@frybynite/image-cloud 0.4.2 → 0.5.2
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/ImageCloud.d.ts +99 -0
- package/dist/ImageCloud.d.ts.map +1 -0
- package/dist/config/adapter.d.ts +50 -0
- package/dist/config/adapter.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +118 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/types.d.ts +599 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/engines/AnimationEngine.d.ts +82 -0
- package/dist/engines/AnimationEngine.d.ts.map +1 -0
- package/dist/engines/EntryAnimationEngine.d.ts +161 -0
- package/dist/engines/EntryAnimationEngine.d.ts.map +1 -0
- package/dist/engines/LayoutEngine.d.ts +68 -0
- package/dist/engines/LayoutEngine.d.ts.map +1 -0
- package/dist/engines/PathAnimator.d.ts +50 -0
- package/dist/engines/PathAnimator.d.ts.map +1 -0
- package/dist/engines/SwipeEngine.d.ts +53 -0
- package/dist/engines/SwipeEngine.d.ts.map +1 -0
- package/dist/engines/ZoomEngine.d.ts +139 -0
- package/dist/engines/ZoomEngine.d.ts.map +1 -0
- package/dist/image-cloud-auto-init.d.ts +14 -0
- package/dist/image-cloud-auto-init.d.ts.map +1 -0
- package/dist/image-cloud-auto-init.js +215 -244
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +235 -264
- 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 +23 -1637
- package/dist/index.d.ts.map +1 -0
- package/dist/layouts/ClusterPlacementLayout.d.ts +40 -0
- package/dist/layouts/ClusterPlacementLayout.d.ts.map +1 -0
- package/dist/layouts/GridPlacementLayout.d.ts +27 -0
- package/dist/layouts/GridPlacementLayout.d.ts.map +1 -0
- package/dist/layouts/RadialPlacementLayout.d.ts +33 -0
- package/dist/layouts/RadialPlacementLayout.d.ts.map +1 -0
- package/dist/layouts/RandomPlacementLayout.d.ts +26 -0
- package/dist/layouts/RandomPlacementLayout.d.ts.map +1 -0
- package/dist/layouts/SpiralPlacementLayout.d.ts +43 -0
- package/dist/layouts/SpiralPlacementLayout.d.ts.map +1 -0
- package/dist/layouts/WavePlacementLayout.d.ts +48 -0
- package/dist/layouts/WavePlacementLayout.d.ts.map +1 -0
- package/dist/loaders/CompositeLoader.d.ts +37 -0
- package/dist/loaders/CompositeLoader.d.ts.map +1 -0
- package/dist/loaders/GoogleDriveLoader.d.ts +90 -0
- package/dist/loaders/GoogleDriveLoader.d.ts.map +1 -0
- package/dist/loaders/ImageFilter.d.ts +26 -0
- package/dist/loaders/ImageFilter.d.ts.map +1 -0
- package/dist/loaders/StaticImageLoader.d.ts +85 -0
- package/dist/loaders/StaticImageLoader.d.ts.map +1 -0
- package/dist/react/index.d.ts +16 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +3227 -0
- package/dist/react.js.map +1 -0
- package/dist/styles/functionalStyles.d.ts +11 -0
- package/dist/styles/functionalStyles.d.ts.map +1 -0
- package/dist/utils/styleUtils.d.ts +54 -0
- package/dist/utils/styleUtils.d.ts.map +1 -0
- package/dist/vue/index.d.ts +18 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +3241 -0
- package/dist/vue.js.map +1 -0
- package/dist/web-component/index.d.ts +15 -0
- package/dist/web-component/index.d.ts.map +1 -0
- package/dist/web-component.d.ts +1 -0
- package/dist/web-component.js +3265 -0
- package/dist/web-component.js.map +1 -0
- package/package.json +38 -4
package/dist/image-cloud.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const mt = Object.freeze({
|
|
2
2
|
none: "none",
|
|
3
3
|
sm: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4
4
|
md: "0 4px 16px rgba(0,0,0,0.4)",
|
|
@@ -13,7 +13,7 @@ const ft = Object.freeze({
|
|
|
13
13
|
bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
|
|
14
14
|
wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
|
|
15
15
|
snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
|
|
16
|
-
}),
|
|
16
|
+
}), St = Object.freeze({
|
|
17
17
|
gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
|
|
18
18
|
playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
|
|
19
19
|
serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
|
|
@@ -24,7 +24,7 @@ const ft = Object.freeze({
|
|
|
24
24
|
mode: "none"
|
|
25
25
|
}), yt = Object.freeze({
|
|
26
26
|
mode: "none"
|
|
27
|
-
}),
|
|
27
|
+
}), At = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
30
30
|
width: 0,
|
|
@@ -77,7 +77,7 @@ const ft = Object.freeze({
|
|
|
77
77
|
min: -15,
|
|
78
78
|
max: 15
|
|
79
79
|
})
|
|
80
|
-
}),
|
|
80
|
+
}), Tt = Object.freeze({
|
|
81
81
|
sizing: $t,
|
|
82
82
|
rotation: Ut
|
|
83
83
|
}), Ct = Object.freeze({
|
|
@@ -85,7 +85,7 @@ const ft = Object.freeze({
|
|
|
85
85
|
validationTimeout: 5e3,
|
|
86
86
|
validationMethod: "head",
|
|
87
87
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
|
|
88
|
-
}),
|
|
88
|
+
}), Rt = Object.freeze({
|
|
89
89
|
enabled: !1,
|
|
90
90
|
centers: !1,
|
|
91
91
|
loaders: !1
|
|
@@ -95,10 +95,10 @@ const ft = Object.freeze({
|
|
|
95
95
|
// Shared loader settings and debug config
|
|
96
96
|
config: Object.freeze({
|
|
97
97
|
loaders: Ct,
|
|
98
|
-
debug:
|
|
98
|
+
debug: Rt
|
|
99
99
|
}),
|
|
100
100
|
// Image sizing and rotation configuration
|
|
101
|
-
image:
|
|
101
|
+
image: Tt,
|
|
102
102
|
// Pattern-based layout configuration
|
|
103
103
|
layout: Object.freeze({
|
|
104
104
|
algorithm: "radial",
|
|
@@ -219,7 +219,7 @@ const ft = Object.freeze({
|
|
|
219
219
|
})
|
|
220
220
|
}),
|
|
221
221
|
// Image styling
|
|
222
|
-
styling:
|
|
222
|
+
styling: At
|
|
223
223
|
});
|
|
224
224
|
function Z(n, t) {
|
|
225
225
|
if (!n) return t || {};
|
|
@@ -307,12 +307,12 @@ function jt(n = {}) {
|
|
|
307
307
|
}, a = {
|
|
308
308
|
loaders: o,
|
|
309
309
|
config: r,
|
|
310
|
-
image: _t(
|
|
310
|
+
image: _t(Tt, i),
|
|
311
311
|
layout: { ...y.layout },
|
|
312
312
|
animation: { ...y.animation },
|
|
313
313
|
interaction: { ...y.interaction },
|
|
314
314
|
rendering: { ...y.rendering },
|
|
315
|
-
styling: Pt(
|
|
315
|
+
styling: Pt(At, n.styling)
|
|
316
316
|
};
|
|
317
317
|
return n.layout && (a.layout = {
|
|
318
318
|
...y.layout,
|
|
@@ -375,7 +375,7 @@ function jt(n = {}) {
|
|
|
375
375
|
...y.rendering.performance,
|
|
376
376
|
...n.rendering.performance
|
|
377
377
|
})), a.config.debug = {
|
|
378
|
-
...
|
|
378
|
+
...Rt,
|
|
379
379
|
...n.config?.debug ?? {}
|
|
380
380
|
}, a;
|
|
381
381
|
}
|
|
@@ -386,7 +386,7 @@ function Wt(n, t) {
|
|
|
386
386
|
return { ...n ? xt[n] : xt.gentle, ...t };
|
|
387
387
|
}
|
|
388
388
|
function Gt(n, t) {
|
|
389
|
-
return { ...n ?
|
|
389
|
+
return { ...n ? St[n] : St.gentle, ...t };
|
|
390
390
|
}
|
|
391
391
|
class qt {
|
|
392
392
|
constructor(t) {
|
|
@@ -549,22 +549,22 @@ function V(n, t, e) {
|
|
|
549
549
|
}
|
|
550
550
|
function Yt(n, t, e, i) {
|
|
551
551
|
const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = Xt(s, r);
|
|
552
|
-
let u = 0, l = 0, d = 1,
|
|
552
|
+
let u = 0, l = 0, d = 1, m = o, b = !1;
|
|
553
553
|
for (let g = 0; g < c.length; g++)
|
|
554
554
|
if (n <= c[g].time) {
|
|
555
|
-
l = g === 0 ? 0 : c[g - 1].time, d = c[g].time,
|
|
555
|
+
l = g === 0 ? 0 : c[g - 1].time, d = c[g].time, m = c[g].overshoot, b = c[g].isOvershoot;
|
|
556
556
|
break;
|
|
557
557
|
}
|
|
558
558
|
const p = (n - l) / (d - l);
|
|
559
559
|
if (b)
|
|
560
|
-
u = 1 +
|
|
560
|
+
u = 1 + m * ot(p);
|
|
561
561
|
else if (l === 0)
|
|
562
562
|
u = ot(p);
|
|
563
563
|
else {
|
|
564
|
-
const
|
|
565
|
-
(
|
|
566
|
-
)?.overshoot ||
|
|
567
|
-
u = V(
|
|
564
|
+
const f = 1 + (c.find(
|
|
565
|
+
(S, v) => S.time > l && v > 0 && c[v - 1].isOvershoot
|
|
566
|
+
)?.overshoot || m);
|
|
567
|
+
u = V(f, 1, ot(p));
|
|
568
568
|
}
|
|
569
569
|
return {
|
|
570
570
|
x: t.x + a * u,
|
|
@@ -585,7 +585,7 @@ function Bt(n, t, e, i) {
|
|
|
585
585
|
const { stiffness: o, damping: s, mass: r, oscillations: a } = i, h = e.x - t.x, c = e.y - t.y, u = Math.sqrt(o / r), l = s / (2 * Math.sqrt(o * r));
|
|
586
586
|
let d;
|
|
587
587
|
if (l < 1) {
|
|
588
|
-
const
|
|
588
|
+
const m = u * Math.sqrt(1 - l * l), b = Math.exp(-l * u * n * 3), p = Math.cos(m * n * a * Math.PI);
|
|
589
589
|
d = 1 - b * p;
|
|
590
590
|
} else
|
|
591
591
|
d = 1 - Math.exp(-u * n * 3);
|
|
@@ -595,10 +595,10 @@ function Bt(n, t, e, i) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
function Jt(n, t, e, i) {
|
|
598
|
-
const { amplitude: o, frequency: s, decay: r, decayRate: a, phase: h } = i, c = e.x - t.x, u = e.y - t.y, l = Math.sqrt(c * c + u * u), d = l > 0 ? -u / l : 0,
|
|
598
|
+
const { amplitude: o, frequency: s, decay: r, decayRate: a, phase: h } = i, c = e.x - t.x, u = e.y - t.y, l = Math.sqrt(c * c + u * u), d = l > 0 ? -u / l : 0, m = l > 0 ? c / l : 1, b = s * Math.PI * 2 * n + h, p = r ? Math.pow(1 - n, a) : 1, g = o * Math.sin(b) * p, f = Vt(n);
|
|
599
599
|
return {
|
|
600
|
-
x: V(t.x, e.x,
|
|
601
|
-
y: V(t.y, e.y,
|
|
600
|
+
x: V(t.x, e.x, f) + g * d,
|
|
601
|
+
y: V(t.y, e.y, f) + g * m
|
|
602
602
|
};
|
|
603
603
|
}
|
|
604
604
|
function ot(n) {
|
|
@@ -618,14 +618,14 @@ function Zt(n, t, e) {
|
|
|
618
618
|
const a = 0.5, c = 0.5 / (o * 2);
|
|
619
619
|
let u = 0.5;
|
|
620
620
|
for (let d = 0; d < o; d++) {
|
|
621
|
-
const
|
|
622
|
-
u += c, s.push({ time: u, scale:
|
|
621
|
+
const m = 1 - (r - 1) * a;
|
|
622
|
+
u += c, s.push({ time: u, scale: m }), r = 1 + (r - 1) * a * a, u += c, d < o - 1 && s.push({ time: u, scale: r });
|
|
623
623
|
}
|
|
624
624
|
s.push({ time: 1, scale: 1 });
|
|
625
625
|
let l = 1;
|
|
626
626
|
for (let d = 0; d < s.length; d++)
|
|
627
627
|
if (n <= s[d].time) {
|
|
628
|
-
const
|
|
628
|
+
const m = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (n - m) / (s[d].time - m), g = ot(p);
|
|
629
629
|
l = b + (s[d].scale - b) * g;
|
|
630
630
|
break;
|
|
631
631
|
}
|
|
@@ -645,16 +645,16 @@ function Qt(n) {
|
|
|
645
645
|
onComplete: u,
|
|
646
646
|
rotationConfig: l,
|
|
647
647
|
startRotation: d,
|
|
648
|
-
scaleConfig:
|
|
648
|
+
scaleConfig: m,
|
|
649
649
|
startScale: b
|
|
650
|
-
} = n, p = o.type, g = d !== void 0 && d !== h,
|
|
651
|
-
if ((p === "linear" || p === "arc") && !v && !(w ||
|
|
650
|
+
} = n, p = o.type, g = d !== void 0 && d !== h, f = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, w = b !== void 0 && b !== c, E = m?.mode === "pop", x = m?.pop || { overshoot: 1.2, bounces: 1 };
|
|
651
|
+
if ((p === "linear" || p === "arc") && !v && !(w || E)) {
|
|
652
652
|
u && u();
|
|
653
653
|
return;
|
|
654
654
|
}
|
|
655
|
-
const
|
|
655
|
+
const L = performance.now(), z = -r / 2, P = -a / 2;
|
|
656
656
|
function _(Y) {
|
|
657
|
-
const N = Y -
|
|
657
|
+
const N = Y - L, T = Math.min(N / s, 1);
|
|
658
658
|
let D;
|
|
659
659
|
switch (p) {
|
|
660
660
|
case "bounce": {
|
|
@@ -662,7 +662,7 @@ function Qt(n) {
|
|
|
662
662
|
o.bouncePreset,
|
|
663
663
|
o.bounce
|
|
664
664
|
);
|
|
665
|
-
D = Yt(
|
|
665
|
+
D = Yt(T, e, i, O);
|
|
666
666
|
break;
|
|
667
667
|
}
|
|
668
668
|
case "elastic": {
|
|
@@ -670,7 +670,7 @@ function Qt(n) {
|
|
|
670
670
|
o.elasticPreset,
|
|
671
671
|
o.elastic
|
|
672
672
|
);
|
|
673
|
-
D = Bt(
|
|
673
|
+
D = Bt(T, e, i, O);
|
|
674
674
|
break;
|
|
675
675
|
}
|
|
676
676
|
case "wave": {
|
|
@@ -678,20 +678,20 @@ function Qt(n) {
|
|
|
678
678
|
o.wavePreset,
|
|
679
679
|
o.wave
|
|
680
680
|
);
|
|
681
|
-
D = Jt(
|
|
681
|
+
D = Jt(T, e, i, O);
|
|
682
682
|
break;
|
|
683
683
|
}
|
|
684
684
|
default:
|
|
685
685
|
D = {
|
|
686
|
-
x: V(e.x, i.x,
|
|
687
|
-
y: V(e.y, i.y,
|
|
686
|
+
x: V(e.x, i.x, T),
|
|
687
|
+
y: V(e.y, i.y, T)
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
690
|
const k = D.x - i.x, H = D.y - i.y;
|
|
691
|
-
let
|
|
692
|
-
|
|
691
|
+
let R;
|
|
692
|
+
f ? R = Kt(T, h, S) : g ? R = V(d, h, T) : R = h;
|
|
693
693
|
let C;
|
|
694
|
-
|
|
694
|
+
E ? C = Zt(T, c, x) : w ? C = V(b, c, T) : C = c, t.style.transform = `translate(${z}px, ${P}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${P}px) rotate(${h}deg) scale(${c})`, u && u());
|
|
695
695
|
}
|
|
696
696
|
requestAnimationFrame(_);
|
|
697
697
|
}
|
|
@@ -753,8 +753,8 @@ class ie {
|
|
|
753
753
|
*/
|
|
754
754
|
calculateNearestEdge(t, e, i, o) {
|
|
755
755
|
const s = t.x, r = t.y, a = s, h = i.width - s, c = r, u = i.height - r, l = Math.min(a, h, c, u);
|
|
756
|
-
let d = t.x,
|
|
757
|
-
return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ?
|
|
756
|
+
let d = t.x, m = t.y;
|
|
757
|
+
return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ? m = -(e.height + o) : m = i.height + o, { x: d, y: m };
|
|
758
758
|
}
|
|
759
759
|
/**
|
|
760
760
|
* Calculate start position from a specific edge
|
|
@@ -812,8 +812,8 @@ class ie {
|
|
|
812
812
|
h = typeof c == "number" ? c : 500;
|
|
813
813
|
let u;
|
|
814
814
|
a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
|
|
815
|
-
const l = i.width / 2, d = i.height / 2,
|
|
816
|
-
return { x:
|
|
815
|
+
const l = i.width / 2, d = i.height / 2, m = l + Math.cos(u) * h, b = d + Math.sin(u) * h;
|
|
816
|
+
return { x: m, y: b };
|
|
817
817
|
}
|
|
818
818
|
/**
|
|
819
819
|
* Get animation parameters for an image
|
|
@@ -833,7 +833,7 @@ class ie {
|
|
|
833
833
|
* Uses pixel-based centering offset for reliable cross-browser behavior
|
|
834
834
|
*/
|
|
835
835
|
buildStartTransform(t, e, i, o, s, r, a, h) {
|
|
836
|
-
const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o,
|
|
836
|
+
const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o, m = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${m}px, ${b}px)` : "translate(-50%, -50%)";
|
|
837
837
|
return t.useScale ? `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(0)` : `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(${d})`;
|
|
838
838
|
}
|
|
839
839
|
/**
|
|
@@ -1062,12 +1062,12 @@ class ne {
|
|
|
1062
1062
|
* @returns Array of layout objects with position, rotation, scale
|
|
1063
1063
|
*/
|
|
1064
1064
|
generate(t, e, i = {}) {
|
|
1065
|
-
const o = [], { width: s, height: r } = e, a = this.config.spacing.padding, h = i.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1,
|
|
1065
|
+
const o = [], { width: s, height: r } = e, a = this.config.spacing.padding, h = i.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, m = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, S = s - a - g, v = r - a - f, w = a + g, E = a + f;
|
|
1066
1066
|
for (let x = 0; x < t; x++) {
|
|
1067
|
-
const
|
|
1067
|
+
const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0, P = b ? this.random(d, m) : 1, _ = h * P, Y = {
|
|
1068
1068
|
id: x,
|
|
1069
|
-
x:
|
|
1070
|
-
y:
|
|
1069
|
+
x: A,
|
|
1070
|
+
y: L,
|
|
1071
1071
|
rotation: z,
|
|
1072
1072
|
scale: P,
|
|
1073
1073
|
baseSize: _
|
|
@@ -1098,16 +1098,16 @@ class oe {
|
|
|
1098
1098
|
* @returns Array of layout objects with position, rotation, scale
|
|
1099
1099
|
*/
|
|
1100
1100
|
generate(t, e, i = {}) {
|
|
1101
|
-
const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1,
|
|
1101
|
+
const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, m = l !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = i.fixedHeight ?? a, g = s / 2, f = r / 2, S = Math.ceil(Math.sqrt(t));
|
|
1102
1102
|
if (t > 0) {
|
|
1103
|
-
const
|
|
1103
|
+
const E = m ? this.random(l, d) : 1, x = p * E;
|
|
1104
1104
|
o.push({
|
|
1105
1105
|
id: 0,
|
|
1106
1106
|
x: g,
|
|
1107
|
-
y:
|
|
1107
|
+
y: f,
|
|
1108
1108
|
rotation: h === "random" ? this.random(c * 0.33, u * 0.33) : 0,
|
|
1109
1109
|
// Less rotation for center
|
|
1110
|
-
scale:
|
|
1110
|
+
scale: E,
|
|
1111
1111
|
baseSize: x,
|
|
1112
1112
|
zIndex: 100
|
|
1113
1113
|
// Center image is highest
|
|
@@ -1115,17 +1115,17 @@ class oe {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
let v = 1, w = 1;
|
|
1117
1117
|
for (; v < t; ) {
|
|
1118
|
-
const
|
|
1118
|
+
const E = w / S, x = b > 0 ? 1 - E * b * 0.5 : 1, A = w * (p * 0.8), L = A * 1.5, z = Math.PI * (3 * (L + A) - Math.sqrt((3 * L + A) * (L + 3 * A))), P = this.estimateWidth(p), _ = Math.floor(z / (P * 0.7));
|
|
1119
1119
|
if (_ === 0) {
|
|
1120
1120
|
w++;
|
|
1121
1121
|
continue;
|
|
1122
1122
|
}
|
|
1123
1123
|
const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
|
|
1124
|
-
for (let
|
|
1125
|
-
const D =
|
|
1126
|
-
let C = g + Math.cos(D) *
|
|
1127
|
-
const $ = this.config.spacing.padding ?? 50, U =
|
|
1128
|
-
C - U < $ ? C = $ + U : C + U > s - $ && (C = s - $ - U), O -
|
|
1124
|
+
for (let T = 0; T < _ && v < t; T++) {
|
|
1125
|
+
const D = T * Y + N, k = m ? this.random(l, d) : 1, H = x * k, R = p * H;
|
|
1126
|
+
let C = g + Math.cos(D) * L, O = f + Math.sin(D) * A;
|
|
1127
|
+
const $ = this.config.spacing.padding ?? 50, U = R * 1.5 / 2, M = R / 2;
|
|
1128
|
+
C - U < $ ? C = $ + U : C + U > s - $ && (C = s - $ - U), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
|
|
1129
1129
|
const W = h === "random" ? this.random(c, u) : 0;
|
|
1130
1130
|
o.push({
|
|
1131
1131
|
id: v,
|
|
@@ -1133,7 +1133,7 @@ class oe {
|
|
|
1133
1133
|
y: O,
|
|
1134
1134
|
rotation: W,
|
|
1135
1135
|
scale: H,
|
|
1136
|
-
baseSize:
|
|
1136
|
+
baseSize: R,
|
|
1137
1137
|
zIndex: Math.max(1, 100 - w)
|
|
1138
1138
|
// Outer rings have lower z-index
|
|
1139
1139
|
}), v++;
|
|
@@ -1171,7 +1171,7 @@ const se = {
|
|
|
1171
1171
|
alignment: "center",
|
|
1172
1172
|
gap: 10,
|
|
1173
1173
|
overflowOffset: 0.25
|
|
1174
|
-
},
|
|
1174
|
+
}, Et = [
|
|
1175
1175
|
{ x: 1, y: 1 },
|
|
1176
1176
|
// bottom-right
|
|
1177
1177
|
{ x: -1, y: -1 },
|
|
@@ -1201,50 +1201,50 @@ class ae {
|
|
|
1201
1201
|
* @returns Array of layout objects with position, rotation, scale
|
|
1202
1202
|
*/
|
|
1203
1203
|
generate(t, e, i = {}) {
|
|
1204
|
-
const o = [], { width: s, height: r } = e, a = { ...se, ...this.config.grid }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1,
|
|
1204
|
+
const o = [], { width: s, height: r } = e, a = { ...se, ...this.config.grid }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, m = l !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: f } = this.calculateGridDimensions(
|
|
1205
1205
|
t,
|
|
1206
1206
|
b,
|
|
1207
1207
|
p,
|
|
1208
1208
|
c,
|
|
1209
1209
|
a
|
|
1210
|
-
),
|
|
1210
|
+
), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ? f + 0.5 : f, x = (b - a.gap * (g - 1)) / w, A = (p - a.gap * (f - 1)) / E, L = S ? x / 2 : 0, z = v ? A / 2 : 0, P = 1 + a.overlap, _ = Math.min(x, A) * P, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = g * x + (g - 1) * a.gap + L, T = f * A + (f - 1) * a.gap + z, D = h + (b - N) / 2, k = h + (p - T) / 2, H = g * f, R = a.columns !== "auto" && a.rows !== "auto", C = R && t > H;
|
|
1211
1211
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1212
1212
|
gridConfigColumns: a.columns,
|
|
1213
1213
|
gridConfigRows: a.rows,
|
|
1214
1214
|
columns: g,
|
|
1215
|
-
rows:
|
|
1215
|
+
rows: f,
|
|
1216
1216
|
cellCount: H,
|
|
1217
|
-
hasFixedGrid:
|
|
1217
|
+
hasFixedGrid: R,
|
|
1218
1218
|
imageCount: t,
|
|
1219
1219
|
isOverflowMode: C
|
|
1220
1220
|
});
|
|
1221
|
-
const O = C ? new Array(H).fill(0) : [], $ = Math.min(x,
|
|
1221
|
+
const O = C ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
|
|
1222
1222
|
for (let F = 0; F < t; F++) {
|
|
1223
|
-
let U,
|
|
1223
|
+
let U, M, W = 0;
|
|
1224
1224
|
if (C && F >= H) {
|
|
1225
1225
|
const q = F - H, j = q % H;
|
|
1226
|
-
W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (U = j % g,
|
|
1226
|
+
W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (U = j % g, M = Math.floor(j / g)) : (M = j % f, U = Math.floor(j / f));
|
|
1227
1227
|
} else
|
|
1228
|
-
a.fillDirection === "row" ? (U = F % g,
|
|
1229
|
-
let G = D + U * (x + a.gap) + x / 2, X = k +
|
|
1230
|
-
if (a.stagger === "row" &&
|
|
1231
|
-
const q = (W - 1) %
|
|
1228
|
+
a.fillDirection === "row" ? (U = F % g, M = Math.floor(F / g)) : (M = F % f, U = Math.floor(F / f));
|
|
1229
|
+
let G = D + U * (x + a.gap) + x / 2, X = k + M * (A + a.gap) + A / 2;
|
|
1230
|
+
if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" && U % 2 === 1 && (X += A / 2), W > 0) {
|
|
1231
|
+
const q = (W - 1) % Et.length, j = Et[q];
|
|
1232
1232
|
G += j.x * $, X += j.y * $;
|
|
1233
1233
|
}
|
|
1234
1234
|
if (a.jitter > 0) {
|
|
1235
|
-
const q = x / 2 * a.jitter, j =
|
|
1235
|
+
const q = x / 2 * a.jitter, j = A / 2 * a.jitter;
|
|
1236
1236
|
G += this.random(-q, q), X += this.random(-j, j);
|
|
1237
1237
|
}
|
|
1238
1238
|
let B = G, J = X;
|
|
1239
1239
|
if (!C && a.fillDirection === "row") {
|
|
1240
1240
|
const q = t % g || g;
|
|
1241
|
-
if (
|
|
1241
|
+
if (M === Math.floor((t - 1) / g) && q < g) {
|
|
1242
1242
|
const vt = q * x + (q - 1) * a.gap;
|
|
1243
1243
|
let gt = 0;
|
|
1244
1244
|
a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
|
-
const rt =
|
|
1247
|
+
const rt = m ? this.random(l, d) : 1, K = Y * rt, it = K * 1.5 / 2, nt = K / 2, lt = h + it, ht = s - h - it, zt = h + nt, Ft = r - h - nt;
|
|
1248
1248
|
B = Math.max(lt, Math.min(B, ht)), J = Math.max(zt, Math.min(J, Ft));
|
|
1249
1249
|
let dt = 0;
|
|
1250
1250
|
if (u === "random") {
|
|
@@ -1308,35 +1308,35 @@ class le {
|
|
|
1308
1308
|
* @returns Array of layout objects with position, rotation, scale
|
|
1309
1309
|
*/
|
|
1310
1310
|
generate(t, e, i = {}) {
|
|
1311
|
-
const o = [], { width: s, height: r } = e, a = { ...ce, ...this.config.spiral }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15,
|
|
1312
|
-
|
|
1313
|
-
|
|
1311
|
+
const o = [], { width: s, height: r } = e, a = { ...ce, ...this.config.spiral }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, m = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, f = s / 2, S = r / 2, v = Math.min(
|
|
1312
|
+
f - h - c / 2,
|
|
1313
|
+
S - h - c / 2
|
|
1314
1314
|
), w = a.direction === "clockwise" ? -1 : 1;
|
|
1315
|
-
for (let
|
|
1316
|
-
let x,
|
|
1315
|
+
for (let E = 0; E < t; E++) {
|
|
1316
|
+
let x, A;
|
|
1317
1317
|
if (a.spiralType === "golden")
|
|
1318
|
-
x =
|
|
1318
|
+
x = E * re * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
|
|
1319
1319
|
else if (a.spiralType === "archimedean") {
|
|
1320
|
-
const G =
|
|
1321
|
-
x = G * w + a.startAngle,
|
|
1320
|
+
const G = E * 0.5 * a.tightness;
|
|
1321
|
+
x = G * w + a.startAngle, A = this.calculateArchimedeanRadius(G, t, v, a.tightness);
|
|
1322
1322
|
} else {
|
|
1323
|
-
const G =
|
|
1324
|
-
x = G * w + a.startAngle,
|
|
1323
|
+
const G = E * 0.3 * a.tightness;
|
|
1324
|
+
x = G * w + a.startAngle, A = this.calculateLogarithmicRadius(G, t, v, a.tightness);
|
|
1325
1325
|
}
|
|
1326
|
-
const
|
|
1327
|
-
let
|
|
1326
|
+
const L = f + Math.cos(x) * A, z = S + Math.sin(x) * A, P = A / v, _ = g > 0 ? 1 - P * g * 0.5 : 1, Y = p ? this.random(m, b) : 1, N = _ * Y, T = c * N, k = T * 1.5 / 2, H = T / 2, R = h + k, C = s - h - k, O = h + H, $ = r - h - H, F = Math.max(R, Math.min(L, C)), U = Math.max(O, Math.min(z, $));
|
|
1327
|
+
let M = 0;
|
|
1328
1328
|
if (u === "random") {
|
|
1329
1329
|
const G = x * 180 / Math.PI % 360, X = this.random(l, d);
|
|
1330
|
-
|
|
1331
|
-
} else u === "tangent" && (
|
|
1332
|
-
const W = t -
|
|
1330
|
+
M = a.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
|
|
1331
|
+
} else u === "tangent" && (M = this.calculateSpiralTangent(x, A, a));
|
|
1332
|
+
const W = t - E;
|
|
1333
1333
|
o.push({
|
|
1334
|
-
id:
|
|
1334
|
+
id: E,
|
|
1335
1335
|
x: F,
|
|
1336
1336
|
y: U,
|
|
1337
|
-
rotation:
|
|
1337
|
+
rotation: M,
|
|
1338
1338
|
scale: N,
|
|
1339
|
-
baseSize:
|
|
1339
|
+
baseSize: T,
|
|
1340
1340
|
zIndex: W
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
|
@@ -1410,46 +1410,46 @@ class de {
|
|
|
1410
1410
|
* @returns Array of layout objects with position, rotation, scale
|
|
1411
1411
|
*/
|
|
1412
1412
|
generate(t, e, i = {}) {
|
|
1413
|
-
const o = [], { width: s, height: r } = e, a = { ...he, ...this.config.cluster }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15,
|
|
1413
|
+
const o = [], { width: s, height: r } = e, a = { ...he, ...this.config.cluster }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, m = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
|
|
1414
1414
|
t,
|
|
1415
1415
|
a.clusterCount,
|
|
1416
1416
|
s,
|
|
1417
1417
|
r,
|
|
1418
1418
|
a.clusterSpacing
|
|
1419
|
-
),
|
|
1419
|
+
), f = this.generateClusterCenters(
|
|
1420
1420
|
g,
|
|
1421
1421
|
s,
|
|
1422
1422
|
r,
|
|
1423
1423
|
h,
|
|
1424
1424
|
a
|
|
1425
|
-
),
|
|
1425
|
+
), S = new Array(g).fill(0);
|
|
1426
1426
|
for (let w = 0; w < t; w++)
|
|
1427
|
-
|
|
1427
|
+
S[w % g]++;
|
|
1428
1428
|
let v = 0;
|
|
1429
1429
|
for (let w = 0; w < g; w++) {
|
|
1430
|
-
const
|
|
1431
|
-
for (let
|
|
1432
|
-
let
|
|
1430
|
+
const E = f[w], x = S[w];
|
|
1431
|
+
for (let A = 0; A < x; A++) {
|
|
1432
|
+
let L, z;
|
|
1433
1433
|
if (a.distribution === "gaussian")
|
|
1434
|
-
|
|
1434
|
+
L = this.gaussianRandom() * E.spread, z = this.gaussianRandom() * E.spread;
|
|
1435
1435
|
else {
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1436
|
+
const M = this.random(0, Math.PI * 2), W = this.random(0, E.spread);
|
|
1437
|
+
L = Math.cos(M) * W, z = Math.sin(M) * W;
|
|
1438
1438
|
}
|
|
1439
1439
|
const P = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
|
|
1440
|
-
|
|
1441
|
-
const Y = p ? this.random(
|
|
1442
|
-
let D =
|
|
1443
|
-
const
|
|
1444
|
-
D = Math.max(h +
|
|
1445
|
-
const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(
|
|
1440
|
+
L /= P, z /= P;
|
|
1441
|
+
const Y = p ? this.random(m, b) : 1, N = _ * Y, T = c * N;
|
|
1442
|
+
let D = E.x + L, k = E.y + z;
|
|
1443
|
+
const R = T * 1.5 / 2, C = T / 2;
|
|
1444
|
+
D = Math.max(h + R, Math.min(D, s - h - R)), k = Math.max(h + C, Math.min(k, r - h - C));
|
|
1445
|
+
const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread, U = Math.round((1 - F) * 50) + 1;
|
|
1446
1446
|
o.push({
|
|
1447
1447
|
id: v,
|
|
1448
1448
|
x: D,
|
|
1449
1449
|
y: k,
|
|
1450
1450
|
rotation: O,
|
|
1451
1451
|
scale: N,
|
|
1452
|
-
baseSize:
|
|
1452
|
+
baseSize: T,
|
|
1453
1453
|
zIndex: U
|
|
1454
1454
|
}), v++;
|
|
1455
1455
|
}
|
|
@@ -1473,22 +1473,22 @@ class de {
|
|
|
1473
1473
|
generateClusterCenters(t, e, i, o, s) {
|
|
1474
1474
|
const r = [], h = o + s.clusterSpread, c = e - o - s.clusterSpread, u = o + s.clusterSpread, l = i - o - s.clusterSpread;
|
|
1475
1475
|
for (let d = 0; d < t; d++) {
|
|
1476
|
-
let
|
|
1476
|
+
let m = null, b = -1;
|
|
1477
1477
|
for (let p = 0; p < 100; p++) {
|
|
1478
1478
|
const g = {
|
|
1479
1479
|
x: this.random(h, c),
|
|
1480
1480
|
y: this.random(u, l),
|
|
1481
1481
|
spread: this.calculateClusterSpread(s)
|
|
1482
1482
|
};
|
|
1483
|
-
let
|
|
1484
|
-
for (const
|
|
1485
|
-
const v = g.x -
|
|
1486
|
-
|
|
1483
|
+
let f = 1 / 0;
|
|
1484
|
+
for (const S of r) {
|
|
1485
|
+
const v = g.x - S.x, w = g.y - S.y, E = Math.sqrt(v * v + w * w);
|
|
1486
|
+
f = Math.min(f, E);
|
|
1487
1487
|
}
|
|
1488
|
-
if ((r.length === 0 ||
|
|
1488
|
+
if ((r.length === 0 || f > b) && (m = g, b = f), f >= s.clusterSpacing)
|
|
1489
1489
|
break;
|
|
1490
1490
|
}
|
|
1491
|
-
|
|
1491
|
+
m && r.push(m);
|
|
1492
1492
|
}
|
|
1493
1493
|
return r;
|
|
1494
1494
|
}
|
|
@@ -1528,29 +1528,29 @@ class ue {
|
|
|
1528
1528
|
* @returns Array of layout objects with position, rotation, scale
|
|
1529
1529
|
*/
|
|
1530
1530
|
generate(t, e, i = {}) {
|
|
1531
|
-
const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1,
|
|
1531
|
+
const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, m = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? a, g = {
|
|
1532
1532
|
...Dt,
|
|
1533
1533
|
...this.config.wave
|
|
1534
|
-
}, { rows:
|
|
1535
|
-
let
|
|
1536
|
-
for (let C = 0; C <
|
|
1537
|
-
const O =
|
|
1534
|
+
}, { rows: f, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / f), z = p * 1.5 / 2, P = h + z, _ = s - h - z, Y = _ - P, N = x > 1 ? Y / (x - 1) : 0, T = h + S + p / 2, D = r - h - S - p / 2, k = D - T, H = f > 1 ? k / (f - 1) : 0;
|
|
1535
|
+
let R = 0;
|
|
1536
|
+
for (let C = 0; C < f && R < t; C++) {
|
|
1537
|
+
const O = f === 1 ? (T + D) / 2 : T + C * H;
|
|
1538
1538
|
let $ = 0;
|
|
1539
|
-
|
|
1540
|
-
for (let F = 0; F < x &&
|
|
1541
|
-
const U = x === 1 ? (P + _) / 2 : P + F * N,
|
|
1539
|
+
E === "offset" ? $ = C * w : E === "alternating" && ($ = C * Math.PI);
|
|
1540
|
+
for (let F = 0; F < x && R < t; F++) {
|
|
1541
|
+
const U = x === 1 ? (P + _) / 2 : P + F * N, M = this.calculateWaveY(U, s, S, v, $), W = U, G = O + M, X = b ? this.random(d, m) : 1, B = p * X;
|
|
1542
1542
|
let J = 0;
|
|
1543
|
-
c === "tangent" ? J = this.calculateRotation(U, s,
|
|
1543
|
+
c === "tangent" ? J = this.calculateRotation(U, s, S, v, $) : c === "random" && (J = this.random(u, l));
|
|
1544
1544
|
const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
|
|
1545
1545
|
o.push({
|
|
1546
|
-
id:
|
|
1546
|
+
id: R,
|
|
1547
1547
|
x: Math.max(it, Math.min(W, nt)),
|
|
1548
1548
|
y: Math.max(lt, Math.min(G, ht)),
|
|
1549
1549
|
rotation: J,
|
|
1550
1550
|
scale: X,
|
|
1551
1551
|
baseSize: B,
|
|
1552
|
-
zIndex:
|
|
1553
|
-
}),
|
|
1552
|
+
zIndex: R + 1
|
|
1553
|
+
}), R++;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
return o;
|
|
@@ -1697,14 +1697,14 @@ class ge {
|
|
|
1697
1697
|
if (r !== void 0)
|
|
1698
1698
|
return { height: r };
|
|
1699
1699
|
const a = s?.minSize ?? 50, h = s?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: l, height: d } = t, p = l * d * c / e;
|
|
1700
|
-
let
|
|
1701
|
-
|
|
1702
|
-
let
|
|
1703
|
-
if (
|
|
1700
|
+
let f = Math.sqrt(p / 1.4);
|
|
1701
|
+
f *= u, f = Math.min(f, i);
|
|
1702
|
+
let S = this.clamp(f, a, h);
|
|
1703
|
+
if (S === a && f < a) {
|
|
1704
1704
|
const v = Math.max(a * 0.05, 20);
|
|
1705
|
-
|
|
1705
|
+
S = Math.max(v, f);
|
|
1706
1706
|
}
|
|
1707
|
-
return { height:
|
|
1707
|
+
return { height: S };
|
|
1708
1708
|
}
|
|
1709
1709
|
/**
|
|
1710
1710
|
* Utility: Clamp a value between min and max
|
|
@@ -1714,11 +1714,11 @@ class ge {
|
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
|
|
1717
|
-
function fe(n) {
|
|
1718
|
-
return n in ft;
|
|
1719
|
-
}
|
|
1720
1717
|
function me(n) {
|
|
1721
|
-
return n
|
|
1718
|
+
return n in mt;
|
|
1719
|
+
}
|
|
1720
|
+
function fe(n) {
|
|
1721
|
+
return n ? me(n) ? mt[n] : n : mt.md;
|
|
1722
1722
|
}
|
|
1723
1723
|
function pe(n) {
|
|
1724
1724
|
if (!n) return "";
|
|
@@ -1749,7 +1749,7 @@ function st(n) {
|
|
|
1749
1749
|
const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
|
|
1750
1750
|
t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
|
|
1751
1751
|
} else n.border && (t.border = Q(n.border));
|
|
1752
|
-
n.shadow !== void 0 && (t.boxShadow =
|
|
1752
|
+
n.shadow !== void 0 && (t.boxShadow = fe(n.shadow));
|
|
1753
1753
|
const o = pe(n.filter);
|
|
1754
1754
|
if (t.filter = o || "none", n.opacity !== void 0 && (t.opacity = String(n.opacity)), n.cursor !== void 0 && (t.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
|
|
1755
1755
|
const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
|
|
@@ -1760,17 +1760,17 @@ function st(n) {
|
|
|
1760
1760
|
function tt(n, t) {
|
|
1761
1761
|
t.borderRadius !== void 0 && (n.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (n.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (n.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (n.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (n.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (n.style.border = t.border), t.borderTop !== void 0 && (n.style.borderTop = t.borderTop), t.borderRight !== void 0 && (n.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (n.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (n.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (n.style.boxShadow = t.boxShadow), t.filter !== void 0 && (n.style.filter = t.filter), t.opacity !== void 0 && (n.style.opacity = t.opacity), t.cursor !== void 0 && (n.style.cursor = t.cursor), t.outline !== void 0 && (n.style.outline = t.outline), t.outlineOffset !== void 0 && (n.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (n.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (n.style.aspectRatio = t.aspectRatio);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function Mt(n) {
|
|
1764
1764
|
return n ? Array.isArray(n) ? n.join(" ") : n : "";
|
|
1765
1765
|
}
|
|
1766
1766
|
function et(n, t) {
|
|
1767
|
-
const e =
|
|
1767
|
+
const e = Mt(t);
|
|
1768
1768
|
e && e.split(" ").forEach((i) => {
|
|
1769
1769
|
i.trim() && n.classList.add(i.trim());
|
|
1770
1770
|
});
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1773
|
-
const e =
|
|
1772
|
+
function Lt(n, t) {
|
|
1773
|
+
const e = Mt(t);
|
|
1774
1774
|
e && e.split(" ").forEach((i) => {
|
|
1775
1775
|
i.trim() && n.classList.remove(i.trim());
|
|
1776
1776
|
});
|
|
@@ -1872,7 +1872,7 @@ class be {
|
|
|
1872
1872
|
* Remove focused styling from an element
|
|
1873
1873
|
*/
|
|
1874
1874
|
removeFocusedStyling(t, e) {
|
|
1875
|
-
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"),
|
|
1875
|
+
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Lt(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
|
|
1876
1876
|
}
|
|
1877
1877
|
/**
|
|
1878
1878
|
* Start focus animation for an image using dimension-based zoom
|
|
@@ -1889,12 +1889,12 @@ class be {
|
|
|
1889
1889
|
rotation: i.rotation,
|
|
1890
1890
|
scale: 1
|
|
1891
1891
|
// No scale - using dimensions
|
|
1892
|
-
}, d = s?.width ?? a,
|
|
1892
|
+
}, d = s?.width ?? a, m = s?.height ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
|
|
1893
1893
|
t,
|
|
1894
1894
|
l,
|
|
1895
1895
|
u,
|
|
1896
1896
|
d,
|
|
1897
|
-
|
|
1897
|
+
m,
|
|
1898
1898
|
c.width,
|
|
1899
1899
|
c.height,
|
|
1900
1900
|
b
|
|
@@ -1947,7 +1947,7 @@ class be {
|
|
|
1947
1947
|
c,
|
|
1948
1948
|
u,
|
|
1949
1949
|
l
|
|
1950
|
-
),
|
|
1950
|
+
), m = {
|
|
1951
1951
|
id: `unfocus-${Date.now()}`,
|
|
1952
1952
|
element: t,
|
|
1953
1953
|
animation: d,
|
|
@@ -1959,12 +1959,33 @@ class be {
|
|
|
1959
1959
|
return {
|
|
1960
1960
|
element: t,
|
|
1961
1961
|
originalState: e,
|
|
1962
|
-
animationHandle:
|
|
1962
|
+
animationHandle: m,
|
|
1963
1963
|
direction: "out",
|
|
1964
1964
|
originalWidth: c,
|
|
1965
1965
|
originalHeight: u
|
|
1966
1966
|
};
|
|
1967
1967
|
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Capture the current visual state of an element mid-animation, BEFORE cancelling.
|
|
1970
|
+
*
|
|
1971
|
+
* The computed matrix.e/f include the -50%/-50% centering offset resolved to pixels.
|
|
1972
|
+
* buildDimensionZoomTransform prepends its own translate(-50%,-50%), so passing raw
|
|
1973
|
+
* matrix.e/f doubles the centering and produces the wrong starting position.
|
|
1974
|
+
*
|
|
1975
|
+
* This method extracts the PURE positional offset (pureX = matrix.e + 0.5*midWidth)
|
|
1976
|
+
* and commits width/height/transform to inline styles before the animation is cancelled,
|
|
1977
|
+
* preventing any visual snap.
|
|
1978
|
+
*
|
|
1979
|
+
* Must be called while the animation is still running (offsetWidth reflects animated size).
|
|
1980
|
+
* Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
|
|
1981
|
+
*/
|
|
1982
|
+
captureMidAnimationState(t) {
|
|
1983
|
+
const e = getComputedStyle(t), i = new DOMMatrix(e.transform), o = t.offsetWidth, s = t.offsetHeight, r = i.e + o * 0.5, a = i.f + s * 0.5, h = Math.atan2(i.b, i.a) * (180 / Math.PI);
|
|
1984
|
+
return t.style.width = `${o}px`, t.style.height = `${s}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${a}px) rotate(${h}deg)`, t.style.transition = "none", {
|
|
1985
|
+
transform: { x: r, y: a, rotation: h, scale: 1 },
|
|
1986
|
+
dimensions: { width: o, height: s }
|
|
1987
|
+
};
|
|
1988
|
+
}
|
|
1968
1989
|
/**
|
|
1969
1990
|
* Handle animation completion
|
|
1970
1991
|
*/
|
|
@@ -1990,21 +2011,12 @@ class be {
|
|
|
1990
2011
|
if (this.currentFocus === t && this.state === I.FOCUSED)
|
|
1991
2012
|
return this.unfocusImage();
|
|
1992
2013
|
if (this.incoming?.element === t && this.state === I.FOCUSING) {
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
y: s.y,
|
|
1996
|
-
rotation: s.rotation,
|
|
1997
|
-
scale: 1
|
|
1998
|
-
// No scale transform - using dimensions
|
|
1999
|
-
}, a = {
|
|
2000
|
-
width: t.offsetWidth,
|
|
2001
|
-
height: t.offsetHeight
|
|
2002
|
-
};
|
|
2003
|
-
this.outgoing = this.startUnfocusAnimation(
|
|
2014
|
+
const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
|
|
2015
|
+
this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
|
|
2004
2016
|
t,
|
|
2005
2017
|
this.incoming.originalState,
|
|
2006
|
-
|
|
2007
|
-
|
|
2018
|
+
s,
|
|
2019
|
+
r
|
|
2008
2020
|
), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
|
|
2009
2021
|
return;
|
|
2010
2022
|
}
|
|
@@ -2046,36 +2058,18 @@ class be {
|
|
|
2046
2058
|
if (this.incoming?.element === t)
|
|
2047
2059
|
return;
|
|
2048
2060
|
if (this.outgoing?.element === t) {
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
scale: 1
|
|
2054
|
-
// No scale - using dimensions
|
|
2055
|
-
}, a = {
|
|
2056
|
-
width: t.offsetWidth,
|
|
2057
|
-
height: t.offsetHeight
|
|
2058
|
-
};
|
|
2059
|
-
if (this.incoming) {
|
|
2060
|
-
const h = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), c = {
|
|
2061
|
-
x: h.x,
|
|
2062
|
-
y: h.y,
|
|
2063
|
-
rotation: h.rotation,
|
|
2064
|
-
scale: 1
|
|
2065
|
-
// No scale - using dimensions
|
|
2066
|
-
}, u = {
|
|
2067
|
-
width: this.incoming.element.offsetWidth,
|
|
2068
|
-
height: this.incoming.element.offsetHeight
|
|
2069
|
-
};
|
|
2070
|
-
this.outgoing = this.startUnfocusAnimation(
|
|
2061
|
+
const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
|
|
2062
|
+
if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
|
|
2063
|
+
const { transform: a, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
|
|
2064
|
+
this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2071
2065
|
this.incoming.element,
|
|
2072
2066
|
this.incoming.originalState,
|
|
2073
|
-
|
|
2074
|
-
|
|
2067
|
+
a,
|
|
2068
|
+
h
|
|
2075
2069
|
);
|
|
2076
2070
|
} else
|
|
2077
2071
|
this.outgoing = null;
|
|
2078
|
-
if (this.incoming = this.startFocusAnimation(t, e, i,
|
|
2072
|
+
if (this.incoming = this.startFocusAnimation(t, e, i, s, r), await Promise.all([
|
|
2079
2073
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2080
2074
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2081
2075
|
]), this.focusGeneration !== o) return;
|
|
@@ -2089,21 +2083,12 @@ class be {
|
|
|
2089
2083
|
this.outgoing.originalWidth,
|
|
2090
2084
|
this.outgoing.originalHeight
|
|
2091
2085
|
), this.outgoing = null), this.incoming) {
|
|
2092
|
-
const s = this.
|
|
2093
|
-
|
|
2094
|
-
y: s.y,
|
|
2095
|
-
rotation: s.rotation,
|
|
2096
|
-
scale: 1
|
|
2097
|
-
// No scale - using dimensions
|
|
2098
|
-
}, a = {
|
|
2099
|
-
width: this.incoming.element.offsetWidth,
|
|
2100
|
-
height: this.incoming.element.offsetHeight
|
|
2101
|
-
};
|
|
2102
|
-
this.outgoing = this.startUnfocusAnimation(
|
|
2086
|
+
const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2087
|
+
this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2103
2088
|
this.incoming.element,
|
|
2104
2089
|
this.incoming.originalState,
|
|
2105
|
-
|
|
2106
|
-
|
|
2090
|
+
s,
|
|
2091
|
+
r
|
|
2107
2092
|
);
|
|
2108
2093
|
}
|
|
2109
2094
|
if (this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
|
|
@@ -2118,50 +2103,36 @@ class be {
|
|
|
2118
2103
|
* Unfocus current image, returning it to original position
|
|
2119
2104
|
*/
|
|
2120
2105
|
async unfocusImage() {
|
|
2106
|
+
if (this.state === I.UNFOCUSING)
|
|
2107
|
+
return;
|
|
2121
2108
|
const t = ++this.focusGeneration;
|
|
2122
2109
|
if (!this.currentFocus || !this.focusData) {
|
|
2123
2110
|
if (this.incoming && this.state === I.FOCUSING) {
|
|
2124
|
-
const s = this.
|
|
2125
|
-
|
|
2126
|
-
y: s.y,
|
|
2127
|
-
rotation: s.rotation,
|
|
2128
|
-
scale: 1
|
|
2129
|
-
// No scale - using dimensions
|
|
2130
|
-
}, a = {
|
|
2131
|
-
width: this.incoming.element.offsetWidth,
|
|
2132
|
-
height: this.incoming.element.offsetHeight
|
|
2133
|
-
};
|
|
2134
|
-
if (this.outgoing = this.startUnfocusAnimation(
|
|
2111
|
+
const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2112
|
+
if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2135
2113
|
this.incoming.element,
|
|
2136
2114
|
this.incoming.originalState,
|
|
2137
|
-
|
|
2138
|
-
|
|
2115
|
+
s,
|
|
2116
|
+
r
|
|
2139
2117
|
), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
|
|
2140
2118
|
this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
|
|
2141
2119
|
}
|
|
2142
2120
|
return;
|
|
2143
2121
|
}
|
|
2144
2122
|
if (this.state === I.CROSS_ANIMATING && this.incoming) {
|
|
2145
|
-
const s = this.
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
rotation: s.rotation,
|
|
2149
|
-
scale: 1
|
|
2150
|
-
// No scale - using dimensions
|
|
2151
|
-
}, a = {
|
|
2152
|
-
width: this.incoming.element.offsetWidth,
|
|
2153
|
-
height: this.incoming.element.offsetHeight
|
|
2154
|
-
}, h = this.startUnfocusAnimation(
|
|
2123
|
+
const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2124
|
+
this.animationEngine.cancelAllAnimations(this.incoming.element);
|
|
2125
|
+
const a = this.startUnfocusAnimation(
|
|
2155
2126
|
this.incoming.element,
|
|
2156
2127
|
this.incoming.originalState,
|
|
2157
|
-
|
|
2158
|
-
|
|
2128
|
+
s,
|
|
2129
|
+
r
|
|
2159
2130
|
);
|
|
2160
2131
|
if (await Promise.all([
|
|
2161
2132
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2162
|
-
this.waitForAnimation(
|
|
2133
|
+
this.waitForAnimation(a.animationHandle)
|
|
2163
2134
|
]), this.focusGeneration !== t) return;
|
|
2164
|
-
this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(
|
|
2135
|
+
this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(a.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
|
|
2165
2136
|
return;
|
|
2166
2137
|
}
|
|
2167
2138
|
this.state = I.UNFOCUSING;
|
|
@@ -2248,7 +2219,7 @@ class be {
|
|
|
2248
2219
|
), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2249
2220
|
}
|
|
2250
2221
|
}
|
|
2251
|
-
const ye = 50, ve = 0.5, we = 20, xe = 0.3,
|
|
2222
|
+
const ye = 50, ve = 0.5, we = 20, xe = 0.3, Se = 150, Ee = 30, at = class at {
|
|
2252
2223
|
constructor(t, e) {
|
|
2253
2224
|
this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = e, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
|
|
2254
2225
|
}
|
|
@@ -2295,7 +2266,7 @@ const ye = 50, ve = 0.5, we = 20, xe = 0.3, Ee = 150, Se = 30, at = class at {
|
|
|
2295
2266
|
const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
|
|
2296
2267
|
if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
|
|
2297
2268
|
const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
|
|
2298
|
-
this.touchState.isHorizontalSwipe = a <=
|
|
2269
|
+
this.touchState.isHorizontalSwipe = a <= Ee;
|
|
2299
2270
|
}
|
|
2300
2271
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2301
2272
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
|
|
@@ -2315,7 +2286,7 @@ const ye = 50, ve = 0.5, we = 20, xe = 0.3, Ee = 150, Se = 30, at = class at {
|
|
|
2315
2286
|
}
|
|
2316
2287
|
};
|
|
2317
2288
|
at.TOUCH_CLICK_DELAY = 300;
|
|
2318
|
-
let
|
|
2289
|
+
let ft = at;
|
|
2319
2290
|
class Ie {
|
|
2320
2291
|
constructor(t) {
|
|
2321
2292
|
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)
|
|
@@ -2537,7 +2508,7 @@ class Ie {
|
|
|
2537
2508
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2538
2509
|
}
|
|
2539
2510
|
}
|
|
2540
|
-
class
|
|
2511
|
+
class Ae {
|
|
2541
2512
|
constructor(t) {
|
|
2542
2513
|
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)
|
|
2543
2514
|
throw new Error("StaticImageLoader requires at least one source to be configured");
|
|
@@ -2717,7 +2688,7 @@ class Te {
|
|
|
2717
2688
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2718
2689
|
}
|
|
2719
2690
|
}
|
|
2720
|
-
class
|
|
2691
|
+
class Te {
|
|
2721
2692
|
constructor(t) {
|
|
2722
2693
|
if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
|
|
2723
2694
|
throw new Error("CompositeLoader requires at least one loader to be configured");
|
|
@@ -2811,7 +2782,7 @@ class Ce {
|
|
|
2811
2782
|
// isAllowedDate(date: Date): boolean
|
|
2812
2783
|
// isAllowedDimensions(width: number, height: number): boolean
|
|
2813
2784
|
}
|
|
2814
|
-
const
|
|
2785
|
+
const Re = `
|
|
2815
2786
|
.fbn-ic-gallery {
|
|
2816
2787
|
position: relative;
|
|
2817
2788
|
width: 100%;
|
|
@@ -2861,14 +2832,14 @@ const Ae = `
|
|
|
2861
2832
|
display: none !important;
|
|
2862
2833
|
}
|
|
2863
2834
|
`;
|
|
2864
|
-
function
|
|
2835
|
+
function Me() {
|
|
2865
2836
|
if (typeof document > "u") return;
|
|
2866
2837
|
const n = "fbn-ic-functional-styles";
|
|
2867
2838
|
if (document.getElementById(n)) return;
|
|
2868
2839
|
const t = document.createElement("style");
|
|
2869
|
-
t.id = n, t.textContent =
|
|
2840
|
+
t.id = n, t.textContent = Re, document.head.appendChild(t);
|
|
2870
2841
|
}
|
|
2871
|
-
class
|
|
2842
|
+
class Le {
|
|
2872
2843
|
constructor(t = {}) {
|
|
2873
2844
|
this.fullConfig = jt(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 qt(this.fullConfig.animation), this.layoutEngine = new ge({
|
|
2874
2845
|
layout: this.fullConfig.layout,
|
|
@@ -2896,7 +2867,7 @@ class Me {
|
|
|
2896
2867
|
if (!t || t.length === 0)
|
|
2897
2868
|
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
|
|
2898
2869
|
const i = t.map((o) => this.createLoaderFromEntry(o, e));
|
|
2899
|
-
return i.length === 1 ? i[0] : new
|
|
2870
|
+
return i.length === 1 ? i[0] : new Te({
|
|
2900
2871
|
loaders: i,
|
|
2901
2872
|
debugLogging: this.fullConfig.config.debug?.loaders
|
|
2902
2873
|
});
|
|
@@ -2914,7 +2885,7 @@ class Me {
|
|
|
2914
2885
|
allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
|
|
2915
2886
|
debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2916
2887
|
};
|
|
2917
|
-
return new
|
|
2888
|
+
return new Ae(o);
|
|
2918
2889
|
} else if ("googleDrive" in t) {
|
|
2919
2890
|
const i = t.googleDrive, o = {
|
|
2920
2891
|
...i,
|
|
@@ -2930,16 +2901,16 @@ class Me {
|
|
|
2930
2901
|
*/
|
|
2931
2902
|
async init() {
|
|
2932
2903
|
try {
|
|
2933
|
-
if (
|
|
2904
|
+
if (Me(), this.containerRef)
|
|
2934
2905
|
this.containerEl = this.containerRef;
|
|
2935
2906
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
2936
2907
|
throw new Error(`Container #${this.containerId} not found`);
|
|
2937
|
-
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new
|
|
2908
|
+
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new ft(this.containerEl, {
|
|
2938
2909
|
onNext: () => this.navigateToNextImage(),
|
|
2939
2910
|
onPrev: () => this.navigateToPreviousImage(),
|
|
2940
2911
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
2941
2912
|
onDragEnd: (t) => {
|
|
2942
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
2913
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Se);
|
|
2943
2914
|
}
|
|
2944
2915
|
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
2945
2916
|
} catch (t) {
|
|
@@ -3066,22 +3037,22 @@ class Me {
|
|
|
3066
3037
|
const d = {
|
|
3067
3038
|
x: parseFloat(c.dataset.startX),
|
|
3068
3039
|
y: parseFloat(c.dataset.startY)
|
|
3069
|
-
},
|
|
3040
|
+
}, m = {
|
|
3070
3041
|
x: parseFloat(c.dataset.endX),
|
|
3071
3042
|
y: parseFloat(c.dataset.endY)
|
|
3072
|
-
}, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation),
|
|
3043
|
+
}, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), f = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : f, w = this.entryAnimationEngine.getTiming();
|
|
3073
3044
|
Qt({
|
|
3074
3045
|
element: c,
|
|
3075
3046
|
startPosition: d,
|
|
3076
|
-
endPosition:
|
|
3047
|
+
endPosition: m,
|
|
3077
3048
|
pathConfig: this.entryAnimationEngine.getPathConfig(),
|
|
3078
3049
|
duration: w.duration,
|
|
3079
3050
|
imageWidth: b,
|
|
3080
3051
|
imageHeight: p,
|
|
3081
3052
|
rotation: g,
|
|
3082
|
-
scale:
|
|
3053
|
+
scale: f,
|
|
3083
3054
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3084
|
-
startRotation:
|
|
3055
|
+
startRotation: S,
|
|
3085
3056
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
3086
3057
|
startScale: v
|
|
3087
3058
|
});
|
|
@@ -3136,8 +3107,8 @@ class Me {
|
|
|
3136
3107
|
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), s.forEach((c, u) => {
|
|
3137
3108
|
const l = document.createElement("div");
|
|
3138
3109
|
l.className = "fbn-ic-debug-center", l.style.position = "absolute", l.style.width = "12px", l.style.height = "12px", l.style.borderRadius = "50%", l.style.backgroundColor = "red", l.style.border = "2px solid yellow", l.style.zIndex = "9999", l.style.pointerEvents = "none";
|
|
3139
|
-
const d = c.x,
|
|
3140
|
-
l.style.left = `${d - 6}px`, l.style.top = `${
|
|
3110
|
+
const d = c.x, m = c.y;
|
|
3111
|
+
l.style.left = `${d - 6}px`, l.style.top = `${m - 6}px`, l.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(m)})`, this.containerEl.appendChild(l);
|
|
3141
3112
|
})), t.forEach((c, u) => {
|
|
3142
3113
|
const l = document.createElement("img");
|
|
3143
3114
|
l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(u);
|
|
@@ -3145,33 +3116,33 @@ class Me {
|
|
|
3145
3116
|
l.style.position = "absolute", l.style.width = "auto", l.style.height = `${e}px`, l.style.left = `${d.x}px`, l.style.top = `${d.y}px`, d.zIndex && (l.style.zIndex = String(d.zIndex)), tt(l, this.defaultStyles), et(l, this.defaultClassName), l.addEventListener("mouseenter", () => {
|
|
3146
3117
|
this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
|
|
3147
3118
|
}), l.addEventListener("mouseleave", () => {
|
|
3148
|
-
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles),
|
|
3149
|
-
}), l.addEventListener("click", (
|
|
3150
|
-
|
|
3119
|
+
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), Lt(l, this.hoverClassName), et(l, this.defaultClassName));
|
|
3120
|
+
}), l.addEventListener("click", (m) => {
|
|
3121
|
+
m.stopPropagation(), this.handleImageClick(l, d);
|
|
3151
3122
|
}), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
|
|
3152
3123
|
if (o !== this.loadGeneration)
|
|
3153
3124
|
return;
|
|
3154
|
-
const
|
|
3125
|
+
const m = l.naturalWidth / l.naturalHeight, b = e * m;
|
|
3155
3126
|
l.style.width = `${b}px`;
|
|
3156
|
-
const p = { x: d.x, y: d.y }, g = { width: b, height: e },
|
|
3127
|
+
const p = { x: d.x, y: d.y }, g = { width: b, height: e }, f = this.entryAnimationEngine.calculateStartPosition(
|
|
3157
3128
|
p,
|
|
3158
3129
|
g,
|
|
3159
3130
|
i,
|
|
3160
3131
|
u,
|
|
3161
3132
|
t.length
|
|
3162
|
-
),
|
|
3133
|
+
), S = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
|
|
3163
3134
|
d.rotation,
|
|
3164
3135
|
d.scale,
|
|
3165
3136
|
b,
|
|
3166
3137
|
e
|
|
3167
|
-
),
|
|
3168
|
-
|
|
3138
|
+
), E = this.entryAnimationEngine.buildStartTransform(
|
|
3139
|
+
f,
|
|
3169
3140
|
p,
|
|
3170
3141
|
d.rotation,
|
|
3171
3142
|
d.scale,
|
|
3172
3143
|
b,
|
|
3173
3144
|
e,
|
|
3174
|
-
|
|
3145
|
+
S,
|
|
3175
3146
|
v
|
|
3176
3147
|
);
|
|
3177
3148
|
this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
|
|
@@ -3182,7 +3153,7 @@ class Me {
|
|
|
3182
3153
|
finalTransform: w,
|
|
3183
3154
|
renderedWidth: b,
|
|
3184
3155
|
renderedHeight: e
|
|
3185
|
-
}), l.style.transform =
|
|
3156
|
+
}), l.style.transform = E, l.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || S !== d.rotation || v !== d.scale) && (l.dataset.startX = String(f.x), l.dataset.startY = String(f.y), l.dataset.endX = String(p.x), l.dataset.endY = String(p.y), l.dataset.imageWidth = String(b), l.dataset.imageHeight = String(e), l.dataset.rotation = String(d.rotation), l.dataset.scale = String(d.scale), l.dataset.startRotation = String(S), l.dataset.startScale = String(v)), this.displayQueue.push(l);
|
|
3186
3157
|
}, l.onerror = () => r++, l.src = c;
|
|
3187
3158
|
});
|
|
3188
3159
|
}
|
|
@@ -3231,27 +3202,27 @@ export {
|
|
|
3231
3202
|
qt as AnimationEngine,
|
|
3232
3203
|
wt as BOUNCE_PRESETS,
|
|
3233
3204
|
de as ClusterPlacementLayout,
|
|
3234
|
-
|
|
3205
|
+
Te as CompositeLoader,
|
|
3235
3206
|
y as DEFAULT_CONFIG,
|
|
3236
3207
|
Ct as DEFAULT_SHARED_LOADER_CONFIG,
|
|
3237
3208
|
xt as ELASTIC_PRESETS,
|
|
3238
3209
|
ie as EntryAnimationEngine,
|
|
3239
|
-
|
|
3210
|
+
Re as FUNCTIONAL_CSS,
|
|
3240
3211
|
Ie as GoogleDriveLoader,
|
|
3241
3212
|
ae as GridPlacementLayout,
|
|
3242
|
-
|
|
3213
|
+
Le as ImageCloud,
|
|
3243
3214
|
Ce as ImageFilter,
|
|
3244
|
-
|
|
3215
|
+
Le as ImageGallery,
|
|
3245
3216
|
ge as LayoutEngine,
|
|
3246
3217
|
oe as RadialPlacementLayout,
|
|
3247
3218
|
ne as RandomPlacementLayout,
|
|
3248
3219
|
le as SpiralPlacementLayout,
|
|
3249
|
-
|
|
3250
|
-
|
|
3220
|
+
Ae as StaticImageLoader,
|
|
3221
|
+
St as WAVE_PATH_PRESETS,
|
|
3251
3222
|
ue as WavePlacementLayout,
|
|
3252
3223
|
be as ZoomEngine,
|
|
3253
3224
|
Qt as animatePath,
|
|
3254
|
-
|
|
3225
|
+
Me as injectFunctionalStyles,
|
|
3255
3226
|
te as requiresJSAnimation
|
|
3256
3227
|
};
|
|
3257
3228
|
//# sourceMappingURL=image-cloud.js.map
|