source: Klonkt/src/assets/css/ward.css@ 39dab6b

Last change on this file since 39dab6b was 39dab6b, checked in by Robin <roboburr@…>, 3 months ago

Ward-PWA: de mini-speler, de themakleur en een breder kaartraster

Drie dingen in een ronde.

DE THEMAKLEUR (SkyPalette). De acht presets en de luminantie-regel komen
LETTERLIJK uit Shaer: dezelfde kleuren, en dezelfde beslissing welke
tekst erop leesbaar is (donker op zon, wit op nacht). Een handgehouden
lijstje zou uit de pas lopen; luminantie beslist. De keuze kleurt het
accent (knoppen, bubbels, de (+)), tint de achtergrond zacht, en laat de
hemel zijn placeholder-schijfjes bijkleuren. Opgeslagen per apparaat.

DE MINI-SPELER. Een feed-kaart rendert een gewone audio, maar de feed
wordt bij elke verversing opnieuw getekend en dan sterft dat element:
de muziek stopt midden in een nummer. Daarom is er EEN blijvende speler
buiten de feed; een audiotegel geeft alleen zijn bron door (gevangen in
de capture-fase) en pauzeert zichzelf. Zo overleeft het geluid een
herteken en een wissel naar de hemel, precies als in de app.

HET KAARTRASTER (Robins wens, 12-8). Op desktop net als op mobiel en
tablet MEER kolommen: auto-fill met een minimum van 280px vult zelf op,
een op een smalle telefoon, twee op een tablet, drie of meer breed.

New file:
src/assets/js/ward-theme.js

  • presets, onSky (luminantie), load/save/apply

Changed files:
src/assets/js/ward.js

  • wireTheme (swatches), wireMiniPlayer (gedeelde audio)
  • de hemel skint bij op een themawissel

src/assets/js/ward-sky.js

  • buildAtlas neemt het accent; reskin() bij een kleurwissel

src/views/pages/ward.ejs

  • themaknop, themadialoog, mini-speler-balk

src/assets/css/ward.css

  • accent/achtergrond als variabelen, mini-speler, swatches, responsief raster (auto-fill minmax 280px)

src/services/i18n.js

  • kleur + play/pause in nl, en, de

test/ward-theme.test.js

  • acht presets, en de tekstkleur volgt luminantie

remarks: 905 tests groen. Slepen en het echt doorspelen van audio zijn
in code getest, niet met oor en vinger; dat is aan Robin op dev.

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

  • Property mode set to 100644
