-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsleep.php
505 lines (404 loc) · 13.3 KB
/
sleep.php
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<?php
session_start(); // Start the session
// Check if the user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php"); // Redirect to login page if not logged in
exit();
}
// Get the current page name
$current_page = basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleep Statistics</title>
<style>
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to right, #616cbb, #748ac7);
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
}
/* Header Styles */
.header {
width: 100%;
max-width: 1200px;
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #4C57A7;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
color: white;
border-radius: 10px;
}
.header img {
max-width: 100px;
}
.date-time {
font-size: 16px;
font-weight: bold;
color: white;
margin-top: 5px; /* Added margin to move it down a bit */
}
.logout-settings-container {
display: flex;
align-items: center;
gap: 15px;
}
.logout-button {
padding: 10px 20px;
background-color: white;
color: #4C57A7;
border: 1px solid #4C57A7;
border-radius: 5px;
cursor: pointer;
}
.logout-button:hover {
background-color: #E2E8F0;
}
/* Button Styling */
.settings-button {
background: none;
border: none;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
width: 50px; /* Increased width */
height: 50px; /* Increased height */
padding: 12px; /* Adjusted padding for better proportions */
border-radius: 50%;
transition: background-color 0.3s ease;
background-color: white;
}
/* Hover Effect for the Button */
.settings-button:hover {
background-color: rgba(0, 0, 0, 0.1);
}
/* Fullscreen overlay */
.settings-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: none;
justify-content: space-between; /* Divides left and right sections */
padding: 20px;
z-index: 1000;
color: white;
}
/* Settings Menu (Left Section) */
.settings-menu {
flex: 1; /* Left section takes 30% */
max-width: 20%; /* Optional: Restrict max width */
/*background: linear-gradient(to left, #748ac7, #4C57A7);*/
background: linear-gradient(to right, #616cbb, #748ac7);
padding: 30px;
border-radius: 10px;
font-size: 24px;
box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.5);
}
.settings-menu h2 {
color: #D1D9F1;
margin-top: 0;
font-weight: bold;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.settings-menu ul {
list-style: none;
padding: 0;
margin: 0;
}
.settings-menu li {
margin-bottom: 15px;
}
.settings-menu a {
text-decoration: none;
color: #E2E8F0;
font-size: 20px;
padding: 5px;
transition: color 0.3s, background-color 0.3s;
border-radius: 5px;
}
.settings-menu a:hover {
color: #2C3E99;
background-color: #D1D9F1;
}
/* Team Section */
.team-section {
flex: 2;
background: linear-gradient(to right, #616cbb, #748ac7);
padding: 20px;
border-radius: 10px;
box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.5);
color: #ffffff;
overflow-y: auto;
display: grid; /* Use grid to align team members */
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Create responsive grid */
gap: 20px; /* Space between the team members */
}
.team-section h1 {
font-size: 52px;
margin-bottom: 100px;
color: white;
font-family: 'Yatra One', cursive;
}
.team-member {
transition: transform 0.3s ease-in-out;
text-decoration: none;
color: inherit;
background: white;
padding: 20px;
border-radius: 10px;
position: relative;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.team-member:hover {
transform: scale(1.05);
}
.team-member img {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 50%;
}
.team-member h3 {
color: #4C57A7;
font-size: 26px;
margin-top: 20px;
}
.team-member p {
color: #4C57A7;
font-size: 14px;
}
/* Close Button */
.close-settings {
background: none;
border: none;
font-size: 18px;
color: #E2E8F0;
cursor: pointer;
margin-bottom: 20px;
border-radius: 5px;
transition: color 0.3s, background-color 0.3s;
}
.close-settings:hover {
color: #2C3E99;
background-color: #D1D9F1;
}
/* Navigation Bar Styles */
.nav-container {
margin: 20px 0;
padding: 10px 0;
}
.nav-menu {
list-style: none;
padding: 0;
margin: 0;
display: flex;
gap: 15px;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
justify-content: center;
}
.nav-link {
text-decoration: none;
color: #fff;
font-size: 18px;
padding: 10px 15px;
border-radius: 5px;
transition: background-color 0.3s, color 0.3s;
}
.nav-link:hover, .nav-link.active {
background-color: #D1D9F1;
color: #2C3E99;
}
/* Footer Styles */
.footer {
font-size: 14px;
text-align: center;
margin-top: auto;
}
footer hr {
border: 0;
border-top: 1px solid white;
margin-bottom: 10px;
}
/* Media Queries */
@media (max-width: 768px) {
.header {
flex-direction: column;
align-items: flex-start;
}
.header img {
max-width: 80px;
}
.settings-overlay {
flex-direction: column; /* Stack the settings and about sections */
gap: 20px;
}
.team-section {
grid-template-columns: repeat(2, 1fr); /* Two items per row on larger screens */
}
.settings-menu, .about-us {
max-width: 100%; /* Use full width for smaller screens */
flex: none;
}
.bar-chart {
height: 150px; /* Adjust chart height */
}
.nav-link {
font-size: 16px;
padding: 8px 10px;
}
}
/* Active overlay display */
.settings-overlay.active {
display: flex; /* Flex layout is only applied when active */
}
</style>
</head>
<body>
<!-- Header -->
<div class="header">
<img src="images/sleep.png" alt="Sleep Med Logo">
<div class="date-time" id="currentDateTime"></div>
<div class="logout-settings-container">
<button id="logout-btn" class="logout-button">Logout</button>
<button id="settings-btn" class="settings-button">⋮</button>
</div>
</div>
<script>
// Update the date and time dynamically
function updateDateTime() {
const date = new Date();
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit' };
const formattedDateTime = date.toLocaleString('en-US', options);
document.getElementById('currentDateTime').textContent = formattedDateTime;
}
setInterval(updateDateTime, 1000);
updateDateTime();
</script>
<div class="settings-overlay" id="settings-overlay">
<!-- Settings Menu -->
<div class="settings-menu">
<button class="close-settings" id="close-settings">Close ✕</button>
<h2>Settings</h2>
<ul>
<li><a href="#">Switch Account</a></li>
<li><a href="#">Delete Account</a></li>
<li><a href="#">Language</a></li>
<li><a href="#">Support</a></li>
<li><a href="app-information.php">App Information</a></li>
</ul>
</div>
<!-- Team Section -->
<div class="team-section">
<h1>Our Team</h1>
<!-- Team Member 1 -->
<a href="https://github.com/safrinfaizz" target="_blank" class="team-member">
<div>
<img src="../../images/safreena.jpg" alt="Safreena">
</div>
<h3>Safreena</h3>
<p>Front-End Developer</p>
<p>"As a health informatics student interested in building websites and working with data, I contributed to the Sleep Monitor project by developing the front-end. For me, front-end development is where creativity and technology meet to solve problems and inspire users."</p>
</a>
<!-- Team Member 2 -->
<a href="https://github.com/SenaDok" target="_blank" class="team-member">
<div>
<img src="../../images/sena.jpg" alt="Sena">
</div>
<h3>Sena</h3>
<p>Front-End Developer</p>
<p>“A healthy body holds a healthy mind and soul, and that's what we should strive to have and share”</p>
</a>
<!-- Team Member 3 -->
<a href="https://github.com/AngelinaNSS" target="_blank" class="team-member">
<div>
<img src="../../images/angelina.jpg" alt="Angelina">
</div>
<h3>Angelina</h3>
<p>Front-End Developer</p>
<p>"I’m a health informatics student with a passion for using tech to improve healthcare. With this Sleep Monitor project, I aim to help people track and improve their sleep, especially for those working late shifts, so they can feel better and perform their best."</p>
</a>
<!-- Team Member 4 -->
<a href="https://github.com/kseniiavi" target="_blank" class="team-member">
<div>
<img src="../../images/kseniia.jpg" alt="Kseniia">
</div>
<h3>Kseniia</h3>
<p>Back-End Developer</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Est quaerat tempora.</p>
</a>
<!-- Team Member 5 -->
<a href="https://github.com/Maryem29" target="_blank" class="team-member">
<div>
<img src="../../images/maryem.jpg" alt="Maryem">
</div>
<h3>Maryem</h3>
<p>Back-End Developer</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Est quaerat tempora.</p>
</a>
</div>
</div>
<script>
const settingsBtn = document.getElementById("settings-btn");
const settingsOverlay = document.getElementById("settings-overlay");
const closeSettings = document.getElementById("close-settings");
// Open settings overlay
settingsBtn.addEventListener("click", () => {
settingsOverlay.classList.add("active");
});
// Close settings overlay
closeSettings.addEventListener("click", () => {
settingsOverlay.classList.remove("active");
});
// Optional: Close overlay when clicking outside the settings panel
settingsOverlay.addEventListener("click", (e) => {
if (e.target === settingsOverlay) {
settingsOverlay.classList.remove("active");
}
});
</script>
<!-- Navigation -->
<div class="nav-container">
<ul class="nav-menu">
<li><a href="statistics.php" class="nav-link <?= $current_page === 'statistics.php' ? 'active' : ''; ?>">Statistics</a></li>
<li><a href="report.php" class="nav-link <?= $current_page === 'report.php' ? 'active' : ''; ?>">Report</a></li>
<li><a href="sleep.php" class="nav-link <?= $current_page === 'sleep.php' ? 'active' : ''; ?>">Sleep</a></li>
<li><a href="alerts.php" class="nav-link <?= $current_page === 'alerts.php' ? 'active' : ''; ?>">Alerts</a></li>
<li><a href="profile.php" class="nav-link <?= $current_page === 'profile.php' ? 'active' : ''; ?>">Profile</a></li>
</ul>
</div>
<!-- Footer -->
<footer>
<hr>
<p>Created by: Kseniia, Maryem, Sena, Saffree, Angelina - Sleep Med </p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Handle logout
document.getElementById("logout-btn").addEventListener("click", function () {
if (confirm("Are you sure you want to log out?")) {
window.location.href = "login.php";
}
});
</script>
</body>
</html>