@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ot = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary: #1a1a2e;--fbn-ic-bg-glass: rgba(255, 255, 255, .05);--fbn-ic-border-glass: rgba(255, 255, 255, .1);--fbn-ic-text-primary: #ffffff;--fbn-ic-text-secondary: #b8b8d1;--fbn-ic-text-muted: #6b6b8f;--fbn-ic-accent-primary: #6366f1;--fbn-ic-accent-secondary: #8b5cf6;--fbn-ic-accent-glow: rgba(99, 102, 241, .4);--fbn-ic-transition-smooth: cubic-bezier(.4, 0, .2, 1);--fbn-ic-transition-bounce: cubic-bezier(.68, -.55, .265, 1.55);--fbn-ic-shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);--fbn-ic-shadow-md: 0 4px 16px rgba(0, 0, 0, .4);--fbn-ic-shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);--fbn-ic-shadow-glow: 0 0 20px var(--fbn-ic-accent-glow)}.fbn-ic-gallery{position:relative;width:100%;height:100%;overflow:hidden;perspective:1000px}.fbn-ic-image{position:absolute;border-radius:8px;box-shadow:var(--fbn-ic-shadow-md);cursor:pointer;transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s .6s;will-change:transform;-webkit-user-select:none;user-select:none;backface-visibility:hidden;-webkit-backface-visibility:hidden}.fbn-ic-image:hover{box-shadow:var(--fbn-ic-shadow-lg)}.fbn-ic-image.fbn-ic-focused{z-index:1000;box-shadow:0 20px 60px #000000b3,var(--fbn-ic-shadow-glow);transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s 0s;will-change:auto}.fbn-ic-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;color:var(--fbn-ic-text-secondary);z-index:100;pointer-events:none}.fbn-ic-spinner{width:50px;height:50px;margin:0 auto 1rem;border:4px solid var(--fbn-ic-border-glass);border-top:4px solid var(--fbn-ic-accent-primary);border-radius:50%;animation:fbn-ic-spin 1s linear infinite}@keyframes fbn-ic-spin{to{transform:rotate(360deg)}}.fbn-ic-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:600px;padding:1.5rem;background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:12px;color:#fca5a5;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:100}.fbn-ic-counter{background:#0009;color:#fff;padding:6px 16px;border-radius:16px;font-family:system-ui,sans-serif;font-size:14px}.fbn-ic-hidden{display:none!important}", ft = 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)",
|
|
@@ -24,7 +24,7 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
24
24
|
mode: "none"
|
|
25
25
|
}), yt = Object.freeze({
|
|
26
26
|
mode: "none"
|
|
27
|
-
}),
|
|
27
|
+
}), Ct = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
30
30
|
width: 0,
|
|
@@ -33,6 +33,7 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
33
33
|
style: "solid"
|
|
34
34
|
}),
|
|
35
35
|
shadow: "none",
|
|
36
|
+
clipPath: void 0,
|
|
36
37
|
filter: Object.freeze({}),
|
|
37
38
|
opacity: 1,
|
|
38
39
|
cursor: "pointer",
|
|
@@ -49,14 +50,14 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
49
50
|
focused: Object.freeze({
|
|
50
51
|
shadow: "none"
|
|
51
52
|
})
|
|
52
|
-
}),
|
|
53
|
+
}), $t = Object.freeze({
|
|
53
54
|
rows: 1,
|
|
54
55
|
amplitude: 100,
|
|
55
56
|
frequency: 2,
|
|
56
57
|
phaseShift: 0,
|
|
57
58
|
synchronization: "offset"
|
|
58
59
|
// Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
|
|
59
|
-
}),
|
|
60
|
+
}), Pt = Object.freeze({
|
|
60
61
|
mobile: Object.freeze({ maxWidth: 767 }),
|
|
61
62
|
tablet: Object.freeze({ maxWidth: 1199 })
|
|
62
63
|
}), Ut = Object.freeze({
|
|
@@ -71,21 +72,21 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
71
72
|
// No variance by default
|
|
72
73
|
max: 1
|
|
73
74
|
})
|
|
74
|
-
}),
|
|
75
|
+
}), _t = Object.freeze({
|
|
75
76
|
mode: "none",
|
|
76
77
|
range: Object.freeze({
|
|
77
78
|
min: -15,
|
|
78
79
|
max: 15
|
|
79
80
|
})
|
|
80
|
-
}), Ct = Object.freeze({
|
|
81
|
-
sizing: Ut,
|
|
82
|
-
rotation: Pt
|
|
83
81
|
}), Tt = Object.freeze({
|
|
82
|
+
sizing: Ut,
|
|
83
|
+
rotation: _t
|
|
84
|
+
}), Rt = Object.freeze({
|
|
84
85
|
validateUrls: !0,
|
|
85
86
|
validationTimeout: 5e3,
|
|
86
87
|
validationMethod: "head",
|
|
87
88
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
|
|
88
|
-
}),
|
|
89
|
+
}), Mt = Object.freeze({
|
|
89
90
|
enabled: !1,
|
|
90
91
|
centers: !1,
|
|
91
92
|
loaders: !1
|
|
@@ -94,17 +95,17 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
94
95
|
loaders: [],
|
|
95
96
|
// Shared loader settings and debug config
|
|
96
97
|
config: Object.freeze({
|
|
97
|
-
loaders:
|
|
98
|
-
debug:
|
|
98
|
+
loaders: Rt,
|
|
99
|
+
debug: Mt
|
|
99
100
|
}),
|
|
100
101
|
// Image sizing and rotation configuration
|
|
101
|
-
image:
|
|
102
|
+
image: Tt,
|
|
102
103
|
// Pattern-based layout configuration
|
|
103
104
|
layout: Object.freeze({
|
|
104
105
|
algorithm: "radial",
|
|
105
106
|
scaleDecay: 0,
|
|
106
107
|
// No decay by default (0-1 for radial/spiral)
|
|
107
|
-
responsive:
|
|
108
|
+
responsive: Pt,
|
|
108
109
|
targetCoverage: 0.6,
|
|
109
110
|
// Target 60% of container area
|
|
110
111
|
densityFactor: 1,
|
|
@@ -215,15 +216,15 @@ const Dt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
215
216
|
})
|
|
216
217
|
}),
|
|
217
218
|
// Image styling
|
|
218
|
-
styling:
|
|
219
|
+
styling: Ct
|
|
219
220
|
});
|
|
220
221
|
function Z(n, t) {
|
|
221
222
|
if (!n) return t || {};
|
|
222
223
|
if (!t) return { ...n };
|
|
223
224
|
const e = { ...n };
|
|
224
|
-
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;
|
|
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.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;
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
+
function Ht(n, t) {
|
|
227
228
|
if (!t) return { ...n };
|
|
228
229
|
const e = Z(n.default, t.default), i = Z(
|
|
229
230
|
Z(e, n.hover),
|
|
@@ -257,7 +258,7 @@ function Nt(n, t) {
|
|
|
257
258
|
}
|
|
258
259
|
return e;
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function kt(n) {
|
|
261
262
|
const t = n.layout?.rotation;
|
|
262
263
|
if (t && "enabled" in t)
|
|
263
264
|
return {
|
|
@@ -267,7 +268,7 @@ function Ht(n) {
|
|
|
267
268
|
}
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function jt(n) {
|
|
271
272
|
const t = n.layout?.sizing?.variance;
|
|
272
273
|
if (t)
|
|
273
274
|
return {
|
|
@@ -278,8 +279,8 @@ function kt(n) {
|
|
|
278
279
|
}
|
|
279
280
|
};
|
|
280
281
|
}
|
|
281
|
-
function
|
|
282
|
-
const t =
|
|
282
|
+
function Gt(n = {}) {
|
|
283
|
+
const t = kt(n), e = jt(n);
|
|
283
284
|
let i = n.image;
|
|
284
285
|
(t || e) && (i = {
|
|
285
286
|
...e || {},
|
|
@@ -297,18 +298,18 @@ function jt(n = {}) {
|
|
|
297
298
|
});
|
|
298
299
|
const r = {
|
|
299
300
|
loaders: {
|
|
300
|
-
...
|
|
301
|
+
...Rt,
|
|
301
302
|
...n.config?.loaders ?? {}
|
|
302
303
|
}
|
|
303
304
|
}, a = {
|
|
304
305
|
loaders: o,
|
|
305
306
|
config: r,
|
|
306
|
-
image: Nt(
|
|
307
|
+
image: Nt(Tt, i),
|
|
307
308
|
layout: { ...y.layout },
|
|
308
309
|
animation: { ...y.animation },
|
|
309
310
|
interaction: { ...y.interaction },
|
|
310
311
|
rendering: { ...y.rendering },
|
|
311
|
-
styling:
|
|
312
|
+
styling: Ht(Ct, n.styling)
|
|
312
313
|
};
|
|
313
314
|
return n.layout && (a.layout = {
|
|
314
315
|
...y.layout,
|
|
@@ -371,20 +372,20 @@ function jt(n = {}) {
|
|
|
371
372
|
...y.rendering.performance,
|
|
372
373
|
...n.rendering.performance
|
|
373
374
|
})), a.config.debug = {
|
|
374
|
-
...
|
|
375
|
+
...Mt,
|
|
375
376
|
...n.config?.debug ?? {}
|
|
376
377
|
}, a;
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function Wt(n, t) {
|
|
379
380
|
return { ...n ? wt[n] : wt.playful, ...t };
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
+
function qt(n, t) {
|
|
382
383
|
return { ...n ? xt[n] : xt.gentle, ...t };
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
+
function Yt(n, t) {
|
|
385
386
|
return { ...n ? St[n] : St.gentle, ...t };
|
|
386
387
|
}
|
|
387
|
-
class
|
|
388
|
+
class Xt {
|
|
388
389
|
constructor(t) {
|
|
389
390
|
this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
|
|
390
391
|
}
|
|
@@ -543,8 +544,8 @@ class Yt {
|
|
|
543
544
|
function V(n, t, e) {
|
|
544
545
|
return n + (t - n) * e;
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
-
const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c =
|
|
547
|
+
function Bt(n, t, e, i) {
|
|
548
|
+
const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = Jt(s, r);
|
|
548
549
|
let u = 0, l = 0, d = 1, f = o, b = !1;
|
|
549
550
|
for (let g = 0; g < c.length; g++)
|
|
550
551
|
if (n <= c[g].time) {
|
|
@@ -567,7 +568,7 @@ function Xt(n, t, e, i) {
|
|
|
567
568
|
y: t.y + h * u
|
|
568
569
|
};
|
|
569
570
|
}
|
|
570
|
-
function
|
|
571
|
+
function Jt(n, t) {
|
|
571
572
|
const e = [];
|
|
572
573
|
let i = 0.6;
|
|
573
574
|
e.push({ time: i, overshoot: 0, isOvershoot: !1 });
|
|
@@ -577,7 +578,7 @@ function Bt(n, t) {
|
|
|
577
578
|
i += r, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
|
|
578
579
|
return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
|
|
579
580
|
}
|
|
580
|
-
function
|
|
581
|
+
function Vt(n, t, e, i) {
|
|
581
582
|
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));
|
|
582
583
|
let d;
|
|
583
584
|
if (l < 1) {
|
|
@@ -590,8 +591,8 @@ function Jt(n, t, e, i) {
|
|
|
590
591
|
y: t.y + c * d
|
|
591
592
|
};
|
|
592
593
|
}
|
|
593
|
-
function
|
|
594
|
-
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 =
|
|
594
|
+
function Kt(n, t, e, i) {
|
|
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, 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 = Zt(n);
|
|
595
596
|
return {
|
|
596
597
|
x: V(t.x, e.x, m) + g * d,
|
|
597
598
|
y: V(t.y, e.y, m) + g * f
|
|
@@ -600,14 +601,14 @@ function Vt(n, t, e, i) {
|
|
|
600
601
|
function ot(n) {
|
|
601
602
|
return 1 - (1 - n) * (1 - n);
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
+
function Zt(n) {
|
|
604
605
|
return 1 - Math.pow(1 - n, 3);
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
+
function Qt(n, t, e) {
|
|
607
608
|
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;
|
|
608
609
|
return t + h;
|
|
609
610
|
}
|
|
610
|
-
function
|
|
611
|
+
function te(n, t, e) {
|
|
611
612
|
const { overshoot: i, bounces: o } = e, s = [];
|
|
612
613
|
s.push({ time: 0.5, scale: i });
|
|
613
614
|
let r = i;
|
|
@@ -627,7 +628,7 @@ function Qt(n, t, e) {
|
|
|
627
628
|
}
|
|
628
629
|
return l * t;
|
|
629
630
|
}
|
|
630
|
-
function
|
|
631
|
+
function ee(n) {
|
|
631
632
|
const {
|
|
632
633
|
element: t,
|
|
633
634
|
startPosition: e,
|
|
@@ -648,33 +649,33 @@ function te(n) {
|
|
|
648
649
|
u && u();
|
|
649
650
|
return;
|
|
650
651
|
}
|
|
651
|
-
const L = performance.now(), z = -r / 2,
|
|
652
|
+
const L = performance.now(), z = -r / 2, U = -a / 2;
|
|
652
653
|
function _(Y) {
|
|
653
|
-
const
|
|
654
|
+
const N = Y - L, C = Math.min(N / s, 1);
|
|
654
655
|
let D;
|
|
655
656
|
switch (p) {
|
|
656
657
|
case "bounce": {
|
|
657
|
-
const O =
|
|
658
|
+
const O = Wt(
|
|
658
659
|
o.bouncePreset,
|
|
659
660
|
o.bounce
|
|
660
661
|
);
|
|
661
|
-
D =
|
|
662
|
+
D = Bt(C, e, i, O);
|
|
662
663
|
break;
|
|
663
664
|
}
|
|
664
665
|
case "elastic": {
|
|
665
|
-
const O =
|
|
666
|
+
const O = qt(
|
|
666
667
|
o.elasticPreset,
|
|
667
668
|
o.elastic
|
|
668
669
|
);
|
|
669
|
-
D =
|
|
670
|
+
D = Vt(C, e, i, O);
|
|
670
671
|
break;
|
|
671
672
|
}
|
|
672
673
|
case "wave": {
|
|
673
|
-
const O =
|
|
674
|
+
const O = Yt(
|
|
674
675
|
o.wavePreset,
|
|
675
676
|
o.wave
|
|
676
677
|
);
|
|
677
|
-
D =
|
|
678
|
+
D = Kt(C, e, i, O);
|
|
678
679
|
break;
|
|
679
680
|
}
|
|
680
681
|
default:
|
|
@@ -683,18 +684,18 @@ function te(n) {
|
|
|
683
684
|
y: V(e.y, i.y, C)
|
|
684
685
|
};
|
|
685
686
|
}
|
|
686
|
-
const j = D.x - i.x,
|
|
687
|
+
const j = D.x - i.x, H = D.y - i.y;
|
|
687
688
|
let R;
|
|
688
|
-
m ? R =
|
|
689
|
+
m ? R = Qt(C, h, S) : g ? R = V(d, h, C) : R = h;
|
|
689
690
|
let T;
|
|
690
|
-
E ? T =
|
|
691
|
+
E ? T = te(C, c, x) : w ? T = V(b, c, C) : T = c, t.style.transform = `translate(${z}px, ${U}px) translate(${j}px, ${H}px) rotate(${R}deg) scale(${T})`, C < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${U}px) rotate(${h}deg) scale(${c})`, u && u());
|
|
691
692
|
}
|
|
692
693
|
requestAnimationFrame(_);
|
|
693
694
|
}
|
|
694
|
-
function
|
|
695
|
+
function ie(n) {
|
|
695
696
|
return n === "bounce" || n === "elastic" || n === "wave";
|
|
696
697
|
}
|
|
697
|
-
const
|
|
698
|
+
const ne = {
|
|
698
699
|
radial: "center",
|
|
699
700
|
spiral: "center",
|
|
700
701
|
grid: "top",
|
|
@@ -702,7 +703,7 @@ const ie = {
|
|
|
702
703
|
random: "nearest-edge",
|
|
703
704
|
wave: "left"
|
|
704
705
|
};
|
|
705
|
-
class
|
|
706
|
+
class oe {
|
|
706
707
|
constructor(t, e) {
|
|
707
708
|
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;
|
|
708
709
|
}
|
|
@@ -710,7 +711,7 @@ class ne {
|
|
|
710
711
|
* Get the effective start position, considering layout-aware defaults
|
|
711
712
|
*/
|
|
712
713
|
resolveStartPosition() {
|
|
713
|
-
return this.config.start.position ? this.config.start.position :
|
|
714
|
+
return this.config.start.position ? this.config.start.position : ne[this.layoutAlgorithm] || "nearest-edge";
|
|
714
715
|
}
|
|
715
716
|
/**
|
|
716
717
|
* Calculate the starting position for an image's entry animation
|
|
@@ -855,7 +856,7 @@ class ne {
|
|
|
855
856
|
* Check if the current path type requires JavaScript animation
|
|
856
857
|
*/
|
|
857
858
|
requiresJSAnimation() {
|
|
858
|
-
return
|
|
859
|
+
return ie(this.pathConfig.type);
|
|
859
860
|
}
|
|
860
861
|
/**
|
|
861
862
|
* Get the path configuration
|
|
@@ -1046,7 +1047,7 @@ class ne {
|
|
|
1046
1047
|
return 1 - (1 - t) * (1 - t);
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
|
-
class
|
|
1050
|
+
class se {
|
|
1050
1051
|
constructor(t, e = {}) {
|
|
1051
1052
|
this.config = t, this.imageConfig = e;
|
|
1052
1053
|
}
|
|
@@ -1060,12 +1061,12 @@ class oe {
|
|
|
1060
1061
|
generate(t, e, i = {}) {
|
|
1061
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, 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;
|
|
1062
1063
|
for (let x = 0; x < t; x++) {
|
|
1063
|
-
const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0,
|
|
1064
|
+
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 = {
|
|
1064
1065
|
id: x,
|
|
1065
1066
|
x: A,
|
|
1066
1067
|
y: L,
|
|
1067
1068
|
rotation: z,
|
|
1068
|
-
scale:
|
|
1069
|
+
scale: U,
|
|
1069
1070
|
baseSize: _
|
|
1070
1071
|
};
|
|
1071
1072
|
o.push(Y);
|
|
@@ -1082,7 +1083,7 @@ class oe {
|
|
|
1082
1083
|
return Math.random() * (e - t) + t;
|
|
1083
1084
|
}
|
|
1084
1085
|
}
|
|
1085
|
-
class
|
|
1086
|
+
class ae {
|
|
1086
1087
|
constructor(t, e = {}) {
|
|
1087
1088
|
this.config = t, this.imageConfig = e;
|
|
1088
1089
|
}
|
|
@@ -1111,24 +1112,24 @@ class se {
|
|
|
1111
1112
|
}
|
|
1112
1113
|
let v = 1, w = 1;
|
|
1113
1114
|
for (; v < t; ) {
|
|
1114
|
-
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))),
|
|
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))), U = this.estimateWidth(p), _ = Math.floor(z / (U * 0.7));
|
|
1115
1116
|
if (_ === 0) {
|
|
1116
1117
|
w++;
|
|
1117
1118
|
continue;
|
|
1118
1119
|
}
|
|
1119
|
-
const Y = 2 * Math.PI / _,
|
|
1120
|
+
const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
|
|
1120
1121
|
for (let C = 0; C < _ && v < t; C++) {
|
|
1121
|
-
const D = C * Y +
|
|
1122
|
+
const D = C * Y + N, j = f ? this.random(l, d) : 1, H = x * j, R = p * H;
|
|
1122
1123
|
let T = g + Math.cos(D) * L, O = m + Math.sin(D) * A;
|
|
1123
|
-
const $ = this.config.spacing.padding ?? 50,
|
|
1124
|
-
T -
|
|
1124
|
+
const $ = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
|
|
1125
|
+
T - P < $ ? T = $ + P : T + P > s - $ && (T = s - $ - P), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
|
|
1125
1126
|
const G = h === "random" ? this.random(c, u) : 0;
|
|
1126
1127
|
o.push({
|
|
1127
1128
|
id: v,
|
|
1128
1129
|
x: T,
|
|
1129
1130
|
y: O,
|
|
1130
1131
|
rotation: G,
|
|
1131
|
-
scale:
|
|
1132
|
+
scale: H,
|
|
1132
1133
|
baseSize: R,
|
|
1133
1134
|
zIndex: Math.max(1, 100 - w)
|
|
1134
1135
|
// Outer rings have lower z-index
|
|
@@ -1157,7 +1158,7 @@ class se {
|
|
|
1157
1158
|
return Math.random() * (e - t) + t;
|
|
1158
1159
|
}
|
|
1159
1160
|
}
|
|
1160
|
-
const
|
|
1161
|
+
const re = {
|
|
1161
1162
|
columns: "auto",
|
|
1162
1163
|
rows: "auto",
|
|
1163
1164
|
stagger: "none",
|
|
@@ -1185,7 +1186,7 @@ const ae = {
|
|
|
1185
1186
|
{ x: 0, y: 1 }
|
|
1186
1187
|
// down
|
|
1187
1188
|
];
|
|
1188
|
-
class
|
|
1189
|
+
class ce {
|
|
1189
1190
|
constructor(t, e = {}) {
|
|
1190
1191
|
this.config = t, this.imageConfig = e;
|
|
1191
1192
|
}
|
|
@@ -1197,33 +1198,33 @@ class re {
|
|
|
1197
1198
|
* @returns Array of layout objects with position, rotation, scale
|
|
1198
1199
|
*/
|
|
1199
1200
|
generate(t, e, i = {}) {
|
|
1200
|
-
const o = [], { width: s, height: r } = e, a = { ...
|
|
1201
|
+
const o = [], { width: s, height: r } = e, a = { ...re, ...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(
|
|
1201
1202
|
t,
|
|
1202
1203
|
b,
|
|
1203
1204
|
p,
|
|
1204
1205
|
c,
|
|
1205
1206
|
a
|
|
1206
|
-
), 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,
|
|
1207
|
+
), 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, C = m * A + (m - 1) * a.gap + z, D = h + (b - N) / 2, j = h + (p - C) / 2, H = g * m, R = a.columns !== "auto" && a.rows !== "auto", T = R && t > H;
|
|
1207
1208
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1208
1209
|
gridConfigColumns: a.columns,
|
|
1209
1210
|
gridConfigRows: a.rows,
|
|
1210
1211
|
columns: g,
|
|
1211
1212
|
rows: m,
|
|
1212
|
-
cellCount:
|
|
1213
|
+
cellCount: H,
|
|
1213
1214
|
hasFixedGrid: R,
|
|
1214
1215
|
imageCount: t,
|
|
1215
1216
|
isOverflowMode: T
|
|
1216
1217
|
});
|
|
1217
|
-
const O = T ? new Array(
|
|
1218
|
+
const O = T ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
|
|
1218
1219
|
for (let F = 0; F < t; F++) {
|
|
1219
|
-
let
|
|
1220
|
-
if (T && F >=
|
|
1221
|
-
const q = F -
|
|
1222
|
-
G = Math.floor(q /
|
|
1220
|
+
let P, M, G = 0;
|
|
1221
|
+
if (T && F >= H) {
|
|
1222
|
+
const q = F - H, k = q % H;
|
|
1223
|
+
G = Math.floor(q / H) + 1, O[k]++, a.fillDirection === "row" ? (P = k % g, M = Math.floor(k / g)) : (M = k % m, P = Math.floor(k / m));
|
|
1223
1224
|
} else
|
|
1224
|
-
a.fillDirection === "row" ? (
|
|
1225
|
-
let W = D +
|
|
1226
|
-
if (a.stagger === "row" && M % 2 === 1 ? W += x / 2 : a.stagger === "column" &&
|
|
1225
|
+
a.fillDirection === "row" ? (P = F % g, M = Math.floor(F / g)) : (M = F % m, P = Math.floor(F / m));
|
|
1226
|
+
let W = D + P * (x + a.gap) + x / 2, X = j + M * (A + a.gap) + A / 2;
|
|
1227
|
+
if (a.stagger === "row" && M % 2 === 1 ? W += x / 2 : a.stagger === "column" && P % 2 === 1 && (X += A / 2), G > 0) {
|
|
1227
1228
|
const q = (G - 1) % Et.length, k = Et[q];
|
|
1228
1229
|
W += k.x * $, X += k.y * $;
|
|
1229
1230
|
}
|
|
@@ -1237,11 +1238,11 @@ class re {
|
|
|
1237
1238
|
if (M === Math.floor((t - 1) / g) && q < g) {
|
|
1238
1239
|
const vt = q * x + (q - 1) * a.gap;
|
|
1239
1240
|
let gt = 0;
|
|
1240
|
-
a.alignment === "center" ? gt = (
|
|
1241
|
+
a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
|
|
1241
1242
|
}
|
|
1242
1243
|
}
|
|
1243
|
-
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,
|
|
1244
|
-
B = Math.max(lt, Math.min(B, ht)), J = Math.max(
|
|
1244
|
+
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, Ft = h + nt, Dt = r - h - nt;
|
|
1245
|
+
B = Math.max(lt, Math.min(B, ht)), J = Math.max(Ft, Math.min(J, Dt));
|
|
1245
1246
|
let dt = 0;
|
|
1246
1247
|
if (u === "random") {
|
|
1247
1248
|
const q = this.imageConfig.rotation?.range?.min ?? -15, k = this.imageConfig.rotation?.range?.max ?? 15;
|
|
@@ -1285,14 +1286,14 @@ class re {
|
|
|
1285
1286
|
return Math.random() * (e - t) + t;
|
|
1286
1287
|
}
|
|
1287
1288
|
}
|
|
1288
|
-
const
|
|
1289
|
+
const le = Math.PI * (3 - Math.sqrt(5)), he = {
|
|
1289
1290
|
spiralType: "golden",
|
|
1290
1291
|
direction: "counterclockwise",
|
|
1291
1292
|
tightness: 1,
|
|
1292
1293
|
scaleDecay: 0,
|
|
1293
1294
|
startAngle: 0
|
|
1294
1295
|
};
|
|
1295
|
-
class
|
|
1296
|
+
class de {
|
|
1296
1297
|
constructor(t, e = {}) {
|
|
1297
1298
|
this.config = t, this.imageConfig = e;
|
|
1298
1299
|
}
|
|
@@ -1304,14 +1305,14 @@ class he {
|
|
|
1304
1305
|
* @returns Array of layout objects with position, rotation, scale
|
|
1305
1306
|
*/
|
|
1306
1307
|
generate(t, e, i = {}) {
|
|
1307
|
-
const o = [], { width: s, height: r } = e, a = { ...
|
|
1308
|
+
const o = [], { width: s, height: r } = e, a = { ...he, ...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(
|
|
1308
1309
|
m - h - c / 2,
|
|
1309
1310
|
S - h - c / 2
|
|
1310
1311
|
), w = a.direction === "clockwise" ? -1 : 1;
|
|
1311
1312
|
for (let E = 0; E < t; E++) {
|
|
1312
1313
|
let x, A;
|
|
1313
1314
|
if (a.spiralType === "golden")
|
|
1314
|
-
x = E *
|
|
1315
|
+
x = E * le * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
|
|
1315
1316
|
else if (a.spiralType === "archimedean") {
|
|
1316
1317
|
const W = E * 0.5 * a.tightness;
|
|
1317
1318
|
x = W * w + a.startAngle, A = this.calculateArchimedeanRadius(W, t, v, a.tightness);
|
|
@@ -1319,7 +1320,7 @@ class he {
|
|
|
1319
1320
|
const W = E * 0.3 * a.tightness;
|
|
1320
1321
|
x = W * w + a.startAngle, A = this.calculateLogarithmicRadius(W, t, v, a.tightness);
|
|
1321
1322
|
}
|
|
1322
|
-
const L = m + Math.cos(x) * A, z = S + Math.sin(x) * A,
|
|
1323
|
+
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, C = c * N, j = C * 1.5 / 2, H = C / 2, R = h + j, T = s - h - j, O = h + H, $ = r - h - H, F = Math.max(R, Math.min(L, T)), P = Math.max(O, Math.min(z, $));
|
|
1323
1324
|
let M = 0;
|
|
1324
1325
|
if (u === "random") {
|
|
1325
1326
|
const W = x * 180 / Math.PI % 360, X = this.random(l, d);
|
|
@@ -1329,9 +1330,9 @@ class he {
|
|
|
1329
1330
|
o.push({
|
|
1330
1331
|
id: E,
|
|
1331
1332
|
x: F,
|
|
1332
|
-
y:
|
|
1333
|
+
y: P,
|
|
1333
1334
|
rotation: M,
|
|
1334
|
-
scale:
|
|
1335
|
+
scale: N,
|
|
1335
1336
|
baseSize: C,
|
|
1336
1337
|
zIndex: G
|
|
1337
1338
|
});
|
|
@@ -1386,7 +1387,7 @@ class he {
|
|
|
1386
1387
|
return Math.random() * (e - t) + t;
|
|
1387
1388
|
}
|
|
1388
1389
|
}
|
|
1389
|
-
const
|
|
1390
|
+
const ue = {
|
|
1390
1391
|
clusterCount: "auto",
|
|
1391
1392
|
clusterSpread: 150,
|
|
1392
1393
|
clusterSpacing: 200,
|
|
@@ -1394,7 +1395,7 @@ const de = {
|
|
|
1394
1395
|
overlap: 0.3,
|
|
1395
1396
|
distribution: "gaussian"
|
|
1396
1397
|
};
|
|
1397
|
-
class
|
|
1398
|
+
class ge {
|
|
1398
1399
|
constructor(t, e = {}) {
|
|
1399
1400
|
this.config = t, this.imageConfig = e;
|
|
1400
1401
|
}
|
|
@@ -1406,7 +1407,7 @@ class ue {
|
|
|
1406
1407
|
* @returns Array of layout objects with position, rotation, scale
|
|
1407
1408
|
*/
|
|
1408
1409
|
generate(t, e, i = {}) {
|
|
1409
|
-
const o = [], { width: s, height: r } = e, a = { ...
|
|
1410
|
+
const o = [], { width: s, height: r } = e, a = { ...ue, ...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(
|
|
1410
1411
|
t,
|
|
1411
1412
|
a.clusterCount,
|
|
1412
1413
|
s,
|
|
@@ -1432,21 +1433,21 @@ class ue {
|
|
|
1432
1433
|
const M = this.random(0, Math.PI * 2), G = this.random(0, E.spread);
|
|
1433
1434
|
L = Math.cos(M) * G, z = Math.sin(M) * G;
|
|
1434
1435
|
}
|
|
1435
|
-
const
|
|
1436
|
-
L /=
|
|
1437
|
-
const Y = p ? this.random(f, b) : 1,
|
|
1436
|
+
const U = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
|
|
1437
|
+
L /= U, z /= U;
|
|
1438
|
+
const Y = p ? this.random(f, b) : 1, N = _ * Y, C = c * N;
|
|
1438
1439
|
let D = E.x + L, j = E.y + z;
|
|
1439
1440
|
const R = C * 1.5 / 2, T = C / 2;
|
|
1440
1441
|
D = Math.max(h + R, Math.min(D, s - h - R)), j = Math.max(h + T, Math.min(j, r - h - T));
|
|
1441
|
-
const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread,
|
|
1442
|
+
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;
|
|
1442
1443
|
o.push({
|
|
1443
1444
|
id: v,
|
|
1444
1445
|
x: D,
|
|
1445
1446
|
y: j,
|
|
1446
1447
|
rotation: O,
|
|
1447
|
-
scale:
|
|
1448
|
+
scale: N,
|
|
1448
1449
|
baseSize: C,
|
|
1449
|
-
zIndex:
|
|
1450
|
+
zIndex: P
|
|
1450
1451
|
}), v++;
|
|
1451
1452
|
}
|
|
1452
1453
|
}
|
|
@@ -1512,7 +1513,7 @@ class ue {
|
|
|
1512
1513
|
return Math.random() * (e - t) + t;
|
|
1513
1514
|
}
|
|
1514
1515
|
}
|
|
1515
|
-
class
|
|
1516
|
+
class fe {
|
|
1516
1517
|
constructor(t, e = {}) {
|
|
1517
1518
|
this.config = t, this.imageConfig = e;
|
|
1518
1519
|
}
|
|
@@ -1525,18 +1526,18 @@ class ge {
|
|
|
1525
1526
|
*/
|
|
1526
1527
|
generate(t, e, i = {}) {
|
|
1527
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, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = i.fixedHeight ?? a, g = {
|
|
1528
|
-
|
|
1529
|
+
...$t,
|
|
1529
1530
|
...this.config.wave
|
|
1530
|
-
}, { rows: m, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / m), z = p * 1.5 / 2,
|
|
1531
|
+
}, { 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, C = h + S + p / 2, D = r - h - S - p / 2, j = D - C, H = m > 1 ? j / (m - 1) : 0;
|
|
1531
1532
|
let R = 0;
|
|
1532
1533
|
for (let T = 0; T < m && R < t; T++) {
|
|
1533
|
-
const O = m === 1 ? (C + D) / 2 : C + T *
|
|
1534
|
+
const O = m === 1 ? (C + D) / 2 : C + T * H;
|
|
1534
1535
|
let $ = 0;
|
|
1535
1536
|
E === "offset" ? $ = T * w : E === "alternating" && ($ = T * Math.PI);
|
|
1536
1537
|
for (let F = 0; F < x && R < t; F++) {
|
|
1537
|
-
const
|
|
1538
|
+
const P = x === 1 ? (U + _) / 2 : U + F * N, M = this.calculateWaveY(P, s, S, v, $), G = P, W = O + M, X = b ? this.random(d, f) : 1, B = p * X;
|
|
1538
1539
|
let J = 0;
|
|
1539
|
-
c === "tangent" ? J = this.calculateRotation(
|
|
1540
|
+
c === "tangent" ? J = this.calculateRotation(P, s, S, v, $) : c === "random" && (J = this.random(u, l));
|
|
1540
1541
|
const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
|
|
1541
1542
|
o.push({
|
|
1542
1543
|
id: R,
|
|
@@ -1589,7 +1590,7 @@ class ge {
|
|
|
1589
1590
|
return Math.random() * (e - t) + t;
|
|
1590
1591
|
}
|
|
1591
1592
|
}
|
|
1592
|
-
class
|
|
1593
|
+
class me {
|
|
1593
1594
|
constructor(t) {
|
|
1594
1595
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
|
|
1595
1596
|
}
|
|
@@ -1600,17 +1601,17 @@ class fe {
|
|
|
1600
1601
|
initLayout() {
|
|
1601
1602
|
switch (this.config.algorithm) {
|
|
1602
1603
|
case "radial":
|
|
1603
|
-
return new
|
|
1604
|
+
return new ae(this.config, this.imageConfig);
|
|
1604
1605
|
case "grid":
|
|
1605
|
-
return new
|
|
1606
|
+
return new ce(this.config, this.imageConfig);
|
|
1606
1607
|
case "spiral":
|
|
1607
|
-
return new
|
|
1608
|
+
return new de(this.config, this.imageConfig);
|
|
1608
1609
|
case "cluster":
|
|
1609
|
-
return new ue(this.config, this.imageConfig);
|
|
1610
|
-
case "wave":
|
|
1611
1610
|
return new ge(this.config, this.imageConfig);
|
|
1611
|
+
case "wave":
|
|
1612
|
+
return new fe(this.config, this.imageConfig);
|
|
1612
1613
|
default:
|
|
1613
|
-
return new
|
|
1614
|
+
return new se(this.config, this.imageConfig);
|
|
1614
1615
|
}
|
|
1615
1616
|
}
|
|
1616
1617
|
/**
|
|
@@ -1710,13 +1711,27 @@ class fe {
|
|
|
1710
1711
|
}
|
|
1711
1712
|
}
|
|
1712
1713
|
var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1714
|
+
const It = {
|
|
1715
|
+
// Geometric shapes - uses percentages for responsive sizing
|
|
1716
|
+
circle: "circle(50%)",
|
|
1717
|
+
square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
|
|
1718
|
+
triangle: "polygon(50% 0%, 100% 100%, 0% 100%)",
|
|
1719
|
+
pentagon: "polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",
|
|
1720
|
+
hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
|
|
1721
|
+
octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
|
|
1722
|
+
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
|
|
1723
|
+
};
|
|
1716
1724
|
function pe(n) {
|
|
1717
|
-
|
|
1725
|
+
if (n)
|
|
1726
|
+
return n in It ? It[n] : n;
|
|
1718
1727
|
}
|
|
1719
1728
|
function be(n) {
|
|
1729
|
+
return n in ft;
|
|
1730
|
+
}
|
|
1731
|
+
function ye(n) {
|
|
1732
|
+
return n ? be(n) ? ft[n] : n : ft.md;
|
|
1733
|
+
}
|
|
1734
|
+
function ve(n) {
|
|
1720
1735
|
if (!n) return "";
|
|
1721
1736
|
const t = [];
|
|
1722
1737
|
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)
|
|
@@ -1745,37 +1760,41 @@ function st(n) {
|
|
|
1745
1760
|
const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
|
|
1746
1761
|
t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
|
|
1747
1762
|
} else n.border && (t.border = Q(n.border));
|
|
1748
|
-
n.shadow !== void 0 && (t.boxShadow =
|
|
1749
|
-
const o =
|
|
1763
|
+
n.shadow !== void 0 && (t.boxShadow = ye(n.shadow));
|
|
1764
|
+
const o = ve(n.filter);
|
|
1750
1765
|
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) {
|
|
1751
1766
|
const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
|
|
1752
1767
|
t.outline = `${s}px ${r} ${a}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
|
|
1753
1768
|
}
|
|
1754
|
-
|
|
1769
|
+
if (n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
|
|
1770
|
+
const s = pe(n.clipPath);
|
|
1771
|
+
s && (s === "none" ? t.clipPath = "unset" : (t.clipPath = s, t.overflow = "hidden"));
|
|
1772
|
+
}
|
|
1773
|
+
return t;
|
|
1755
1774
|
}
|
|
1756
1775
|
function tt(n, t) {
|
|
1757
|
-
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);
|
|
1776
|
+
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);
|
|
1758
1777
|
}
|
|
1759
|
-
function
|
|
1778
|
+
function Lt(n) {
|
|
1760
1779
|
return n ? Array.isArray(n) ? n.join(" ") : n : "";
|
|
1761
1780
|
}
|
|
1762
1781
|
function et(n, t) {
|
|
1763
|
-
const e =
|
|
1782
|
+
const e = Lt(t);
|
|
1764
1783
|
e && e.split(" ").forEach((i) => {
|
|
1765
1784
|
i.trim() && n.classList.add(i.trim());
|
|
1766
1785
|
});
|
|
1767
1786
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const e =
|
|
1787
|
+
function zt(n, t) {
|
|
1788
|
+
const e = Lt(t);
|
|
1770
1789
|
e && e.split(" ").forEach((i) => {
|
|
1771
1790
|
i.trim() && n.classList.remove(i.trim());
|
|
1772
1791
|
});
|
|
1773
1792
|
}
|
|
1774
|
-
const
|
|
1793
|
+
const At = {
|
|
1775
1794
|
UNFOCUSING: 999,
|
|
1776
1795
|
FOCUSING: 1e3
|
|
1777
1796
|
};
|
|
1778
|
-
class
|
|
1797
|
+
class we {
|
|
1779
1798
|
constructor(t, e, i) {
|
|
1780
1799
|
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;
|
|
1781
1800
|
}
|
|
@@ -1868,7 +1887,7 @@ class ye {
|
|
|
1868
1887
|
* Remove focused styling from an element
|
|
1869
1888
|
*/
|
|
1870
1889
|
removeFocusedStyling(t, e) {
|
|
1871
|
-
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"),
|
|
1890
|
+
t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), zt(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
|
|
1872
1891
|
}
|
|
1873
1892
|
/**
|
|
1874
1893
|
* Start focus animation for an image using dimension-based zoom
|
|
@@ -1878,7 +1897,7 @@ class ye {
|
|
|
1878
1897
|
*/
|
|
1879
1898
|
startFocusAnimation(t, e, i, o, s) {
|
|
1880
1899
|
const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
|
|
1881
|
-
this.applyFocusedStyling(t,
|
|
1900
|
+
this.applyFocusedStyling(t, At.FOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
1882
1901
|
const l = o ?? {
|
|
1883
1902
|
x: 0,
|
|
1884
1903
|
y: 0,
|
|
@@ -1927,7 +1946,7 @@ class ye {
|
|
|
1927
1946
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
1928
1947
|
*/
|
|
1929
1948
|
startUnfocusAnimation(t, e, i, o) {
|
|
1930
|
-
t.style.zIndex = String(
|
|
1949
|
+
t.style.zIndex = String(At.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
1931
1950
|
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 = {
|
|
1932
1951
|
x: 0,
|
|
1933
1952
|
y: 0,
|
|
@@ -2215,7 +2234,7 @@ class ye {
|
|
|
2215
2234
|
), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2216
2235
|
}
|
|
2217
2236
|
}
|
|
2218
|
-
const
|
|
2237
|
+
const xe = 50, Se = 0.5, Ee = 20, Ie = 0.3, Ae = 150, Ce = 30, at = class at {
|
|
2219
2238
|
constructor(t, e) {
|
|
2220
2239
|
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);
|
|
2221
2240
|
}
|
|
@@ -2262,11 +2281,11 @@ const ve = 50, we = 0.5, xe = 20, Se = 0.3, Ee = 150, Ie = 30, at = class at {
|
|
|
2262
2281
|
const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
|
|
2263
2282
|
if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
|
|
2264
2283
|
const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
|
|
2265
|
-
this.touchState.isHorizontalSwipe = a <=
|
|
2284
|
+
this.touchState.isHorizontalSwipe = a <= Ce;
|
|
2266
2285
|
}
|
|
2267
2286
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2268
2287
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
|
|
2269
|
-
const s = i *
|
|
2288
|
+
const s = i * Ie;
|
|
2270
2289
|
this.callbacks.onDragOffset(s);
|
|
2271
2290
|
}
|
|
2272
2291
|
}
|
|
@@ -2275,7 +2294,7 @@ const ve = 50, we = 0.5, xe = 20, Se = 0.3, Ee = 150, Ie = 30, at = class at {
|
|
|
2275
2294
|
this.recentTouchTimestamp = Date.now();
|
|
2276
2295
|
const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, s = Math.abs(e);
|
|
2277
2296
|
let r = !1;
|
|
2278
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >=
|
|
2297
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= xe || o >= Se && s >= Ee) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2279
2298
|
}
|
|
2280
2299
|
handleTouchCancel(t) {
|
|
2281
2300
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
@@ -2283,7 +2302,7 @@ const ve = 50, we = 0.5, xe = 20, Se = 0.3, Ee = 150, Ie = 30, at = class at {
|
|
|
2283
2302
|
};
|
|
2284
2303
|
at.TOUCH_CLICK_DELAY = 300;
|
|
2285
2304
|
let mt = at;
|
|
2286
|
-
class
|
|
2305
|
+
class Te {
|
|
2287
2306
|
constructor(t) {
|
|
2288
2307
|
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)
|
|
2289
2308
|
throw new Error("GoogleDriveLoader requires at least one source to be configured");
|
|
@@ -2504,7 +2523,7 @@ class Ae {
|
|
|
2504
2523
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2505
2524
|
}
|
|
2506
2525
|
}
|
|
2507
|
-
class
|
|
2526
|
+
class Re {
|
|
2508
2527
|
constructor(t) {
|
|
2509
2528
|
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)
|
|
2510
2529
|
throw new Error("StaticImageLoader requires at least one source to be configured");
|
|
@@ -2684,7 +2703,7 @@ class Ce {
|
|
|
2684
2703
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2685
2704
|
}
|
|
2686
2705
|
}
|
|
2687
|
-
class
|
|
2706
|
+
class Me {
|
|
2688
2707
|
constructor(t) {
|
|
2689
2708
|
if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
|
|
2690
2709
|
throw new Error("CompositeLoader requires at least one loader to be configured");
|
|
@@ -2741,7 +2760,7 @@ class Te {
|
|
|
2741
2760
|
this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
|
|
2742
2761
|
}
|
|
2743
2762
|
}
|
|
2744
|
-
class
|
|
2763
|
+
class Le {
|
|
2745
2764
|
/**
|
|
2746
2765
|
* Create a new ImageFilter
|
|
2747
2766
|
* @param extensions - Array of allowed file extensions (without dots)
|
|
@@ -2778,7 +2797,7 @@ class Re {
|
|
|
2778
2797
|
// isAllowedDate(date: Date): boolean
|
|
2779
2798
|
// isAllowedDimensions(width: number, height: number): boolean
|
|
2780
2799
|
}
|
|
2781
|
-
const
|
|
2800
|
+
const ze = `
|
|
2782
2801
|
.fbn-ic-gallery {
|
|
2783
2802
|
position: relative;
|
|
2784
2803
|
width: 100%;
|
|
@@ -2828,21 +2847,21 @@ const Me = `
|
|
|
2828
2847
|
display: none !important;
|
|
2829
2848
|
}
|
|
2830
2849
|
`;
|
|
2831
|
-
function
|
|
2850
|
+
function Fe() {
|
|
2832
2851
|
if (typeof document > "u") return;
|
|
2833
2852
|
const n = "fbn-ic-functional-styles";
|
|
2834
2853
|
if (document.getElementById(n)) return;
|
|
2835
2854
|
const t = document.createElement("style");
|
|
2836
|
-
t.id = n, t.textContent =
|
|
2855
|
+
t.id = n, t.textContent = ze, document.head.appendChild(t);
|
|
2837
2856
|
}
|
|
2838
|
-
class
|
|
2857
|
+
class De {
|
|
2839
2858
|
constructor(t = {}) {
|
|
2840
|
-
this.fullConfig =
|
|
2859
|
+
this.fullConfig = Gt(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 Xt(this.fullConfig.animation), this.layoutEngine = new me({
|
|
2841
2860
|
layout: this.fullConfig.layout,
|
|
2842
2861
|
image: this.fullConfig.image
|
|
2843
|
-
}), this.zoomEngine = new
|
|
2862
|
+
}), this.zoomEngine = new we(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;
|
|
2844
2863
|
const e = this.fullConfig.animation.entry || y.animation.entry;
|
|
2845
|
-
this.entryAnimationEngine = new
|
|
2864
|
+
this.entryAnimationEngine = new oe(
|
|
2846
2865
|
e,
|
|
2847
2866
|
this.fullConfig.layout.algorithm
|
|
2848
2867
|
), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
@@ -2852,7 +2871,7 @@ class ze {
|
|
|
2852
2871
|
*/
|
|
2853
2872
|
createImageFilter() {
|
|
2854
2873
|
const t = this.fullConfig.config.loaders?.allowedExtensions;
|
|
2855
|
-
return new
|
|
2874
|
+
return new Le(t);
|
|
2856
2875
|
}
|
|
2857
2876
|
/**
|
|
2858
2877
|
* Create appropriate image loader based on config
|
|
@@ -2863,7 +2882,7 @@ class ze {
|
|
|
2863
2882
|
if (!t || t.length === 0)
|
|
2864
2883
|
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
|
|
2865
2884
|
const i = t.map((o) => this.createLoaderFromEntry(o, e));
|
|
2866
|
-
return i.length === 1 ? i[0] : new
|
|
2885
|
+
return i.length === 1 ? i[0] : new Me({
|
|
2867
2886
|
loaders: i,
|
|
2868
2887
|
debugLogging: this.fullConfig.config.debug?.loaders
|
|
2869
2888
|
});
|
|
@@ -2881,14 +2900,14 @@ class ze {
|
|
|
2881
2900
|
allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
|
|
2882
2901
|
debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2883
2902
|
};
|
|
2884
|
-
return new
|
|
2903
|
+
return new Re(o);
|
|
2885
2904
|
} else if ("googleDrive" in t) {
|
|
2886
2905
|
const i = t.googleDrive, o = {
|
|
2887
2906
|
...i,
|
|
2888
2907
|
allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
|
|
2889
2908
|
debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2890
2909
|
};
|
|
2891
|
-
return new
|
|
2910
|
+
return new Te(o);
|
|
2892
2911
|
} else
|
|
2893
2912
|
throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
|
|
2894
2913
|
}
|
|
@@ -2897,7 +2916,7 @@ class ze {
|
|
|
2897
2916
|
*/
|
|
2898
2917
|
async init() {
|
|
2899
2918
|
try {
|
|
2900
|
-
if (
|
|
2919
|
+
if (Fe(), this.containerRef)
|
|
2901
2920
|
this.containerEl = this.containerRef;
|
|
2902
2921
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
2903
2922
|
throw new Error(`Container #${this.containerId} not found`);
|
|
@@ -2906,7 +2925,7 @@ class ze {
|
|
|
2906
2925
|
onPrev: () => this.navigateToPreviousImage(),
|
|
2907
2926
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
2908
2927
|
onDragEnd: (t) => {
|
|
2909
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
2928
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ae);
|
|
2910
2929
|
}
|
|
2911
2930
|
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
2912
2931
|
} catch (t) {
|
|
@@ -3037,7 +3056,7 @@ class ze {
|
|
|
3037
3056
|
x: parseFloat(c.dataset.endX),
|
|
3038
3057
|
y: parseFloat(c.dataset.endY)
|
|
3039
3058
|
}, 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();
|
|
3040
|
-
|
|
3059
|
+
ee({
|
|
3041
3060
|
element: c,
|
|
3042
3061
|
startPosition: d,
|
|
3043
3062
|
endPosition: f,
|
|
@@ -3112,7 +3131,7 @@ class ze {
|
|
|
3112
3131
|
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", () => {
|
|
3113
3132
|
this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
|
|
3114
3133
|
}), l.addEventListener("mouseleave", () => {
|
|
3115
|
-
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles),
|
|
3134
|
+
this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), zt(l, this.hoverClassName), et(l, this.defaultClassName));
|
|
3116
3135
|
}), l.addEventListener("click", (f) => {
|
|
3117
3136
|
f.stopPropagation(), this.handleImageClick(l, d);
|
|
3118
3137
|
}), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
|
|
@@ -3194,15 +3213,15 @@ class ze {
|
|
|
3194
3213
|
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();
|
|
3195
3214
|
}
|
|
3196
3215
|
}
|
|
3197
|
-
function
|
|
3216
|
+
function Oe() {
|
|
3198
3217
|
if (typeof document > "u") return;
|
|
3199
3218
|
const n = "fbn-ic-styles";
|
|
3200
3219
|
if (document.getElementById(n)) return;
|
|
3201
3220
|
const t = document.createElement("style");
|
|
3202
|
-
t.id = n, t.textContent =
|
|
3221
|
+
t.id = n, t.textContent = Ot, document.head.appendChild(t);
|
|
3203
3222
|
}
|
|
3204
|
-
|
|
3205
|
-
function
|
|
3223
|
+
Oe();
|
|
3224
|
+
function $e() {
|
|
3206
3225
|
if (typeof document > "u") {
|
|
3207
3226
|
console.warn("ImageCloud: Document not available (not in browser environment)");
|
|
3208
3227
|
return;
|
|
@@ -3232,17 +3251,17 @@ function De() {
|
|
|
3232
3251
|
console.error(`ImageCloud: Missing configuration for #${i.id}. Add data-config='{...}' attribute.`);
|
|
3233
3252
|
return;
|
|
3234
3253
|
}
|
|
3235
|
-
new
|
|
3254
|
+
new De(s).init().catch((a) => {
|
|
3236
3255
|
console.error("ImageCloud initialization failed:", a);
|
|
3237
3256
|
});
|
|
3238
3257
|
});
|
|
3239
3258
|
};
|
|
3240
3259
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", n) : n();
|
|
3241
3260
|
}
|
|
3242
|
-
|
|
3261
|
+
$e();
|
|
3243
3262
|
export {
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3263
|
+
De as ImageCloud,
|
|
3264
|
+
De as ImageGallery,
|
|
3265
|
+
$e as autoInitialize
|
|
3247
3266
|
};
|
|
3248
3267
|
//# sourceMappingURL=image-cloud-auto-init.js.map
|