-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.html
More file actions
97 lines (81 loc) · 2.09 KB
/
header.html
File metadata and controls
97 lines (81 loc) · 2.09 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Colombo HCI Lab</title>
<style>
.hamburger {
display: none;
font-size: 28px;
cursor: pointer;
}
.navbar {
display: block;
}
@media (max-width: 768px) {
.hamburger {
display: block;
}
.navbar {
display: none;
}
.navbar.open {
display: block;
}
.nav-menu {
flex-direction: column;
align-items: center;
gap: 10px;
}
}
.nav-menu {
list-style: none;
display: flex;
gap: 20px;
}
.nav-item a {
text-decoration: none;
}
</style>
</head>
<body>
<!-- Header -->
<header class="main-header">
<a href="/index.html" class="logo">
<img src="/images/logo.png" alt="Colombo HCI Lab Logo" />
</a>
<div class="header-content">
<div class="header-text">
<h1>Colombo HCI Lab</h1>
</div>
<!-- Hamburger icon (mobile only) -->
<div class="hamburger" onclick="toggleNav()">☰</div>
<!-- Navigation Menu -->
<nav class="navbar" id="mainNav">
<ul class="nav-menu">
<li class="nav-item"><a href="/" class="nav-link">Home</a></li>
<li class="nav-item"><a href="/Research/" class="nav-link">Research</a></li>
<li class="nav-item"><a href="/Team/" class="nav-link">Team</a></li>
<li class="nav-item"><a href="/Contact/" class="nav-link">Contact</a></li>
</ul>
</nav>
</div>
</header>
<!-- JS to toggle menu -->
<script>
function toggleNav() {
var nav = document.getElementById("mainNav");
nav.classList.toggle("open");
}
// Optional: Close nav when clicking outside
window.addEventListener("click", function(event) {
const nav = document.getElementById("mainNav");
const hamburger = document.querySelector(".hamburger");
if (!nav.contains(event.target) && !hamburger.contains(event.target)) {
nav.classList.remove("open");
}
});
</script>
</body>
</html>