Update index.html

This commit is contained in:
Ark
2026-01-14 00:39:29 +00:00
parent 183f81b0e3
commit 2fc6ebe5ce

View File

@@ -1 +1,36 @@
if you are seeing this, the hosting app is working. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Dark Mode Test</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<h1>Dark Mode Test</h1>
<p>This is a simple dual-file dark mode website.</p>
<button id="toggle">Toggle Dark Mode</button>
</div>
<script>
const toggle = document.getElementById("toggle");
// Load saved theme
if (localStorage.getItem("theme") === "dark") {
document.body.classList.add("dark");
}
toggle.addEventListener("click", () => {
document.body.classList.toggle("dark");
// Save theme
if (document.body.classList.contains("dark")) {
localStorage.setItem("theme", "dark");
} else {
localStorage.setItem("theme", "light");
}
});
</script>
</body>
</html>