@michaelyagi/shoji 0.1.0-beta.12 → 0.1.0-beta.14
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/core/shoji-core.css +43 -0
- package/dist/core/shoji-core.js.map +1 -1
- package/dist/core/shoji-core.min.css +1 -1
- package/dist/core/shoji-core.min.js.map +1 -1
- package/dist/esm/core/iconSwap.d.ts +21 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/types.d.ts +1 -1
- package/dist/esm/iconSwap-BAXTLihx.js +21 -0
- package/dist/esm/iconSwap-BAXTLihx.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index2.css +43 -0
- package/dist/esm/index3.css +1 -1
- package/dist/esm/plugins/autoplay/index.d.ts +40 -8
- package/dist/esm/plugins/autoplay/index.js +97 -23
- package/dist/esm/plugins/autoplay/index.js.map +1 -1
- package/dist/esm/plugins/fullscreen/index.js +4 -2
- package/dist/esm/plugins/fullscreen/index.js.map +1 -1
- package/dist/esm/plugins/zoom/icons.d.ts +14 -1
- package/dist/esm/plugins/zoom/index.js +18 -2
- package/dist/esm/plugins/zoom/index.js.map +1 -1
- package/dist/plugins/autoplay.css +1 -1
- package/dist/plugins/autoplay.js +113 -23
- package/dist/plugins/autoplay.js.map +1 -1
- package/dist/plugins/autoplay.min.js +1 -1
- package/dist/plugins/autoplay.min.js.map +1 -1
- package/dist/plugins/fullscreen.js +20 -2
- package/dist/plugins/fullscreen.js.map +1 -1
- package/dist/plugins/fullscreen.min.js +1 -1
- package/dist/plugins/fullscreen.min.js.map +1 -1
- package/dist/plugins/zoom.js +34 -2
- package/dist/plugins/zoom.js.map +1 -1
- package/dist/plugins/zoom.min.js +1 -1
- package/dist/plugins/zoom.min.js.map +1 -1
- package/dist/shoji.css +44 -1
- package/dist/shoji.js +134 -28
- package/dist/shoji.js.map +1 -1
- package/dist/shoji.min.css +1 -1
- package/dist/shoji.min.js +1 -1
- package/dist/shoji.min.js.map +1 -1
- package/package.json +1 -1
package/dist/core/shoji-core.css
CHANGED
|
@@ -51,6 +51,13 @@
|
|
|
51
51
|
|
|
52
52
|
--shoji-easing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
53
53
|
--shoji-duration: 300ms;
|
|
54
|
+
/* A dedicated var, not a reuse of --shoji-duration: a toolbar icon
|
|
55
|
+
cross-fade (Fullscreen's enter/exit, Autoplay's play/pause, Zoom's
|
|
56
|
+
actual-size expand/contract, src/core/iconSwap.ts) reads as a snappy
|
|
57
|
+
state flip, not a UI transition on the same scale as opening/closing —
|
|
58
|
+
the same "reuse read as too slow/fast for a different purpose"
|
|
59
|
+
reasoning `--shoji-active-thumbnail-fade-duration` was split out for. */
|
|
60
|
+
--shoji-icon-swap-duration: 150ms;
|
|
54
61
|
/* The toolbar's own rendered height (44px button + top/bottom padding) —
|
|
55
62
|
defined before the caption sizing below since it now derives from
|
|
56
63
|
this. Also reserves space at the top of a provider embed (YouTube
|
|
@@ -125,6 +132,7 @@
|
|
|
125
132
|
@media (prefers-reduced-motion: reduce) {
|
|
126
133
|
:root {
|
|
127
134
|
--shoji-duration: 0ms;
|
|
135
|
+
--shoji-icon-swap-duration: 0ms;
|
|
128
136
|
}
|
|
129
137
|
}
|
|
130
138
|
|
|
@@ -358,6 +366,41 @@
|
|
|
358
366
|
pointer-events: none;
|
|
359
367
|
}
|
|
360
368
|
|
|
369
|
+
/* `src/core/iconSwap.ts` — a toolbar button whose icon reflects live state
|
|
370
|
+
(Fullscreen enter/exit, Autoplay play/pause, Zoom actual-size
|
|
371
|
+
expand/contract). Both icons stay in the DOM at once, exactly stacked;
|
|
372
|
+
the modifier class below only ever changes which one is opaque, so the
|
|
373
|
+
swap is a plain cross-fade with nothing being added/removed mid-transition
|
|
374
|
+
(no flash-of-no-icon between an old node's removal and a new one's
|
|
375
|
+
fill/stroke painting in). */
|
|
376
|
+
.shoji-icon-swap {
|
|
377
|
+
position: relative;
|
|
378
|
+
display: inline-flex;
|
|
379
|
+
width: 24px;
|
|
380
|
+
height: 24px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.shoji-icon-swap-icon {
|
|
384
|
+
position: absolute;
|
|
385
|
+
inset: 0;
|
|
386
|
+
display: flex;
|
|
387
|
+
align-items: center;
|
|
388
|
+
justify-content: center;
|
|
389
|
+
transition: opacity var(--shoji-icon-swap-duration, 150ms) var(--shoji-easing);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.shoji-icon-swap-icon--on {
|
|
393
|
+
opacity: 0;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.shoji-icon-swap--on .shoji-icon-swap-icon--off {
|
|
397
|
+
opacity: 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.shoji-icon-swap--on .shoji-icon-swap-icon--on {
|
|
401
|
+
opacity: 1;
|
|
402
|
+
}
|
|
403
|
+
|
|
361
404
|
.shoji-slides {
|
|
362
405
|
position: relative;
|
|
363
406
|
flex: 1;
|