forked from MIbrahim-Nasir/LifeHack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
103 lines (97 loc) · 3.31 KB
/
home.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Health Companion - Home</title>
<link rel="stylesheet" href="style.css">
<style>
.module-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
padding: 20px;
}
.module-button {
width: 200px;
height: 200px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 10px;
font-size: 18px;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
text-decoration: none;
}
.module-button:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.module-button i {
font-size: 48px;
margin-bottom: 10px;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<div class="header-controls">
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
<em>Dark Mode</em>
</div>
<button id="logoutButton" onclick="logout()" class="logout-button">Logout</button>
</div>
<main>
<h1>AI Health Companion</h1>
<div id="userProfile"></div>
<div class="module-container">
<a href="index.html" class="module-button">
<i class="fas fa-box"></i>
Product Analysis
</a>
<a href="food_analysis.html" class="module-button">
<i class="fas fa-utensils"></i>
Food Analysis
</a>
<a href="emergency.html" class="module-button">
<i class="fas fa-ambulance"></i>
Emergency
</a>
</div>
</main>
<script src="profile.js"></script>
<script>
window.onload = function() {
displayUserProfile();
}
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
toggleSwitch.addEventListener('change', switchTheme, false);
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark') {
toggleSwitch.checked = true;
}
}
</script>
</body>
</html>