-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
128 lines (104 loc) · 3.68 KB
/
index.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="box/style.css">
<link href='https://unpkg.com/boxicons@2.1.1/css/boxicons.min.css' rel='stylesheet'>
<link rel="icon" type="" href="image/homecare.png">
<title>HomeCare</title>
</head>
<body>
<nav>
<div class="nav-bar">
<i class='bx bx-menu sidebarOpen'></i>
<span class="logo navLogo"><a href="index.html"><img src="image/logolurus.png" width="55%"></a></span>
<div class="menu">
<div class="logo-toggle">
<i class='bx bx-x siderbarClose'></i>
</div>
</div>
<div class="darkLight-searchBox">
<div class="dark-light">
<i class='bx bx-moon moon'></i>
<i class='bx bx-sun sun'></i>
</div>
<div class="searchBox">
<div class="searchToggle">
<i class='bx bx-x cancel'></i>
<i class='bx bx-search search'></i>
</div>
<div class="search-field">
<input type="text" placeholder="Search...">
<i class='bx bx-search'></i>
</div>
</div>
</div>
<div class="buttons">
<a href="login.html"><input type="button" value="Daftar"></a>
</div>
</div>
</nav>
<!--isi-->
<img class="hospital" src="image/home.png" alt="" width="100%">
<div class="container">
<div class="box">
<a href="login.html"><img src="image/tanya.jpg" alt="Gambar 1"></a>
<h3><a href="login.html"><button class="tombol">Tanya Dokter</button></h3></a>
</div>
<div class="box">
<a href="login.html"><img src="image/temu.jpg" alt="Gambar 2"></a>
<h3><a href="login.html"><button class="tombol">Temu Dokter</button></h3></a>
</div>
<div class="box">
<a href="login.html"><img src="image/layanan.jpg" alt="Gambar 3">
<h3><a href="login.html"><button class="tombol">Layanan Medis</button></h3>
</a>
</div>
<div class="box">
<a href="login.html"><img src="image/penyakit.jpg" alt="Gambar 4">
<h3><a href="login.html"><button class="tombol">Info penyakit</button></h3>
</a>
</div>
<div class="box">
<a href="login.html"><img src="image/obat.jpg" alt="Gambar 5">
<h3><a href="login.html"><button class="tombol">Info Obat</button></h3>
</a>
</div>
</div>
<script>
const body = document.querySelector("body"),
nav = document.querySelector("nav"),
modeToggle = document.querySelector(".dark-light"),
searchToggle = document.querySelector(".searchToggle"),
sidebarOpen = document.querySelector(".sidebarOpen"),
siderbarClose = document.querySelector(".siderbarClose");
let getMode = localStorage.getItem("mode");
if (getMode && getMode === "dark-mode") {
body.classList.add("dark");
}
modeToggle.addEventListener("click", () => {
modeToggle.classList.toggle("active");
body.classList.toggle("dark");
if (!body.classList.contains("dark")) {
localStorage.setItem("mode", "light-mode");
} else {
localStorage.setItem("mode", "dark-mode");
}
});
searchToggle.addEventListener("click", () => {
searchToggle.classList.toggle("active");
});
sidebarOpen.addEventListener("click", () => {
nav.classList.add("active");
});
body.addEventListener("click", e => {
let clickedElm = e.target;
if (!clickedElm.classList.contains("sidebarOpen") && !clickedElm.classList.contains("menu")) {
nav.classList.remove("active");
}
});
</script>
</body>
</html>