@jsenv/navi 0.29.372 → 0.29.374
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/dev/jsenv_navi.js +127 -9
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +127 -9
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/route_transitions.md +20 -1
- package/docs/view_transitions.md +43 -0
- package/package.json +1 -1
|
@@ -307,7 +307,11 @@ about the bar:
|
|
|
307
307
|
that takes the whole screen (a full-screen wizard whose banner is its own
|
|
308
308
|
header) is this case, on the way in and on the way back.
|
|
309
309
|
|
|
310
|
-
The pages are ordered above
|
|
310
|
+
The pages are ordered above a bar only one state has for that reason, and
|
|
311
|
+
below a bar both states have: the frame stands over the pages as it does at
|
|
312
|
+
rest, so what a bar paints outside its box — a button standing up out of a tab
|
|
313
|
+
bar, a shadow on the page — is seen for the length of the movement instead of
|
|
314
|
+
being cut at the bar's edge. The price of being
|
|
311
315
|
photographed is that a bar cannot answer the pointer for those few hundred
|
|
312
316
|
milliseconds, which is what a route transition wants anyway: both pages are
|
|
313
317
|
pictures too, and a press landing on either would be an accident. `RouteTravel`
|
|
@@ -316,6 +320,21 @@ is the opposite case — a finger is on the box — and leaves the bars live.
|
|
|
316
320
|
A bar the application names itself keeps its name and its own movement: navi
|
|
317
321
|
names only what is unnamed.
|
|
318
322
|
|
|
323
|
+
A **modal `Dialog` open on a page** is furniture of the same kind: its box is
|
|
324
|
+
photographed on its own and travels with its page, or holds where it stands if
|
|
325
|
+
both states have it. Its **wall** cannot be photographed (see
|
|
326
|
+
[view_transitions.md](./view_transitions.md#the-top-layer-is-painted-through-the-roots-picture)),
|
|
327
|
+
and dropping it for the movement makes the whole window blink under the press.
|
|
328
|
+
So the wall is painted where it would be seen: into the pages' picture, into
|
|
329
|
+
each bar's picture, and, for what no picture covers (the glass beside a
|
|
330
|
+
narrowed app, the window below a short page), as a live element under the
|
|
331
|
+
pictures that fades on the movement's clock. The outcome is derived from the
|
|
332
|
+
pair of states like everything else here — a page leaving from under a wall
|
|
333
|
+
leaves dimmed and the bars fade their dim with it; a page arriving under one
|
|
334
|
+
arrives dimmed and the bars dim with it; a wall both states have holds. The real
|
|
335
|
+
wall is switched off for exactly the length of the movement, so no frame shows
|
|
336
|
+
two walls. Demo: [a dialog leaving with its page](../src/nav/demos/route_transition_dialog/route_transition_dialog.html).
|
|
337
|
+
|
|
319
338
|
It is a `Box`, so the layout the pages need is written on it directly (`flex`,
|
|
320
339
|
`className`, `style`, …). An app that already has an element holding its pages
|
|
321
340
|
can mark that one with `data-navi-route-transition-area` rather than nesting
|
package/docs/view_transitions.md
CHANGED
|
@@ -11,6 +11,7 @@ they are met once.
|
|
|
11
11
|
- [Rendering is suspended for the whole callback](#rendering-is-suspended-for-the-whole-callback)
|
|
12
12
|
- [`finished` rejects when another transition replaces it](#finished-rejects-when-another-transition-replaces-it)
|
|
13
13
|
- [The top layer is painted through the root's picture](#the-top-layer-is-painted-through-the-roots-picture)
|
|
14
|
+
- [Two frames show the live document](#two-frames-show-the-live-document)
|
|
14
15
|
|
|
15
16
|
## A name is unique per document
|
|
16
17
|
|
|
@@ -85,3 +86,45 @@ past a few thousand pixels of scroll, which is how it hid). A transition that
|
|
|
85
86
|
opens or closes a top-layer surface keeps the root's default name and pays the
|
|
86
87
|
frozen page — under a modal wall that costs nothing. navi's own lift
|
|
87
88
|
(`popup_lift.md`) does exactly that.
|
|
89
|
+
|
|
90
|
+
When the root cannot be kept — a route transition splits the bars from the
|
|
91
|
+
pages, which only works with the root opted out — the top layer has to be
|
|
92
|
+
**stood in for**. A dialog's box is an element, so it can be named and
|
|
93
|
+
photographed on its own. Its wall cannot: `::backdrop` wears no name. What
|
|
94
|
+
works is painting what the wall paints into the pictures themselves: a plain
|
|
95
|
+
element appended inside each photographed box (the pages, each bar) before
|
|
96
|
+
each capture, and one `position: fixed` element in the live document for what
|
|
97
|
+
no picture covers, with a hole cut where each picture stands. The live one is
|
|
98
|
+
not a picture, so nothing cross-fades it: it is animated on the movement's own
|
|
99
|
+
clock. Where a picture stands changes over the movement — the frame the first
|
|
100
|
+
picture is taken on shows the leaving state, the last frame the arriving one,
|
|
101
|
+
and in between only the intersection of the two states' rectangles is under a
|
|
102
|
+
picture at every moment — so the holes are cut three times. Reference:
|
|
103
|
+
`paintTransitionWalls` and `paintRestWalls` in `nav/transition_furniture.js`;
|
|
104
|
+
the measured story is in [route_transitions.md](./route_transitions.md#pages-between-fixed-bars-the-transition-area).
|
|
105
|
+
|
|
106
|
+
## Two frames show the live document
|
|
107
|
+
|
|
108
|
+
A view transition is not pictures from the call to `finished`. **The frame the
|
|
109
|
+
first picture is taken on is rendered and shown**, with the top layer painted
|
|
110
|
+
as usual, and `:active-view-transition` already matches on it (it matches from
|
|
111
|
+
the `startViewTransition` call). **The frame after the pictures are dropped is
|
|
112
|
+
shown too**, before the `finished` callbacks run — they are a frame late.
|
|
113
|
+
Whatever is switched on for the movement is therefore on screen one frame
|
|
114
|
+
before the pictures and one frame after; anything it stands in for must be
|
|
115
|
+
switched off for exactly the same span, or that frame shows both (measured: a
|
|
116
|
+
wall twice as dark under the press, read as a flash).
|
|
117
|
+
|
|
118
|
+
Two consequences for the switch itself:
|
|
119
|
+
|
|
120
|
+
- **Switch both on the same DOM write**, at the same moment: an attribute set
|
|
121
|
+
before the call and removed in `finished`. The late frame then shows the
|
|
122
|
+
stand-in alone, which is what the real thing looked like — one frame nobody
|
|
123
|
+
can see.
|
|
124
|
+
- **`:active-view-transition` is the only same-frame signal at the end**: it
|
|
125
|
+
stops matching in the rendering step that drops the pictures, before that
|
|
126
|
+
frame is painted. It is what to use when the last frame must differ from the
|
|
127
|
+
movement (see the holes above). It is NOT what to gate a stand-in's
|
|
128
|
+
`display` on: hidden before the call, a stand-in measures as a zero rect and
|
|
129
|
+
lands in the wrong place; and on the capture frame it is displayed while the
|
|
130
|
+
real thing is still there.
|