feat: Grundstruktur mit Tab-Navigation

This commit is contained in:
Ferdinand
2026-04-01 16:09:36 +02:00
parent 1097b2a5e6
commit 331a7ed706
3 changed files with 144 additions and 0 deletions

19
js/app.js Normal file
View File

@@ -0,0 +1,19 @@
// Globaler State — aktive Farbe als { h, s, l } (HSL, 0-360, 0-100, 0-100)
export const state = {
color: { h: 200, s: 60, l: 50 },
setColor(hsl) {
this.color = hsl;
document.dispatchEvent(new CustomEvent('colorChanged', { detail: hsl }));
}
};
// Tab-Navigation
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.addEventListener('click', () => {
const tab = btn.dataset.tab;
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(s => s.classList.remove('active'));
btn.classList.add('active');
document.getElementById('tab-' + tab).classList.add('active');
});
});