@novely/solid-renderer 0.0.7 → 0.1.0

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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * These SVG icons are provided by Make Lemonade's Iconicicons (https://iconic.app/)
3
+ * under the "Do WTF You Want With" license.
4
+ */
5
+ import type { JSX } from 'solid-js';
6
+ type SVGProps = JSX.SvgSVGAttributes<SVGSVGElement>;
7
+ type IconProps = SVGProps & {
8
+ children: JSX.Element;
9
+ };
10
+ declare const Icon: {
11
+ (props: IconProps): JSX.Element;
12
+ Back(): JSX.Element;
13
+ Save(): JSX.Element;
14
+ Settings(): JSX.Element;
15
+ Exit(): JSX.Element;
16
+ };
17
+ export { Icon };
package/dist/index.jsx CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/renderer.tsx
2
- import { Switch, Match } from "solid-js";
2
+ import { Switch, Match, createEffect as createEffect3 } from "solid-js";
3
3
  import { createStore } from "solid-js/store";
4
4
 
5
5
  // src/utils.ts
@@ -31,6 +31,16 @@ var canvasDrawImages = (canvas = document.createElement("canvas"), ctx = canvas.
31
31
  var url = (str) => {
32
32
  return `url(${str})`;
33
33
  };
34
+ var escaped = {
35
+ '"': "&quot;",
36
+ "'": "&#39;",
37
+ "&": "&amp;",
38
+ "<": "&lt;",
39
+ ">": "&gt;"
40
+ };
41
+ var escape = (str) => {
42
+ return String(str).replace(/["'&<>]/g, (match) => escaped[match]);
43
+ };
34
44
 
35
45
  // src/context/index.tsx
36
46
  import { from, createContext, useContext } from "solid-js";
@@ -121,6 +131,29 @@ var Modal = (props) => {
121
131
  >{props.children}</div></Show>;
122
132
  };
123
133
 
134
+ // src/components/Icon.tsx
135
+ var Icon = (props) => {
136
+ return <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" {...props}>{props.children}</svg>;
137
+ };
138
+ Icon.Back = () => {
139
+ return <path d="m9.75 12 8.5-6.25v12.5L9.75 12ZM5.75 5.75v12.5" />;
140
+ };
141
+ Icon.Save = () => {
142
+ return <>
143
+ <path d="M6.75 19.25h10.5a2 2 0 0 0 2-2V9.828a2 2 0 0 0-.586-1.414l-3.078-3.078a2 2 0 0 0-1.414-.586H6.75a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2Z" />
144
+ <path d="M8.75 19v-3.25a1 1 0 0 1 1-1h4.5a1 1 0 0 1 1 1V19M8.75 5v3.25" />
145
+ </>;
146
+ };
147
+ Icon.Settings = () => {
148
+ return <>
149
+ <path d="M13.12 5.613a1 1 0 0 0-.991-.863h-.258a1 1 0 0 0-.99.863l-.087.632c-.056.403-.354.724-.732.874a5.225 5.225 0 0 0-.167.07c-.373.163-.81.15-1.136-.095l-.308-.23a1 1 0 0 0-1.307.092l-.188.188a1 1 0 0 0-.092 1.307l.23.308c.244.325.258.763.095 1.136a5.225 5.225 0 0 0-.07.167c-.15.378-.47.676-.874.732l-.632.087a1 1 0 0 0-.863.99v.258a1 1 0 0 0 .863.99l.632.087c.403.056.724.354.874.732l.07.167c.163.373.15.81-.095 1.136l-.23.308a1 1 0 0 0 .092 1.307l.188.188a1 1 0 0 0 1.307.093l.308-.231c.325-.244.763-.258 1.136-.095a5.4 5.4 0 0 0 .167.07c.378.15.676.47.732.874l.087.632a1 1 0 0 0 .99.863h.258a1 1 0 0 0 .99-.863l.087-.632c.056-.403.354-.724.732-.874a5.12 5.12 0 0 0 .167-.07c.373-.163.81-.15 1.136.095l.308.23a1 1 0 0 0 1.307-.092l.188-.188a1 1 0 0 0 .093-1.307l-.231-.308c-.244-.325-.258-.763-.095-1.136l.07-.167c.15-.378.47-.676.874-.732l.632-.087a1 1 0 0 0 .863-.99v-.258a1 1 0 0 0-.863-.99l-.632-.087c-.403-.056-.724-.354-.874-.732a5.168 5.168 0 0 0-.07-.167c-.163-.373-.15-.81.095-1.136l.23-.308a1 1 0 0 0-.092-1.307l-.188-.188a1 1 0 0 0-1.307-.092l-.308.23c-.325.244-.763.258-1.136.095a5.185 5.185 0 0 0-.167-.07c-.378-.15-.676-.47-.732-.874l-.087-.632Z" />
150
+ <path d="M13.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z" />
151
+ </>;
152
+ };
153
+ Icon.Exit = () => {
154
+ return <path d="m15.75 8.75 3.5 3.25-3.5 3.25M19 12h-8.25M15.25 4.75h-8.5a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2h8.5" />;
155
+ };
156
+
124
157
  // ../typewriter/dist/index.js
125
158
  var defaultSpeed = () => {
126
159
  return Math.min(90 * Math.random() + 100, 90);
@@ -140,8 +173,12 @@ var typewriter = ({ node, text, ended, speed = defaultSpeed }) => {
140
173
  const nodes = collectTextNodes(node).map((child) => {
141
174
  const letters = [...child.textContent].map((char) => {
142
175
  const text2 = document.createElement("span");
143
- text2.textContent = char;
144
- text2.style.cssText = "opacity: 0;";
176
+ if (char === " ") {
177
+ text2.innerHTML = "&#8197;";
178
+ } else {
179
+ text2.textContent = char;
180
+ }
181
+ text2.style.opacity = "0";
145
182
  return text2;
146
183
  });
147
184
  child.replaceWith(...letters);
@@ -203,7 +240,7 @@ var typewriter = ({ node, text, ended, speed = defaultSpeed }) => {
203
240
  node.innerHTML = "";
204
241
  return end;
205
242
  }
206
- node.innerHTML = text;
243
+ node.innerHTML = text.replace(/ /gm, "&#8197;");
207
244
  end = true;
208
245
  return false;
209
246
  },
@@ -313,7 +350,7 @@ var Game = (props) => {
313
350
  const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
314
351
  return canvas;
315
352
  }}</Show2></div>
316
- <p class="action-dialog-content" ref={store.dialogRef}> </p>
353
+ <p class="action-dialog-content" ref={store.dialogRef} />
317
354
  </div>
318
355
  </div>
319
356
  <Modal
@@ -362,23 +399,32 @@ var Game = (props) => {
362
399
  </div>
363
400
  </div></Modal>
364
401
  <div data-custom={true}><For each={layers()}>{(value) => value.dom}</For></div>
365
- <div class="action-text" data-shown={Boolean(props.state.text.content)} ref={store.textRef} onClick={clearTypewriterEffect}> </div>
402
+ <div class="action-text" data-shown={Boolean(props.state.text.content)} onClick={clearTypewriterEffect}><span ref={store.textRef} /></div>
366
403
  <div class="control-panel">
367
404
  <button
368
405
  type="button"
369
406
  class="button control-panel__button"
407
+ title={data.t("GoBack")}
370
408
  onClick={data.options.back}
371
- >{data.t("GoBack")}</button>
409
+ >
410
+ <span class="control-panel__button__content">{data.t("GoBack")}</span>
411
+ <Icon class="control-panel__button__icon" children={Icon.Back()} />
412
+ </button>
372
413
  <button
373
414
  type="button"
374
415
  class="button control-panel__button"
416
+ title={data.t("DoSave")}
375
417
  onClick={() => {
376
418
  data.options.save(false, "manual");
377
419
  }}
378
- >{data.t("DoSave")}</button>
420
+ >
421
+ <span class="control-panel__button__content">{data.t("DoSave")}</span>
422
+ <Icon class="control-panel__button__icon" children={Icon.Save()} />
423
+ </button>
379
424
  <button
380
425
  type="button"
381
426
  class="button control-panel__button"
427
+ title={data.t(auto() ? "Stop" : "Auto")}
382
428
  onClick={() => {
383
429
  setAuto((prev) => !prev);
384
430
  }}
@@ -386,16 +432,24 @@ var Game = (props) => {
386
432
  <button
387
433
  type="button"
388
434
  class="button control-panel__button"
435
+ title={data.t("Settings")}
389
436
  onClick={() => {
390
437
  data.options.save(false, "auto");
391
438
  props.setState("screen", "settings");
392
439
  }}
393
- >{data.t("Settings")}</button>
440
+ >
441
+ <span class="control-panel__button__content">{data.t("Settings")}</span>
442
+ <Icon class="control-panel__button__icon" children={Icon.Settings()} />
443
+ </button>
394
444
  <button
395
445
  type="button"
396
446
  class="button control-panel__button"
447
+ title={data.t("Exit")}
397
448
  onClick={data.options.exit}
398
- >{data.t("Exit")}</button>
449
+ >
450
+ <span class="control-panel__button__content">{data.t("Exit")}</span>
451
+ <Icon class="control-panel__button__icon" children={Icon.Exit()} />
452
+ </button>
399
453
  </div>
400
454
  </div>;
401
455
  };
@@ -443,9 +497,14 @@ var Saves = (props) => {
443
497
  onClick={() => data.options.set(save)}
444
498
  >
445
499
  {stringDate}
446
- <span style={{ "margin-left": "1em" }}>{stringType}</span>
500
+ <span class="saves__button-load__type">{stringType}</span>
447
501
  </button>
448
- <button type="reset" class="button" aria-label={data.t("DeleteASaveFrom") + " " + stringDate} onClick={[removeSave, date]}><span>{data.t("Remove")}</span></button>
502
+ <button
503
+ type="reset"
504
+ class="button saves__button-reset"
505
+ aria-label={data.t("DeleteASaveFrom") + " " + stringDate}
506
+ onClick={[removeSave, date]}
507
+ ><span>{data.t("Remove")}</span></button>
449
508
  </li>;
450
509
  }}</For2></ol></Show3></div>
451
510
  </div>;
@@ -503,7 +562,7 @@ var Loading = () => {
503
562
  };
504
563
 
505
564
  // src/renderer.tsx
506
- var createSolidRenderer = () => {
565
+ var createSolidRenderer = ({ fullscreen = false } = {}) => {
507
566
  const [state, setState] = createStore({
508
567
  background: "",
509
568
  characters: {},
@@ -555,22 +614,26 @@ var createSolidRenderer = () => {
555
614
  ctx,
556
615
  emotions: {},
557
616
  withEmotion(emotion) {
558
- const stored = store.characters[character].emotions[emotion];
617
+ const stored = this.emotions[emotion];
559
618
  const render = (...images) => {
560
619
  return () => {
561
620
  canvasDrawImages(canvas, ctx, images);
562
621
  };
563
622
  };
564
- if (stored)
565
- return render(..."head" in stored ? [stored.head, stored.left, stored.right] : [stored]);
623
+ if (stored) {
624
+ if (stored instanceof HTMLImageElement) {
625
+ return render(stored);
626
+ }
627
+ return render(...Object.values(stored));
628
+ }
566
629
  const emotionData = characters[character].emotions[emotion];
567
630
  if (typeof emotionData === "string") {
568
- return render(store.characters[character].emotions[emotion] = createImage(emotionData));
631
+ return render(this.emotions[emotion] = createImage(emotionData));
569
632
  }
570
633
  const head = createImage(emotionData.head);
571
634
  const left = createImage(emotionData.body.left);
572
635
  const right = createImage(emotionData.body.right);
573
- store.characters[character].emotions[emotion] = {
636
+ this.emotions[emotion] = {
574
637
  head,
575
638
  left,
576
639
  right
@@ -617,7 +680,8 @@ var createSolidRenderer = () => {
617
680
  },
618
681
  clear(goingBack) {
619
682
  return (resolve) => {
620
- setState("background", "#000");
683
+ if (!goingBack)
684
+ setState("background", "#000");
621
685
  setState("choices", { choices: [], visible: false, resolve: void 0, question: "" });
622
686
  setState("input", { element: void 0, question: "", visible: false });
623
687
  setState("dialog", { visible: false, content: "", name: "" });
@@ -637,11 +701,21 @@ var createSolidRenderer = () => {
637
701
  },
638
702
  input(question, onInput, setup) {
639
703
  return (resolve) => {
640
- const errorHandler = (value) => {
704
+ const error = (value) => {
641
705
  setState("input", { error: value });
642
706
  };
643
707
  const onInputHandler = (event) => {
644
- onInput({ input, event, error: errorHandler });
708
+ let value;
709
+ onInput({
710
+ input,
711
+ event,
712
+ error,
713
+ get value() {
714
+ if (value)
715
+ return value;
716
+ return value = escape(input.value);
717
+ }
718
+ });
645
719
  };
646
720
  const input = <input type="text" name="novely-input" required autocomplete="off" onInput={onInputHandler} />;
647
721
  if (setup)
@@ -719,7 +793,19 @@ var createSolidRenderer = () => {
719
793
  };
720
794
  },
721
795
  Novely(props) {
722
- return <div {...props} ref={root}><Provider storeData={options.$} options={options} renderer={renderer}><Switch fallback={<>No</>}>
796
+ createEffect3(() => {
797
+ const screen = state.screen;
798
+ if (fullscreen && document.fullscreenEnabled) {
799
+ if (screen === "game" && !document.fullscreenElement) {
800
+ document.documentElement.requestFullscreen().catch(() => {
801
+ });
802
+ } else if (screen === "mainmenu" && document.fullscreenElement && "exitFullscreen" in document) {
803
+ document.exitFullscreen().catch(() => {
804
+ });
805
+ }
806
+ }
807
+ });
808
+ return <div {...props} ref={root}><Provider storeData={options.$} options={options} renderer={renderer}><Switch>
723
809
  <Match when={state.screen === "game"}><Game state={state} setState={
724
810
  /* @once */
725
811
  setState
@@ -115,9 +115,16 @@ interface SolidRendererStore extends RendererStore {
115
115
  dialogRef?: HTMLParagraphElement;
116
116
  textRef?: HTMLParagraphElement;
117
117
  }
118
- declare const createSolidRenderer: () => {
118
+ interface CreateSolidRendererOptions {
119
+ /**
120
+ * Enter fullscreen mode when opening a game, exit when opening main-menu
121
+ * @default false
122
+ */
123
+ fullscreen?: boolean;
124
+ }
125
+ declare const createSolidRenderer: ({ fullscreen }?: CreateSolidRendererOptions) => {
119
126
  createRenderer(init: RendererInit): Renderer;
120
- Novely(props: Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'>): JSX.Element;
127
+ Novely(props: Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'ref'>): JSX.Element;
121
128
  };
122
129
  export { createSolidRenderer };
123
130
  export type { State, SolidRendererStore };
@@ -1,8 +1,8 @@
1
1
  /* src/styles/root/root.css */
2
2
  .root {
3
- height: 100vh;
4
3
  width: 100vw;
5
- font-size: 1em;
4
+ height: 100vh;
5
+ font-size: 1rem;
6
6
  font-family:
7
7
  ui-sans-serif,
8
8
  system-ui,
@@ -29,235 +29,14 @@
29
29
 
30
30
  /* src/styles/root/index.css */
31
31
 
32
- /* src/styles/main-menu/main-menu.css */
33
- .main-menu {
34
- overflow: hidden;
35
- background-image: var(--novely-main-menu-background-image);
36
- padding: 0 1em;
37
- display: grid;
38
- justify-content: start;
39
- align-content: center;
40
- }
41
-
42
- /* src/styles/main-menu/button/button.css */
43
- .main-menu__button {
44
- min-width: 30vw;
45
- }
46
-
47
- /* src/styles/main-menu/index.css */
48
-
49
- /* src/styles/loading/loading.css */
50
- .loading {
51
- overflow: hidden;
52
- background: black;
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- }
57
-
58
- /* src/styles/loading/animation/animation.css */
59
- .loading__animation {
60
- display: inline-block;
61
- position: relative;
62
- width: 80px;
63
- height: 80px;
64
- }
65
- .loading__animation div {
66
- position: absolute;
67
- top: 33px;
68
- width: 13px;
69
- height: 13px;
70
- border-radius: 50%;
71
- background: #fff;
72
- animation-timing-function: cubic-bezier(0, 1, 1, 0);
73
- }
74
- .loading__animation div:nth-child(1) {
75
- left: 8px;
76
- animation: lds-ellipsis1 0.6s infinite;
77
- }
78
- .loading__animation div:nth-child(2) {
79
- left: 8px;
80
- animation: lds-ellipsis2 0.6s infinite;
81
- }
82
- .loading__animation div:nth-child(3) {
83
- left: 32px;
84
- animation: lds-ellipsis2 0.6s infinite;
85
- }
86
- .loading__animation div:nth-child(4) {
87
- left: 56px;
88
- animation: lds-ellipsis3 0.6s infinite;
89
- }
90
- @keyframes lds-ellipsis1 {
91
- 0% {
92
- transform: scale(0);
93
- }
94
- 100% {
95
- transform: scale(1);
96
- }
97
- }
98
- @keyframes lds-ellipsis3 {
99
- 0% {
100
- transform: scale(1);
101
- }
102
- 100% {
103
- transform: scale(0);
104
- }
105
- }
106
- @keyframes lds-ellipsis2 {
107
- 0% {
108
- transform: translate(0, 0);
109
- }
110
- 100% {
111
- transform: translate(24px, 0);
112
- }
113
- }
114
-
115
- /* src/styles/loading/index.css */
116
-
117
- /* src/styles/settings/settings.css */
118
- .settings {
119
- position: absolute;
120
- inset: 0;
121
- z-index: 1;
122
- padding: 0 1em;
123
- gap: 1em;
124
- overflow: hidden;
125
- background-image: var(--novely-settings-background-image);
126
- display: flex;
127
- }
128
- @media (orientation: portrait) {
129
- .settings {
130
- flex-direction: column-reverse;
131
- }
132
- }
133
-
134
- /* src/styles/settings/button/button.css */
135
- .settings__button {
136
- min-width: 30vw;
137
- }
138
- @media (orientation: portrait) {
139
- .settings__button {
140
- min-width: 80%;
141
- }
142
- }
143
-
144
- /* src/styles/settings/column/column.css */
145
- .settings__column {
146
- display: flex;
147
- align-items: center;
148
- justify-content: center;
149
- flex-direction: column;
150
- flex-wrap: wrap;
151
- }
152
-
153
- /* src/styles/settings/index.css */
154
-
155
- /* src/styles/saves/saves.css */
156
- .saves {
157
- position: absolute;
158
- inset: 0;
159
- z-index: 1;
160
- padding: 0 1em;
161
- gap: 1em;
162
- overflow: hidden;
163
- background-image: var(--novely-saves-background-image);
164
- display: flex;
165
- }
166
- @media (orientation: portrait) {
167
- .saves {
168
- flex-direction: column-reverse;
169
- }
170
- }
171
-
172
- /* src/styles/saves/button/button.css */
173
- .saves__button {
174
- min-width: 30vw;
175
- }
176
- .saves__button-load {
177
- width: 100%;
178
- touch-action: auto !important;
179
- }
180
- @media (orientation: portrait) {
181
- .saves__button {
182
- min-width: 80%;
183
- }
184
- }
185
-
186
- /* src/styles/saves/list/list.css */
187
- .saves__list-container {
188
- width: 100%;
189
- height: 100%;
190
- display: flex;
191
- align-items: center;
192
- justify-content: center;
193
- overflow: hidden;
194
- }
195
- .saves__list {
196
- width: 100%;
197
- height: 80%;
198
- padding: 0 1em;
199
- display: grid;
200
- align-content: flex-start;
201
- justify-content: center;
202
- justify-items: stretch;
203
- list-style: none;
204
- overflow-y: scroll;
205
- margin-block-start: 0;
206
- margin-block-end: 0;
207
- touch-action: auto !important;
208
- border-radius: var(--saves-list-border-radius, 14px);
209
- background-color: var(--saves-list-background-color, #ffffff57);
210
- }
211
- .saves__list::-webkit-scrollbar {
212
- width: 14px;
213
- }
214
- .saves__list::-webkit-scrollbar-track {
215
- background-color: #ffe9f3;
216
- border-radius: 7px;
217
- }
218
- .saves__list::-webkit-scrollbar-thumb {
219
- background-color: #ffc7df;
220
- border-radius: 7px;
221
- }
222
- .saves__list::-webkit-scrollbar-thumb:hover {
223
- background-color: #ffc6d8;
224
- }
225
- .saves__list:hover {
226
- scrollbar-color: #ffc6d8;
227
- }
228
- .saves__list-item {
229
- display: flex;
230
- }
231
- @media (orientation: portrait) {
232
- .saves__list {
233
- height: 100%;
234
- }
235
- .saves__list-container {
236
- margin-top: 1em;
237
- }
238
- }
239
-
240
- /* src/styles/saves/column/column.css */
241
- @media (orientation: portrait) {
242
- .saves__column {
243
- display: flex;
244
- align-items: center;
245
- justify-content: center;
246
- flex-direction: column;
247
- flex-wrap: wrap;
248
- }
249
- }
250
-
251
- /* src/styles/saves/index.css */
252
-
253
32
  /* src/styles/button/button.css */
254
33
  .button {
255
34
  background-color: var(--novely-button-background-color, #ffe9f3);
256
35
  border: 4px solid var(--novely-button-border-color, #ffc7df);
257
36
  color: var(--novely-button-color, #000);
258
- margin: 0.4em 0;
259
- padding: 0.4em;
260
- font-size: 1.02em;
37
+ margin: 0.4rem 0;
38
+ padding: 0.4rem;
39
+ font-size: 1.02rem;
261
40
  line-height: 1.2;
262
41
  cursor: pointer;
263
42
  user-select: none;
@@ -276,9 +55,8 @@
276
55
 
277
56
  /* src/styles/characters/characters.css */
278
57
  .characters {
279
- position: absolute;
280
- inset: 0;
281
- z-index: 1;
58
+ width: 100vw;
59
+ height: 100vh;
282
60
  overflow: hidden;
283
61
  display: flex;
284
62
  align-items: flex-end;
@@ -296,21 +74,38 @@
296
74
  /* src/styles/control-panel/control-panel.css */
297
75
  .control-panel {
298
76
  z-index: 23;
299
- position: absolute;
77
+ position: fixed;
300
78
  display: flex;
301
79
  justify-content: end;
302
- right: 0.4em;
303
- bottom: 0.4em;
80
+ right: 0.4rem;
81
+ bottom: 0.4rem;
304
82
  }
305
83
 
306
84
  /* src/styles/control-panel/button/button.css */
307
85
  .control-panel__button {
308
86
  border: 2px solid var(--novely-button-border-color, #ffc7df);
309
87
  margin: 0;
310
- padding: 0.2em 0.4em;
311
- font-size: 1em;
88
+ padding: 0.2rem 0.4rem;
89
+ font-size: 1rem;
312
90
  line-height: 1;
313
- height: 2em;
91
+ height: 2rem;
92
+ }
93
+ .control-panel__button__icon {
94
+ display: none;
95
+ }
96
+ @media (orientation: portrait) {
97
+ .control-panel__button__icon {
98
+ display: block;
99
+ }
100
+ .control-panel__button__content {
101
+ clip: rect(0 0 0 0);
102
+ clip-path: inset(50%);
103
+ height: 1px;
104
+ overflow: hidden;
105
+ position: absolute;
106
+ white-space: nowrap;
107
+ width: 1px;
108
+ }
314
109
  }
315
110
 
316
111
  /* src/styles/control-panel/index.css */
@@ -322,7 +117,8 @@
322
117
  z-index: 2;
323
118
  display: none;
324
119
  text-align: center;
325
- font-size: 1.5em;
120
+ font-size: 1.5rem;
121
+ user-select: none;
326
122
  }
327
123
  .action-text[data-shown=true] {
328
124
  display: flex;
@@ -334,6 +130,7 @@
334
130
  }
335
131
  .action-text[data-shown=true] > span {
336
132
  cursor: pointer;
133
+ user-select: none;
337
134
  }
338
135
 
339
136
  /* src/styles/action-text/index.css */
@@ -351,18 +148,18 @@
351
148
  background-color: var(--novely-select-background-color, #ffe9f3);
352
149
  border: 4px solid var(--novely-select-border-color, #ffc7df);
353
150
  color: var(--novely-select-color, #000);
354
- margin: 0.4em 0;
355
- padding: 0.4em;
356
- font-size: 1.02em;
151
+ margin: 0.4rem 0;
152
+ padding: 0.4rem;
153
+ font-size: 1.02rem;
357
154
  }
358
155
 
359
156
  /* src/styles/select/label/label.css */
360
157
  .select__label {
361
158
  background: var(--novely-select-label-background, #ffe9f3);
362
159
  color: var(--novely-select-color, #000);
363
- font-size: 1.02em;
364
- padding: 0.25em 0.5em;
365
- border-radius: 0.25em;
160
+ font-size: 1.02rem;
161
+ padding: 0.25rem 0.5rem;
162
+ border-radius: 0.25rem;
366
163
  }
367
164
 
368
165
  /* src/styles/select/index.css */
@@ -371,10 +168,10 @@
371
168
  .action-dialog {
372
169
  min-height: 26vh;
373
170
  width: 75%;
374
- position: absolute;
171
+ position: fixed;
375
172
  left: 50%;
376
173
  transform: translateX(-50%);
377
- bottom: 0.4em;
174
+ bottom: 0.4rem;
378
175
  z-index: 22;
379
176
  text-align: left;
380
177
  flex-direction: column;
@@ -396,7 +193,7 @@
396
193
  background-size: var(--novely-dialog-background-size, 100px 100px);
397
194
  display: flex;
398
195
  flex-wrap: nowrap;
399
- padding-bottom: 2.8em;
196
+ padding-bottom: 2.8rem;
400
197
  }
401
198
  .action-dialog-person {
402
199
  max-height: 25vh;
@@ -409,7 +206,7 @@
409
206
  margin: 0;
410
207
  }
411
208
  .action-dialog-name {
412
- font-size: 1.4375em;
209
+ font-size: 1.4375rem;
413
210
  line-height: 1.2;
414
211
  background: #ffffff;
415
212
  border-radius: 7px 7px 0 0;
@@ -420,7 +217,7 @@
420
217
  }
421
218
  .action-dialog-content {
422
219
  width: 100%;
423
- font-size: 2.2375em;
220
+ font-size: 2.2375rem;
424
221
  line-height: 1.2;
425
222
  text-shadow:
426
223
  1px 1px 0 black,
@@ -442,36 +239,35 @@
442
239
  transform: unset;
443
240
  }
444
241
  .action-dialog-name {
445
- font-size: 1.02em;
242
+ font-size: 1.02rem;
446
243
  }
447
244
  .action-dialog-content {
448
- font-size: 1.32em;
245
+ font-size: 1.32rem;
449
246
  }
450
247
  .action-dialog-container {
451
248
  border-radius: 14px 14px 0 0;
452
249
  }
453
- }
454
- @media only screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
455
250
  .action-dialog-content {
456
- font-size: 1.32em;
457
- line-height: 1.15;
251
+ text-shadow: none;
458
252
  }
459
253
  }
460
- @media only screen and (orientation: landscape) and (hover: hover) and (pointer: coarse) {
254
+ @media only screen and (orientation: landscape) and (pointer: coarse) {
461
255
  .action-dialog-content {
462
- font-size: 1.32em;
256
+ font-size: 1.32rem;
463
257
  line-height: 1.15;
464
258
  }
259
+ .action-dialog-content {
260
+ text-shadow: none;
261
+ }
465
262
  }
466
263
 
467
264
  /* src/styles/action-dialog/index.css */
468
265
 
469
266
  /* src/styles/dialog/dialog.css */
470
267
  .dialog {
471
- position: fixed;
268
+ position: absolute;
472
269
  inset: 0;
473
270
  z-index: 20;
474
- overflow-y: auto;
475
271
  }
476
272
  .dialog-container {
477
273
  min-height: 100vh;
@@ -490,25 +286,25 @@
490
286
  min-height: 40vh;
491
287
  min-width: 50vw;
492
288
  max-width: 100vw;
493
- padding-left: 0.25em;
494
- padding-right: 0.25em;
289
+ padding-left: 0.25rem;
290
+ padding-right: 0.25rem;
495
291
  display: flex;
496
292
  flex-direction: column;
497
293
  align-items: stretch;
498
294
  }
499
295
  .dialog-panel-label {
500
296
  user-select: none;
501
- font-size: 1.2375em;
297
+ font-size: 1.2375rem;
502
298
  }
503
299
  .dialog-panel-label[data-used=true] {
504
300
  background: var(--novely-dialog-panel-label-background, #ffe9f3);
505
301
  color: var(--novely-dialog-panel-label-color, #000);
506
- padding: 0.25em 0.5em;
507
- border-radius: 0.25em;
302
+ padding: 0.25rem 0.5rem;
303
+ border-radius: 0.25rem;
508
304
  }
509
305
  @media (orientation: portrait) {
510
306
  .dialog-panel {
511
- max-width: 95vw;
307
+ width: calc(100vw - 0.5rem);
512
308
  }
513
309
  }
514
310
 
@@ -520,12 +316,12 @@
520
316
  flex-direction: column;
521
317
  align-items: center;
522
318
  justify-content: center;
523
- font-size: 1.2375em;
319
+ font-size: 1.2375rem;
524
320
  width: 100%;
525
321
  }
526
322
  .input-dialog-label > span {
527
- margin: 0.4em 0;
528
- min-height: 1em;
323
+ margin: 0.4rem 0;
324
+ min-height: 1rem;
529
325
  min-height: 1lh;
530
326
  }
531
327
  .input-dialog-panel {
@@ -543,12 +339,245 @@
543
339
 
544
340
  /* src/styles/input-dialog/button/button.css */
545
341
  .dialog-input__button {
546
- font-size: 1.2375em;
547
- padding: 0.4em 0.6em;
342
+ font-size: 1.2375rem;
343
+ padding: 0.4rem 0.6rem;
548
344
  width: -moz-fit-content;
549
345
  width: fit-content;
550
346
  }
551
347
 
552
348
  /* src/styles/input-dialog/index.css */
553
349
 
350
+ /* src/styles/main-menu/main-menu.css */
351
+ .main-menu {
352
+ overflow: hidden;
353
+ background-image: var(--novely-main-menu-background-image);
354
+ padding: 0 1rem;
355
+ display: grid;
356
+ align-content: center;
357
+ }
358
+ @media (orientation: landscape) {
359
+ .main-menu {
360
+ justify-content: start;
361
+ }
362
+ }
363
+
364
+ /* src/styles/main-menu/button/button.css */
365
+ .main-menu__button {
366
+ min-width: 30vw;
367
+ }
368
+
369
+ /* src/styles/main-menu/index.css */
370
+
371
+ /* src/styles/loading/loading.css */
372
+ .loading {
373
+ overflow: hidden;
374
+ background: black;
375
+ display: flex;
376
+ justify-content: center;
377
+ align-items: center;
378
+ }
379
+
380
+ /* src/styles/loading/animation/animation.css */
381
+ .loading__animation {
382
+ display: inline-block;
383
+ position: relative;
384
+ width: 80px;
385
+ height: 80px;
386
+ }
387
+ .loading__animation div {
388
+ position: absolute;
389
+ top: 33px;
390
+ width: 13px;
391
+ height: 13px;
392
+ border-radius: 50%;
393
+ background: #fff;
394
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
395
+ }
396
+ .loading__animation div:nth-child(1) {
397
+ left: 8px;
398
+ animation: lds-ellipsis1 0.6s infinite;
399
+ }
400
+ .loading__animation div:nth-child(2) {
401
+ left: 8px;
402
+ animation: lds-ellipsis2 0.6s infinite;
403
+ }
404
+ .loading__animation div:nth-child(3) {
405
+ left: 32px;
406
+ animation: lds-ellipsis2 0.6s infinite;
407
+ }
408
+ .loading__animation div:nth-child(4) {
409
+ left: 56px;
410
+ animation: lds-ellipsis3 0.6s infinite;
411
+ }
412
+ @keyframes lds-ellipsis1 {
413
+ 0% {
414
+ transform: scale(0);
415
+ }
416
+ 100% {
417
+ transform: scale(1);
418
+ }
419
+ }
420
+ @keyframes lds-ellipsis3 {
421
+ 0% {
422
+ transform: scale(1);
423
+ }
424
+ 100% {
425
+ transform: scale(0);
426
+ }
427
+ }
428
+ @keyframes lds-ellipsis2 {
429
+ 0% {
430
+ transform: translate(0, 0);
431
+ }
432
+ 100% {
433
+ transform: translate(24px, 0);
434
+ }
435
+ }
436
+
437
+ /* src/styles/loading/index.css */
438
+
439
+ /* src/styles/settings/settings.css */
440
+ .settings {
441
+ padding: 0 1rem;
442
+ gap: 1rem;
443
+ overflow: hidden;
444
+ background-image: var(--novely-settings-background-image);
445
+ display: flex;
446
+ }
447
+ @media (orientation: portrait) {
448
+ .settings {
449
+ flex-direction: column-reverse;
450
+ }
451
+ }
452
+
453
+ /* src/styles/settings/button/button.css */
454
+ .settings__button {
455
+ min-width: 30vw;
456
+ }
457
+ @media (orientation: portrait) {
458
+ .settings__button {
459
+ min-width: 80%;
460
+ }
461
+ }
462
+
463
+ /* src/styles/settings/column/column.css */
464
+ .settings__column {
465
+ display: flex;
466
+ align-items: center;
467
+ justify-content: center;
468
+ flex-direction: column;
469
+ flex-wrap: wrap;
470
+ }
471
+
472
+ /* src/styles/settings/index.css */
473
+
474
+ /* src/styles/saves/saves.css */
475
+ .saves {
476
+ padding: 0 1rem;
477
+ gap: 1rem;
478
+ overflow: hidden;
479
+ background-image: var(--novely-saves-background-image);
480
+ display: flex;
481
+ }
482
+ @media (orientation: portrait) {
483
+ .saves {
484
+ flex-direction: column-reverse;
485
+ }
486
+ }
487
+
488
+ /* src/styles/saves/button/button.css */
489
+ .saves__button {
490
+ min-width: 30vw;
491
+ }
492
+ .saves__button-load {
493
+ width: 100%;
494
+ touch-action: auto !important;
495
+ }
496
+ .saves__button-load__type {
497
+ margin-left: 1rem;
498
+ }
499
+ @media (orientation: portrait) {
500
+ .saves__button {
501
+ min-width: 80%;
502
+ }
503
+ .saves__button-load {
504
+ margin-bottom: 0;
505
+ }
506
+ .saves__button-reset {
507
+ margin-top: 4px;
508
+ }
509
+ }
510
+
511
+ /* src/styles/saves/list/list.css */
512
+ .saves__list-container {
513
+ width: 100%;
514
+ height: 100%;
515
+ display: flex;
516
+ align-items: center;
517
+ justify-content: center;
518
+ overflow: hidden;
519
+ }
520
+ .saves__list {
521
+ width: 100%;
522
+ height: 80%;
523
+ padding: 0 1rem;
524
+ display: grid;
525
+ align-content: flex-start;
526
+ justify-content: center;
527
+ justify-items: stretch;
528
+ list-style: none;
529
+ overflow-y: scroll;
530
+ padding-inline-start: 0;
531
+ padding-inline-end: 0;
532
+ margin-block-start: 0;
533
+ margin-block-end: 0;
534
+ touch-action: auto !important;
535
+ border-radius: var(--saves-list-border-radius, 14px);
536
+ background-color: var(--saves-list-background-color, #ffffff57);
537
+ }
538
+ .saves__list::-webkit-scrollbar {
539
+ width: 14px;
540
+ }
541
+ .saves__list::-webkit-scrollbar-track {
542
+ background-color: #ffe9f3;
543
+ border-radius: 7px;
544
+ }
545
+ .saves__list::-webkit-scrollbar-thumb {
546
+ background-color: #ffc7df;
547
+ border-radius: 7px;
548
+ }
549
+ .saves__list::-webkit-scrollbar-thumb:hover {
550
+ background-color: #ffc6d8;
551
+ }
552
+ .saves__list:hover {
553
+ scrollbar-color: #ffc6d8;
554
+ }
555
+ .saves__list-item {
556
+ display: flex;
557
+ }
558
+ @media (orientation: portrait) {
559
+ .saves__list {
560
+ height: 100%;
561
+ }
562
+ .saves__list-container {
563
+ margin-top: 1rem;
564
+ }
565
+ .saves__list-item {
566
+ flex-direction: column;
567
+ }
568
+ }
569
+
570
+ /* src/styles/saves/column/column.css */
571
+ @media (orientation: portrait) {
572
+ .saves__column {
573
+ display: flex;
574
+ align-items: center;
575
+ justify-content: center;
576
+ flex-direction: column;
577
+ flex-wrap: wrap;
578
+ }
579
+ }
580
+
581
+ /* src/styles/saves/index.css */
582
+
554
583
  /* src/styles/index.css */
package/dist/utils.d.ts CHANGED
@@ -6,4 +6,5 @@ declare const createImage: (src: string) => HTMLImageElement;
6
6
  */
7
7
  declare const canvasDrawImages: (canvas: HTMLCanvasElement | undefined, ctx: CanvasRenderingContext2D | undefined, images: HTMLImageElement[]) => readonly [HTMLCanvasElement, CanvasRenderingContext2D];
8
8
  declare const url: <T extends string>(str: T) => `url(${T})`;
9
- export { isCSSImage, canvasDrawImages, url, createImage, capitalize };
9
+ declare const escape: (str: string) => string;
10
+ export { isCSSImage, canvasDrawImages, url, createImage, capitalize, escape };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"