-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwellness.html
More file actions
82 lines (67 loc) · 1.81 KB
/
wellness.html
File metadata and controls
82 lines (67 loc) · 1.81 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Wellness Tracking</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>HealthMed Insight</h1>
<p>Wellness Tracking Module</p>
</header>
<div class="card">
<h3>Sleep Hours (per night)</h3>
<input
type="range"
min="0"
max="12"
value="6"
id="sleep"
oninput="updateSleep(this.value)"
>
<p>
<strong>Sleep Duration:</strong>
<span id="sleepValue">6</span> hrs
</p>
<h3>Exercise Today</h3>
<select id="exercise">
<option value="">Select</option>
<option>Yes</option>
<option>No</option>
</select>
<h3>Mental Health Status</h3>
<select id="mental">
<option value="">Select</option>
<option>Good</option>
<option>Stressed</option>
<option>Need Support</option>
</select>
<h3>Patient Feedback</h3>
<textarea id="wellnessText" placeholder="How are you feeling today?"></textarea>
<button onclick="saveWellness()">Save Wellness Data</button>
</div>
<script>
// Update sleep text live
function updateSleep(val) {
document.getElementById("sleepValue").innerText = val;
}
// Save wellness data
function saveWellness() {
const sleep = document.getElementById("sleep").value;
const exercise = document.getElementById("exercise").value;
const mental = document.getElementById("mental").value;
const feedback = document.getElementById("wellnessText").value;
if (!exercise || !mental) {
alert("Please complete all wellness fields");
return;
}
localStorage.setItem("sleep", sleep);
localStorage.setItem("exercise", exercise);
localStorage.setItem("mental", mental);
localStorage.setItem("wellness_feedback", feedback);
alert("Wellness data saved successfully!");
}
</script>
</body>
</html>