@nmnmcc/standard 0.4.0 → 0.5.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.
Files changed (47) hide show
  1. package/README.md +45 -68
  2. package/dist/Extend.js +1 -1
  3. package/dist/{Standard-BPpzr5SM.js → Standard-BC6CfFOv.js} +116 -159
  4. package/dist/Standard.js +1 -1
  5. package/dist/Ui-DSgtM8Tf.js +591 -0
  6. package/dist/Ui.d.ts +4 -4
  7. package/dist/Ui.js +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/standard/page/page.d.ts +4 -6
  10. package/dist/standard/page/page.d.ts.map +1 -1
  11. package/dist/standard/tokens/tokens.d.ts +20 -103
  12. package/dist/standard/tokens/tokens.d.ts.map +1 -1
  13. package/dist/standard.css +1 -1
  14. package/dist/ui/flap/flap.d.ts +10 -10
  15. package/dist/ui/flap/flap.d.ts.map +1 -1
  16. package/dist/ui/modal/modal.d.ts +4 -1
  17. package/dist/ui/modal/modal.d.ts.map +1 -1
  18. package/dist/ui/navigator/navigator.d.ts +58 -59
  19. package/dist/ui/navigator/navigator.d.ts.map +1 -1
  20. package/dist/ui/notice/notice.d.ts +6 -1
  21. package/dist/ui/notice/notice.d.ts.map +1 -1
  22. package/dist/ui/sheet/sheet.d.ts +9 -9
  23. package/dist/ui/toasts/toasts.d.ts +8 -7
  24. package/dist/ui/toasts/toasts.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/standard/page/page.module.css +85 -47
  27. package/src/standard/page/page.module.d.css.ts +4 -2
  28. package/src/standard/page/page.ts +83 -1
  29. package/src/standard/tokens/tokens.ts +20 -268
  30. package/src/ui/dialog/dialog.module.css +24 -11
  31. package/src/ui/flap/flap.module.css +108 -52
  32. package/src/ui/flap/flap.module.d.css.ts +6 -1
  33. package/src/ui/flap/flap.ts +140 -13
  34. package/src/ui/modal/modal.module.css +73 -22
  35. package/src/ui/modal/modal.module.d.css.ts +1 -0
  36. package/src/ui/modal/modal.ts +21 -15
  37. package/src/ui/navigator/navigator.module.css +334 -176
  38. package/src/ui/navigator/navigator.module.d.css.ts +2 -10
  39. package/src/ui/navigator/navigator.ts +111 -106
  40. package/src/ui/notice/notice.ts +7 -2
  41. package/src/ui/popover/popover.ts +3 -3
  42. package/src/ui/sheet/sheet.module.css +51 -58
  43. package/src/ui/sheet/sheet.ts +9 -9
  44. package/src/ui/toasts/toasts.module.css +70 -11
  45. package/src/ui/toasts/toasts.module.d.css.ts +1 -0
  46. package/src/ui/toasts/toasts.ts +148 -4
  47. package/dist/Ui-B9xQqqNT.js +0 -468
@@ -1,5 +1,22 @@
1
1
  /* navigator: everywhere you can go, at the side of the page, along its top, or along its bottom. */
2
2
 
