craft-library 0.9.0 → 0.10.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.
- package/README.md +33 -2
- package/dist/card-load.js +1 -1
- package/dist/card-mount.js +1 -1
- package/dist/card.cdn.js +1 -1
- package/dist/card.js +1 -1
- package/dist/cdn.js +4 -4
- package/dist/craft.js +863 -22
- package/dist/elements.js +25 -4
- package/dist/glassnav.js +1 -1
- package/dist/index.js +17 -2
- package/dist/joinha.js +1 -1
- package/dist/leporello-assets.js +3 -0
- package/dist/leporello.js +466 -0
- package/dist/like.js +1 -1
- package/dist/magnet.js +1 -1
- package/dist/olea/amb-ecobag.jpg +0 -0
- package/dist/olea/amb-linha.jpg +0 -0
- package/dist/olea/amb-mesa.jpg +0 -0
- package/dist/olea/amb-papelaria.jpg +0 -0
- package/dist/olea/amb-rotulo.jpg +0 -0
- package/dist/olea/ecobag.jpg +0 -0
- package/dist/olea/linha.jpg +0 -0
- package/dist/olea/mesa.jpg +0 -0
- package/dist/olea/papelaria.jpg +0 -0
- package/dist/olea/rotulo.jpg +0 -0
- package/dist/orb.js +1 -1
- package/dist/panorama-assets.js +2 -2
- package/dist/panorama-mount.js +1 -1
- package/dist/panorama.js +1 -1
- package/dist/piggy-load.js +1 -1
- package/dist/piggy-mount.js +1 -1
- package/dist/piggy.cdn.js +1 -1
- package/dist/piggy.js +1 -1
- package/dist/pin-load.js +1 -1
- package/dist/pin-mount.js +1 -1
- package/dist/pin.cdn.js +1 -1
- package/dist/pin.js +1 -1
- package/dist/sign.js +1 -1
- package/dist/style.js +1 -1
- package/dist/thinking.js +1 -1
- package/dist/tokens-load.js +1 -1
- package/dist/tokens-mount.js +1 -1
- package/dist/tokens.cdn.js +1 -1
- package/dist/tokens.js +1 -1
- package/package.json +1 -1
package/dist/craft.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Sara Lobo Library · liquid glass nav bar, bursting heart, magnetic icon, iridescent card, glass piggy bank, magic sphere, sweep, panorama, map pin, token wheel, thumbs reaction, fold orb · <glass-nav>, <like-button>, <magnetic-icon>, <iridescent-card>, <piggy-bank>, <magic-sphere>, <sweep-sphere>, <panorama-reel>, <map-pin>, <token-wheel>, <thumbs-reaction>, <fold-orb> · https://saralobolibrary.com · MIT */
|
|
1
|
+
/*! Sara Lobo Library · liquid glass nav bar, bursting heart, magnetic icon, iridescent card, glass piggy bank, magic sphere, sweep, panorama, map pin, token wheel, thumbs reaction, fold orb, leporello · <glass-nav>, <like-button>, <magnetic-icon>, <iridescent-card>, <piggy-bank>, <magic-sphere>, <sweep-sphere>, <panorama-reel>, <map-pin>, <token-wheel>, <thumbs-reaction>, <fold-orb>, <leporello-book> · https://saralobolibrary.com · MIT */
|
|
2
2
|
(() => {
|
|
3
3
|
// dist/style.js
|
|
4
4
|
var done = /* @__PURE__ */ new Set();
|
|
@@ -2972,7 +2972,7 @@ void main() {
|
|
|
2972
2972
|
show();
|
|
2973
2973
|
}
|
|
2974
2974
|
set(o.value);
|
|
2975
|
-
var
|
|
2975
|
+
var api8 = {
|
|
2976
2976
|
set,
|
|
2977
2977
|
// the reaction again, as a tap would play it (from rest, so it can be shown on a loop)
|
|
2978
2978
|
play: function(v) {
|
|
@@ -2995,7 +2995,7 @@ void main() {
|
|
|
2995
2995
|
root.__joinha = null;
|
|
2996
2996
|
}
|
|
2997
2997
|
};
|
|
2998
|
-
return root.__joinha =
|
|
2998
|
+
return root.__joinha = api8;
|
|
2999
2999
|
}
|
|
3000
3000
|
function scan() {
|
|
3001
3001
|
Array.prototype.forEach.call(document.querySelectorAll(".joinha"), function(r) {
|
|
@@ -3195,14 +3195,14 @@ void main() {
|
|
|
3195
3195
|
host.appendChild(canvas);
|
|
3196
3196
|
var gl = canvas.getContext("webgl", { antialias: false, alpha: false, depth: false, stencil: false, premultipliedAlpha: false, powerPreference: "high-performance" });
|
|
3197
3197
|
var noop = function() {
|
|
3198
|
-
return
|
|
3198
|
+
return api8;
|
|
3199
3199
|
};
|
|
3200
|
-
var
|
|
3200
|
+
var api8 = { set: noop, tone: noop, level: noop, pulse: noop, lookAt: noop, follow: noop, destroy: function() {
|
|
3201
3201
|
canvas.remove();
|
|
3202
3202
|
} };
|
|
3203
3203
|
if (!gl) {
|
|
3204
3204
|
host.classList.add("orb-nogl");
|
|
3205
|
-
return
|
|
3205
|
+
return api8;
|
|
3206
3206
|
}
|
|
3207
3207
|
function sh(type, src) {
|
|
3208
3208
|
var s = gl.createShader(type);
|
|
@@ -3217,7 +3217,7 @@ void main() {
|
|
|
3217
3217
|
gl.linkProgram(prog);
|
|
3218
3218
|
if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) {
|
|
3219
3219
|
host.classList.add("orb-nogl");
|
|
3220
|
-
return
|
|
3220
|
+
return api8;
|
|
3221
3221
|
}
|
|
3222
3222
|
gl.useProgram(prog);
|
|
3223
3223
|
var buf = gl.createBuffer();
|
|
@@ -3510,38 +3510,38 @@ void main() {
|
|
|
3510
3510
|
step(0);
|
|
3511
3511
|
draw();
|
|
3512
3512
|
raf = requestAnimationFrame(frame);
|
|
3513
|
-
|
|
3513
|
+
api8 = {
|
|
3514
3514
|
set: function(s) {
|
|
3515
3515
|
if (STATES[s]) {
|
|
3516
3516
|
state = s;
|
|
3517
3517
|
if (s === "listening" && o.mic) startMic();
|
|
3518
3518
|
if (s !== "listening") stopMic();
|
|
3519
3519
|
}
|
|
3520
|
-
return
|
|
3520
|
+
return api8;
|
|
3521
3521
|
},
|
|
3522
3522
|
tone: function(n) {
|
|
3523
3523
|
if (TONES[n]) {
|
|
3524
3524
|
tone = n;
|
|
3525
3525
|
want = TONES[n];
|
|
3526
3526
|
}
|
|
3527
|
-
return
|
|
3527
|
+
return api8;
|
|
3528
3528
|
},
|
|
3529
3529
|
level: function(v) {
|
|
3530
3530
|
extLevel = v == null ? null : +v;
|
|
3531
|
-
return
|
|
3531
|
+
return api8;
|
|
3532
3532
|
},
|
|
3533
3533
|
pulse: function() {
|
|
3534
3534
|
key();
|
|
3535
|
-
return
|
|
3535
|
+
return api8;
|
|
3536
3536
|
},
|
|
3537
3537
|
lookAt: function(x, y) {
|
|
3538
3538
|
if (x == null) {
|
|
3539
3539
|
look = null;
|
|
3540
|
-
return
|
|
3540
|
+
return api8;
|
|
3541
3541
|
}
|
|
3542
3542
|
var r = host.getBoundingClientRect();
|
|
3543
3543
|
look = [x - r.left, y - r.top];
|
|
3544
|
-
return
|
|
3544
|
+
return api8;
|
|
3545
3545
|
},
|
|
3546
3546
|
follow: function(el) {
|
|
3547
3547
|
if (followEl) {
|
|
@@ -3560,7 +3560,7 @@ void main() {
|
|
|
3560
3560
|
followEl.addEventListener("keyup", readCaret);
|
|
3561
3561
|
followEl.addEventListener("click", readCaret);
|
|
3562
3562
|
}
|
|
3563
|
-
return
|
|
3563
|
+
return api8;
|
|
3564
3564
|
},
|
|
3565
3565
|
get state() {
|
|
3566
3566
|
return state;
|
|
@@ -3571,7 +3571,7 @@ void main() {
|
|
|
3571
3571
|
destroy: function() {
|
|
3572
3572
|
dead = true;
|
|
3573
3573
|
cancelAnimationFrame(raf);
|
|
3574
|
-
|
|
3574
|
+
api8.follow(null);
|
|
3575
3575
|
stopMic();
|
|
3576
3576
|
if (ro) ro.disconnect();
|
|
3577
3577
|
else removeEventListener("resize", size);
|
|
@@ -3582,10 +3582,10 @@ void main() {
|
|
|
3582
3582
|
host.classList.remove("orb");
|
|
3583
3583
|
}
|
|
3584
3584
|
};
|
|
3585
|
-
if (o.follow)
|
|
3586
|
-
if (o.level != null)
|
|
3587
|
-
|
|
3588
|
-
return
|
|
3585
|
+
if (o.follow) api8.follow(typeof o.follow === "string" ? document.querySelector(o.follow) : o.follow);
|
|
3586
|
+
if (o.level != null) api8.level(o.level);
|
|
3587
|
+
api8.set(state);
|
|
3588
|
+
return api8;
|
|
3589
3589
|
}
|
|
3590
3590
|
orb.tones = Object.keys(TONES);
|
|
3591
3591
|
orb.states = Object.keys(STATES);
|
|
@@ -3620,6 +3620,824 @@ void main() {
|
|
|
3620
3620
|
};
|
|
3621
3621
|
}
|
|
3622
3622
|
|
|
3623
|
+
// src/leporello-assets-cdn.js
|
|
3624
|
+
var me6 = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : "";
|
|
3625
|
+
var ASSETS2 = me6 ? me6.slice(0, me6.lastIndexOf("/") + 1) : "https://cdn.jsdelivr.net/npm/craft-library@0/dist/";
|
|
3626
|
+
|
|
3627
|
+
// dist/leporello.js
|
|
3628
|
+
var CSS8 = `/*! Leporello \xB7 Sara Lobo Library \xB7 https://saralobolibrary.com/leporello \xB7 MIT */
|
|
3629
|
+
/* The brand book in a folded strip: it fills the box it is given and paints its own dark ground. Sizes follow the box
|
|
3630
|
+
(container query units), so the same piece reads in a card, a section or a full screen. */
|
|
3631
|
+
.lep{--lep-ink:#EFE9DC;--lep-mut:#9A9384;--lep-ground:#141310;--lep-paper:#F1EDE5;--lep-ink2:#23241F;--lep-serif:'Cormorant Garamond','Instrument Serif',Georgia,'Times New Roman',serif;--lep-sans:-apple-system,BlinkMacSystemFont,'SF Pro Text','Inter','Helvetica Neue',system-ui,sans-serif;
|
|
3632
|
+
position:relative;width:100%;height:100%;min-height:300px;overflow:hidden;display:flex;flex-direction:column;background:var(--lep-ground);color:var(--lep-ink);container-type:size;font-family:var(--lep-sans);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;user-select:none;-webkit-user-select:none}
|
|
3633
|
+
.lep *,.lep *::before,.lep *::after{box-sizing:border-box}
|
|
3634
|
+
.lep button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;padding:0;margin:0;-webkit-tap-highlight-color:transparent}
|
|
3635
|
+
.lep img{-webkit-user-drag:none}
|
|
3636
|
+
/* the stage takes the light of the page in the middle */
|
|
3637
|
+
.lep-amb{position:absolute;inset:0;overflow:hidden;pointer-events:none}
|
|
3638
|
+
.lep-amb i{position:absolute;inset:-12%;opacity:0;will-change:opacity}
|
|
3639
|
+
.lep-amb i.blur{filter:blur(48px) saturate(1.1)}
|
|
3640
|
+
.lep-amb::after{content:"";position:absolute;inset:0;background:radial-gradient(85% 75% at 50% 50%,rgba(20,19,16,.45),rgba(20,19,16,.86) 72%,#141310)}
|
|
3641
|
+
.lep-head,.lep-scene,.lep-cap{position:relative;z-index:1}
|
|
3642
|
+
.lep-head{flex:none;display:flex;flex-direction:column;align-items:center;gap:clamp(6px,1.4cqh,10px);padding:clamp(16px,5cqh,30px) 24px 0;text-align:center}
|
|
3643
|
+
.lep-head small{font:600 clamp(10px,1.1cqw,12px)/1 var(--lep-serif);letter-spacing:.5em;padding-left:.5em;color:var(--lep-mut)}
|
|
3644
|
+
.lep-title{margin:0;font:300 clamp(28px,min(5cqw,10cqh),56px)/.95 var(--lep-serif);letter-spacing:-.012em;color:var(--lep-ink)}
|
|
3645
|
+
.lep-title em{font-style:italic;font-weight:300}
|
|
3646
|
+
.lep-cap{flex:none;display:flex;flex-direction:column;align-items:center;gap:clamp(10px,2.4cqh,14px);padding:0 24px clamp(18px,5cqh,28px)}
|
|
3647
|
+
.lep-row{display:flex;align-items:baseline;gap:12px}
|
|
3648
|
+
.lep-num{display:grid;font:italic 400 clamp(14px,1.6cqw,17px) var(--lep-serif);color:var(--lep-mut)}
|
|
3649
|
+
.lep-name{display:grid;font:400 clamp(21px,2.7cqw,29px)/1.1 var(--lep-serif);letter-spacing:-.005em;white-space:nowrap}
|
|
3650
|
+
.lep-mw{grid-area:1/1;white-space:pre}
|
|
3651
|
+
.lep-mw span{display:inline-block}
|
|
3652
|
+
.lep-dots{position:relative;height:1px;overflow:hidden;flex:none}
|
|
3653
|
+
.lep-dt-row{position:absolute;left:0;top:0;display:flex;gap:6px}
|
|
3654
|
+
.lep-dt-row i{width:18px;height:1px;background:rgba(236,231,218,.16)}
|
|
3655
|
+
.lep-dots b{position:absolute;left:0;top:0;width:18px;height:1px;background:#ECE7DA;will-change:transform}
|
|
3656
|
+
/* the strip */
|
|
3657
|
+
.lep-scene{flex:1;min-height:0;overflow:hidden;perspective:1500px;touch-action:pan-y;cursor:grab;-webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
|
|
3658
|
+
.lep-scene.lep-drag{cursor:grabbing}
|
|
3659
|
+
.lep-scene.lep-peek{cursor:none}
|
|
3660
|
+
.lep-scene:focus{outline:none}
|
|
3661
|
+
.lep-scene:focus-visible{outline:1px solid rgba(239,233,220,.3);outline-offset:-10px;border-radius:14px}
|
|
3662
|
+
.lep-world{position:absolute;inset:0;transform-style:preserve-3d;pointer-events:none}
|
|
3663
|
+
.lep-page{position:absolute;left:0;top:0;transform-origin:0 50%;background:#F3F0E9;overflow:hidden;cursor:pointer;pointer-events:auto;will-change:transform}
|
|
3664
|
+
.lep-page.lep-held{visibility:hidden!important}
|
|
3665
|
+
.lep-page::before{content:"";position:absolute;inset:0;border-left:1px solid rgba(0,0,0,.08);pointer-events:none;z-index:2}
|
|
3666
|
+
.lep-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
|
|
3667
|
+
.lep-sh{position:absolute;inset:0;background:#0b0b09;opacity:0;pointer-events:none;z-index:3}
|
|
3668
|
+
.lep-plus{position:absolute;right:9px;bottom:9px;width:26px;height:26px;border-radius:50%;background:rgba(241,237,229,.94);color:#23241F;display:grid;place-items:center;opacity:0;transform:scale(.9);transition:opacity .3s cubic-bezier(.22,1,.36,1),transform .4s cubic-bezier(.22,1,.36,1);z-index:4;box-shadow:0 2px 8px rgba(0,0,0,.22)}
|
|
3669
|
+
.lep-page.lep-center .lep-plus{opacity:1;transform:none}
|
|
3670
|
+
.lep-floor{position:absolute;left:12%;right:12%;height:46px;margin-top:-23px;border-radius:50%;background:radial-gradient(closest-side,rgba(0,0,0,.6),rgba(0,0,0,0));pointer-events:none}
|
|
3671
|
+
.lep-cur{position:absolute;left:0;top:0;width:66px;height:66px;margin:-33px 0 0 -33px;border-radius:50%;background:var(--lep-paper);color:var(--lep-ink2);display:grid;place-items:center;font:600 10px var(--lep-sans);letter-spacing:.18em;padding-left:.18em;text-transform:uppercase;opacity:0;scale:.8;pointer-events:none;z-index:5;transition:opacity .25s cubic-bezier(.22,1,.36,1),scale .45s cubic-bezier(.22,1,.36,1);box-shadow:0 12px 30px -12px rgba(0,0,0,.7);will-change:transform}
|
|
3672
|
+
.lep-cur.lep-on{opacity:1;scale:1}
|
|
3673
|
+
/* pages drawn in type (the demo's cover, palette and specimen) scale with the page */
|
|
3674
|
+
.lep-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#5E6442;color:#F2EEE3}
|
|
3675
|
+
.lep-cover b{font:400 calc(var(--lep-pw) * .2)/1 var(--lep-serif);letter-spacing:.14em;padding-left:.14em}
|
|
3676
|
+
.lep-pal{position:absolute;inset:0;display:grid;grid-template-rows:1.3fr 1fr 1fr 1fr}
|
|
3677
|
+
.lep-pal div{display:flex;align-items:flex-end;padding:7% 9%;font:400 calc(var(--lep-pw) * .085)/1.1 var(--lep-serif)}
|
|
3678
|
+
.lep-type{position:absolute;inset:0;padding:11% 10%;display:flex;flex-direction:column;justify-content:flex-end;color:#24251F;background:#EDE8DE}
|
|
3679
|
+
.lep-type b{font:300 calc(var(--lep-pw) * .62)/.85 var(--lep-serif)}
|
|
3680
|
+
/* the page of its own */
|
|
3681
|
+
.lep-od{position:absolute;inset:0;z-index:6;pointer-events:none}
|
|
3682
|
+
.lep-od.lep-on{pointer-events:auto}
|
|
3683
|
+
.lep-od-bg{position:absolute;inset:0;background:var(--lep-paper);opacity:0}
|
|
3684
|
+
.lep-od-media{position:absolute;left:0;top:0;overflow:hidden;visibility:hidden;background:#F3F0E9}
|
|
3685
|
+
.lep-od-media>div{position:absolute;inset:0}
|
|
3686
|
+
.lep-od-text{position:absolute;left:calc(58% + 7cqw);right:6cqw;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center;color:var(--lep-ink2);user-select:text;-webkit-user-select:text}
|
|
3687
|
+
.lep-od-text>*{opacity:0;transform:translateY(8px);transition:opacity .16s ease,transform .16s ease}
|
|
3688
|
+
.lep-od.lep-ui .lep-od-text>*{opacity:1;transform:none;transition:opacity .55s cubic-bezier(.2,0,0,1),transform .55s cubic-bezier(.2,0,0,1)}
|
|
3689
|
+
.lep-od.lep-ui .lep-od-text>:nth-child(2){transition-delay:.06s}
|
|
3690
|
+
.lep-od.lep-ui .lep-od-text>:nth-child(3){transition-delay:.12s}
|
|
3691
|
+
.lep-od.lep-ui .lep-od-text>:nth-child(4){transition-delay:.18s}
|
|
3692
|
+
.lep-od-text.lep-swap>*{opacity:0!important;transform:translateY(6px)!important;transition:opacity .16s ease,transform .16s ease!important}
|
|
3693
|
+
.lep-od-k{font:500 11px var(--lep-sans);letter-spacing:.3em;color:#8C8778;font-variant-numeric:tabular-nums}
|
|
3694
|
+
.lep-od-text h4{margin:clamp(8px,2.6cqh,16px) 0 0;font:300 clamp(30px,min(4.8cqw,9.5cqh),54px)/1 var(--lep-serif);letter-spacing:-.012em}
|
|
3695
|
+
.lep-od-text p{margin:clamp(10px,3.4cqh,20px) 0 0;max-width:30ch;font:400 clamp(13px,1.35cqw,15px)/1.65 var(--lep-sans);color:#5C5B52}
|
|
3696
|
+
.lep-od-nav{margin-top:clamp(18px,6cqh,36px);display:flex;gap:10px}
|
|
3697
|
+
.lep-od-nav button{width:42px;height:42px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(35,36,31,.16);display:grid;place-items:center;color:var(--lep-ink2);transition:background-color .2s ease}
|
|
3698
|
+
.lep-od-nav button:hover{background:rgba(35,36,31,.06)}
|
|
3699
|
+
.lep-od-x{position:absolute;top:18px;right:18px;width:42px;height:42px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(35,36,31,.16);color:var(--lep-ink2);display:grid;place-items:center;opacity:0;transition:opacity .2s ease}
|
|
3700
|
+
.lep-od.lep-ui .lep-od-x{opacity:1;transition:opacity .4s ease .1s}
|
|
3701
|
+
.lep button:focus-visible{outline:1.5px solid var(--lep-ink2);outline-offset:2px}
|
|
3702
|
+
/* a narrow box: the picture on top, the words under it */
|
|
3703
|
+
@container (max-width:599px){
|
|
3704
|
+
.lep-od-text{left:22px;right:22px;top:calc(52% + 18px);bottom:20px;justify-content:flex-start}
|
|
3705
|
+
.lep-od-nav{margin-top:auto}
|
|
3706
|
+
.lep-od-x{background:rgba(241,237,229,.92);box-shadow:0 2px 12px rgba(0,0,0,.14)}
|
|
3707
|
+
}
|
|
3708
|
+
@media (prefers-reduced-motion:reduce){
|
|
3709
|
+
.lep-plus,.lep-cur,.lep-od-text>*,.lep-od-x{transition-duration:.01s!important}
|
|
3710
|
+
}
|
|
3711
|
+
`;
|
|
3712
|
+
var api7;
|
|
3713
|
+
function engine7() {
|
|
3714
|
+
if (api7) return api7;
|
|
3715
|
+
const window2 = {};
|
|
3716
|
+
(function() {
|
|
3717
|
+
"use strict";
|
|
3718
|
+
var FONTS2 = "https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap";
|
|
3719
|
+
var REDUCE = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3720
|
+
var OLEA = [
|
|
3721
|
+
{ title: "Cover", html: '<div class="lep-cover"><b>OLEA</b></div>', ambient: "#5E6442", text: "The brand in one word: the name in a fine serif, with room to breathe." },
|
|
3722
|
+
{ title: "Label", image: "olea/rotulo.jpg", ambient: "olea/amb-rotulo.jpg", text: "Cotton paper with a blind emboss, and the harvest printed on every bottle." },
|
|
3723
|
+
{ title: "Palette", html: '<div class="lep-pal"><div style="background:#5E6442;color:#F2EEE3">Olive</div><div style="background:#E9E3D6;color:#3B3A33">Stone</div><div style="background:#A66A3F;color:#F6ECE3">Earth</div><div style="background:#23241F;color:#E9E3D6">Ink</div></div>', ambient: "linear-gradient(160deg,#5E6442,#A66A3F)", text: "Four colours taken from the grove: the leaf, the stone, the earth and the ink." },
|
|
3724
|
+
{ title: "Full range", image: "olea/linha.jpg", ambient: "olea/amb-linha.jpg", text: "Three sizes and a gift box, in one family of frosted glass." },
|
|
3725
|
+
{ title: "Typography", html: '<div class="lep-type"><b>Aa</b></div>', ambient: "#6A645A", text: "A high-contrast serif for headings and a quiet sans for everything else." },
|
|
3726
|
+
{ title: "Stationery", image: "olea/papelaria.jpg", ambient: "olea/amb-papelaria.jpg", text: "Linen paper and olive green in a single colour, with no varnish or gloss." },
|
|
3727
|
+
{ title: "Tote bag", image: "olea/ecobag.jpg", ambient: "olea/amb-ecobag.jpg", text: "Raw cotton and the name in green, for the market and the shop." },
|
|
3728
|
+
{ title: "At the table", image: "olea/mesa.jpg", ambient: "olea/amb-mesa.jpg", text: "The product where it belongs: bread, salt and this year\u2019s oil." }
|
|
3729
|
+
];
|
|
3730
|
+
var clamp2 = function(x, a, b) {
|
|
3731
|
+
return Math.min(b, Math.max(a, x));
|
|
3732
|
+
};
|
|
3733
|
+
var smooth = function(a, b, x) {
|
|
3734
|
+
var t = clamp2((x - a) / (b - a), 0, 1);
|
|
3735
|
+
return t * t * (3 - 2 * t);
|
|
3736
|
+
};
|
|
3737
|
+
var wrapN = function(x, m) {
|
|
3738
|
+
return (x % m + m) % m;
|
|
3739
|
+
};
|
|
3740
|
+
var wdiff = function(x, m) {
|
|
3741
|
+
return wrapN(x + m / 2, m) - m / 2;
|
|
3742
|
+
};
|
|
3743
|
+
var f2 = function(x) {
|
|
3744
|
+
return x.toFixed(2);
|
|
3745
|
+
};
|
|
3746
|
+
var pad = function(n) {
|
|
3747
|
+
return String(n).padStart(2, "0");
|
|
3748
|
+
};
|
|
3749
|
+
var esc2 = function(s) {
|
|
3750
|
+
return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3751
|
+
};
|
|
3752
|
+
var mk = function(cls, tag) {
|
|
3753
|
+
var e = document.createElement(tag || "div");
|
|
3754
|
+
if (cls) e.className = cls;
|
|
3755
|
+
return e;
|
|
3756
|
+
};
|
|
3757
|
+
var bez = function(x1, y1, x2, y2) {
|
|
3758
|
+
var cx = 3 * x1, bx = 3 * (x2 - x1) - cx, ax = 1 - cx - bx, cy = 3 * y1, by = 3 * (y2 - y1) - cy, ay = 1 - cy - by;
|
|
3759
|
+
return function(x) {
|
|
3760
|
+
if (x <= 0) return 0;
|
|
3761
|
+
if (x >= 1) return 1;
|
|
3762
|
+
var t = x;
|
|
3763
|
+
for (var i = 0; i < 8; i++) {
|
|
3764
|
+
var e = ((ax * t + bx) * t + cx) * t - x, d = (3 * ax * t + 2 * bx) * t + cx;
|
|
3765
|
+
if (Math.abs(e) < 1e-5 || Math.abs(d) < 1e-6) break;
|
|
3766
|
+
t -= e / d;
|
|
3767
|
+
}
|
|
3768
|
+
t = clamp2(t, 0, 1);
|
|
3769
|
+
return ((ay * t + by) * t + cy) * t;
|
|
3770
|
+
};
|
|
3771
|
+
};
|
|
3772
|
+
var EASE_OUT = bez(0.2, 0, 0, 1), EASE_IO = bez(0.45, 0, 0.25, 1);
|
|
3773
|
+
var tween = function(tw, clock) {
|
|
3774
|
+
return tw.from + (tw.to - tw.from) * tw.ease(clamp2((clock - tw.t0) / tw.dur, 0, 1));
|
|
3775
|
+
};
|
|
3776
|
+
function Spring(value, stiffness) {
|
|
3777
|
+
this.x = value;
|
|
3778
|
+
this.v = 0;
|
|
3779
|
+
this.target = value;
|
|
3780
|
+
this.k = stiffness;
|
|
3781
|
+
this.c = 2 * Math.sqrt(stiffness);
|
|
3782
|
+
}
|
|
3783
|
+
Spring.prototype.step = function(dt) {
|
|
3784
|
+
var n = Math.max(1, Math.ceil(dt * 240)), h = dt / n;
|
|
3785
|
+
for (var i = 0; i < n; i++) {
|
|
3786
|
+
this.v += (-this.k * (this.x - this.target) - this.c * this.v) * h;
|
|
3787
|
+
this.x += this.v * h;
|
|
3788
|
+
}
|
|
3789
|
+
return this.x;
|
|
3790
|
+
};
|
|
3791
|
+
function Track(M, period) {
|
|
3792
|
+
this.M = M;
|
|
3793
|
+
this.s = 0;
|
|
3794
|
+
this.vel = 0;
|
|
3795
|
+
this.mode = "auto";
|
|
3796
|
+
this.gain = 0;
|
|
3797
|
+
this.hover = false;
|
|
3798
|
+
this.focus = false;
|
|
3799
|
+
this.paused = REDUCE;
|
|
3800
|
+
this.lock = false;
|
|
3801
|
+
this.idle = 99;
|
|
3802
|
+
this.wheelT = 0;
|
|
3803
|
+
this.eps = 0.12;
|
|
3804
|
+
this.vmax = 1 / Math.sqrt(this.eps) / period;
|
|
3805
|
+
this.sp = new Spring(0, 42);
|
|
3806
|
+
}
|
|
3807
|
+
Track.prototype = {
|
|
3808
|
+
touch: function() {
|
|
3809
|
+
this.idle = 0;
|
|
3810
|
+
},
|
|
3811
|
+
wantAuto: function() {
|
|
3812
|
+
return !this.lock && !this.paused && !this.hover && !this.focus && this.idle > 2.4;
|
|
3813
|
+
},
|
|
3814
|
+
settleTo: function(target, v) {
|
|
3815
|
+
this.mode = "settle";
|
|
3816
|
+
this.sp.x = this.s;
|
|
3817
|
+
this.sp.v = v === void 0 ? this.vel : v;
|
|
3818
|
+
this.sp.target = target;
|
|
3819
|
+
},
|
|
3820
|
+
base: function() {
|
|
3821
|
+
return this.mode === "settle" ? Math.round(this.sp.target) : this.vel > 0.02 ? Math.ceil(this.s - 0.04) : Math.round(this.s);
|
|
3822
|
+
},
|
|
3823
|
+
release: function(v) {
|
|
3824
|
+
this.touch();
|
|
3825
|
+
this.settleTo(Math.round(this.s + clamp2(v * 0.22, -2.5, 2.5)), v);
|
|
3826
|
+
},
|
|
3827
|
+
goto: function(slot) {
|
|
3828
|
+
this.touch();
|
|
3829
|
+
var b = this.base();
|
|
3830
|
+
this.settleTo(b + wdiff(slot - b, this.M));
|
|
3831
|
+
},
|
|
3832
|
+
holdAt: function(slot) {
|
|
3833
|
+
this.touch();
|
|
3834
|
+
this.settleTo(this.s + wdiff(slot - this.s, this.M));
|
|
3835
|
+
},
|
|
3836
|
+
nudge: function(n) {
|
|
3837
|
+
this.touch();
|
|
3838
|
+
this.settleTo(this.base() + n);
|
|
3839
|
+
},
|
|
3840
|
+
wheel: function(ds) {
|
|
3841
|
+
this.touch();
|
|
3842
|
+
if (this.mode !== "settle") this.settleTo(this.s);
|
|
3843
|
+
this.sp.target += ds;
|
|
3844
|
+
this.wheelT = 0.16;
|
|
3845
|
+
},
|
|
3846
|
+
step: function(dt) {
|
|
3847
|
+
this.idle += dt;
|
|
3848
|
+
if (this.mode === "drag") return;
|
|
3849
|
+
if (this.mode === "auto") {
|
|
3850
|
+
if (!this.wantAuto()) {
|
|
3851
|
+
var fr = this.s - Math.floor(this.s);
|
|
3852
|
+
this.settleTo(fr < 0.03 ? Math.floor(this.s) : Math.ceil(this.s), this.vel);
|
|
3853
|
+
this.gain = 0;
|
|
3854
|
+
return;
|
|
3855
|
+
}
|
|
3856
|
+
this.gain += (1 - this.gain) * (1 - Math.exp(-1.6 * dt));
|
|
3857
|
+
var sn = Math.sin(Math.PI * (this.s - Math.round(this.s)));
|
|
3858
|
+
this.vel = this.vmax * (this.eps + (1 - this.eps) * sn * sn) * this.gain;
|
|
3859
|
+
this.s += this.vel * dt;
|
|
3860
|
+
return;
|
|
3861
|
+
}
|
|
3862
|
+
if (this.wheelT > 0) {
|
|
3863
|
+
this.wheelT -= dt;
|
|
3864
|
+
if (this.wheelT <= 0) this.sp.target = Math.round(this.sp.target);
|
|
3865
|
+
}
|
|
3866
|
+
var prev = this.s;
|
|
3867
|
+
this.s = this.sp.step(dt);
|
|
3868
|
+
this.vel = (this.s - prev) / dt;
|
|
3869
|
+
if (this.wheelT <= 0 && Math.abs(this.s - this.sp.target) < 1e-3 && Math.abs(this.sp.v) < 3e-3) {
|
|
3870
|
+
this.s = this.sp.target;
|
|
3871
|
+
this.sp.v = 0;
|
|
3872
|
+
this.vel = 0;
|
|
3873
|
+
if (this.wantAuto()) {
|
|
3874
|
+
this.mode = "auto";
|
|
3875
|
+
this.gain = 0;
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
};
|
|
3880
|
+
function morph(el, text, instant) {
|
|
3881
|
+
var cur = el.querySelector(".lep-mw.on");
|
|
3882
|
+
if (cur && cur.getAttribute("data-t") === text) return;
|
|
3883
|
+
var nw = mk("lep-mw on", "span");
|
|
3884
|
+
nw.setAttribute("data-t", text);
|
|
3885
|
+
Array.from(text).forEach(function(ch) {
|
|
3886
|
+
var s = mk("", "span");
|
|
3887
|
+
s.textContent = ch;
|
|
3888
|
+
nw.appendChild(s);
|
|
3889
|
+
});
|
|
3890
|
+
el.appendChild(nw);
|
|
3891
|
+
if (cur) {
|
|
3892
|
+
cur.classList.remove("on");
|
|
3893
|
+
if (instant || !cur.animate) {
|
|
3894
|
+
cur.remove();
|
|
3895
|
+
return;
|
|
3896
|
+
}
|
|
3897
|
+
var a = cur.animate(
|
|
3898
|
+
REDUCE ? [{ opacity: 1 }, { opacity: 0 }] : [{ opacity: 1, filter: "blur(0px)", transform: "translateY(0)" }, { opacity: 0, filter: "blur(4px)", transform: "translateY(-.22em)" }],
|
|
3899
|
+
{ duration: REDUCE ? 160 : 280, easing: "cubic-bezier(.4,0,1,1)", fill: "forwards" }
|
|
3900
|
+
);
|
|
3901
|
+
a.onfinish = function() {
|
|
3902
|
+
cur.remove();
|
|
3903
|
+
};
|
|
3904
|
+
}
|
|
3905
|
+
if (instant || !cur || !nw.animate) return;
|
|
3906
|
+
Array.from(nw.children).forEach(function(s, i) {
|
|
3907
|
+
s.animate(
|
|
3908
|
+
REDUCE ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 0, filter: "blur(5px)", transform: "translateY(.28em)" }, { opacity: 1, filter: "blur(0px)", transform: "translateY(0)" }],
|
|
3909
|
+
{ duration: REDUCE ? 200 : 560, delay: REDUCE ? 0 : 70 + i * 14, easing: "cubic-bezier(.22,1,.36,1)", fill: "backwards" }
|
|
3910
|
+
);
|
|
3911
|
+
});
|
|
3912
|
+
}
|
|
3913
|
+
var ARROW_L = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.5 2.5 4 6l3.5 3.5"/></svg>';
|
|
3914
|
+
var ARROW_R = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 2.5 8 6 4.5 9.5"/></svg>';
|
|
3915
|
+
var PLUS = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M6 2v8M2 6h8"/></svg>';
|
|
3916
|
+
var CLOSE = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>';
|
|
3917
|
+
function leporello(host, o) {
|
|
3918
|
+
o = o || {};
|
|
3919
|
+
var base5 = o.base || "";
|
|
3920
|
+
var src = function(u) {
|
|
3921
|
+
return /^(https?:|data:|blob:|\/)/.test(u) ? u : base5 + u;
|
|
3922
|
+
};
|
|
3923
|
+
var pages = (o.pages && o.pages.length ? o.pages : OLEA).map(function(p2) {
|
|
3924
|
+
return { title: p2.title || "", text: p2.text || "", image: p2.image ? src(p2.image) : "", html: p2.html || "", ambient: p2.ambient ? /\.(jpe?g|png|webp|avif)(\?|$)/i.test(p2.ambient) ? "url('" + src(p2.ambient) + "') center/cover" : p2.ambient : "" };
|
|
3925
|
+
});
|
|
3926
|
+
var N = pages.length, k = Math.ceil(16 / N);
|
|
3927
|
+
if (N * k % 2) k++;
|
|
3928
|
+
var M = N * k;
|
|
3929
|
+
var L = Object.assign({ region: "Brand book", open: "Open", close: "Back to the book", prev: "Previous page", next: "Next page" }, o.labels || {});
|
|
3930
|
+
var kicker = o.kicker === void 0 ? "OLEA" : o.kicker, title = o.title === void 0 ? "Brand <em>book</em>" : o.title;
|
|
3931
|
+
if (o.fonts !== false && !document.querySelector("link[data-leporello-fonts]")) {
|
|
3932
|
+
var ln = document.createElement("link");
|
|
3933
|
+
ln.rel = "stylesheet";
|
|
3934
|
+
ln.href = FONTS2;
|
|
3935
|
+
ln.setAttribute("data-leporello-fonts", "");
|
|
3936
|
+
document.head.appendChild(ln);
|
|
3937
|
+
}
|
|
3938
|
+
var root = mk("lep");
|
|
3939
|
+
root.setAttribute("role", "region");
|
|
3940
|
+
root.setAttribute("aria-roledescription", "carousel");
|
|
3941
|
+
root.setAttribute("aria-label", L.region);
|
|
3942
|
+
var amb = mk("lep-amb");
|
|
3943
|
+
pages.forEach(function(p2) {
|
|
3944
|
+
var i2 = mk("", "i");
|
|
3945
|
+
if (p2.ambient) i2.style.background = p2.ambient;
|
|
3946
|
+
else if (p2.image) {
|
|
3947
|
+
i2.style.background = "url('" + p2.image + "') center/cover";
|
|
3948
|
+
i2.className = "blur";
|
|
3949
|
+
}
|
|
3950
|
+
amb.appendChild(i2);
|
|
3951
|
+
});
|
|
3952
|
+
var head = mk("lep-head");
|
|
3953
|
+
head.innerHTML = (kicker ? "<small>" + esc2(kicker) + "</small>" : "") + (title ? '<h3 class="lep-title">' + title + "</h3>" : "");
|
|
3954
|
+
var scene = mk("lep-scene");
|
|
3955
|
+
scene.tabIndex = 0;
|
|
3956
|
+
var floor = mk("lep-floor"), world = mk("lep-world"), cur = mk("lep-cur");
|
|
3957
|
+
cur.textContent = L.open;
|
|
3958
|
+
scene.append(floor, world, cur);
|
|
3959
|
+
var cap = mk("lep-cap");
|
|
3960
|
+
cap.innerHTML = '<div class="lep-row"><span class="lep-num lep-morph"></span><span class="lep-name lep-morph"></span></div><div class="lep-dots" aria-hidden="true"><span class="lep-dt-row"></span><b></b><b></b></div>';
|
|
3961
|
+
var od = mk("lep-od");
|
|
3962
|
+
od.setAttribute("aria-hidden", "true");
|
|
3963
|
+
od.innerHTML = '<div class="lep-od-bg"></div><div class="lep-od-media"></div><div class="lep-od-text"><span class="lep-od-k"></span><h4></h4><p></p><div class="lep-od-nav"><button type="button" class="lep-od-prev" aria-label="' + esc2(L.prev) + '">' + ARROW_L + '</button><button type="button" class="lep-od-next" aria-label="' + esc2(L.next) + '">' + ARROW_R + '</button></div></div><button type="button" class="lep-od-x" aria-label="' + esc2(L.close) + '">' + CLOSE + "</button>";
|
|
3964
|
+
root.append(amb, head, scene, cap, od);
|
|
3965
|
+
host.innerHTML = "";
|
|
3966
|
+
host.appendChild(root);
|
|
3967
|
+
var items = [];
|
|
3968
|
+
for (var i = 0; i < M; i++) {
|
|
3969
|
+
var p = pages[i % N], el = mk("lep-page");
|
|
3970
|
+
el.setAttribute("data-slot", i);
|
|
3971
|
+
el.innerHTML = (p.html || (p.image ? '<img class="lep-img" src="' + esc2(p.image) + '" alt="" draggable="false" decoding="async">' : "")) + '<div class="lep-sh"></div><span class="lep-plus" aria-hidden="true">' + PLUS + "</span>";
|
|
3972
|
+
world.appendChild(el);
|
|
3973
|
+
items.push({ el, sh: el.querySelector(".lep-sh"), vis: true });
|
|
3974
|
+
}
|
|
3975
|
+
var ambEls = Array.from(amb.children), ambW = new Float64Array(N).fill(-1);
|
|
3976
|
+
var numEl = cap.querySelector(".lep-num"), nameEl = cap.querySelector(".lep-name");
|
|
3977
|
+
var dotRow = cap.querySelector(".lep-dt-row"), pills = cap.querySelectorAll(".lep-dots b");
|
|
3978
|
+
dotRow.innerHTML = new Array(N + 1).join("<i></i>");
|
|
3979
|
+
cap.querySelector(".lep-dots").style.width = N * 24 - 6 + "px";
|
|
3980
|
+
var odBg = od.querySelector(".lep-od-bg"), odMedia = od.querySelector(".lep-od-media"), odText = od.querySelector(".lep-od-text");
|
|
3981
|
+
var odK = od.querySelector(".lep-od-k"), odH = od.querySelector("h4"), odP = od.querySelector("p");
|
|
3982
|
+
var tr = new Track(M, o.period || 3.6);
|
|
3983
|
+
tr.paused = REDUCE || o.autoplay === false;
|
|
3984
|
+
var W = 0, H = 0, Wp = 180, Hp = 240, ppu = 180, ax = new Float64Array(M + 1), px = new Float64Array(M + 1), pz = new Float64Array(M + 1);
|
|
3985
|
+
var dirty = true, lastS = NaN, idx = -1, centre = -1;
|
|
3986
|
+
function measure() {
|
|
3987
|
+
W = scene.clientWidth;
|
|
3988
|
+
H = scene.clientHeight;
|
|
3989
|
+
if (!W || !H) return;
|
|
3990
|
+
Wp = o.page || clamp2(W * 0.2, 104, 240);
|
|
3991
|
+
Hp = Math.min(Wp * 4 / 3, H - 24);
|
|
3992
|
+
Wp = Math.min(Wp, Hp * 0.75);
|
|
3993
|
+
ppu = Wp;
|
|
3994
|
+
root.style.setProperty("--lep-pw", Wp + "px");
|
|
3995
|
+
items.forEach(function(it) {
|
|
3996
|
+
it.el.style.width = Wp + "px";
|
|
3997
|
+
it.el.style.height = Hp + "px";
|
|
3998
|
+
});
|
|
3999
|
+
floor.style.top = H / 2 + Hp / 2 + 12 + "px";
|
|
4000
|
+
if (D.mode === "open") {
|
|
4001
|
+
var t = target();
|
|
4002
|
+
D.X.target = t.x;
|
|
4003
|
+
D.Y.target = t.y;
|
|
4004
|
+
D.Wd.target = t.w;
|
|
4005
|
+
D.Hd.target = t.h;
|
|
4006
|
+
}
|
|
4007
|
+
dirty = true;
|
|
4008
|
+
}
|
|
4009
|
+
function render(s) {
|
|
4010
|
+
var k0 = Math.round(s), u = s - (k0 - 0.5), cx = W / 2, top = H / 2 - Hp / 2 - 4, half = W / 2 + 40;
|
|
4011
|
+
var maxA = 80 * Math.PI / 180, C = M / 2;
|
|
4012
|
+
for (var n = 0; n < M; n++) {
|
|
4013
|
+
var j = k0 - C + n;
|
|
4014
|
+
ax[n] = (wrapN(j, 2) ? -1 : 1) * maxA * smooth(0.3, 3.2, Math.abs(j - s));
|
|
4015
|
+
}
|
|
4016
|
+
px[C] = -u * Wp * Math.cos(ax[C]);
|
|
4017
|
+
pz[C] = -u * Wp * Math.sin(ax[C]);
|
|
4018
|
+
for (n = C; n < M; n++) {
|
|
4019
|
+
px[n + 1] = px[n] + Wp * Math.cos(ax[n]);
|
|
4020
|
+
pz[n + 1] = pz[n] + Wp * Math.sin(ax[n]);
|
|
4021
|
+
}
|
|
4022
|
+
for (n = C; n > 0; n--) {
|
|
4023
|
+
px[n - 1] = px[n] - Wp * Math.cos(ax[n - 1]);
|
|
4024
|
+
pz[n - 1] = pz[n] - Wp * Math.sin(ax[n - 1]);
|
|
4025
|
+
}
|
|
4026
|
+
var z0 = -Wp * 0.25;
|
|
4027
|
+
for (n = 0; n < M; n++) {
|
|
4028
|
+
var it = items[wrapN(k0 - C + n, M)], a = ax[n];
|
|
4029
|
+
if (px[n + 1] < -half || px[n] > half) {
|
|
4030
|
+
if (it.vis) {
|
|
4031
|
+
it.el.style.visibility = "hidden";
|
|
4032
|
+
it.vis = false;
|
|
4033
|
+
}
|
|
4034
|
+
continue;
|
|
4035
|
+
}
|
|
4036
|
+
if (!it.vis) {
|
|
4037
|
+
it.el.style.visibility = "";
|
|
4038
|
+
it.vis = true;
|
|
4039
|
+
}
|
|
4040
|
+
it.el.style.transform = "translate3d(" + f2(cx + px[n]) + "px," + f2(top) + "px," + f2(pz[n] + z0) + "px) rotateY(" + (-a).toFixed(4) + "rad)";
|
|
4041
|
+
it.sh.style.opacity = (0.02 + 0.3 * (1 - Math.cos(a - 0.52))).toFixed(3);
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
function captions(s) {
|
|
4045
|
+
var i2 = wrapN(Math.round(s), N);
|
|
4046
|
+
if (i2 !== idx) {
|
|
4047
|
+
var first = idx < 0;
|
|
4048
|
+
idx = i2;
|
|
4049
|
+
morph(numEl, pad(i2 + 1), first);
|
|
4050
|
+
morph(nameEl, pages[i2].title, first);
|
|
4051
|
+
if (!first) host.dispatchEvent(new CustomEvent("leporellochange", { bubbles: true, detail: { index: i2 } }));
|
|
4052
|
+
}
|
|
4053
|
+
var p2 = wrapN(s, N);
|
|
4054
|
+
pills[0].style.transform = "translate3d(" + f2(p2 * 24) + "px,0,0)";
|
|
4055
|
+
pills[1].style.transform = "translate3d(" + f2((p2 - N) * 24) + "px,0,0)";
|
|
4056
|
+
for (var k2 = 0; k2 < N; k2++) {
|
|
4057
|
+
var w = Math.max(0, 1 - Math.abs(wdiff(k2 - s, N)));
|
|
4058
|
+
if (Math.abs(w - ambW[k2]) > 4e-3) {
|
|
4059
|
+
ambW[k2] = w;
|
|
4060
|
+
ambEls[k2].style.opacity = w.toFixed(3);
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
var c = wrapN(Math.round(s), M), want = Math.abs(s - Math.round(s)) < 0.18 ? c : -1;
|
|
4064
|
+
if (want !== centre) {
|
|
4065
|
+
if (centre >= 0) items[centre].el.classList.remove("lep-center");
|
|
4066
|
+
if (want >= 0) items[want].el.classList.add("lep-center");
|
|
4067
|
+
centre = want;
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4070
|
+
var D = { mode: "closed", clock: 0, queue: [], X: new Spring(0, 150), Y: new Spring(0, 150), Wd: new Spring(0, 150), Hd: new Spring(0, 150), bgT: null, bg: 0, slot: -1 };
|
|
4071
|
+
function local(r) {
|
|
4072
|
+
var b = root.getBoundingClientRect();
|
|
4073
|
+
return { x: r.left - b.left, y: r.top - b.top, w: r.width, h: r.height };
|
|
4074
|
+
}
|
|
4075
|
+
function target() {
|
|
4076
|
+
var w = root.clientWidth, h = root.clientHeight;
|
|
4077
|
+
return w >= 600 ? { x: 0, y: 0, w: Math.round(w * 0.58), h } : { x: 0, y: 0, w, h: Math.round(h * 0.52) };
|
|
4078
|
+
}
|
|
4079
|
+
function fillMedia(i2, fresh) {
|
|
4080
|
+
var box = mk("");
|
|
4081
|
+
box.innerHTML = pages[i2].html || (pages[i2].image ? '<img class="lep-img" src="' + esc2(pages[i2].image) + '" alt="">' : "");
|
|
4082
|
+
if (fresh || !box.animate) {
|
|
4083
|
+
odMedia.innerHTML = "";
|
|
4084
|
+
odMedia.appendChild(box);
|
|
4085
|
+
return;
|
|
4086
|
+
}
|
|
4087
|
+
box.style.opacity = "0";
|
|
4088
|
+
odMedia.appendChild(box);
|
|
4089
|
+
box.animate([{ opacity: 0, filter: "blur(6px)" }, { opacity: 1, filter: "blur(0px)" }], { duration: 420, easing: "cubic-bezier(.2,0,0,1)", fill: "forwards" }).onfinish = function() {
|
|
4090
|
+
box.style.opacity = "1";
|
|
4091
|
+
Array.from(odMedia.children).forEach(function(c) {
|
|
4092
|
+
if (c !== box) c.remove();
|
|
4093
|
+
});
|
|
4094
|
+
};
|
|
4095
|
+
}
|
|
4096
|
+
function fillText(i2) {
|
|
4097
|
+
odK.textContent = pad(i2 + 1) + " / " + pad(N);
|
|
4098
|
+
odH.textContent = pages[i2].title;
|
|
4099
|
+
odP.textContent = pages[i2].text;
|
|
4100
|
+
}
|
|
4101
|
+
function openPage(slot) {
|
|
4102
|
+
if (D.mode !== "closed") return;
|
|
4103
|
+
if (slot === void 0) slot = wrapN(Math.round(tr.s), M);
|
|
4104
|
+
var i2 = slot % N, page = items[slot].el, a = local(page.getBoundingClientRect()), b = target();
|
|
4105
|
+
tr.holdAt(slot);
|
|
4106
|
+
tr.lock = true;
|
|
4107
|
+
D.slot = slot;
|
|
4108
|
+
fillMedia(i2, true);
|
|
4109
|
+
fillText(i2);
|
|
4110
|
+
D.X.x = a.x;
|
|
4111
|
+
D.Y.x = a.y;
|
|
4112
|
+
D.Wd.x = a.w;
|
|
4113
|
+
D.Hd.x = a.h;
|
|
4114
|
+
D.X.v = D.Y.v = D.Wd.v = D.Hd.v = 0;
|
|
4115
|
+
D.X.target = b.x;
|
|
4116
|
+
D.Y.target = b.y;
|
|
4117
|
+
D.Wd.target = b.w;
|
|
4118
|
+
D.Hd.target = b.h;
|
|
4119
|
+
if (REDUCE) {
|
|
4120
|
+
D.X.x = b.x;
|
|
4121
|
+
D.Y.x = b.y;
|
|
4122
|
+
D.Wd.x = b.w;
|
|
4123
|
+
D.Hd.x = b.h;
|
|
4124
|
+
}
|
|
4125
|
+
page.classList.add("lep-held");
|
|
4126
|
+
odMedia.style.visibility = "visible";
|
|
4127
|
+
scene.style.pointerEvents = "none";
|
|
4128
|
+
cur.classList.remove("lep-on");
|
|
4129
|
+
scene.classList.remove("lep-peek");
|
|
4130
|
+
cs.on = false;
|
|
4131
|
+
od.classList.add("lep-on");
|
|
4132
|
+
od.setAttribute("aria-hidden", "false");
|
|
4133
|
+
D.mode = "open";
|
|
4134
|
+
D.clock = 0;
|
|
4135
|
+
D.queue = [];
|
|
4136
|
+
D.bgT = { from: D.bg, to: 1, t0: 60, dur: 520, ease: EASE_OUT };
|
|
4137
|
+
D.queue.push({ at: REDUCE ? 0 : 420, fn: function() {
|
|
4138
|
+
od.classList.add("lep-ui");
|
|
4139
|
+
od.querySelector(".lep-od-x").focus({ preventScroll: true });
|
|
4140
|
+
} });
|
|
4141
|
+
host.dispatchEvent(new CustomEvent("leporelloopen", { bubbles: true, detail: { index: i2 } }));
|
|
4142
|
+
}
|
|
4143
|
+
function closePage() {
|
|
4144
|
+
if (D.mode !== "open") return;
|
|
4145
|
+
od.classList.remove("lep-ui");
|
|
4146
|
+
D.mode = "closing";
|
|
4147
|
+
D.clock = 0;
|
|
4148
|
+
D.queue = [];
|
|
4149
|
+
D.bgT = { from: D.bg, to: 0, t0: 120, dur: 480, ease: EASE_IO };
|
|
4150
|
+
D.queue.push({ at: 120, fn: function() {
|
|
4151
|
+
var a = local(items[D.slot].el.getBoundingClientRect());
|
|
4152
|
+
D.X.target = a.x;
|
|
4153
|
+
D.Y.target = a.y;
|
|
4154
|
+
D.Wd.target = a.w;
|
|
4155
|
+
D.Hd.target = a.h;
|
|
4156
|
+
if (REDUCE) {
|
|
4157
|
+
D.X.x = a.x;
|
|
4158
|
+
D.Y.x = a.y;
|
|
4159
|
+
D.Wd.x = a.w;
|
|
4160
|
+
D.Hd.x = a.h;
|
|
4161
|
+
}
|
|
4162
|
+
} });
|
|
4163
|
+
D.queue.push({ at: REDUCE ? 200 : 900, fn: function() {
|
|
4164
|
+
items[D.slot].el.classList.remove("lep-held");
|
|
4165
|
+
odMedia.style.visibility = "hidden";
|
|
4166
|
+
od.classList.remove("lep-on");
|
|
4167
|
+
od.setAttribute("aria-hidden", "true");
|
|
4168
|
+
D.mode = "closed";
|
|
4169
|
+
tr.lock = false;
|
|
4170
|
+
tr.touch();
|
|
4171
|
+
scene.style.pointerEvents = "";
|
|
4172
|
+
scene.style.opacity = "";
|
|
4173
|
+
scene.focus({ preventScroll: true });
|
|
4174
|
+
} });
|
|
4175
|
+
host.dispatchEvent(new CustomEvent("leporelloclose", { bubbles: true, detail: { index: D.slot % N } }));
|
|
4176
|
+
}
|
|
4177
|
+
function turnPage(dir) {
|
|
4178
|
+
if (D.mode !== "open") return;
|
|
4179
|
+
var slot = wrapN(D.slot + dir, M), i2 = slot % N;
|
|
4180
|
+
items[D.slot].el.classList.remove("lep-held");
|
|
4181
|
+
items[slot].el.classList.add("lep-held");
|
|
4182
|
+
tr.holdAt(slot);
|
|
4183
|
+
D.slot = slot;
|
|
4184
|
+
fillMedia(i2, false);
|
|
4185
|
+
odText.classList.add("lep-swap");
|
|
4186
|
+
setTimeout(function() {
|
|
4187
|
+
fillText(i2);
|
|
4188
|
+
odText.classList.remove("lep-swap");
|
|
4189
|
+
}, 170);
|
|
4190
|
+
}
|
|
4191
|
+
od.querySelector(".lep-od-x").addEventListener("click", closePage);
|
|
4192
|
+
od.querySelector(".lep-od-prev").addEventListener("click", function() {
|
|
4193
|
+
turnPage(-1);
|
|
4194
|
+
});
|
|
4195
|
+
od.querySelector(".lep-od-next").addEventListener("click", function() {
|
|
4196
|
+
turnPage(1);
|
|
4197
|
+
});
|
|
4198
|
+
var cs = { x: 0, y: 0, tx: 0, ty: 0, on: false }, drag = null, engaged = false;
|
|
4199
|
+
scene.addEventListener("pointerenter", function(e) {
|
|
4200
|
+
if (e.pointerType === "mouse") tr.hover = true;
|
|
4201
|
+
});
|
|
4202
|
+
scene.addEventListener("pointerleave", function(e) {
|
|
4203
|
+
if (e.pointerType === "mouse") {
|
|
4204
|
+
tr.hover = false;
|
|
4205
|
+
tr.touch();
|
|
4206
|
+
tr.idle = 1.4;
|
|
4207
|
+
}
|
|
4208
|
+
engaged = false;
|
|
4209
|
+
cs.on = false;
|
|
4210
|
+
cur.classList.remove("lep-on");
|
|
4211
|
+
scene.classList.remove("lep-peek");
|
|
4212
|
+
});
|
|
4213
|
+
scene.addEventListener("focus", function() {
|
|
4214
|
+
tr.focus = scene.matches(":focus-visible");
|
|
4215
|
+
});
|
|
4216
|
+
scene.addEventListener("blur", function() {
|
|
4217
|
+
tr.focus = false;
|
|
4218
|
+
});
|
|
4219
|
+
scene.addEventListener("pointermove", function(e) {
|
|
4220
|
+
if (e.pointerType === "mouse" && !drag) {
|
|
4221
|
+
var r = scene.getBoundingClientRect(), over = !!(e.target.closest && e.target.closest(".lep-page.lep-center")) && D.mode === "closed";
|
|
4222
|
+
cs.tx = e.clientX - r.left;
|
|
4223
|
+
cs.ty = e.clientY - r.top;
|
|
4224
|
+
if (over && !cs.on) {
|
|
4225
|
+
cs.x = cs.tx;
|
|
4226
|
+
cs.y = cs.ty;
|
|
4227
|
+
}
|
|
4228
|
+
cs.on = over;
|
|
4229
|
+
cur.classList.toggle("lep-on", over);
|
|
4230
|
+
scene.classList.toggle("lep-peek", over);
|
|
4231
|
+
}
|
|
4232
|
+
if (!drag || e.pointerId !== drag.id) return;
|
|
4233
|
+
var p2 = e.clientX;
|
|
4234
|
+
if (!drag.moved) {
|
|
4235
|
+
if (Math.abs(p2 - drag.p0) < 5) return;
|
|
4236
|
+
drag.moved = true;
|
|
4237
|
+
drag.p0 = p2;
|
|
4238
|
+
drag.s0 = tr.s;
|
|
4239
|
+
drag.t = e.timeStamp;
|
|
4240
|
+
scene.setPointerCapture(e.pointerId);
|
|
4241
|
+
scene.classList.add("lep-drag");
|
|
4242
|
+
tr.mode = "drag";
|
|
4243
|
+
tr.touch();
|
|
4244
|
+
cs.on = false;
|
|
4245
|
+
cur.classList.remove("lep-on");
|
|
4246
|
+
return;
|
|
4247
|
+
}
|
|
4248
|
+
var dts = Math.max(4, e.timeStamp - drag.t) / 1e3, ns = drag.s0 - (p2 - drag.p0) / ppu;
|
|
4249
|
+
var inst = (ns - tr.s) / dts, kk = 1 - Math.exp(-dts / 0.05);
|
|
4250
|
+
drag.vel += (inst - drag.vel) * kk;
|
|
4251
|
+
tr.s = ns;
|
|
4252
|
+
tr.vel = drag.vel;
|
|
4253
|
+
drag.t = e.timeStamp;
|
|
4254
|
+
});
|
|
4255
|
+
scene.addEventListener("pointerdown", function(e) {
|
|
4256
|
+
if (e.button !== 0) return;
|
|
4257
|
+
engaged = true;
|
|
4258
|
+
drag = { id: e.pointerId, p0: e.clientX, s0: tr.s, moved: false, t: e.timeStamp, vel: 0 };
|
|
4259
|
+
});
|
|
4260
|
+
function end(e) {
|
|
4261
|
+
if (!drag || e.pointerId !== drag.id) return;
|
|
4262
|
+
var d = drag;
|
|
4263
|
+
drag = null;
|
|
4264
|
+
scene.classList.remove("lep-drag");
|
|
4265
|
+
if (d.moved) {
|
|
4266
|
+
tr.release(e.timeStamp - d.t > 90 ? 0 : d.vel);
|
|
4267
|
+
return;
|
|
4268
|
+
}
|
|
4269
|
+
if (e.type !== "pointerup") return;
|
|
4270
|
+
var card = e.target.closest && e.target.closest("[data-slot]");
|
|
4271
|
+
if (!card) return;
|
|
4272
|
+
var slot = +card.getAttribute("data-slot");
|
|
4273
|
+
if (slot === wrapN(Math.round(tr.s), M) && Math.abs(tr.s - Math.round(tr.s)) < 0.2) openPage(slot);
|
|
4274
|
+
else tr.goto(slot);
|
|
4275
|
+
}
|
|
4276
|
+
scene.addEventListener("pointerup", end);
|
|
4277
|
+
scene.addEventListener("pointercancel", end);
|
|
4278
|
+
scene.addEventListener("wheel", function(e) {
|
|
4279
|
+
if (Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
|
|
4280
|
+
e.preventDefault();
|
|
4281
|
+
tr.wheel(e.deltaX * (e.deltaMode === 1 ? 16 : 1) / ppu);
|
|
4282
|
+
}, { passive: false });
|
|
4283
|
+
scene.addEventListener("keydown", function(e) {
|
|
4284
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
4285
|
+
e.preventDefault();
|
|
4286
|
+
openPage();
|
|
4287
|
+
return;
|
|
4288
|
+
}
|
|
4289
|
+
var next = e.key === "ArrowRight" || e.key === "ArrowDown", prev = e.key === "ArrowLeft" || e.key === "ArrowUp";
|
|
4290
|
+
if (!next && !prev) return;
|
|
4291
|
+
e.preventDefault();
|
|
4292
|
+
tr.nudge(next ? 1 : -1);
|
|
4293
|
+
});
|
|
4294
|
+
root.addEventListener("keydown", function(e) {
|
|
4295
|
+
if (D.mode !== "open") return;
|
|
4296
|
+
if (e.key === "Escape") closePage();
|
|
4297
|
+
else if (e.key === "ArrowRight") turnPage(1);
|
|
4298
|
+
else if (e.key === "ArrowLeft") turnPage(-1);
|
|
4299
|
+
});
|
|
4300
|
+
var raf = 0, last = performance.now(), visible = true, alive = true;
|
|
4301
|
+
function frame(now) {
|
|
4302
|
+
if (!alive) return;
|
|
4303
|
+
raf = requestAnimationFrame(frame);
|
|
4304
|
+
var dt = Math.min(1 / 30, Math.max(0, (now - last) / 1e3));
|
|
4305
|
+
last = now;
|
|
4306
|
+
if (!visible || document.hidden || dt === 0) return;
|
|
4307
|
+
tr.step(dt);
|
|
4308
|
+
var s = tr.s;
|
|
4309
|
+
if (dirty || s !== lastS) {
|
|
4310
|
+
render(s);
|
|
4311
|
+
captions(s);
|
|
4312
|
+
lastS = s;
|
|
4313
|
+
dirty = false;
|
|
4314
|
+
}
|
|
4315
|
+
if (cs.on) {
|
|
4316
|
+
var kc = 1 - Math.exp(-18 * dt);
|
|
4317
|
+
cs.x += (cs.tx - cs.x) * kc;
|
|
4318
|
+
cs.y += (cs.ty - cs.y) * kc;
|
|
4319
|
+
cur.style.transform = "translate3d(" + f2(cs.x) + "px," + f2(cs.y) + "px,0)";
|
|
4320
|
+
}
|
|
4321
|
+
if (D.mode === "closed") return;
|
|
4322
|
+
D.clock += dt * 1e3;
|
|
4323
|
+
while (D.queue.length && D.queue[0].at <= D.clock) D.queue.shift().fn();
|
|
4324
|
+
D.X.step(dt);
|
|
4325
|
+
D.Y.step(dt);
|
|
4326
|
+
D.Wd.step(dt);
|
|
4327
|
+
D.Hd.step(dt);
|
|
4328
|
+
if (D.bgT) D.bg = tween(D.bgT, D.clock);
|
|
4329
|
+
var m = odMedia.style, mw = Math.max(1, D.Wd.x);
|
|
4330
|
+
m.transform = "translate3d(" + f2(D.X.x) + "px," + f2(D.Y.x) + "px,0)";
|
|
4331
|
+
m.width = f2(mw) + "px";
|
|
4332
|
+
m.height = f2(Math.max(1, D.Hd.x)) + "px";
|
|
4333
|
+
odMedia.style.setProperty("--lep-pw", f2(mw) + "px");
|
|
4334
|
+
odBg.style.opacity = D.bg.toFixed(3);
|
|
4335
|
+
head.style.opacity = (1 - D.bg).toFixed(3);
|
|
4336
|
+
scene.style.opacity = (1 - 0.92 * D.bg).toFixed(3);
|
|
4337
|
+
}
|
|
4338
|
+
var ro = new ResizeObserver(measure);
|
|
4339
|
+
ro.observe(scene);
|
|
4340
|
+
var io = typeof IntersectionObserver !== "undefined" ? new IntersectionObserver(function(es) {
|
|
4341
|
+
visible = es[0].isIntersecting;
|
|
4342
|
+
}, { rootMargin: "120px" }) : null;
|
|
4343
|
+
if (io) io.observe(root);
|
|
4344
|
+
measure();
|
|
4345
|
+
raf = requestAnimationFrame(frame);
|
|
4346
|
+
return {
|
|
4347
|
+
open: function(i2) {
|
|
4348
|
+
if (i2 === void 0) openPage();
|
|
4349
|
+
else {
|
|
4350
|
+
var slot = wrapN(Math.round(tr.s), M);
|
|
4351
|
+
slot += wdiff(i2 - slot % N, N);
|
|
4352
|
+
tr.holdAt(wrapN(slot, M));
|
|
4353
|
+
setTimeout(function() {
|
|
4354
|
+
openPage(wrapN(slot, M));
|
|
4355
|
+
}, REDUCE ? 0 : 700);
|
|
4356
|
+
}
|
|
4357
|
+
},
|
|
4358
|
+
close: closePage,
|
|
4359
|
+
next: function() {
|
|
4360
|
+
if (D.mode === "open") turnPage(1);
|
|
4361
|
+
else tr.nudge(1);
|
|
4362
|
+
},
|
|
4363
|
+
prev: function() {
|
|
4364
|
+
if (D.mode === "open") turnPage(-1);
|
|
4365
|
+
else tr.nudge(-1);
|
|
4366
|
+
},
|
|
4367
|
+
go: function(i2) {
|
|
4368
|
+
var b = Math.round(tr.s);
|
|
4369
|
+
tr.goto(wrapN(b + wdiff(i2 - wrapN(b, N), N), M));
|
|
4370
|
+
},
|
|
4371
|
+
play: function() {
|
|
4372
|
+
closePage();
|
|
4373
|
+
tr.paused = false;
|
|
4374
|
+
tr.idle = 99;
|
|
4375
|
+
},
|
|
4376
|
+
pause: function() {
|
|
4377
|
+
tr.paused = true;
|
|
4378
|
+
},
|
|
4379
|
+
get index() {
|
|
4380
|
+
return idx;
|
|
4381
|
+
},
|
|
4382
|
+
get position() {
|
|
4383
|
+
return tr.s;
|
|
4384
|
+
},
|
|
4385
|
+
get isOpen() {
|
|
4386
|
+
return D.mode === "open";
|
|
4387
|
+
},
|
|
4388
|
+
destroy: function() {
|
|
4389
|
+
alive = false;
|
|
4390
|
+
cancelAnimationFrame(raf);
|
|
4391
|
+
ro.disconnect();
|
|
4392
|
+
if (io) io.disconnect();
|
|
4393
|
+
root.remove();
|
|
4394
|
+
}
|
|
4395
|
+
};
|
|
4396
|
+
}
|
|
4397
|
+
window2.leporello = leporello;
|
|
4398
|
+
})();
|
|
4399
|
+
return api7 = window2;
|
|
4400
|
+
}
|
|
4401
|
+
function mountLeporello(host, o = {}) {
|
|
4402
|
+
css("craft-leporello", CSS8);
|
|
4403
|
+
const E = engine7();
|
|
4404
|
+
const tall = (h) => {
|
|
4405
|
+
if (h != null && h !== "") host.style.height = typeof h === "number" || /^\d+(\.\d+)?$/.test(h) ? h + "px" : String(h);
|
|
4406
|
+
};
|
|
4407
|
+
tall(o.height);
|
|
4408
|
+
const opts = {};
|
|
4409
|
+
for (const k of ["pages", "kicker", "title", "labels", "autoplay", "period", "page", "fonts"]) if (o[k] !== void 0) opts[k] = o[k];
|
|
4410
|
+
opts.base = o.pages ? o.base || "" : ASSETS2;
|
|
4411
|
+
const on = [["leporellochange", o.onChange], ["leporelloopen", o.onOpen], ["leporelloclose", o.onClose]].filter((e) => e[1]);
|
|
4412
|
+
const fns = on.map(([type, fn]) => {
|
|
4413
|
+
const f = (e) => fn(e.detail.index);
|
|
4414
|
+
host.addEventListener(type, f);
|
|
4415
|
+
return [type, f];
|
|
4416
|
+
});
|
|
4417
|
+
const m = E.leporello(host, opts);
|
|
4418
|
+
return {
|
|
4419
|
+
open: (i) => m.open(i),
|
|
4420
|
+
close: () => m.close(),
|
|
4421
|
+
next: () => m.next(),
|
|
4422
|
+
prev: () => m.prev(),
|
|
4423
|
+
go: (i) => m.go(i),
|
|
4424
|
+
play: () => m.play(),
|
|
4425
|
+
pause: () => m.pause(),
|
|
4426
|
+
height: tall,
|
|
4427
|
+
get index() {
|
|
4428
|
+
return m.index;
|
|
4429
|
+
},
|
|
4430
|
+
get isOpen() {
|
|
4431
|
+
return m.isOpen;
|
|
4432
|
+
},
|
|
4433
|
+
destroy() {
|
|
4434
|
+
fns.forEach(([type, f]) => host.removeEventListener(type, f));
|
|
4435
|
+
m.destroy();
|
|
4436
|
+
host.innerHTML = "";
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
}
|
|
4440
|
+
|
|
3623
4441
|
// dist/sign.js
|
|
3624
4442
|
function sign() {
|
|
3625
4443
|
if (typeof window === "undefined" || typeof document === "undefined" || window.__craftLibrarySigned) return;
|
|
@@ -3639,7 +4457,7 @@ void main() {
|
|
|
3639
4457
|
customElements.define(name, class extends HTMLElement {
|
|
3640
4458
|
connectedCallback() {
|
|
3641
4459
|
if (this.piece) return;
|
|
3642
|
-
css("craft-hosts", "like-button,magnetic-icon,thumbs-reaction{display:inline-block;line-height:0;vertical-align:middle}fold-orb{display:block}");
|
|
4460
|
+
css("craft-hosts", "like-button,magnetic-icon,thumbs-reaction{display:inline-block;line-height:0;vertical-align:middle}fold-orb,leporello-book{display:block}");
|
|
3643
4461
|
this.piece = mount(this, options(this));
|
|
3644
4462
|
}
|
|
3645
4463
|
});
|
|
@@ -3797,7 +4615,30 @@ void main() {
|
|
|
3797
4615
|
mic: el.hasAttribute("mic") && el.getAttribute("mic") !== "false",
|
|
3798
4616
|
label: el.getAttribute("label") || void 0
|
|
3799
4617
|
}));
|
|
4618
|
+
define("leporello-book", (el, o) => {
|
|
4619
|
+
const m = mountLeporello(el, o);
|
|
4620
|
+
["open", "close", "next", "prev", "go", "play", "pause"].forEach((k) => {
|
|
4621
|
+
el[k] = m[k];
|
|
4622
|
+
});
|
|
4623
|
+
return m;
|
|
4624
|
+
}, (el) => {
|
|
4625
|
+
const a = (n) => el.getAttribute(n), json2 = (v) => {
|
|
4626
|
+
try {
|
|
4627
|
+
return v ? JSON.parse(v) : void 0;
|
|
4628
|
+
} catch (e) {
|
|
4629
|
+
return void 0;
|
|
4630
|
+
}
|
|
4631
|
+
};
|
|
4632
|
+
return {
|
|
4633
|
+
pages: json2(a("pages")),
|
|
4634
|
+
kicker: el.hasAttribute("kicker") ? a("kicker") : void 0,
|
|
4635
|
+
title: el.hasAttribute("heading") ? a("heading") : void 0,
|
|
4636
|
+
autoplay: a("autoplay") === "false" ? false : void 0,
|
|
4637
|
+
height: a("height") || void 0,
|
|
4638
|
+
labels: { open: a("label-open") || void 0, close: a("label-close") || void 0 }
|
|
4639
|
+
};
|
|
4640
|
+
});
|
|
3800
4641
|
|
|
3801
4642
|
// dist/cdn.js
|
|
3802
|
-
window.CraftLibrary = { mountLike, mountMagnet, mountGlassNav, mountIridescentCard, mountPiggyBank, mountThinking, mountPanoramaReel, mountMapPin, mountTokenWheel, mountThumbsReaction, mountFoldOrb };
|
|
4643
|
+
window.CraftLibrary = { mountLike, mountMagnet, mountGlassNav, mountIridescentCard, mountPiggyBank, mountThinking, mountPanoramaReel, mountMapPin, mountTokenWheel, mountThumbsReaction, mountFoldOrb, mountLeporello };
|
|
3803
4644
|
})();
|