Light Modus eingefügt
This commit is contained in:
parent
80da3247a1
commit
17fe296d21
8 changed files with 75 additions and 1 deletions
|
|
@ -15,6 +15,20 @@
|
||||||
--border: #1f2a44;
|
--border: #1f2a44;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Light Mode */
|
||||||
|
.light-mode {
|
||||||
|
--bg: #f8fafc;
|
||||||
|
--surface: #ffffff;
|
||||||
|
--surface-light: #e2e8f0;
|
||||||
|
|
||||||
|
--primary: #16a34a;
|
||||||
|
--accent: #2563eb;
|
||||||
|
|
||||||
|
--text: #1e293b;
|
||||||
|
--muted: #64748b;
|
||||||
|
|
||||||
|
--border: #cbd5e1;
|
||||||
|
}
|
||||||
/* =========================
|
/* =========================
|
||||||
GLOBAL RESET
|
GLOBAL RESET
|
||||||
========================= */
|
========================= */
|
||||||
|
|
@ -70,6 +84,15 @@ nav a:hover {
|
||||||
color: #0b1220;
|
color: #0b1220;
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
}
|
}
|
||||||
|
/* =========================
|
||||||
|
Bottom light Version
|
||||||
|
========================= */
|
||||||
|
.theme-switch-container {
|
||||||
|
position: fixed;
|
||||||
|
top: 80px;
|
||||||
|
right: 20px;
|
||||||
|
z-index: 1100;
|
||||||
|
}
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
MAIN LAYOUT
|
MAIN LAYOUT
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>Sneaky Snack Snakes</h1>
|
<h1>Sneaky Snack Snakes</h1>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main class="impressum">
|
<main class="impressum">
|
||||||
|
|
||||||
<h1>Impressum</h1>
|
<h1>Impressum</h1>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>Sneaky Snack Snakes</h1>
|
<h1>Sneaky Snack Snakes</h1>
|
||||||
<img src="img/Sneaky_Snack_Snakes.png" alt="Sneaky Snack Snakes">
|
<img src="img/Sneaky_Snack_Snakes.png" alt="Sneaky Snack Snakes">
|
||||||
|
|
|
||||||
26
js/script.js
26
js/script.js
|
|
@ -70,4 +70,28 @@ function startNotenrechner() {
|
||||||
|
|
||||||
ausgabe.textContent =
|
ausgabe.textContent =
|
||||||
`${punkte} von ${max} Punkten (${prozent} %) = ${berechneNote(prozent)}`;
|
`${punkte} von ${max} Punkten (${prozent} %) = ${berechneNote(prozent)}`;
|
||||||
}
|
}
|
||||||
|
// Light-/Dark-Mode
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
const themeButton = document.getElementById("theme-toggle");
|
||||||
|
|
||||||
|
if (!themeButton) return;
|
||||||
|
|
||||||
|
if (localStorage.getItem("theme") === "light") {
|
||||||
|
document.body.classList.add("light-mode");
|
||||||
|
themeButton.textContent = "🌙 Dark Mode";
|
||||||
|
}
|
||||||
|
|
||||||
|
themeButton.addEventListener("click", () => {
|
||||||
|
document.body.classList.toggle("light-mode");
|
||||||
|
|
||||||
|
if (document.body.classList.contains("light-mode")) {
|
||||||
|
localStorage.setItem("theme", "light");
|
||||||
|
themeButton.textContent = "🌙 Dark Mode";
|
||||||
|
} else {
|
||||||
|
localStorage.setItem("theme", "dark");
|
||||||
|
themeButton.textContent = "☀️ Light Mode";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -13,6 +13,11 @@
|
||||||
<a href="impressum.html">Impressum</a>
|
<a href="impressum.html">Impressum</a>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>Sneaky Snack Snakes</h1>
|
<h1>Sneaky Snack Snakes</h1>
|
||||||
<p>Hier wird demnächst ein Kontaktformular eingefügt</p>
|
<p>Hier wird demnächst ein Kontaktformular eingefügt</p>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@
|
||||||
<a href="impressum.html">Impressum</a>
|
<a href="impressum.html">Impressum</a>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<section id="notenrechner">
|
<section id="notenrechner">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@
|
||||||
<a href="impressum.html">Impressum</a>
|
<a href="impressum.html">Impressum</a>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="theme-switch-container">
|
||||||
|
<button id="theme-toggle">☀️ Light Mode</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>Über uns</h1>
|
<h1>Über uns</h1>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue