@novely/solid-renderer 0.4.2 → 0.5.1
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/index.jsx +41 -5
- package/dist/renderer.d.ts +1 -0
- package/dist/styles/index.css +37 -7
- package/package.json +1 -1
package/dist/index.jsx
CHANGED
|
@@ -508,6 +508,31 @@ var Game = (props) => {
|
|
|
508
508
|
>{data.t("Sumbit")}</button>
|
|
509
509
|
</div>
|
|
510
510
|
</div></Modal>
|
|
511
|
+
<Modal isOpen={() => props.state.exitPromptShown}><div class="dialog-container">
|
|
512
|
+
<span class="dialog-fix" aria-hidden="true"></span>
|
|
513
|
+
<div class="dialog-backdrop" />
|
|
514
|
+
<div class="dialog-panel exit-dialog-panel">
|
|
515
|
+
<span
|
|
516
|
+
class="dialog-panel-label"
|
|
517
|
+
>{data.t("ExitDialogWarning")}</span>
|
|
518
|
+
<div class="exit-dialog-panel-buttons">
|
|
519
|
+
<button
|
|
520
|
+
type="button"
|
|
521
|
+
class="button"
|
|
522
|
+
onClick={() => {
|
|
523
|
+
setState("exitPromptShown", false);
|
|
524
|
+
}}
|
|
525
|
+
>{data.t("ExitDialogBack")}</button>
|
|
526
|
+
<button
|
|
527
|
+
type="button"
|
|
528
|
+
class="button"
|
|
529
|
+
onClick={() => {
|
|
530
|
+
data.options.exit(true);
|
|
531
|
+
}}
|
|
532
|
+
>{data.t("ExitDialogExit")}</button>
|
|
533
|
+
</div>
|
|
534
|
+
</div>
|
|
535
|
+
</div></Modal>
|
|
511
536
|
<div data-custom={true}><For each={layers()}>{(value) => value.dom}</For></div>
|
|
512
537
|
<div
|
|
513
538
|
class="action-text"
|
|
@@ -576,7 +601,9 @@ var Game = (props) => {
|
|
|
576
601
|
type="button"
|
|
577
602
|
class="button control-panel__button"
|
|
578
603
|
title={data.t("Exit")}
|
|
579
|
-
onClick={
|
|
604
|
+
onClick={() => {
|
|
605
|
+
data.options.exit();
|
|
606
|
+
}}
|
|
580
607
|
>
|
|
581
608
|
<span class="control-panel__button__content">{data.t("Exit")}</span>
|
|
582
609
|
<Icon class="control-panel__button__icon" children={Icon.Exit()} />
|
|
@@ -764,7 +791,8 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside" } = {}) =>
|
|
|
764
791
|
mainmenu: {
|
|
765
792
|
items: []
|
|
766
793
|
},
|
|
767
|
-
screen: "mainmenu"
|
|
794
|
+
screen: "mainmenu",
|
|
795
|
+
exitPromptShown: false
|
|
768
796
|
});
|
|
769
797
|
const store = {
|
|
770
798
|
characters: {},
|
|
@@ -824,8 +852,10 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside" } = {}) =>
|
|
|
824
852
|
setState("characters", character, { style, visible: true });
|
|
825
853
|
const { canvas: element } = store.characters[character];
|
|
826
854
|
element.className = "";
|
|
827
|
-
|
|
828
|
-
|
|
855
|
+
if (className) {
|
|
856
|
+
void element.offsetHeight;
|
|
857
|
+
element.className = className;
|
|
858
|
+
}
|
|
829
859
|
},
|
|
830
860
|
remove(className, style, duration) {
|
|
831
861
|
return (resolve, restoring) => {
|
|
@@ -838,7 +868,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside" } = {}) =>
|
|
|
838
868
|
setState("characters", character, { visible: false });
|
|
839
869
|
resolve();
|
|
840
870
|
}, duration);
|
|
841
|
-
|
|
871
|
+
if (className) {
|
|
872
|
+
store.characters[character].canvas.className = className;
|
|
873
|
+
}
|
|
842
874
|
setState("characters", character, { style, timeoutId });
|
|
843
875
|
};
|
|
844
876
|
}
|
|
@@ -863,6 +895,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside" } = {}) =>
|
|
|
863
895
|
},
|
|
864
896
|
clear(goingBack, keep, keepCharacters) {
|
|
865
897
|
return (resolve) => {
|
|
898
|
+
setState("exitPromptShown", false);
|
|
866
899
|
if (!keep.has("showBackground"))
|
|
867
900
|
setState("background", "#000");
|
|
868
901
|
if (!keep.has("choice"))
|
|
@@ -994,6 +1027,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside" } = {}) =>
|
|
|
994
1027
|
ui: {
|
|
995
1028
|
showScreen(name) {
|
|
996
1029
|
setState("screen", name);
|
|
1030
|
+
},
|
|
1031
|
+
showExitPrompt() {
|
|
1032
|
+
setState("exitPromptShown", true);
|
|
997
1033
|
}
|
|
998
1034
|
}
|
|
999
1035
|
};
|
package/dist/renderer.d.ts
CHANGED
package/dist/styles/index.css
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
/* src/styles/control-panel/control-panel.css */
|
|
82
82
|
.control-panel {
|
|
83
|
-
z-index:
|
|
83
|
+
z-index: 30;
|
|
84
84
|
justify-content: end;
|
|
85
85
|
display: flex;
|
|
86
86
|
position: fixed;
|
|
@@ -309,13 +309,23 @@
|
|
|
309
309
|
|
|
310
310
|
/* src/styles/dialog/dialog.css */
|
|
311
311
|
.dialog {
|
|
312
|
-
z-index:
|
|
312
|
+
z-index: 25;
|
|
313
313
|
position: absolute;
|
|
314
314
|
top: 0;
|
|
315
315
|
bottom: 0;
|
|
316
316
|
left: 0;
|
|
317
317
|
right: 0;
|
|
318
318
|
}
|
|
319
|
+
.dialog-backdrop {
|
|
320
|
+
z-index: 23;
|
|
321
|
+
pointer-events: none;
|
|
322
|
+
background-color: var(--novely-dialog-backdrop-background-color, #1616166c);
|
|
323
|
+
position: fixed;
|
|
324
|
+
top: 0;
|
|
325
|
+
bottom: 0;
|
|
326
|
+
left: 0;
|
|
327
|
+
right: 0;
|
|
328
|
+
}
|
|
319
329
|
.dialog-container {
|
|
320
330
|
justify-content: center;
|
|
321
331
|
align-items: center;
|
|
@@ -329,7 +339,7 @@
|
|
|
329
339
|
}
|
|
330
340
|
.dialog-panel {
|
|
331
341
|
text-align: left;
|
|
332
|
-
z-index:
|
|
342
|
+
z-index: 24;
|
|
333
343
|
flex-direction: column;
|
|
334
344
|
align-items: stretch;
|
|
335
345
|
min-width: 50vw;
|
|
@@ -379,10 +389,10 @@
|
|
|
379
389
|
}
|
|
380
390
|
.input-dialog-panel {
|
|
381
391
|
color: #fff;
|
|
382
|
-
background-
|
|
383
|
-
background-
|
|
384
|
-
background-position: 0 0, 50px 50px;
|
|
385
|
-
background-size: 100px 100px;
|
|
392
|
+
background-image: var(--novely-dialog-background-image, radial-gradient(#d6608998 20%, transparent 20%), radial-gradient(#d6608998 20%, transparent 20%));
|
|
393
|
+
background-color: var(--novely-dialog-background-color, #f092b4d8);
|
|
394
|
+
background-position: var(--novely-dialog-background-position, 0 0, 50px 50px);
|
|
395
|
+
background-size: var(--novely-dialog-background-size, 100px 100px);
|
|
386
396
|
border: 3px solid #fff;
|
|
387
397
|
border-radius: 14px;
|
|
388
398
|
justify-content: center;
|
|
@@ -399,6 +409,26 @@
|
|
|
399
409
|
|
|
400
410
|
/* src/styles/input-dialog/index.css */
|
|
401
411
|
|
|
412
|
+
/* src/styles/exit-dialog/exit-dialog.css */
|
|
413
|
+
.exit-dialog-panel {
|
|
414
|
+
color: #fff;
|
|
415
|
+
background-image: var(--novely-dialog-background-image, radial-gradient(#d6608998 20%, transparent 20%), radial-gradient(#d6608998 20%, transparent 20%));
|
|
416
|
+
background-color: var(--novely-dialog-background-color, #f092b4d8);
|
|
417
|
+
background-position: var(--novely-dialog-background-position, 0 0, 50px 50px);
|
|
418
|
+
background-size: var(--novely-dialog-background-size, 100px 100px);
|
|
419
|
+
border: 3px solid #fff;
|
|
420
|
+
border-radius: 14px;
|
|
421
|
+
justify-content: center;
|
|
422
|
+
align-items: center;
|
|
423
|
+
box-shadow: 1px 1px 4px #00000072;
|
|
424
|
+
}
|
|
425
|
+
.exit-dialog-panel-buttons {
|
|
426
|
+
gap: .5rem;
|
|
427
|
+
display: flex;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/* src/styles/exit-dialog/index.css */
|
|
431
|
+
|
|
402
432
|
/* src/styles/main-menu/main-menu.css */
|
|
403
433
|
.main-menu {
|
|
404
434
|
background-image: var(--novely-main-menu-background-image);
|