forked from sophtsai/CMSC434Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotesEntry.html
110 lines (97 loc) · 3.28 KB
/
notesEntry.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="styles.css" />
<title>Health App</title>
</head>
<body>
<!--=============== HEADER ===============-->
<header class="header" id="header">
<nav class="nav container">
<a href="logSelection.html">
<img src="Assets/arrow-back-pink.png" width="60px" />
</a>
<img src="Assets/chevron-left-purple.png" />
<h1 class="data-date">Nov 1, 2023</h1>
<img src="Assets/chevron-right-purple.png" />
<div class="nav-menu" id="nav-menu">
<ul class="nav-list">
<li class="nav-item">
<a href="tips.html" class="nav-link">
<img src="Assets/tips-pink.png" />
<span class="nav-name">Tips</span>
</a>
</li>
<li class="nav-item">
<a href="exercise.html" class="nav-link">
<img src="Assets/exercise-pink.png" />
<span class="nav-name">Exercise</span>
</a>
</li>
<li class="nav-item">
<a href="index.html" class="nav-link active-link">
<img src="Assets/calendar-pink.png" />
<span class="nav-name">Calendar</span>
</a>
</li>
<li class="nav-item">
<a href="goals.html" class="nav-link">
<img src="Assets/goals-pink.png" />
<span class="nav-name">Goals</span>
</a>
</li>
<li class="nav-item">
<a href="profile.html" class="nav-link">
<img src="Assets/profile-pink.png" />
<span class="nav-name">Profile</span>
</a>
</li>
</ul>
</div>
<img src="Assets/strawberries.png" alt="" class="nav-img" />
</nav>
</header>
<!--======= DATA ENTRY CONTENT =======-->
<main class="content">
<h2 class="entry-title">Notes</h2>
<div class="entry-note">
<textarea
class="notes-box"
id="notes-input"
style="font-size: 25px"></textarea>
<img
src="Assets/keyboard.png"
alt="keyboard"
id="keyboard"
class="keyboardImg" />
</div>
<a href="logSelection.html">
<button class="data-entry-btn" id="notes-save">Save</button>
</a>
</main>
<script>
// Store weight input
const notesInput = document.getElementById("notes-input");
const notesSaveButton = document.getElementById("notes-save");
notesSaveButton.addEventListener("click", function () {
const notesValue = notesInput.value;
if (notesValue.trim() !== "") {
// Store the input data in localStorage
localStorage.setItem("storedNotes", notesValue);
} else {
localStorage.setItem("storedNotes", "");
}
});
window.onbeforeunload = function () {
const notesValue = notesInput.value;
if (notesValue.trim() !== "") {
localStorage.setItem("storedNotes", notesValue);
} else {
localStorage.setItem("storedNotes", "");
}
};
</script>
</body>
</html>