@hadoku/game-ui 0.1.47 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/front/LobbyShell.css +56 -0
- package/dist/front/LobbyShell.d.ts +1 -0
- package/dist/front/LobbyShell.js +6 -1
- package/dist/front/RoomFront.css +663 -0
- package/dist/front/RoomFront.d.ts +26 -16
- package/dist/front/RoomFront.js +10 -14
- package/dist/rooms/feed.d.ts +17 -0
- package/dist/rooms/feed.js +62 -0
- package/dist/rooms/room-core-client.d.ts +69 -0
- package/dist/rooms/room-core-client.js +148 -0
- package/dist/seats/SeatChip.css +256 -0
- package/dist/seats/SeatChip.d.ts +1 -0
- package/dist/seats/SeatChip.js +3 -2
- package/dist/seats/SpectatorRow.js +1 -1
- package/dist/visible.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The front page's room list and its create dialog (`./RoomFront.tsx`): the paint for every class
|
|
3
|
+
* that file draws, so a game gets a finished list by importing the component, not by copying a
|
|
4
|
+
* stylesheet. Theme tokens only (`--color-*`, `--hdk-*`), never a literal colour.
|
|
5
|
+
*
|
|
6
|
+
* The defaults are cardtable's own front page (a grid of tinted symbol cards). Everything a game
|
|
7
|
+
* tunes is a custom property below, set by the game on any ancestor (the dialog portals into
|
|
8
|
+
* `<body>`, so its properties are read from `:root`): bomberman's single column of flat rows is
|
|
9
|
+
* these same rules with its own values. A row's own colours come from the game per row
|
|
10
|
+
* (`RoomFrontRowExtras.vars`): its format's tint, its state's dot.
|
|
11
|
+
*
|
|
12
|
+
* Named hooks, all optional:
|
|
13
|
+
* panel --room-front-bg, -border, -radius, -padding, -gap, -flex, -min-height
|
|
14
|
+
* head --room-front-head-align, -head-gap, -title-size, -title-weight, -title-margin,
|
|
15
|
+
* -actions-align, -actions-gap
|
|
16
|
+
* button --room-front-go-* (the Create buttons, `.room-front__go`)
|
|
17
|
+
* list --room-front-columns, -list-gap, -list-display, -list-direction, -list-overflow,
|
|
18
|
+
* -list-min-height
|
|
19
|
+
* card --room-front-card-bg, -card-border, -card-radius, -card-hover-lift, -card-hover-border,
|
|
20
|
+
* -card-hover-shadow, -card-padding, -card-gap, -card-display, -row-gap, -row-align,
|
|
21
|
+
* -row-wrap, -name-weight, -seats-size, -seats-ink, -state-size, -state-ink,
|
|
22
|
+
* -state-align, -dot-size, -dot, -detail-size, -detail-ink
|
|
23
|
+
* roster --room-front-roster-* (shown, or kept for assistive tech only: the default)
|
|
24
|
+
* enter --room-front-enter-* (Join, Watch, Reset)
|
|
25
|
+
* per row --room-front-tint, --room-front-dot, --room-front-state-ink
|
|
26
|
+
* dialog --room-front-create-* (on `:root`: the dialog is not inside the page)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/* ── the panel ───────────────────────────────────────────────────────── */
|
|
30
|
+
|
|
31
|
+
.rooms {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex: var(--room-front-flex, 0 1 auto);
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: var(--room-front-gap, 14px);
|
|
36
|
+
min-height: var(--room-front-min-height, auto);
|
|
37
|
+
padding: var(--room-front-padding, 20px);
|
|
38
|
+
border: var(--room-front-border, 1px solid var(--color-border));
|
|
39
|
+
border-radius: var(--room-front-radius, 8px);
|
|
40
|
+
background: var(--room-front-bg, var(--color-bg-card));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Title on the left, the actions at the right edge; `wrap` drops them under a long title. */
|
|
44
|
+
.rooms__head {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
align-items: var(--room-front-head-align, baseline);
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
gap: var(--room-front-head-gap, 8px 12px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rooms__title {
|
|
53
|
+
margin: var(--room-front-title-margin, 0);
|
|
54
|
+
font-size: var(--room-front-title-size, 19px);
|
|
55
|
+
font-weight: var(--room-front-title-weight, 600);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Create room, and a game's own actions beside it. */
|
|
59
|
+
.rooms__actions {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: var(--room-front-actions-align, normal);
|
|
62
|
+
gap: var(--room-front-actions-gap, 8px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ── the Create buttons ──────────────────────────────────────────────── */
|
|
66
|
+
|
|
67
|
+
.room-front__go {
|
|
68
|
+
align-self: var(--room-front-go-align, flex-start);
|
|
69
|
+
padding: var(--room-front-go-padding, 10px 18px);
|
|
70
|
+
border: 0;
|
|
71
|
+
border-radius: var(--room-front-go-radius, var(--hdk-radius));
|
|
72
|
+
background: var(--color-primary);
|
|
73
|
+
color: var(--color-on-primary);
|
|
74
|
+
font-size: var(--room-front-go-size, 14px);
|
|
75
|
+
font-weight: var(--room-front-go-weight, 600);
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.room-front__go:hover:not(:disabled),
|
|
80
|
+
.room-front__go:focus-visible:not(:disabled) {
|
|
81
|
+
background: var(--room-front-go-hover-bg, var(--color-primary));
|
|
82
|
+
filter: var(--room-front-go-hover-filter, brightness(1.08));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The focus ring: the theme's own (an outline) unless a game draws a shadow instead. */
|
|
86
|
+
.room-front__go:focus-visible {
|
|
87
|
+
outline-style: var(--room-front-go-focus-outline, solid);
|
|
88
|
+
box-shadow: var(--room-front-go-focus-shadow, none);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* A dead button must look dead: an outline on the page's own fill, unless a game dims it instead. */
|
|
92
|
+
.room-front__go:disabled {
|
|
93
|
+
background: var(--room-front-go-disabled-bg, var(--color-bg-alt));
|
|
94
|
+
color: var(--room-front-go-disabled-ink, var(--color-text-secondary));
|
|
95
|
+
box-shadow: var(--room-front-go-disabled-shadow, inset 0 0 0 1px var(--color-border-light));
|
|
96
|
+
opacity: var(--room-front-go-disabled-opacity, 1);
|
|
97
|
+
cursor: var(--room-front-go-disabled-cursor, not-allowed);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* ── the Testing fold ────────────────────────────────────────────────── */
|
|
101
|
+
|
|
102
|
+
/* The whole title is the button, a chevron before it turned down while open: no button chrome. */
|
|
103
|
+
.rooms__fold {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 6px;
|
|
107
|
+
padding: 0;
|
|
108
|
+
border: 0;
|
|
109
|
+
background: transparent;
|
|
110
|
+
color: inherit;
|
|
111
|
+
font: inherit;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.rooms__fold:hover .rooms__fold-chevron {
|
|
116
|
+
color: var(--color-text);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rooms__fold:focus-visible {
|
|
120
|
+
outline: 2px solid var(--color-primary);
|
|
121
|
+
outline-offset: 3px;
|
|
122
|
+
border-radius: 4px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rooms__fold-chevron {
|
|
126
|
+
flex: none;
|
|
127
|
+
fill: none;
|
|
128
|
+
stroke: currentColor;
|
|
129
|
+
stroke-width: 2;
|
|
130
|
+
stroke-linecap: round;
|
|
131
|
+
stroke-linejoin: round;
|
|
132
|
+
color: var(--color-text-secondary);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.rooms__fold[aria-expanded='true'] .rooms__fold-chevron {
|
|
136
|
+
transform: rotate(90deg);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
140
|
+
.rooms__fold-chevron {
|
|
141
|
+
transition:
|
|
142
|
+
transform 0.12s ease,
|
|
143
|
+
color 0.12s ease;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* ── status lines ────────────────────────────────────────────────────── */
|
|
148
|
+
|
|
149
|
+
/* The skeleton and the list itself (`Reveal`), each laid out as the panel lays out its own. */
|
|
150
|
+
.rooms__layer {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
gap: var(--room-front-gap, 14px);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.rooms__status {
|
|
157
|
+
margin: 0;
|
|
158
|
+
color: var(--room-front-status-ink, var(--color-text-secondary));
|
|
159
|
+
font-size: var(--room-front-status-size, inherit);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.rooms__status--bad {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-wrap: wrap;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: var(--room-front-bad-gap, 10px);
|
|
167
|
+
padding: var(--room-front-bad-padding, 0);
|
|
168
|
+
border-radius: var(--room-front-bad-radius, 0);
|
|
169
|
+
background: var(--room-front-bad-bg, transparent);
|
|
170
|
+
color: var(--room-front-bad-ink, var(--color-warning));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.rooms__status--bad p {
|
|
174
|
+
margin: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.rooms__stale {
|
|
178
|
+
margin: 0;
|
|
179
|
+
color: var(--room-front-stale-ink, var(--color-text-secondary));
|
|
180
|
+
font-size: var(--room-front-stale-size, 13px);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* ── the list ────────────────────────────────────────────────────────── */
|
|
184
|
+
|
|
185
|
+
/*
|
|
186
|
+
* `will-change: transform`: the grid is its own compositor layer, so scrolling the page moves it
|
|
187
|
+
* rather than redrawing every card's gradient each frame (measured in cardtable: headless Firefox
|
|
188
|
+
* 11–12 ms of CPU per scrolled frame at 40 rooms, 6 ms with it). On the list, not the panel: the
|
|
189
|
+
* panel holds the dialog's fixed backdrop and the fixed tip layer, which a transform would re-anchor.
|
|
190
|
+
*/
|
|
191
|
+
.rooms__list {
|
|
192
|
+
display: var(--room-front-list-display, grid);
|
|
193
|
+
flex-direction: var(--room-front-list-direction, row);
|
|
194
|
+
grid-template-columns: var(--room-front-columns, repeat(auto-fill, minmax(320px, 1fr)));
|
|
195
|
+
gap: var(--room-front-list-gap, 12px);
|
|
196
|
+
min-width: var(--room-front-list-min-width, auto);
|
|
197
|
+
min-height: var(--room-front-list-min-height, auto);
|
|
198
|
+
margin: 0;
|
|
199
|
+
padding: 0;
|
|
200
|
+
overflow: var(--room-front-list-overflow, visible);
|
|
201
|
+
list-style: none;
|
|
202
|
+
will-change: transform;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* ── one card ────────────────────────────────────────────────────────── */
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
* Four rows (type/name/seats, mode, state, the way in) over the room's tint and its faint scene.
|
|
209
|
+
* `overflow: hidden` clips the scene; the body is raised above it. The tint is the game's per row
|
|
210
|
+
* (`--room-front-tint`); with none, a neutral wash.
|
|
211
|
+
*/
|
|
212
|
+
.room-card {
|
|
213
|
+
--room-front-tint-default: var(--color-neutral);
|
|
214
|
+
|
|
215
|
+
position: relative;
|
|
216
|
+
display: var(--room-front-card-display, list-item);
|
|
217
|
+
flex-direction: var(--room-front-card-direction, row);
|
|
218
|
+
gap: var(--room-front-card-gap, normal);
|
|
219
|
+
padding: var(--room-front-card-outer-padding, 0);
|
|
220
|
+
overflow: var(--room-front-card-overflow, hidden);
|
|
221
|
+
border: var(--room-front-card-border, 1px solid var(--color-border));
|
|
222
|
+
border-radius: var(--room-front-card-radius, 8px);
|
|
223
|
+
background: var(
|
|
224
|
+
--room-front-card-bg,
|
|
225
|
+
radial-gradient(in srgb circle at 85% 15%, color-mix(in srgb, var(--room-front-tint, var(--room-front-tint-default)) 38%, transparent) 0%, transparent 65%),
|
|
226
|
+
linear-gradient(160deg, color-mix(in srgb, var(--room-front-tint, var(--room-front-tint-default)) 16%, var(--color-bg)) 0%, var(--color-bg) 75%)
|
|
227
|
+
);
|
|
228
|
+
color: var(--room-front-card-ink, inherit);
|
|
229
|
+
transition:
|
|
230
|
+
transform 0.15s ease,
|
|
231
|
+
border-color 0.15s ease,
|
|
232
|
+
box-shadow 0.15s ease,
|
|
233
|
+
opacity 0.2s ease;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.room-card:hover,
|
|
237
|
+
.room-card:focus-within {
|
|
238
|
+
transform: translateY(var(--room-front-card-hover-lift, -2px));
|
|
239
|
+
border-color: var(--room-front-card-hover-border, var(--color-primary));
|
|
240
|
+
box-shadow: var(--room-front-card-hover-shadow, 0 6px 20px color-mix(in srgb, var(--color-bg-overlay) 60%, transparent));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/*
|
|
244
|
+
* A room that does not match every filter that is ON: faded and shaded, never hidden; its buttons
|
|
245
|
+
* still work through the shade. A shade over the card, never a `filter` on it.
|
|
246
|
+
*/
|
|
247
|
+
.room-card::after {
|
|
248
|
+
content: '';
|
|
249
|
+
position: absolute;
|
|
250
|
+
inset: 0;
|
|
251
|
+
z-index: 2;
|
|
252
|
+
opacity: 0;
|
|
253
|
+
background: var(--color-bg-overlay);
|
|
254
|
+
pointer-events: none;
|
|
255
|
+
transition: opacity 0.2s ease;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.room-card[data-match='false'] {
|
|
259
|
+
opacity: 0.45;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.room-card[data-match='false']::after {
|
|
263
|
+
opacity: 0.5;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* The room's own scene, large and faint in the corner. */
|
|
267
|
+
.room-card__mark {
|
|
268
|
+
position: absolute;
|
|
269
|
+
right: -6px;
|
|
270
|
+
bottom: -10px;
|
|
271
|
+
opacity: 0.1;
|
|
272
|
+
color: var(--color-text);
|
|
273
|
+
pointer-events: none;
|
|
274
|
+
transition:
|
|
275
|
+
transform 0.4s ease,
|
|
276
|
+
opacity 0.2s ease;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.room-card:hover .room-card__mark,
|
|
280
|
+
.room-card:focus-within .room-card__mark {
|
|
281
|
+
transform: scale(1.06) rotate(-3deg);
|
|
282
|
+
opacity: 0.14;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.room-card__body {
|
|
286
|
+
position: relative;
|
|
287
|
+
z-index: 1;
|
|
288
|
+
display: var(--room-front-body-display, flex);
|
|
289
|
+
flex-direction: column;
|
|
290
|
+
gap: var(--room-front-row-stack-gap, 6px);
|
|
291
|
+
box-sizing: border-box;
|
|
292
|
+
height: var(--room-front-body-height, 100%);
|
|
293
|
+
padding: var(--room-front-card-padding, 12px 14px);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.room-card__row1,
|
|
297
|
+
.room-card__row2,
|
|
298
|
+
.room-card__row3,
|
|
299
|
+
.room-card__row4 {
|
|
300
|
+
display: flex;
|
|
301
|
+
flex-wrap: wrap;
|
|
302
|
+
align-items: var(--room-front-row-align, center);
|
|
303
|
+
gap: var(--room-front-row-gap, 8px);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* The title row never wraps: the name ellipsises instead of pushing the icon to its own line. */
|
|
307
|
+
.room-card__row1 {
|
|
308
|
+
flex-wrap: var(--room-front-row1-wrap, nowrap);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Nor the chips: a long mode ellipsises in its chip, so every card is the same height. */
|
|
312
|
+
.room-card__row2 {
|
|
313
|
+
flex-wrap: nowrap;
|
|
314
|
+
min-width: 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* The state and its detail: one row that never wraps, two sizes of text on one baseline. */
|
|
318
|
+
.room-card__row3 {
|
|
319
|
+
flex-wrap: var(--room-front-row3-wrap, nowrap);
|
|
320
|
+
align-items: baseline;
|
|
321
|
+
min-width: 0;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Pinned to the card's foot, so every card's buttons in a grid row share a baseline. */
|
|
325
|
+
.room-card__row4 {
|
|
326
|
+
align-items: var(--room-front-row4-align, center);
|
|
327
|
+
margin-top: auto;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.room-card__type-icon {
|
|
331
|
+
display: inline-flex;
|
|
332
|
+
flex: 0 0 auto;
|
|
333
|
+
color: var(--color-text-secondary);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.room-card__name {
|
|
337
|
+
flex: 1 1 auto;
|
|
338
|
+
min-width: 0;
|
|
339
|
+
overflow: hidden;
|
|
340
|
+
font-weight: var(--room-front-name-weight, 600);
|
|
341
|
+
text-overflow: ellipsis;
|
|
342
|
+
white-space: nowrap;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* A game's own trophy glyph (a tournament, say): an icon in the theme's gold, never text. */
|
|
346
|
+
.room-card__trophy {
|
|
347
|
+
display: inline-flex;
|
|
348
|
+
flex: 0 0 auto;
|
|
349
|
+
color: var(--room-front-trophy-ink, var(--color-warning));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* The lock leads the primary button's own label, not the title row. */
|
|
353
|
+
.room-card__lock {
|
|
354
|
+
display: inline-flex;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.room-card__seats {
|
|
358
|
+
display: inline-flex;
|
|
359
|
+
flex: 0 0 auto;
|
|
360
|
+
align-items: center;
|
|
361
|
+
gap: var(--room-front-seats-gap, 4px);
|
|
362
|
+
color: var(--room-front-seats-ink, var(--color-text-secondary));
|
|
363
|
+
font-size: var(--room-front-seats-size, 12px);
|
|
364
|
+
white-space: nowrap;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.room-card__mode-chip {
|
|
368
|
+
display: inline-flex;
|
|
369
|
+
align-items: center;
|
|
370
|
+
gap: 4px;
|
|
371
|
+
min-width: 0;
|
|
372
|
+
max-width: 100%;
|
|
373
|
+
padding: 2px 8px;
|
|
374
|
+
border: 1px solid var(--color-border);
|
|
375
|
+
border-radius: 999px;
|
|
376
|
+
color: var(--color-text-secondary);
|
|
377
|
+
font-size: 12px;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.room-card__mode-text {
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
text-overflow: ellipsis;
|
|
383
|
+
white-space: nowrap;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.room-card__series-chip {
|
|
387
|
+
flex: 0 0 auto;
|
|
388
|
+
padding: 2px 8px;
|
|
389
|
+
border: 1px solid var(--color-border);
|
|
390
|
+
border-radius: 999px;
|
|
391
|
+
font-size: 12px;
|
|
392
|
+
font-weight: 700;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.room-card__state {
|
|
396
|
+
display: inline-flex;
|
|
397
|
+
flex: 0 0 auto;
|
|
398
|
+
align-items: var(--room-front-state-align, baseline);
|
|
399
|
+
gap: var(--room-front-state-gap, 6px);
|
|
400
|
+
color: var(--room-front-state-ink, inherit);
|
|
401
|
+
font-size: var(--room-front-state-size, 13px);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/* The dot has no text to sit on: centred on the label beside it. The game colours it per state. */
|
|
405
|
+
.room-card__dot {
|
|
406
|
+
align-self: center;
|
|
407
|
+
width: var(--room-front-dot-size, 8px);
|
|
408
|
+
height: var(--room-front-dot-size, 8px);
|
|
409
|
+
border-radius: 50%;
|
|
410
|
+
background: var(--room-front-dot, var(--color-text-secondary));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.room-card__state-detail {
|
|
414
|
+
min-width: 0;
|
|
415
|
+
overflow: hidden;
|
|
416
|
+
color: var(--room-front-detail-ink, var(--color-text-secondary));
|
|
417
|
+
font-size: var(--room-front-detail-size, 12px);
|
|
418
|
+
text-overflow: ellipsis;
|
|
419
|
+
white-space: nowrap;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* A game's own trailing line (a streamed client's label), at the end of row 4 so it never adds a row. */
|
|
423
|
+
.room-card__legacy {
|
|
424
|
+
display: flex;
|
|
425
|
+
flex-wrap: nowrap;
|
|
426
|
+
gap: 8px;
|
|
427
|
+
margin-left: auto;
|
|
428
|
+
color: var(--color-text-secondary);
|
|
429
|
+
font-size: 12px;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* Words kept for assistive tech and tests, out of sight (a game's own label in `legacyMeta`, say). */
|
|
433
|
+
.rooms__sr {
|
|
434
|
+
position: absolute;
|
|
435
|
+
width: 1px;
|
|
436
|
+
height: 1px;
|
|
437
|
+
overflow: hidden;
|
|
438
|
+
clip: rect(0 0 0 0);
|
|
439
|
+
white-space: nowrap;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
* The roster: the faces and names, out of sight by default (the card's seat count says it
|
|
444
|
+
* visually). A game that shows it sets the `--room-front-roster-*` below.
|
|
445
|
+
*/
|
|
446
|
+
.rooms__members.rooms__sr {
|
|
447
|
+
position: var(--room-front-roster-position, absolute);
|
|
448
|
+
display: var(--room-front-roster-display, block);
|
|
449
|
+
flex-wrap: var(--room-front-roster-flex-wrap, nowrap);
|
|
450
|
+
align-items: var(--room-front-roster-align, normal);
|
|
451
|
+
gap: var(--room-front-roster-gap, normal);
|
|
452
|
+
width: var(--room-front-roster-size, 1px);
|
|
453
|
+
height: var(--room-front-roster-size, 1px);
|
|
454
|
+
overflow: var(--room-front-roster-overflow, hidden);
|
|
455
|
+
clip: var(--room-front-roster-clip, rect(0 0 0 0));
|
|
456
|
+
color: var(--room-front-roster-ink, inherit);
|
|
457
|
+
font-size: var(--room-front-roster-text, inherit);
|
|
458
|
+
white-space: var(--room-front-roster-wrap, nowrap);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* A member's character beside their name; pixelated, because these are small sprites. */
|
|
462
|
+
.rooms__face {
|
|
463
|
+
width: 18px;
|
|
464
|
+
height: 18px;
|
|
465
|
+
margin-right: var(--room-front-face-gap, 4px);
|
|
466
|
+
border-radius: var(--room-front-face-radius, 3px);
|
|
467
|
+
vertical-align: -4px;
|
|
468
|
+
image-rendering: pixelated;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* ── the way in ──────────────────────────────────────────────────────── */
|
|
472
|
+
|
|
473
|
+
/* Join, Watch and Reset, and the list's own Retry and the password's Enter: one bordered button. */
|
|
474
|
+
.rooms__enter,
|
|
475
|
+
.rooms__password button,
|
|
476
|
+
.rooms__status--bad button {
|
|
477
|
+
padding: var(--room-front-enter-padding, 8px 16px);
|
|
478
|
+
border: 1px solid var(--color-border);
|
|
479
|
+
border-radius: var(--room-front-enter-radius, 8px);
|
|
480
|
+
background: var(--room-front-enter-bg, var(--color-bg-hover));
|
|
481
|
+
color: var(--color-text);
|
|
482
|
+
font-size: var(--room-front-enter-size, 14px);
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/* A row's own buttons: the primary fills with the accent on hover, Watch glows the danger. */
|
|
487
|
+
.room-card__go {
|
|
488
|
+
display: var(--room-front-enter-display, inline-flex);
|
|
489
|
+
flex: var(--room-front-enter-flex, 0 0 auto);
|
|
490
|
+
align-items: center;
|
|
491
|
+
justify-content: center;
|
|
492
|
+
gap: 6px;
|
|
493
|
+
font-weight: var(--room-front-enter-weight, 600);
|
|
494
|
+
transition:
|
|
495
|
+
background 0.12s ease,
|
|
496
|
+
color 0.12s ease,
|
|
497
|
+
border-color 0.12s ease,
|
|
498
|
+
box-shadow 0.12s ease;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.room-card__go:hover:not(:disabled),
|
|
502
|
+
.room-card__go:focus-visible {
|
|
503
|
+
border-color: var(--room-front-enter-hover-border, var(--color-primary));
|
|
504
|
+
background: var(--room-front-enter-hover-bg, var(--color-primary));
|
|
505
|
+
color: var(--room-front-enter-hover-ink, var(--color-on-primary));
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.room-card__go--watch:hover:not(:disabled),
|
|
509
|
+
.room-card__go--watch:focus-visible {
|
|
510
|
+
border-color: var(--color-danger);
|
|
511
|
+
background: var(--color-bg-hover);
|
|
512
|
+
color: color-mix(in srgb, var(--color-danger) 50%, var(--color-text));
|
|
513
|
+
box-shadow: 0 0 0 3px var(--color-danger-bg);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.rooms__enter:disabled {
|
|
517
|
+
opacity: var(--room-front-enter-disabled-opacity, 1);
|
|
518
|
+
cursor: var(--room-front-enter-disabled-cursor, pointer);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/* The password prompt, in place of the row's buttons. */
|
|
522
|
+
.rooms__password {
|
|
523
|
+
display: flex;
|
|
524
|
+
flex: 1 1 100%;
|
|
525
|
+
flex-wrap: wrap;
|
|
526
|
+
align-items: center;
|
|
527
|
+
gap: 8px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.rooms__password label,
|
|
531
|
+
.rooms__caption {
|
|
532
|
+
flex-basis: 100%;
|
|
533
|
+
color: var(--color-text-secondary);
|
|
534
|
+
font-size: 12px;
|
|
535
|
+
letter-spacing: 0.06em;
|
|
536
|
+
text-transform: uppercase;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.rooms__password input {
|
|
540
|
+
flex: 1 1 200px;
|
|
541
|
+
min-width: 0;
|
|
542
|
+
padding: 9px 10px;
|
|
543
|
+
border: 1px solid var(--color-border);
|
|
544
|
+
border-radius: 8px;
|
|
545
|
+
background: var(--color-bg);
|
|
546
|
+
color: var(--color-text);
|
|
547
|
+
font: inherit;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.rooms__error {
|
|
551
|
+
flex-basis: 100%;
|
|
552
|
+
margin: var(--room-front-error-margin, 0);
|
|
553
|
+
padding: var(--room-front-error-padding, 0);
|
|
554
|
+
border-radius: var(--room-front-error-radius, 0);
|
|
555
|
+
background: var(--room-front-error-bg, transparent);
|
|
556
|
+
color: var(--room-front-error-ink, var(--color-danger));
|
|
557
|
+
font-size: var(--room-front-error-size, inherit);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* ── the create dialog ───────────────────────────────────────────────── */
|
|
561
|
+
|
|
562
|
+
/*
|
|
563
|
+
* Not under `.rooms`: the dialog portals into `<body>` (`OverPage`), so no rule here may be scoped
|
|
564
|
+
* under the page, and its custom properties are read from `:root`.
|
|
565
|
+
*/
|
|
566
|
+
.rooms__backdrop {
|
|
567
|
+
position: fixed;
|
|
568
|
+
inset: 0;
|
|
569
|
+
z-index: var(--room-front-create-z, var(--z-modal, 50));
|
|
570
|
+
display: flex;
|
|
571
|
+
align-items: center;
|
|
572
|
+
justify-content: center;
|
|
573
|
+
padding: var(--room-front-create-inset, 16px);
|
|
574
|
+
background: var(--color-bg-overlay);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/*
|
|
578
|
+
* The panel. Its surface (fill, edge, shadow) is `:where()`-light, so a game's own raised-surface
|
|
579
|
+
* class passed as `createPanelClassName` draws over it regardless of which sheet loads first.
|
|
580
|
+
*/
|
|
581
|
+
.room-front-create {
|
|
582
|
+
display: flex;
|
|
583
|
+
flex-direction: column;
|
|
584
|
+
gap: var(--room-front-create-gap, 6px);
|
|
585
|
+
box-sizing: var(--room-front-create-box, border-box);
|
|
586
|
+
width: min(420px, 100%);
|
|
587
|
+
max-height: calc(100dvh - 32px);
|
|
588
|
+
overflow-y: auto;
|
|
589
|
+
padding: var(--room-front-create-padding, 16px 20px 20px);
|
|
590
|
+
border-radius: var(--room-front-create-radius, var(--hdk-radius-lg));
|
|
591
|
+
color: var(--room-front-create-ink, inherit);
|
|
592
|
+
font-family: var(--room-front-create-font, inherit);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
:where(.room-front-create) {
|
|
596
|
+
border: var(--room-front-create-border, 1px solid var(--color-border));
|
|
597
|
+
background: var(--room-front-create-bg, var(--color-bg-card));
|
|
598
|
+
box-shadow: var(--room-front-create-shadow, var(--hdk-shadow-lg));
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.rooms__create-head {
|
|
602
|
+
display: flex;
|
|
603
|
+
align-items: center;
|
|
604
|
+
justify-content: space-between;
|
|
605
|
+
margin-bottom: var(--room-front-create-head-gap, 4px);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.rooms__create-head h3 {
|
|
609
|
+
margin: 0;
|
|
610
|
+
font-size: var(--room-front-create-title-size, 16px);
|
|
611
|
+
font-weight: var(--room-front-create-title-weight, 600);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.rooms__create-close {
|
|
615
|
+
display: inline-flex;
|
|
616
|
+
align-items: center;
|
|
617
|
+
justify-content: center;
|
|
618
|
+
padding: var(--room-front-create-close-padding, 4px);
|
|
619
|
+
border: var(--room-front-create-close-border, 1px solid transparent);
|
|
620
|
+
border-radius: var(--hdk-radius-sm);
|
|
621
|
+
background: transparent;
|
|
622
|
+
color: var(--room-front-create-close-ink, inherit);
|
|
623
|
+
cursor: pointer;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.rooms__create-close:hover,
|
|
627
|
+
.rooms__create-close:focus-visible {
|
|
628
|
+
border-color: var(--room-front-create-close-hover-border, var(--color-border));
|
|
629
|
+
background: var(--room-front-create-close-hover-bg, transparent);
|
|
630
|
+
color: var(--room-front-create-close-hover-ink, inherit);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.room-front-create label[for],
|
|
634
|
+
.room-front-create .rooms__caption {
|
|
635
|
+
flex-basis: var(--room-front-create-label-basis, 100%);
|
|
636
|
+
color: var(--room-front-create-label-ink, var(--color-text-secondary));
|
|
637
|
+
font-size: var(--room-front-create-label-size, 12px);
|
|
638
|
+
font-weight: var(--room-front-create-label-weight, inherit);
|
|
639
|
+
letter-spacing: var(--room-front-create-label-spacing, 0.06em);
|
|
640
|
+
text-transform: var(--room-front-create-label-case, uppercase);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.room-front-create input,
|
|
644
|
+
.room-front-create select {
|
|
645
|
+
min-width: 0;
|
|
646
|
+
padding: var(--room-front-create-input-padding, 9px 10px);
|
|
647
|
+
border: 1px solid var(--color-border);
|
|
648
|
+
border-radius: var(--room-front-create-input-radius, 8px);
|
|
649
|
+
background: var(--color-bg);
|
|
650
|
+
color: var(--color-text);
|
|
651
|
+
font: inherit;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.room-front-create .room-front__go {
|
|
655
|
+
margin-top: var(--room-front-create-go-gap, 6px);
|
|
656
|
+
font-family: var(--room-front-create-go-font, inherit);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.room-front-create input:focus-visible,
|
|
660
|
+
.room-front-create .rooms__create-close:focus-visible {
|
|
661
|
+
outline-style: var(--room-front-create-focus-outline, solid);
|
|
662
|
+
box-shadow: var(--room-front-create-focus-shadow, none);
|
|
663
|
+
}
|