-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
48 lines (46 loc) · 1.39 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
<!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" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<nav>
<a id="logo" href="#">rygenzx</a>
<ul id="list">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
<button id="hamburger">
<svg
xmlns="http://www.w3.org/2000/svg"
width="28"
height="28"
fill="currentColor"
class="bi bi-list"
viewBox="0 0 16 16"
>
<path
fill-rule="evenodd"
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"
/>
</svg>
</button>
</nav>
<script>
const elList = document.getElementById('list');
const elHamburger = document.getElementById('hamburger');
elHamburger.addEventListener('click', () => {
if (elList.classList[0] == undefined) {
elList.classList.add('active');
} else {
elList.classList.remove('active');
}
});
</script>
</body>
</html>