Feat: lots of improvements

This commit is contained in:
2026-02-08 13:52:40 +01:00
parent 2c1765effa
commit f6132bdd70
34 changed files with 333 additions and 123 deletions

View File

@@ -1,21 +1,3 @@
const toggle = document.getElementById('theme-toggle');
const root = document.documentElement;
const stored = localStorage.getItem('theme');
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const isLight = stored ? stored === 'light' : !prefersDark;
if (isLight) {
root.classList.add('light');
}
toggle.textContent = isLight ? 'DARK' : 'LIGHT';
toggle.addEventListener('click', () => {
root.classList.toggle('light');
const light = root.classList.contains('light');
toggle.textContent = light ? 'DARK' : 'LIGHT';
localStorage.setItem('theme', light ? 'light' : 'dark');
});
document.querySelectorAll('.example-cell').forEach(cell => {
cell.addEventListener('click', () => {
const video = cell.querySelector('video');
@@ -45,6 +27,10 @@ document.querySelectorAll('.feature-tags button').forEach(btn => {
});
});
document.getElementById('kofi-close').addEventListener('click', () => {
document.getElementById('kofi-popup').style.display = 'none';
});
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
document.querySelectorAll('.example-cell.expanded').forEach(c => {