Skip to content

Commit 76ca820

Browse files
committed
Merge branch 'dev'
2 parents 3146f27 + 6acfdb9 commit 76ca820

5 files changed

Lines changed: 248 additions & 15 deletions

File tree

website/app/adaptive.css

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
:root {
2+
color-scheme: light;
3+
accent-color: var(--md-primary);
4+
--device-min-tap: 2.75rem;
5+
}
6+
7+
@media (prefers-color-scheme: dark) {
8+
:root {
9+
color-scheme: dark;
10+
}
11+
}
12+
13+
html {
14+
font-size: 100%;
15+
-webkit-text-size-adjust: 100%;
16+
text-size-adjust: 100%;
17+
scrollbar-color: var(--md-outline) var(--md-bg);
18+
}
19+
20+
body {
21+
text-rendering: optimizeLegibility;
22+
}
23+
24+
button,
25+
input,
26+
select,
27+
textarea {
28+
color-scheme: inherit;
29+
font: inherit;
30+
}
31+
32+
::selection {
33+
background: color-mix(in srgb, var(--md-primary) 28%, transparent);
34+
}
35+
36+
:where(a, button, input, select, textarea):focus-visible {
37+
outline: 0.1875rem solid color-mix(in srgb, var(--md-primary) 80%, var(--md-on-surface));
38+
outline-offset: 0.1875rem;
39+
}
40+
41+
@supports not (color: color-mix(in srgb, red, white)) {
42+
:where(a, button, input, select, textarea):focus-visible {
43+
outline-color: var(--md-primary);
44+
}
45+
}
46+
47+
h1,
48+
.sec-head h2,
49+
.stat-num,
50+
.stat-label,
51+
.count-num,
52+
.btn-filled,
53+
.btn-tonal,
54+
.filter-label {
55+
letter-spacing: 0;
56+
}
57+
58+
h1 {
59+
font-size: 2.75rem;
60+
}
61+
62+
.sec-head h2 {
63+
font-size: 1.75rem;
64+
}
65+
66+
.count-num {
67+
font-size: 7rem;
68+
}
69+
70+
@media (max-width: 37.5rem) {
71+
h1 {
72+
font-size: 2.1rem;
73+
}
74+
75+
.sec-head h2 {
76+
font-size: 1.45rem;
77+
}
78+
79+
.count-num {
80+
font-size: 5rem;
81+
}
82+
}
83+
84+
@media (pointer: coarse) {
85+
:where(.btn-filled, .btn-tonal, .chip, .nav-gh, .time-input) {
86+
min-height: var(--device-min-tap);
87+
}
88+
89+
:where(.nav-sponsor, .header-sponsor, .header-back, .time-reset) {
90+
min-width: var(--device-min-tap);
91+
min-height: var(--device-min-tap);
92+
}
93+
}
94+
95+
@media (hover: none) {
96+
.nav-sponsor:hover,
97+
.card-link:hover,
98+
.room-card:hover,
99+
.header-sponsor:hover {
100+
transform: none;
101+
}
102+
}
103+
104+
@media (prefers-reduced-motion: reduce) {
105+
html {
106+
scroll-behavior: auto;
107+
}
108+
109+
*,
110+
*::before,
111+
*::after {
112+
animation-delay: 0ms !important;
113+
animation-duration: 1ms !important;
114+
animation-iteration-count: 1 !important;
115+
scroll-behavior: auto !important;
116+
transition-duration: 1ms !important;
117+
}
118+
}
119+
120+
@media (prefers-contrast: more) {
121+
:root {
122+
--md-outline: #2E3138;
123+
--md-outline-variant: #61656F;
124+
--md-shadow-1: none;
125+
--md-shadow-2: none;
126+
}
127+
128+
:where(.card, .summary-card, .room-card, .info-card, .schedule-card, .status-card, .install-panel) {
129+
border: 1px solid var(--md-outline);
130+
}
131+
132+
:where(.btn-filled, .btn-tonal, .chip, .badge, .time-input, .time-custom-badge) {
133+
border: 1px solid currentColor;
134+
}
135+
}
136+
137+
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
138+
:root {
139+
--md-outline: #DEE3EA;
140+
--md-outline-variant: #AAB0BA;
141+
}
142+
}
143+
144+
@media (forced-colors: active) {
145+
:root {
146+
color-scheme: light dark;
147+
--md-primary: Highlight;
148+
--md-on-primary: HighlightText;
149+
--md-primary-container: Highlight;
150+
--md-on-primary-container: HighlightText;
151+
--md-secondary: ButtonText;
152+
--md-on-secondary: ButtonFace;
153+
--md-secondary-container: ButtonFace;
154+
--md-on-secondary-container: ButtonText;
155+
--md-tertiary: Highlight;
156+
--md-on-tertiary: HighlightText;
157+
--md-tertiary-container: Highlight;
158+
--md-on-tertiary-container: HighlightText;
159+
--md-error: Highlight;
160+
--md-on-error: HighlightText;
161+
--md-error-container: Highlight;
162+
--md-on-error-container: HighlightText;
163+
--md-surface: Canvas;
164+
--md-surface-variant: Canvas;
165+
--md-on-surface: CanvasText;
166+
--md-on-surface-variant: CanvasText;
167+
--md-outline: CanvasText;
168+
--md-outline-variant: CanvasText;
169+
--md-bg: Canvas;
170+
--md-surface-1: Canvas;
171+
--sponsor: LinkText;
172+
--sponsor-container: Canvas;
173+
--md-shadow-1: none;
174+
--md-shadow-2: none;
175+
}
176+
177+
:where(.card, .summary-card, .room-card, .info-card, .schedule-card, .status-card, .install-panel) {
178+
border: 1px solid CanvasText;
179+
}
180+
181+
:where(.btn-filled, .chip.active, .badge-free, .badge-allday, .status-card.free) {
182+
background: Highlight;
183+
border-color: Highlight;
184+
color: HighlightText;
185+
forced-color-adjust: none;
186+
}
187+
188+
:where(.btn-tonal, .chip, .time-input, .time-custom-badge) {
189+
background: ButtonFace;
190+
border-color: ButtonText;
191+
color: ButtonText;
192+
}
193+
194+
a {
195+
color: LinkText;
196+
}
197+
}

