@frybynite/image-cloud 0.7.3 → 0.7.4
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 +177 -158
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +237 -218
- 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 +3 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +222 -203
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +3 -0
- package/dist/vue.js +224 -205
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +3 -0
- package/dist/web-component.js +171 -152
- package/dist/web-component.js.map +1 -1
- package/package.json +17 -1
package/dist/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as $t, ref as wt, onMounted as Pt, onUnmounted as Ut, watch as _t, h as Ht } from "vue";
|
|
2
|
+
const ft = 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)",
|
|
@@ -25,7 +25,7 @@ const mt = Object.freeze({
|
|
|
25
25
|
mode: "none"
|
|
26
26
|
}), yt = Object.freeze({
|
|
27
27
|
mode: "none"
|
|
28
|
-
}),
|
|
28
|
+
}), Ct = Object.freeze({
|
|
29
29
|
default: Object.freeze({
|
|
30
30
|
border: Object.freeze({
|
|
31
31
|
width: 0,
|
|
@@ -34,6 +34,7 @@ const mt = Object.freeze({
|
|
|
34
34
|
style: "solid"
|
|
35
35
|
}),
|
|
36
36
|
shadow: "none",
|
|
37
|
+
clipPath: void 0,
|
|
37
38
|
filter: Object.freeze({}),
|
|
38
39
|
opacity: 1,
|
|
39
40
|
cursor: "pointer",
|
|
@@ -50,17 +51,17 @@ const mt = Object.freeze({
|
|
|
50
51
|
focused: Object.freeze({
|
|
51
52
|
shadow: "none"
|
|
52
53
|
})
|
|
53
|
-
}),
|
|
54
|
+
}), Nt = Object.freeze({
|
|
54
55
|
rows: 1,
|
|
55
56
|
amplitude: 100,
|
|
56
57
|
frequency: 2,
|
|
57
58
|
phaseShift: 0,
|
|
58
59
|
synchronization: "offset"
|
|
59
60
|
// Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
|
|
60
|
-
}),
|
|
61
|
+
}), jt = Object.freeze({
|
|
61
62
|
mobile: Object.freeze({ maxWidth: 767 }),
|
|
62
63
|
tablet: Object.freeze({ maxWidth: 1199 })
|
|
63
|
-
}),
|
|
64
|
+
}), kt = Object.freeze({
|
|
64
65
|
mode: "adaptive",
|
|
65
66
|
// Default to adaptive sizing
|
|
66
67
|
minSize: 50,
|
|
@@ -72,21 +73,21 @@ const mt = Object.freeze({
|
|
|
72
73
|
// No variance by default
|
|
73
74
|
max: 1
|
|
74
75
|
})
|
|
75
|
-
}),
|
|
76
|
+
}), Wt = Object.freeze({
|
|
76
77
|
mode: "none",
|
|
77
78
|
range: Object.freeze({
|
|
78
79
|
min: -15,
|
|
79
80
|
max: 15
|
|
80
81
|
})
|
|
81
|
-
}), Ct = Object.freeze({
|
|
82
|
-
sizing: jt,
|
|
83
|
-
rotation: kt
|
|
84
82
|
}), Rt = Object.freeze({
|
|
83
|
+
sizing: kt,
|
|
84
|
+
rotation: Wt
|
|
85
|
+
}), Mt = Object.freeze({
|
|
85
86
|
validateUrls: !0,
|
|
86
87
|
validationTimeout: 5e3,
|
|
87
88
|
validationMethod: "head",
|
|
88
89
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
|
|
89
|
-
}),
|
|
90
|
+
}), Lt = Object.freeze({
|
|
90
91
|
enabled: !1,
|
|
91
92
|
centers: !1,
|
|
92
93
|
loaders: !1
|
|
@@ -95,17 +96,17 @@ const mt = Object.freeze({
|
|
|
95
96
|
loaders: [],
|
|
96
97
|
// Shared loader settings and debug config
|
|
97
98
|
config: Object.freeze({
|
|
98
|
-
loaders:
|
|
99
|
-
debug:
|
|
99
|
+
loaders: Mt,
|
|
100
|
+
debug: Lt
|
|
100
101
|
}),
|
|
101
102
|
// Image sizing and rotation configuration
|
|
102
|
-
image:
|
|
103
|
+
image: Rt,
|
|
103
104
|
// Pattern-based layout configuration
|
|
104
105
|
layout: Object.freeze({
|
|
105
106
|
algorithm: "radial",
|
|
106
107
|
scaleDecay: 0,
|
|
107
108
|
// No decay by default (0-1 for radial/spiral)
|
|
108
|
-
responsive:
|
|
109
|
+
responsive: jt,
|
|
109
110
|
targetCoverage: 0.6,
|
|
110
111
|
// Target 60% of container area
|
|
111
112
|
densityFactor: 1,
|
|
@@ -216,15 +217,15 @@ const mt = Object.freeze({
|
|
|
216
217
|
})
|
|
217
218
|
}),
|
|
218
219
|
// Image styling
|
|
219
|
-
styling:
|
|
220
|
+
styling: Ct
|
|
220
221
|
});
|
|
221
222
|
function Z(n, t) {
|
|
222
223
|
if (!n) return t || {};
|
|
223
224
|
if (!t) return { ...n };
|
|
224
225
|
const e = { ...n };
|
|
225
|
-
return t.border !== void 0 && (e.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
|
|
226
|
+
return t.border !== void 0 && (e.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.clipPath !== void 0 && (e.clipPath = t.clipPath), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
+
function Gt(n, t) {
|
|
228
229
|
if (!t) return { ...n };
|
|
229
230
|
const e = Z(n.default, t.default), i = Z(
|
|
230
231
|
Z(e, n.hover),
|
|
@@ -239,7 +240,7 @@ function Wt(n, t) {
|
|
|
239
240
|
focused: o
|
|
240
241
|
};
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
+
function qt(n, t) {
|
|
243
244
|
if (!t) return { ...n };
|
|
244
245
|
const e = { ...n };
|
|
245
246
|
if (t.sizing !== void 0 && (e.sizing = {
|
|
@@ -258,7 +259,7 @@ function Gt(n, t) {
|
|
|
258
259
|
}
|
|
259
260
|
return e;
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function Yt(n) {
|
|
262
263
|
const t = n.layout?.rotation;
|
|
263
264
|
if (t && "enabled" in t)
|
|
264
265
|
return {
|
|
@@ -268,7 +269,7 @@ function qt(n) {
|
|
|
268
269
|
}
|
|
269
270
|
};
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
+
function Xt(n) {
|
|
272
273
|
const t = n.layout?.sizing?.variance;
|
|
273
274
|
if (t)
|
|
274
275
|
return {
|
|
@@ -279,8 +280,8 @@ function Yt(n) {
|
|
|
279
280
|
}
|
|
280
281
|
};
|
|
281
282
|
}
|
|
282
|
-
function
|
|
283
|
-
const t =
|
|
283
|
+
function Bt(n = {}) {
|
|
284
|
+
const t = Yt(n), e = Xt(n);
|
|
284
285
|
let i = n.image;
|
|
285
286
|
(t || e) && (i = {
|
|
286
287
|
...e || {},
|
|
@@ -298,18 +299,18 @@ function Xt(n = {}) {
|
|
|
298
299
|
});
|
|
299
300
|
const r = {
|
|
300
301
|
loaders: {
|
|
301
|
-
...
|
|
302
|
+
...Mt,
|
|
302
303
|
...n.config?.loaders ?? {}
|
|
303
304
|
}
|
|
304
305
|
}, a = {
|
|
305
306
|
loaders: o,
|
|
306
307
|
config: r,
|
|
307
|
-
image:
|
|
308
|
+
image: qt(Rt, i),
|
|
308
309
|
layout: { ...y.layout },
|
|
309
310
|
animation: { ...y.animation },
|
|
310
311
|
interaction: { ...y.interaction },
|
|
311
312
|
rendering: { ...y.rendering },
|
|
312
|
-
styling:
|
|
313
|
+
styling: Gt(Ct, n.styling)
|
|
313
314
|
};
|
|
314
315
|
return n.layout && (a.layout = {
|
|
315
316
|
...y.layout,
|
|
@@ -372,20 +373,20 @@ function Xt(n = {}) {
|
|
|
372
373
|
...y.rendering.performance,
|
|
373
374
|
...n.rendering.performance
|
|
374
375
|
})), a.config.debug = {
|
|
375
|
-
...
|
|
376
|
+
...Lt,
|
|
376
377
|
...n.config?.debug ?? {}
|
|
377
378
|
}, a;
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function Jt(n, t) {
|
|
380
381
|
return { ...n ? xt[n] : xt.playful, ...t };
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
+
function Vt(n, t) {
|
|
383
384
|
return { ...n ? St[n] : St.gentle, ...t };
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function Kt(n, t) {
|
|
386
387
|
return { ...n ? Et[n] : Et.gentle, ...t };
|
|
387
388
|
}
|
|
388
|
-
class
|
|
389
|
+
class Zt {
|
|
389
390
|
constructor(t) {
|
|
390
391
|
this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
|
|
391
392
|
}
|
|
@@ -544,31 +545,31 @@ class Kt {
|
|
|
544
545
|
function V(n, t, e) {
|
|
545
546
|
return n + (t - n) * e;
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
-
const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c =
|
|
549
|
-
let u = 0, l = 0, d = 1,
|
|
548
|
+
function Qt(n, t, e, i) {
|
|
549
|
+
const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = te(s, r);
|
|
550
|
+
let u = 0, l = 0, d = 1, f = o, b = !1;
|
|
550
551
|
for (let g = 0; g < c.length; g++)
|
|
551
552
|
if (n <= c[g].time) {
|
|
552
|
-
l = g === 0 ? 0 : c[g - 1].time, d = c[g].time,
|
|
553
|
+
l = g === 0 ? 0 : c[g - 1].time, d = c[g].time, f = c[g].overshoot, b = c[g].isOvershoot;
|
|
553
554
|
break;
|
|
554
555
|
}
|
|
555
556
|
const p = (n - l) / (d - l);
|
|
556
557
|
if (b)
|
|
557
|
-
u = 1 +
|
|
558
|
+
u = 1 + f * ot(p);
|
|
558
559
|
else if (l === 0)
|
|
559
560
|
u = ot(p);
|
|
560
561
|
else {
|
|
561
|
-
const
|
|
562
|
+
const m = 1 + (c.find(
|
|
562
563
|
(S, v) => S.time > l && v > 0 && c[v - 1].isOvershoot
|
|
563
|
-
)?.overshoot ||
|
|
564
|
-
u = V(
|
|
564
|
+
)?.overshoot || f);
|
|
565
|
+
u = V(m, 1, ot(p));
|
|
565
566
|
}
|
|
566
567
|
return {
|
|
567
568
|
x: t.x + a * u,
|
|
568
569
|
y: t.y + h * u
|
|
569
570
|
};
|
|
570
571
|
}
|
|
571
|
-
function
|
|
572
|
+
function te(n, t) {
|
|
572
573
|
const e = [];
|
|
573
574
|
let i = 0.6;
|
|
574
575
|
e.push({ time: i, overshoot: 0, isOvershoot: !1 });
|
|
@@ -578,11 +579,11 @@ function Qt(n, t) {
|
|
|
578
579
|
i += r, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
|
|
579
580
|
return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
|
|
580
581
|
}
|
|
581
|
-
function
|
|
582
|
+
function ee(n, t, e, i) {
|
|
582
583
|
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));
|
|
583
584
|
let d;
|
|
584
585
|
if (l < 1) {
|
|
585
|
-
const
|
|
586
|
+
const f = u * Math.sqrt(1 - l * l), b = Math.exp(-l * u * n * 3), p = Math.cos(f * n * a * Math.PI);
|
|
586
587
|
d = 1 - b * p;
|
|
587
588
|
} else
|
|
588
589
|
d = 1 - Math.exp(-u * n * 3);
|
|
@@ -591,44 +592,44 @@ function te(n, t, e, i) {
|
|
|
591
592
|
y: t.y + c * d
|
|
592
593
|
};
|
|
593
594
|
}
|
|
594
|
-
function
|
|
595
|
-
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,
|
|
595
|
+
function ie(n, t, e, i) {
|
|
596
|
+
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, f = 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, m = ne(n);
|
|
596
597
|
return {
|
|
597
|
-
x: V(t.x, e.x,
|
|
598
|
-
y: V(t.y, e.y,
|
|
598
|
+
x: V(t.x, e.x, m) + g * d,
|
|
599
|
+
y: V(t.y, e.y, m) + g * f
|
|
599
600
|
};
|
|
600
601
|
}
|
|
601
602
|
function ot(n) {
|
|
602
603
|
return 1 - (1 - n) * (1 - n);
|
|
603
604
|
}
|
|
604
|
-
function
|
|
605
|
+
function ne(n) {
|
|
605
606
|
return 1 - Math.pow(1 - n, 3);
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
+
function oe(n, t, e) {
|
|
608
609
|
const { amplitude: i, frequency: o, decay: s } = e, r = Math.sin(n * o * Math.PI * 2), a = s ? Math.pow(1 - n, 2) : 1, h = i * r * a;
|
|
609
610
|
return t + h;
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function se(n, t, e) {
|
|
612
613
|
const { overshoot: i, bounces: o } = e, s = [];
|
|
613
614
|
s.push({ time: 0.5, scale: i });
|
|
614
615
|
let r = i;
|
|
615
616
|
const a = 0.5, c = 0.5 / (o * 2);
|
|
616
617
|
let u = 0.5;
|
|
617
618
|
for (let d = 0; d < o; d++) {
|
|
618
|
-
const
|
|
619
|
-
u += c, s.push({ time: u, scale:
|
|
619
|
+
const f = 1 - (r - 1) * a;
|
|
620
|
+
u += c, s.push({ time: u, scale: f }), r = 1 + (r - 1) * a * a, u += c, d < o - 1 && s.push({ time: u, scale: r });
|
|
620
621
|
}
|
|
621
622
|
s.push({ time: 1, scale: 1 });
|
|
622
623
|
let l = 1;
|
|
623
624
|
for (let d = 0; d < s.length; d++)
|
|
624
625
|
if (n <= s[d].time) {
|
|
625
|
-
const
|
|
626
|
+
const f = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (n - f) / (s[d].time - f), g = ot(p);
|
|
626
627
|
l = b + (s[d].scale - b) * g;
|
|
627
628
|
break;
|
|
628
629
|
}
|
|
629
630
|
return l * t;
|
|
630
631
|
}
|
|
631
|
-
function
|
|
632
|
+
function ae(n) {
|
|
632
633
|
const {
|
|
633
634
|
element: t,
|
|
634
635
|
startPosition: e,
|
|
@@ -642,40 +643,40 @@ function se(n) {
|
|
|
642
643
|
onComplete: u,
|
|
643
644
|
rotationConfig: l,
|
|
644
645
|
startRotation: d,
|
|
645
|
-
scaleConfig:
|
|
646
|
+
scaleConfig: f,
|
|
646
647
|
startScale: b
|
|
647
|
-
} = n, p = o.type, g = d !== void 0 && d !== h,
|
|
648
|
+
} = n, p = o.type, g = d !== void 0 && d !== h, m = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = g || m, w = b !== void 0 && b !== c, E = f?.mode === "pop", x = f?.pop || { overshoot: 1.2, bounces: 1 };
|
|
648
649
|
if ((p === "linear" || p === "arc") && !v && !(w || E)) {
|
|
649
650
|
u && u();
|
|
650
651
|
return;
|
|
651
652
|
}
|
|
652
|
-
const L = performance.now(), z = -r / 2,
|
|
653
|
+
const L = performance.now(), z = -r / 2, U = -a / 2;
|
|
653
654
|
function _(Y) {
|
|
654
655
|
const N = Y - L, T = Math.min(N / s, 1);
|
|
655
656
|
let D;
|
|
656
657
|
switch (p) {
|
|
657
658
|
case "bounce": {
|
|
658
|
-
const O =
|
|
659
|
+
const O = Jt(
|
|
659
660
|
o.bouncePreset,
|
|
660
661
|
o.bounce
|
|
661
662
|
);
|
|
662
|
-
D =
|
|
663
|
+
D = Qt(T, e, i, O);
|
|
663
664
|
break;
|
|
664
665
|
}
|
|
665
666
|
case "elastic": {
|
|
666
|
-
const O =
|
|
667
|
+
const O = Vt(
|
|
667
668
|
o.elasticPreset,
|
|
668
669
|
o.elastic
|
|
669
670
|
);
|
|
670
|
-
D =
|
|
671
|
+
D = ee(T, e, i, O);
|
|
671
672
|
break;
|
|
672
673
|
}
|
|
673
674
|
case "wave": {
|
|
674
|
-
const O =
|
|
675
|
+
const O = Kt(
|
|
675
676
|
o.wavePreset,
|
|
676
677
|
o.wave
|
|
677
678
|
);
|
|
678
|
-
D =
|
|
679
|
+
D = ie(T, e, i, O);
|
|
679
680
|
break;
|
|
680
681
|
}
|
|
681
682
|
default:
|
|
@@ -686,16 +687,16 @@ function se(n) {
|
|
|
686
687
|
}
|
|
687
688
|
const k = D.x - i.x, H = D.y - i.y;
|
|
688
689
|
let R;
|
|
689
|
-
|
|
690
|
+
m ? R = oe(T, h, S) : g ? R = V(d, h, T) : R = h;
|
|
690
691
|
let C;
|
|
691
|
-
E ? C =
|
|
692
|
+
E ? C = se(T, c, x) : w ? C = V(b, c, T) : C = c, t.style.transform = `translate(${z}px, ${U}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${U}px) rotate(${h}deg) scale(${c})`, u && u());
|
|
692
693
|
}
|
|
693
694
|
requestAnimationFrame(_);
|
|
694
695
|
}
|
|
695
|
-
function
|
|
696
|
+
function re(n) {
|
|
696
697
|
return n === "bounce" || n === "elastic" || n === "wave";
|
|
697
698
|
}
|
|
698
|
-
const
|
|
699
|
+
const ce = {
|
|
699
700
|
radial: "center",
|
|
700
701
|
spiral: "center",
|
|
701
702
|
grid: "top",
|
|
@@ -703,7 +704,7 @@ const re = {
|
|
|
703
704
|
random: "nearest-edge",
|
|
704
705
|
wave: "left"
|
|
705
706
|
};
|
|
706
|
-
class
|
|
707
|
+
class le {
|
|
707
708
|
constructor(t, e) {
|
|
708
709
|
this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || pt, this.rotationConfig = t.rotation || bt, this.scaleConfig = t.scale || yt;
|
|
709
710
|
}
|
|
@@ -711,7 +712,7 @@ class ce {
|
|
|
711
712
|
* Get the effective start position, considering layout-aware defaults
|
|
712
713
|
*/
|
|
713
714
|
resolveStartPosition() {
|
|
714
|
-
return this.config.start.position ? this.config.start.position :
|
|
715
|
+
return this.config.start.position ? this.config.start.position : ce[this.layoutAlgorithm] || "nearest-edge";
|
|
715
716
|
}
|
|
716
717
|
/**
|
|
717
718
|
* Calculate the starting position for an image's entry animation
|
|
@@ -750,8 +751,8 @@ class ce {
|
|
|
750
751
|
*/
|
|
751
752
|
calculateNearestEdge(t, e, i, o) {
|
|
752
753
|
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);
|
|
753
|
-
let d = t.x,
|
|
754
|
-
return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ?
|
|
754
|
+
let d = t.x, f = t.y;
|
|
755
|
+
return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ? f = -(e.height + o) : f = i.height + o, { x: d, y: f };
|
|
755
756
|
}
|
|
756
757
|
/**
|
|
757
758
|
* Calculate start position from a specific edge
|
|
@@ -809,8 +810,8 @@ class ce {
|
|
|
809
810
|
h = typeof c == "number" ? c : 500;
|
|
810
811
|
let u;
|
|
811
812
|
a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
|
|
812
|
-
const l = i.width / 2, d = i.height / 2,
|
|
813
|
-
return { x:
|
|
813
|
+
const l = i.width / 2, d = i.height / 2, f = l + Math.cos(u) * h, b = d + Math.sin(u) * h;
|
|
814
|
+
return { x: f, y: b };
|
|
814
815
|
}
|
|
815
816
|
/**
|
|
816
817
|
* Get animation parameters for an image
|
|
@@ -830,7 +831,7 @@ class ce {
|
|
|
830
831
|
* Uses pixel-based centering offset for reliable cross-browser behavior
|
|
831
832
|
*/
|
|
832
833
|
buildStartTransform(t, e, i, o, s, r, a, h) {
|
|
833
|
-
const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o,
|
|
834
|
+
const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o, f = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${f}px, ${b}px)` : "translate(-50%, -50%)";
|
|
834
835
|
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})`;
|
|
835
836
|
}
|
|
836
837
|
/**
|
|
@@ -856,7 +857,7 @@ class ce {
|
|
|
856
857
|
* Check if the current path type requires JavaScript animation
|
|
857
858
|
*/
|
|
858
859
|
requiresJSAnimation() {
|
|
859
|
-
return
|
|
860
|
+
return re(this.pathConfig.type);
|
|
860
861
|
}
|
|
861
862
|
/**
|
|
862
863
|
* Get the path configuration
|
|
@@ -1047,7 +1048,7 @@ class ce {
|
|
|
1047
1048
|
return 1 - (1 - t) * (1 - t);
|
|
1048
1049
|
}
|
|
1049
1050
|
}
|
|
1050
|
-
class
|
|
1051
|
+
class he {
|
|
1051
1052
|
constructor(t, e = {}) {
|
|
1052
1053
|
this.config = t, this.imageConfig = e;
|
|
1053
1054
|
}
|
|
@@ -1059,14 +1060,14 @@ class le {
|
|
|
1059
1060
|
* @returns Array of layout objects with position, rotation, scale
|
|
1060
1061
|
*/
|
|
1061
1062
|
generate(t, e, i = {}) {
|
|
1062
|
-
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,
|
|
1063
|
+
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, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = h * 1.5 / 2, m = h / 2, S = s - a - g, v = r - a - m, w = a + g, E = a + m;
|
|
1063
1064
|
for (let x = 0; x < t; x++) {
|
|
1064
|
-
const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0,
|
|
1065
|
+
const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0, U = b ? this.random(d, f) : 1, _ = h * U, Y = {
|
|
1065
1066
|
id: x,
|
|
1066
1067
|
x: A,
|
|
1067
1068
|
y: L,
|
|
1068
1069
|
rotation: z,
|
|
1069
|
-
scale:
|
|
1070
|
+
scale: U,
|
|
1070
1071
|
baseSize: _
|
|
1071
1072
|
};
|
|
1072
1073
|
o.push(Y);
|
|
@@ -1083,7 +1084,7 @@ class le {
|
|
|
1083
1084
|
return Math.random() * (e - t) + t;
|
|
1084
1085
|
}
|
|
1085
1086
|
}
|
|
1086
|
-
class
|
|
1087
|
+
class de {
|
|
1087
1088
|
constructor(t, e = {}) {
|
|
1088
1089
|
this.config = t, this.imageConfig = e;
|
|
1089
1090
|
}
|
|
@@ -1095,13 +1096,13 @@ class he {
|
|
|
1095
1096
|
* @returns Array of layout objects with position, rotation, scale
|
|
1096
1097
|
*/
|
|
1097
1098
|
generate(t, e, i = {}) {
|
|
1098
|
-
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,
|
|
1099
|
+
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, f = l !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = i.fixedHeight ?? a, g = s / 2, m = r / 2, S = Math.ceil(Math.sqrt(t));
|
|
1099
1100
|
if (t > 0) {
|
|
1100
|
-
const E =
|
|
1101
|
+
const E = f ? this.random(l, d) : 1, x = p * E;
|
|
1101
1102
|
o.push({
|
|
1102
1103
|
id: 0,
|
|
1103
1104
|
x: g,
|
|
1104
|
-
y:
|
|
1105
|
+
y: m,
|
|
1105
1106
|
rotation: h === "random" ? this.random(c * 0.33, u * 0.33) : 0,
|
|
1106
1107
|
// Less rotation for center
|
|
1107
1108
|
scale: E,
|
|
@@ -1112,17 +1113,17 @@ class he {
|
|
|
1112
1113
|
}
|
|
1113
1114
|
let v = 1, w = 1;
|
|
1114
1115
|
for (; v < t; ) {
|
|
1115
|
-
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))),
|
|
1116
|
+
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))), U = this.estimateWidth(p), _ = Math.floor(z / (U * 0.7));
|
|
1116
1117
|
if (_ === 0) {
|
|
1117
1118
|
w++;
|
|
1118
1119
|
continue;
|
|
1119
1120
|
}
|
|
1120
1121
|
const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
|
|
1121
1122
|
for (let T = 0; T < _ && v < t; T++) {
|
|
1122
|
-
const D = T * Y + N, k =
|
|
1123
|
-
let C = g + Math.cos(D) * L, O =
|
|
1124
|
-
const $ = this.config.spacing.padding ?? 50,
|
|
1125
|
-
C -
|
|
1123
|
+
const D = T * Y + N, k = f ? this.random(l, d) : 1, H = x * k, R = p * H;
|
|
1124
|
+
let C = g + Math.cos(D) * L, O = m + Math.sin(D) * A;
|
|
1125
|
+
const $ = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
|
|
1126
|
+
C - P < $ ? C = $ + P : C + P > s - $ && (C = s - $ - P), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
|
|
1126
1127
|
const W = h === "random" ? this.random(c, u) : 0;
|
|
1127
1128
|
o.push({
|
|
1128
1129
|
id: v,
|
|
@@ -1158,7 +1159,7 @@ class he {
|
|
|
1158
1159
|
return Math.random() * (e - t) + t;
|
|
1159
1160
|
}
|
|
1160
1161
|
}
|
|
1161
|
-
const
|
|
1162
|
+
const ue = {
|
|
1162
1163
|
columns: "auto",
|
|
1163
1164
|
rows: "auto",
|
|
1164
1165
|
stagger: "none",
|
|
@@ -1186,7 +1187,7 @@ const de = {
|
|
|
1186
1187
|
{ x: 0, y: 1 }
|
|
1187
1188
|
// down
|
|
1188
1189
|
];
|
|
1189
|
-
class
|
|
1190
|
+
class ge {
|
|
1190
1191
|
constructor(t, e = {}) {
|
|
1191
1192
|
this.config = t, this.imageConfig = e;
|
|
1192
1193
|
}
|
|
@@ -1198,18 +1199,18 @@ class ue {
|
|
|
1198
1199
|
* @returns Array of layout objects with position, rotation, scale
|
|
1199
1200
|
*/
|
|
1200
1201
|
generate(t, e, i = {}) {
|
|
1201
|
-
const o = [], { width: s, height: r } = e, a = { ...
|
|
1202
|
+
const o = [], { width: s, height: r } = e, a = { ...ue, ...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, f = l !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: m } = this.calculateGridDimensions(
|
|
1202
1203
|
t,
|
|
1203
1204
|
b,
|
|
1204
1205
|
p,
|
|
1205
1206
|
c,
|
|
1206
1207
|
a
|
|
1207
|
-
), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ?
|
|
1208
|
+
), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ? m + 0.5 : m, x = (b - a.gap * (g - 1)) / w, A = (p - a.gap * (m - 1)) / E, L = S ? x / 2 : 0, z = v ? A / 2 : 0, U = 1 + a.overlap, _ = Math.min(x, A) * U, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = g * x + (g - 1) * a.gap + L, T = m * A + (m - 1) * a.gap + z, D = h + (b - N) / 2, k = h + (p - T) / 2, H = g * m, R = a.columns !== "auto" && a.rows !== "auto", C = R && t > H;
|
|
1208
1209
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1209
1210
|
gridConfigColumns: a.columns,
|
|
1210
1211
|
gridConfigRows: a.rows,
|
|
1211
1212
|
columns: g,
|
|
1212
|
-
rows:
|
|
1213
|
+
rows: m,
|
|
1213
1214
|
cellCount: H,
|
|
1214
1215
|
hasFixedGrid: R,
|
|
1215
1216
|
imageCount: t,
|
|
@@ -1217,14 +1218,14 @@ class ue {
|
|
|
1217
1218
|
});
|
|
1218
1219
|
const O = C ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
|
|
1219
1220
|
for (let F = 0; F < t; F++) {
|
|
1220
|
-
let
|
|
1221
|
+
let P, M, W = 0;
|
|
1221
1222
|
if (C && F >= H) {
|
|
1222
1223
|
const q = F - H, j = q % H;
|
|
1223
|
-
W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (
|
|
1224
|
+
W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (P = j % g, M = Math.floor(j / g)) : (M = j % m, P = Math.floor(j / m));
|
|
1224
1225
|
} else
|
|
1225
|
-
a.fillDirection === "row" ? (
|
|
1226
|
-
let G = D +
|
|
1227
|
-
if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" &&
|
|
1226
|
+
a.fillDirection === "row" ? (P = F % g, M = Math.floor(F / g)) : (M = F % m, P = Math.floor(F / m));
|
|
1227
|
+
let G = D + P * (x + a.gap) + x / 2, X = k + M * (A + a.gap) + A / 2;
|
|
1228
|
+
if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" && P % 2 === 1 && (X += A / 2), W > 0) {
|
|
1228
1229
|
const q = (W - 1) % It.length, j = It[q];
|
|
1229
1230
|
G += j.x * $, X += j.y * $;
|
|
1230
1231
|
}
|
|
@@ -1241,8 +1242,8 @@ class ue {
|
|
|
1241
1242
|
a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
|
|
1242
1243
|
}
|
|
1243
1244
|
}
|
|
1244
|
-
const rt =
|
|
1245
|
-
B = Math.max(lt, Math.min(B, ht)), J = Math.max(
|
|
1245
|
+
const rt = f ? this.random(l, d) : 1, K = Y * rt, it = K * 1.5 / 2, nt = K / 2, lt = h + it, ht = s - h - it, Dt = h + nt, Ot = r - h - nt;
|
|
1246
|
+
B = Math.max(lt, Math.min(B, ht)), J = Math.max(Dt, Math.min(J, Ot));
|
|
1246
1247
|
let dt = 0;
|
|
1247
1248
|
if (u === "random") {
|
|
1248
1249
|
const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
|
|
@@ -1286,14 +1287,14 @@ class ue {
|
|
|
1286
1287
|
return Math.random() * (e - t) + t;
|
|
1287
1288
|
}
|
|
1288
1289
|
}
|
|
1289
|
-
const
|
|
1290
|
+
const fe = Math.PI * (3 - Math.sqrt(5)), me = {
|
|
1290
1291
|
spiralType: "golden",
|
|
1291
1292
|
direction: "counterclockwise",
|
|
1292
1293
|
tightness: 1,
|
|
1293
1294
|
scaleDecay: 0,
|
|
1294
1295
|
startAngle: 0
|
|
1295
1296
|
};
|
|
1296
|
-
class
|
|
1297
|
+
class pe {
|
|
1297
1298
|
constructor(t, e = {}) {
|
|
1298
1299
|
this.config = t, this.imageConfig = e;
|
|
1299
1300
|
}
|
|
@@ -1305,14 +1306,14 @@ class fe {
|
|
|
1305
1306
|
* @returns Array of layout objects with position, rotation, scale
|
|
1306
1307
|
*/
|
|
1307
1308
|
generate(t, e, i = {}) {
|
|
1308
|
-
const o = [], { width: s, height: r } = e, a = { ...me, ...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,
|
|
1309
|
-
|
|
1309
|
+
const o = [], { width: s, height: r } = e, a = { ...me, ...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, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, m = s / 2, S = r / 2, v = Math.min(
|
|
1310
|
+
m - h - c / 2,
|
|
1310
1311
|
S - h - c / 2
|
|
1311
1312
|
), w = a.direction === "clockwise" ? -1 : 1;
|
|
1312
1313
|
for (let E = 0; E < t; E++) {
|
|
1313
1314
|
let x, A;
|
|
1314
1315
|
if (a.spiralType === "golden")
|
|
1315
|
-
x = E *
|
|
1316
|
+
x = E * fe * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
|
|
1316
1317
|
else if (a.spiralType === "archimedean") {
|
|
1317
1318
|
const G = E * 0.5 * a.tightness;
|
|
1318
1319
|
x = G * w + a.startAngle, A = this.calculateArchimedeanRadius(G, t, v, a.tightness);
|
|
@@ -1320,7 +1321,7 @@ class fe {
|
|
|
1320
1321
|
const G = E * 0.3 * a.tightness;
|
|
1321
1322
|
x = G * w + a.startAngle, A = this.calculateLogarithmicRadius(G, t, v, a.tightness);
|
|
1322
1323
|
}
|
|
1323
|
-
const L =
|
|
1324
|
+
const L = m + Math.cos(x) * A, z = S + Math.sin(x) * A, U = A / v, _ = g > 0 ? 1 - U * g * 0.5 : 1, Y = p ? this.random(f, 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)), P = Math.max(O, Math.min(z, $));
|
|
1324
1325
|
let M = 0;
|
|
1325
1326
|
if (u === "random") {
|
|
1326
1327
|
const G = x * 180 / Math.PI % 360, X = this.random(l, d);
|
|
@@ -1330,7 +1331,7 @@ class fe {
|
|
|
1330
1331
|
o.push({
|
|
1331
1332
|
id: E,
|
|
1332
1333
|
x: F,
|
|
1333
|
-
y:
|
|
1334
|
+
y: P,
|
|
1334
1335
|
rotation: M,
|
|
1335
1336
|
scale: N,
|
|
1336
1337
|
baseSize: T,
|
|
@@ -1387,7 +1388,7 @@ class fe {
|
|
|
1387
1388
|
return Math.random() * (e - t) + t;
|
|
1388
1389
|
}
|
|
1389
1390
|
}
|
|
1390
|
-
const
|
|
1391
|
+
const be = {
|
|
1391
1392
|
clusterCount: "auto",
|
|
1392
1393
|
clusterSpread: 150,
|
|
1393
1394
|
clusterSpacing: 200,
|
|
@@ -1395,7 +1396,7 @@ const pe = {
|
|
|
1395
1396
|
overlap: 0.3,
|
|
1396
1397
|
distribution: "gaussian"
|
|
1397
1398
|
};
|
|
1398
|
-
class
|
|
1399
|
+
class ye {
|
|
1399
1400
|
constructor(t, e = {}) {
|
|
1400
1401
|
this.config = t, this.imageConfig = e;
|
|
1401
1402
|
}
|
|
@@ -1407,13 +1408,13 @@ class be {
|
|
|
1407
1408
|
* @returns Array of layout objects with position, rotation, scale
|
|
1408
1409
|
*/
|
|
1409
1410
|
generate(t, e, i = {}) {
|
|
1410
|
-
const o = [], { width: s, height: r } = e, a = { ...
|
|
1411
|
+
const o = [], { width: s, height: r } = e, a = { ...be, ...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, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.calculateClusterCount(
|
|
1411
1412
|
t,
|
|
1412
1413
|
a.clusterCount,
|
|
1413
1414
|
s,
|
|
1414
1415
|
r,
|
|
1415
1416
|
a.clusterSpacing
|
|
1416
|
-
),
|
|
1417
|
+
), m = this.generateClusterCenters(
|
|
1417
1418
|
g,
|
|
1418
1419
|
s,
|
|
1419
1420
|
r,
|
|
@@ -1424,7 +1425,7 @@ class be {
|
|
|
1424
1425
|
S[w % g]++;
|
|
1425
1426
|
let v = 0;
|
|
1426
1427
|
for (let w = 0; w < g; w++) {
|
|
1427
|
-
const E =
|
|
1428
|
+
const E = m[w], x = S[w];
|
|
1428
1429
|
for (let A = 0; A < x; A++) {
|
|
1429
1430
|
let L, z;
|
|
1430
1431
|
if (a.distribution === "gaussian")
|
|
@@ -1433,13 +1434,13 @@ class be {
|
|
|
1433
1434
|
const M = this.random(0, Math.PI * 2), W = this.random(0, E.spread);
|
|
1434
1435
|
L = Math.cos(M) * W, z = Math.sin(M) * W;
|
|
1435
1436
|
}
|
|
1436
|
-
const
|
|
1437
|
-
L /=
|
|
1438
|
-
const Y = p ? this.random(
|
|
1437
|
+
const U = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
|
|
1438
|
+
L /= U, z /= U;
|
|
1439
|
+
const Y = p ? this.random(f, b) : 1, N = _ * Y, T = c * N;
|
|
1439
1440
|
let D = E.x + L, k = E.y + z;
|
|
1440
1441
|
const R = T * 1.5 / 2, C = T / 2;
|
|
1441
1442
|
D = Math.max(h + R, Math.min(D, s - h - R)), k = Math.max(h + C, Math.min(k, r - h - C));
|
|
1442
|
-
const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread,
|
|
1443
|
+
const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread, P = Math.round((1 - F) * 50) + 1;
|
|
1443
1444
|
o.push({
|
|
1444
1445
|
id: v,
|
|
1445
1446
|
x: D,
|
|
@@ -1447,7 +1448,7 @@ class be {
|
|
|
1447
1448
|
rotation: O,
|
|
1448
1449
|
scale: N,
|
|
1449
1450
|
baseSize: T,
|
|
1450
|
-
zIndex:
|
|
1451
|
+
zIndex: P
|
|
1451
1452
|
}), v++;
|
|
1452
1453
|
}
|
|
1453
1454
|
}
|
|
@@ -1470,22 +1471,22 @@ class be {
|
|
|
1470
1471
|
generateClusterCenters(t, e, i, o, s) {
|
|
1471
1472
|
const r = [], h = o + s.clusterSpread, c = e - o - s.clusterSpread, u = o + s.clusterSpread, l = i - o - s.clusterSpread;
|
|
1472
1473
|
for (let d = 0; d < t; d++) {
|
|
1473
|
-
let
|
|
1474
|
+
let f = null, b = -1;
|
|
1474
1475
|
for (let p = 0; p < 100; p++) {
|
|
1475
1476
|
const g = {
|
|
1476
1477
|
x: this.random(h, c),
|
|
1477
1478
|
y: this.random(u, l),
|
|
1478
1479
|
spread: this.calculateClusterSpread(s)
|
|
1479
1480
|
};
|
|
1480
|
-
let
|
|
1481
|
+
let m = 1 / 0;
|
|
1481
1482
|
for (const S of r) {
|
|
1482
1483
|
const v = g.x - S.x, w = g.y - S.y, E = Math.sqrt(v * v + w * w);
|
|
1483
|
-
|
|
1484
|
+
m = Math.min(m, E);
|
|
1484
1485
|
}
|
|
1485
|
-
if ((r.length === 0 ||
|
|
1486
|
+
if ((r.length === 0 || m > b) && (f = g, b = m), m >= s.clusterSpacing)
|
|
1486
1487
|
break;
|
|
1487
1488
|
}
|
|
1488
|
-
|
|
1489
|
+
f && r.push(f);
|
|
1489
1490
|
}
|
|
1490
1491
|
return r;
|
|
1491
1492
|
}
|
|
@@ -1513,7 +1514,7 @@ class be {
|
|
|
1513
1514
|
return Math.random() * (e - t) + t;
|
|
1514
1515
|
}
|
|
1515
1516
|
}
|
|
1516
|
-
class
|
|
1517
|
+
class ve {
|
|
1517
1518
|
constructor(t, e = {}) {
|
|
1518
1519
|
this.config = t, this.imageConfig = e;
|
|
1519
1520
|
}
|
|
@@ -1525,19 +1526,19 @@ class ye {
|
|
|
1525
1526
|
* @returns Array of layout objects with position, rotation, scale
|
|
1526
1527
|
*/
|
|
1527
1528
|
generate(t, e, i = {}) {
|
|
1528
|
-
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,
|
|
1529
|
-
...
|
|
1529
|
+
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, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = i.fixedHeight ?? a, g = {
|
|
1530
|
+
...Nt,
|
|
1530
1531
|
...this.config.wave
|
|
1531
|
-
}, { rows:
|
|
1532
|
+
}, { rows: m, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / m), z = p * 1.5 / 2, U = h + z, _ = s - h - z, Y = _ - U, N = x > 1 ? Y / (x - 1) : 0, T = h + S + p / 2, D = r - h - S - p / 2, k = D - T, H = m > 1 ? k / (m - 1) : 0;
|
|
1532
1533
|
let R = 0;
|
|
1533
|
-
for (let C = 0; C <
|
|
1534
|
-
const O =
|
|
1534
|
+
for (let C = 0; C < m && R < t; C++) {
|
|
1535
|
+
const O = m === 1 ? (T + D) / 2 : T + C * H;
|
|
1535
1536
|
let $ = 0;
|
|
1536
1537
|
E === "offset" ? $ = C * w : E === "alternating" && ($ = C * Math.PI);
|
|
1537
1538
|
for (let F = 0; F < x && R < t; F++) {
|
|
1538
|
-
const
|
|
1539
|
+
const P = x === 1 ? (U + _) / 2 : U + F * N, M = this.calculateWaveY(P, s, S, v, $), W = P, G = O + M, X = b ? this.random(d, f) : 1, B = p * X;
|
|
1539
1540
|
let J = 0;
|
|
1540
|
-
c === "tangent" ? J = this.calculateRotation(
|
|
1541
|
+
c === "tangent" ? J = this.calculateRotation(P, s, S, v, $) : c === "random" && (J = this.random(u, l));
|
|
1541
1542
|
const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
|
|
1542
1543
|
o.push({
|
|
1543
1544
|
id: R,
|
|
@@ -1590,7 +1591,7 @@ class ye {
|
|
|
1590
1591
|
return Math.random() * (e - t) + t;
|
|
1591
1592
|
}
|
|
1592
1593
|
}
|
|
1593
|
-
class
|
|
1594
|
+
class we {
|
|
1594
1595
|
constructor(t) {
|
|
1595
1596
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
|
|
1596
1597
|
}
|
|
@@ -1601,17 +1602,17 @@ class ve {
|
|
|
1601
1602
|
initLayout() {
|
|
1602
1603
|
switch (this.config.algorithm) {
|
|
1603
1604
|
case "radial":
|
|
1604
|
-
return new
|
|
1605
|
+
return new de(this.config, this.imageConfig);
|
|
1605
1606
|
case "grid":
|
|
1606
|
-
return new
|
|
1607
|
+
return new ge(this.config, this.imageConfig);
|
|
1607
1608
|
case "spiral":
|
|
1608
|
-
return new
|
|
1609
|
+
return new pe(this.config, this.imageConfig);
|
|
1609
1610
|
case "cluster":
|
|
1610
|
-
return new be(this.config, this.imageConfig);
|
|
1611
|
-
case "wave":
|
|
1612
1611
|
return new ye(this.config, this.imageConfig);
|
|
1612
|
+
case "wave":
|
|
1613
|
+
return new ve(this.config, this.imageConfig);
|
|
1613
1614
|
default:
|
|
1614
|
-
return new
|
|
1615
|
+
return new he(this.config, this.imageConfig);
|
|
1615
1616
|
}
|
|
1616
1617
|
}
|
|
1617
1618
|
/**
|
|
@@ -1694,12 +1695,12 @@ class ve {
|
|
|
1694
1695
|
if (r !== void 0)
|
|
1695
1696
|
return { height: r };
|
|
1696
1697
|
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;
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1699
|
-
let S = this.clamp(
|
|
1700
|
-
if (S === a &&
|
|
1698
|
+
let m = Math.sqrt(p / 1.4);
|
|
1699
|
+
m *= u, m = Math.min(m, i);
|
|
1700
|
+
let S = this.clamp(m, a, h);
|
|
1701
|
+
if (S === a && m < a) {
|
|
1701
1702
|
const v = Math.max(a * 0.05, 20);
|
|
1702
|
-
S = Math.max(v,
|
|
1703
|
+
S = Math.max(v, m);
|
|
1703
1704
|
}
|
|
1704
1705
|
return { height: S };
|
|
1705
1706
|
}
|
|
@@ -1711,13 +1712,27 @@ class ve {
|
|
|
1711
1712
|
}
|
|
1712
1713
|
}
|
|
1713
1714
|
var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1715
|
+
const At = {
|
|
1716
|
+
// Geometric shapes - uses percentages for responsive sizing
|
|
1717
|
+
circle: "circle(50%)",
|
|
1718
|
+
square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
|
|
1719
|
+
triangle: "polygon(50% 0%, 100% 100%, 0% 100%)",
|
|
1720
|
+
pentagon: "polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",
|
|
1721
|
+
hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
|
|
1722
|
+
octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
|
|
1723
|
+
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
|
|
1724
|
+
};
|
|
1717
1725
|
function xe(n) {
|
|
1718
|
-
|
|
1726
|
+
if (n)
|
|
1727
|
+
return n in At ? At[n] : n;
|
|
1719
1728
|
}
|
|
1720
1729
|
function Se(n) {
|
|
1730
|
+
return n in ft;
|
|
1731
|
+
}
|
|
1732
|
+
function Ee(n) {
|
|
1733
|
+
return n ? Se(n) ? ft[n] : n : ft.md;
|
|
1734
|
+
}
|
|
1735
|
+
function Ie(n) {
|
|
1721
1736
|
if (!n) return "";
|
|
1722
1737
|
const t = [];
|
|
1723
1738
|
if (n.grayscale !== void 0 && t.push(`grayscale(${n.grayscale})`), n.blur !== void 0 && t.push(`blur(${n.blur}px)`), n.brightness !== void 0 && t.push(`brightness(${n.brightness})`), n.contrast !== void 0 && t.push(`contrast(${n.contrast})`), n.saturate !== void 0 && t.push(`saturate(${n.saturate})`), n.opacity !== void 0 && t.push(`opacity(${n.opacity})`), n.sepia !== void 0 && t.push(`sepia(${n.sepia})`), n.hueRotate !== void 0 && t.push(`hue-rotate(${n.hueRotate}deg)`), n.invert !== void 0 && t.push(`invert(${n.invert})`), n.dropShadow !== void 0)
|
|
@@ -1746,37 +1761,41 @@ function st(n) {
|
|
|
1746
1761
|
const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
|
|
1747
1762
|
t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
|
|
1748
1763
|
} else n.border && (t.border = Q(n.border));
|
|
1749
|
-
n.shadow !== void 0 && (t.boxShadow =
|
|
1750
|
-
const o =
|
|
1764
|
+
n.shadow !== void 0 && (t.boxShadow = Ee(n.shadow));
|
|
1765
|
+
const o = Ie(n.filter);
|
|
1751
1766
|
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) {
|
|
1752
1767
|
const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
|
|
1753
1768
|
t.outline = `${s}px ${r} ${a}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
|
|
1754
1769
|
}
|
|
1755
|
-
|
|
1770
|
+
if (n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
|
|
1771
|
+
const s = xe(n.clipPath);
|
|
1772
|
+
s && (s === "none" ? t.clipPath = "unset" : (t.clipPath = s, t.overflow = "hidden"));
|
|
1773
|
+
}
|
|
1774
|
+
return t;
|
|
1756
1775
|
}
|
|
1757
1776
|
function tt(n, t) {
|
|
1758
|
-
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);
|
|
1777
|
+
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), t.clipPath !== void 0 && (n.style.clipPath = t.clipPath), t.overflow !== void 0 && (n.style.overflow = t.overflow);
|
|
1759
1778
|
}
|
|
1760
|
-
function
|
|
1779
|
+
function zt(n) {
|
|
1761
1780
|
return n ? Array.isArray(n) ? n.join(" ") : n : "";
|
|
1762
1781
|
}
|
|
1763
1782
|
function et(n, t) {
|
|
1764
|
-
const e =
|
|
1783
|
+
const e = zt(t);
|
|
1765
1784
|
e && e.split(" ").forEach((i) => {
|
|
1766
1785
|
i.trim() && n.classList.add(i.trim());
|
|
1767
1786
|
});
|
|
1768
1787
|
}
|
|
1769
|
-
function
|
|
1770
|
-
const e =
|
|
1788
|
+
function Ft(n, t) {
|
|
1789
|
+
const e = zt(t);
|
|
1771
1790
|
e && e.split(" ").forEach((i) => {
|
|
1772
1791
|
i.trim() && n.classList.remove(i.trim());
|
|
1773
1792
|
});
|
|
1774
1793
|
}
|
|
1775
|
-
const
|
|
1794
|
+
const Tt = {
|
|
1776
1795
|
UNFOCUSING: 999,
|
|
1777
1796
|
FOCUSING: 1e3
|
|
1778
1797
|
};
|
|
1779
|
-
class
|
|
1798
|
+
class Ae {
|
|
1780
1799
|
constructor(t, e, i) {
|
|
1781
1800
|
this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = st(i?.default), this.focusedStyles = st(i?.focused), this.defaultClassName = i?.default?.className, this.focusedClassName = i?.focused?.className;
|
|
1782
1801
|
}
|
|
@@ -1869,7 +1888,7 @@ class Ee {
|
|
|
1869
1888
|
* Remove focused styling from an element
|
|
1870
1889
|
*/
|
|
1871
1890
|
removeFocusedStyling(t, e) {
|
|
1872
|
-
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"),
|
|
1891
|
+
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Ft(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
|
|
1873
1892
|
}
|
|
1874
1893
|
/**
|
|
1875
1894
|
* Start focus animation for an image using dimension-based zoom
|
|
@@ -1879,19 +1898,19 @@ class Ee {
|
|
|
1879
1898
|
*/
|
|
1880
1899
|
startFocusAnimation(t, e, i, o, s) {
|
|
1881
1900
|
const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
|
|
1882
|
-
this.applyFocusedStyling(t,
|
|
1901
|
+
this.applyFocusedStyling(t, Tt.FOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
1883
1902
|
const l = o ?? {
|
|
1884
1903
|
x: 0,
|
|
1885
1904
|
y: 0,
|
|
1886
1905
|
rotation: i.rotation,
|
|
1887
1906
|
scale: 1
|
|
1888
1907
|
// No scale - using dimensions
|
|
1889
|
-
}, d = s?.width ?? a,
|
|
1908
|
+
}, d = s?.width ?? a, f = s?.height ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
|
|
1890
1909
|
t,
|
|
1891
1910
|
l,
|
|
1892
1911
|
u,
|
|
1893
1912
|
d,
|
|
1894
|
-
|
|
1913
|
+
f,
|
|
1895
1914
|
c.width,
|
|
1896
1915
|
c.height,
|
|
1897
1916
|
b
|
|
@@ -1928,7 +1947,7 @@ class Ee {
|
|
|
1928
1947
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
1929
1948
|
*/
|
|
1930
1949
|
startUnfocusAnimation(t, e, i, o) {
|
|
1931
|
-
t.style.zIndex = String(
|
|
1950
|
+
t.style.zIndex = String(Tt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
1932
1951
|
const s = i ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, r = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, a = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, h = {
|
|
1933
1952
|
x: 0,
|
|
1934
1953
|
y: 0,
|
|
@@ -1944,7 +1963,7 @@ class Ee {
|
|
|
1944
1963
|
c,
|
|
1945
1964
|
u,
|
|
1946
1965
|
l
|
|
1947
|
-
),
|
|
1966
|
+
), f = {
|
|
1948
1967
|
id: `unfocus-${Date.now()}`,
|
|
1949
1968
|
element: t,
|
|
1950
1969
|
animation: d,
|
|
@@ -1956,7 +1975,7 @@ class Ee {
|
|
|
1956
1975
|
return {
|
|
1957
1976
|
element: t,
|
|
1958
1977
|
originalState: e,
|
|
1959
|
-
animationHandle:
|
|
1978
|
+
animationHandle: f,
|
|
1960
1979
|
direction: "out",
|
|
1961
1980
|
originalWidth: c,
|
|
1962
1981
|
originalHeight: u
|
|
@@ -2216,7 +2235,7 @@ class Ee {
|
|
|
2216
2235
|
), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2217
2236
|
}
|
|
2218
2237
|
}
|
|
2219
|
-
const
|
|
2238
|
+
const Te = 50, Ce = 0.5, Re = 20, Me = 0.3, Le = 150, ze = 30, at = class at {
|
|
2220
2239
|
constructor(t, e) {
|
|
2221
2240
|
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);
|
|
2222
2241
|
}
|
|
@@ -2263,11 +2282,11 @@ const Ie = 50, Ae = 0.5, Te = 20, Ce = 0.3, Re = 150, Me = 30, at = class at {
|
|
|
2263
2282
|
const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
|
|
2264
2283
|
if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
|
|
2265
2284
|
const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
|
|
2266
|
-
this.touchState.isHorizontalSwipe = a <=
|
|
2285
|
+
this.touchState.isHorizontalSwipe = a <= ze;
|
|
2267
2286
|
}
|
|
2268
2287
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2269
2288
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
|
|
2270
|
-
const s = i *
|
|
2289
|
+
const s = i * Me;
|
|
2271
2290
|
this.callbacks.onDragOffset(s);
|
|
2272
2291
|
}
|
|
2273
2292
|
}
|
|
@@ -2276,15 +2295,15 @@ const Ie = 50, Ae = 0.5, Te = 20, Ce = 0.3, Re = 150, Me = 30, at = class at {
|
|
|
2276
2295
|
this.recentTouchTimestamp = Date.now();
|
|
2277
2296
|
const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, s = Math.abs(e);
|
|
2278
2297
|
let r = !1;
|
|
2279
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >=
|
|
2298
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Te || o >= Ce && s >= Re) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2280
2299
|
}
|
|
2281
2300
|
handleTouchCancel(t) {
|
|
2282
2301
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
2283
2302
|
}
|
|
2284
2303
|
};
|
|
2285
2304
|
at.TOUCH_CLICK_DELAY = 300;
|
|
2286
|
-
let
|
|
2287
|
-
class
|
|
2305
|
+
let mt = at;
|
|
2306
|
+
class Fe {
|
|
2288
2307
|
constructor(t) {
|
|
2289
2308
|
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)
|
|
2290
2309
|
throw new Error("GoogleDriveLoader requires at least one source to be configured");
|
|
@@ -2505,7 +2524,7 @@ class Le {
|
|
|
2505
2524
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2506
2525
|
}
|
|
2507
2526
|
}
|
|
2508
|
-
class
|
|
2527
|
+
class De {
|
|
2509
2528
|
constructor(t) {
|
|
2510
2529
|
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)
|
|
2511
2530
|
throw new Error("StaticImageLoader requires at least one source to be configured");
|
|
@@ -2685,7 +2704,7 @@ class ze {
|
|
|
2685
2704
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2686
2705
|
}
|
|
2687
2706
|
}
|
|
2688
|
-
class
|
|
2707
|
+
class Oe {
|
|
2689
2708
|
constructor(t) {
|
|
2690
2709
|
if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
|
|
2691
2710
|
throw new Error("CompositeLoader requires at least one loader to be configured");
|
|
@@ -2742,7 +2761,7 @@ class Fe {
|
|
|
2742
2761
|
this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
|
|
2743
2762
|
}
|
|
2744
2763
|
}
|
|
2745
|
-
class
|
|
2764
|
+
class $e {
|
|
2746
2765
|
/**
|
|
2747
2766
|
* Create a new ImageFilter
|
|
2748
2767
|
* @param extensions - Array of allowed file extensions (without dots)
|
|
@@ -2779,7 +2798,7 @@ class De {
|
|
|
2779
2798
|
// isAllowedDate(date: Date): boolean
|
|
2780
2799
|
// isAllowedDimensions(width: number, height: number): boolean
|
|
2781
2800
|
}
|
|
2782
|
-
const
|
|
2801
|
+
const Pe = `
|
|
2783
2802
|
.fbn-ic-gallery {
|
|
2784
2803
|
position: relative;
|
|
2785
2804
|
width: 100%;
|
|
@@ -2829,21 +2848,21 @@ const Oe = `
|
|
|
2829
2848
|
display: none !important;
|
|
2830
2849
|
}
|
|
2831
2850
|
`;
|
|
2832
|
-
function
|
|
2851
|
+
function Ue() {
|
|
2833
2852
|
if (typeof document > "u") return;
|
|
2834
2853
|
const n = "fbn-ic-functional-styles";
|
|
2835
2854
|
if (document.getElementById(n)) return;
|
|
2836
2855
|
const t = document.createElement("style");
|
|
2837
|
-
t.id = n, t.textContent =
|
|
2856
|
+
t.id = n, t.textContent = Pe, document.head.appendChild(t);
|
|
2838
2857
|
}
|
|
2839
|
-
let
|
|
2858
|
+
let _e = class {
|
|
2840
2859
|
constructor(t = {}) {
|
|
2841
|
-
this.fullConfig =
|
|
2860
|
+
this.fullConfig = Bt(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 Zt(this.fullConfig.animation), this.layoutEngine = new we({
|
|
2842
2861
|
layout: this.fullConfig.layout,
|
|
2843
2862
|
image: this.fullConfig.image
|
|
2844
|
-
}), this.zoomEngine = new
|
|
2863
|
+
}), this.zoomEngine = new Ae(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = st(this.fullConfig.styling?.default), this.hoverStyles = st(this.fullConfig.styling?.hover), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
|
|
2845
2864
|
const e = this.fullConfig.animation.entry || y.animation.entry;
|
|
2846
|
-
this.entryAnimationEngine = new
|
|
2865
|
+
this.entryAnimationEngine = new le(
|
|
2847
2866
|
e,
|
|
2848
2867
|
this.fullConfig.layout.algorithm
|
|
2849
2868
|
), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
@@ -2853,7 +2872,7 @@ let Ue = class {
|
|
|
2853
2872
|
*/
|
|
2854
2873
|
createImageFilter() {
|
|
2855
2874
|
const t = this.fullConfig.config.loaders?.allowedExtensions;
|
|
2856
|
-
return new
|
|
2875
|
+
return new $e(t);
|
|
2857
2876
|
}
|
|
2858
2877
|
/**
|
|
2859
2878
|
* Create appropriate image loader based on config
|
|
@@ -2864,7 +2883,7 @@ let Ue = class {
|
|
|
2864
2883
|
if (!t || t.length === 0)
|
|
2865
2884
|
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
|
|
2866
2885
|
const i = t.map((o) => this.createLoaderFromEntry(o, e));
|
|
2867
|
-
return i.length === 1 ? i[0] : new
|
|
2886
|
+
return i.length === 1 ? i[0] : new Oe({
|
|
2868
2887
|
loaders: i,
|
|
2869
2888
|
debugLogging: this.fullConfig.config.debug?.loaders
|
|
2870
2889
|
});
|
|
@@ -2882,14 +2901,14 @@ let Ue = class {
|
|
|
2882
2901
|
allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
|
|
2883
2902
|
debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2884
2903
|
};
|
|
2885
|
-
return new
|
|
2904
|
+
return new De(o);
|
|
2886
2905
|
} else if ("googleDrive" in t) {
|
|
2887
2906
|
const i = t.googleDrive, o = {
|
|
2888
2907
|
...i,
|
|
2889
2908
|
allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
|
|
2890
2909
|
debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2891
2910
|
};
|
|
2892
|
-
return new
|
|
2911
|
+
return new Fe(o);
|
|
2893
2912
|
} else
|
|
2894
2913
|
throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
|
|
2895
2914
|
}
|
|
@@ -2898,16 +2917,16 @@ let Ue = class {
|
|
|
2898
2917
|
*/
|
|
2899
2918
|
async init() {
|
|
2900
2919
|
try {
|
|
2901
|
-
if (
|
|
2920
|
+
if (Ue(), this.containerRef)
|
|
2902
2921
|
this.containerEl = this.containerRef;
|
|
2903
2922
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
2904
2923
|
throw new Error(`Container #${this.containerId} not found`);
|
|
2905
|
-
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new
|
|
2924
|
+
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new mt(this.containerEl, {
|
|
2906
2925
|
onNext: () => this.navigateToNextImage(),
|
|
2907
2926
|
onPrev: () => this.navigateToPreviousImage(),
|
|
2908
2927
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
2909
2928
|
onDragEnd: (t) => {
|
|
2910
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
2929
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Le);
|
|
2911
2930
|
}
|
|
2912
2931
|
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
2913
2932
|
} catch (t) {
|
|
@@ -3034,20 +3053,20 @@ let Ue = class {
|
|
|
3034
3053
|
const d = {
|
|
3035
3054
|
x: parseFloat(c.dataset.startX),
|
|
3036
3055
|
y: parseFloat(c.dataset.startY)
|
|
3037
|
-
},
|
|
3056
|
+
}, f = {
|
|
3038
3057
|
x: parseFloat(c.dataset.endX),
|
|
3039
3058
|
y: parseFloat(c.dataset.endY)
|
|
3040
|
-
}, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation),
|
|
3041
|
-
|
|
3059
|
+
}, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, w = this.entryAnimationEngine.getTiming();
|
|
3060
|
+
ae({
|
|
3042
3061
|
element: c,
|
|
3043
3062
|
startPosition: d,
|
|
3044
|
-
endPosition:
|
|
3063
|
+
endPosition: f,
|
|
3045
3064
|
pathConfig: this.entryAnimationEngine.getPathConfig(),
|
|
3046
3065
|
duration: w.duration,
|
|
3047
3066
|
imageWidth: b,
|
|
3048
3067
|
imageHeight: p,
|
|
3049
3068
|
rotation: g,
|
|
3050
|
-
scale:
|
|
3069
|
+
scale: m,
|
|
3051
3070
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3052
3071
|
startRotation: S,
|
|
3053
3072
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
@@ -3104,8 +3123,8 @@ let Ue = class {
|
|
|
3104
3123
|
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), s.forEach((c, u) => {
|
|
3105
3124
|
const l = document.createElement("div");
|
|
3106
3125
|
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";
|
|
3107
|
-
const d = c.x,
|
|
3108
|
-
l.style.left = `${d - 6}px`, l.style.top = `${
|
|
3126
|
+
const d = c.x, f = c.y;
|
|
3127
|
+
l.style.left = `${d - 6}px`, l.style.top = `${f - 6}px`, l.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(l);
|
|
3109
3128
|
})), t.forEach((c, u) => {
|
|
3110
3129
|
const l = document.createElement("img");
|
|
3111
3130
|
l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(u);
|
|
@@ -3113,15 +3132,15 @@ let Ue = class {
|
|
|
3113
3132
|
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", () => {
|
|
3114
3133
|
this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
|
|
3115
3134
|
}), l.addEventListener("mouseleave", () => {
|
|
3116
|
-
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles),
|
|
3117
|
-
}), l.addEventListener("click", (
|
|
3118
|
-
|
|
3135
|
+
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), Ft(l, this.hoverClassName), et(l, this.defaultClassName));
|
|
3136
|
+
}), l.addEventListener("click", (f) => {
|
|
3137
|
+
f.stopPropagation(), this.handleImageClick(l, d);
|
|
3119
3138
|
}), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
|
|
3120
3139
|
if (o !== this.loadGeneration)
|
|
3121
3140
|
return;
|
|
3122
|
-
const
|
|
3141
|
+
const f = l.naturalWidth / l.naturalHeight, b = e * f;
|
|
3123
3142
|
l.style.width = `${b}px`;
|
|
3124
|
-
const p = { x: d.x, y: d.y }, g = { width: b, height: e },
|
|
3143
|
+
const p = { x: d.x, y: d.y }, g = { width: b, height: e }, m = this.entryAnimationEngine.calculateStartPosition(
|
|
3125
3144
|
p,
|
|
3126
3145
|
g,
|
|
3127
3146
|
i,
|
|
@@ -3133,7 +3152,7 @@ let Ue = class {
|
|
|
3133
3152
|
b,
|
|
3134
3153
|
e
|
|
3135
3154
|
), E = this.entryAnimationEngine.buildStartTransform(
|
|
3136
|
-
|
|
3155
|
+
m,
|
|
3137
3156
|
p,
|
|
3138
3157
|
d.rotation,
|
|
3139
3158
|
d.scale,
|
|
@@ -3150,7 +3169,7 @@ let Ue = class {
|
|
|
3150
3169
|
finalTransform: w,
|
|
3151
3170
|
renderedWidth: b,
|
|
3152
3171
|
renderedHeight: e
|
|
3153
|
-
}), 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(
|
|
3172
|
+
}), 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(m.x), l.dataset.startY = String(m.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);
|
|
3154
3173
|
}, l.onerror = () => r++, l.src = c;
|
|
3155
3174
|
});
|
|
3156
3175
|
}
|
|
@@ -3195,7 +3214,7 @@ let Ue = class {
|
|
|
3195
3214
|
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();
|
|
3196
3215
|
}
|
|
3197
3216
|
};
|
|
3198
|
-
const
|
|
3217
|
+
const je = $t({
|
|
3199
3218
|
name: "ImageCloud",
|
|
3200
3219
|
props: {
|
|
3201
3220
|
options: {
|
|
@@ -3208,7 +3227,7 @@ const He = Ot({
|
|
|
3208
3227
|
function o() {
|
|
3209
3228
|
if (!e.value) return;
|
|
3210
3229
|
i.value?.destroy();
|
|
3211
|
-
const s = new
|
|
3230
|
+
const s = new _e({
|
|
3212
3231
|
container: e.value,
|
|
3213
3232
|
...n.options
|
|
3214
3233
|
});
|
|
@@ -3216,22 +3235,22 @@ const He = Ot({
|
|
|
3216
3235
|
console.error("ImageCloud init failed:", r);
|
|
3217
3236
|
});
|
|
3218
3237
|
}
|
|
3219
|
-
return
|
|
3238
|
+
return Pt(() => {
|
|
3220
3239
|
o();
|
|
3221
3240
|
}), Ut(() => {
|
|
3222
3241
|
i.value?.destroy(), i.value = null;
|
|
3223
|
-
}),
|
|
3242
|
+
}), _t(
|
|
3224
3243
|
() => n.options,
|
|
3225
3244
|
() => {
|
|
3226
3245
|
o();
|
|
3227
3246
|
},
|
|
3228
3247
|
{ deep: !0 }
|
|
3229
|
-
), t({ instance: i }), () =>
|
|
3248
|
+
), t({ instance: i }), () => Ht("div", {
|
|
3230
3249
|
ref: e
|
|
3231
3250
|
});
|
|
3232
3251
|
}
|
|
3233
3252
|
});
|
|
3234
3253
|
export {
|
|
3235
|
-
|
|
3254
|
+
je as ImageCloud
|
|
3236
3255
|
};
|
|
3237
3256
|
//# sourceMappingURL=vue.js.map
|