feat: Grundstruktur mit Tab-Navigation
This commit is contained in:
37
index.html
Normal file
37
index.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Farbhelfer</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Farbhelfer</h1>
|
||||
<nav>
|
||||
<button class="tab-btn active" data-tab="picker">Picker</button>
|
||||
<button class="tab-btn" data-tab="eingabe">Eingabe</button>
|
||||
<button class="tab-btn" data-tab="harmonien">Harmonien</button>
|
||||
<button class="tab-btn" data-tab="sammlung">Sammlung</button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="tab-picker" class="tab-content active">
|
||||
<p>Picker kommt hier</p>
|
||||
</section>
|
||||
<section id="tab-eingabe" class="tab-content">
|
||||
<p>Eingabe kommt hier</p>
|
||||
</section>
|
||||
<section id="tab-harmonien" class="tab-content">
|
||||
<p>Harmonien kommen hier</p>
|
||||
</section>
|
||||
<section id="tab-sammlung" class="tab-content">
|
||||
<p>Sammlung kommt hier</p>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script type="module" src="js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
19
js/app.js
Normal file
19
js/app.js
Normal 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');
|
||||
});
|
||||
});
|
||||
88
style.css
Normal file
88
style.css
Normal file
@@ -0,0 +1,88 @@
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
font-family: system-ui, sans-serif;
|
||||
background: #f5f5f5;
|
||||
color: #222;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
header {
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 1rem 1.5rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
header h1 { font-size: 1.2rem; margin-bottom: 0.75rem; }
|
||||
|
||||
nav { display: flex; gap: 0.5rem; }
|
||||
|
||||
.tab-btn {
|
||||
padding: 0.4rem 1rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.tab-btn.active {
|
||||
background: #222;
|
||||
color: #fff;
|
||||
border-color: #222;
|
||||
}
|
||||
|
||||
main { padding: 1.5rem; max-width: 900px; margin: 0 auto; }
|
||||
|
||||
.tab-content { display: none; }
|
||||
.tab-content.active { display: block; }
|
||||
|
||||
.color-preview {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #ddd;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.color-codes {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.color-code-group { display: flex; flex-direction: column; gap: 0.25rem; }
|
||||
.color-code-group label { font-size: 0.75rem; color: #666; text-transform: uppercase; }
|
||||
.color-code-group input {
|
||||
padding: 0.4rem 0.6rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 6px;
|
||||
font-family: monospace;
|
||||
font-size: 0.9rem;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
button.action-btn {
|
||||
padding: 0.4rem 0.9rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
button.action-btn:hover { background: #f0f0f0; }
|
||||
|
||||
.swatch {
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ddd;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
Reference in New Issue
Block a user