-
Notifications
You must be signed in to change notification settings - Fork 0
/
insights.html
51 lines (48 loc) · 1.61 KB
/
insights.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Insights - Mindfulness Journal</title>
</head>
<body>
<header>
<h1>Mindfulness Journal</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="journal.html">Journal</a></li>
</ul>
</nav>
</header>
<main>
<h2>Insights</h2>
<ul class="insights-list" id="insightsList">
<!-- Insights will be dynamically added here -->
</ul>
</main>
<footer>
<p>© 2023 Mindfulness Journal App</p>
</footer>
<script>
const insightsList = document.getElementById("insightsList");
// Clear existing entries
insightsList.innerHTML = "";
// Get entries from localStorage
const entries = JSON.parse(localStorage.getItem("journalEntries")) || [];
// Loop through entries and create list items
entries.forEach((entry) => {
const listItem = document.createElement("li");
listItem.innerHTML = `
<p><strong>Thoughts:</strong> ${entry.thoughts}</p>
<p><strong>Mood:</strong> ${entry.mood}</p>
<p><strong>Activities:</strong> ${entry.activities}</p>
<p class="timestamp"><strong>Timestamp:</strong> ${entry.timestamp}</p>
`;
insightsList.appendChild(listItem);
});
</script>
</body>
</html>