website/app/adaptive.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(() => {
2+
const themeColor = document.querySelector('meta[name="theme-color"]:not([media])');
3+
const darkQuery = window.matchMedia('(prefers-color-scheme: dark)');
4+
5+
function syncThemeColor() {
6+
if (!themeColor) return;
7+
themeColor.setAttribute('content', darkQuery.matches ? '#111318' : '#FDFCFF');
8+
}
9+
10+
syncThemeColor();
11+
12+
if (typeof darkQuery.addEventListener === 'function') {
13+
darkQuery.addEventListener('change', syncThemeColor);
14+
} else if (typeof darkQuery.addListener === 'function') {
15+
darkQuery.addListener(syncThemeColor);
16+
}
17+
})();

website/app/index.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<title>THD Room Finder</title>
77
<meta name="description" content="Find free study rooms at THD Deggendorf in real time. No login required.">
88
<meta name="application-name" content="THD Room Finder">
9-
<meta name="theme-color" content="#1565C0">
9+
<meta name="color-scheme" content="light dark">
10+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#FDFCFF">
11+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111318">
12+
<meta name="theme-color" content="#FDFCFF">
1013
<meta name="mobile-web-app-capable" content="yes">
1114
<meta name="apple-mobile-web-app-capable" content="yes">
1215
<meta name="apple-mobile-web-app-status-bar-style" content="default">
@@ -196,7 +199,7 @@
196199
font-size: 0.875rem;
197200
font-weight: 500;
198201
font-family: var(--md-font);
199-
letter-spacing: 0.00625rem;
202+
letter-spacing: 0;
200203
cursor: pointer;
201204
transition: box-shadow 0.15s;
202205
-webkit-tap-highlight-color: transparent;
@@ -215,7 +218,7 @@
215218
font-size: 0.875rem;
216219
font-weight: 500;
217220
font-family: var(--md-font);
218-
letter-spacing: 0.00625rem;
221+
letter-spacing: 0;
219222
cursor: pointer;
220223
transition: box-shadow 0.15s;
221224
-webkit-tap-highlight-color: transparent;
@@ -308,9 +311,9 @@
308311
}
309312
.home-count { text-align: center; }
310313
.count-num {
311-
font-size: clamp(4.5rem, 22vw, 8rem);
314+
font-size: 7rem;
312315
font-weight: 300;
313-
letter-spacing: -0.02em;
316+
letter-spacing: 0;
314317
line-height: 1;
315318
color: var(--md-primary);
316319
}
@@ -346,7 +349,7 @@
346349
font-size: 0.75rem;
347350
font-weight: 500;
348351
color: var(--md-on-surface-variant);
349-
letter-spacing: 0.05em;
352+
letter-spacing: 0;
350353
padding: 0 1rem 0.4rem;
351354
text-transform: uppercase;
352355
}
@@ -572,7 +575,13 @@
572575
padding: 0.15rem 0.5rem;
573576
border-radius: var(--md-radius-s);
574577
}
578+
579+
@media (max-width: 600px) {
580+
.count-num { font-size: 5rem; }
581+
}
575582
</style>
583+
<link rel="stylesheet" href="adaptive.css">
584+
<script defer src="adaptive.js"></script>
576585
</head>
577586
<body>
578587
<header id="header">