File size: 14.2 KB
Line 
1/* De Ward PWA: rustig, groot genoeg voor een kind, donker als de rest. */
2:root {
3 --bg: #141a24;
4 --card: #1c2431;
5 --ink: #eef2f8;
6 --dim: #9aa7bb;
7 --accent: #5a32e6;
8 --on-accent: #ffffff;
9 --bg-top: #1a2233;
10 --bg-bottom: #0d1017;
11 --alarm: #ef9f27;
12 --ok: #46c26a;
13}
14* { box-sizing: border-box; }
15/* Het hidden-attribuut wint ALTIJD. Zonder deze regel verslaat elke eigen
16 display-regel (zoals de flex van #thread) de browser-default display:none,
17 en dan staat een 'verborgen' overlay gewoon over de pagina heen. Dat was
18 precies de vastzittende gespreks-overlay van 12-8. */
19[hidden] { display: none !important; }
20body {
21 margin: 0; padding: 16px calc(16px + env(safe-area-inset-right)) 32px calc(16px + env(safe-area-inset-left));
22 background: linear-gradient(var(--bg-top), var(--bg-bottom)) fixed, var(--bg);
23 color: var(--ink);
24 font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
25}
26h1 { font-size: 1.4rem; margin: 8px 0 20px; }
27h2 { font-size: 1rem; margin: 24px 0 10px; color: var(--dim); font-weight: 600; }
28
29/* De hulpknop is het belangrijkste element op deze pagina en ziet er ook zo
30 uit: vol breed, grote raakzone, geen concurrentie eromheen. */
31.help button {
32 width: 100%; padding: 18px; border: 0; border-radius: 14px;
33 background: var(--accent); color: var(--on-accent); font-size: 1.1rem; font-weight: 600;
34}
35.help button:disabled { background: #3a3f4d; color: var(--dim); }
36.help .hint { margin: 8px 2px 0; color: var(--dim); font-size: .85rem; }
37
38.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
39.card { background: var(--card); border-radius: 12px; padding: 12px 14px; }
40.row { display: flex; align-items: center; gap: 10px; }
41.name { font-weight: 600; margin: 0; }
42.hint { color: var(--dim); font-size: .85rem; margin: 6px 0 0; }
43.empty { color: var(--dim); }
44
45.chip { margin-left: auto; font-size: .75rem; padding: 3px 9px; border-radius: 999px; background: #2a3342; color: var(--dim); }
46.chip.ok { background: rgba(70,194,106,.16); color: var(--ok); }
47.chip.away { background: rgba(239,159,39,.16); color: var(--alarm); }
48
49/* Misvormd krijgt de alarmkleur, onbereikbaar bewust NIET: niet-weten is geen
50 misconfiguratie. Maar het is ook geen goedkeuring, dus het staat er wel. */
51.note { margin: 8px 0 0; font-size: .85rem; padding: 6px 9px; border-radius: 8px; }
52.note.alarm { background: rgba(239,159,39,.16); color: var(--alarm); }
53.note.unknown { background: rgba(154,167,187,.14); color: var(--dim); }
54
55/* ── De feed ──────────────────────────────────────────────────────────── */
56.post { background: var(--card); border-radius: 12px; padding: 12px 14px; border: 2px solid transparent; }
57.post .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
58.post .when { margin-left: auto; color: var(--dim); font-size: .8rem; }
59.post .cw { color: var(--alarm); font-size: .85rem; margin: 6px 0 0; }
60.post .body { margin-top: 8px; overflow-wrap: anywhere; }
61.post .body img, .post .body video { max-width: 100%; height: auto; border-radius: 8px; }
62/* Waar de boei zou landen. Zichtbaar oplichten, want mikken met een vinger
63 zonder terugkoppeling is gokken. */
64.post.hover { border-color: var(--accent); }
65
66/* ── De reddingsboei ──────────────────────────────────────────────────── */
67#buoy {
68 position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
69 width: 76px; height: 76px; border: 0; border-radius: 50%;
70 background: transparent; font-size: 52px; line-height: 1;
71 /* Zonder dit vecht slepen met scrollen en verlies je hem halverwege. */
72 touch-action: none; cursor: grab; z-index: 50;
73}
74#buoy.dragging { cursor: grabbing; transform: scale(1.1); }
75
76dialog#help-dialog {
77 border: 0; border-radius: 16px; padding: 18px; max-width: 420px; width: calc(100% - 32px);
78 background: var(--card); color: var(--ink);
79}
80dialog#help-dialog::backdrop { background: rgba(0,0,0,.5); }
81dialog#help-dialog h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--ink); }
82dialog#help-dialog label { display: block; color: var(--dim); font-size: .85rem; margin-bottom: 4px; }
83dialog#help-dialog textarea {
84 width: 100%; border-radius: 10px; border: 1px solid #2a3342;
85 background: #131a25; color: var(--ink); padding: 8px; font: inherit;
86}
87dialog#help-dialog menu { display: flex; gap: 8px; justify-content: flex-end; margin: 14px 0 0; padding: 0; }
88dialog#help-dialog button { border: 0; border-radius: 10px; padding: 10px 14px; background: #2a3342; color: var(--ink); font: inherit; }
89dialog#help-dialog button.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
90
91/* Voor schermlezers, niet voor het oog. */
92.sr-only {
93 position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
94 overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
95}
96
97/* ── De hemel ─────────────────────────────────────────────────────────── */
98/* Ligt achter alles en draait altijd. In kaartenstand is hij decor; in
99 berichtenstand vallen de kaarten weg en is hij de interface. */
100#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
101#app { position: relative; z-index: 1; }
102.topbar { display: flex; align-items: center; gap: 12px; }
103.topbar h1 { margin: 8px 0 20px; }
104.topbar #mode {
105 margin-left: auto; border: 0; border-radius: 999px; padding: 8px 16px;
106 background: #2a3342; color: var(--ink); font: inherit;
107}
108/* De kaarten vallen weg, de hemel blijft: dezelfde beweging als in de app. */
109body.messages-mode .help, body.messages-mode .cards { display: none; }
110
111/* ── De zwaai-hand ────────────────────────────────────────────────────── */
112/* Zelfde hoek als de boei; ze wisselen elkaar af met de stand. */
113#hand {
114 position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
115 width: 76px; height: 76px; border: 0; border-radius: 50%;
116 background: transparent; font-size: 52px; line-height: 1;
117 touch-action: none; cursor: grab; z-index: 50;
118}
119#hand.dragging { cursor: grabbing; transform: scale(1.1); }
120
121/* ── Het gesprek over de hemel ────────────────────────────────────────── */
122#thread {
123 position: fixed; inset: 0; z-index: 40;
124 display: flex; flex-direction: column;
125 /* Doorschijnend: de hemel eronder blijft zichtbaar draaien, net als de
126 glazen bubbels in de app. */
127 background: rgba(20, 26, 36, .72); backdrop-filter: blur(14px);
128}
129#thread header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
130#thread header h2 { margin: 0; font-size: 1.05rem; }
131#thread-close { border: 0; background: #2a3342; color: var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 1rem; }
132#thread-list { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
133.bubble { max-width: 78%; padding: 10px 12px; border-radius: 14px; background: var(--card); }
134.bubble.out { align-self: flex-end; background: var(--accent); }
135.bubble.wave { font-size: 1.4rem; }
136.bubble .when { display: block; margin-top: 4px; font-size: .7rem; color: rgba(255,255,255,.55); }
137.bubble .body img { max-width: 100%; border-radius: 8px; }
138#thread-form { display: flex; gap: 8px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
139#thread-form input {
140 flex: 1; border-radius: 999px; border: 1px solid #2a3342;
141 background: #131a25; color: var(--ink); padding: 10px 16px; font: inherit;
142}
143#thread-form button { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; }
144
145/* ── Het zwaai-paneel ─────────────────────────────────────────────────── */
146dialog#wave-dialog {
147 border: 0; border-radius: 16px; padding: 18px; max-width: 320px; width: calc(100% - 48px);
148 background: var(--card); color: var(--ink); text-align: center;
149}
150dialog#wave-dialog::backdrop { background: rgba(0,0,0,.4); }
151dialog#wave-dialog h2 { margin: 0 0 12px; font-size: 1.05rem; }
152.wave-answers { display: grid; gap: 8px; }
153.wave-answers button { border: 0; border-radius: 10px; padding: 12px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; }
154#wave-cancel { margin-top: 10px; border: 0; background: none; color: var(--dim); font: inherit; }
155
156/* ── De vriendenkiezer achter de (+) ──────────────────────────────────── */
157dialog#friends-dialog {
158 border: 0; border-radius: 16px; padding: 18px; max-width: 380px; width: calc(100% - 48px);
159 max-height: 70vh; overflow-y: auto;
160 background: var(--card); color: var(--ink);
161}
162dialog#friends-dialog::backdrop { background: rgba(0,0,0,.4); }
163dialog#friends-dialog h2 { margin: 0 0 12px; font-size: 1.05rem; }
164.friend button.row {
165 width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
166 border: 0; background: none; color: var(--ink); padding: 4px 2px; font: inherit; cursor: pointer;
167}
168.friend .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
169.friend .wie { display: flex; flex-direction: column; }
170#friends-cancel { margin-top: 12px; border: 0; background: none; color: var(--dim); font: inherit; }
171
172/* ── De composer ──────────────────────────────────────────────────────── */
173.feed-head { display: flex; align-items: center; gap: 12px; }
174.feed-head h2 { margin: 24px 0 10px; }
175#compose-open { margin-left: auto; border: 0; border-radius: 999px; padding: 8px 16px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; }
176
177dialog#compose-dialog {
178 border: 0; border-radius: 16px; padding: 16px; max-width: 480px; width: calc(100% - 32px);
179 background: var(--card); color: var(--ink);
180}
181dialog#compose-dialog::backdrop { background: rgba(0,0,0,.5); }
182.compose-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
183.compose-head #compose-cancel { border: 0; background: #2a3342; color: var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 1rem; }
184.compose-head #compose-vis { flex: 1; border-radius: 10px; border: 1px solid #2a3342; background: #131a25; color: var(--ink); padding: 8px; font: inherit; }
185.compose-head .primary { border: 0; border-radius: 10px; padding: 8px 16px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; }
186.compose-head .primary:disabled { background: #3a3f4d; color: var(--dim); }
187#compose-text { width: 100%; border-radius: 12px; border: 1px solid #2a3342; background: #131a25; color: var(--ink); padding: 10px; font: inherit; resize: vertical; }
188.compose-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
189.media-chip { position: relative; display: flex; align-items: center; gap: 6px; background: #131a25; border-radius: 10px; padding: 6px 8px; }
190.media-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
191.media-chip .kind { font-size: 1.2rem; }
192.media-chip .name { font-size: .8rem; color: var(--dim); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
193.media-chip .drop { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #000; color: #fff; font-size: .75rem; line-height: 1; }
194.compose-tools { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
195.compose-tools .tool { font-size: 1.4rem; cursor: pointer; padding: 4px 8px; border-radius: 10px; background: #131a25; }
196.compose-tools .hint { margin-left: auto; }
197
198/* ── Het kaartraster: meer kolommen naarmate er ruimte is ─────────────── */
199/* Robins wens (12-8): op desktop net als op mobiel en tablet MEERDERE
200 kolommen. auto-fill met een minimum vult zelf op: één kolom op een smalle
201 telefoon, twee op een tablet, drie of meer op een breed scherm. */
202.cards {
203 display: grid;
204 grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
205 gap: 12px;
206 align-items: start;
207}
208
209/* ── De mini-speler ───────────────────────────────────────────────────── */
210#mini-player {
211 position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
212 z-index: 45; display: flex; align-items: center; gap: 10px;
213 padding: 8px 12px; border-radius: 14px;
214 background: var(--card); box-shadow: 0 6px 24px rgba(0,0,0,.4);
215 max-width: 520px; margin: 0 auto;
216}
217#mini-player #mini-toggle { border: 0; border-radius: 50%; width: 40px; height: 40px; background: var(--accent); color: var(--on-accent); font-size: 1rem; }
218#mini-player #mini-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
219#mini-player #mini-close { border: 0; background: none; color: var(--dim); font-size: 1rem; }
220
221/* ── De themakiezer ───────────────────────────────────────────────────── */
222.icon-btn { border: 0; background: #2a3342; border-radius: 999px; width: 38px; height: 38px; font-size: 1.1rem; }
223dialog#theme-dialog {
224 border: 0; border-radius: 16px; padding: 18px; max-width: 320px; width: calc(100% - 48px);
225 background: var(--card); color: var(--ink); text-align: center;
226}
227dialog#theme-dialog::backdrop { background: rgba(0,0,0,.4); }
228dialog#theme-dialog h2 { margin: 0 0 14px; font-size: 1.05rem; }
229.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
230.swatch { width: 100%; aspect-ratio: 1; border: 3px solid transparent; border-radius: 50%; cursor: pointer; }
231.swatch.chosen { border-color: var(--ink); }
232#theme-close { margin-top: 14px; border: 0; background: none; color: var(--dim); font: inherit; }
Note: See TracBrowser for help on using the repository browser.