Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
703 lines (617 loc) · 15.7 KB
/
Copy pathstyles.css
File metadata and controls
703 lines (617 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
:root {
--bg: #f4f4f6;
--card-bg: #ffffff;
--ink: #1c1c1e;
--muted: #595960;
--weekday-bg: #ececf0;
--weekend-bg: #f8f8fa;
--weekday-fg: #5b5b60;
--line: rgba(0, 0, 0, 0.1);
--chip-bg: #e9e9ec;
--p1-color: #a3cf8f;
--p2-color: #f7dd86;
--outside-opacity: 0.7;
/* Fallbacks for the very first paint before app.js's applyInkVars() runs;
match the defaults above (both light pastels), and are immediately
overwritten (and kept in sync with whatever the color wells pick) by
app.js — see inkFor()/applyInkVars(). */
--p1-ink: #1c1c1e;
--p1-ink-on: #ffffff;
--p2-ink: #1c1c1e;
--p2-ink-on: #ffffff;
--danger: #d70015;
color-scheme: light dark;
/* 4px spacing scale — every gap/padding below snaps to one of these. */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
/* Type scale — five steps, no ad-hoc sizes in between. */
--font-xs: 12px;
--font-sm: 14px;
--font-md: 16px;
--font-lg: 20px;
--font-xl: 28px;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #0b0b0d;
--card-bg: #1c1c1e;
--ink: #f2f2f7;
--muted: #9a9aa0;
--weekday-bg: #101012;
--weekend-bg: #17171a;
--weekday-fg: #9a9aa0;
--line: rgba(255, 255, 255, 0.14);
--chip-bg: #2c2c2e;
--danger: #ff453a;
}
.calendar-card {
box-shadow: none;
border: 1px solid var(--line);
}
}
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
}
input,
textarea {
-webkit-user-select: text;
user-select: text;
-webkit-touch-callout: default;
}
html, body {
height: 100%;
margin: 0;
background: var(--bg);
font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, sans-serif;
overscroll-behavior: none;
color: var(--ink);
}
.app {
min-height: 100dvh;
display: flex;
flex-direction: column;
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-3) var(--space-4);
touch-action: manipulation;
}
.month-nav {
display: flex;
gap: var(--space-4);
}
.topbar-end {
display: flex;
gap: var(--space-3);
}
.icon-btn {
appearance: none;
-webkit-appearance: none;
border: none;
background: none;
padding: var(--space-2);
min-width: 44px;
min-height: 44px;
line-height: 1;
color: var(--ink);
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10px;
}
.icon-btn.active {
background: var(--ink);
color: var(--bg);
border: 1px solid var(--ink);
}
.icon-btn:disabled,
.today-btn:disabled {
opacity: 0.3;
pointer-events: none;
}
.hint {
margin: 0 0 var(--space-2);
padding: var(--space-2) var(--space-3);
background: var(--chip-bg);
color: var(--ink);
font-size: var(--font-xs);
text-align: center;
border-radius: 10px;
}
.notes-hint-dismiss {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: var(--space-2);
background: none;
border: none;
appearance: none;
-webkit-appearance: none;
font-family: inherit;
font-size: var(--font-xs);
font-weight: 600;
text-decoration: underline;
color: var(--ink);
padding: var(--space-2) var(--space-3);
min-height: 44px;
}
.icon-btn:active,
.brush-btn:active {
background: var(--chip-bg);
transform: scale(0.96);
}
/* No `transform` here (unlike .icon-btn/.brush-btn above): a day-cell press
can be the start of a paint drag, and elementFromPoint()-based hit-testing
in app.js relies on cells staying exactly where they're laid out. */
.day-cell:active {
filter: brightness(0.94);
}
.icon-btn:focus-visible,
.brush-btn:focus-visible,
.day-cell:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.settings-form input:focus-visible,
.text-btn:focus-visible,
.notes-hint-dismiss:focus-visible,
.today-btn:focus-visible {
outline: 2px solid var(--ink);
outline-offset: 2px;
}
.icon-btn svg {
width: 22px;
height: 22px;
display: block;
}
main {
flex: 1;
display: flex;
flex-direction: column;
padding: 0 var(--space-4);
}
.calendar-viewport {
position: relative;
overflow: hidden;
touch-action: pan-y;
}
.calendar-card {
background: var(--card-bg);
border-radius: 18px;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.calendar-card--peek {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.month-title {
text-align: center;
font-size: var(--font-xl);
font-weight: 800;
letter-spacing: 0.5px;
margin: 0;
padding: var(--space-4) 0 var(--space-3);
}
/* "Heute" pill: jumps back to the month containing today. Disabled (and
visually faded, like .icon-btn:disabled) while that month is already
displayed, so it never renders as a no-op tap target. */
.today-btn {
appearance: none;
-webkit-appearance: none;
border: none;
background: var(--chip-bg);
color: var(--ink);
font-family: inherit;
font-size: var(--font-sm);
font-weight: 600;
padding: var(--space-2) var(--space-3);
min-height: 44px;
border-radius: 999px;
cursor: pointer;
}
.weekday-row {
display: grid;
grid-template-columns: repeat(7, 1fr);
background: var(--weekday-bg);
}
.weekday-row span {
text-align: center;
color: var(--weekday-fg);
font-weight: 700;
font-size: var(--font-xs);
padding: var(--space-2) 0;
letter-spacing: 0.5px;
}
.day-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
}
/* Paint mode drags can move in any direction across cells, including ones
the browser would otherwise claim for native scrolling/zooming — turn
those off entirely while it's active so our own pointer tracking wins. */
.day-grid.paint-mode {
touch-action: none;
}
.day-cell {
position: relative;
aspect-ratio: 0.82;
border: 0.5px solid var(--line);
background: var(--card-bg);
display: block;
padding: 0;
margin: 0;
min-width: 0;
appearance: none;
-webkit-appearance: none;
font: inherit;
touch-action: manipulation;
}
.note-dot {
position: absolute;
bottom: var(--space-1);
right: var(--space-1);
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--ink);
box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
z-index: 3;
}
.day-cell .num {
position: absolute;
top: var(--space-1);
left: var(--space-1);
width: 24px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--font-sm);
font-weight: 600;
color: var(--ink);
z-index: 2;
}
/* Grid fills (.p1/.p2/.both) come from a free-choice color well (any hex),
so their ink/dot can't follow one hardcoded constant: it also must not
follow the global --ink, which flips with the color scheme independently
of the (unrelated) fill color. Each owner's ink (--p1-ink/--p2-ink) is
picked in app.js (inkFor()) to whichever of near-black/near-white
contrasts best against that owner's actual chosen fill. .both cells split
diagonally: .num sits over the overlay triangle (--cell-second-ink),
.note-dot over the base fill (--cell-first-ink) — see applyOwnerVisual(). */
.day-cell.p1 .num {
color: var(--p1-ink);
}
.day-cell.p2 .num {
color: var(--p2-ink);
}
.day-cell.both .num {
color: var(--cell-second-ink, var(--p1-ink));
}
.day-cell.p1 .note-dot {
background: var(--p1-ink);
}
.day-cell.p2 .note-dot {
background: var(--p2-ink);
}
.day-cell.both .note-dot {
background: var(--cell-first-ink, var(--p2-ink));
}
/* Non-color cue for who owns a day (WCAG 1.4.1) — the owner's initial(s),
painted opposite the note-dot so both can coexist without overlapping. */
.owner-mark {
position: absolute;
bottom: var(--space-1);
left: var(--space-1);
font-size: 9px;
font-weight: 700;
line-height: 1;
letter-spacing: 0.02em;
z-index: 2;
pointer-events: none;
}
.day-cell.p1 .owner-mark {
color: var(--p1-ink);
}
.day-cell.p2 .owner-mark {
color: var(--p2-ink);
}
.day-cell.both .owner-mark {
color: var(--cell-first-ink, var(--p2-ink));
}
.day-cell.outside {
opacity: var(--outside-opacity);
}
/* Weekend columns (Sat/Sun) recede slightly when unpainted; owner fills
(.p1/.p2/.both) still take precedence since they set their own background. */
.day-grid > :nth-child(7n-1),
.day-grid > :nth-child(7n) {
background: var(--weekend-bg);
}
/* Today's date number gets a filled ring so it can be spotted without
counting cells; sits on the number only, never the cell background. */
.day-cell.today .num {
border-radius: 999px;
background: var(--ink);
color: var(--card-bg);
}
.day-cell.p1.today .num {
background: var(--p1-ink);
color: var(--p1-ink-on);
}
.day-cell.p2.today .num {
background: var(--p2-ink);
color: var(--p2-ink-on);
}
.day-cell.both.today .num {
background: var(--cell-second-ink, var(--p1-ink));
color: var(--cell-second-ink-on, var(--p1-ink-on));
}
.day-cell.p1 {
background: var(--p1-color);
}
.day-cell.p2 {
background: var(--p2-color);
}
.day-cell.both {
background: var(--cell-first, var(--p2-color));
}
.day-cell.both::after {
content: "";
position: absolute;
inset: 0;
background: var(--cell-second, var(--p1-color));
clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.handover-row {
display: flex;
justify-content: center;
padding: var(--space-3) 0 0;
}
.stats-row {
display: flex;
gap: var(--space-2);
justify-content: center;
padding: var(--space-3) 0 var(--space-1);
}
.stat-chip {
display: flex;
align-items: center;
gap: var(--space-1);
font-size: var(--font-sm);
font-weight: 600;
color: var(--muted);
white-space: nowrap;
}
/* The handover line is the app's headline answer ("who has the kids next");
the counts below it are a secondary footnote. Promote it so it doesn't
read as just another muted chip. */
#handoverRow .stat-chip {
font-size: var(--font-md);
color: var(--ink);
}
/* #handoverRow and #handoverPlaceholder are mutually exclusive (exactly one
is shown at a time) but share the same box model, so whichever one is
visible reserves the same height — the stats row below never shifts
depending on whether a handover currently exists. */
#handoverPlaceholder .stat-chip {
font-size: var(--font-md);
}
.stat-chip .dot {
width: 8px;
height: 8px;
border-radius: 50%;
display: inline-block;
}
.brush-bar {
display: flex;
padding: var(--space-4);
padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
justify-content: center;
position: sticky;
bottom: 0;
background: var(--bg);
z-index: 1;
}
.brush-group {
display: flex;
gap: var(--space-3);
}
.brush-btn {
appearance: none;
-webkit-appearance: none;
display: flex;
align-items: center;
gap: var(--space-2);
border: 2px solid transparent;
background: transparent;
border-radius: 14px;
padding: var(--space-2) var(--space-4);
font-size: var(--font-md);
font-weight: 600;
color: var(--ink);
font-family: inherit;
}
.brush-btn[aria-checked="true"] {
border-color: var(--ink);
}
.brush-btn .dot {
width: 14px;
height: 14px;
border-radius: 50%;
display: inline-block;
}
.settings-dialog {
border: none;
border-radius: 18px;
padding: 0;
width: min(340px, 90vw);
background: var(--card-bg);
color: var(--ink);
}
.settings-dialog::backdrop {
background: rgba(0, 0, 0, 0.35);
}
.settings-form {
padding: var(--space-4);
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.settings-form h2 {
margin: 0;
font-size: var(--font-lg);
}
.settings-form label {
display: flex;
flex-direction: column;
gap: var(--space-1);
font-size: var(--font-sm);
color: var(--muted);
}
.person-group {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.group-label {
font-size: var(--font-xs);
font-weight: 700;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.4px;
}
.settings-form input[type="text"] {
padding: var(--space-2) var(--space-3);
border-radius: 10px;
border: 1px solid var(--line);
font-size: var(--font-md);
background: var(--card-bg);
color: var(--ink);
}
.settings-form input[type="color"] {
width: 100%;
height: 40px;
border: none;
border-radius: 10px;
padding: 0;
}
.settings-hint {
margin: 0;
font-size: var(--font-xs);
color: var(--muted);
line-height: 1.4;
}
.settings-actions {
display: flex;
gap: var(--space-2);
}
/* Speichern comes first in the markup so pressing Enter in the note field
submits it (browsers implicit-submit the first submit button in DOM
order) — `order` puts Löschen back on the left visually. */
.settings-actions .secondary-btn {
flex: 1;
order: 1;
}
.settings-actions .primary-btn {
flex: 1;
order: 2;
margin-top: 0;
}
.primary-btn,
.secondary-btn {
appearance: none;
-webkit-appearance: none;
border: none;
border-radius: 12px;
padding: var(--space-3);
font-size: var(--font-md);
font-weight: 600;
font-family: inherit;
}
.primary-btn {
margin-top: var(--space-2);
background: var(--ink);
color: var(--card-bg);
}
.secondary-btn {
background: var(--chip-bg);
color: var(--ink);
}
/* De-emphasised destructive action: a plain text button, not a full-width
button competing visually with Speichern/Abbrechen. */
.text-btn {
display: block;
width: 100%;
margin-top: var(--space-3);
background: none;
border: none;
appearance: none;
-webkit-appearance: none;
font-family: inherit;
font-size: var(--font-sm);
padding: var(--space-2);
}
.text-btn[hidden] {
display: none;
}
.danger-btn {
color: var(--danger);
}
/* This is a phone calendar; the grid/chrome is designed for a tall, narrow
layout and has no landscape variant. Since neither iOS Safari nor the web
app manifest support actually locking screen orientation, fake it: render
<html> as if the viewport were still portrait-shaped, then rotate that box
back onto the real (landscape) viewport so the app keeps its normal layout
instead of reflowing into a broken wide/short one. Only handles rotating
the phone one way (the far more common one, e.g. mute switch ending up on
top); rotating the other way leaves the app upside down rather than
reflowed, which is the accepted tradeoff of this CSS-only technique.
Gated on (hover: none) and (pointer: coarse), not just orientation, so it
only ever applies on an actual touchscreen phone -- a desktop/laptop
browser window that happens to be wider than tall (landscape by the same
media-feature test) must never get its <html> rotated.
Placed at the very end of the file (rather than near .app's own rule) so
its overrides of later, equal-specificity rules like .brush-bar's
position:sticky reliably win the cascade regardless of where in the file
those original rules happen to live. */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
html {
position: fixed;
top: 100%;
left: 0;
width: 100vh;
height: 100vw;
transform: rotate(-90deg);
transform-origin: left top;
overflow-x: hidden;
}
/* 100dvh always resolves against the real (landscape) viewport, not
against html's rotated portrait-shaped box above, so .app would only
fill a fraction of it — pin it to html's own (now correct) height instead. */
.app {
min-height: 100%;
}
/* position: sticky's "stick to the bottom of the scrollport" is computed
against the real (landscape) viewport too, not html's rotated box, so
the brush bar sticks to a point that no longer matches its actual
flex-column position — visually overlapping the content above it
instead of sitting below it. Falling back to its normal flow position
is the safe option; nothing on this single screen's worth of content
actually needs it pinned while rotated. */
.brush-bar {
position: static;
}
}