website/app/sw.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
const VERSION = 'thd-v4';
1+
const VERSION = 'thd-v6';
22
const SHELL_CACHE = `${VERSION}-shell`;
33
const RUNTIME_CACHE = `${VERSION}-runtime`;
44
const SHELL = [
55
'/',
66
'/index.html',
77
'/manifest.json',
8+
'/adaptive.css',
9+
'/adaptive.js',
810
'/api.js',
911
'/logic.js',
1012
'/app.js',

website/index.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<link rel="icon" href="app/icons/icon.svg" type="image/svg+xml">
1717
<link rel="icon" href="app/icons/icon-192.png" sizes="192x192" type="image/png">
1818
<link rel="apple-touch-icon" sizes="180x180" href="app/icons/icon-180.png">
19+
<meta name="color-scheme" content="light dark">
20+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#FDFCFF">
21+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111318">
22+
<meta name="theme-color" content="#FDFCFF">
1923
<style>
2024
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
2125

@@ -167,9 +171,9 @@
167171
}
168172

169173
h1 {
170-
font-size: clamp(1.9rem, 5vw, 2.75rem);
174+
font-size: 2.75rem;
171175
font-weight: 400;
172-
letter-spacing: -0.01em;
176+
letter-spacing: 0;
173177
line-height: 1.15;
174178
margin-bottom: 1rem;
175179
color: var(--md-on-surface);
@@ -195,7 +199,7 @@
195199
.stat-num {
196200
font-size: 1.5rem;
197201
font-weight: 400;
198-
letter-spacing: -0.01em;
202+
letter-spacing: 0;
199203
color: var(--md-primary);
200204
line-height: 1;
201205
}
@@ -205,7 +209,7 @@
205209
margin-top: 0.3rem;
206210
font-weight: 500;
207211
text-transform: uppercase;
208-
letter-spacing: 0.05em;
212+
letter-spacing: 0;
209213
}
210214

211215
/* ── CTAs ─────────────────────────────────── */
@@ -226,7 +230,7 @@
226230
font-size: 0.875rem;
227231
font-weight: 500;
228232
font-family: var(--md-font);
229-
letter-spacing: 0.00625rem;
233+
letter-spacing: 0;
230234
padding: 0.625rem 1.5rem;
231235
border-radius: var(--md-radius-xl);
232236
text-decoration: none;
@@ -243,7 +247,7 @@
243247
font-size: 0.875rem;
244248
font-weight: 500;
245249
font-family: var(--md-font);
246-
letter-spacing: 0.00625rem;
250+
letter-spacing: 0;
247251
padding: 0.625rem 1.5rem;
248252
border-radius: var(--md-radius-xl);
249253
text-decoration: none;
@@ -271,9 +275,9 @@
271275
}
272276
.sec-head { text-align: center; margin-bottom: 2.5rem; }
273277
.sec-head h2 {
274-
font-size: clamp(1.3rem, 3vw, 1.75rem);
278+
font-size: 1.75rem;
275279
font-weight: 400;
276-
letter-spacing: -0.01em;
280+
letter-spacing: 0;
277281
margin-bottom: 0.4rem;
278282
color: var(--md-on-surface);
279283
}
@@ -349,11 +353,15 @@
349353
.features { padding: 3rem 1.25rem 4rem; }
350354
.grid-4 { grid-template-columns: 1fr 1fr; }
351355
.stat-row { gap: 1.5rem; }
356+
h1 { font-size: 2.1rem; }
357+
.sec-head h2 { font-size: 1.45rem; }
352358
}
353359
@media (max-width: 420px) {
354360
.grid-4 { grid-template-columns: 1fr; }
355361
}
356362
</style>
363+
<link rel="stylesheet" href="app/adaptive.css">
364+
<script defer src="app/adaptive.js"></script>
357365
</head>
358366
<body>
359367

0 commit comments

Comments
 (0)