-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (55 loc) · 1.71 KB
/
index.html
File metadata and controls
61 lines (55 loc) · 1.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Campus Lost and Found</title>
<link rel="stylesheet" href="stylelost.css" />
</head>
<body>
<header>
<div class="logo">
<img src="Campus Logo.png" alt="Campus Lost and Found Logo">
</div>
<div class="logo">🧭 Campus Lost & Found</div>
<h1>Campus Lost & Found</h1>
<nav>
<a href="submit.html">Submit Item</a>
<a href="listings.html">View Listings</a>
</nav>
</header>
<main class="home-main">
<section class="intro">
<h2>Lost Something? Found Something?</h2>
<p>This platform helps students submit or view lost & found items easily and safely.</p>
<a class="cta-button" href="submit.html">Report Now</a>
</section>
</main>
<button id="backToTop">⬆ Back to Top</button>
<script>
const toggleBtn = document.getElementById("darkModeToggle");
const body = document.body;
// Load mode from localStorage
if (localStorage.getItem("dark-mode") === "true") {
body.classList.add("dark");
toggleBtn.textContent = "☀ Light Mode";
}
toggleBtn.addEventListener("click", () => {
body.classList.toggle("dark");
const darkMode = body.classList.contains("dark");
localStorage.setItem("dark-mode", darkMode);
toggleBtn.textContent = darkMode ? "☀ Light Mode" : "🌙 Dark Mode";
});
</script>
<script>
// Back to top button
const btn = document.getElementById("backToTop");
window.onscroll = () => {
btn.style.display = window.scrollY > 300 ? "block" : "none";
};
btn.onclick = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};
</script>
</body>
</html>