3
+ /*
4
+ * How far down the page the top of the window is, which the page's own
5
+ * script says, and how far the page has turned from the window: 0 when it
6
+ * is flat in it, 1 when it has turned all the way. Neither is for what is
7
+ * in the page to know.
8
+ */
9
+ @property --s-ui-seen {
10
+ syntax: "<length>";
11
+ inherits: false;
12
+ initial-value: 0px;
13
+ }
14
+ @property --s-ui-far {
15
+ syntax: "<number>";
16
+ inherits: false;
17
+ initial-value: 0;
18
+ }
19
+
3
20
  @layer standard.ui {
4
21
  /*
5
22
  * The navigator, in two layers. First a bar: each group, by a pictogram
@@ -8,39 +25,81 @@
8
25
  * not shown is written in its colour, and the current place is the two
9
26
  * colours swapped.
10
27
  *
11
- * It takes one of three places. At the side, the bar is a rail down the
12
- * edge where the page starts and the pane is beside it. Along the top,
13
- * the bar is a row and the pane hangs under the group that is shown.
14
- * Along the bottom, which is where a thumb is, the bar is a row of tabs
15
- * and the pane rises from behind it. A narrow window always has it along
16
- * the bottom.
28
+ * It takes one of three places. Along the top, the bar is a row and the
29
+ * pane hangs under the group that is shown. Along the bottom, which is
30
+ * where a thumb is, the bar is a row of tabs and the pane turns up over
31
+ * it. A narrow window always has it along the bottom. At the side it is
32
+ * one column down the edge where the page starts, always there, and its
33
+ * two layers are one in front of the other: the pane turns in over the
34
+ * groups, as the next leaf of a door, and out again.
35
+ *
36
+ * The button that goes back, and the link home, which is a house or the
37
+ * app's mark, are at the start of the bar. The tabs along the bottom
38
+ * have no room for them: there they are in a bar of their own, along
39
+ * the top of the page.
17
40
  *
18
- * The button that goes back, and the app's mark, are at the start of the
19
- * bar. The tabs along the bottom have no room for them: there they are
20
- * in a bar of their own, along the top of the page.
41
+ * Until it is opened there is only the bar. Along the bottom and along
42
+ * the top the open pane takes no room: it is in front of the page, as a
43
+ * sheet or as a menu. At the side it is in the navigator's own column.
21
44
  *
22
- * Closed, which is how it is until it is opened, there is only the bar.
23
- * Docked, the open pane takes its room from the page, by moving its
24
- * edge. As a sheet it takes none: the window moves over to it, and the
25
- * page slides out by as much as the pane slides in. Along the bottom it
26
- * is always a sheet. Along the top it is neither: it hangs over the
27
- * page, as a menu does.
45
+ * The navigator is the post of a revolving door, and the page is a leaf
46
+ * of that door. When anything comes in front of the page (the pane as a
47
+ * sheet or a menu, a sheet, a dialog), the page turns away on
48
+ * the edge of the window the navigator is at, the way a door
49
+ * turns on its post, and does not slide. What comes in is the next leaf: it does not
50
+ * slide in, it turns in on the same post, from a quarter of a turn away,
51
+ * where none of it is in the window, and goes out the same way. Its far edge goes back from the window, so
52
+ * it is seen smaller there, and the further back a part of it is, the
53
+ * more of the page's ground it takes: paler in the light scheme, darker
54
+ * in the dark scheme. When nothing is in front of it any more, it turns
55
+ * back.
28
56
  */
29
57
  .shell {
30
- /* How high the top of each layer is, and how wide the rail is while it is closed. */
58
+ /* How high a bar along the top is, and each row of the column at the side. */
31
59
  --s-ui-row: 3.75rem;
32
- /* How wide the rail is, open. */
33
- --s-ui-rail: 11rem;
60
+ /* How wide the pane is that hangs under a bar along the top, and the column at the side. */
34
61
  --s-ui-pane: 14.25rem;
35
- /* What centres a pictogram in the closed rail, and keeps a name out of it. */
62
+ /* What a pictogram has before it in the bar. */
36
63
  --s-ui-inset: calc((var(--s-ui-row) - 1.5rem) / 2);
37
64
  /* How high a row of the pane is. It is a list read downwards, so a row is lower than a button; a finger still gets the whole target. */
38
65
  --s-ui-place: calc(var(--s-target) - var(--s-unit));
39
- /* How high the tabs along the bottom are, and the pane that rises from behind them. */
66
+ /* How high the tabs along the bottom are, and the pane that turns up over them. */
40
67
  --s-ui-tabs: 3.5rem;
41
68
  --s-ui-drawer: min(24rem, round(60dvb, 1px));
42
69
  /* How high the bar along the top is. There is none unless there is something to put in it. */
43
70
  --s-ui-top: 0px;
71
+ /* How far from the window the eye is that sees the page turn. */
72
+ --s-ui-eye: 150vmax;
73
+ /* How far down the window the top of the tabs is, and the bottom edge of the window, which is what everything turns on when the navigator is along the bottom. */
74
+ --s-ui-post: calc(100dvb - var(--s-ui-tabs) - env(safe-area-inset-bottom, 0px));
75
+ --s-ui-axis: 100dvb;
76
+ /* How far the page's edge is from the line it turns on, when the navigator is at the side. */
77
+ --s-ui-arm: 0px;
78
+ /*
79
+ * The post of the door: where in the window the line is that everything
80
+ * turns on. It is the edge of the window the navigator is at. And
81
+ * how a thing stands before it comes in front of the page: a quarter
82
+ * of a turn away, standing out of the window towards whoever looks at
83
+ * it. Seen from in front of the middle of the window, none of it is in
84
+ * the window there. What comes in turns from that to flat in the
85
+ * window, and goes out the same way. A dialog and a sheet read these,
86
+ * each from where it is itself.
87
+ */
88
+ --s-ui-hinge-x: 50vi;
89
+ --s-ui-hinge-y: var(--s-ui-axis);
90
+ --s-ui-swing: rotateX(-90deg);
91
+ /*
92
+ * How much of the window is the navigator's, at its top, at its bottom
93
+ * and where the page starts. A sheet and a dialog keep to the rest,
94
+ * and are cut off at its edges: they are never over the navigator.
95
+ */
96
+ --s-ui-clear-top: calc(var(--s-ui-top) + env(safe-area-inset-top, 0px));
97
+ --s-ui-clear-bottom: calc(var(--s-ui-tabs) + env(safe-area-inset-bottom, 0px));
98
+ --s-ui-clear-start: 0px;
99
+ --s-ui-bare: 0;
100
+ --s-ui-flip: translate(calc(50vi - var(--s-ui-hinge-x)), calc(50dvb - var(--s-ui-hinge-y)))
101
+ perspective(var(--s-ui-eye)) translate(calc(var(--s-ui-hinge-x) - 50vi), calc(var(--s-ui-hinge-y) - 50dvb))
102
+ var(--s-ui-swing);
44
103
 
45
104
  &:has(> .nav-top) {
46
105
  --s-ui-top: var(--s-ui-row);
@@ -54,8 +113,8 @@
54
113
  display: grid;
55
114
  grid-template-columns: minmax(0, 1fr);
56
115
  grid-template-rows: auto minmax(0, 1fr) auto;
57
- /* The page can be moved past the edge of the window without the window scrolling after it. */
58
- overflow-x: clip;
116
+ /* The page can turn past the edge of the window without the window scrolling after it. */
117
+ overflow: clip;
59
118
  }
60
119
 
61
120
  /* What is beside the navigator is measured against its own width, not the window's. */
@@ -65,10 +124,75 @@
65
124
  display: flex;
66
125
  flex-direction: column;
67
126
  min-block-size: calc(100dvb - var(--s-ui-tabs) - var(--s-ui-top));
68
- transition: translate var(--s-travel) var(--s-glide);
127
+ /* The line it turns on: the edge of the window the navigator is at. Here that is the bottom of the window. */
128
+ transform-origin: 50% calc(var(--s-ui-seen) + var(--s-ui-axis));
129
+ /* The shade goes with the turn: it is worked out from how far the page has turned, so it comes in and goes out in step with it. */
130
+ transition:
131
+ transform var(--s-travel) var(--s-glide),
132
+ --s-ui-far var(--s-travel) var(--s-glide);
133
+ }
134
+
135
+ /*
136
+ * The shade: the ground behind the page, drawn over the page, more of it
137
+ * the further back the page is. How much of it there is at any moment is
138
+ * how far the page has turned, so it is never there all at once and
139
+ * never gone all at once. It is over everything in the page, and takes
140
+ * no press. When the page is flat again it is not there at all.
141
+ */
142
+ .shell-body::after {
143
+ --s-ui-far: inherit;
144
+ --s-ui-seen: inherit;
145
+ --s-ui-shade: color-mix(in oklch, var(--s-bg) calc(72% * var(--s-ui-far)), transparent);
146
+
147
+ content: "";
148
+ position: absolute;
149
+ inset: 0;
150
+ z-index: 2147483647;
151
+ background: linear-gradient(
152
+ to bottom,
153
+ var(--s-ui-shade) var(--s-ui-seen),
154
+ transparent calc(var(--s-ui-seen) + var(--s-ui-post))
155
+ );
156
+ pointer-events: none;
157
+ visibility: hidden;
158
+ transition: visibility 0s var(--s-travel);
159
+ }
160
+
161
+ .shell:is(.state-open, :has(:modal)) > .shell-body::after {
162
+ visibility: visible;
163
+ transition: none;
164
+ }
165
+
166
+ /*
167
+ * A change of view that closes what was in front of the page: the view
168
+ * that comes in is flat from the first, and turns in whole. It does not
169
+ * also turn back from where the last one was.
170
+ */
171
+ :root:active-view-transition-type(in, out) .shell.shell :is(.shell-body, .nav-pane) {
172
+ transition: none;
69
173
  }
70
174
 
71
- :where(.nav-list, .nav-cell, .nav-mark) {
175
+ /*
176
+ * Something is in front of the page: the navigator's own pane, or a
177
+ * dialog or a sheet, which are over everything else in
178
+ * the window. The page turns away from it by 15 degrees on the edge of the window the navigator is at. It is seen from in front of the middle of
179
+ * the window, so what is further back is smaller. And what is further
180
+ * back takes more of the ground behind the page: up to 72 parts in 100
181
+ * at the far edge of the window.
182
+ *
183
+ * Only the part of the page that is near the window is drawn while it is
184
+ * turned: a long page has parts a long way past the edge it turns on,
185
+ * and those would come out in front of the window.
186
+ */
187
+ .shell:is(.state-open, :has(:modal)) > .shell-body {
188
+ --s-ui-far: 1;
189
+
190
+ transform: translateY(calc(50dvb - var(--s-ui-axis))) perspective(var(--s-ui-eye))
191
+ translateY(calc(var(--s-ui-axis) - 50dvb)) rotateX(15deg);
192
+ clip-path: inset(calc(var(--s-ui-seen) - 50dvb) 0 calc(100% - var(--s-ui-seen) - 150dvb) 0);
193
+ }
194
+
195
+ :where(.nav-list, .nav-cell, .nav-mark, .nav-up) {
72
196
  --s-line: var(--s-mark);
73
197
  --s-on-line: var(--s-on-mark);
74
198
  }
@@ -96,11 +220,11 @@
96
220
  min-block-size: var(--s-ui-row);
97
221
  padding-block-start: env(safe-area-inset-top);
98
222
  background: var(--s-ui-bar);
99
- /* In a change of page it is not part of what moves. */
223
+ /* In a change of page it is not part of what turns, and is over it. */
100
224
  view-transition-name: s-ui-navigator-top;
101
225
  }
102
226
 
103
- /* The app's mark and name there. It is not a button: the tabs open the navigator. */
227
+ /* The app's mark and name there: the link home. */
104
228
  .nav-sign {
105
229
  display: flex;
106
230
  align-items: center;
@@ -108,7 +232,9 @@
108
232
  padding-inline: var(--s-ui-inset);
109
233
  white-space: nowrap;
110
234
  overflow: clip;
235
+ color: inherit;
111
236
  font-size: 1.25rem;
237
+ text-decoration: none;
112
238
 
113
239
  /* After the button, its pictogram's own margin is all the room it needs. */
114
240
  .nav-back + & {
@@ -119,7 +245,18 @@
119
245
  .navigator {
120
246
  grid-row: 3;
121
247
  inset-block-end: 0;
122
- /* In a change of page it is not part of what moves. */
248
+ }
249
+
250
+ /*
251
+ * In a change of page the bar is not part of what turns, and is over
252
+ * it. Only one of the two is ever there. The pane has no name of its
253
+ * own when it is in front of the page: then it belongs to the view it
254
+ * was opened over, and goes with that view. A place pressed in it turns
255
+ * the pane out with the page that is left, or leaves it under the page
256
+ * that turns in.
257
+ */
258
+ .nav-bar,
259
+ .nav-tabs {
123
260
  view-transition-name: s-ui-navigator;
124
261
  }
125
262
 
@@ -128,7 +265,12 @@
128
265
  display: none;
129
266
  }
130
267
 
131
- /* The bar along the bottom: a tab for each group. It is over the pane, so the pane rises from behind it. */
268
+ /* The row that goes back from the places to the groups: only a navigator at the side has its places in front of its groups. */
269
+ .nav-up {
270
+ display: none;
271
+ }
272
+
273
+ /* The bar along the bottom: a tab for each group. */
132
274
  .nav-tabs {
133
275
  position: relative;
134
276
  z-index: 1;
@@ -190,15 +332,13 @@
190
332
  }
191
333
  }
192
334
 
193
- /* The button that opens and closes the navigator: three bars, or the app's mark and, where there is room, its name. */
335
+ /* The button that goes back is as wide as the bar is high. */
194
336
  .nav-back {
195
337
  inline-size: var(--s-ui-row);
196
- /* In a change of page it is not part of the navigator: its arrow goes with the page, seen through the button. */
197
- view-transition-name: s-ui-navigator-back;
198
338
  }
199
339
 
200
- /* The button that goes back is set as it is: an arrow, in a square. */
201
- .nav-fold,
340
+ /* The button that goes back: an arrow, in a square. And the link home: a house, or the app's mark and its name. */
341
+ .nav-home,
202
342
  .nav-back {
203
343
  flex: none;
204
344
  display: flex;
@@ -210,45 +350,7 @@
210
350
  background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
211
351
  color: inherit;
212
352
  font-size: 1.25rem;
213
- }
214
-
215
- /*
216
- * The arrow of the button that goes back points the way the window will
217
- * move: back along the line of reading, as it is drawn, or turned from
218
- * that. When the window moves, the arrow leaves with the page that is
219
- * left, and the one that comes in with the next page is turned already.
220
- * When the page changes and the window does not move, the arrow turns
221
- * where it is: the short way round where it can, by a `rotate` of its
222
- * own that says the same direction as one of these.
223
- */
224
- .nav-way {
225
- transition: rotate var(--s-travel) var(--s-glide);
226
-
227
- &.turn-45 {
228
- rotate: 45deg;
229
- }
230
- &.turn-90 {
231
- rotate: 90deg;
232
- }
233
- &.turn-135 {
234
- rotate: 135deg;
235
- }
236
- &.turn-180 {
237
- rotate: 180deg;
238
- }
239
- &.turn--45 {
240
- rotate: -45deg;
241
- }
242
- &.turn--90 {
243
- rotate: -90deg;
244
- }
245
- &.turn--135 {
246
- rotate: -135deg;
247
- }
248
- }
249
-
250
- :root:active-view-transition-type(forward, back, down, up) .nav-way {
251
- transition: none;
353
+ text-decoration: none;
252
354
  }
253
355
 
254
356
  /*
@@ -283,40 +385,32 @@
283
385
  }
284
386
  }
285
387
 
286
- /* The second layer. Its lists are stacked, and only the one shown is in it. Along the bottom it rises from behind the tabs. */
388
+ /* The second layer. Its lists are stacked, and only the one shown is in it. Along the bottom it turns up on the bottom edge of the window. As a sheet or a menu it is over the bar, so all of its turn is seen: it comes round in front of the bar. */
287
389
  .nav-pane {
288
390
  position: absolute;
289
391
  inset-inline: 0;
290
392
  inset-block-end: 100%;
393
+ z-index: 2;
291
394
  display: grid;
292
395
  block-size: var(--s-ui-drawer);
293
396
  background: var(--s-bg);
294
397
  overflow: clip;
295
- /*
296
- * Closed, it is where it will be and none of it is seen: its top edge
297
- * is down at the tabs. It is not moved below them to hide it, because
298
- * there it would be past the bottom of the page and the page would
299
- * scroll on into nothing.
300
- */
301
- clip-path: inset(100% 0 0 0);
398
+ /* Closed, it is a quarter of a turn out of the window, on the window's bottom edge. */
399
+ transform-origin: 50% calc(100% + var(--s-ui-tabs) + env(safe-area-inset-bottom, 0px));
400
+ transform: translateY(calc(50dvb - var(--s-ui-axis))) perspective(var(--s-ui-eye))
401
+ translateY(calc(var(--s-ui-axis) - 50dvb)) rotateX(-90deg);
302
402
  visibility: hidden;
303
403
  transition:
304
- clip-path var(--s-travel) var(--s-glide),
305
- translate var(--s-travel) var(--s-glide),
404
+ transform var(--s-travel) var(--s-glide),
306
405
  visibility var(--s-travel);
307
406
  }
308
407
 
309
- /* Open, its edge has gone up as far as the page has. */
408
+ /* Open, it has turned up in front of the page. */
310
409
  .shell.state-open .nav-pane {
311
- clip-path: inset(0);
410
+ transform: none;
312
411
  visibility: visible;
313
412
  }
314
413
 
315
- /* The window has moved down to the pane: the page is as far up as the pane is high. */
316
- .shell.state-open > .shell-body {
317
- translate: 0 calc(-1 * var(--s-ui-drawer));
318
- }
319
-
320
414
  /*
321
415
  * A list is set on its group's colour: the pane is a block of it, as the
322
416
  * group is in the bar. The text on it is in the colour that goes on that
@@ -348,18 +442,9 @@
348
442
  overflow: hidden auto;
349
443
  overscroll-behavior: contain;
350
444
  scrollbar-width: none;
351
- /* A change of group moves the lists the way the groups are placed: an earlier group is above, a later one below. */
352
- transition:
353
- translate var(--s-move) var(--s-ease),
354
- visibility var(--s-move);
355
-
356
- &.is-before {
357
- translate: 0 -100%;
358
- visibility: hidden;
359
- }
360
- &.is-after {
361
- translate: 0 100%;
362
- visibility: hidden;
445
+ /* Only the list of the group shown is there. A change of group is a change of state: the other list is there at once, and nothing moves. */
446
+ &:is(.is-before, .is-after) {
447
+ display: none;
363
448
  }
364
449
  }
365
450
 
@@ -447,122 +532,155 @@
447
532
  }
448
533
 
449
534
  @container s-page (inline-size >= 48rem) {
450
- /* ---- At the side: a rail down the edge where the page starts, and the pane beside it. ---- */
535
+ /* ---- At the side: one column down the edge where the page starts, its two layers one in front of the other. ---- */
451
536
 
452
537
  .shell.place-side {
538
+ --s-ui-hinge-x: 0px;
539
+ --s-ui-hinge-y: 50dvb;
540
+ --s-ui-swing: rotateY(-90deg);
541
+ --s-ui-clear-top: 0px;
542
+ --s-ui-clear-bottom: 0px;
543
+ /* How far the page's edge is from the edge of the window, which is what everything turns on: as far as the column is wide. */
544
+ --s-ui-arm: var(--s-ui-pane);
545
+ --s-ui-clear-start: var(--s-ui-arm);
546
+
453
547
  grid-template-columns: auto minmax(0, 1fr);
454
548
  grid-template-rows: none;
455
549
 
550
+ /* The page turns on the edge of the window where the column is. */
456
551
  & > .shell-body {
457
552
  grid-row: auto;
458
553
  min-block-size: 100dvb;
459
- translate: none;
554
+ transform-origin: calc(-1 * var(--s-ui-arm)) calc(var(--s-ui-seen) + 50dvb);
555
+ }
556
+
557
+ &:has(:modal) > .shell-body {
558
+ transform: translateX(calc(50% + var(--s-ui-arm))) perspective(var(--s-ui-eye))
559
+ translateX(calc(-50% - var(--s-ui-arm))) rotateY(15deg);
560
+ }
561
+
562
+ & > .shell-body::after {
563
+ background: linear-gradient(to right, transparent, var(--s-ui-shade));
564
+ }
565
+
566
+ /* The navigator's own places are in its column, not in front of the page: for them the page stays flat. */
567
+ &:not(:has(:modal)) > .shell-body {
568
+ --s-ui-far: 0;
569
+
570
+ transform: none;
571
+ clip-path: none;
572
+ }
573
+
574
+ &:not(:has(:modal)) > .shell-body::after {
575
+ visibility: hidden;
460
576
  }
461
577
 
462
578
  & > .nav-top {
463
579
  display: none;
464
580
  }
465
581
 
582
+ /* The column: always there, and always as wide. */
466
583
  & > .navigator {
584
+ /* How high its head is: the link home, and over it the button that goes back if there is one. */
585
+ --s-ui-head: var(--s-ui-row);
586
+
467
587
  grid-row: auto;
468
588
  inset-block: 0 auto;
469
589
  align-self: start;
470
- display: flex;
590
+ inline-size: var(--s-ui-pane);
471
591
  block-size: 100dvb;
592
+
593
+ &:has(.nav-back) {
594
+ --s-ui-head: calc(2 * var(--s-ui-row));
595
+ }
472
596
  }
473
597
 
474
598
  & .nav-tabs {
475
599
  display: none;
476
600
  }
477
601
 
478
- /* The rail. It is over the pane, so a sliding pane comes out from under it. Closed, it is as wide as its pictograms. */
602
+ /* The layer behind: the head, and under it the groups, one to a row. */
479
603
  & .nav-bar {
480
- position: relative;
481
- z-index: 1;
482
- flex: none;
483
604
  display: flex;
484
605
  flex-direction: column;
485
- inline-size: var(--s-ui-row);
606
+ block-size: 100%;
486
607
  background: var(--s-ui-bar);
487
608
  overflow: hidden auto;
488
609
  scrollbar-width: none;
489
- /* It opens and closes by moving its edge, and uncovers the names. */
490
- transition: inline-size var(--s-move) var(--s-ease);
491
610
  }
492
611
 
493
- /* Each is as high as the closed rail is wide: closed, a group is a square, and the one shown a square block of its colour. */
494
- & :is(.nav-back, .nav-fold, .nav-cell) {
612
+ & :is(.nav-back, .nav-home, .nav-cell) {
495
613
  inline-size: 100%;
496
614
  block-size: var(--s-ui-row);
497
615
  }
498
616
 
499
- /* Open: the rail has room for the names. */
500
- &.state-open .nav-bar {
501
- inline-size: var(--s-ui-rail);
502
- }
503
-
504
- /* The pane is beside the rail. It opens and folds by moving its edge; what is in it keeps its width, and is uncovered. */
617
+ /*
618
+ * The layer in front: the places of the group shown, over the groups
619
+ * and under the head. It is a leaf of the door. It turns in on the
620
+ * edge of the window, from a quarter of a turn out of it, and turns
621
+ * out the same way: the groups behind it are there all the time. It
622
+ * is the navigator's, and stays where it is in a change of page.
623
+ */
505
624
  & .nav-pane {
506
- position: static;
507
- inline-size: var(--s-ui-pane);
625
+ inset-block: var(--s-ui-head) 0;
626
+ grid-template-rows: auto minmax(0, 1fr);
508
627
  block-size: auto;
509
- clip-path: none;
510
- translate: none;
511
- visibility: visible;
512
- transition:
513
- inline-size var(--s-move) var(--s-ease),
514
- translate var(--s-travel) var(--s-glide),
515
- visibility var(--s-travel);
516
- }
517
-
518
- & .nav-list {
519
- inline-size: var(--s-ui-pane);
520
- }
521
-
522
- /* Docked and closed: the pane has no width, and the page has the room. */
523
- &:not(.mode-sheet, .state-open) .nav-pane {
524
- inline-size: 0;
525
- visibility: hidden;
526
- }
527
-
528
- /* As a sheet it keeps the room of the closed rail, however wide it grows: the rest lies over where the page was. */
529
- &.mode-sheet > .navigator {
530
- inline-size: var(--s-ui-row);
531
- }
532
- /* The rail grows in step with the page leaving. */
533
- &.mode-sheet .nav-bar {
534
- transition: inline-size var(--s-travel) var(--s-glide);
628
+ transform-origin: 0 calc(50dvb - var(--s-ui-head));
629
+ transform: translateX(50vi) perspective(var(--s-ui-eye)) translateX(-50vi) rotateY(-90deg);
630
+ view-transition-name: s-ui-navigator-pane;
535
631
  }
536
632
 
537
- /* The pane is beside the rail and takes no room. Closed, it is under the rail and off the window. */
538
- &.mode-sheet .nav-pane {
539
- position: absolute;
540
- inset-block: 0;
541
- inset-inline: var(--s-ui-row) auto;
542
- translate: -100% 0;
543
- visibility: hidden;
633
+ &.state-open .nav-pane {
634
+ transform: none;
544
635
  }
545
636
 
546
- &.mode-sheet.state-open .nav-pane {
547
- translate: calc(var(--s-ui-rail) - var(--s-ui-row)) 0;
548
- visibility: visible;
637
+ /* At its head, the row that goes back to the groups: an arrow and the name of the group, on the group's colour. */
638
+ & .nav-up {
639
+ display: flex;
640
+ align-items: center;
641
+ column-gap: var(--s-ui-inset);
642
+ block-size: var(--s-ui-row);
643
+ padding-inline: var(--s-ui-inset);
644
+ background: color-mix(in oklch, var(--s-on-line) var(--s-ui-press), var(--s-line));
645
+ color: var(--s-on-line);
646
+ font-size: 1.25rem;
647
+ white-space: nowrap;
648
+ overflow: clip;
649
+ forced-color-adjust: none;
549
650
  }
550
651
 
551
- /* The window has moved over to them: the page is moved across by as much as the rail has grown and the pane is wide. */
552
- &.mode-sheet.state-open > .shell-body {
553
- translate: calc(var(--s-ui-rail) - var(--s-ui-row) + var(--s-ui-pane)) 0;
652
+ & .nav-list {
653
+ grid-area: 2 / 1;
554
654
  }
555
655
  }
556
656
 
557
657
  /* ---- Along the top: a row of groups, and the places of one of them hanging under it. ---- */
558
658
 
559
659
  .shell.place-top {
660
+ --s-ui-hinge-y: 0px;
661
+ --s-ui-swing: rotateX(90deg);
662
+ --s-ui-clear-top: var(--s-ui-row);
663
+ --s-ui-clear-bottom: 0px;
664
+
560
665
  grid-template-rows: auto minmax(0, 1fr);
561
666
 
667
+ /* The page turns on the top edge of the window, where the bar is. */
562
668
  & > .shell-body {
563
669
  grid-row: 2;
564
670
  min-block-size: calc(100dvb - var(--s-ui-row));
565
- translate: none;
671
+ transform-origin: 50% var(--s-ui-seen);
672
+ }
673
+
674
+ &:is(.state-open, :has(:modal)) > .shell-body {
675
+ transform: translateY(50dvb) perspective(var(--s-ui-eye)) translateY(-50dvb) rotateX(-15deg);
676
+ }
677
+
678
+ & > .shell-body::after {
679
+ background: linear-gradient(
680
+ to bottom,
681
+ transparent calc(var(--s-ui-seen) + var(--s-ui-row)),
682
+ var(--s-ui-shade) calc(var(--s-ui-seen) + 100dvb)
683
+ );
566
684
  }
567
685
 
568
686
  & > .nav-top {
@@ -578,7 +696,7 @@
578
696
  display: none;
579
697
  }
580
698
 
581
- /* The row of groups. It is over the pane, so a sliding pane comes out from under it. */
699
+ /* The row of groups. */
582
700
  & .nav-bar {
583
701
  position: relative;
584
702
  z-index: 1;
@@ -589,11 +707,11 @@
589
707
  scrollbar-width: none;
590
708
  }
591
709
 
592
- & .nav-fold {
710
+ & .nav-home {
593
711
  inline-size: var(--s-ui-row);
594
712
  }
595
713
  /* With a mark and a name it is as wide as they are, and the name a word's width from the mark, as the groups have theirs. */
596
- & .nav-fold.nav-brand {
714
+ & .nav-home.nav-brand {
597
715
  inline-size: auto;
598
716
  column-gap: var(--s-unit);
599
717
  padding-inline: calc(2 * var(--s-unit));
@@ -614,8 +732,8 @@
614
732
 
615
733
  /*
616
734
  * The places of the group shown hang under it, in a list read
617
- * downwards. It is drawn down out of the bar, and back up into it: an
618
- * edge moves, and nothing fades. It takes no room and moves nothing,
735
+ * downwards. It turns down in front of the bar, on the middle of
736
+ * the bar, and back up: nothing fades. It takes no room,
619
737
  * like a menu, so it closes when a place is chosen.
620
738
  */
621
739
  & .nav-pane {
@@ -625,15 +743,12 @@
625
743
  inline-size: var(--s-ui-pane);
626
744
  block-size: auto;
627
745
  max-block-size: min(var(--s-ui-drawer), 100dvb - var(--s-ui-row));
628
- translate: none;
629
- clip-path: inset(0 0 100% 0);
630
- transition:
631
- clip-path var(--s-move) var(--s-ease),
632
- visibility var(--s-move);
746
+ transform-origin: 50% calc(-1 * var(--s-ui-row));
747
+ transform: translateY(50dvb) perspective(var(--s-ui-eye)) translateY(-50dvb) rotateX(90deg);
633
748
  }
634
749
 
635
750
  &.state-open .nav-pane {
636
- clip-path: inset(0);
751
+ transform: none;
637
752
  }
638
753
 
639
754
  /* Only the list of the group shown is in it: it is as long as that list, up to what the window has room for. */
@@ -642,14 +757,57 @@
642
757
  max-block-size: inherit;
643
758
  padding-block: 0 var(--s-unit);
644
759
  }
645
-
646
- & .nav-list:is(.is-before, .is-after) {
647
- display: none;
648
- }
649
760
  }
650
761
  }
651
762
  }
652
763
 
764
+ /*
765
+ * A change of view turns on the same post: the edge of the window the
766
+ * navigator is at. What turns then is a snapshot of the window, which the
767
+ * page's stylesheet moves, and all it can read is what the root says. So
768
+ * the root says where the post is in the window, how a view stands a
769
+ * quarter of a turn away from it, seen from in front of the middle of the
770
+ * window, and which part of the window is not the navigator's. The
771
+ * lengths are those of the shell: `--s-ui-row`, `--s-ui-tabs` and
772
+ * `--s-ui-pane`.
773
+ */
774
+ :root:has(.shell) {
775
+ /* The part of the window that is not the navigator's: all of a view that is drawn while one turns. */
776
+ --s-clear-top: 0px;
777
+ --s-clear: inset(var(--s-clear-top) 0 calc(3.5rem + env(safe-area-inset-bottom, 0px)) 0);
778
+ --s-post-x: 50vi;
779
+ --s-post-y: 100dvb;
780
+ --s-turn: translateY(calc(50dvb - var(--s-post-y))) perspective(150vmax) translateY(calc(var(--s-post-y) - 50dvb))
781
+ rotateX(-90deg);
782
+ --s-turn-away: translateY(calc(50dvb - var(--s-post-y))) perspective(150vmax)
783
+ translateY(calc(var(--s-post-y) - 50dvb)) rotateX(90deg);
784
+ }
785
+
786
+ :root:has(.shell > .nav-top) {
787
+ --s-clear-top: calc(3.75rem + env(safe-area-inset-top, 0px));
788
+ }
789
+
790
+ @media (width >= 48rem) {
791
+ :root:has(.shell.place-side) {
792
+ --s-clear: inset(0 0 0 14.25rem);
793
+ --s-post-x: 0px;
794
+ --s-post-y: 50dvb;
795
+ --s-turn: translateX(calc(50vi - var(--s-post-x))) perspective(150vmax) translateX(calc(var(--s-post-x) - 50vi))
796
+ rotateY(-90deg);
797
+ --s-turn-away: translateX(calc(50vi - var(--s-post-x))) perspective(150vmax)
798
+ translateX(calc(var(--s-post-x) - 50vi)) rotateY(90deg);
799
+ }
800
+
801
+ :root:has(.shell.place-top) {
802
+ --s-clear: inset(3.75rem 0 0 0);
803
+ --s-post-y: 0px;
804
+ --s-turn: translateY(calc(50dvb - var(--s-post-y))) perspective(150vmax) translateY(calc(var(--s-post-y) - 50dvb))
805
+ rotateX(90deg);
806
+ --s-turn-away: translateY(calc(50dvb - var(--s-post-y))) perspective(150vmax)
807
+ translateY(calc(var(--s-post-y) - 50dvb)) rotateX(-90deg);
808
+ }
809
+ }
810
+
653
811
  @media print {
654
812
  .navigator,
655
813
  .nav-top {