@frybynite/image-cloud 0.8.3 → 0.9.1
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/image-cloud-auto-init.js +531 -304
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +466 -239
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +3 -3
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +54 -1
- package/dist/react.d.ts +54 -1
- package/dist/react.js +466 -239
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +54 -1
- package/dist/vue.js +467 -240
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +54 -1
- package/dist/web-component.js +824 -597
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Ht, ref as It, onMounted as kt, onUnmounted as Nt, watch as jt, h as Wt } from "vue";
|
|
2
2
|
const mt = Object.freeze({
|
|
3
3
|
none: "none",
|
|
4
4
|
sm: "0 2px 4px rgba(0,0,0,0.1)",
|
|
5
5
|
md: "0 4px 16px rgba(0,0,0,0.4)",
|
|
6
6
|
lg: "0 8px 32px rgba(0,0,0,0.5)",
|
|
7
7
|
glow: "0 0 30px rgba(255,255,255,0.6)"
|
|
8
|
-
}),
|
|
8
|
+
}), Rt = Object.freeze({
|
|
9
9
|
energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
|
|
10
10
|
playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
|
|
11
11
|
subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
|
|
@@ -14,7 +14,7 @@ const mt = Object.freeze({
|
|
|
14
14
|
bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
|
|
15
15
|
wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
|
|
16
16
|
snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
|
|
17
|
-
}),
|
|
17
|
+
}), At = Object.freeze({
|
|
18
18
|
gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
|
|
19
19
|
playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
|
|
20
20
|
serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
|
|
@@ -51,16 +51,16 @@ const mt = Object.freeze({
|
|
|
51
51
|
focused: Object.freeze({
|
|
52
52
|
shadow: "none"
|
|
53
53
|
})
|
|
54
|
-
}), kt = Object.freeze({
|
|
55
|
-
tightness: 1
|
|
56
54
|
}), Gt = Object.freeze({
|
|
55
|
+
tightness: 1
|
|
56
|
+
}), qt = Object.freeze({
|
|
57
57
|
rows: 1,
|
|
58
58
|
amplitude: 100,
|
|
59
59
|
frequency: 2,
|
|
60
60
|
phaseShift: 0,
|
|
61
61
|
synchronization: "offset"
|
|
62
62
|
// Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
|
|
63
|
-
}),
|
|
63
|
+
}), Bt = Object.freeze({
|
|
64
64
|
spacing: 0
|
|
65
65
|
}), Xt = Object.freeze({
|
|
66
66
|
mobile: Object.freeze({ maxWidth: 767 }),
|
|
@@ -77,7 +77,7 @@ const mt = Object.freeze({
|
|
|
77
77
|
// No variance by default
|
|
78
78
|
max: 1
|
|
79
79
|
})
|
|
80
|
-
}),
|
|
80
|
+
}), Vt = Object.freeze({
|
|
81
81
|
mode: "none",
|
|
82
82
|
range: Object.freeze({
|
|
83
83
|
min: -15,
|
|
@@ -85,7 +85,7 @@ const mt = Object.freeze({
|
|
|
85
85
|
})
|
|
86
86
|
}), zt = Object.freeze({
|
|
87
87
|
sizing: Yt,
|
|
88
|
-
rotation:
|
|
88
|
+
rotation: Vt
|
|
89
89
|
}), Ot = Object.freeze({
|
|
90
90
|
validateUrls: !0,
|
|
91
91
|
validationTimeout: 5e3,
|
|
@@ -95,7 +95,7 @@ const mt = Object.freeze({
|
|
|
95
95
|
enabled: !1,
|
|
96
96
|
centers: !1,
|
|
97
97
|
loaders: !1
|
|
98
|
-
}), E = Object.freeze({
|
|
98
|
+
}), Jt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), Kt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Zt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Qt = Object.freeze({ speed: 4e3, direction: "clockwise" }), $t = Object.freeze({ type: "none" }), E = Object.freeze({
|
|
99
99
|
// Loader configuration (always an array, composite behavior is implicit)
|
|
100
100
|
loaders: [],
|
|
101
101
|
// Shared loader settings and debug config
|
|
@@ -137,10 +137,8 @@ const mt = Object.freeze({
|
|
|
137
137
|
queue: Object.freeze({
|
|
138
138
|
enabled: !0,
|
|
139
139
|
// When false, all images display simultaneously
|
|
140
|
-
interval: 150
|
|
140
|
+
interval: 150
|
|
141
141
|
// ms between processing queue items (when enabled)
|
|
142
|
-
maxConcurrent: void 0
|
|
143
|
-
// STUB: Not implemented yet
|
|
144
142
|
}),
|
|
145
143
|
performance: Object.freeze({
|
|
146
144
|
useGPU: void 0,
|
|
@@ -169,7 +167,8 @@ const mt = Object.freeze({
|
|
|
169
167
|
path: yt,
|
|
170
168
|
rotation: vt,
|
|
171
169
|
scale: wt
|
|
172
|
-
})
|
|
170
|
+
}),
|
|
171
|
+
idle: $t
|
|
173
172
|
}),
|
|
174
173
|
// Pattern-based interaction configuration
|
|
175
174
|
interaction: Object.freeze({
|
|
@@ -193,7 +192,8 @@ const mt = Object.freeze({
|
|
|
193
192
|
// STUB: Not implemented yet
|
|
194
193
|
doubleTapToFocus: void 0
|
|
195
194
|
// STUB: Not implemented yet
|
|
196
|
-
})
|
|
195
|
+
}),
|
|
196
|
+
disableDragging: !1
|
|
197
197
|
}),
|
|
198
198
|
// Pattern-based rendering configuration
|
|
199
199
|
rendering: Object.freeze({
|
|
@@ -221,7 +221,7 @@ function Z(o, t) {
|
|
|
221
221
|
const i = { ...o };
|
|
222
222
|
return t.border !== void 0 && (i.border = { ...o.border, ...t.border }), t.borderTop !== void 0 && (i.borderTop = { ...o.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (i.borderRight = { ...o.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (i.borderBottom = { ...o.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (i.borderLeft = { ...o.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (i.filter = { ...o.filter, ...t.filter }), t.outline !== void 0 && (i.outline = { ...o.outline, ...t.outline }), t.shadow !== void 0 && (i.shadow = t.shadow), t.clipPath !== void 0 && (i.clipPath = t.clipPath), t.opacity !== void 0 && (i.opacity = t.opacity), t.cursor !== void 0 && (i.cursor = t.cursor), t.className !== void 0 && (i.className = t.className), t.objectFit !== void 0 && (i.objectFit = t.objectFit), t.aspectRatio !== void 0 && (i.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (i.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (i.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (i.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (i.borderRadiusBottomLeft = t.borderRadiusBottomLeft), i;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function te(o, t) {
|
|
225
225
|
if (!t) return { ...o };
|
|
226
226
|
const i = Z(o.default, t.default), e = Z(
|
|
227
227
|
Z(i, o.hover),
|
|
@@ -236,7 +236,7 @@ function Vt(o, t) {
|
|
|
236
236
|
focused: n
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function ee(o, t) {
|
|
240
240
|
if (!t) return { ...o };
|
|
241
241
|
const i = { ...o };
|
|
242
242
|
if (t.sizing !== void 0 && (i.sizing = {
|
|
@@ -255,7 +255,7 @@ function Jt(o, t) {
|
|
|
255
255
|
}
|
|
256
256
|
return i;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function ie(o) {
|
|
259
259
|
const t = o.layout?.rotation;
|
|
260
260
|
if (t && "enabled" in t)
|
|
261
261
|
return {
|
|
@@ -265,7 +265,7 @@ function Kt(o) {
|
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function ne(o) {
|
|
269
269
|
const t = o.layout?.sizing?.variance;
|
|
270
270
|
if (t)
|
|
271
271
|
return {
|
|
@@ -276,8 +276,8 @@ function Zt(o) {
|
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const t =
|
|
279
|
+
function oe(o = {}) {
|
|
280
|
+
const t = ie(o), i = ne(o);
|
|
281
281
|
let e = o.image;
|
|
282
282
|
(t || i) && (e = {
|
|
283
283
|
...i || {},
|
|
@@ -301,12 +301,12 @@ function Qt(o = {}) {
|
|
|
301
301
|
}, s = {
|
|
302
302
|
loaders: n,
|
|
303
303
|
config: r,
|
|
304
|
-
image:
|
|
304
|
+
image: ee(zt, e),
|
|
305
305
|
layout: { ...E.layout },
|
|
306
306
|
animation: { ...E.animation },
|
|
307
307
|
interaction: { ...E.interaction },
|
|
308
308
|
rendering: { ...E.rendering },
|
|
309
|
-
styling:
|
|
309
|
+
styling: te(Ft, o.styling)
|
|
310
310
|
};
|
|
311
311
|
if (o.layout && (s.layout = {
|
|
312
312
|
...E.layout,
|
|
@@ -342,6 +342,9 @@ function Qt(o = {}) {
|
|
|
342
342
|
path: o.animation.entry.path ? { ...yt, ...o.animation.entry.path } : E.animation.entry.path,
|
|
343
343
|
rotation: o.animation.entry.rotation ? { ...vt, ...o.animation.entry.rotation } : E.animation.entry.rotation,
|
|
344
344
|
scale: o.animation.entry.scale ? { ...wt, ...o.animation.entry.scale } : E.animation.entry.scale
|
|
345
|
+
}), o.animation.idle && (s.animation.idle = {
|
|
346
|
+
...$t,
|
|
347
|
+
...o.animation.idle
|
|
345
348
|
})), o.interaction && (s.interaction = {
|
|
346
349
|
...E.interaction,
|
|
347
350
|
...o.interaction
|
|
@@ -379,16 +382,16 @@ function Qt(o = {}) {
|
|
|
379
382
|
}
|
|
380
383
|
return s;
|
|
381
384
|
}
|
|
382
|
-
function
|
|
383
|
-
return { ...o ?
|
|
385
|
+
function se(o, t) {
|
|
386
|
+
return { ...o ? Rt[o] : Rt.playful, ...t };
|
|
384
387
|
}
|
|
385
|
-
function
|
|
388
|
+
function ae(o, t) {
|
|
386
389
|
return { ...o ? Tt[o] : Tt.gentle, ...t };
|
|
387
390
|
}
|
|
388
|
-
function
|
|
389
|
-
return { ...o ?
|
|
391
|
+
function re(o, t) {
|
|
392
|
+
return { ...o ? At[o] : At.gentle, ...t };
|
|
390
393
|
}
|
|
391
|
-
class
|
|
394
|
+
class ce {
|
|
392
395
|
constructor(t) {
|
|
393
396
|
this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
|
|
394
397
|
}
|
|
@@ -547,8 +550,8 @@ class oe {
|
|
|
547
550
|
function J(o, t, i) {
|
|
548
551
|
return o + (t - o) * i;
|
|
549
552
|
}
|
|
550
|
-
function
|
|
551
|
-
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l =
|
|
553
|
+
function le(o, t, i, e) {
|
|
554
|
+
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l = he(a, r);
|
|
552
555
|
let u = 0, h = 0, d = 1, f = n, b = !1;
|
|
553
556
|
for (let g = 0; g < l.length; g++)
|
|
554
557
|
if (o <= l[g].time) {
|
|
@@ -557,21 +560,21 @@ function ne(o, t, i, e) {
|
|
|
557
560
|
}
|
|
558
561
|
const p = (o - h) / (d - h);
|
|
559
562
|
if (b)
|
|
560
|
-
u = 1 + f *
|
|
563
|
+
u = 1 + f * ot(p);
|
|
561
564
|
else if (h === 0)
|
|
562
|
-
u =
|
|
565
|
+
u = ot(p);
|
|
563
566
|
else {
|
|
564
567
|
const m = 1 + (l.find(
|
|
565
568
|
(y, w) => y.time > h && w > 0 && l[w - 1].isOvershoot
|
|
566
569
|
)?.overshoot || f);
|
|
567
|
-
u = J(m, 1,
|
|
570
|
+
u = J(m, 1, ot(p));
|
|
568
571
|
}
|
|
569
572
|
return {
|
|
570
573
|
x: t.x + s * u,
|
|
571
574
|
y: t.y + c * u
|
|
572
575
|
};
|
|
573
576
|
}
|
|
574
|
-
function
|
|
577
|
+
function he(o, t) {
|
|
575
578
|
const i = [];
|
|
576
579
|
let e = 0.6;
|
|
577
580
|
i.push({ time: e, overshoot: 0, isOvershoot: !1 });
|
|
@@ -581,7 +584,7 @@ function se(o, t) {
|
|
|
581
584
|
e += r, i.push({ time: e, overshoot: n, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: n * t, isOvershoot: !1 }), n *= t;
|
|
582
585
|
return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
|
|
583
586
|
}
|
|
584
|
-
function
|
|
587
|
+
function de(o, t, i, e) {
|
|
585
588
|
const { stiffness: n, damping: a, mass: r, oscillations: s } = e, c = i.x - t.x, l = i.y - t.y, u = Math.sqrt(n / r), h = a / (2 * Math.sqrt(n * r));
|
|
586
589
|
let d;
|
|
587
590
|
if (h < 1) {
|
|
@@ -594,24 +597,24 @@ function ae(o, t, i, e) {
|
|
|
594
597
|
y: t.y + l * d
|
|
595
598
|
};
|
|
596
599
|
}
|
|
597
|
-
function
|
|
598
|
-
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase: c } = e, l = i.x - t.x, u = i.y - t.y, h = Math.sqrt(l * l + u * u), d = h > 0 ? -u / h : 0, f = h > 0 ? l / h : 1, b = a * Math.PI * 2 * o + c, p = r ? Math.pow(1 - o, s) : 1, g = n * Math.sin(b) * p, m =
|
|
600
|
+
function ue(o, t, i, e) {
|
|
601
|
+
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase: c } = e, l = i.x - t.x, u = i.y - t.y, h = Math.sqrt(l * l + u * u), d = h > 0 ? -u / h : 0, f = h > 0 ? l / h : 1, b = a * Math.PI * 2 * o + c, p = r ? Math.pow(1 - o, s) : 1, g = n * Math.sin(b) * p, m = ge(o);
|
|
599
602
|
return {
|
|
600
603
|
x: J(t.x, i.x, m) + g * d,
|
|
601
604
|
y: J(t.y, i.y, m) + g * f
|
|
602
605
|
};
|
|
603
606
|
}
|
|
604
|
-
function
|
|
607
|
+
function ot(o) {
|
|
605
608
|
return 1 - (1 - o) * (1 - o);
|
|
606
609
|
}
|
|
607
|
-
function
|
|
610
|
+
function ge(o) {
|
|
608
611
|
return 1 - Math.pow(1 - o, 3);
|
|
609
612
|
}
|
|
610
|
-
function
|
|
613
|
+
function fe(o, t, i) {
|
|
611
614
|
const { amplitude: e, frequency: n, decay: a } = i, r = Math.sin(o * n * Math.PI * 2), s = a ? Math.pow(1 - o, 2) : 1, c = e * r * s;
|
|
612
615
|
return t + c;
|
|
613
616
|
}
|
|
614
|
-
function
|
|
617
|
+
function me(o, t, i) {
|
|
615
618
|
const { overshoot: e, bounces: n } = i, a = [];
|
|
616
619
|
a.push({ time: 0.5, scale: e });
|
|
617
620
|
let r = e;
|
|
@@ -625,13 +628,13 @@ function he(o, t, i) {
|
|
|
625
628
|
let h = 1;
|
|
626
629
|
for (let d = 0; d < a.length; d++)
|
|
627
630
|
if (o <= a[d].time) {
|
|
628
|
-
const f = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (o - f) / (a[d].time - f), g =
|
|
631
|
+
const f = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (o - f) / (a[d].time - f), g = ot(p);
|
|
629
632
|
h = b + (a[d].scale - b) * g;
|
|
630
633
|
break;
|
|
631
634
|
}
|
|
632
635
|
return h * t;
|
|
633
636
|
}
|
|
634
|
-
function
|
|
637
|
+
function pe(o) {
|
|
635
638
|
const {
|
|
636
639
|
element: t,
|
|
637
640
|
startPosition: i,
|
|
@@ -647,38 +650,38 @@ function de(o) {
|
|
|
647
650
|
startRotation: d,
|
|
648
651
|
scaleConfig: f,
|
|
649
652
|
startScale: b
|
|
650
|
-
} = o, p = n.type, g = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, w = g || m, v = b !== void 0 && b !== l,
|
|
651
|
-
if ((p === "linear" || p === "arc") && !w && !(v ||
|
|
653
|
+
} = o, p = n.type, g = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, w = g || m, v = b !== void 0 && b !== l, I = f?.mode === "pop", x = f?.pop || { overshoot: 1.2, bounces: 1 };
|
|
654
|
+
if ((p === "linear" || p === "arc") && !w && !(v || I)) {
|
|
652
655
|
u && u();
|
|
653
656
|
return;
|
|
654
657
|
}
|
|
655
658
|
const z = performance.now(), L = -r / 2, _ = -s / 2;
|
|
656
659
|
function O(H) {
|
|
657
|
-
const
|
|
660
|
+
const k = H - z, T = Math.min(k / a, 1);
|
|
658
661
|
let D;
|
|
659
662
|
switch (p) {
|
|
660
663
|
case "bounce": {
|
|
661
|
-
const
|
|
664
|
+
const N = se(
|
|
662
665
|
n.bouncePreset,
|
|
663
666
|
n.bounce
|
|
664
667
|
);
|
|
665
|
-
D =
|
|
668
|
+
D = le(T, i, e, N);
|
|
666
669
|
break;
|
|
667
670
|
}
|
|
668
671
|
case "elastic": {
|
|
669
|
-
const
|
|
672
|
+
const N = ae(
|
|
670
673
|
n.elasticPreset,
|
|
671
674
|
n.elastic
|
|
672
675
|
);
|
|
673
|
-
D =
|
|
676
|
+
D = de(T, i, e, N);
|
|
674
677
|
break;
|
|
675
678
|
}
|
|
676
679
|
case "wave": {
|
|
677
|
-
const
|
|
680
|
+
const N = re(
|
|
678
681
|
n.wavePreset,
|
|
679
682
|
n.wave
|
|
680
683
|
);
|
|
681
|
-
D =
|
|
684
|
+
D = ue(T, i, e, N);
|
|
682
685
|
break;
|
|
683
686
|
}
|
|
684
687
|
default:
|
|
@@ -689,16 +692,16 @@ function de(o) {
|
|
|
689
692
|
}
|
|
690
693
|
const G = D.x - e.x, U = D.y - e.y;
|
|
691
694
|
let M;
|
|
692
|
-
m ? M =
|
|
693
|
-
let
|
|
694
|
-
|
|
695
|
+
m ? M = fe(T, c, y) : g ? M = J(d, c, T) : M = c;
|
|
696
|
+
let A;
|
|
697
|
+
I ? A = me(T, l, x) : v ? A = J(b, l, T) : A = l, t.style.transform = `translate(${L}px, ${_}px) translate(${G}px, ${U}px) rotate(${M}deg) scale(${A})`, T < 1 ? requestAnimationFrame(O) : (t.style.transform = `translate(${L}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
|
|
695
698
|
}
|
|
696
699
|
requestAnimationFrame(O);
|
|
697
700
|
}
|
|
698
|
-
function
|
|
701
|
+
function be(o) {
|
|
699
702
|
return o === "bounce" || o === "elastic" || o === "wave";
|
|
700
703
|
}
|
|
701
|
-
const
|
|
704
|
+
const ye = {
|
|
702
705
|
radial: "center",
|
|
703
706
|
spiral: "center",
|
|
704
707
|
grid: "top",
|
|
@@ -707,7 +710,7 @@ const ge = {
|
|
|
707
710
|
wave: "left",
|
|
708
711
|
honeycomb: "center"
|
|
709
712
|
};
|
|
710
|
-
class
|
|
713
|
+
class ve {
|
|
711
714
|
constructor(t, i) {
|
|
712
715
|
this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || yt, this.rotationConfig = t.rotation || vt, this.scaleConfig = t.scale || wt;
|
|
713
716
|
}
|
|
@@ -715,7 +718,7 @@ class fe {
|
|
|
715
718
|
* Get the effective start position, considering layout-aware defaults
|
|
716
719
|
*/
|
|
717
720
|
resolveStartPosition() {
|
|
718
|
-
return this.config.start.position ? this.config.start.position :
|
|
721
|
+
return this.config.start.position ? this.config.start.position : ye[this.layoutAlgorithm] || "nearest-edge";
|
|
719
722
|
}
|
|
720
723
|
/**
|
|
721
724
|
* Calculate the starting position for an image's entry animation
|
|
@@ -860,7 +863,7 @@ class fe {
|
|
|
860
863
|
* Check if the current path type requires JavaScript animation
|
|
861
864
|
*/
|
|
862
865
|
requiresJSAnimation() {
|
|
863
|
-
return
|
|
866
|
+
return be(this.pathConfig.type);
|
|
864
867
|
}
|
|
865
868
|
/**
|
|
866
869
|
* Get the path configuration
|
|
@@ -1051,7 +1054,193 @@ class fe {
|
|
|
1051
1054
|
return 1 - (1 - t) * (1 - t);
|
|
1052
1055
|
}
|
|
1053
1056
|
}
|
|
1054
|
-
class
|
|
1057
|
+
class we {
|
|
1058
|
+
constructor(t, i = 600) {
|
|
1059
|
+
this.entries = /* @__PURE__ */ new Map(), this.togetherRafId = null, this.togetherSpeed = 0, this.config = t, this.entryDurationMs = i;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Register an image element for idle animation.
|
|
1063
|
+
* Starts animation after entry duration completes.
|
|
1064
|
+
*/
|
|
1065
|
+
register(t, i, e, n) {
|
|
1066
|
+
if (this.entries.has(t)) return;
|
|
1067
|
+
const a = n ?? this.entryDurationMs, r = this.config.startDelay ?? a, s = {
|
|
1068
|
+
element: t,
|
|
1069
|
+
index: i,
|
|
1070
|
+
totalImages: e,
|
|
1071
|
+
animation: null,
|
|
1072
|
+
blinkAnimation: null,
|
|
1073
|
+
customTeardown: null,
|
|
1074
|
+
paused: !1,
|
|
1075
|
+
stopped: !1,
|
|
1076
|
+
startTimer: null
|
|
1077
|
+
};
|
|
1078
|
+
this.entries.set(t, s), s.startTimer = setTimeout(() => {
|
|
1079
|
+
s.startTimer = null, !s.stopped && !s.paused && this._startAnimation(s);
|
|
1080
|
+
}, r);
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Pause idle animation for a specific image (set to neutral then pause).
|
|
1084
|
+
*/
|
|
1085
|
+
pauseForImage(t) {
|
|
1086
|
+
const i = this.entries.get(t);
|
|
1087
|
+
i && (i.paused = !0, i.startTimer !== null && (clearTimeout(i.startTimer), i.startTimer = null), this._pauseEntry(i));
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Resume idle animation for a specific image by starting a fresh animation.
|
|
1091
|
+
* Always restarts rather than resuming, to avoid Web Animations API
|
|
1092
|
+
* quirks with negative-delay animations after pause/cancel.
|
|
1093
|
+
*/
|
|
1094
|
+
resumeForImage(t) {
|
|
1095
|
+
const i = this.entries.get(t);
|
|
1096
|
+
!i || i.stopped || (i.paused = !1, this._startAnimation(i));
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Stop and remove idle animation for a specific image.
|
|
1100
|
+
*/
|
|
1101
|
+
stopForImage(t) {
|
|
1102
|
+
const i = this.entries.get(t);
|
|
1103
|
+
i && (i.stopped = !0, i.startTimer !== null && (clearTimeout(i.startTimer), i.startTimer = null), this._cancelEntry(i), this.entries.delete(t));
|
|
1104
|
+
}
|
|
1105
|
+
pauseAll() {
|
|
1106
|
+
for (const t of this.entries.values())
|
|
1107
|
+
t.paused = !0, t.startTimer !== null && (clearTimeout(t.startTimer), t.startTimer = null), this._pauseEntry(t);
|
|
1108
|
+
}
|
|
1109
|
+
resumeAll() {
|
|
1110
|
+
for (const t of this.entries.values())
|
|
1111
|
+
t.stopped || (t.paused = !1, this._startAnimation(t));
|
|
1112
|
+
}
|
|
1113
|
+
stopAll() {
|
|
1114
|
+
for (const t of this.entries.values())
|
|
1115
|
+
t.stopped = !0, t.startTimer !== null && (clearTimeout(t.startTimer), t.startTimer = null), this._cancelEntry(t);
|
|
1116
|
+
this.entries.clear(), this._stopTogetherLoop();
|
|
1117
|
+
}
|
|
1118
|
+
// ──────────────────────────────────────────────────────────────────────────
|
|
1119
|
+
// Private helpers
|
|
1120
|
+
// ──────────────────────────────────────────────────────────────────────────
|
|
1121
|
+
_startAnimation(t) {
|
|
1122
|
+
const { type: i } = this.config;
|
|
1123
|
+
switch (i) {
|
|
1124
|
+
case "wiggle":
|
|
1125
|
+
this._startWiggle(t);
|
|
1126
|
+
break;
|
|
1127
|
+
case "pulse":
|
|
1128
|
+
this._startPulse(t);
|
|
1129
|
+
break;
|
|
1130
|
+
case "blink":
|
|
1131
|
+
this._startBlink(t);
|
|
1132
|
+
break;
|
|
1133
|
+
case "spin":
|
|
1134
|
+
this._startSpin(t);
|
|
1135
|
+
break;
|
|
1136
|
+
case "custom":
|
|
1137
|
+
this._startCustom(t);
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
_startWiggle(t) {
|
|
1142
|
+
const i = { ...Jt, ...this.config.wiggle }, e = [
|
|
1143
|
+
{ transform: "rotate(0deg)", offset: 0 },
|
|
1144
|
+
{ transform: `rotate(${i.maxAngle}deg)`, offset: 0.25 },
|
|
1145
|
+
{ transform: "rotate(0deg)", offset: 0.5 },
|
|
1146
|
+
{ transform: `rotate(${-i.maxAngle}deg)`, offset: 0.75 },
|
|
1147
|
+
{ transform: "rotate(0deg)", offset: 1 }
|
|
1148
|
+
];
|
|
1149
|
+
i.sync === "together" ? (t.animation = t.element.animate(e, {
|
|
1150
|
+
duration: i.speed,
|
|
1151
|
+
iterations: 1 / 0,
|
|
1152
|
+
composite: "add",
|
|
1153
|
+
fill: "both"
|
|
1154
|
+
}), t.animation.pause(), this._startTogetherLoop(i.speed)) : t.animation = t.element.animate(e, {
|
|
1155
|
+
duration: i.speed,
|
|
1156
|
+
delay: -(Math.random() * i.speed),
|
|
1157
|
+
iterations: 1 / 0,
|
|
1158
|
+
composite: "add"
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
_startPulse(t) {
|
|
1162
|
+
const i = { ...Kt, ...this.config.pulse }, e = [
|
|
1163
|
+
{ transform: "scale(1)", offset: 0 },
|
|
1164
|
+
{ transform: `scale(${i.maxScale})`, offset: 0.25 },
|
|
1165
|
+
{ transform: "scale(1)", offset: 0.5 },
|
|
1166
|
+
{ transform: `scale(${i.minScale})`, offset: 0.75 },
|
|
1167
|
+
{ transform: "scale(1)", offset: 1 }
|
|
1168
|
+
];
|
|
1169
|
+
i.sync === "together" ? (t.animation = t.element.animate(e, {
|
|
1170
|
+
duration: i.speed,
|
|
1171
|
+
iterations: 1 / 0,
|
|
1172
|
+
composite: "add",
|
|
1173
|
+
fill: "both"
|
|
1174
|
+
}), t.animation.pause(), this._startTogetherLoop(i.speed)) : t.animation = t.element.animate(e, {
|
|
1175
|
+
duration: i.speed,
|
|
1176
|
+
delay: -(Math.random() * i.speed),
|
|
1177
|
+
iterations: 1 / 0,
|
|
1178
|
+
composite: "add"
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
_startBlink(t) {
|
|
1182
|
+
const i = { ...Zt, ...this.config.blink }, e = -(Math.random() * i.speed), n = parseFloat(getComputedStyle(t.element).opacity) || 1;
|
|
1183
|
+
let a, r;
|
|
1184
|
+
i.style === "fade" ? (a = [
|
|
1185
|
+
{ opacity: n, offset: 0 },
|
|
1186
|
+
{ opacity: 0, offset: 0.5 },
|
|
1187
|
+
{ opacity: n, offset: 1 }
|
|
1188
|
+
], r = {
|
|
1189
|
+
duration: i.speed,
|
|
1190
|
+
delay: e,
|
|
1191
|
+
iterations: 1 / 0,
|
|
1192
|
+
easing: "ease-in-out"
|
|
1193
|
+
}) : (a = [
|
|
1194
|
+
{ opacity: n, offset: 0 },
|
|
1195
|
+
{ opacity: n, offset: i.onRatio },
|
|
1196
|
+
{ opacity: 0, offset: Math.min(i.onRatio + 0.01, 0.99) },
|
|
1197
|
+
{ opacity: 0, offset: 0.99 },
|
|
1198
|
+
{ opacity: n, offset: 1 }
|
|
1199
|
+
], r = {
|
|
1200
|
+
duration: i.speed,
|
|
1201
|
+
delay: e,
|
|
1202
|
+
iterations: 1 / 0
|
|
1203
|
+
}), t.blinkAnimation = t.element.animate(a, r);
|
|
1204
|
+
}
|
|
1205
|
+
_startSpin(t) {
|
|
1206
|
+
const i = { ...Qt, ...this.config.spin }, e = i.direction === "clockwise" ? 360 : -360;
|
|
1207
|
+
t.animation = t.element.animate(
|
|
1208
|
+
[{ transform: "rotate(0deg)" }, { transform: `rotate(${e}deg)` }],
|
|
1209
|
+
{
|
|
1210
|
+
duration: i.speed,
|
|
1211
|
+
iterations: 1 / 0,
|
|
1212
|
+
easing: "linear",
|
|
1213
|
+
composite: "add"
|
|
1214
|
+
}
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1217
|
+
_startCustom(t) {
|
|
1218
|
+
const i = this.config.custom;
|
|
1219
|
+
if (!i) return;
|
|
1220
|
+
const e = i({ element: t.element, index: t.index, totalImages: t.totalImages });
|
|
1221
|
+
typeof e == "function" ? t.customTeardown = e : e && typeof e.play == "function" && (t.animation = e);
|
|
1222
|
+
}
|
|
1223
|
+
_startTogetherLoop(t) {
|
|
1224
|
+
if (this.togetherSpeed = t, this.togetherRafId !== null) return;
|
|
1225
|
+
const i = () => {
|
|
1226
|
+
const e = performance.now() % this.togetherSpeed;
|
|
1227
|
+
for (const n of this.entries.values())
|
|
1228
|
+
!n.stopped && !n.paused && n.animation && (n.animation.currentTime = e);
|
|
1229
|
+
this.togetherRafId = requestAnimationFrame(i);
|
|
1230
|
+
};
|
|
1231
|
+
this.togetherRafId = requestAnimationFrame(i);
|
|
1232
|
+
}
|
|
1233
|
+
_stopTogetherLoop() {
|
|
1234
|
+
this.togetherRafId !== null && (cancelAnimationFrame(this.togetherRafId), this.togetherRafId = null);
|
|
1235
|
+
}
|
|
1236
|
+
_pauseEntry(t) {
|
|
1237
|
+
t.animation && (t.animation.cancel(), t.animation = null), t.blinkAnimation && (t.blinkAnimation.cancel(), t.blinkAnimation = null);
|
|
1238
|
+
}
|
|
1239
|
+
_cancelEntry(t) {
|
|
1240
|
+
t.animation && (t.animation.cancel(), t.animation = null), t.blinkAnimation && (t.blinkAnimation.cancel(), t.blinkAnimation = null), t.customTeardown && (t.customTeardown(), t.customTeardown = null);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
class xe {
|
|
1055
1244
|
constructor(t, i = {}) {
|
|
1056
1245
|
this.config = t, this.imageConfig = i;
|
|
1057
1246
|
}
|
|
@@ -1063,11 +1252,11 @@ class me {
|
|
|
1063
1252
|
* @returns Array of layout objects with position, rotation, scale
|
|
1064
1253
|
*/
|
|
1065
1254
|
generate(t, i, e = {}) {
|
|
1066
|
-
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding, c = e.fixedHeight ?? 200, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = c * 1.5 / 2, m = c / 2, y = a - s - g, w = r - s - m, v = s + g,
|
|
1255
|
+
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding, c = e.fixedHeight ?? 200, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = c * 1.5 / 2, m = c / 2, y = a - s - g, w = r - s - m, v = s + g, I = s + m;
|
|
1067
1256
|
for (let x = 0; x < t; x++) {
|
|
1068
|
-
const
|
|
1257
|
+
const R = this.random(v, y), z = this.random(I, w), L = l === "random" ? this.random(u, h) : 0, _ = b ? this.random(d, f) : 1, O = c * _, H = {
|
|
1069
1258
|
id: x,
|
|
1070
|
-
x:
|
|
1259
|
+
x: R,
|
|
1071
1260
|
y: z,
|
|
1072
1261
|
rotation: L,
|
|
1073
1262
|
scale: _,
|
|
@@ -1087,7 +1276,7 @@ class me {
|
|
|
1087
1276
|
return Math.random() * (i - t) + t;
|
|
1088
1277
|
}
|
|
1089
1278
|
}
|
|
1090
|
-
class
|
|
1279
|
+
class Ee {
|
|
1091
1280
|
constructor(t, i = {}) {
|
|
1092
1281
|
this.config = t, this.imageConfig = i;
|
|
1093
1282
|
}
|
|
@@ -1100,9 +1289,9 @@ class pe {
|
|
|
1100
1289
|
*/
|
|
1101
1290
|
generate(t, i, e = {}) {
|
|
1102
1291
|
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = h !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = {
|
|
1103
|
-
...
|
|
1292
|
+
...Gt,
|
|
1104
1293
|
...this.config.radial
|
|
1105
|
-
}, g = e.fixedHeight ?? s, m = a / 2, y = r / 2, w = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50,
|
|
1294
|
+
}, g = e.fixedHeight ?? s, m = a / 2, y = r / 2, w = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50, I = Math.max(g * 0.8, Math.min(
|
|
1106
1295
|
m - v - g / 2,
|
|
1107
1296
|
y - v - g / 2
|
|
1108
1297
|
));
|
|
@@ -1120,32 +1309,32 @@ class pe {
|
|
|
1120
1309
|
// Center image is highest
|
|
1121
1310
|
});
|
|
1122
1311
|
}
|
|
1123
|
-
let x = 1,
|
|
1312
|
+
let x = 1, R = 1;
|
|
1124
1313
|
for (; x < t; ) {
|
|
1125
|
-
const z =
|
|
1314
|
+
const z = R / w, L = b > 0 ? 1 - z * b * 0.5 : 1, _ = Math.max(g * 0.8, I / w * 1.5 / p.tightness), O = R * _, H = O * 1.5, k = Math.PI * (3 * (H + O) - Math.sqrt((3 * H + O) * (H + 3 * O))), T = this.estimateWidth(g), D = Math.floor(k / (T * 0.7));
|
|
1126
1315
|
if (D === 0) {
|
|
1127
|
-
|
|
1316
|
+
R++;
|
|
1128
1317
|
continue;
|
|
1129
1318
|
}
|
|
1130
|
-
const G = 2 * Math.PI / D, U =
|
|
1319
|
+
const G = 2 * Math.PI / D, U = R * (20 * Math.PI / 180);
|
|
1131
1320
|
for (let M = 0; M < D && x < t; M++) {
|
|
1132
|
-
const
|
|
1133
|
-
let $ = m + Math.cos(
|
|
1134
|
-
const P =
|
|
1135
|
-
$ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P), F -
|
|
1136
|
-
const
|
|
1321
|
+
const A = M * G + U, N = f ? this.random(h, d) : 1, B = L * N, C = g * B;
|
|
1322
|
+
let $ = m + Math.cos(A) * H, F = y + Math.sin(A) * O;
|
|
1323
|
+
const P = C * 1.5 / 2, j = C / 2;
|
|
1324
|
+
$ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P), F - j < v ? F = v + j : F + j > r - v && (F = r - v - j);
|
|
1325
|
+
const Y = c === "random" ? this.random(l, u) : 0;
|
|
1137
1326
|
n.push({
|
|
1138
1327
|
id: x,
|
|
1139
1328
|
x: $,
|
|
1140
1329
|
y: F,
|
|
1141
|
-
rotation:
|
|
1142
|
-
scale:
|
|
1143
|
-
baseSize:
|
|
1144
|
-
zIndex: Math.max(1, 100 -
|
|
1330
|
+
rotation: Y,
|
|
1331
|
+
scale: B,
|
|
1332
|
+
baseSize: C,
|
|
1333
|
+
zIndex: Math.max(1, 100 - R)
|
|
1145
1334
|
// Outer rings have lower z-index
|
|
1146
1335
|
}), x++;
|
|
1147
1336
|
}
|
|
1148
|
-
|
|
1337
|
+
R++;
|
|
1149
1338
|
}
|
|
1150
1339
|
return n;
|
|
1151
1340
|
}
|
|
@@ -1168,7 +1357,7 @@ class pe {
|
|
|
1168
1357
|
return Math.random() * (i - t) + t;
|
|
1169
1358
|
}
|
|
1170
1359
|
}
|
|
1171
|
-
const
|
|
1360
|
+
const Se = {
|
|
1172
1361
|
columns: "auto",
|
|
1173
1362
|
rows: "auto",
|
|
1174
1363
|
stagger: "none",
|
|
@@ -1178,7 +1367,7 @@ const be = {
|
|
|
1178
1367
|
alignment: "center",
|
|
1179
1368
|
gap: 10,
|
|
1180
1369
|
overflowOffset: 0.25
|
|
1181
|
-
},
|
|
1370
|
+
}, Ct = [
|
|
1182
1371
|
{ x: 1, y: 1 },
|
|
1183
1372
|
// bottom-right
|
|
1184
1373
|
{ x: -1, y: -1 },
|
|
@@ -1196,7 +1385,7 @@ const be = {
|
|
|
1196
1385
|
{ x: 0, y: 1 }
|
|
1197
1386
|
// down
|
|
1198
1387
|
];
|
|
1199
|
-
class
|
|
1388
|
+
class Ie {
|
|
1200
1389
|
constructor(t, i = {}) {
|
|
1201
1390
|
this.config = t, this.imageConfig = i;
|
|
1202
1391
|
}
|
|
@@ -1208,13 +1397,13 @@ class ye {
|
|
|
1208
1397
|
* @returns Array of layout objects with position, rotation, scale
|
|
1209
1398
|
*/
|
|
1210
1399
|
generate(t, i, e = {}) {
|
|
1211
|
-
const n = [], { width: a, height: r } = i, s = { ...
|
|
1400
|
+
const n = [], { width: a, height: r } = i, s = { ...Se, ...this.config.grid }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = h !== 1 || d !== 1, b = a - 2 * c, p = r - 2 * c, { columns: g, rows: m } = this.calculateGridDimensions(
|
|
1212
1401
|
t,
|
|
1213
1402
|
b,
|
|
1214
1403
|
p,
|
|
1215
1404
|
l,
|
|
1216
1405
|
s
|
|
1217
|
-
), y = s.stagger === "row", w = s.stagger === "column", v = y ? g + 0.5 : g,
|
|
1406
|
+
), y = s.stagger === "row", w = s.stagger === "column", v = y ? g + 0.5 : g, I = w ? m + 0.5 : m, x = (b - s.gap * (g - 1)) / v, R = (p - s.gap * (m - 1)) / I, z = y ? x / 2 : 0, L = w ? R / 2 : 0, _ = 1 + s.overlap, O = Math.min(x, R) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, O) : O, k = g * x + (g - 1) * s.gap + z, T = m * R + (m - 1) * s.gap + L, D = c + (b - k) / 2, G = c + (p - T) / 2, U = g * m, M = s.columns !== "auto" && s.rows !== "auto", A = M && t > U;
|
|
1218
1407
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1219
1408
|
gridConfigColumns: s.columns,
|
|
1220
1409
|
gridConfigRows: s.rows,
|
|
@@ -1223,45 +1412,45 @@ class ye {
|
|
|
1223
1412
|
cellCount: U,
|
|
1224
1413
|
hasFixedGrid: M,
|
|
1225
1414
|
imageCount: t,
|
|
1226
|
-
isOverflowMode:
|
|
1415
|
+
isOverflowMode: A
|
|
1227
1416
|
});
|
|
1228
|
-
const
|
|
1229
|
-
for (let
|
|
1230
|
-
let $, F,
|
|
1231
|
-
if (
|
|
1232
|
-
const q =
|
|
1233
|
-
|
|
1417
|
+
const N = A ? new Array(U).fill(0) : [], B = Math.min(x, R) * s.overflowOffset;
|
|
1418
|
+
for (let C = 0; C < t; C++) {
|
|
1419
|
+
let $, F, X = 0;
|
|
1420
|
+
if (A && C >= U) {
|
|
1421
|
+
const q = C - U, W = q % U;
|
|
1422
|
+
X = Math.floor(q / U) + 1, N[W]++, s.fillDirection === "row" ? ($ = W % g, F = Math.floor(W / g)) : (F = W % m, $ = Math.floor(W / m));
|
|
1234
1423
|
} else
|
|
1235
|
-
s.fillDirection === "row" ? ($ =
|
|
1236
|
-
let P = D + $ * (x + s.gap) + x / 2,
|
|
1237
|
-
if (s.stagger === "row" && F % 2 === 1 ? P += x / 2 : s.stagger === "column" && $ % 2 === 1 && (
|
|
1238
|
-
const q = (
|
|
1239
|
-
P +=
|
|
1424
|
+
s.fillDirection === "row" ? ($ = C % g, F = Math.floor(C / g)) : (F = C % m, $ = Math.floor(C / m));
|
|
1425
|
+
let P = D + $ * (x + s.gap) + x / 2, j = G + F * (R + s.gap) + R / 2;
|
|
1426
|
+
if (s.stagger === "row" && F % 2 === 1 ? P += x / 2 : s.stagger === "column" && $ % 2 === 1 && (j += R / 2), X > 0) {
|
|
1427
|
+
const q = (X - 1) % Ct.length, W = Ct[q];
|
|
1428
|
+
P += W.x * B, j += W.y * B;
|
|
1240
1429
|
}
|
|
1241
1430
|
if (s.jitter > 0) {
|
|
1242
|
-
const q = x / 2 * s.jitter,
|
|
1243
|
-
P += this.random(-q, q),
|
|
1431
|
+
const q = x / 2 * s.jitter, W = R / 2 * s.jitter;
|
|
1432
|
+
P += this.random(-q, q), j += this.random(-W, W);
|
|
1244
1433
|
}
|
|
1245
|
-
let
|
|
1246
|
-
if (!
|
|
1434
|
+
let Y = P, V = j;
|
|
1435
|
+
if (!A && s.fillDirection === "row") {
|
|
1247
1436
|
const q = t % g || g;
|
|
1248
1437
|
if (F === Math.floor((t - 1) / g) && q < g) {
|
|
1249
1438
|
const St = q * x + (q - 1) * s.gap;
|
|
1250
1439
|
let gt = 0;
|
|
1251
|
-
s.alignment === "center" ? gt = (
|
|
1440
|
+
s.alignment === "center" ? gt = (k - St) / 2 : s.alignment === "end" && (gt = k - St), Y += gt;
|
|
1252
1441
|
}
|
|
1253
1442
|
}
|
|
1254
|
-
const rt = f ? this.random(h, d) : 1, K = H * rt, it = K * 1.5 / 2,
|
|
1255
|
-
|
|
1443
|
+
const rt = f ? this.random(h, d) : 1, K = H * rt, it = K * 1.5 / 2, nt = K / 2, lt = c + it, ht = a - c - it, _t = c + nt, Ut = r - c - nt;
|
|
1444
|
+
Y = Math.max(lt, Math.min(Y, ht)), V = Math.max(_t, Math.min(V, Ut));
|
|
1256
1445
|
let dt = 0;
|
|
1257
1446
|
if (u === "random") {
|
|
1258
|
-
const q = this.imageConfig.rotation?.range?.min ?? -15,
|
|
1259
|
-
s.jitter > 0 ? dt = this.random(q * s.jitter,
|
|
1447
|
+
const q = this.imageConfig.rotation?.range?.min ?? -15, W = this.imageConfig.rotation?.range?.max ?? 15;
|
|
1448
|
+
s.jitter > 0 ? dt = this.random(q * s.jitter, W * s.jitter) : dt = this.random(q, W);
|
|
1260
1449
|
}
|
|
1261
1450
|
let ut;
|
|
1262
|
-
|
|
1263
|
-
id:
|
|
1264
|
-
x:
|
|
1451
|
+
A && X > 0 ? ut = 50 - X : ut = A ? 100 + C : C + 1, n.push({
|
|
1452
|
+
id: C,
|
|
1453
|
+
x: Y,
|
|
1265
1454
|
y: V,
|
|
1266
1455
|
rotation: dt,
|
|
1267
1456
|
scale: rt,
|
|
@@ -1296,14 +1485,14 @@ class ye {
|
|
|
1296
1485
|
return Math.random() * (i - t) + t;
|
|
1297
1486
|
}
|
|
1298
1487
|
}
|
|
1299
|
-
const
|
|
1488
|
+
const Re = Math.PI * (3 - Math.sqrt(5)), Te = {
|
|
1300
1489
|
spiralType: "golden",
|
|
1301
1490
|
direction: "counterclockwise",
|
|
1302
1491
|
tightness: 1,
|
|
1303
1492
|
scaleDecay: 0,
|
|
1304
1493
|
startAngle: 0
|
|
1305
1494
|
};
|
|
1306
|
-
class
|
|
1495
|
+
class Ae {
|
|
1307
1496
|
constructor(t, i = {}) {
|
|
1308
1497
|
this.config = t, this.imageConfig = i;
|
|
1309
1498
|
}
|
|
@@ -1315,36 +1504,36 @@ class xe {
|
|
|
1315
1504
|
* @returns Array of layout objects with position, rotation, scale
|
|
1316
1505
|
*/
|
|
1317
1506
|
generate(t, i, e = {}) {
|
|
1318
|
-
const n = [], { width: a, height: r } = i, s = { ...
|
|
1507
|
+
const n = [], { width: a, height: r } = i, s = { ...Te, ...this.config.spiral }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, y = r / 2, w = Math.min(
|
|
1319
1508
|
m - c - l / 2,
|
|
1320
1509
|
y - c - l / 2
|
|
1321
1510
|
), v = s.direction === "clockwise" ? -1 : 1;
|
|
1322
|
-
for (let
|
|
1323
|
-
let x,
|
|
1511
|
+
for (let I = 0; I < t; I++) {
|
|
1512
|
+
let x, R;
|
|
1324
1513
|
if (s.spiralType === "golden")
|
|
1325
|
-
x =
|
|
1514
|
+
x = I * Re * v + s.startAngle, R = this.calculateGoldenRadius(I, t, w, s.tightness);
|
|
1326
1515
|
else if (s.spiralType === "archimedean") {
|
|
1327
|
-
const P =
|
|
1328
|
-
x = P * v + s.startAngle,
|
|
1516
|
+
const P = I * 0.5 * s.tightness;
|
|
1517
|
+
x = P * v + s.startAngle, R = this.calculateArchimedeanRadius(P, t, w, s.tightness);
|
|
1329
1518
|
} else {
|
|
1330
|
-
const P =
|
|
1331
|
-
x = P * v + s.startAngle,
|
|
1519
|
+
const P = I * 0.3 * s.tightness;
|
|
1520
|
+
x = P * v + s.startAngle, R = this.calculateLogarithmicRadius(P, t, w, s.tightness);
|
|
1332
1521
|
}
|
|
1333
|
-
const z = m + Math.cos(x) *
|
|
1522
|
+
const z = m + Math.cos(x) * R, L = y + Math.sin(x) * R, _ = R / w, O = g > 0 ? 1 - _ * g * 0.5 : 1, H = p ? this.random(f, b) : 1, k = O * H, T = l * k, G = T * 1.5 / 2, U = T / 2, M = c + G, A = a - c - G, N = c + U, B = r - c - U, C = Math.max(M, Math.min(z, A)), $ = Math.max(N, Math.min(L, B));
|
|
1334
1523
|
let F = 0;
|
|
1335
1524
|
if (u === "random") {
|
|
1336
|
-
const P = x * 180 / Math.PI % 360,
|
|
1337
|
-
F = s.spiralType === "golden" ?
|
|
1338
|
-
} else u === "tangent" && (F = this.calculateSpiralTangent(x,
|
|
1339
|
-
const
|
|
1525
|
+
const P = x * 180 / Math.PI % 360, j = this.random(h, d);
|
|
1526
|
+
F = s.spiralType === "golden" ? j : P * 0.1 + j * 0.9;
|
|
1527
|
+
} else u === "tangent" && (F = this.calculateSpiralTangent(x, R, s));
|
|
1528
|
+
const X = t - I;
|
|
1340
1529
|
n.push({
|
|
1341
|
-
id:
|
|
1342
|
-
x:
|
|
1530
|
+
id: I,
|
|
1531
|
+
x: C,
|
|
1343
1532
|
y: $,
|
|
1344
1533
|
rotation: F,
|
|
1345
|
-
scale:
|
|
1534
|
+
scale: k,
|
|
1346
1535
|
baseSize: T,
|
|
1347
|
-
zIndex:
|
|
1536
|
+
zIndex: X
|
|
1348
1537
|
});
|
|
1349
1538
|
}
|
|
1350
1539
|
return n;
|
|
@@ -1397,7 +1586,7 @@ class xe {
|
|
|
1397
1586
|
return Math.random() * (i - t) + t;
|
|
1398
1587
|
}
|
|
1399
1588
|
}
|
|
1400
|
-
const
|
|
1589
|
+
const Ce = {
|
|
1401
1590
|
clusterCount: "auto",
|
|
1402
1591
|
clusterSpread: 150,
|
|
1403
1592
|
clusterSpacing: 200,
|
|
@@ -1405,7 +1594,7 @@ const Ee = {
|
|
|
1405
1594
|
overlap: 0.3,
|
|
1406
1595
|
distribution: "gaussian"
|
|
1407
1596
|
};
|
|
1408
|
-
class
|
|
1597
|
+
class Le {
|
|
1409
1598
|
constructor(t, i = {}) {
|
|
1410
1599
|
this.config = t, this.imageConfig = i;
|
|
1411
1600
|
}
|
|
@@ -1417,7 +1606,7 @@ class Se {
|
|
|
1417
1606
|
* @returns Array of layout objects with position, rotation, scale
|
|
1418
1607
|
*/
|
|
1419
1608
|
generate(t, i, e = {}) {
|
|
1420
|
-
const n = [], { width: a, height: r } = i, s = { ...
|
|
1609
|
+
const n = [], { width: a, height: r } = i, s = { ...Ce, ...this.config.cluster }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.calculateClusterCount(
|
|
1421
1610
|
t,
|
|
1422
1611
|
s.clusterCount,
|
|
1423
1612
|
a,
|
|
@@ -1434,28 +1623,28 @@ class Se {
|
|
|
1434
1623
|
y[v % g]++;
|
|
1435
1624
|
let w = 0;
|
|
1436
1625
|
for (let v = 0; v < g; v++) {
|
|
1437
|
-
const
|
|
1438
|
-
for (let
|
|
1626
|
+
const I = m[v], x = y[v];
|
|
1627
|
+
for (let R = 0; R < x; R++) {
|
|
1439
1628
|
let z, L;
|
|
1440
1629
|
if (s.distribution === "gaussian")
|
|
1441
|
-
z = this.gaussianRandom() *
|
|
1630
|
+
z = this.gaussianRandom() * I.spread, L = this.gaussianRandom() * I.spread;
|
|
1442
1631
|
else {
|
|
1443
|
-
const F = this.random(0, Math.PI * 2),
|
|
1444
|
-
z = Math.cos(F) *
|
|
1632
|
+
const F = this.random(0, Math.PI * 2), X = this.random(0, I.spread);
|
|
1633
|
+
z = Math.cos(F) * X, L = Math.sin(F) * X;
|
|
1445
1634
|
}
|
|
1446
1635
|
const _ = 1 + s.overlap * 0.5, O = 1 + s.overlap * 0.3;
|
|
1447
1636
|
z /= _, L /= _;
|
|
1448
|
-
const H = p ? this.random(f, b) : 1,
|
|
1449
|
-
let D =
|
|
1450
|
-
const M = T * 1.5 / 2,
|
|
1451
|
-
D = Math.max(c + M, Math.min(D, a - c - M)), G = Math.max(c +
|
|
1452
|
-
const
|
|
1637
|
+
const H = p ? this.random(f, b) : 1, k = O * H, T = l * k;
|
|
1638
|
+
let D = I.x + z, G = I.y + L;
|
|
1639
|
+
const M = T * 1.5 / 2, A = T / 2;
|
|
1640
|
+
D = Math.max(c + M, Math.min(D, a - c - M)), G = Math.max(c + A, Math.min(G, r - c - A));
|
|
1641
|
+
const N = u === "random" ? this.random(h, d) : 0, C = Math.sqrt(z * z + L * L) / I.spread, $ = Math.round((1 - C) * 50) + 1;
|
|
1453
1642
|
n.push({
|
|
1454
1643
|
id: w,
|
|
1455
1644
|
x: D,
|
|
1456
1645
|
y: G,
|
|
1457
|
-
rotation:
|
|
1458
|
-
scale:
|
|
1646
|
+
rotation: N,
|
|
1647
|
+
scale: k,
|
|
1459
1648
|
baseSize: T,
|
|
1460
1649
|
zIndex: $
|
|
1461
1650
|
}), w++;
|
|
@@ -1489,8 +1678,8 @@ class Se {
|
|
|
1489
1678
|
};
|
|
1490
1679
|
let m = 1 / 0;
|
|
1491
1680
|
for (const y of r) {
|
|
1492
|
-
const w = g.x - y.x, v = g.y - y.y,
|
|
1493
|
-
m = Math.min(m,
|
|
1681
|
+
const w = g.x - y.x, v = g.y - y.y, I = Math.sqrt(w * w + v * v);
|
|
1682
|
+
m = Math.min(m, I);
|
|
1494
1683
|
}
|
|
1495
1684
|
if ((r.length === 0 || m > b) && (f = g, b = m), m >= a.clusterSpacing)
|
|
1496
1685
|
break;
|
|
@@ -1523,7 +1712,7 @@ class Se {
|
|
|
1523
1712
|
return Math.random() * (i - t) + t;
|
|
1524
1713
|
}
|
|
1525
1714
|
}
|
|
1526
|
-
class
|
|
1715
|
+
class Me {
|
|
1527
1716
|
constructor(t, i = {}) {
|
|
1528
1717
|
this.config = t, this.imageConfig = i;
|
|
1529
1718
|
}
|
|
@@ -1536,26 +1725,26 @@ class Re {
|
|
|
1536
1725
|
*/
|
|
1537
1726
|
generate(t, i, e = {}) {
|
|
1538
1727
|
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = e.fixedHeight ?? s, g = {
|
|
1539
|
-
...
|
|
1728
|
+
...qt,
|
|
1540
1729
|
...this.config.wave
|
|
1541
|
-
}, { rows: m, amplitude: y, frequency: w, phaseShift: v, synchronization:
|
|
1730
|
+
}, { rows: m, amplitude: y, frequency: w, phaseShift: v, synchronization: I } = g, x = Math.ceil(t / m), L = p * 1.5 / 2, _ = c + L, O = a - c - L, H = O - _, k = x > 1 ? H / (x - 1) : 0, T = c + y + p / 2, D = r - c - y - p / 2, G = D - T, U = m > 1 ? G / (m - 1) : 0;
|
|
1542
1731
|
let M = 0;
|
|
1543
|
-
for (let
|
|
1544
|
-
const
|
|
1545
|
-
let
|
|
1546
|
-
|
|
1547
|
-
for (let
|
|
1548
|
-
const $ = x === 1 ? (_ + O) / 2 : _ +
|
|
1732
|
+
for (let A = 0; A < m && M < t; A++) {
|
|
1733
|
+
const N = m === 1 ? (T + D) / 2 : T + A * U;
|
|
1734
|
+
let B = 0;
|
|
1735
|
+
I === "offset" ? B = A * v : I === "alternating" && (B = A * Math.PI);
|
|
1736
|
+
for (let C = 0; C < x && M < t; C++) {
|
|
1737
|
+
const $ = x === 1 ? (_ + O) / 2 : _ + C * k, F = this.calculateWaveY($, a, y, w, B), X = $, P = N + F, j = b ? this.random(d, f) : 1, Y = p * j;
|
|
1549
1738
|
let V = 0;
|
|
1550
|
-
l === "tangent" ? V = this.calculateRotation($, a, y, w,
|
|
1551
|
-
const K =
|
|
1739
|
+
l === "tangent" ? V = this.calculateRotation($, a, y, w, B) : l === "random" && (V = this.random(u, h));
|
|
1740
|
+
const K = Y * 1.5 / 2, ct = Y / 2, it = c + K, nt = a - c - K, lt = c + ct, ht = r - c - ct;
|
|
1552
1741
|
n.push({
|
|
1553
1742
|
id: M,
|
|
1554
|
-
x: Math.max(it, Math.min(
|
|
1743
|
+
x: Math.max(it, Math.min(X, nt)),
|
|
1555
1744
|
y: Math.max(lt, Math.min(P, ht)),
|
|
1556
1745
|
rotation: V,
|
|
1557
|
-
scale:
|
|
1558
|
-
baseSize:
|
|
1746
|
+
scale: j,
|
|
1747
|
+
baseSize: Y,
|
|
1559
1748
|
zIndex: M + 1
|
|
1560
1749
|
}), M++;
|
|
1561
1750
|
}
|
|
@@ -1613,21 +1802,21 @@ const xt = 100, Q = 100 / Math.sqrt(3), Et = [
|
|
|
1613
1802
|
// lower-left
|
|
1614
1803
|
[0, 50]
|
|
1615
1804
|
// left
|
|
1616
|
-
],
|
|
1617
|
-
function
|
|
1805
|
+
], Fe = Et[1][0] / xt, ze = Et[2][1] / xt;
|
|
1806
|
+
function Oe(o) {
|
|
1618
1807
|
return {
|
|
1619
|
-
colStep:
|
|
1620
|
-
rowOffset:
|
|
1808
|
+
colStep: Fe * o,
|
|
1809
|
+
rowOffset: ze * o
|
|
1621
1810
|
};
|
|
1622
1811
|
}
|
|
1623
|
-
function
|
|
1624
|
-
const { colStep: r } =
|
|
1812
|
+
function De(o, t, i, e, n, a) {
|
|
1813
|
+
const { colStep: r } = Oe(a);
|
|
1625
1814
|
return {
|
|
1626
1815
|
px: e + r * o,
|
|
1627
1816
|
py: n + a * (t + o / 2)
|
|
1628
1817
|
};
|
|
1629
1818
|
}
|
|
1630
|
-
const
|
|
1819
|
+
const $e = [
|
|
1631
1820
|
[1, 0, -1],
|
|
1632
1821
|
[0, 1, -1],
|
|
1633
1822
|
[-1, 1, 0],
|
|
@@ -1635,16 +1824,16 @@ const Le = [
|
|
|
1635
1824
|
[0, -1, 1],
|
|
1636
1825
|
[1, -1, 0]
|
|
1637
1826
|
];
|
|
1638
|
-
function
|
|
1827
|
+
function Pe(o) {
|
|
1639
1828
|
if (o === 0) return [[0, 0, 0]];
|
|
1640
1829
|
const t = [];
|
|
1641
1830
|
let [i, e, n] = [0, -o, o];
|
|
1642
|
-
for (const [a, r, s] of
|
|
1831
|
+
for (const [a, r, s] of $e)
|
|
1643
1832
|
for (let c = 0; c < o; c++)
|
|
1644
1833
|
t.push([i, e, n]), i += a, e += r, n += s;
|
|
1645
1834
|
return t;
|
|
1646
1835
|
}
|
|
1647
|
-
class
|
|
1836
|
+
class _e {
|
|
1648
1837
|
// imageConfig intentionally not stored — honeycomb forces uniform sizing (rotation/variance
|
|
1649
1838
|
// would break hex tiling). Kept as parameter for interface compatibility.
|
|
1650
1839
|
constructor(t, i = {}) {
|
|
@@ -1652,15 +1841,15 @@ class Fe {
|
|
|
1652
1841
|
}
|
|
1653
1842
|
generate(t, i, e = {}) {
|
|
1654
1843
|
const n = [], { width: a, height: r } = i, s = a / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
|
|
1655
|
-
...
|
|
1844
|
+
...Bt,
|
|
1656
1845
|
...this.config.honeycomb
|
|
1657
1846
|
}.spacing ?? 0, d = l + h;
|
|
1658
1847
|
let f = 0, b = 0;
|
|
1659
1848
|
for (; f < t; ) {
|
|
1660
|
-
const p =
|
|
1849
|
+
const p = Pe(b);
|
|
1661
1850
|
for (const [g, m, y] of p) {
|
|
1662
1851
|
if (f >= t) break;
|
|
1663
|
-
const { px: w, py: v } =
|
|
1852
|
+
const { px: w, py: v } = De(g, m, y, s, c, d);
|
|
1664
1853
|
n.push({
|
|
1665
1854
|
id: f,
|
|
1666
1855
|
x: w,
|
|
@@ -1677,7 +1866,7 @@ class Fe {
|
|
|
1677
1866
|
return n;
|
|
1678
1867
|
}
|
|
1679
1868
|
}
|
|
1680
|
-
class
|
|
1869
|
+
class Ue {
|
|
1681
1870
|
constructor(t) {
|
|
1682
1871
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
|
|
1683
1872
|
}
|
|
@@ -1688,19 +1877,19 @@ class ze {
|
|
|
1688
1877
|
initLayout() {
|
|
1689
1878
|
switch (this.config.algorithm) {
|
|
1690
1879
|
case "radial":
|
|
1691
|
-
return new
|
|
1880
|
+
return new Ee(this.config, this.imageConfig);
|
|
1692
1881
|
case "grid":
|
|
1693
|
-
return new
|
|
1882
|
+
return new Ie(this.config, this.imageConfig);
|
|
1694
1883
|
case "spiral":
|
|
1695
|
-
return new
|
|
1884
|
+
return new Ae(this.config, this.imageConfig);
|
|
1696
1885
|
case "cluster":
|
|
1697
|
-
return new
|
|
1886
|
+
return new Le(this.config, this.imageConfig);
|
|
1698
1887
|
case "wave":
|
|
1699
|
-
return new
|
|
1888
|
+
return new Me(this.config, this.imageConfig);
|
|
1700
1889
|
case "honeycomb":
|
|
1701
|
-
return new
|
|
1890
|
+
return new _e(this.config, this.imageConfig);
|
|
1702
1891
|
default:
|
|
1703
|
-
return new
|
|
1892
|
+
return new xe(this.config, this.imageConfig);
|
|
1704
1893
|
}
|
|
1705
1894
|
}
|
|
1706
1895
|
/**
|
|
@@ -1822,7 +2011,7 @@ const Lt = {
|
|
|
1822
2011
|
hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
|
|
1823
2012
|
octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
|
|
1824
2013
|
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
|
|
1825
|
-
},
|
|
2014
|
+
}, He = {
|
|
1826
2015
|
// Circle - uses radius in pixels (refHeight of 100px = 50px radius)
|
|
1827
2016
|
circle: {
|
|
1828
2017
|
refHeight: 100,
|
|
@@ -1860,12 +2049,12 @@ const Lt = {
|
|
|
1860
2049
|
points: [[50, 0], [100, 50], [50, 100], [0, 50]]
|
|
1861
2050
|
}
|
|
1862
2051
|
};
|
|
1863
|
-
function
|
|
2052
|
+
function ke(o) {
|
|
1864
2053
|
if (o)
|
|
1865
2054
|
return o in Lt ? Lt[o] : o;
|
|
1866
2055
|
}
|
|
1867
|
-
function
|
|
1868
|
-
const e =
|
|
2056
|
+
function Ne(o, t, i) {
|
|
2057
|
+
const e = He[o];
|
|
1869
2058
|
if (!e) return "";
|
|
1870
2059
|
const n = t / e.refHeight;
|
|
1871
2060
|
if (o === "circle")
|
|
@@ -1876,13 +2065,13 @@ function $e(o, t, i) {
|
|
|
1876
2065
|
return `${m}px ${y}px`;
|
|
1877
2066
|
}).join(", ")})`;
|
|
1878
2067
|
}
|
|
1879
|
-
function
|
|
2068
|
+
function je(o) {
|
|
1880
2069
|
return o in mt;
|
|
1881
2070
|
}
|
|
1882
|
-
function
|
|
1883
|
-
return o ?
|
|
2071
|
+
function We(o) {
|
|
2072
|
+
return o ? je(o) ? mt[o] : o : mt.md;
|
|
1884
2073
|
}
|
|
1885
|
-
function
|
|
2074
|
+
function Ge(o) {
|
|
1886
2075
|
if (!o) return "";
|
|
1887
2076
|
const t = [];
|
|
1888
2077
|
if (o.grayscale !== void 0 && t.push(`grayscale(${o.grayscale})`), o.blur !== void 0 && t.push(`blur(${o.blur}px)`), o.brightness !== void 0 && t.push(`brightness(${o.brightness})`), o.contrast !== void 0 && t.push(`contrast(${o.contrast})`), o.saturate !== void 0 && t.push(`saturate(${o.saturate})`), o.opacity !== void 0 && t.push(`opacity(${o.opacity})`), o.sepia !== void 0 && t.push(`sepia(${o.sepia})`), o.hueRotate !== void 0 && t.push(`hue-rotate(${o.hueRotate}deg)`), o.invert !== void 0 && t.push(`invert(${o.invert})`), o.dropShadow !== void 0)
|
|
@@ -1911,8 +2100,8 @@ function et(o, t, i) {
|
|
|
1911
2100
|
const s = o.border || {}, c = { ...s, ...o.borderTop }, l = { ...s, ...o.borderRight }, u = { ...s, ...o.borderBottom }, h = { ...s, ...o.borderLeft };
|
|
1912
2101
|
e.borderTop = tt(c), e.borderRight = tt(l), e.borderBottom = tt(u), e.borderLeft = tt(h);
|
|
1913
2102
|
} else o.border && (e.border = tt(o.border));
|
|
1914
|
-
o.shadow !== void 0 && (e.boxShadow =
|
|
1915
|
-
const r =
|
|
2103
|
+
o.shadow !== void 0 && (e.boxShadow = We(o.shadow));
|
|
2104
|
+
const r = Ge(o.filter);
|
|
1916
2105
|
if (e.filter = r || "none", o.opacity !== void 0 && (e.opacity = String(o.opacity)), o.cursor !== void 0 && (e.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
|
|
1917
2106
|
const s = o.outline.width ?? 0, c = o.outline.style ?? "solid", l = o.outline.color ?? "#000000";
|
|
1918
2107
|
e.outline = `${s}px ${c} ${l}`, o.outline.offset !== void 0 && (e.outlineOffset = `${o.outline.offset}px`);
|
|
@@ -1921,33 +2110,33 @@ function et(o, t, i) {
|
|
|
1921
2110
|
let s;
|
|
1922
2111
|
const c = typeof o.clipPath == "object" && o.clipPath !== null && "shape" in o.clipPath, l = c ? o.clipPath : void 0;
|
|
1923
2112
|
if (l?.mode === "height-relative" && t)
|
|
1924
|
-
s =
|
|
2113
|
+
s = Ne(l.shape, t, i);
|
|
1925
2114
|
else {
|
|
1926
2115
|
const u = c && l ? l.shape : o.clipPath;
|
|
1927
|
-
s =
|
|
2116
|
+
s = ke(u);
|
|
1928
2117
|
}
|
|
1929
2118
|
s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
|
|
1930
2119
|
}
|
|
1931
2120
|
return e;
|
|
1932
2121
|
}
|
|
1933
|
-
function
|
|
2122
|
+
function qe(o, t) {
|
|
1934
2123
|
t.borderRadius !== void 0 && (o.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (o.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (o.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (o.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (o.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (o.style.border = t.border), t.borderTop !== void 0 && (o.style.borderTop = t.borderTop), t.borderRight !== void 0 && (o.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (o.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (o.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (o.style.boxShadow = t.boxShadow), t.filter !== void 0 && (o.style.filter = t.filter), t.opacity !== void 0 && (o.style.opacity = t.opacity), t.cursor !== void 0 && (o.style.cursor = t.cursor), t.outline !== void 0 && (o.style.outline = t.outline), t.outlineOffset !== void 0 && (o.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (o.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (o.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (o.style.clipPath = t.clipPath), t.overflow !== void 0 && (o.style.overflow = t.overflow);
|
|
1935
2124
|
}
|
|
1936
2125
|
function ft(o, t, i, e) {
|
|
1937
2126
|
const n = et(t, i, e);
|
|
1938
|
-
|
|
2127
|
+
qe(o, n);
|
|
1939
2128
|
}
|
|
1940
|
-
function
|
|
2129
|
+
function Pt(o) {
|
|
1941
2130
|
return o ? Array.isArray(o) ? o.join(" ") : o : "";
|
|
1942
2131
|
}
|
|
1943
2132
|
function st(o, t) {
|
|
1944
|
-
const i =
|
|
2133
|
+
const i = Pt(t);
|
|
1945
2134
|
i && i.split(" ").forEach((e) => {
|
|
1946
2135
|
e.trim() && o.classList.add(e.trim());
|
|
1947
2136
|
});
|
|
1948
2137
|
}
|
|
1949
2138
|
function pt(o, t) {
|
|
1950
|
-
const i =
|
|
2139
|
+
const i = Pt(t);
|
|
1951
2140
|
i && i.split(" ").forEach((e) => {
|
|
1952
2141
|
e.trim() && o.classList.remove(e.trim());
|
|
1953
2142
|
});
|
|
@@ -1956,9 +2145,15 @@ const Mt = {
|
|
|
1956
2145
|
UNFOCUSING: 999,
|
|
1957
2146
|
FOCUSING: 1e3
|
|
1958
2147
|
};
|
|
1959
|
-
class
|
|
2148
|
+
class Be {
|
|
1960
2149
|
constructor(t, i, e) {
|
|
1961
|
-
this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
|
|
2150
|
+
this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.onUnfocusComplete = null, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Set callback to be fired when an unfocus animation fully completes.
|
|
2154
|
+
*/
|
|
2155
|
+
setOnUnfocusCompleteCallback(t) {
|
|
2156
|
+
this.onUnfocusComplete = t;
|
|
1962
2157
|
}
|
|
1963
2158
|
/**
|
|
1964
2159
|
* Get current state machine state
|
|
@@ -2237,7 +2432,11 @@ class Ne {
|
|
|
2237
2432
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2238
2433
|
]), this.focusGeneration !== n)
|
|
2239
2434
|
return;
|
|
2240
|
-
|
|
2435
|
+
if (this.outgoing) {
|
|
2436
|
+
const a = this.outgoing.element;
|
|
2437
|
+
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2438
|
+
}
|
|
2439
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2241
2440
|
break;
|
|
2242
2441
|
case S.FOCUSING:
|
|
2243
2442
|
if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
|
|
@@ -2254,7 +2453,11 @@ class Ne {
|
|
|
2254
2453
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2255
2454
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2256
2455
|
]), this.focusGeneration !== n) return;
|
|
2257
|
-
|
|
2456
|
+
if (this.outgoing) {
|
|
2457
|
+
const a = this.outgoing.element;
|
|
2458
|
+
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2459
|
+
}
|
|
2460
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2258
2461
|
break;
|
|
2259
2462
|
case S.CROSS_ANIMATING:
|
|
2260
2463
|
if (this.incoming?.element === t)
|
|
@@ -2275,7 +2478,11 @@ class Ne {
|
|
|
2275
2478
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2276
2479
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2277
2480
|
]), this.focusGeneration !== n) return;
|
|
2278
|
-
|
|
2481
|
+
if (this.outgoing) {
|
|
2482
|
+
const s = this.outgoing.element;
|
|
2483
|
+
this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
|
|
2484
|
+
}
|
|
2485
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2279
2486
|
return;
|
|
2280
2487
|
}
|
|
2281
2488
|
if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
|
|
@@ -2297,7 +2504,11 @@ class Ne {
|
|
|
2297
2504
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2298
2505
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2299
2506
|
]), this.focusGeneration !== n) return;
|
|
2300
|
-
|
|
2507
|
+
if (this.outgoing) {
|
|
2508
|
+
const a = this.outgoing.element;
|
|
2509
|
+
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2510
|
+
}
|
|
2511
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2301
2512
|
break;
|
|
2302
2513
|
}
|
|
2303
2514
|
}
|
|
@@ -2317,7 +2528,8 @@ class Ne {
|
|
|
2317
2528
|
a,
|
|
2318
2529
|
r
|
|
2319
2530
|
), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
|
|
2320
|
-
|
|
2531
|
+
const s = this.outgoing.element;
|
|
2532
|
+
this.removeFocusedStyling(s, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = S.IDLE, this.onUnfocusComplete?.(s);
|
|
2321
2533
|
}
|
|
2322
2534
|
return;
|
|
2323
2535
|
}
|
|
@@ -2334,12 +2546,15 @@ class Ne {
|
|
|
2334
2546
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2335
2547
|
this.waitForAnimation(s.animationHandle)
|
|
2336
2548
|
]), this.focusGeneration !== t) return;
|
|
2337
|
-
|
|
2549
|
+
let c = null;
|
|
2550
|
+
this.outgoing && (c = this.outgoing.element, this.removeFocusedStyling(c, this.outgoing.originalState.zIndex?.toString() || ""));
|
|
2551
|
+
const l = s.element;
|
|
2552
|
+
this.removeFocusedStyling(l, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE, c && this.onUnfocusComplete?.(c), this.onUnfocusComplete?.(l);
|
|
2338
2553
|
return;
|
|
2339
2554
|
}
|
|
2340
2555
|
this.state = S.UNFOCUSING;
|
|
2341
2556
|
const i = this.currentFocus, e = this.focusData.originalState, n = this.focusData.originalZIndex;
|
|
2342
|
-
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE);
|
|
2557
|
+
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE, this.onUnfocusComplete?.(i));
|
|
2343
2558
|
}
|
|
2344
2559
|
/**
|
|
2345
2560
|
* Swap focus from current image to a new one (alias for focusImage with cross-animation)
|
|
@@ -2421,7 +2636,7 @@ class Ne {
|
|
|
2421
2636
|
), this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2422
2637
|
}
|
|
2423
2638
|
}
|
|
2424
|
-
const
|
|
2639
|
+
const Xe = 50, Ye = 0.5, Ve = 20, Je = 0.3, Ke = 150, Ze = 30, at = class at {
|
|
2425
2640
|
constructor(t, i) {
|
|
2426
2641
|
this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = i, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
|
|
2427
2642
|
}
|
|
@@ -2468,11 +2683,11 @@ const je = 50, We = 0.5, ke = 20, Ge = 0.3, qe = 150, Xe = 30, at = class at {
|
|
|
2468
2683
|
const i = t.touches[0], e = i.clientX - this.touchState.startX, n = i.clientY - this.touchState.startY;
|
|
2469
2684
|
if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + n * n) > 10) {
|
|
2470
2685
|
const s = Math.atan2(Math.abs(n), Math.abs(e)) * (180 / Math.PI);
|
|
2471
|
-
this.touchState.isHorizontalSwipe = s <=
|
|
2686
|
+
this.touchState.isHorizontalSwipe = s <= Ze;
|
|
2472
2687
|
}
|
|
2473
2688
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2474
2689
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
|
|
2475
|
-
const a = e *
|
|
2690
|
+
const a = e * Je;
|
|
2476
2691
|
this.callbacks.onDragOffset(a);
|
|
2477
2692
|
}
|
|
2478
2693
|
}
|
|
@@ -2481,7 +2696,7 @@ const je = 50, We = 0.5, ke = 20, Ge = 0.3, qe = 150, Xe = 30, at = class at {
|
|
|
2481
2696
|
this.recentTouchTimestamp = Date.now();
|
|
2482
2697
|
const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, n = Math.abs(i) / e, a = Math.abs(i);
|
|
2483
2698
|
let r = !1;
|
|
2484
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >=
|
|
2699
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Xe || n >= Ye && a >= Ve) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2485
2700
|
}
|
|
2486
2701
|
handleTouchCancel(t) {
|
|
2487
2702
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
@@ -2489,7 +2704,7 @@ const je = 50, We = 0.5, ke = 20, Ge = 0.3, qe = 150, Xe = 30, at = class at {
|
|
|
2489
2704
|
};
|
|
2490
2705
|
at.TOUCH_CLICK_DELAY = 300;
|
|
2491
2706
|
let bt = at;
|
|
2492
|
-
class
|
|
2707
|
+
class Qe {
|
|
2493
2708
|
constructor(t) {
|
|
2494
2709
|
if (this._prepared = !1, this._discoveredUrls = [], this.apiKey = t.apiKey ?? "", this.apiEndpoint = t.apiEndpoint ?? "https://www.googleapis.com/drive/v3/files", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
|
|
2495
2710
|
throw new Error("GoogleDriveLoader requires at least one source to be configured");
|
|
@@ -2710,7 +2925,7 @@ class Ye {
|
|
|
2710
2925
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2711
2926
|
}
|
|
2712
2927
|
}
|
|
2713
|
-
class
|
|
2928
|
+
class ti {
|
|
2714
2929
|
constructor(t) {
|
|
2715
2930
|
if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
|
|
2716
2931
|
throw new Error("StaticImageLoader requires at least one source to be configured");
|
|
@@ -2890,7 +3105,7 @@ class Be {
|
|
|
2890
3105
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2891
3106
|
}
|
|
2892
3107
|
}
|
|
2893
|
-
class
|
|
3108
|
+
class ei {
|
|
2894
3109
|
constructor(t) {
|
|
2895
3110
|
if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
|
|
2896
3111
|
throw new Error("CompositeLoader requires at least one loader to be configured");
|
|
@@ -2947,7 +3162,7 @@ class Ve {
|
|
|
2947
3162
|
this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
|
|
2948
3163
|
}
|
|
2949
3164
|
}
|
|
2950
|
-
class
|
|
3165
|
+
class ii {
|
|
2951
3166
|
/**
|
|
2952
3167
|
* Create a new ImageFilter
|
|
2953
3168
|
* @param extensions - Array of allowed file extensions (without dots)
|
|
@@ -2984,7 +3199,7 @@ class Je {
|
|
|
2984
3199
|
// isAllowedDate(date: Date): boolean
|
|
2985
3200
|
// isAllowedDimensions(width: number, height: number): boolean
|
|
2986
3201
|
}
|
|
2987
|
-
const
|
|
3202
|
+
const ni = `
|
|
2988
3203
|
.fbn-ic-gallery {
|
|
2989
3204
|
position: relative;
|
|
2990
3205
|
width: 100%;
|
|
@@ -3034,31 +3249,38 @@ const Ke = `
|
|
|
3034
3249
|
display: none !important;
|
|
3035
3250
|
}
|
|
3036
3251
|
`;
|
|
3037
|
-
function
|
|
3252
|
+
function oi() {
|
|
3038
3253
|
if (typeof document > "u") return;
|
|
3039
3254
|
const o = "fbn-ic-functional-styles";
|
|
3040
3255
|
if (document.getElementById(o)) return;
|
|
3041
3256
|
const t = document.createElement("style");
|
|
3042
|
-
t.id = o, t.textContent =
|
|
3257
|
+
t.id = o, t.textContent = ni, document.head.appendChild(t);
|
|
3043
3258
|
}
|
|
3044
|
-
let
|
|
3259
|
+
let si = class {
|
|
3045
3260
|
constructor(t = {}) {
|
|
3046
|
-
this.fullConfig =
|
|
3261
|
+
this.fullConfig = oe(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.animationEngine = new ce(this.fullConfig.animation), this.layoutEngine = new Ue({
|
|
3047
3262
|
layout: this.fullConfig.layout,
|
|
3048
3263
|
image: this.fullConfig.image
|
|
3049
|
-
}), this.zoomEngine = new
|
|
3264
|
+
}), this.zoomEngine = new Be(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = et(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
|
|
3050
3265
|
const i = this.fullConfig.animation.entry || E.animation.entry;
|
|
3051
|
-
this.entryAnimationEngine = new
|
|
3266
|
+
this.entryAnimationEngine = new ve(
|
|
3052
3267
|
i,
|
|
3053
3268
|
this.fullConfig.layout.algorithm
|
|
3054
|
-
)
|
|
3269
|
+
);
|
|
3270
|
+
const e = this.fullConfig.animation.idle;
|
|
3271
|
+
e && e.type !== "none" ? this.idleAnimationEngine = new we(
|
|
3272
|
+
e,
|
|
3273
|
+
i.timing?.duration ?? 600
|
|
3274
|
+
) : this.idleAnimationEngine = null, this.zoomEngine.setOnUnfocusCompleteCallback((n) => {
|
|
3275
|
+
this.idleAnimationEngine?.resumeForImage(n);
|
|
3276
|
+
}), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
3055
3277
|
}
|
|
3056
3278
|
/**
|
|
3057
3279
|
* Create image filter based on shared loader config
|
|
3058
3280
|
*/
|
|
3059
3281
|
createImageFilter() {
|
|
3060
3282
|
const t = this.fullConfig.config.loaders?.allowedExtensions;
|
|
3061
|
-
return new
|
|
3283
|
+
return new ii(t);
|
|
3062
3284
|
}
|
|
3063
3285
|
/**
|
|
3064
3286
|
* Create appropriate image loader based on config
|
|
@@ -3069,7 +3291,7 @@ let Qe = class {
|
|
|
3069
3291
|
if (!t || t.length === 0)
|
|
3070
3292
|
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
|
|
3071
3293
|
const e = t.map((n) => this.createLoaderFromEntry(n, i));
|
|
3072
|
-
return e.length === 1 ? e[0] : new
|
|
3294
|
+
return e.length === 1 ? e[0] : new ei({
|
|
3073
3295
|
loaders: e,
|
|
3074
3296
|
debugLogging: this.fullConfig.config.debug?.loaders
|
|
3075
3297
|
});
|
|
@@ -3087,14 +3309,14 @@ let Qe = class {
|
|
|
3087
3309
|
allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
|
|
3088
3310
|
debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
3089
3311
|
};
|
|
3090
|
-
return new
|
|
3312
|
+
return new ti(n);
|
|
3091
3313
|
} else if ("googleDrive" in t) {
|
|
3092
3314
|
const e = t.googleDrive, n = {
|
|
3093
3315
|
...e,
|
|
3094
3316
|
allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
|
|
3095
3317
|
debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
3096
3318
|
};
|
|
3097
|
-
return new
|
|
3319
|
+
return new Qe(n);
|
|
3098
3320
|
} else
|
|
3099
3321
|
throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
|
|
3100
3322
|
}
|
|
@@ -3103,7 +3325,7 @@ let Qe = class {
|
|
|
3103
3325
|
*/
|
|
3104
3326
|
async init() {
|
|
3105
3327
|
try {
|
|
3106
|
-
if (
|
|
3328
|
+
if (oi(), this.containerRef)
|
|
3107
3329
|
this.containerEl = this.containerRef;
|
|
3108
3330
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
3109
3331
|
throw new Error(`Container #${this.containerId} not found`);
|
|
@@ -3112,7 +3334,7 @@ let Qe = class {
|
|
|
3112
3334
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3113
3335
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
3114
3336
|
onDragEnd: (t) => {
|
|
3115
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
3337
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ke);
|
|
3116
3338
|
}
|
|
3117
3339
|
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3118
3340
|
} catch (t) {
|
|
@@ -3243,7 +3465,7 @@ let Qe = class {
|
|
|
3243
3465
|
x: parseFloat(l.dataset.endX),
|
|
3244
3466
|
y: parseFloat(l.dataset.endY)
|
|
3245
3467
|
}, b = parseFloat(l.dataset.imageWidth), p = parseFloat(l.dataset.imageHeight), g = parseFloat(l.dataset.rotation), m = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : g, w = l.dataset.startScale ? parseFloat(l.dataset.startScale) : m, v = this.entryAnimationEngine.getTiming();
|
|
3246
|
-
|
|
3468
|
+
pe({
|
|
3247
3469
|
element: l,
|
|
3248
3470
|
startPosition: d,
|
|
3249
3471
|
endPosition: f,
|
|
@@ -3276,6 +3498,10 @@ let Qe = class {
|
|
|
3276
3498
|
pathType: this.entryAnimationEngine.getPathType()
|
|
3277
3499
|
});
|
|
3278
3500
|
}
|
|
3501
|
+
if (this.idleAnimationEngine) {
|
|
3502
|
+
const d = this.entryAnimationEngine.getTiming().duration;
|
|
3503
|
+
this.idleAnimationEngine.register(l, h, this.imageElements.length, d);
|
|
3504
|
+
}
|
|
3279
3505
|
}), r++);
|
|
3280
3506
|
}, c = () => {
|
|
3281
3507
|
if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
|
|
@@ -3313,7 +3539,7 @@ let Qe = class {
|
|
|
3313
3539
|
h.style.left = `${d - 6}px`, h.style.top = `${f - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(h);
|
|
3314
3540
|
})), t.forEach((l, u) => {
|
|
3315
3541
|
const h = document.createElement("img");
|
|
3316
|
-
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
|
|
3542
|
+
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.disableDragging && (h.draggable = !1), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
|
|
3317
3543
|
const d = a[u];
|
|
3318
3544
|
h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)), st(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
|
|
3319
3545
|
if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
|
|
@@ -3343,7 +3569,7 @@ let Qe = class {
|
|
|
3343
3569
|
d.scale,
|
|
3344
3570
|
b,
|
|
3345
3571
|
i
|
|
3346
|
-
),
|
|
3572
|
+
), I = this.entryAnimationEngine.buildStartTransform(
|
|
3347
3573
|
m,
|
|
3348
3574
|
p,
|
|
3349
3575
|
d.rotation,
|
|
@@ -3361,7 +3587,7 @@ let Qe = class {
|
|
|
3361
3587
|
finalTransform: v,
|
|
3362
3588
|
renderedWidth: b,
|
|
3363
3589
|
renderedHeight: i
|
|
3364
|
-
}), h.style.transform =
|
|
3590
|
+
}), h.style.transform = I, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || w !== d.scale) && (h.dataset.startX = String(m.x), h.dataset.startY = String(m.y), h.dataset.endX = String(p.x), h.dataset.endY = String(p.y), h.dataset.imageWidth = String(b), h.dataset.imageHeight = String(i), h.dataset.rotation = String(d.rotation), h.dataset.scale = String(d.scale), h.dataset.startRotation = String(y), h.dataset.startScale = String(w)), this.displayQueue.push(h);
|
|
3365
3591
|
}, h.onerror = () => r++, h.src = l;
|
|
3366
3592
|
});
|
|
3367
3593
|
}
|
|
@@ -3374,6 +3600,7 @@ let Qe = class {
|
|
|
3374
3600
|
if (e)
|
|
3375
3601
|
await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter();
|
|
3376
3602
|
else {
|
|
3603
|
+
this.idleAnimationEngine?.pauseForImage(t);
|
|
3377
3604
|
const a = t.dataset.imageId;
|
|
3378
3605
|
this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, n, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
|
|
3379
3606
|
}
|
|
@@ -3382,7 +3609,7 @@ let Qe = class {
|
|
|
3382
3609
|
* Clear the image cloud and reset state
|
|
3383
3610
|
*/
|
|
3384
3611
|
clearImageCloud() {
|
|
3385
|
-
this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null), this.loadGeneration++, this.displayQueue = [], this.containerEl && this.containerEl.querySelectorAll(".fbn-ic-image, .fbn-ic-debug-center").forEach((t) => t.remove()), this.imageElements = [], this.imageLayouts = [], this.currentFocusIndex = null, this.hoveredImage = null, this.layoutEngine.reset(), this.zoomEngine.reset(), this.imagesLoaded = !1;
|
|
3612
|
+
this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null), this.loadGeneration++, this.displayQueue = [], this.containerEl && this.containerEl.querySelectorAll(".fbn-ic-image, .fbn-ic-debug-center").forEach((t) => t.remove()), this.imageElements = [], this.imageLayouts = [], this.currentFocusIndex = null, this.hoveredImage = null, this.layoutEngine.reset(), this.zoomEngine.reset(), this.idleAnimationEngine?.stopAll(), this.imagesLoaded = !1;
|
|
3386
3613
|
}
|
|
3387
3614
|
showLoading(t) {
|
|
3388
3615
|
!this.fullConfig.rendering.ui.showLoadingSpinner || !this.loadingEl || (t ? this.loadingEl.classList.remove("fbn-ic-hidden") : this.loadingEl.classList.add("fbn-ic-hidden"));
|
|
@@ -3403,10 +3630,10 @@ let Qe = class {
|
|
|
3403
3630
|
* Destroy the gallery and clean up resources
|
|
3404
3631
|
*/
|
|
3405
3632
|
destroy() {
|
|
3406
|
-
this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy();
|
|
3633
|
+
this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy(), this.idleAnimationEngine?.stopAll(), this.idleAnimationEngine = null;
|
|
3407
3634
|
}
|
|
3408
3635
|
};
|
|
3409
|
-
const
|
|
3636
|
+
const ci = Ht({
|
|
3410
3637
|
name: "ImageCloud",
|
|
3411
3638
|
props: {
|
|
3412
3639
|
options: {
|
|
@@ -3415,11 +3642,11 @@ const ii = Ut({
|
|
|
3415
3642
|
}
|
|
3416
3643
|
},
|
|
3417
3644
|
setup(o, { expose: t }) {
|
|
3418
|
-
const i =
|
|
3645
|
+
const i = It(null), e = It(null);
|
|
3419
3646
|
function n() {
|
|
3420
3647
|
if (!i.value) return;
|
|
3421
3648
|
e.value?.destroy();
|
|
3422
|
-
const a = new
|
|
3649
|
+
const a = new si({
|
|
3423
3650
|
container: i.value,
|
|
3424
3651
|
...o.options
|
|
3425
3652
|
});
|
|
@@ -3427,7 +3654,7 @@ const ii = Ut({
|
|
|
3427
3654
|
console.error("ImageCloud init failed:", r);
|
|
3428
3655
|
});
|
|
3429
3656
|
}
|
|
3430
|
-
return
|
|
3657
|
+
return kt(() => {
|
|
3431
3658
|
n();
|
|
3432
3659
|
}), Nt(() => {
|
|
3433
3660
|
e.value?.destroy(), e.value = null;
|
|
@@ -3443,6 +3670,6 @@ const ii = Ut({
|
|
|
3443
3670
|
}
|
|
3444
3671
|
});
|
|
3445
3672
|
export {
|
|
3446
|
-
|
|
3673
|
+
ci as ImageCloud
|
|
3447
3674
|
};
|
|
3448
3675
|
//# sourceMappingURL=vue.js.map
|