squiffy-runtime 6.0.1 → 7.0.0-beta.11
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/assets.d.ts +3 -0
- package/dist/assets.test.d.ts +1 -0
- package/dist/classes.test.d.ts +1 -0
- package/dist/confirmDialog.d.ts +8 -0
- package/dist/events.d.ts +16 -0
- package/dist/every.d.ts +12 -0
- package/dist/every.test.d.ts +1 -0
- package/dist/helpers.test.d.ts +1 -0
- package/dist/numbers.d.ts +3 -0
- package/dist/panels.d.ts +14 -0
- package/dist/panels.test.d.ts +1 -0
- package/dist/paths.d.ts +15 -0
- package/dist/paths.test.d.ts +1 -0
- package/dist/persistent.test.d.ts +1 -0
- package/dist/playerSettings.d.ts +17 -0
- package/dist/pluginManager.d.ts +2 -1
- package/dist/preview-host.d.ts +33 -0
- package/dist/preview-host.js +125 -0
- package/dist/preview-host.js.map +7 -0
- package/dist/preview-host.test.d.ts +1 -0
- package/dist/preview-html.d.ts +2 -0
- package/dist/preview-html.js +2 -0
- package/dist/preview-protocol.d.ts +69 -0
- package/dist/preview.d.ts +15 -0
- package/dist/preview.main.d.ts +1 -0
- package/dist/preview.test.d.ts +1 -0
- package/dist/saveSlots.d.ts +16 -0
- package/dist/saves.test.d.ts +1 -0
- package/dist/savesDialog.d.ts +43 -0
- package/dist/savesDialog.test.d.ts +1 -0
- package/dist/scripts.test.d.ts +1 -0
- package/dist/settings.test.d.ts +1 -0
- package/dist/settingsDialog.d.ts +17 -0
- package/dist/skill.test.d.ts +1 -0
- package/dist/sound.d.ts +35 -0
- package/dist/sound.test.d.ts +1 -0
- package/dist/squiffy.page.css +155 -0
- package/dist/squiffy.preview.html +1631 -0
- package/dist/squiffy.runtime.css +1123 -20
- package/dist/squiffy.runtime.d.ts +13 -1
- package/dist/squiffy.runtime.global.js +146 -76
- package/dist/squiffy.runtime.global.js.map +1 -1
- package/dist/squiffy.runtime.js +7105 -4681
- package/dist/squiffy.runtime.js.map +1 -1
- package/dist/state.d.ts +17 -0
- package/dist/storyLists.d.ts +4 -0
- package/dist/storyLists.test.d.ts +1 -0
- package/dist/style.test.d.ts +1 -0
- package/dist/textProcessor.d.ts +27 -0
- package/dist/transitions.test.d.ts +1 -0
- package/dist/types.d.ts +137 -1
- package/dist/types.plugins.d.ts +2 -0
- package/dist/uiLinks.test.d.ts +1 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.test.d.ts +1 -0
- package/package.json +25 -11
- package/src/__snapshots__/squiffy.runtime.test.ts.snap +22 -22
- package/src/animation.test.ts +44 -0
- package/src/animation.ts +9 -5
- package/src/assets.test.ts +225 -0
- package/src/assets.ts +92 -0
- package/src/classes.test.ts +201 -0
- package/src/confirmDialog.ts +66 -0
- package/src/events.ts +20 -0
- package/src/every.test.ts +25 -0
- package/src/every.ts +94 -0
- package/src/helpers.test.ts +34 -0
- package/src/numbers.ts +21 -0
- package/src/panels.test.ts +225 -0
- package/src/panels.ts +187 -0
- package/src/paths.test.ts +66 -0
- package/src/paths.ts +155 -0
- package/src/persistent.test.ts +155 -0
- package/src/playerSettings.ts +128 -0
- package/src/pluginManager.ts +6 -1
- package/src/plugins/animate.ts +34 -9
- package/src/plugins/live.ts +18 -5
- package/src/plugins/plugins.test.ts +93 -6
- package/src/plugins/replaceLabel.ts +7 -3
- package/src/preview-host.test.ts +171 -0
- package/src/preview-host.ts +190 -0
- package/src/preview-protocol.ts +79 -0
- package/src/preview.main.ts +34 -0
- package/src/preview.test.ts +367 -0
- package/src/preview.ts +331 -0
- package/src/saveSlots.ts +159 -0
- package/src/saves.test.ts +199 -0
- package/src/savesDialog.test.ts +290 -0
- package/src/savesDialog.ts +499 -0
- package/src/scripts.test.ts +130 -0
- package/src/settings.test.ts +233 -0
- package/src/settingsDialog.ts +160 -0
- package/src/skill.test.ts +67 -0
- package/src/sound.test.ts +273 -0
- package/src/sound.ts +207 -0
- package/src/squiffy.page.css +155 -0
- package/src/squiffy.runtime.css +1123 -20
- package/src/squiffy.runtime.test.ts +2806 -44
- package/src/squiffy.runtime.ts +1130 -64
- package/src/state.ts +172 -11
- package/src/storyLists.test.ts +134 -0
- package/src/storyLists.ts +57 -0
- package/src/style.test.ts +89 -0
- package/src/textProcessor.ts +739 -58
- package/src/transitions.test.ts +343 -0
- package/src/types.plugins.ts +7 -0
- package/src/types.ts +226 -2
- package/src/uiLinks.test.ts +156 -0
- package/src/updater.ts +26 -8
- package/src/utils.test.ts +60 -0
- package/src/utils.ts +46 -14
- package/vite.config.ts +3 -4
- package/vite.preview.config.ts +83 -0
- package/dist/infixExpressions.d.ts +0 -2
- package/src/infixExpressions.test.ts +0 -187
- package/src/infixExpressions.ts +0 -323
- /package/dist/{infixExpressions.test.d.ts → animation.test.d.ts} +0 -0
package/src/squiffy.runtime.css
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
|
-
/* Core Squiffy Runtime Styles */
|
|
1
|
+
/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */
|
|
2
|
+
|
|
3
|
+
/* Colours. Each has a light and a dark value, and light-dark() picks one from the page's
|
|
4
|
+
color-scheme. This file doesn't set color-scheme itself, so a story embedded in a page stays
|
|
5
|
+
light unless the page opts in to dark mode. The exported story's page (squiffy.page.css) sets
|
|
6
|
+
"color-scheme: light dark", so it follows the reader's system setting. */
|
|
7
|
+
:root
|
|
8
|
+
{
|
|
9
|
+
--squiffy-text: light-dark(#1f2328, #e4e4e7);
|
|
10
|
+
--squiffy-background: light-dark(#ffffff, #18181b);
|
|
11
|
+
/* Secondary text: the header buttons, and links waiting for valid input */
|
|
12
|
+
--squiffy-muted: light-dark(#6b6f76, #9a9ca3);
|
|
13
|
+
/* The lines between sections */
|
|
14
|
+
--squiffy-border: light-dark(#e2e2e6, #34343a);
|
|
15
|
+
--squiffy-link: light-dark(#1d5fd6, #7aa7ff);
|
|
16
|
+
--squiffy-link-hover: light-dark(#0f3f99, #b0cbff);
|
|
17
|
+
--squiffy-error: light-dark(#c62828, #ff7b72);
|
|
18
|
+
--squiffy-success: light-dark(#2e7d32, #6cc070);
|
|
19
|
+
}
|
|
2
20
|
|
|
3
21
|
/* Link styles */
|
|
4
22
|
a.squiffy-link
|
|
5
23
|
{
|
|
24
|
+
color: var(--squiffy-link);
|
|
6
25
|
text-decoration: underline;
|
|
7
|
-
text-decoration-color:
|
|
8
|
-
|
|
26
|
+
text-decoration-color: currentColor;
|
|
27
|
+
text-decoration-thickness: from-font;
|
|
28
|
+
text-underline-offset: 0.15em;
|
|
9
29
|
cursor: pointer;
|
|
10
30
|
transition: color 0.4s ease-in-out, text-decoration-color 0.4s ease-in-out;
|
|
11
31
|
}
|
|
12
32
|
|
|
33
|
+
a.squiffy-link:hover
|
|
34
|
+
{
|
|
35
|
+
color: var(--squiffy-link-hover);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
a.squiffy-link:focus-visible,
|
|
39
|
+
button.squiffy-header-button:focus-visible,
|
|
40
|
+
.squiffy-continue:focus-visible
|
|
41
|
+
{
|
|
42
|
+
outline: 2px solid var(--squiffy-link);
|
|
43
|
+
outline-offset: 2px;
|
|
44
|
+
border-radius: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
13
47
|
/* Rotate/sequence links - visually distinct as they update in-place rather than advancing the story */
|
|
14
48
|
a.squiffy-link[data-handler="rotate"],
|
|
15
49
|
a.squiffy-link[data-handler="sequence"] {
|
|
@@ -33,10 +67,9 @@ a.squiffy-link.validation-disabled
|
|
|
33
67
|
{
|
|
34
68
|
text-decoration: inherit;
|
|
35
69
|
text-decoration-color: transparent;
|
|
36
|
-
color:
|
|
70
|
+
color: var(--squiffy-muted) !important;
|
|
37
71
|
cursor: not-allowed;
|
|
38
72
|
pointer-events: none;
|
|
39
|
-
opacity: 0.6;
|
|
40
73
|
}
|
|
41
74
|
|
|
42
75
|
/* Invalid input field states */
|
|
@@ -44,8 +77,8 @@ input.squiffy-invalid,
|
|
|
44
77
|
textarea.squiffy-invalid,
|
|
45
78
|
select.squiffy-invalid
|
|
46
79
|
{
|
|
47
|
-
border-color:
|
|
48
|
-
box-shadow: 0 0 0 0.2rem
|
|
80
|
+
border-color: var(--squiffy-error) !important;
|
|
81
|
+
box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 25%, transparent);
|
|
49
82
|
}
|
|
50
83
|
|
|
51
84
|
/* Valid input field states (optional, provides positive feedback) */
|
|
@@ -53,7 +86,7 @@ input:not([disabled]):valid,
|
|
|
53
86
|
textarea:not([disabled]):valid,
|
|
54
87
|
select:not([disabled]):valid
|
|
55
88
|
{
|
|
56
|
-
border-color:
|
|
89
|
+
border-color: var(--squiffy-success);
|
|
57
90
|
}
|
|
58
91
|
|
|
59
92
|
/* Focus state for invalid inputs */
|
|
@@ -62,19 +95,55 @@ textarea.squiffy-invalid:focus,
|
|
|
62
95
|
select.squiffy-invalid:focus
|
|
63
96
|
{
|
|
64
97
|
outline: none;
|
|
65
|
-
border-color:
|
|
66
|
-
box-shadow: 0 0 0 0.2rem
|
|
98
|
+
border-color: var(--squiffy-error) !important;
|
|
99
|
+
box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 50%, transparent);
|
|
67
100
|
}
|
|
68
101
|
|
|
69
|
-
/* Header button styles */
|
|
102
|
+
/* Header button styles: the Back, Restart and light/dark buttons, which are icons */
|
|
70
103
|
button.squiffy-header-button
|
|
71
104
|
{
|
|
72
|
-
|
|
73
|
-
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
color: var(--squiffy-muted);
|
|
74
109
|
cursor: pointer;
|
|
75
110
|
background: none;
|
|
76
111
|
border: none;
|
|
77
|
-
|
|
112
|
+
border-radius: 0.375em;
|
|
113
|
+
padding: 0.375em;
|
|
114
|
+
font: inherit;
|
|
115
|
+
vertical-align: middle;
|
|
116
|
+
transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
button.squiffy-header-button:hover:not(:disabled)
|
|
120
|
+
{
|
|
121
|
+
color: var(--squiffy-text);
|
|
122
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
button.squiffy-header-button svg
|
|
126
|
+
{
|
|
127
|
+
width: 1.25em;
|
|
128
|
+
height: 1.25em;
|
|
129
|
+
fill: none;
|
|
130
|
+
stroke: currentColor;
|
|
131
|
+
stroke-width: 2;
|
|
132
|
+
stroke-linecap: round;
|
|
133
|
+
stroke-linejoin: round;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* The light/dark button, when the story's CSS fixes the theme */
|
|
137
|
+
button.squiffy-header-button[hidden]
|
|
138
|
+
{
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* The Back button, when there's nothing to go back to */
|
|
143
|
+
button.squiffy-header-button:disabled
|
|
144
|
+
{
|
|
145
|
+
cursor: default;
|
|
146
|
+
opacity: 0.5;
|
|
78
147
|
}
|
|
79
148
|
|
|
80
149
|
/* Output block spacing */
|
|
@@ -83,7 +152,20 @@ div.squiffy-output-passage:not(:last-child),
|
|
|
83
152
|
div.squiffy-output-section:not(:last-child)
|
|
84
153
|
{
|
|
85
154
|
margin-bottom: 1em;
|
|
86
|
-
border-bottom: 1px solid
|
|
155
|
+
border-bottom: 1px solid var(--squiffy-border);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* ...but a block, passage or section that output no text (such as a passage that only does
|
|
159
|
+
{{replace}}) gets no line, and nor does one followed only by those, so they don't add extra lines */
|
|
160
|
+
div.squiffy-output-block:not(:has(> div:not(:empty))),
|
|
161
|
+
div.squiffy-output-block:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),
|
|
162
|
+
div.squiffy-output-passage:not(:has(> div.squiffy-output-block > div:not(:empty))),
|
|
163
|
+
div.squiffy-output-passage:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),
|
|
164
|
+
div.squiffy-output-section:not(:has(div.squiffy-output-block > div:not(:empty))),
|
|
165
|
+
div.squiffy-output-section:not(:has(~ div.squiffy-output-section div.squiffy-output-block > div:not(:empty)))
|
|
166
|
+
{
|
|
167
|
+
margin-bottom: 0;
|
|
168
|
+
border-bottom: none;
|
|
87
169
|
}
|
|
88
170
|
|
|
89
171
|
/* Fade animations */
|
|
@@ -99,9 +181,11 @@ div.squiffy-output-section:not(:last-child)
|
|
|
99
181
|
|
|
100
182
|
/* Continue animation - click to proceed */
|
|
101
183
|
.squiffy-continue {
|
|
184
|
+
color: var(--squiffy-link);
|
|
102
185
|
text-decoration: underline;
|
|
103
|
-
text-decoration-color:
|
|
104
|
-
|
|
186
|
+
text-decoration-color: currentColor;
|
|
187
|
+
text-decoration-thickness: from-font;
|
|
188
|
+
text-underline-offset: 0.15em;
|
|
105
189
|
cursor: pointer;
|
|
106
190
|
}
|
|
107
191
|
|
|
@@ -121,8 +205,8 @@ div.squiffy-output-section:not(:last-child)
|
|
|
121
205
|
}
|
|
122
206
|
|
|
123
207
|
@keyframes squiffy-glow {
|
|
124
|
-
0%, 100% { text-shadow: 0 0 4px
|
|
125
|
-
50% { text-shadow: 0 0 12px
|
|
208
|
+
0%, 100% { text-shadow: 0 0 4px color-mix(in srgb, currentColor 50%, transparent); }
|
|
209
|
+
50% { text-shadow: 0 0 12px color-mix(in srgb, currentColor 80%, transparent), 0 0 20px color-mix(in srgb, currentColor 40%, transparent); }
|
|
126
210
|
}
|
|
127
211
|
|
|
128
212
|
/* Style: bounce - subtle vertical bounce */
|
|
@@ -139,5 +223,1024 @@ div.squiffy-output-section:not(:last-child)
|
|
|
139
223
|
/* Style: wave - character spans need special handling for underline */
|
|
140
224
|
.squiffy-continue-wave {
|
|
141
225
|
text-decoration: none;
|
|
142
|
-
border-bottom: 1px solid
|
|
226
|
+
border-bottom: 1px solid currentColor;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Text effects for {{#style}} (#453), e.g. {{#style "shudder"}}...{{/style}} */
|
|
230
|
+
span.squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .mirror, .upside-down, .tall, .flat) {
|
|
231
|
+
/* Transforms don't apply to inline elements */
|
|
232
|
+
display: inline-block;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.squiffy-style.shake {
|
|
236
|
+
animation: squiffy-shake 0.4s ease-in-out infinite;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@keyframes squiffy-shake {
|
|
240
|
+
0%, 100% { transform: translateX(0); }
|
|
241
|
+
25% { transform: translateX(-3px); }
|
|
242
|
+
75% { transform: translateX(3px); }
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.squiffy-style.shudder {
|
|
246
|
+
animation: squiffy-shudder 0.1s linear infinite alternate;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes squiffy-shudder {
|
|
250
|
+
from { transform: translateX(-1px); }
|
|
251
|
+
to { transform: translateX(1px); }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.squiffy-style.rumble {
|
|
255
|
+
animation: squiffy-rumble 0.1s linear infinite alternate;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@keyframes squiffy-rumble {
|
|
259
|
+
from { transform: translateY(-1px); }
|
|
260
|
+
to { transform: translateY(1px); }
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.squiffy-style.sway {
|
|
264
|
+
animation: squiffy-sway 2.5s ease-in-out infinite;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@keyframes squiffy-sway {
|
|
268
|
+
0%, 100% { transform: rotate(-3deg); }
|
|
269
|
+
50% { transform: rotate(3deg); }
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.squiffy-style.buoy {
|
|
273
|
+
animation: squiffy-buoy 2.5s ease-in-out infinite;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@keyframes squiffy-buoy {
|
|
277
|
+
0%, 100% { transform: translateY(0); }
|
|
278
|
+
50% { transform: translateY(-0.25em); }
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.squiffy-style.pulse {
|
|
282
|
+
animation: squiffy-pulse 1.5s ease-in-out infinite;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.squiffy-style.fade-in-out {
|
|
286
|
+
animation: squiffy-fade-in-out 3s ease-in-out infinite;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@keyframes squiffy-fade-in-out {
|
|
290
|
+
0%, 100% { opacity: 1; }
|
|
291
|
+
50% { opacity: 0; }
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.squiffy-style.blink {
|
|
295
|
+
animation: squiffy-blink 1s step-end infinite;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@keyframes squiffy-blink {
|
|
299
|
+
50% { opacity: 0; }
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.squiffy-style.flicker {
|
|
303
|
+
animation: squiffy-flicker 3s linear infinite;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@keyframes squiffy-flicker {
|
|
307
|
+
0%, 19%, 21%, 23%, 54%, 56%, 100% { opacity: 1; }
|
|
308
|
+
20%, 22%, 55% { opacity: 0.2; }
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.squiffy-style.blur {
|
|
312
|
+
filter: blur(1px);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.squiffy-style.blurrier {
|
|
316
|
+
filter: blur(3px);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.squiffy-style.smear {
|
|
320
|
+
text-shadow: 0.15em 0 0.1em color-mix(in srgb, currentColor 50%, transparent), 0.3em 0 0.15em color-mix(in srgb, currentColor 25%, transparent);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.squiffy-style.mirror {
|
|
324
|
+
transform: scaleX(-1);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.squiffy-style.upside-down {
|
|
328
|
+
transform: scaleY(-1);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* The typographic effects, which don't move (#541) */
|
|
332
|
+
.squiffy-style.shadow {
|
|
333
|
+
text-shadow: 0.08em 0.08em 0.08em color-mix(in srgb, currentColor 50%, transparent);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* A dimmed face, lit from the top left and shadowed at the bottom right */
|
|
337
|
+
.squiffy-style.emboss {
|
|
338
|
+
color: color-mix(in srgb, currentColor 35%, var(--squiffy-background));
|
|
339
|
+
text-shadow: -1px -1px 0 color-mix(in srgb, var(--squiffy-text) 80%, white),
|
|
340
|
+
1px 1px 0 color-mix(in srgb, var(--squiffy-background) 40%, black);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.squiffy-style.outline {
|
|
344
|
+
color: var(--squiffy-background);
|
|
345
|
+
text-shadow: -1px -1px 0 var(--squiffy-text), 1px -1px 0 var(--squiffy-text),
|
|
346
|
+
-1px 1px 0 var(--squiffy-text), 1px 1px 0 var(--squiffy-text);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.squiffy-style.condense {
|
|
350
|
+
letter-spacing: -0.08em;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.squiffy-style.expand {
|
|
354
|
+
letter-spacing: 0.1em;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.squiffy-style.tall {
|
|
358
|
+
transform: scaleY(1.5);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.squiffy-style.flat {
|
|
362
|
+
transform: scaleY(0.5);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.squiffy-style.double-underline {
|
|
366
|
+
text-decoration: underline double;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.squiffy-style.wavy-underline {
|
|
370
|
+
text-decoration: underline wavy;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.squiffy-style.double-strike {
|
|
374
|
+
text-decoration: line-through double;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.squiffy-style.wavy-strike {
|
|
378
|
+
text-decoration: line-through wavy;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Transitions for how a section or passage appears (#489), from @transition. The element has
|
|
382
|
+
squiffy-transition and the transition's name as classes while it plays, and @transition's
|
|
383
|
+
time in --squiffy-transition-time. @leave plays them backwards, with squiffy-leave too, except
|
|
384
|
+
the slides, which leave the way they're named. A story's stylesheet can add its own, e.g.
|
|
385
|
+
.squiffy-transition.swirl { animation-name: swirl; } */
|
|
386
|
+
.squiffy-transition {
|
|
387
|
+
animation-duration: var(--squiffy-transition-time, 0.5s);
|
|
388
|
+
animation-timing-function: ease-out;
|
|
389
|
+
animation-fill-mode: both;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.squiffy-transition:is(.fade, .dissolve) {
|
|
393
|
+
animation-name: squiffy-transition-fade;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
@keyframes squiffy-transition-fade {
|
|
397
|
+
from { opacity: 0; }
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* The slides move by --squiffy-slide-distance, e.g. 100% to slide all the way off and on */
|
|
401
|
+
@keyframes squiffy-transition-from-below {
|
|
402
|
+
from { opacity: 0; transform: translateY(var(--squiffy-slide-distance, 2em)); }
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
@keyframes squiffy-transition-from-above {
|
|
406
|
+
from { opacity: 0; transform: translateY(calc(-1 * var(--squiffy-slide-distance, 2em))); }
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
@keyframes squiffy-transition-from-right {
|
|
410
|
+
from { opacity: 0; transform: translateX(var(--squiffy-slide-distance, 3em)); }
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
@keyframes squiffy-transition-from-left {
|
|
414
|
+
from { opacity: 0; transform: translateX(calc(-1 * var(--squiffy-slide-distance, 3em))); }
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/* A slide moves the way it's named: slide-left comes in from the right, and leaves to the left */
|
|
418
|
+
.squiffy-transition.slide-up {
|
|
419
|
+
animation-name: squiffy-transition-from-below;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.squiffy-transition.slide-down {
|
|
423
|
+
animation-name: squiffy-transition-from-above;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.squiffy-transition.slide-left {
|
|
427
|
+
animation-name: squiffy-transition-from-right;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.squiffy-transition.slide-right {
|
|
431
|
+
animation-name: squiffy-transition-from-left;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* @leave plays the animations backwards, as the old text goes before the screen is cleared. So
|
|
435
|
+
that a slide leaves the way it's named, it plays the opposite slide backwards. */
|
|
436
|
+
.squiffy-transition.squiffy-leave {
|
|
437
|
+
animation-direction: reverse;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.squiffy-transition.squiffy-leave.slide-up {
|
|
441
|
+
animation-name: squiffy-transition-from-above;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.squiffy-transition.squiffy-leave.slide-down {
|
|
445
|
+
animation-name: squiffy-transition-from-below;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.squiffy-transition.squiffy-leave.slide-left {
|
|
449
|
+
animation-name: squiffy-transition-from-left;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.squiffy-transition.squiffy-leave.slide-right {
|
|
453
|
+
animation-name: squiffy-transition-from-right;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/* So a transition, a story's own too, doesn't make the page scroll sideways, or a slide make it
|
|
457
|
+
longer */
|
|
458
|
+
:has(> .squiffy-transition) {
|
|
459
|
+
overflow-x: clip;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
:has(> .squiffy-transition:is(.slide-up, .slide-down)) {
|
|
463
|
+
overflow-y: clip;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.squiffy-transition.zoom {
|
|
467
|
+
animation-name: squiffy-transition-zoom;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
@keyframes squiffy-transition-zoom {
|
|
471
|
+
from { opacity: 0; transform: scale(0.9); }
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.squiffy-transition.blur {
|
|
475
|
+
animation-name: squiffy-transition-blur;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@keyframes squiffy-transition-blur {
|
|
479
|
+
from { opacity: 0; filter: blur(8px); }
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.squiffy-transition.pulse {
|
|
483
|
+
animation-name: squiffy-transition-pulse;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
@keyframes squiffy-transition-pulse {
|
|
487
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
488
|
+
60% { opacity: 1; transform: scale(1.02); }
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.squiffy-transition.rumble {
|
|
492
|
+
animation-name: squiffy-transition-rumble;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
@keyframes squiffy-transition-rumble {
|
|
496
|
+
from { opacity: 0; }
|
|
497
|
+
10%, 30%, 50%, 70% { transform: translateY(-2px); }
|
|
498
|
+
20%, 40%, 60%, 80% { transform: translateY(2px); }
|
|
499
|
+
50% { opacity: 1; }
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.squiffy-transition.shudder {
|
|
503
|
+
animation-name: squiffy-transition-shudder;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
@keyframes squiffy-transition-shudder {
|
|
507
|
+
from { opacity: 0; }
|
|
508
|
+
10%, 30%, 50%, 70% { transform: translateX(-2px); }
|
|
509
|
+
20%, 40%, 60%, 80% { transform: translateX(2px); }
|
|
510
|
+
50% { opacity: 1; }
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.squiffy-transition.flicker {
|
|
514
|
+
animation-name: squiffy-transition-flicker;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
@keyframes squiffy-transition-flicker {
|
|
518
|
+
from, 15%, 35%, 55% { opacity: 0; }
|
|
519
|
+
10%, 25%, 45% { opacity: 0.6; }
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/* Respect the reader's reduced-motion setting */
|
|
523
|
+
@media (prefers-reduced-motion: reduce)
|
|
524
|
+
{
|
|
525
|
+
/* Every transition, a story's own too, is a plain fade */
|
|
526
|
+
.squiffy-transition {
|
|
527
|
+
animation-name: squiffy-transition-fade !important;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.squiffy-continue-pulse,
|
|
531
|
+
.squiffy-continue-glow,
|
|
532
|
+
.squiffy-continue-bounce,
|
|
533
|
+
.squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .pulse, .fade-in-out, .blink, .flicker)
|
|
534
|
+
{
|
|
535
|
+
animation: none;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* The Saved games dialog, opened by the page's Save button */
|
|
540
|
+
dialog.squiffy-saves
|
|
541
|
+
{
|
|
542
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
543
|
+
max-height: calc(100vh - 2rem);
|
|
544
|
+
box-sizing: border-box;
|
|
545
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
546
|
+
border: 1px solid var(--squiffy-border);
|
|
547
|
+
border-radius: 0.75rem;
|
|
548
|
+
background-color: var(--squiffy-background);
|
|
549
|
+
color: var(--squiffy-text);
|
|
550
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
551
|
+
font-size: 0.9375rem;
|
|
552
|
+
line-height: 1.4;
|
|
553
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
dialog.squiffy-saves::backdrop
|
|
557
|
+
{
|
|
558
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
dialog.squiffy-saves svg
|
|
562
|
+
{
|
|
563
|
+
width: 1.25em;
|
|
564
|
+
height: 1.25em;
|
|
565
|
+
flex: none;
|
|
566
|
+
fill: none;
|
|
567
|
+
stroke: currentColor;
|
|
568
|
+
stroke-width: 2;
|
|
569
|
+
stroke-linecap: round;
|
|
570
|
+
stroke-linejoin: round;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.squiffy-saves-header
|
|
574
|
+
{
|
|
575
|
+
display: flex;
|
|
576
|
+
align-items: center;
|
|
577
|
+
justify-content: space-between;
|
|
578
|
+
margin-bottom: 0.75rem;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.squiffy-saves-header h2
|
|
582
|
+
{
|
|
583
|
+
margin: 0;
|
|
584
|
+
font-size: 1.125rem;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.squiffy-saves button
|
|
588
|
+
{
|
|
589
|
+
font: inherit;
|
|
590
|
+
color: inherit;
|
|
591
|
+
cursor: pointer;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.squiffy-saves button:focus-visible,
|
|
595
|
+
.squiffy-saves input:focus-visible
|
|
596
|
+
{
|
|
597
|
+
outline: 2px solid var(--squiffy-link);
|
|
598
|
+
outline-offset: 2px;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.squiffy-saves-button
|
|
602
|
+
{
|
|
603
|
+
flex: none;
|
|
604
|
+
padding: 0.3em 0.8em;
|
|
605
|
+
border: 1px solid var(--squiffy-border);
|
|
606
|
+
border-radius: 0.375em;
|
|
607
|
+
background: none;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.squiffy-saves-button:hover
|
|
611
|
+
{
|
|
612
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.squiffy-saves .squiffy-saves-primary
|
|
616
|
+
{
|
|
617
|
+
border-color: var(--squiffy-link);
|
|
618
|
+
background-color: var(--squiffy-link);
|
|
619
|
+
color: var(--squiffy-background);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.squiffy-saves .squiffy-saves-danger-button
|
|
623
|
+
{
|
|
624
|
+
border-color: var(--squiffy-error);
|
|
625
|
+
background-color: var(--squiffy-error);
|
|
626
|
+
color: var(--squiffy-background);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.squiffy-saves-icon-button
|
|
630
|
+
{
|
|
631
|
+
display: inline-flex;
|
|
632
|
+
padding: 0.3em;
|
|
633
|
+
border: none;
|
|
634
|
+
border-radius: 0.375em;
|
|
635
|
+
background: none;
|
|
636
|
+
color: var(--squiffy-muted) !important;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.squiffy-saves-icon-button:hover,
|
|
640
|
+
.squiffy-saves-icon-button[aria-expanded="true"]
|
|
641
|
+
{
|
|
642
|
+
color: var(--squiffy-text) !important;
|
|
643
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.squiffy-saves-error
|
|
647
|
+
{
|
|
648
|
+
margin: 0 0 0.75rem;
|
|
649
|
+
color: var(--squiffy-error);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.squiffy-saves-new
|
|
653
|
+
{
|
|
654
|
+
display: flex;
|
|
655
|
+
gap: 0.5rem;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.squiffy-saves input[type="text"]
|
|
659
|
+
{
|
|
660
|
+
flex: 1;
|
|
661
|
+
min-width: 0;
|
|
662
|
+
padding: 0.3em 0.6em;
|
|
663
|
+
border: 1px solid var(--squiffy-border);
|
|
664
|
+
border-radius: 0.375em;
|
|
665
|
+
background-color: var(--squiffy-background);
|
|
666
|
+
color: inherit;
|
|
667
|
+
font: inherit;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.squiffy-saves-list
|
|
671
|
+
{
|
|
672
|
+
list-style: none;
|
|
673
|
+
margin: 0.75rem 0 0;
|
|
674
|
+
padding: 0;
|
|
675
|
+
max-height: 50vh;
|
|
676
|
+
overflow-y: auto;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.squiffy-saves-empty
|
|
680
|
+
{
|
|
681
|
+
padding: 0.75rem 0;
|
|
682
|
+
color: var(--squiffy-muted);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.squiffy-saves-row
|
|
686
|
+
{
|
|
687
|
+
padding: 0.5rem 0;
|
|
688
|
+
border-top: 1px solid var(--squiffy-border);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.squiffy-saves-line
|
|
692
|
+
{
|
|
693
|
+
display: flex;
|
|
694
|
+
align-items: center;
|
|
695
|
+
gap: 0.5rem;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.squiffy-saves-info
|
|
699
|
+
{
|
|
700
|
+
flex: 1;
|
|
701
|
+
min-width: 0;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.squiffy-saves-title
|
|
705
|
+
{
|
|
706
|
+
overflow: hidden;
|
|
707
|
+
text-overflow: ellipsis;
|
|
708
|
+
white-space: nowrap;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.squiffy-saves-meta
|
|
712
|
+
{
|
|
713
|
+
color: var(--squiffy-muted);
|
|
714
|
+
font-size: 0.8125rem;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.squiffy-saves-options
|
|
718
|
+
{
|
|
719
|
+
position: relative;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.squiffy-saves-menu
|
|
723
|
+
{
|
|
724
|
+
position: absolute;
|
|
725
|
+
right: 0;
|
|
726
|
+
top: 100%;
|
|
727
|
+
z-index: 1;
|
|
728
|
+
display: flex;
|
|
729
|
+
flex-direction: column;
|
|
730
|
+
min-width: 10rem;
|
|
731
|
+
margin-top: 0.25rem;
|
|
732
|
+
padding: 0.25rem;
|
|
733
|
+
border: 1px solid var(--squiffy-border);
|
|
734
|
+
border-radius: 0.5rem;
|
|
735
|
+
background-color: var(--squiffy-background);
|
|
736
|
+
box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.2);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.squiffy-saves-menu[hidden]
|
|
740
|
+
{
|
|
741
|
+
display: none;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/* In the top layer, placed by the script */
|
|
745
|
+
.squiffy-saves-menu:popover-open
|
|
746
|
+
{
|
|
747
|
+
position: fixed;
|
|
748
|
+
right: auto;
|
|
749
|
+
bottom: auto;
|
|
750
|
+
margin: 0;
|
|
751
|
+
color: inherit;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.squiffy-saves-menu button
|
|
755
|
+
{
|
|
756
|
+
padding: 0.4em 0.75em;
|
|
757
|
+
border: none;
|
|
758
|
+
border-radius: 0.25em;
|
|
759
|
+
background: none;
|
|
760
|
+
text-align: left;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.squiffy-saves-menu button:hover,
|
|
764
|
+
.squiffy-saves-menu button:focus-visible
|
|
765
|
+
{
|
|
766
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.squiffy-saves .squiffy-saves-danger
|
|
770
|
+
{
|
|
771
|
+
color: var(--squiffy-error);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.squiffy-saves-confirm
|
|
775
|
+
{
|
|
776
|
+
margin-top: 0.5rem;
|
|
777
|
+
padding: 0.75rem;
|
|
778
|
+
border: 1px solid var(--squiffy-border);
|
|
779
|
+
border-radius: 0.5rem;
|
|
780
|
+
background-color: color-mix(in srgb, var(--squiffy-text) 5%, transparent);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.squiffy-saves-confirm p
|
|
784
|
+
{
|
|
785
|
+
margin: 0 0 0.5rem;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.squiffy-saves-confirm-buttons
|
|
789
|
+
{
|
|
790
|
+
display: flex;
|
|
791
|
+
justify-content: flex-end;
|
|
792
|
+
gap: 0.5rem;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.squiffy-saves-footer
|
|
796
|
+
{
|
|
797
|
+
display: flex;
|
|
798
|
+
flex-wrap: wrap;
|
|
799
|
+
gap: 0.5rem 1.25rem;
|
|
800
|
+
margin-top: 0.75rem;
|
|
801
|
+
padding-top: 0.75rem;
|
|
802
|
+
border-top: 1px solid var(--squiffy-border);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.squiffy-saves-link
|
|
806
|
+
{
|
|
807
|
+
display: inline-flex;
|
|
808
|
+
align-items: center;
|
|
809
|
+
gap: 0.375em;
|
|
810
|
+
padding: 0;
|
|
811
|
+
border: none;
|
|
812
|
+
background: none;
|
|
813
|
+
color: var(--squiffy-link) !important;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.squiffy-saves-link:hover
|
|
817
|
+
{
|
|
818
|
+
text-decoration: underline;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/* A question for the player, such as whether to restart, in place of the browser's confirm() */
|
|
822
|
+
dialog.squiffy-confirm
|
|
823
|
+
{
|
|
824
|
+
width: min(24rem, calc(100vw - 2rem));
|
|
825
|
+
box-sizing: border-box;
|
|
826
|
+
padding: 1.25rem;
|
|
827
|
+
border: 1px solid var(--squiffy-border);
|
|
828
|
+
border-radius: 0.75rem;
|
|
829
|
+
background-color: var(--squiffy-background);
|
|
830
|
+
color: var(--squiffy-text);
|
|
831
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
832
|
+
font-size: 0.9375rem;
|
|
833
|
+
line-height: 1.4;
|
|
834
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
dialog.squiffy-confirm::backdrop
|
|
838
|
+
{
|
|
839
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.squiffy-confirm p
|
|
843
|
+
{
|
|
844
|
+
margin: 0 0 1rem;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.squiffy-confirm-buttons
|
|
848
|
+
{
|
|
849
|
+
display: flex;
|
|
850
|
+
justify-content: flex-end;
|
|
851
|
+
gap: 0.5rem;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.squiffy-confirm-button
|
|
855
|
+
{
|
|
856
|
+
padding: 0.3em 0.8em;
|
|
857
|
+
border: 1px solid var(--squiffy-border);
|
|
858
|
+
border-radius: 0.375em;
|
|
859
|
+
background: none;
|
|
860
|
+
font: inherit;
|
|
861
|
+
color: inherit;
|
|
862
|
+
cursor: pointer;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.squiffy-confirm-button:hover
|
|
866
|
+
{
|
|
867
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
.squiffy-confirm-button:focus-visible
|
|
871
|
+
{
|
|
872
|
+
outline: 2px solid var(--squiffy-link);
|
|
873
|
+
outline-offset: 2px;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.squiffy-confirm .squiffy-confirm-primary
|
|
877
|
+
{
|
|
878
|
+
border-color: var(--squiffy-link);
|
|
879
|
+
background-color: var(--squiffy-link);
|
|
880
|
+
color: var(--squiffy-background);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.squiffy-confirm .squiffy-confirm-danger
|
|
884
|
+
{
|
|
885
|
+
border-color: var(--squiffy-error);
|
|
886
|
+
background-color: var(--squiffy-error);
|
|
887
|
+
color: var(--squiffy-background);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.squiffy-confirm .squiffy-confirm-primary:hover,
|
|
891
|
+
.squiffy-confirm .squiffy-confirm-danger:hover
|
|
892
|
+
{
|
|
893
|
+
filter: brightness(1.1);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/* The Settings dialog (#452), for a story with "settings" in its squiffy.json */
|
|
897
|
+
dialog.squiffy-settings
|
|
898
|
+
{
|
|
899
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
900
|
+
max-height: calc(100vh - 2rem);
|
|
901
|
+
box-sizing: border-box;
|
|
902
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
903
|
+
border: 1px solid var(--squiffy-border);
|
|
904
|
+
border-radius: 0.75rem;
|
|
905
|
+
background-color: var(--squiffy-background);
|
|
906
|
+
color: var(--squiffy-text);
|
|
907
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
908
|
+
font-size: 0.9375rem;
|
|
909
|
+
line-height: 1.4;
|
|
910
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
dialog.squiffy-settings::backdrop
|
|
914
|
+
{
|
|
915
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.squiffy-settings-header
|
|
919
|
+
{
|
|
920
|
+
display: flex;
|
|
921
|
+
align-items: center;
|
|
922
|
+
justify-content: space-between;
|
|
923
|
+
margin-bottom: 0.5rem;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.squiffy-settings-header h2
|
|
927
|
+
{
|
|
928
|
+
margin: 0;
|
|
929
|
+
font-size: 1.125rem;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.squiffy-settings button,
|
|
933
|
+
.squiffy-settings select
|
|
934
|
+
{
|
|
935
|
+
font: inherit;
|
|
936
|
+
color: inherit;
|
|
937
|
+
cursor: pointer;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.squiffy-settings button:focus-visible,
|
|
941
|
+
.squiffy-settings input:focus-visible,
|
|
942
|
+
.squiffy-settings select:focus-visible
|
|
943
|
+
{
|
|
944
|
+
outline: 2px solid var(--squiffy-link);
|
|
945
|
+
outline-offset: 2px;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
button.squiffy-settings-close
|
|
949
|
+
{
|
|
950
|
+
display: inline-flex;
|
|
951
|
+
padding: 0.25em;
|
|
952
|
+
border: none;
|
|
953
|
+
border-radius: 0.375em;
|
|
954
|
+
background: none;
|
|
955
|
+
color: var(--squiffy-muted);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
button.squiffy-settings-close:hover
|
|
959
|
+
{
|
|
960
|
+
color: var(--squiffy-text);
|
|
961
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
button.squiffy-settings-close svg
|
|
965
|
+
{
|
|
966
|
+
width: 1.25em;
|
|
967
|
+
height: 1.25em;
|
|
968
|
+
fill: none;
|
|
969
|
+
stroke: currentColor;
|
|
970
|
+
stroke-width: 2;
|
|
971
|
+
stroke-linecap: round;
|
|
972
|
+
stroke-linejoin: round;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.squiffy-setting
|
|
976
|
+
{
|
|
977
|
+
display: flex;
|
|
978
|
+
align-items: center;
|
|
979
|
+
justify-content: space-between;
|
|
980
|
+
gap: 1rem;
|
|
981
|
+
padding: 0.75rem 0;
|
|
982
|
+
border-bottom: 1px solid var(--squiffy-border);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.squiffy-setting-text
|
|
986
|
+
{
|
|
987
|
+
min-width: 0;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.squiffy-setting-text label
|
|
991
|
+
{
|
|
992
|
+
display: block;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.squiffy-setting-text p
|
|
996
|
+
{
|
|
997
|
+
margin: 0.125rem 0 0;
|
|
998
|
+
color: var(--squiffy-muted);
|
|
999
|
+
font-size: 0.875em;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.squiffy-setting select
|
|
1003
|
+
{
|
|
1004
|
+
flex: none;
|
|
1005
|
+
max-width: 50%;
|
|
1006
|
+
padding: 0.25em 0.5em;
|
|
1007
|
+
border: 1px solid var(--squiffy-border);
|
|
1008
|
+
border-radius: 0.375em;
|
|
1009
|
+
background-color: var(--squiffy-background);
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/* A toggle is a switch */
|
|
1013
|
+
.squiffy-setting input[type=checkbox]
|
|
1014
|
+
{
|
|
1015
|
+
appearance: none;
|
|
1016
|
+
flex: none;
|
|
1017
|
+
position: relative;
|
|
1018
|
+
width: 2.5em;
|
|
1019
|
+
height: 1.5em;
|
|
1020
|
+
margin: 0;
|
|
1021
|
+
border-radius: 0.75em;
|
|
1022
|
+
background-color: color-mix(in srgb, var(--squiffy-text) 25%, transparent);
|
|
1023
|
+
cursor: pointer;
|
|
1024
|
+
transition: background-color 0.15s;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.squiffy-setting input[type=checkbox]::before
|
|
1028
|
+
{
|
|
1029
|
+
content: "";
|
|
1030
|
+
position: absolute;
|
|
1031
|
+
top: 0.1875em;
|
|
1032
|
+
left: 0.1875em;
|
|
1033
|
+
width: 1.125em;
|
|
1034
|
+
height: 1.125em;
|
|
1035
|
+
border-radius: 50%;
|
|
1036
|
+
background-color: var(--squiffy-background);
|
|
1037
|
+
transition: transform 0.15s;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.squiffy-setting input[type=checkbox]:checked
|
|
1041
|
+
{
|
|
1042
|
+
background-color: var(--squiffy-link);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.squiffy-setting input[type=checkbox]:checked::before
|
|
1046
|
+
{
|
|
1047
|
+
transform: translateX(1em);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
.squiffy-setting-slider
|
|
1051
|
+
{
|
|
1052
|
+
display: flex;
|
|
1053
|
+
flex: none;
|
|
1054
|
+
align-items: center;
|
|
1055
|
+
gap: 0.5rem;
|
|
1056
|
+
width: 45%;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.squiffy-setting-slider input
|
|
1060
|
+
{
|
|
1061
|
+
flex: 1;
|
|
1062
|
+
min-width: 0;
|
|
1063
|
+
accent-color: var(--squiffy-link);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.squiffy-setting-slider output
|
|
1067
|
+
{
|
|
1068
|
+
min-width: 2ch;
|
|
1069
|
+
text-align: end;
|
|
1070
|
+
font-variant-numeric: tabular-nums;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
.squiffy-settings-footer
|
|
1074
|
+
{
|
|
1075
|
+
display: flex;
|
|
1076
|
+
justify-content: flex-end;
|
|
1077
|
+
margin-top: 1rem;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
button.squiffy-settings-reset
|
|
1081
|
+
{
|
|
1082
|
+
padding: 0.3em 0.8em;
|
|
1083
|
+
border: 1px solid var(--squiffy-border);
|
|
1084
|
+
border-radius: 0.375em;
|
|
1085
|
+
background: none;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
button.squiffy-settings-reset:hover
|
|
1089
|
+
{
|
|
1090
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
@media (prefers-reduced-motion: reduce)
|
|
1094
|
+
{
|
|
1095
|
+
.squiffy-setting input[type=checkbox],
|
|
1096
|
+
.squiffy-setting input[type=checkbox]::before
|
|
1097
|
+
{
|
|
1098
|
+
transition: none;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/* Panels (squiffy.json's "panels"): passages always to hand, beside the story or in a dialog */
|
|
1103
|
+
:root
|
|
1104
|
+
{
|
|
1105
|
+
/* The width of a side panel */
|
|
1106
|
+
--squiffy-side-width: 16rem;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/* A panel's button in the header, when it has a label rather than an icon */
|
|
1110
|
+
button.squiffy-panel-text-button
|
|
1111
|
+
{
|
|
1112
|
+
padding: 0.375em 0.625em;
|
|
1113
|
+
line-height: 1.25;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/* Space between the panels' buttons and the page's own */
|
|
1117
|
+
button.squiffy-panel-button:not(:has(+ button.squiffy-panel-button))
|
|
1118
|
+
{
|
|
1119
|
+
margin-right: 0.5em;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/* The side panels. Like the header, they're smaller than the story text. */
|
|
1123
|
+
aside.squiffy-panels-side
|
|
1124
|
+
{
|
|
1125
|
+
font-size: 0.9375rem;
|
|
1126
|
+
line-height: 1.5;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
aside.squiffy-panels-side[hidden],
|
|
1130
|
+
aside.squiffy-panels-side > section.squiffy-panel[hidden]
|
|
1131
|
+
{
|
|
1132
|
+
display: none;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
aside.squiffy-panels-side > section.squiffy-panel + section.squiffy-panel
|
|
1136
|
+
{
|
|
1137
|
+
margin-top: 1rem;
|
|
1138
|
+
padding-top: 1rem;
|
|
1139
|
+
border-top: 1px solid var(--squiffy-border);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
.squiffy-panel > :first-child
|
|
1143
|
+
{
|
|
1144
|
+
margin-top: 0;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
.squiffy-panel > :last-child
|
|
1148
|
+
{
|
|
1149
|
+
margin-bottom: 0;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.squiffy-panel img
|
|
1153
|
+
{
|
|
1154
|
+
max-width: 100%;
|
|
1155
|
+
height: auto;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/* On a screen too narrow for the story and a side panel, the panel is a button in the header,
|
|
1159
|
+
which shows it in a dialog */
|
|
1160
|
+
@media (min-width: 64rem)
|
|
1161
|
+
{
|
|
1162
|
+
button.squiffy-panel-side-button
|
|
1163
|
+
{
|
|
1164
|
+
display: none;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
@media (max-width: 63.99rem)
|
|
1169
|
+
{
|
|
1170
|
+
aside.squiffy-panels-side
|
|
1171
|
+
{
|
|
1172
|
+
display: none;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/* The dialog a panel's button opens */
|
|
1177
|
+
dialog.squiffy-panel-dialog
|
|
1178
|
+
{
|
|
1179
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
1180
|
+
max-height: calc(100vh - 2rem);
|
|
1181
|
+
box-sizing: border-box;
|
|
1182
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
1183
|
+
border: 1px solid var(--squiffy-border);
|
|
1184
|
+
border-radius: 0.75rem;
|
|
1185
|
+
background-color: var(--squiffy-background);
|
|
1186
|
+
color: var(--squiffy-text);
|
|
1187
|
+
font-family: var(--squiffy-font-family, inherit);
|
|
1188
|
+
font-size: var(--squiffy-font-size, 1rem);
|
|
1189
|
+
line-height: var(--squiffy-line-height, 1.5);
|
|
1190
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
dialog.squiffy-panel-dialog::backdrop
|
|
1194
|
+
{
|
|
1195
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
.squiffy-panel-dialog-header
|
|
1199
|
+
{
|
|
1200
|
+
display: flex;
|
|
1201
|
+
align-items: center;
|
|
1202
|
+
justify-content: space-between;
|
|
1203
|
+
gap: 1rem;
|
|
1204
|
+
margin-bottom: 0.75rem;
|
|
1205
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.squiffy-panel-dialog-header h2
|
|
1209
|
+
{
|
|
1210
|
+
margin: 0;
|
|
1211
|
+
font-size: 1.125rem;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
button.squiffy-panel-dialog-close
|
|
1215
|
+
{
|
|
1216
|
+
display: inline-flex;
|
|
1217
|
+
padding: 0.25em;
|
|
1218
|
+
border: none;
|
|
1219
|
+
border-radius: 0.375em;
|
|
1220
|
+
background: none;
|
|
1221
|
+
color: var(--squiffy-muted);
|
|
1222
|
+
cursor: pointer;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
button.squiffy-panel-dialog-close:hover
|
|
1226
|
+
{
|
|
1227
|
+
color: var(--squiffy-text);
|
|
1228
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
button.squiffy-panel-dialog-close:focus-visible
|
|
1232
|
+
{
|
|
1233
|
+
outline: 2px solid var(--squiffy-link);
|
|
1234
|
+
outline-offset: 2px;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
button.squiffy-panel-dialog-close svg
|
|
1238
|
+
{
|
|
1239
|
+
width: 1.25em;
|
|
1240
|
+
height: 1.25em;
|
|
1241
|
+
fill: none;
|
|
1242
|
+
stroke: currentColor;
|
|
1243
|
+
stroke-width: 2;
|
|
1244
|
+
stroke-linecap: round;
|
|
1245
|
+
stroke-linejoin: round;
|
|
143
1246
|
}
|