@novely/solid-renderer 0.0.3 → 0.0.5
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/components/Modal.d.ts +2 -2
- package/dist/index.jsx +97 -144
- package/dist/styles/index.css +500 -0
- package/dist/utils.d.ts +1 -2
- package/package.json +2 -3
- package/dist/index.css +0 -448
- package/dist/styles/styles.d.ts +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FlowComponent, Accessor } from 'solid-js';
|
|
2
2
|
interface ModalProps {
|
|
3
3
|
isOpen: Accessor<boolean>;
|
|
4
|
-
setIsOpen
|
|
5
|
-
onClose
|
|
4
|
+
setIsOpen?: (value: boolean) => void;
|
|
5
|
+
onClose?: () => void;
|
|
6
6
|
}
|
|
7
7
|
declare const Modal: FlowComponent<ModalProps>;
|
|
8
8
|
export { Modal };
|
package/dist/index.jsx
CHANGED
|
@@ -31,9 +31,6 @@ var canvasDrawImages = (canvas = document.createElement("canvas"), ctx = canvas.
|
|
|
31
31
|
var url = (str) => {
|
|
32
32
|
return `url(${str})`;
|
|
33
33
|
};
|
|
34
|
-
var join = (...elements) => {
|
|
35
|
-
return elements.filter(Boolean).join(" ");
|
|
36
|
-
};
|
|
37
34
|
|
|
38
35
|
// src/context/index.tsx
|
|
39
36
|
import { from, createContext, useContext } from "solid-js";
|
|
@@ -58,42 +55,6 @@ var useData = () => {
|
|
|
58
55
|
// src/screens/game.tsx
|
|
59
56
|
import { createEffect as createEffect2, createSignal, untrack as untrack2, For, Show as Show2 } from "solid-js";
|
|
60
57
|
|
|
61
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/root.module.css?esbuild-css-modules-plugin-building
|
|
62
|
-
var root_module_default = { "root": "n-root" };
|
|
63
|
-
|
|
64
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/button.module.css?esbuild-css-modules-plugin-building
|
|
65
|
-
var button_module_default = { "button": "n-button", "buttonControlPanel": "n-buttonControlPanel", "buttonInputDialogPanel": "n-buttonInputDialogPanel", "buttonMainMenu": "n-buttonMainMenu", "buttonSaves": "n-buttonSaves", "buttonSavesDelete": "n-buttonSavesDelete", "buttonSettings": "n-buttonSettings" };
|
|
66
|
-
|
|
67
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/characters.module.css?esbuild-css-modules-plugin-building
|
|
68
|
-
var characters_module_default = { "characters": "n-characters" };
|
|
69
|
-
|
|
70
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/dialog.module.css?esbuild-css-modules-plugin-building
|
|
71
|
-
var dialog_module_default = { "dialog": "n-dialog", "dialogContainer": "n-dialogContainer", "dialogContainerWithPerson": "n-dialogContainerWithPerson", "dialogContent": "n-dialogContent", "dialogName": "n-dialogName", "dialogPerson": "n-dialogPerson", "pers": "n-pers", "text": "n-text" };
|
|
72
|
-
|
|
73
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/headlessDialog.module.css?esbuild-css-modules-plugin-building
|
|
74
|
-
var headlessDialog_module_default = { "headlessDialog": "n-headlessDialog", "headlessDialogContainer": "n-headlessDialogContainer", "headlessDialogFix": "n-headlessDialogFix", "headlessDialogPanel": "n-headlessDialogPanel", "headlessDialogPanelLabel": "n-headlessDialogPanelLabel", "inputDialogLabel": "n-inputDialogLabel", "inputDialogPanel": "n-inputDialogPanel" };
|
|
75
|
-
|
|
76
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/mainMenu.module.css?esbuild-css-modules-plugin-building
|
|
77
|
-
var mainMenu_module_default = { "controls": "n-controls", "mainMenu": "n-mainMenu" };
|
|
78
|
-
|
|
79
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/saves.module.css?esbuild-css-modules-plugin-building
|
|
80
|
-
var saves_module_default = { "controls": "n-controls", "list": "n-list", "saves": "n-saves" };
|
|
81
|
-
|
|
82
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/controlPanel.module.css?esbuild-css-modules-plugin-building
|
|
83
|
-
var controlPanel_module_default = { "controlPanel": "n-controlPanel" };
|
|
84
|
-
|
|
85
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/settings.module.css?esbuild-css-modules-plugin-building
|
|
86
|
-
var settings_module_default = { "content": "n-content", "controls": "n-controls", "select": "n-select", "settings": "n-settings" };
|
|
87
|
-
|
|
88
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/loading.module.css?esbuild-css-modules-plugin-building
|
|
89
|
-
var loading_module_default = { "ldsEllipsis": "n-lds-ellipsis", "ldsEllipsis1": "n-lds-ellipsis1", "ldsEllipsis2": "n-lds-ellipsis2", "ldsEllipsis3": "n-lds-ellipsis3", "loading": "n-loading" };
|
|
90
|
-
|
|
91
|
-
// esbuild-css-modules-plugin-namespace:./src/styles/fullscreenText.module.css?esbuild-css-modules-plugin-building
|
|
92
|
-
var fullscreenText_module_default = { "fullscreenText": "n-fullscreenText" };
|
|
93
|
-
|
|
94
|
-
// src/styles/styles.ts
|
|
95
|
-
Object.assign(root_module_default, button_module_default, characters_module_default, dialog_module_default, headlessDialog_module_default, mainMenu_module_default, saves_module_default, controlPanel_module_default, settings_module_default, loading_module_default, fullscreenText_module_default);
|
|
96
|
-
|
|
97
58
|
// src/components/DialogName.tsx
|
|
98
59
|
var DialogName = (props) => {
|
|
99
60
|
const color = () => {
|
|
@@ -102,7 +63,7 @@ var DialogName = (props) => {
|
|
|
102
63
|
return c ? c in cs ? cs[c].color : "#000" : "#000";
|
|
103
64
|
};
|
|
104
65
|
return <span
|
|
105
|
-
class=
|
|
66
|
+
class="action-dialog-name"
|
|
106
67
|
style={{
|
|
107
68
|
color: color(),
|
|
108
69
|
opacity: props.character ? 1 : 0,
|
|
@@ -143,16 +104,16 @@ var Modal = (props) => {
|
|
|
143
104
|
}
|
|
144
105
|
};
|
|
145
106
|
const close = () => {
|
|
146
|
-
props.setIsOpen(false);
|
|
147
|
-
props.onClose();
|
|
107
|
+
props.setIsOpen && props.setIsOpen(false);
|
|
108
|
+
props.onClose && untrack(props.onClose);
|
|
148
109
|
};
|
|
149
|
-
createEffect(on(props.isOpen, (isOpen) => isOpen && untrack(props.onClose), { defer: true }));
|
|
110
|
+
createEffect(on(props.isOpen, (isOpen) => isOpen && props.onClose && untrack(props.onClose), { defer: true }));
|
|
150
111
|
addEventListener("keydown", handleKeydown);
|
|
151
112
|
onCleanup(() => removeEventListener("keydown", handleKeydown));
|
|
152
113
|
return <Show when={props.isOpen()}><div
|
|
153
114
|
role="dialog"
|
|
115
|
+
class="dialog"
|
|
154
116
|
aria-modal={true}
|
|
155
|
-
class={root_module_default.headlessDialog}
|
|
156
117
|
ref={(element) => {
|
|
157
118
|
modalWindow = element;
|
|
158
119
|
clickOutside(element, close);
|
|
@@ -161,25 +122,30 @@ var Modal = (props) => {
|
|
|
161
122
|
};
|
|
162
123
|
|
|
163
124
|
// ../typewriter/dist/index.js
|
|
164
|
-
var
|
|
165
|
-
|
|
125
|
+
var b = () => Math.min(90 * Math.random() + 100, 90);
|
|
126
|
+
var v = ({ node: N, text: m, ended: c, speed: T = b }) => {
|
|
127
|
+
let e = document.createElement("span");
|
|
166
128
|
e.innerHTML = m;
|
|
167
|
-
let
|
|
129
|
+
let l = (t, M) => {
|
|
168
130
|
let d = [];
|
|
169
|
-
return
|
|
170
|
-
|
|
131
|
+
return t.childNodes.forEach((s) => {
|
|
132
|
+
s.nodeName === "#text" && (d.push(s), M && (s.textContent = "")), d.push(...l(s, M));
|
|
171
133
|
}), d;
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
|
|
134
|
+
}, u = l(e.cloneNode(true), false).map((t) => [...t.textContent]), q = l(e, true);
|
|
135
|
+
N.appendChild(e);
|
|
136
|
+
let n = 0, a = 0, r = false, p, i = () => {
|
|
137
|
+
p = requestAnimationFrame(x);
|
|
138
|
+
}, o = () => {
|
|
139
|
+
cancelAnimationFrame(p);
|
|
140
|
+
}, f = 0, h = 0, x = (t) => {
|
|
141
|
+
t >= h + f ? (h = t, f = T(), C()) : r ? o() : i();
|
|
142
|
+
}, C = () => {
|
|
143
|
+
u[n]?.length > a ? (q[n].textContent += u[n][a++], i()) : n++ < u.length ? (a = 0, i()) : (r = true, o(), c && c());
|
|
178
144
|
};
|
|
179
|
-
return
|
|
180
|
-
return
|
|
145
|
+
return C(), { end() {
|
|
146
|
+
return o(), r ? (e.remove(), true) : (e.innerHTML = m, r = true, false);
|
|
181
147
|
}, destroy() {
|
|
182
|
-
|
|
148
|
+
o(), e.remove();
|
|
183
149
|
} };
|
|
184
150
|
};
|
|
185
151
|
|
|
@@ -195,22 +161,30 @@ var Game = (props) => {
|
|
|
195
161
|
const [auto, setAuto] = createSignal(false);
|
|
196
162
|
const getCurrentContent = () => {
|
|
197
163
|
const state = props.state;
|
|
198
|
-
|
|
164
|
+
if (state.dialog.content) {
|
|
165
|
+
return [store.dialogRef, state.dialog.content];
|
|
166
|
+
} else {
|
|
167
|
+
return [store.textRef, state.text.content];
|
|
168
|
+
}
|
|
199
169
|
};
|
|
200
170
|
createEffect2(() => {
|
|
201
|
-
const [
|
|
171
|
+
const [element, text] = getCurrentContent();
|
|
202
172
|
writer?.destroy();
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
173
|
+
if (!element)
|
|
174
|
+
return;
|
|
175
|
+
writer = v({
|
|
176
|
+
node: element,
|
|
177
|
+
text,
|
|
178
|
+
ended() {
|
|
179
|
+
const next = untrack2(auto);
|
|
180
|
+
if (next) {
|
|
208
181
|
untrack2(clearTypewriterEffect);
|
|
182
|
+
}
|
|
209
183
|
},
|
|
210
|
-
()
|
|
184
|
+
speed() {
|
|
211
185
|
return data.storeData().meta[1];
|
|
212
186
|
}
|
|
213
|
-
);
|
|
187
|
+
});
|
|
214
188
|
});
|
|
215
189
|
const onChoicesButtonClick = ([disabled, i]) => {
|
|
216
190
|
if (disabled)
|
|
@@ -235,14 +209,14 @@ var Game = (props) => {
|
|
|
235
209
|
resolve?.();
|
|
236
210
|
};
|
|
237
211
|
const layers = () => Object.values(props.state.layers);
|
|
238
|
-
return <div class=
|
|
239
|
-
<div data-characters={true} class=
|
|
212
|
+
return <div class="root" style={background()}>
|
|
213
|
+
<div data-characters={true} class="characters"><For each={Object.entries(props.state.characters)}>{([character, data2]) => <Show2 when={data2.visible}><Character
|
|
240
214
|
character={character}
|
|
241
215
|
data={data2}
|
|
242
216
|
characters={store.characters}
|
|
243
217
|
/></Show2>}</For></div>
|
|
244
218
|
<div
|
|
245
|
-
class=
|
|
219
|
+
class="action-dialog"
|
|
246
220
|
style={{ display: props.state.dialog.visible ? "flex" : "none" }}
|
|
247
221
|
onClick={clearTypewriterEffect}
|
|
248
222
|
>
|
|
@@ -251,8 +225,11 @@ var Game = (props) => {
|
|
|
251
225
|
name={props.state.dialog.name}
|
|
252
226
|
characters={characters}
|
|
253
227
|
/>
|
|
254
|
-
<div
|
|
255
|
-
|
|
228
|
+
<div
|
|
229
|
+
class="action-dialog-container"
|
|
230
|
+
data-no-person={!(props.state.dialog.character && props.state.dialog.emotion)}
|
|
231
|
+
>
|
|
232
|
+
<div class="action-dialog-person"><Show2 when={props.state.dialog.emotion} keyed>{(emotion) => {
|
|
256
233
|
const character = props.state.dialog.character;
|
|
257
234
|
if (!character)
|
|
258
235
|
return null;
|
|
@@ -266,29 +243,28 @@ var Game = (props) => {
|
|
|
266
243
|
const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
|
|
267
244
|
return canvas;
|
|
268
245
|
}}</Show2></div>
|
|
269
|
-
<p class=
|
|
246
|
+
<p class="action-dialog-content" ref={store.dialogRef}> </p>
|
|
270
247
|
</div>
|
|
271
248
|
</div>
|
|
272
249
|
<Modal
|
|
273
250
|
isOpen={() => props.state.choices.visible}
|
|
274
|
-
|
|
275
|
-
}}
|
|
276
|
-
onClose={() => {
|
|
277
|
-
}}
|
|
278
|
-
><div class={root_module_default.headlessDialogContainer}>
|
|
251
|
+
><div class="dialog-container">
|
|
279
252
|
<span
|
|
280
|
-
class=
|
|
253
|
+
class="dialog-fix"
|
|
281
254
|
aria-hidden="true"
|
|
282
255
|
></span>
|
|
283
|
-
<div class=
|
|
284
|
-
<span
|
|
256
|
+
<div class="dialog-panel">
|
|
257
|
+
<span
|
|
258
|
+
class="dialog-panel-label"
|
|
259
|
+
aria-hidden={!props.state.choices.question}
|
|
260
|
+
>{props.state.choices.question || <>ᅠ</>}</span>
|
|
285
261
|
<For each={props.state.choices.choices}>{([text, _, active], i) => {
|
|
286
262
|
const disabled = active ? !active() : false;
|
|
287
263
|
const index = i();
|
|
288
264
|
return <button
|
|
289
265
|
type="button"
|
|
266
|
+
class="button"
|
|
290
267
|
aria-disabled={disabled}
|
|
291
|
-
class={join(root_module_default.button, root_module_default.buttonChoices)}
|
|
292
268
|
onClick={[onChoicesButtonClick, [disabled, index]]}
|
|
293
269
|
>{text}</button>;
|
|
294
270
|
}}</For>
|
|
@@ -296,34 +272,30 @@ var Game = (props) => {
|
|
|
296
272
|
</div></Modal>
|
|
297
273
|
<Modal
|
|
298
274
|
isOpen={() => props.state.input.visible}
|
|
299
|
-
|
|
300
|
-
}}
|
|
301
|
-
onClose={() => {
|
|
302
|
-
}}
|
|
303
|
-
><div class={root_module_default.headlessDialogContainer}>
|
|
275
|
+
><div class="dialog-container">
|
|
304
276
|
<span
|
|
305
|
-
class=
|
|
277
|
+
class="dialog-fix"
|
|
306
278
|
aria-hidden="true"
|
|
307
279
|
></span>
|
|
308
|
-
<div class=
|
|
309
|
-
<label for="novely-input" class=
|
|
280
|
+
<div class="dialog-panel input-dialog-panel">
|
|
281
|
+
<label for="novely-input" class="input-dialog-label">
|
|
310
282
|
<span>{props.state.input.question}</span>
|
|
311
283
|
{props.state.input.element}
|
|
312
284
|
<span aria-live="polite">{props.state.input.error}</span>
|
|
313
285
|
</label>
|
|
314
286
|
<button
|
|
287
|
+
class="button dialog-input__button"
|
|
315
288
|
onClick={onInputButtonClick}
|
|
316
|
-
|
|
317
|
-
aria-disabled={props.state.input.error || !props.state.input.element?.validity.valid ? "true" : "false"}
|
|
289
|
+
aria-disabled={Boolean(props.state.input.error || !props.state.input.element?.validity.valid)}
|
|
318
290
|
>{data.t("Sumbit")}</button>
|
|
319
291
|
</div>
|
|
320
292
|
</div></Modal>
|
|
321
293
|
<div data-custom={true}><For each={layers()}>{(value) => value.dom}</For></div>
|
|
322
|
-
<div class=
|
|
323
|
-
<div class=
|
|
294
|
+
<div class="action-text" data-shown={Boolean(props.state.text.content)} ref={store.textRef} onClick={clearTypewriterEffect}> </div>
|
|
295
|
+
<div class="control-panel">
|
|
324
296
|
<button
|
|
325
297
|
type="button"
|
|
326
|
-
class=
|
|
298
|
+
class="button control-panel__button"
|
|
327
299
|
onClick={() => {
|
|
328
300
|
data.options.stack.back();
|
|
329
301
|
data.options.restore(data.options.stack.value);
|
|
@@ -331,21 +303,21 @@ var Game = (props) => {
|
|
|
331
303
|
>{data.t("GoBack")}</button>
|
|
332
304
|
<button
|
|
333
305
|
type="button"
|
|
334
|
-
class=
|
|
306
|
+
class="button control-panel__button"
|
|
335
307
|
onClick={() => {
|
|
336
308
|
data.options.save(false, "manual");
|
|
337
309
|
}}
|
|
338
310
|
>{data.t("DoSave")}</button>
|
|
339
311
|
<button
|
|
340
312
|
type="button"
|
|
341
|
-
class=
|
|
313
|
+
class="button control-panel__button"
|
|
342
314
|
onClick={() => {
|
|
343
315
|
setAuto((prev) => !prev);
|
|
344
316
|
}}
|
|
345
317
|
>{data.t(auto() ? "Stop" : "Auto")}</button>
|
|
346
318
|
<button
|
|
347
319
|
type="button"
|
|
348
|
-
class=
|
|
320
|
+
class="button control-panel__button"
|
|
349
321
|
onClick={() => {
|
|
350
322
|
data.options.save(false, "auto");
|
|
351
323
|
props.setState("screen", "settings");
|
|
@@ -353,7 +325,7 @@ var Game = (props) => {
|
|
|
353
325
|
>{data.t("Settings")}</button>
|
|
354
326
|
<button
|
|
355
327
|
type="button"
|
|
356
|
-
class=
|
|
328
|
+
class="button control-panel__button"
|
|
357
329
|
onClick={data.options.exit}
|
|
358
330
|
>{data.t("Exit")}</button>
|
|
359
331
|
</div>
|
|
@@ -363,17 +335,12 @@ var Game = (props) => {
|
|
|
363
335
|
// src/screens/mainmenu.tsx
|
|
364
336
|
var MainMenu = (props) => {
|
|
365
337
|
const data = useData();
|
|
366
|
-
return <div
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}}
|
|
371
|
-
|
|
372
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonMainMenu)} onClick={data.options.newGame}>{data.t("NewGame")}</button>
|
|
373
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonMainMenu)} onClick={() => data.options.restore()}>{data.t("LoadSave")}</button>
|
|
374
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonMainMenu)} onClick={() => props.setState("screen", "saves")}>{data.t("Saves")}</button>
|
|
375
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonMainMenu)} onClick={() => props.setState("screen", "settings")}>{data.t("Settings")}</button>
|
|
376
|
-
</div></div>;
|
|
338
|
+
return <div class="root main-menu">
|
|
339
|
+
<button type="button" class="button main-menu__button" onClick={data.options.newGame}>{data.t("NewGame")}</button>
|
|
340
|
+
<button type="button" class="button main-menu__button" onClick={() => data.options.restore()}>{data.t("LoadSave")}</button>
|
|
341
|
+
<button type="button" class="button main-menu__button" onClick={() => props.setState("screen", "saves")}>{data.t("Saves")}</button>
|
|
342
|
+
<button type="button" class="button main-menu__button" onClick={() => props.setState("screen", "settings")}>{data.t("Settings")}</button>
|
|
343
|
+
</div>;
|
|
377
344
|
};
|
|
378
345
|
|
|
379
346
|
// src/screens/saves.tsx
|
|
@@ -394,28 +361,23 @@ var Saves = (props) => {
|
|
|
394
361
|
return prev.saves = _saves, prev;
|
|
395
362
|
});
|
|
396
363
|
};
|
|
397
|
-
return <div
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
[root_module_default.saves]: true
|
|
401
|
-
}}
|
|
402
|
-
>
|
|
403
|
-
<div class={root_module_default.controls}><button type="button" class={join(root_module_default.button, root_module_default.buttonSaves)} onClick={() => props.setState("screen", "mainmenu")}>{data.t("GoBack")}</button></div>
|
|
404
|
-
<Show3 when={saves()} fallback={data.t("NoSaves")}><ol class={root_module_default.list}><For2 each={saves()}>{(save) => {
|
|
364
|
+
return <div class="root saves">
|
|
365
|
+
<div class="saves__column"><button type="button" class="button saves__button" onClick={() => props.setState("screen", "mainmenu")}>{data.t("GoBack")}</button></div>
|
|
366
|
+
<Show3 when={saves()} fallback={data.t("NoSaves")}><ol class="saves__list"><For2 each={saves()}>{(save) => {
|
|
405
367
|
const [date, type] = save[2];
|
|
406
368
|
const stringDate = capitalize(new Date(date).toLocaleDateString(language(), { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }));
|
|
407
369
|
const stringType = data.t(type === "auto" ? "Automatic" : "Manual");
|
|
408
|
-
return <li>
|
|
370
|
+
return <li class="saves__list-item">
|
|
409
371
|
<button
|
|
410
372
|
type="button"
|
|
411
|
-
class=
|
|
373
|
+
class="button saves__button-load"
|
|
412
374
|
aria-label={data.t("LoadASaveFrom") + " " + stringDate}
|
|
413
375
|
onClick={() => data.options.set(save)}
|
|
414
376
|
>
|
|
415
377
|
{stringDate}
|
|
416
378
|
<span style={{ "margin-left": "1em" }}>{stringType}</span>
|
|
417
379
|
</button>
|
|
418
|
-
<button type="reset" class=
|
|
380
|
+
<button type="reset" class="button" aria-label={data.t("DeleteASaveFrom") + " " + stringDate} onClick={[removeSave, date]}><span>{data.t("Remove")}</span></button>
|
|
419
381
|
</li>;
|
|
420
382
|
}}</For2></ol></Show3>
|
|
421
383
|
</div>;
|
|
@@ -442,25 +404,21 @@ var Settings = (props) => {
|
|
|
442
404
|
return prev.meta[1] = selected, prev;
|
|
443
405
|
});
|
|
444
406
|
};
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
>
|
|
452
|
-
<div class={root_module_default.controls}>
|
|
453
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonSettings)} onClick={() => props.setState("screen", "mainmenu")}>{data.t("HomeScreen")}</button>
|
|
454
|
-
<button type="button" class={join(root_module_default.button, root_module_default.buttonSettings)} onClick={() => data.options.restore()}>{data.t("ToTheGame")}</button>
|
|
407
|
+
const languageSelectID = createUniqueId();
|
|
408
|
+
const speedSelectID = createUniqueId();
|
|
409
|
+
return <div class="root settings">
|
|
410
|
+
<div class="settings__column">
|
|
411
|
+
<button type="button" class="button settings__button" onClick={() => props.setState("screen", "mainmenu")}>{data.t("HomeScreen")}</button>
|
|
412
|
+
<button type="button" class="button settings__button" onClick={() => data.options.restore()}>{data.t("ToTheGame")}</button>
|
|
455
413
|
</div>
|
|
456
|
-
<div class=
|
|
457
|
-
<div class=
|
|
458
|
-
<label for={
|
|
459
|
-
<select id={
|
|
414
|
+
<div class="settings__column">
|
|
415
|
+
<div class="select">
|
|
416
|
+
<label class="select__label" for={languageSelectID}>{data.t("Language")}</label>
|
|
417
|
+
<select class="select__select" id={languageSelectID} onChange={onLanguageSelect}><For3 each={data.options.languages}>{(lang) => <option value={lang} selected={lang === language()}>{capitalize(languageNames().of(lang) || lang)}</option>}</For3></select>
|
|
460
418
|
</div>
|
|
461
|
-
<div class=
|
|
462
|
-
<label for={
|
|
463
|
-
<select id={
|
|
419
|
+
<div class="select">
|
|
420
|
+
<label class="select__label" for={speedSelectID}>{data.t("TextSpeed")}</label>
|
|
421
|
+
<select class="select__select" id={speedSelectID} onChange={onSpeedSelect}><For3 each={[90, 140, 190]}>{(speed) => <option value={speed} selected={speed === textSpeed()}>{speed}</option>}</For3></select>
|
|
464
422
|
</div>
|
|
465
423
|
</div>
|
|
466
424
|
</div>;
|
|
@@ -468,12 +426,7 @@ var Settings = (props) => {
|
|
|
468
426
|
|
|
469
427
|
// src/screens/loading.tsx
|
|
470
428
|
var Loading = () => {
|
|
471
|
-
return <div
|
|
472
|
-
classList={{
|
|
473
|
-
[root_module_default.root]: true,
|
|
474
|
-
[root_module_default.loading]: true
|
|
475
|
-
}}
|
|
476
|
-
><div class={root_module_default.ldsEllipsis}>
|
|
429
|
+
return <div class="root loading"><div class="loading__animation">
|
|
477
430
|
<div />
|
|
478
431
|
<div />
|
|
479
432
|
<div />
|