-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (38 loc) · 1.19 KB
/
index.html
File metadata and controls
40 lines (38 loc) · 1.19 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<title>Responsive Fullscreen Animated Sticky</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<img src="PyPro-v2.jpg" class="banner" />
<a href="#" class="logo">HackClub</a>
<div class="toggle"></div>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Join us</a></li>
</ul>
</nav>
</header>
<script>
window.addEventListener('scroll', function () {
const header = document.querySelector('header');
header.classList.toggle('sticky', window.scrollY > 0);
});
const navigation = document.querySelector('nav');
document.querySelector('.toggle').onclick = function () {
console.log('clicked');
this.classList.toggle('active');
navigation.classList.toggle('active');
};
</script>
</body>
</html>