Feat: lots of improvements
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user