@frybynite/image-cloud 0.9.2 → 0.9.3
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 +298 -315
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +671 -688
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +2 -2
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +7 -17
- package/dist/react.d.ts +7 -17
- package/dist/react.js +565 -582
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +7 -17
- package/dist/vue.js +675 -692
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +7 -17
- package/dist/web-component.js +363 -380
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/web-component.js
CHANGED
|
@@ -50,9 +50,9 @@ const mt = Object.freeze({
|
|
|
50
50
|
focused: Object.freeze({
|
|
51
51
|
shadow: "none"
|
|
52
52
|
})
|
|
53
|
-
}), kt = Object.freeze({
|
|
54
|
-
tightness: 1
|
|
55
53
|
}), Nt = Object.freeze({
|
|
54
|
+
tightness: 1
|
|
55
|
+
}), kt = Object.freeze({
|
|
56
56
|
rows: 1,
|
|
57
57
|
amplitude: 100,
|
|
58
58
|
frequency: 2,
|
|
@@ -85,22 +85,22 @@ const mt = Object.freeze({
|
|
|
85
85
|
}), zt = Object.freeze({
|
|
86
86
|
sizing: Gt,
|
|
87
87
|
rotation: qt
|
|
88
|
-
}),
|
|
88
|
+
}), _t = Object.freeze({
|
|
89
89
|
validateUrls: !0,
|
|
90
90
|
validationTimeout: 5e3,
|
|
91
91
|
validationMethod: "head",
|
|
92
92
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
|
|
93
|
-
}),
|
|
93
|
+
}), Dt = Object.freeze({
|
|
94
94
|
enabled: !1,
|
|
95
95
|
centers: !1,
|
|
96
96
|
loaders: !1
|
|
97
|
-
}), Bt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), Xt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Yt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Jt = Object.freeze({ speed: 4e3, direction: "clockwise" }), $t = Object.freeze({ type: "none" }),
|
|
97
|
+
}), Bt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), Xt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Yt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Jt = Object.freeze({ speed: 4e3, direction: "clockwise" }), $t = Object.freeze({ type: "none" }), R = Object.freeze({
|
|
98
98
|
// Loader configuration (always an array, composite behavior is implicit)
|
|
99
99
|
loaders: [],
|
|
100
100
|
// Shared loader settings and debug config
|
|
101
101
|
config: Object.freeze({
|
|
102
|
-
loaders:
|
|
103
|
-
debug:
|
|
102
|
+
loaders: _t,
|
|
103
|
+
debug: Dt
|
|
104
104
|
}),
|
|
105
105
|
// Image sizing and rotation configuration
|
|
106
106
|
image: zt,
|
|
@@ -178,22 +178,10 @@ const mt = Object.freeze({
|
|
|
178
178
|
}),
|
|
179
179
|
dragging: !0
|
|
180
180
|
}),
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
mobile: 768,
|
|
186
|
-
tablet: void 0,
|
|
187
|
-
// STUB: Not implemented yet
|
|
188
|
-
desktop: void 0
|
|
189
|
-
// STUB: Not implemented yet
|
|
190
|
-
}),
|
|
191
|
-
mobileDetection: () => typeof window > "u" ? !1 : window.innerWidth <= 768
|
|
192
|
-
}),
|
|
193
|
-
ui: Object.freeze({
|
|
194
|
-
showLoadingSpinner: !1,
|
|
195
|
-
showImageCounter: !1
|
|
196
|
-
})
|
|
181
|
+
// UI configuration
|
|
182
|
+
ui: Object.freeze({
|
|
183
|
+
showLoadingSpinner: !1,
|
|
184
|
+
showImageCounter: !1
|
|
197
185
|
}),
|
|
198
186
|
// Image styling
|
|
199
187
|
styling: Ot
|
|
@@ -278,75 +266,70 @@ function te(o = {}) {
|
|
|
278
266
|
});
|
|
279
267
|
const r = {
|
|
280
268
|
loaders: {
|
|
281
|
-
...
|
|
269
|
+
..._t,
|
|
282
270
|
...o.config?.loaders ?? {}
|
|
283
271
|
}
|
|
284
272
|
}, s = {
|
|
285
273
|
loaders: n,
|
|
286
274
|
config: r,
|
|
287
275
|
image: Kt(zt, e),
|
|
288
|
-
layout: { ...
|
|
289
|
-
animation: { ...
|
|
290
|
-
interaction: { ...
|
|
291
|
-
|
|
276
|
+
layout: { ...R.layout },
|
|
277
|
+
animation: { ...R.animation },
|
|
278
|
+
interaction: { ...R.interaction },
|
|
279
|
+
ui: { ...R.ui },
|
|
292
280
|
styling: Vt(Ot, o.styling)
|
|
293
281
|
};
|
|
294
|
-
|
|
295
|
-
...
|
|
282
|
+
o.layout && (s.layout = {
|
|
283
|
+
...R.layout,
|
|
296
284
|
...o.layout
|
|
297
285
|
}, o.layout.responsive && (s.layout.responsive = {
|
|
298
|
-
...
|
|
299
|
-
mobile: o.layout.responsive.mobile ? { ...
|
|
300
|
-
tablet: o.layout.responsive.tablet ? { ...
|
|
286
|
+
...R.layout.responsive,
|
|
287
|
+
mobile: o.layout.responsive.mobile ? { ...R.layout.responsive.mobile, ...o.layout.responsive.mobile } : R.layout.responsive.mobile,
|
|
288
|
+
tablet: o.layout.responsive.tablet ? { ...R.layout.responsive.tablet, ...o.layout.responsive.tablet } : R.layout.responsive.tablet
|
|
301
289
|
}), o.layout.spacing && (s.layout.spacing = {
|
|
302
|
-
...
|
|
290
|
+
...R.layout.spacing,
|
|
303
291
|
...o.layout.spacing
|
|
304
292
|
})), o.animation && (s.animation = {
|
|
305
|
-
...
|
|
293
|
+
...R.animation,
|
|
306
294
|
...o.animation
|
|
307
295
|
}, o.animation.easing && (s.animation.easing = {
|
|
308
|
-
...
|
|
296
|
+
...R.animation.easing,
|
|
309
297
|
...o.animation.easing
|
|
310
298
|
}), o.animation.queue && (s.animation.queue = {
|
|
311
|
-
...
|
|
299
|
+
...R.animation.queue,
|
|
312
300
|
...o.animation.queue
|
|
313
301
|
}), o.animation.entry && (s.animation.entry = {
|
|
314
|
-
...
|
|
302
|
+
...R.animation.entry,
|
|
315
303
|
...o.animation.entry,
|
|
316
304
|
start: o.animation.entry.start ? {
|
|
317
|
-
...
|
|
305
|
+
...R.animation.entry.start,
|
|
318
306
|
...o.animation.entry.start,
|
|
319
|
-
circular: o.animation.entry.start.circular ? { ...
|
|
320
|
-
} :
|
|
321
|
-
timing: o.animation.entry.timing ? { ...
|
|
322
|
-
path: o.animation.entry.path ? { ...vt, ...o.animation.entry.path } :
|
|
323
|
-
rotation: o.animation.entry.rotation ? { ...wt, ...o.animation.entry.rotation } :
|
|
324
|
-
scale: o.animation.entry.scale ? { ...Et, ...o.animation.entry.scale } :
|
|
307
|
+
circular: o.animation.entry.start.circular ? { ...R.animation.entry.start.circular, ...o.animation.entry.start.circular } : R.animation.entry.start.circular
|
|
308
|
+
} : R.animation.entry.start,
|
|
309
|
+
timing: o.animation.entry.timing ? { ...R.animation.entry.timing, ...o.animation.entry.timing } : R.animation.entry.timing,
|
|
310
|
+
path: o.animation.entry.path ? { ...vt, ...o.animation.entry.path } : R.animation.entry.path,
|
|
311
|
+
rotation: o.animation.entry.rotation ? { ...wt, ...o.animation.entry.rotation } : R.animation.entry.rotation,
|
|
312
|
+
scale: o.animation.entry.scale ? { ...Et, ...o.animation.entry.scale } : R.animation.entry.scale
|
|
325
313
|
}), o.animation.idle && (s.animation.idle = {
|
|
326
314
|
...$t,
|
|
327
315
|
...o.animation.idle
|
|
328
316
|
})), o.interaction && (s.interaction = {
|
|
329
|
-
...
|
|
317
|
+
...R.interaction,
|
|
330
318
|
...o.interaction
|
|
331
319
|
}, o.interaction.focus && (s.interaction.focus = {
|
|
332
|
-
...
|
|
320
|
+
...R.interaction.focus,
|
|
333
321
|
...o.interaction.focus
|
|
334
322
|
}), o.interaction.navigation && (s.interaction.navigation = {
|
|
335
|
-
...
|
|
323
|
+
...R.interaction.navigation,
|
|
336
324
|
...o.interaction.navigation
|
|
337
|
-
}))
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
...
|
|
342
|
-
...o.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}), o.rendering.ui && (s.rendering.ui = {
|
|
346
|
-
...x.rendering.ui,
|
|
347
|
-
...o.rendering.ui
|
|
348
|
-
})), s.config.debug = {
|
|
349
|
-
..._t,
|
|
325
|
+
}));
|
|
326
|
+
const l = o.rendering?.ui;
|
|
327
|
+
if (l && console.warn("[ImageCloud] rendering.ui is deprecated. Use top-level ui instead."), s.ui = {
|
|
328
|
+
...R.ui,
|
|
329
|
+
...l,
|
|
330
|
+
...o.ui
|
|
331
|
+
}, s.config.debug = {
|
|
332
|
+
...Dt,
|
|
350
333
|
...o.config?.debug ?? {}
|
|
351
334
|
}, s.layout.algorithm === "honeycomb" && s.styling) {
|
|
352
335
|
const c = { shape: "hexagon", mode: "height-relative" };
|
|
@@ -395,12 +378,12 @@ class oe {
|
|
|
395
378
|
*/
|
|
396
379
|
animateTransformCancellable(t, i, e, n = null, a = null) {
|
|
397
380
|
this.cancelAllAnimations(t);
|
|
398
|
-
const r = n ?? this.config.duration, s = a ?? this.config.easing.default,
|
|
381
|
+
const r = n ?? this.config.duration, s = a ?? this.config.easing.default, l = this.buildTransformString(i), c = this.buildTransformString(e);
|
|
399
382
|
t.style.transition = "none";
|
|
400
383
|
const u = t.animate(
|
|
401
384
|
[
|
|
402
|
-
{ transform:
|
|
403
|
-
{ transform:
|
|
385
|
+
{ transform: l },
|
|
386
|
+
{ transform: c }
|
|
404
387
|
],
|
|
405
388
|
{
|
|
406
389
|
duration: r,
|
|
@@ -418,7 +401,7 @@ class oe {
|
|
|
418
401
|
duration: r
|
|
419
402
|
};
|
|
420
403
|
return this.activeAnimations.set(t, h), u.finished.then(() => {
|
|
421
|
-
t.style.transform =
|
|
404
|
+
t.style.transform = c, this.activeAnimations.delete(t);
|
|
422
405
|
}).catch(() => {
|
|
423
406
|
this.activeAnimations.delete(t);
|
|
424
407
|
}), h;
|
|
@@ -464,8 +447,8 @@ class oe {
|
|
|
464
447
|
const e = getComputedStyle(t).transform;
|
|
465
448
|
if (e === "none" || !e)
|
|
466
449
|
return { x: 0, y: 0, rotation: 0, scale: 1 };
|
|
467
|
-
const n = new DOMMatrix(e), a = Math.sqrt(n.a * n.a + n.b * n.b), r = Math.atan2(n.b, n.a) * (180 / Math.PI), s = n.e,
|
|
468
|
-
return { x: s, y:
|
|
450
|
+
const n = new DOMMatrix(e), a = Math.sqrt(n.a * n.a + n.b * n.b), r = Math.atan2(n.b, n.a) * (180 / Math.PI), s = n.e, l = n.f;
|
|
451
|
+
return { x: s, y: l, rotation: r, scale: a };
|
|
469
452
|
}
|
|
470
453
|
/**
|
|
471
454
|
* Check if an element has an active animation
|
|
@@ -528,27 +511,27 @@ function V(o, t, i) {
|
|
|
528
511
|
return o + (t - o) * i;
|
|
529
512
|
}
|
|
530
513
|
function se(o, t, i, e) {
|
|
531
|
-
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x,
|
|
532
|
-
let u = 0, h = 0, d = 1, f = n,
|
|
533
|
-
for (let g = 0; g <
|
|
534
|
-
if (o <=
|
|
535
|
-
h = g === 0 ? 0 :
|
|
514
|
+
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x, l = i.y - t.y, c = ae(a, r);
|
|
515
|
+
let u = 0, h = 0, d = 1, f = n, y = !1;
|
|
516
|
+
for (let g = 0; g < c.length; g++)
|
|
517
|
+
if (o <= c[g].time) {
|
|
518
|
+
h = g === 0 ? 0 : c[g - 1].time, d = c[g].time, f = c[g].overshoot, y = c[g].isOvershoot;
|
|
536
519
|
break;
|
|
537
520
|
}
|
|
538
521
|
const p = (o - h) / (d - h);
|
|
539
|
-
if (
|
|
522
|
+
if (y)
|
|
540
523
|
u = 1 + f * ot(p);
|
|
541
524
|
else if (h === 0)
|
|
542
525
|
u = ot(p);
|
|
543
526
|
else {
|
|
544
|
-
const m = 1 + (
|
|
545
|
-
(
|
|
527
|
+
const m = 1 + (c.find(
|
|
528
|
+
(b, w) => b.time > h && w > 0 && c[w - 1].isOvershoot
|
|
546
529
|
)?.overshoot || f);
|
|
547
530
|
u = V(m, 1, ot(p));
|
|
548
531
|
}
|
|
549
532
|
return {
|
|
550
533
|
x: t.x + s * u,
|
|
551
|
-
y: t.y +
|
|
534
|
+
y: t.y + l * u
|
|
552
535
|
};
|
|
553
536
|
}
|
|
554
537
|
function ae(o, t) {
|
|
@@ -562,20 +545,20 @@ function ae(o, t) {
|
|
|
562
545
|
return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
|
|
563
546
|
}
|
|
564
547
|
function re(o, t, i, e) {
|
|
565
|
-
const { stiffness: n, damping: a, mass: r, oscillations: s } = e,
|
|
548
|
+
const { stiffness: n, damping: a, mass: r, oscillations: s } = e, l = i.x - t.x, c = i.y - t.y, u = Math.sqrt(n / r), h = a / (2 * Math.sqrt(n * r));
|
|
566
549
|
let d;
|
|
567
550
|
if (h < 1) {
|
|
568
|
-
const f = u * Math.sqrt(1 - h * h),
|
|
569
|
-
d = 1 -
|
|
551
|
+
const f = u * Math.sqrt(1 - h * h), y = Math.exp(-h * u * o * 3), p = Math.cos(f * o * s * Math.PI);
|
|
552
|
+
d = 1 - y * p;
|
|
570
553
|
} else
|
|
571
554
|
d = 1 - Math.exp(-u * o * 3);
|
|
572
555
|
return d = Math.max(0, Math.min(d, 1.3)), {
|
|
573
|
-
x: t.x +
|
|
574
|
-
y: t.y +
|
|
556
|
+
x: t.x + l * d,
|
|
557
|
+
y: t.y + c * d
|
|
575
558
|
};
|
|
576
559
|
}
|
|
577
560
|
function ce(o, t, i, e) {
|
|
578
|
-
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase:
|
|
561
|
+
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase: l } = e, c = i.x - t.x, u = i.y - t.y, h = Math.sqrt(c * c + u * u), d = h > 0 ? -u / h : 0, f = h > 0 ? c / h : 1, y = a * Math.PI * 2 * o + l, p = r ? Math.pow(1 - o, s) : 1, g = n * Math.sin(y) * p, m = le(o);
|
|
579
562
|
return {
|
|
580
563
|
x: V(t.x, i.x, m) + g * d,
|
|
581
564
|
y: V(t.y, i.y, m) + g * f
|
|
@@ -588,25 +571,25 @@ function le(o) {
|
|
|
588
571
|
return 1 - Math.pow(1 - o, 3);
|
|
589
572
|
}
|
|
590
573
|
function he(o, t, i) {
|
|
591
|
-
const { amplitude: e, frequency: n, decay: a } = i, r = Math.sin(o * n * Math.PI * 2), s = a ? Math.pow(1 - o, 2) : 1,
|
|
592
|
-
return t +
|
|
574
|
+
const { amplitude: e, frequency: n, decay: a } = i, r = Math.sin(o * n * Math.PI * 2), s = a ? Math.pow(1 - o, 2) : 1, l = e * r * s;
|
|
575
|
+
return t + l;
|
|
593
576
|
}
|
|
594
577
|
function de(o, t, i) {
|
|
595
578
|
const { overshoot: e, bounces: n } = i, a = [];
|
|
596
579
|
a.push({ time: 0.5, scale: e });
|
|
597
580
|
let r = e;
|
|
598
|
-
const s = 0.5,
|
|
581
|
+
const s = 0.5, c = 0.5 / (n * 2);
|
|
599
582
|
let u = 0.5;
|
|
600
583
|
for (let d = 0; d < n; d++) {
|
|
601
584
|
const f = 1 - (r - 1) * s;
|
|
602
|
-
u +=
|
|
585
|
+
u += c, a.push({ time: u, scale: f }), r = 1 + (r - 1) * s * s, u += c, d < n - 1 && a.push({ time: u, scale: r });
|
|
603
586
|
}
|
|
604
587
|
a.push({ time: 1, scale: 1 });
|
|
605
588
|
let h = 1;
|
|
606
589
|
for (let d = 0; d < a.length; d++)
|
|
607
590
|
if (o <= a[d].time) {
|
|
608
|
-
const f = d === 0 ? 0 : a[d - 1].time,
|
|
609
|
-
h =
|
|
591
|
+
const f = d === 0 ? 0 : a[d - 1].time, y = d === 0 ? 1 : a[d - 1].scale, p = (o - f) / (a[d].time - f), g = ot(p);
|
|
592
|
+
h = y + (a[d].scale - y) * g;
|
|
610
593
|
break;
|
|
611
594
|
}
|
|
612
595
|
return h * t;
|
|
@@ -620,58 +603,58 @@ function ue(o) {
|
|
|
620
603
|
duration: a,
|
|
621
604
|
imageWidth: r,
|
|
622
605
|
imageHeight: s,
|
|
623
|
-
rotation:
|
|
624
|
-
scale:
|
|
606
|
+
rotation: l,
|
|
607
|
+
scale: c,
|
|
625
608
|
onComplete: u,
|
|
626
609
|
rotationConfig: h,
|
|
627
610
|
startRotation: d,
|
|
628
611
|
scaleConfig: f,
|
|
629
|
-
startScale:
|
|
630
|
-
} = o, p = n.type, g = d !== void 0 && d !==
|
|
631
|
-
if ((p === "linear" || p === "arc") && !w && !(v ||
|
|
612
|
+
startScale: y
|
|
613
|
+
} = o, p = n.type, g = d !== void 0 && d !== l, m = h?.mode === "wobble", b = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, w = g || m, v = y !== void 0 && y !== c, S = f?.mode === "pop", E = f?.pop || { overshoot: 1.2, bounces: 1 };
|
|
614
|
+
if ((p === "linear" || p === "arc") && !w && !(v || S)) {
|
|
632
615
|
u && u();
|
|
633
616
|
return;
|
|
634
617
|
}
|
|
635
618
|
const O = performance.now(), L = -r / 2, P = -s / 2;
|
|
636
619
|
function z(H) {
|
|
637
|
-
const
|
|
638
|
-
let
|
|
620
|
+
const N = H - O, A = Math.min(N / a, 1);
|
|
621
|
+
let _;
|
|
639
622
|
switch (p) {
|
|
640
623
|
case "bounce": {
|
|
641
|
-
const
|
|
624
|
+
const k = ee(
|
|
642
625
|
n.bouncePreset,
|
|
643
626
|
n.bounce
|
|
644
627
|
);
|
|
645
|
-
|
|
628
|
+
_ = se(A, i, e, k);
|
|
646
629
|
break;
|
|
647
630
|
}
|
|
648
631
|
case "elastic": {
|
|
649
|
-
const
|
|
632
|
+
const k = ie(
|
|
650
633
|
n.elasticPreset,
|
|
651
634
|
n.elastic
|
|
652
635
|
);
|
|
653
|
-
|
|
636
|
+
_ = re(A, i, e, k);
|
|
654
637
|
break;
|
|
655
638
|
}
|
|
656
639
|
case "wave": {
|
|
657
|
-
const
|
|
640
|
+
const k = ne(
|
|
658
641
|
n.wavePreset,
|
|
659
642
|
n.wave
|
|
660
643
|
);
|
|
661
|
-
|
|
644
|
+
_ = ce(A, i, e, k);
|
|
662
645
|
break;
|
|
663
646
|
}
|
|
664
647
|
default:
|
|
665
|
-
|
|
648
|
+
_ = {
|
|
666
649
|
x: V(i.x, e.x, A),
|
|
667
650
|
y: V(i.y, e.y, A)
|
|
668
651
|
};
|
|
669
652
|
}
|
|
670
|
-
const G =
|
|
653
|
+
const G = _.x - e.x, U = _.y - e.y;
|
|
671
654
|
let M;
|
|
672
|
-
m ? M = he(A,
|
|
655
|
+
m ? M = he(A, l, b) : g ? M = V(d, l, A) : M = l;
|
|
673
656
|
let T;
|
|
674
|
-
|
|
657
|
+
S ? T = de(A, c, E) : v ? T = V(y, c, A) : T = c, t.style.transform = `translate(${L}px, ${P}px) translate(${G}px, ${U}px) rotate(${M}deg) scale(${T})`, A < 1 ? requestAnimationFrame(z) : (t.style.transform = `translate(${L}px, ${P}px) rotate(${l}deg) scale(${c})`, u && u());
|
|
675
658
|
}
|
|
676
659
|
requestAnimationFrame(z);
|
|
677
660
|
}
|
|
@@ -733,9 +716,9 @@ class me {
|
|
|
733
716
|
* Calculate start position from the nearest edge (current default behavior)
|
|
734
717
|
*/
|
|
735
718
|
calculateNearestEdge(t, i, e, n) {
|
|
736
|
-
const a = t.x, r = t.y, s = a,
|
|
719
|
+
const a = t.x, r = t.y, s = a, l = e.width - a, c = r, u = e.height - r, h = Math.min(s, l, c, u);
|
|
737
720
|
let d = t.x, f = t.y;
|
|
738
|
-
return h === s ? d = -(i.width + n) : h ===
|
|
721
|
+
return h === s ? d = -(i.width + n) : h === l ? d = e.width + n : h === c ? f = -(i.height + n) : f = e.height + n, { x: d, y: f };
|
|
739
722
|
}
|
|
740
723
|
/**
|
|
741
724
|
* Calculate start position from a specific edge
|
|
@@ -782,19 +765,19 @@ class me {
|
|
|
782
765
|
*/
|
|
783
766
|
calculateCircularPosition(t, i, e, n, a) {
|
|
784
767
|
const r = this.config.start.circular || {}, s = r.distribution || "even";
|
|
785
|
-
let
|
|
786
|
-
const
|
|
787
|
-
if (typeof
|
|
788
|
-
const p = parseFloat(
|
|
789
|
-
|
|
768
|
+
let l;
|
|
769
|
+
const c = r.radius || "120%";
|
|
770
|
+
if (typeof c == "string" && c.endsWith("%")) {
|
|
771
|
+
const p = parseFloat(c) / 100;
|
|
772
|
+
l = Math.sqrt(
|
|
790
773
|
e.width ** 2 + e.height ** 2
|
|
791
774
|
) * p / 2;
|
|
792
775
|
} else
|
|
793
|
-
|
|
776
|
+
l = typeof c == "number" ? c : 500;
|
|
794
777
|
let u;
|
|
795
778
|
s === "even" ? u = n / a * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
|
|
796
|
-
const h = e.width / 2, d = e.height / 2, f = h + Math.cos(u) *
|
|
797
|
-
return { x: f, y
|
|
779
|
+
const h = e.width / 2, d = e.height / 2, f = h + Math.cos(u) * l, y = d + Math.sin(u) * l;
|
|
780
|
+
return { x: f, y };
|
|
798
781
|
}
|
|
799
782
|
/**
|
|
800
783
|
* Get animation parameters for an image
|
|
@@ -813,9 +796,9 @@ class me {
|
|
|
813
796
|
* Build a CSS transform string for the start position
|
|
814
797
|
* Uses pixel-based centering offset for reliable cross-browser behavior
|
|
815
798
|
*/
|
|
816
|
-
buildStartTransform(t, i, e, n, a, r, s,
|
|
817
|
-
const
|
|
818
|
-
return t.useScale ? `${p} translate(${
|
|
799
|
+
buildStartTransform(t, i, e, n, a, r, s, l) {
|
|
800
|
+
const c = t.x - i.x, u = t.y - i.y, h = s !== void 0 ? s : e, d = l !== void 0 ? l : n, f = a !== void 0 ? -a / 2 : 0, y = r !== void 0 ? -r / 2 : 0, p = a !== void 0 ? `translate(${f}px, ${y}px)` : "translate(-50%, -50%)";
|
|
801
|
+
return t.useScale ? `${p} translate(${c}px, ${u}px) rotate(${h}deg) scale(0)` : `${p} translate(${c}px, ${u}px) rotate(${h}deg) scale(${d})`;
|
|
819
802
|
}
|
|
820
803
|
/**
|
|
821
804
|
* Build the final CSS transform string
|
|
@@ -942,8 +925,8 @@ class me {
|
|
|
942
925
|
amplitude: 15,
|
|
943
926
|
frequency: 3,
|
|
944
927
|
decay: !0
|
|
945
|
-
}, { amplitude: n, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2),
|
|
946
|
-
return i +
|
|
928
|
+
}, { amplitude: n, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2), l = r ? Math.pow(1 - t, 2) : 1, c = n * s * l;
|
|
929
|
+
return i + c;
|
|
947
930
|
}
|
|
948
931
|
/**
|
|
949
932
|
* Get the scale configuration
|
|
@@ -1001,10 +984,10 @@ class me {
|
|
|
1001
984
|
bounces: 1
|
|
1002
985
|
}, { overshoot: n, bounces: a } = e, r = this.generateScaleBounceKeyframes(a, n);
|
|
1003
986
|
let s = i;
|
|
1004
|
-
for (let
|
|
1005
|
-
if (t <= r[
|
|
1006
|
-
const
|
|
1007
|
-
s = u + (r[
|
|
987
|
+
for (let l = 0; l < r.length; l++)
|
|
988
|
+
if (t <= r[l].time) {
|
|
989
|
+
const c = l === 0 ? 0 : r[l - 1].time, u = l === 0 ? i : r[l - 1].scale, h = (t - c) / (r[l].time - c), d = this.easeOutQuad(h);
|
|
990
|
+
s = u + (r[l].scale - u) * d;
|
|
1008
991
|
break;
|
|
1009
992
|
}
|
|
1010
993
|
return s * i;
|
|
@@ -1017,10 +1000,10 @@ class me {
|
|
|
1017
1000
|
e.push({ time: 0.5, scale: i });
|
|
1018
1001
|
let n = i;
|
|
1019
1002
|
const a = 0.5, s = 0.5 / (t * 2);
|
|
1020
|
-
let
|
|
1021
|
-
for (let
|
|
1003
|
+
let l = 0.5;
|
|
1004
|
+
for (let c = 0; c < t; c++) {
|
|
1022
1005
|
const u = 1 - (n - 1) * a;
|
|
1023
|
-
|
|
1006
|
+
l += s, e.push({ time: l, scale: u }), n = 1 + (n - 1) * a * a, l += s, c < t - 1 && e.push({ time: l, scale: n });
|
|
1024
1007
|
}
|
|
1025
1008
|
return e.push({ time: 1, scale: 1 }), e;
|
|
1026
1009
|
}
|
|
@@ -1217,7 +1200,7 @@ class pe {
|
|
|
1217
1200
|
t.animation && (t.animation.cancel(), t.animation = null), t.blinkAnimation && (t.blinkAnimation.cancel(), t.blinkAnimation = null), t.customTeardown && (t.customTeardown(), t.customTeardown = null);
|
|
1218
1201
|
}
|
|
1219
1202
|
}
|
|
1220
|
-
class
|
|
1203
|
+
class ye {
|
|
1221
1204
|
constructor(t, i = {}) {
|
|
1222
1205
|
this.config = t, this.imageConfig = i;
|
|
1223
1206
|
}
|
|
@@ -1229,11 +1212,11 @@ class be {
|
|
|
1229
1212
|
* @returns Array of layout objects with position, rotation, scale
|
|
1230
1213
|
*/
|
|
1231
1214
|
generate(t, i, e = {}) {
|
|
1232
|
-
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding,
|
|
1215
|
+
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding, l = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, y = d !== 1 || f !== 1, g = l * 1.5 / 2, m = l / 2, b = a - s - g, w = r - s - m, v = s + g, S = s + m;
|
|
1233
1216
|
for (let E = 0; E < t; E++) {
|
|
1234
|
-
const
|
|
1217
|
+
const I = this.random(v, b), O = this.random(S, w), L = c === "random" ? this.random(u, h) : 0, P = y ? this.random(d, f) : 1, z = l * P, H = {
|
|
1235
1218
|
id: E,
|
|
1236
|
-
x:
|
|
1219
|
+
x: I,
|
|
1237
1220
|
y: O,
|
|
1238
1221
|
rotation: L,
|
|
1239
1222
|
scale: P,
|
|
@@ -1253,7 +1236,7 @@ class be {
|
|
|
1253
1236
|
return Math.random() * (i - t) + t;
|
|
1254
1237
|
}
|
|
1255
1238
|
}
|
|
1256
|
-
class
|
|
1239
|
+
class be {
|
|
1257
1240
|
constructor(t, i = {}) {
|
|
1258
1241
|
this.config = t, this.imageConfig = i;
|
|
1259
1242
|
}
|
|
@@ -1265,20 +1248,20 @@ class ye {
|
|
|
1265
1248
|
* @returns Array of layout objects with position, rotation, scale
|
|
1266
1249
|
*/
|
|
1267
1250
|
generate(t, i, e = {}) {
|
|
1268
|
-
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1269
|
-
...
|
|
1251
|
+
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, l = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = h !== 1 || d !== 1, y = this.config.scaleDecay ?? 0, p = {
|
|
1252
|
+
...Nt,
|
|
1270
1253
|
...this.config.radial
|
|
1271
|
-
}, g = e.fixedHeight ?? s, m = a / 2,
|
|
1254
|
+
}, g = e.fixedHeight ?? s, m = a / 2, b = r / 2, w = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50, S = Math.max(g * 0.8, Math.min(
|
|
1272
1255
|
m - v - g / 2,
|
|
1273
|
-
|
|
1256
|
+
b - v - g / 2
|
|
1274
1257
|
));
|
|
1275
1258
|
if (t > 0) {
|
|
1276
1259
|
const O = f ? this.random(h, d) : 1, L = g * O;
|
|
1277
1260
|
n.push({
|
|
1278
1261
|
id: 0,
|
|
1279
1262
|
x: m,
|
|
1280
|
-
y,
|
|
1281
|
-
rotation:
|
|
1263
|
+
y: b,
|
|
1264
|
+
rotation: l === "random" ? this.random(c * 0.33, u * 0.33) : 0,
|
|
1282
1265
|
// Less rotation for center
|
|
1283
1266
|
scale: O,
|
|
1284
1267
|
baseSize: L,
|
|
@@ -1286,32 +1269,32 @@ class ye {
|
|
|
1286
1269
|
// Center image is highest
|
|
1287
1270
|
});
|
|
1288
1271
|
}
|
|
1289
|
-
let E = 1,
|
|
1272
|
+
let E = 1, I = 1;
|
|
1290
1273
|
for (; E < t; ) {
|
|
1291
|
-
const O =
|
|
1292
|
-
if (
|
|
1293
|
-
|
|
1274
|
+
const O = I / w, L = y > 0 ? 1 - O * y * 0.5 : 1, P = Math.max(g * 0.8, S / w * 1.5 / p.tightness), z = I * P, H = z * 1.5, N = Math.PI * (3 * (H + z) - Math.sqrt((3 * H + z) * (H + 3 * z))), A = this.estimateWidth(g), _ = Math.floor(N / (A * 0.7));
|
|
1275
|
+
if (_ === 0) {
|
|
1276
|
+
I++;
|
|
1294
1277
|
continue;
|
|
1295
1278
|
}
|
|
1296
|
-
const G = 2 * Math.PI /
|
|
1297
|
-
for (let M = 0; M <
|
|
1298
|
-
const T = M * G + U,
|
|
1299
|
-
let
|
|
1279
|
+
const G = 2 * Math.PI / _, U = I * (20 * Math.PI / 180);
|
|
1280
|
+
for (let M = 0; M < _ && E < t; M++) {
|
|
1281
|
+
const T = M * G + U, k = f ? this.random(h, d) : 1, B = L * k, C = g * B;
|
|
1282
|
+
let D = m + Math.cos(T) * H, F = b + Math.sin(T) * z;
|
|
1300
1283
|
const $ = C * 1.5 / 2, j = C / 2;
|
|
1301
|
-
|
|
1302
|
-
const Y =
|
|
1284
|
+
D - $ < v ? D = v + $ : D + $ > a - v && (D = a - v - $), F - j < v ? F = v + j : F + j > r - v && (F = r - v - j);
|
|
1285
|
+
const Y = l === "random" ? this.random(c, u) : 0;
|
|
1303
1286
|
n.push({
|
|
1304
1287
|
id: E,
|
|
1305
|
-
x:
|
|
1288
|
+
x: D,
|
|
1306
1289
|
y: F,
|
|
1307
1290
|
rotation: Y,
|
|
1308
1291
|
scale: B,
|
|
1309
1292
|
baseSize: C,
|
|
1310
|
-
zIndex: Math.max(1, 100 -
|
|
1293
|
+
zIndex: Math.max(1, 100 - I)
|
|
1311
1294
|
// Outer rings have lower z-index
|
|
1312
1295
|
}), E++;
|
|
1313
1296
|
}
|
|
1314
|
-
|
|
1297
|
+
I++;
|
|
1315
1298
|
}
|
|
1316
1299
|
return n;
|
|
1317
1300
|
}
|
|
@@ -1374,13 +1357,13 @@ class we {
|
|
|
1374
1357
|
* @returns Array of layout objects with position, rotation, scale
|
|
1375
1358
|
*/
|
|
1376
1359
|
generate(t, i, e = {}) {
|
|
1377
|
-
const n = [], { width: a, height: r } = i, s = { ...ve, ...this.config.grid },
|
|
1360
|
+
const n = [], { width: a, height: r } = i, s = { ...ve, ...this.config.grid }, l = this.config.spacing.padding, c = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = h !== 1 || d !== 1, y = a - 2 * l, p = r - 2 * l, { columns: g, rows: m } = this.calculateGridDimensions(
|
|
1378
1361
|
t,
|
|
1379
|
-
|
|
1362
|
+
y,
|
|
1380
1363
|
p,
|
|
1381
|
-
|
|
1364
|
+
c,
|
|
1382
1365
|
s
|
|
1383
|
-
),
|
|
1366
|
+
), b = s.stagger === "row", w = s.stagger === "column", v = b ? g + 0.5 : g, S = w ? m + 0.5 : m, E = (y - s.gap * (g - 1)) / v, I = (p - s.gap * (m - 1)) / S, O = b ? E / 2 : 0, L = w ? I / 2 : 0, P = 1 + s.overlap, z = Math.min(E, I) * P, H = e.fixedHeight ? Math.min(e.fixedHeight, z) : z, N = g * E + (g - 1) * s.gap + O, A = m * I + (m - 1) * s.gap + L, _ = l + (y - N) / 2, G = l + (p - A) / 2, U = g * m, M = s.columns !== "auto" && s.rows !== "auto", T = M && t > U;
|
|
1384
1367
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1385
1368
|
gridConfigColumns: s.columns,
|
|
1386
1369
|
gridConfigRows: s.rows,
|
|
@@ -1391,21 +1374,21 @@ class we {
|
|
|
1391
1374
|
imageCount: t,
|
|
1392
1375
|
isOverflowMode: T
|
|
1393
1376
|
});
|
|
1394
|
-
const
|
|
1377
|
+
const k = T ? new Array(U).fill(0) : [], B = Math.min(E, I) * s.overflowOffset;
|
|
1395
1378
|
for (let C = 0; C < t; C++) {
|
|
1396
|
-
let
|
|
1379
|
+
let D, F, X = 0;
|
|
1397
1380
|
if (T && C >= U) {
|
|
1398
1381
|
const q = C - U, W = q % U;
|
|
1399
|
-
X = Math.floor(q / U) + 1,
|
|
1382
|
+
X = Math.floor(q / U) + 1, k[W]++, s.fillDirection === "row" ? (D = W % g, F = Math.floor(W / g)) : (F = W % m, D = Math.floor(W / m));
|
|
1400
1383
|
} else
|
|
1401
|
-
s.fillDirection === "row" ? (
|
|
1402
|
-
let $ =
|
|
1403
|
-
if (s.stagger === "row" && F % 2 === 1 ? $ += E / 2 : s.stagger === "column" &&
|
|
1384
|
+
s.fillDirection === "row" ? (D = C % g, F = Math.floor(C / g)) : (F = C % m, D = Math.floor(C / m));
|
|
1385
|
+
let $ = _ + D * (E + s.gap) + E / 2, j = G + F * (I + s.gap) + I / 2;
|
|
1386
|
+
if (s.stagger === "row" && F % 2 === 1 ? $ += E / 2 : s.stagger === "column" && D % 2 === 1 && (j += I / 2), X > 0) {
|
|
1404
1387
|
const q = (X - 1) % Lt.length, W = Lt[q];
|
|
1405
1388
|
$ += W.x * B, j += W.y * B;
|
|
1406
1389
|
}
|
|
1407
1390
|
if (s.jitter > 0) {
|
|
1408
|
-
const q = E / 2 * s.jitter, W =
|
|
1391
|
+
const q = E / 2 * s.jitter, W = I / 2 * s.jitter;
|
|
1409
1392
|
$ += this.random(-q, q), j += this.random(-W, W);
|
|
1410
1393
|
}
|
|
1411
1394
|
let Y = $, J = j;
|
|
@@ -1414,10 +1397,10 @@ class we {
|
|
|
1414
1397
|
if (F === Math.floor((t - 1) / g) && q < g) {
|
|
1415
1398
|
const Rt = q * E + (q - 1) * s.gap;
|
|
1416
1399
|
let gt = 0;
|
|
1417
|
-
s.alignment === "center" ? gt = (
|
|
1400
|
+
s.alignment === "center" ? gt = (N - Rt) / 2 : s.alignment === "end" && (gt = N - Rt), Y += gt;
|
|
1418
1401
|
}
|
|
1419
1402
|
}
|
|
1420
|
-
const rt = f ? this.random(h, d) : 1, K = H * rt, it = K * 1.5 / 2, nt = K / 2, lt =
|
|
1403
|
+
const rt = f ? this.random(h, d) : 1, K = H * rt, it = K * 1.5 / 2, nt = K / 2, lt = l + it, ht = a - l - it, Ut = l + nt, Ht = r - l - nt;
|
|
1421
1404
|
Y = Math.max(lt, Math.min(Y, ht)), J = Math.max(Ut, Math.min(J, Ht));
|
|
1422
1405
|
let dt = 0;
|
|
1423
1406
|
if (u === "random") {
|
|
@@ -1449,8 +1432,8 @@ class we {
|
|
|
1449
1432
|
else if (a.rows !== "auto")
|
|
1450
1433
|
s = a.rows, r = Math.ceil(t / s);
|
|
1451
1434
|
else {
|
|
1452
|
-
const
|
|
1453
|
-
for (r = Math.max(1, Math.round(Math.sqrt(t *
|
|
1435
|
+
const l = i / e;
|
|
1436
|
+
for (r = Math.max(1, Math.round(Math.sqrt(t * l / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
|
|
1454
1437
|
r--;
|
|
1455
1438
|
}
|
|
1456
1439
|
return { columns: Math.max(1, r), rows: Math.max(1, s) };
|
|
@@ -1481,34 +1464,34 @@ class Se {
|
|
|
1481
1464
|
* @returns Array of layout objects with position, rotation, scale
|
|
1482
1465
|
*/
|
|
1483
1466
|
generate(t, i, e = {}) {
|
|
1484
|
-
const n = [], { width: a, height: r } = i, s = { ...xe, ...this.config.spiral },
|
|
1485
|
-
m -
|
|
1486
|
-
|
|
1467
|
+
const n = [], { width: a, height: r } = i, s = { ...xe, ...this.config.spiral }, l = this.config.spacing.padding, c = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, y = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || y !== 1, g = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, b = r / 2, w = Math.min(
|
|
1468
|
+
m - l - c / 2,
|
|
1469
|
+
b - l - c / 2
|
|
1487
1470
|
), v = s.direction === "clockwise" ? -1 : 1;
|
|
1488
|
-
for (let
|
|
1489
|
-
let E,
|
|
1471
|
+
for (let S = 0; S < t; S++) {
|
|
1472
|
+
let E, I;
|
|
1490
1473
|
if (s.spiralType === "golden")
|
|
1491
|
-
E =
|
|
1474
|
+
E = S * Ee * v + s.startAngle, I = this.calculateGoldenRadius(S, t, w, s.tightness);
|
|
1492
1475
|
else if (s.spiralType === "archimedean") {
|
|
1493
|
-
const $ =
|
|
1494
|
-
E = $ * v + s.startAngle,
|
|
1476
|
+
const $ = S * 0.5 * s.tightness;
|
|
1477
|
+
E = $ * v + s.startAngle, I = this.calculateArchimedeanRadius($, t, w, s.tightness);
|
|
1495
1478
|
} else {
|
|
1496
|
-
const $ =
|
|
1497
|
-
E = $ * v + s.startAngle,
|
|
1479
|
+
const $ = S * 0.3 * s.tightness;
|
|
1480
|
+
E = $ * v + s.startAngle, I = this.calculateLogarithmicRadius($, t, w, s.tightness);
|
|
1498
1481
|
}
|
|
1499
|
-
const O = m + Math.cos(E) *
|
|
1482
|
+
const O = m + Math.cos(E) * I, L = b + Math.sin(E) * I, P = I / w, z = g > 0 ? 1 - P * g * 0.5 : 1, H = p ? this.random(f, y) : 1, N = z * H, A = c * N, G = A * 1.5 / 2, U = A / 2, M = l + G, T = a - l - G, k = l + U, B = r - l - U, C = Math.max(M, Math.min(O, T)), D = Math.max(k, Math.min(L, B));
|
|
1500
1483
|
let F = 0;
|
|
1501
1484
|
if (u === "random") {
|
|
1502
1485
|
const $ = E * 180 / Math.PI % 360, j = this.random(h, d);
|
|
1503
1486
|
F = s.spiralType === "golden" ? j : $ * 0.1 + j * 0.9;
|
|
1504
|
-
} else u === "tangent" && (F = this.calculateSpiralTangent(E,
|
|
1505
|
-
const X = t -
|
|
1487
|
+
} else u === "tangent" && (F = this.calculateSpiralTangent(E, I, s));
|
|
1488
|
+
const X = t - S;
|
|
1506
1489
|
n.push({
|
|
1507
|
-
id:
|
|
1490
|
+
id: S,
|
|
1508
1491
|
x: C,
|
|
1509
|
-
y:
|
|
1492
|
+
y: D,
|
|
1510
1493
|
rotation: F,
|
|
1511
|
-
scale:
|
|
1494
|
+
scale: N,
|
|
1512
1495
|
baseSize: A,
|
|
1513
1496
|
zIndex: X
|
|
1514
1497
|
});
|
|
@@ -1553,8 +1536,8 @@ class Se {
|
|
|
1553
1536
|
* r = a * e^(b*θ)
|
|
1554
1537
|
*/
|
|
1555
1538
|
calculateLogarithmicRadius(t, i, e, n) {
|
|
1556
|
-
const a = e * 0.05, r = 0.15 / n, s = a * Math.exp(r * t),
|
|
1557
|
-
return s /
|
|
1539
|
+
const a = e * 0.05, r = 0.15 / n, s = a * Math.exp(r * t), l = i * 0.3 * n, c = a * Math.exp(r * l);
|
|
1540
|
+
return s / c * e;
|
|
1558
1541
|
}
|
|
1559
1542
|
/**
|
|
1560
1543
|
* Utility: Generate random number between min and max
|
|
@@ -1583,7 +1566,7 @@ class Re {
|
|
|
1583
1566
|
* @returns Array of layout objects with position, rotation, scale
|
|
1584
1567
|
*/
|
|
1585
1568
|
generate(t, i, e = {}) {
|
|
1586
|
-
const n = [], { width: a, height: r } = i, s = { ...Ie, ...this.config.cluster },
|
|
1569
|
+
const n = [], { width: a, height: r } = i, s = { ...Ie, ...this.config.cluster }, l = this.config.spacing.padding, c = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, y = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || y !== 1, g = this.calculateClusterCount(
|
|
1587
1570
|
t,
|
|
1588
1571
|
s.clusterCount,
|
|
1589
1572
|
a,
|
|
@@ -1593,37 +1576,37 @@ class Re {
|
|
|
1593
1576
|
g,
|
|
1594
1577
|
a,
|
|
1595
1578
|
r,
|
|
1596
|
-
|
|
1579
|
+
l,
|
|
1597
1580
|
s
|
|
1598
|
-
),
|
|
1581
|
+
), b = new Array(g).fill(0);
|
|
1599
1582
|
for (let v = 0; v < t; v++)
|
|
1600
|
-
|
|
1583
|
+
b[v % g]++;
|
|
1601
1584
|
let w = 0;
|
|
1602
1585
|
for (let v = 0; v < g; v++) {
|
|
1603
|
-
const
|
|
1604
|
-
for (let
|
|
1586
|
+
const S = m[v], E = b[v];
|
|
1587
|
+
for (let I = 0; I < E; I++) {
|
|
1605
1588
|
let O, L;
|
|
1606
1589
|
if (s.distribution === "gaussian")
|
|
1607
|
-
O = this.gaussianRandom() *
|
|
1590
|
+
O = this.gaussianRandom() * S.spread, L = this.gaussianRandom() * S.spread;
|
|
1608
1591
|
else {
|
|
1609
|
-
const F = this.random(0, Math.PI * 2), X = this.random(0,
|
|
1592
|
+
const F = this.random(0, Math.PI * 2), X = this.random(0, S.spread);
|
|
1610
1593
|
O = Math.cos(F) * X, L = Math.sin(F) * X;
|
|
1611
1594
|
}
|
|
1612
1595
|
const P = 1 + s.overlap * 0.5, z = 1 + s.overlap * 0.3;
|
|
1613
1596
|
O /= P, L /= P;
|
|
1614
|
-
const H = p ? this.random(f,
|
|
1615
|
-
let
|
|
1597
|
+
const H = p ? this.random(f, y) : 1, N = z * H, A = c * N;
|
|
1598
|
+
let _ = S.x + O, G = S.y + L;
|
|
1616
1599
|
const M = A * 1.5 / 2, T = A / 2;
|
|
1617
|
-
|
|
1618
|
-
const
|
|
1600
|
+
_ = Math.max(l + M, Math.min(_, a - l - M)), G = Math.max(l + T, Math.min(G, r - l - T));
|
|
1601
|
+
const k = u === "random" ? this.random(h, d) : 0, C = Math.sqrt(O * O + L * L) / S.spread, D = Math.round((1 - C) * 50) + 1;
|
|
1619
1602
|
n.push({
|
|
1620
1603
|
id: w,
|
|
1621
|
-
x:
|
|
1604
|
+
x: _,
|
|
1622
1605
|
y: G,
|
|
1623
|
-
rotation:
|
|
1624
|
-
scale:
|
|
1606
|
+
rotation: k,
|
|
1607
|
+
scale: N,
|
|
1625
1608
|
baseSize: A,
|
|
1626
|
-
zIndex:
|
|
1609
|
+
zIndex: D
|
|
1627
1610
|
}), w++;
|
|
1628
1611
|
}
|
|
1629
1612
|
}
|
|
@@ -1635,30 +1618,30 @@ class Re {
|
|
|
1635
1618
|
calculateClusterCount(t, i, e, n, a) {
|
|
1636
1619
|
if (i !== "auto")
|
|
1637
1620
|
return Math.max(1, Math.min(i, t));
|
|
1638
|
-
const s = Math.max(1, Math.ceil(t / 8)),
|
|
1621
|
+
const s = Math.max(1, Math.ceil(t / 8)), l = Math.floor(
|
|
1639
1622
|
e / a * (n / a) * 0.6
|
|
1640
1623
|
);
|
|
1641
|
-
return Math.max(1, Math.min(s,
|
|
1624
|
+
return Math.max(1, Math.min(s, l, 10));
|
|
1642
1625
|
}
|
|
1643
1626
|
/**
|
|
1644
1627
|
* Generate cluster center positions with spacing constraints
|
|
1645
1628
|
*/
|
|
1646
1629
|
generateClusterCenters(t, i, e, n, a) {
|
|
1647
|
-
const r = [],
|
|
1630
|
+
const r = [], l = n + a.clusterSpread, c = i - n - a.clusterSpread, u = n + a.clusterSpread, h = e - n - a.clusterSpread;
|
|
1648
1631
|
for (let d = 0; d < t; d++) {
|
|
1649
|
-
let f = null,
|
|
1632
|
+
let f = null, y = -1;
|
|
1650
1633
|
for (let p = 0; p < 100; p++) {
|
|
1651
1634
|
const g = {
|
|
1652
|
-
x: this.random(
|
|
1635
|
+
x: this.random(l, c),
|
|
1653
1636
|
y: this.random(u, h),
|
|
1654
1637
|
spread: this.calculateClusterSpread(a)
|
|
1655
1638
|
};
|
|
1656
1639
|
let m = 1 / 0;
|
|
1657
|
-
for (const
|
|
1658
|
-
const w = g.x -
|
|
1659
|
-
m = Math.min(m,
|
|
1640
|
+
for (const b of r) {
|
|
1641
|
+
const w = g.x - b.x, v = g.y - b.y, S = Math.sqrt(w * w + v * v);
|
|
1642
|
+
m = Math.min(m, S);
|
|
1660
1643
|
}
|
|
1661
|
-
if ((r.length === 0 || m >
|
|
1644
|
+
if ((r.length === 0 || m > y) && (f = g, y = m), m >= a.clusterSpacing)
|
|
1662
1645
|
break;
|
|
1663
1646
|
}
|
|
1664
1647
|
f && r.push(f);
|
|
@@ -1701,20 +1684,20 @@ class Ae {
|
|
|
1701
1684
|
* @returns Array of layout objects with position, rotation, scale
|
|
1702
1685
|
*/
|
|
1703
1686
|
generate(t, i, e = {}) {
|
|
1704
|
-
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1705
|
-
...
|
|
1687
|
+
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, l = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, y = d !== 1 || f !== 1, p = e.fixedHeight ?? s, g = {
|
|
1688
|
+
...kt,
|
|
1706
1689
|
...this.config.wave
|
|
1707
|
-
}, { rows: m, amplitude:
|
|
1690
|
+
}, { rows: m, amplitude: b, frequency: w, phaseShift: v, synchronization: S } = g, E = Math.ceil(t / m), L = p * 1.5 / 2, P = l + L, z = a - l - L, H = z - P, N = E > 1 ? H / (E - 1) : 0, A = l + b + p / 2, _ = r - l - b - p / 2, G = _ - A, U = m > 1 ? G / (m - 1) : 0;
|
|
1708
1691
|
let M = 0;
|
|
1709
1692
|
for (let T = 0; T < m && M < t; T++) {
|
|
1710
|
-
const
|
|
1693
|
+
const k = m === 1 ? (A + _) / 2 : A + T * U;
|
|
1711
1694
|
let B = 0;
|
|
1712
|
-
|
|
1695
|
+
S === "offset" ? B = T * v : S === "alternating" && (B = T * Math.PI);
|
|
1713
1696
|
for (let C = 0; C < E && M < t; C++) {
|
|
1714
|
-
const
|
|
1697
|
+
const D = E === 1 ? (P + z) / 2 : P + C * N, F = this.calculateWaveY(D, a, b, w, B), X = D, $ = k + F, j = y ? this.random(d, f) : 1, Y = p * j;
|
|
1715
1698
|
let J = 0;
|
|
1716
|
-
|
|
1717
|
-
const K = Y * 1.5 / 2, ct = Y / 2, it =
|
|
1699
|
+
c === "tangent" ? J = this.calculateRotation(D, a, b, w, B) : c === "random" && (J = this.random(u, h));
|
|
1700
|
+
const K = Y * 1.5 / 2, ct = Y / 2, it = l + K, nt = a - l - K, lt = l + ct, ht = r - l - ct;
|
|
1718
1701
|
n.push({
|
|
1719
1702
|
id: M,
|
|
1720
1703
|
x: Math.max(it, Math.min(X, nt)),
|
|
@@ -1806,7 +1789,7 @@ function Oe(o) {
|
|
|
1806
1789
|
const t = [];
|
|
1807
1790
|
let [i, e, n] = [0, -o, o];
|
|
1808
1791
|
for (const [a, r, s] of Fe)
|
|
1809
|
-
for (let
|
|
1792
|
+
for (let l = 0; l < o; l++)
|
|
1810
1793
|
t.push([i, e, n]), i += a, e += r, n += s;
|
|
1811
1794
|
return t;
|
|
1812
1795
|
}
|
|
@@ -1817,33 +1800,33 @@ class ze {
|
|
|
1817
1800
|
this.config = t;
|
|
1818
1801
|
}
|
|
1819
1802
|
generate(t, i, e = {}) {
|
|
1820
|
-
const n = [], { width: a, height: r } = i, s = a / 2,
|
|
1803
|
+
const n = [], { width: a, height: r } = i, s = a / 2, l = r / 2, c = e.fixedHeight ?? 200, h = {
|
|
1821
1804
|
...jt,
|
|
1822
1805
|
...this.config.honeycomb
|
|
1823
|
-
}.spacing ?? 0, d =
|
|
1824
|
-
let f = 0,
|
|
1806
|
+
}.spacing ?? 0, d = c + h;
|
|
1807
|
+
let f = 0, y = 0;
|
|
1825
1808
|
for (; f < t; ) {
|
|
1826
|
-
const p = Oe(
|
|
1827
|
-
for (const [g, m,
|
|
1809
|
+
const p = Oe(y);
|
|
1810
|
+
for (const [g, m, b] of p) {
|
|
1828
1811
|
if (f >= t) break;
|
|
1829
|
-
const { px: w, py: v } = Me(g, m,
|
|
1812
|
+
const { px: w, py: v } = Me(g, m, b, s, l, d);
|
|
1830
1813
|
n.push({
|
|
1831
1814
|
id: f,
|
|
1832
1815
|
x: w,
|
|
1833
1816
|
y: v,
|
|
1834
1817
|
rotation: 0,
|
|
1835
1818
|
scale: 1,
|
|
1836
|
-
baseSize:
|
|
1819
|
+
baseSize: c,
|
|
1837
1820
|
// Inner rings render above outer rings
|
|
1838
|
-
zIndex: Math.max(1, 100 -
|
|
1821
|
+
zIndex: Math.max(1, 100 - y)
|
|
1839
1822
|
}), f++;
|
|
1840
1823
|
}
|
|
1841
|
-
|
|
1824
|
+
y++;
|
|
1842
1825
|
}
|
|
1843
1826
|
return n;
|
|
1844
1827
|
}
|
|
1845
1828
|
}
|
|
1846
|
-
class
|
|
1829
|
+
class _e {
|
|
1847
1830
|
constructor(t) {
|
|
1848
1831
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
|
|
1849
1832
|
}
|
|
@@ -1854,7 +1837,7 @@ class De {
|
|
|
1854
1837
|
initLayout() {
|
|
1855
1838
|
switch (this.config.algorithm) {
|
|
1856
1839
|
case "radial":
|
|
1857
|
-
return new
|
|
1840
|
+
return new be(this.config, this.imageConfig);
|
|
1858
1841
|
case "grid":
|
|
1859
1842
|
return new we(this.config, this.imageConfig);
|
|
1860
1843
|
case "spiral":
|
|
@@ -1866,7 +1849,7 @@ class De {
|
|
|
1866
1849
|
case "honeycomb":
|
|
1867
1850
|
return new ze(this.config, this.imageConfig);
|
|
1868
1851
|
default:
|
|
1869
|
-
return new
|
|
1852
|
+
return new ye(this.config, this.imageConfig);
|
|
1870
1853
|
}
|
|
1871
1854
|
}
|
|
1872
1855
|
/**
|
|
@@ -1948,15 +1931,15 @@ class De {
|
|
|
1948
1931
|
const a = this.imageConfig.sizing, r = this.resolveBaseHeight(n);
|
|
1949
1932
|
if (r !== void 0)
|
|
1950
1933
|
return { height: r };
|
|
1951
|
-
const s = a?.minSize ?? 50,
|
|
1934
|
+
const s = a?.minSize ?? 50, l = a?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: h, height: d } = t, p = h * d * c / i;
|
|
1952
1935
|
let m = Math.sqrt(p / 1.4);
|
|
1953
1936
|
m *= u, m = Math.min(m, e);
|
|
1954
|
-
let
|
|
1955
|
-
if (
|
|
1937
|
+
let b = this.clamp(m, s, l);
|
|
1938
|
+
if (b === s && m < s) {
|
|
1956
1939
|
const w = Math.max(s * 0.05, 20);
|
|
1957
|
-
|
|
1940
|
+
b = Math.max(w, m);
|
|
1958
1941
|
}
|
|
1959
|
-
return this.config.algorithm === "honeycomb" && (
|
|
1942
|
+
return this.config.algorithm === "honeycomb" && (b = Math.min(b, this.honeycombMaxImageHeight(i, t))), { height: b };
|
|
1960
1943
|
}
|
|
1961
1944
|
/**
|
|
1962
1945
|
* Returns the largest image height at which all honeycomb rings fit within the container.
|
|
@@ -1968,7 +1951,7 @@ class De {
|
|
|
1968
1951
|
let e = 0, n = 1;
|
|
1969
1952
|
for (; n < t; )
|
|
1970
1953
|
e++, n += 6 * e;
|
|
1971
|
-
const a = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, s = i.width / 2,
|
|
1954
|
+
const a = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, s = i.width / 2, l = i.height / 2, c = Math.sqrt(3) / 2, u = 1 / Math.sqrt(3), h = (l - a - r * e) / (e + 0.5), d = (s - a - c * r * e) / (c * e + u);
|
|
1972
1955
|
return Math.max(10, Math.min(h, d));
|
|
1973
1956
|
}
|
|
1974
1957
|
/**
|
|
@@ -1978,7 +1961,7 @@ class De {
|
|
|
1978
1961
|
return Math.max(i, Math.min(e, t));
|
|
1979
1962
|
}
|
|
1980
1963
|
}
|
|
1981
|
-
var
|
|
1964
|
+
var x = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(x || {});
|
|
1982
1965
|
const Mt = {
|
|
1983
1966
|
// Geometric shapes - uses percentages for responsive sizing
|
|
1984
1967
|
circle: "circle(50%)",
|
|
@@ -1988,7 +1971,7 @@ const Mt = {
|
|
|
1988
1971
|
hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
|
|
1989
1972
|
octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
|
|
1990
1973
|
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
|
|
1991
|
-
},
|
|
1974
|
+
}, De = {
|
|
1992
1975
|
// Circle - uses radius in pixels (refHeight of 100px = 50px radius)
|
|
1993
1976
|
circle: {
|
|
1994
1977
|
refHeight: 100,
|
|
@@ -2031,15 +2014,15 @@ function $e(o) {
|
|
|
2031
2014
|
return o in Mt ? Mt[o] : o;
|
|
2032
2015
|
}
|
|
2033
2016
|
function Pe(o, t, i) {
|
|
2034
|
-
const e =
|
|
2017
|
+
const e = De[o];
|
|
2035
2018
|
if (!e) return "";
|
|
2036
2019
|
const n = t / e.refHeight;
|
|
2037
2020
|
if (o === "circle")
|
|
2038
2021
|
return `circle(${Math.round(50 * n * 100) / 100}px)`;
|
|
2039
|
-
const a = e.points.map(([p]) => p), r = e.points.map(([, p]) => p), s = (Math.min(...a) + Math.max(...a)) / 2 * n,
|
|
2022
|
+
const a = e.points.map(([p]) => p), r = e.points.map(([, p]) => p), s = (Math.min(...a) + Math.max(...a)) / 2 * n, l = (Math.min(...r) + Math.max(...r)) / 2 * n, c = (Math.max(...a) - Math.min(...a)) * n, u = (i ?? c) / 2, h = t / 2, d = u - s, f = h - l;
|
|
2040
2023
|
return `polygon(${e.points.map(([p, g]) => {
|
|
2041
|
-
const m = Math.round((p * n + d) * 100) / 100,
|
|
2042
|
-
return `${m}px ${
|
|
2024
|
+
const m = Math.round((p * n + d) * 100) / 100, b = Math.round((g * n + f) * 100) / 100;
|
|
2025
|
+
return `${m}px ${b}px`;
|
|
2043
2026
|
}).join(", ")})`;
|
|
2044
2027
|
}
|
|
2045
2028
|
function Ue(o) {
|
|
@@ -2048,7 +2031,7 @@ function Ue(o) {
|
|
|
2048
2031
|
function He(o) {
|
|
2049
2032
|
return o ? Ue(o) ? mt[o] : o : mt.md;
|
|
2050
2033
|
}
|
|
2051
|
-
function
|
|
2034
|
+
function Ne(o) {
|
|
2052
2035
|
if (!o) return "";
|
|
2053
2036
|
const t = [];
|
|
2054
2037
|
if (o.grayscale !== void 0 && t.push(`grayscale(${o.grayscale})`), o.blur !== void 0 && t.push(`blur(${o.blur}px)`), o.brightness !== void 0 && t.push(`brightness(${o.brightness})`), o.contrast !== void 0 && t.push(`contrast(${o.contrast})`), o.saturate !== void 0 && t.push(`saturate(${o.saturate})`), o.opacity !== void 0 && t.push(`opacity(${o.opacity})`), o.sepia !== void 0 && t.push(`sepia(${o.sepia})`), o.hueRotate !== void 0 && t.push(`hue-rotate(${o.hueRotate}deg)`), o.invert !== void 0 && t.push(`invert(${o.invert})`), o.dropShadow !== void 0)
|
|
@@ -2074,34 +2057,34 @@ function et(o, t, i) {
|
|
|
2074
2057
|
o.borderRadiusTopLeft !== void 0 ? e.borderTopLeftRadius = `${o.borderRadiusTopLeft}px` : s && (e.borderTopLeftRadius = `${s}px`), o.borderRadiusTopRight !== void 0 ? e.borderTopRightRadius = `${o.borderRadiusTopRight}px` : s && (e.borderTopRightRadius = `${s}px`), o.borderRadiusBottomRight !== void 0 ? e.borderBottomRightRadius = `${o.borderRadiusBottomRight}px` : s && (e.borderBottomRightRadius = `${s}px`), o.borderRadiusBottomLeft !== void 0 ? e.borderBottomLeftRadius = `${o.borderRadiusBottomLeft}px` : s && (e.borderBottomLeftRadius = `${s}px`);
|
|
2075
2058
|
} else o.border?.radius !== void 0 && (e.borderRadius = `${o.border.radius}px`);
|
|
2076
2059
|
if (o.borderTop || o.borderRight || o.borderBottom || o.borderLeft) {
|
|
2077
|
-
const s = o.border || {},
|
|
2078
|
-
e.borderTop = tt(
|
|
2060
|
+
const s = o.border || {}, l = { ...s, ...o.borderTop }, c = { ...s, ...o.borderRight }, u = { ...s, ...o.borderBottom }, h = { ...s, ...o.borderLeft };
|
|
2061
|
+
e.borderTop = tt(l), e.borderRight = tt(c), e.borderBottom = tt(u), e.borderLeft = tt(h);
|
|
2079
2062
|
} else o.border && (e.border = tt(o.border));
|
|
2080
2063
|
o.shadow !== void 0 && (e.boxShadow = He(o.shadow));
|
|
2081
|
-
const r =
|
|
2064
|
+
const r = Ne(o.filter);
|
|
2082
2065
|
if (e.filter = r || "none", o.opacity !== void 0 && (e.opacity = String(o.opacity)), o.cursor !== void 0 && (e.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
|
|
2083
|
-
const s = o.outline.width ?? 0,
|
|
2084
|
-
e.outline = `${s}px ${
|
|
2066
|
+
const s = o.outline.width ?? 0, l = o.outline.style ?? "solid", c = o.outline.color ?? "#000000";
|
|
2067
|
+
e.outline = `${s}px ${l} ${c}`, o.outline.offset !== void 0 && (e.outlineOffset = `${o.outline.offset}px`);
|
|
2085
2068
|
}
|
|
2086
2069
|
if (o.objectFit !== void 0 && (e.objectFit = o.objectFit), o.aspectRatio !== void 0 && (e.aspectRatio = o.aspectRatio), o.clipPath !== void 0) {
|
|
2087
2070
|
let s;
|
|
2088
|
-
const
|
|
2089
|
-
if (
|
|
2090
|
-
s = Pe(
|
|
2071
|
+
const l = typeof o.clipPath == "object" && o.clipPath !== null && "shape" in o.clipPath, c = l ? o.clipPath : void 0;
|
|
2072
|
+
if (c?.mode === "height-relative" && t)
|
|
2073
|
+
s = Pe(c.shape, t, i);
|
|
2091
2074
|
else {
|
|
2092
|
-
const u =
|
|
2075
|
+
const u = l && c ? c.shape : o.clipPath;
|
|
2093
2076
|
s = $e(u);
|
|
2094
2077
|
}
|
|
2095
2078
|
s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
|
|
2096
2079
|
}
|
|
2097
2080
|
return e;
|
|
2098
2081
|
}
|
|
2099
|
-
function
|
|
2082
|
+
function ke(o, t) {
|
|
2100
2083
|
t.borderRadius !== void 0 && (o.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (o.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (o.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (o.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (o.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (o.style.border = t.border), t.borderTop !== void 0 && (o.style.borderTop = t.borderTop), t.borderRight !== void 0 && (o.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (o.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (o.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (o.style.boxShadow = t.boxShadow), t.filter !== void 0 && (o.style.filter = t.filter), t.opacity !== void 0 && (o.style.opacity = t.opacity), t.cursor !== void 0 && (o.style.cursor = t.cursor), t.outline !== void 0 && (o.style.outline = t.outline), t.outlineOffset !== void 0 && (o.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (o.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (o.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (o.style.clipPath = t.clipPath), t.overflow !== void 0 && (o.style.overflow = t.overflow);
|
|
2101
2084
|
}
|
|
2102
2085
|
function ft(o, t, i, e) {
|
|
2103
2086
|
const n = et(t, i, e);
|
|
2104
|
-
|
|
2087
|
+
ke(o, n);
|
|
2105
2088
|
}
|
|
2106
2089
|
function Pt(o) {
|
|
2107
2090
|
return o ? Array.isArray(o) ? o.join(" ") : o : "";
|
|
@@ -2124,7 +2107,7 @@ const Ft = {
|
|
|
2124
2107
|
};
|
|
2125
2108
|
class je {
|
|
2126
2109
|
constructor(t, i, e) {
|
|
2127
|
-
this.state =
|
|
2110
|
+
this.state = x.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.onUnfocusComplete = null, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
|
|
2128
2111
|
}
|
|
2129
2112
|
/**
|
|
2130
2113
|
* Set callback to be fired when an unfocus animation fully completes.
|
|
@@ -2142,7 +2125,7 @@ class je {
|
|
|
2142
2125
|
* Check if any animation is in progress
|
|
2143
2126
|
*/
|
|
2144
2127
|
isAnimating() {
|
|
2145
|
-
return this.state !==
|
|
2128
|
+
return this.state !== x.IDLE && this.state !== x.FOCUSED;
|
|
2146
2129
|
}
|
|
2147
2130
|
/**
|
|
2148
2131
|
* Normalize scalePercent value
|
|
@@ -2156,9 +2139,9 @@ class je {
|
|
|
2156
2139
|
*/
|
|
2157
2140
|
calculateFocusDimensions(t, i, e) {
|
|
2158
2141
|
const n = this.normalizeScalePercent(this.config.scalePercent), a = e.height * n, r = t / i;
|
|
2159
|
-
let s = a,
|
|
2160
|
-
const
|
|
2161
|
-
return
|
|
2142
|
+
let s = a, l = s * r;
|
|
2143
|
+
const c = e.width * n;
|
|
2144
|
+
return l > c && (l = c, s = l / r), { width: l, height: s };
|
|
2162
2145
|
}
|
|
2163
2146
|
/**
|
|
2164
2147
|
* Calculate the transform needed to center an image (position only, no scale)
|
|
@@ -2189,12 +2172,12 @@ class je {
|
|
|
2189
2172
|
* Create a Web Animation that animates both transform (position) and dimensions
|
|
2190
2173
|
* This provides sharper zoom by re-rendering at target size instead of scaling pixels
|
|
2191
2174
|
*/
|
|
2192
|
-
animateWithDimensions(t, i, e, n, a, r, s,
|
|
2193
|
-
const
|
|
2175
|
+
animateWithDimensions(t, i, e, n, a, r, s, l) {
|
|
2176
|
+
const c = this.buildDimensionZoomTransform(i), u = this.buildDimensionZoomTransform(e);
|
|
2194
2177
|
return t.style.transition = "none", t.animate(
|
|
2195
2178
|
[
|
|
2196
2179
|
{
|
|
2197
|
-
transform:
|
|
2180
|
+
transform: c,
|
|
2198
2181
|
width: `${n}px`,
|
|
2199
2182
|
height: `${a}px`
|
|
2200
2183
|
},
|
|
@@ -2205,7 +2188,7 @@ class je {
|
|
|
2205
2188
|
}
|
|
2206
2189
|
],
|
|
2207
2190
|
{
|
|
2208
|
-
duration:
|
|
2191
|
+
duration: l,
|
|
2209
2192
|
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
2210
2193
|
fill: "forwards"
|
|
2211
2194
|
}
|
|
@@ -2239,8 +2222,8 @@ class je {
|
|
|
2239
2222
|
let n = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
|
|
2240
2223
|
e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (n = { ...n, clipPath: void 0 });
|
|
2241
2224
|
const a = () => {
|
|
2242
|
-
const r = t.offsetHeight, s = t.offsetWidth,
|
|
2243
|
-
|
|
2225
|
+
const r = t.offsetHeight, s = t.offsetWidth, l = et(n, r, s);
|
|
2226
|
+
l.clipPath !== void 0 ? t.style.clipPath = l.clipPath : t.style.clipPath = "unset", l.overflow !== void 0 && (t.style.overflow = l.overflow), i.animation.playState === "running" && requestAnimationFrame(a);
|
|
2244
2227
|
};
|
|
2245
2228
|
requestAnimationFrame(a);
|
|
2246
2229
|
}
|
|
@@ -2251,7 +2234,7 @@ class je {
|
|
|
2251
2234
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
2252
2235
|
*/
|
|
2253
2236
|
startFocusAnimation(t, i, e, n, a) {
|
|
2254
|
-
const r = t.style.zIndex || "", s = t.offsetWidth,
|
|
2237
|
+
const r = t.style.zIndex || "", s = t.offsetWidth, l = t.offsetHeight, c = this.calculateFocusDimensions(s, l, i), u = this.calculateFocusTransform(i, e);
|
|
2255
2238
|
this.animationEngine.cancelAllAnimations(t);
|
|
2256
2239
|
const h = this.config.animationDuration ?? 600;
|
|
2257
2240
|
this.applyFocusedStyling(t, Ft.FOCUSING);
|
|
@@ -2261,14 +2244,14 @@ class je {
|
|
|
2261
2244
|
rotation: e.rotation,
|
|
2262
2245
|
scale: 1
|
|
2263
2246
|
// No scale - using dimensions
|
|
2264
|
-
}, f = a?.width ?? s,
|
|
2247
|
+
}, f = a?.width ?? s, y = a?.height ?? l, p = this.animateWithDimensions(
|
|
2265
2248
|
t,
|
|
2266
2249
|
d,
|
|
2267
2250
|
u,
|
|
2268
2251
|
f,
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2252
|
+
y,
|
|
2253
|
+
c.width,
|
|
2254
|
+
c.height,
|
|
2272
2255
|
h
|
|
2273
2256
|
), g = {
|
|
2274
2257
|
id: `focus-${Date.now()}`,
|
|
@@ -2285,16 +2268,16 @@ class je {
|
|
|
2285
2268
|
focusTransform: u,
|
|
2286
2269
|
originalZIndex: r,
|
|
2287
2270
|
originalWidth: s,
|
|
2288
|
-
originalHeight:
|
|
2289
|
-
focusWidth:
|
|
2290
|
-
focusHeight:
|
|
2271
|
+
originalHeight: l,
|
|
2272
|
+
focusWidth: c.width,
|
|
2273
|
+
focusHeight: c.height
|
|
2291
2274
|
}, this.startClipPathAnimation(t, g, !0), {
|
|
2292
2275
|
element: t,
|
|
2293
2276
|
originalState: e,
|
|
2294
2277
|
animationHandle: g,
|
|
2295
2278
|
direction: "in",
|
|
2296
2279
|
originalWidth: s,
|
|
2297
|
-
originalHeight:
|
|
2280
|
+
originalHeight: l
|
|
2298
2281
|
};
|
|
2299
2282
|
}
|
|
2300
2283
|
/**
|
|
@@ -2306,7 +2289,7 @@ class je {
|
|
|
2306
2289
|
t.style.zIndex = String(Ft.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
2307
2290
|
const a = this.config.animationDuration ?? 600;
|
|
2308
2291
|
t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName);
|
|
2309
|
-
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth,
|
|
2292
|
+
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, l = n?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, c = {
|
|
2310
2293
|
x: 0,
|
|
2311
2294
|
y: 0,
|
|
2312
2295
|
rotation: i.rotation,
|
|
@@ -2315,9 +2298,9 @@ class je {
|
|
|
2315
2298
|
}, u = this.focusData?.originalWidth ?? t.offsetWidth, h = this.focusData?.originalHeight ?? t.offsetHeight, d = this.animateWithDimensions(
|
|
2316
2299
|
t,
|
|
2317
2300
|
r,
|
|
2318
|
-
l,
|
|
2319
|
-
s,
|
|
2320
2301
|
c,
|
|
2302
|
+
s,
|
|
2303
|
+
l,
|
|
2321
2304
|
u,
|
|
2322
2305
|
h,
|
|
2323
2306
|
a
|
|
@@ -2326,7 +2309,7 @@ class je {
|
|
|
2326
2309
|
element: t,
|
|
2327
2310
|
animation: d,
|
|
2328
2311
|
fromState: r,
|
|
2329
|
-
toState:
|
|
2312
|
+
toState: c,
|
|
2330
2313
|
startTime: performance.now(),
|
|
2331
2314
|
duration: a
|
|
2332
2315
|
};
|
|
@@ -2354,9 +2337,9 @@ class je {
|
|
|
2354
2337
|
* Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
|
|
2355
2338
|
*/
|
|
2356
2339
|
captureMidAnimationState(t) {
|
|
2357
|
-
const i = getComputedStyle(t), e = new DOMMatrix(i.transform), n = t.offsetWidth, a = t.offsetHeight, r = e.e + n * 0.5, s = e.f + a * 0.5,
|
|
2358
|
-
return t.style.width = `${n}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${
|
|
2359
|
-
transform: { x: r, y: s, rotation:
|
|
2340
|
+
const i = getComputedStyle(t), e = new DOMMatrix(i.transform), n = t.offsetWidth, a = t.offsetHeight, r = e.e + n * 0.5, s = e.f + a * 0.5, l = Math.atan2(e.b, e.a) * (180 / Math.PI);
|
|
2341
|
+
return t.style.width = `${n}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${l}deg)`, t.style.transition = "none", {
|
|
2342
|
+
transform: { x: r, y: s, rotation: l, scale: 1 },
|
|
2360
2343
|
dimensions: { width: n, height: a }
|
|
2361
2344
|
};
|
|
2362
2345
|
}
|
|
@@ -2382,26 +2365,26 @@ class je {
|
|
|
2382
2365
|
* Implements cross-animation when swapping focus
|
|
2383
2366
|
*/
|
|
2384
2367
|
async focusImage(t, i, e) {
|
|
2385
|
-
if (this.currentFocus === t && this.state ===
|
|
2368
|
+
if (this.currentFocus === t && this.state === x.FOCUSED)
|
|
2386
2369
|
return this.unfocusImage();
|
|
2387
|
-
if (this.incoming?.element === t && this.state ===
|
|
2370
|
+
if (this.incoming?.element === t && this.state === x.FOCUSING) {
|
|
2388
2371
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
|
|
2389
2372
|
this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
|
|
2390
2373
|
t,
|
|
2391
2374
|
this.incoming.originalState,
|
|
2392
2375
|
a,
|
|
2393
2376
|
r
|
|
2394
|
-
), this.incoming = null, this.state =
|
|
2377
|
+
), this.incoming = null, this.state = x.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE;
|
|
2395
2378
|
return;
|
|
2396
2379
|
}
|
|
2397
2380
|
const n = ++this.focusGeneration;
|
|
2398
2381
|
switch (this.state) {
|
|
2399
|
-
case
|
|
2400
|
-
if (this.state =
|
|
2401
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2382
|
+
case x.IDLE:
|
|
2383
|
+
if (this.state = x.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
|
|
2384
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2402
2385
|
break;
|
|
2403
|
-
case
|
|
2404
|
-
if (this.state =
|
|
2386
|
+
case x.FOCUSED:
|
|
2387
|
+
if (this.state = x.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
|
|
2405
2388
|
this.currentFocus,
|
|
2406
2389
|
this.focusData.originalState
|
|
2407
2390
|
)), this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
|
|
@@ -2413,9 +2396,9 @@ class je {
|
|
|
2413
2396
|
const a = this.outgoing.element;
|
|
2414
2397
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2415
2398
|
}
|
|
2416
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2399
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2417
2400
|
break;
|
|
2418
|
-
case
|
|
2401
|
+
case x.FOCUSING:
|
|
2419
2402
|
if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
|
|
2420
2403
|
this.incoming.element,
|
|
2421
2404
|
this.incoming.originalState,
|
|
@@ -2423,10 +2406,10 @@ class je {
|
|
|
2423
2406
|
this.focusData?.originalWidth,
|
|
2424
2407
|
this.focusData?.originalHeight
|
|
2425
2408
|
), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
|
|
2426
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2409
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2427
2410
|
break;
|
|
2428
|
-
case
|
|
2429
|
-
if (this.state =
|
|
2411
|
+
case x.UNFOCUSING:
|
|
2412
|
+
if (this.state = x.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
|
|
2430
2413
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2431
2414
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2432
2415
|
]), this.focusGeneration !== n) return;
|
|
@@ -2434,20 +2417,20 @@ class je {
|
|
|
2434
2417
|
const a = this.outgoing.element;
|
|
2435
2418
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2436
2419
|
}
|
|
2437
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2420
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2438
2421
|
break;
|
|
2439
|
-
case
|
|
2422
|
+
case x.CROSS_ANIMATING:
|
|
2440
2423
|
if (this.incoming?.element === t)
|
|
2441
2424
|
return;
|
|
2442
2425
|
if (this.outgoing?.element === t) {
|
|
2443
2426
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
|
|
2444
2427
|
if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
|
|
2445
|
-
const { transform: s, dimensions:
|
|
2428
|
+
const { transform: s, dimensions: l } = this.captureMidAnimationState(this.incoming.element);
|
|
2446
2429
|
this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2447
2430
|
this.incoming.element,
|
|
2448
2431
|
this.incoming.originalState,
|
|
2449
2432
|
s,
|
|
2450
|
-
|
|
2433
|
+
l
|
|
2451
2434
|
);
|
|
2452
2435
|
} else
|
|
2453
2436
|
this.outgoing = null;
|
|
@@ -2459,7 +2442,7 @@ class je {
|
|
|
2459
2442
|
const s = this.outgoing.element;
|
|
2460
2443
|
this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
|
|
2461
2444
|
}
|
|
2462
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2445
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2463
2446
|
return;
|
|
2464
2447
|
}
|
|
2465
2448
|
if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
|
|
@@ -2485,7 +2468,7 @@ class je {
|
|
|
2485
2468
|
const a = this.outgoing.element;
|
|
2486
2469
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2487
2470
|
}
|
|
2488
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2471
|
+
this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
|
|
2489
2472
|
break;
|
|
2490
2473
|
}
|
|
2491
2474
|
}
|
|
@@ -2493,24 +2476,24 @@ class je {
|
|
|
2493
2476
|
* Unfocus current image, returning it to original position
|
|
2494
2477
|
*/
|
|
2495
2478
|
async unfocusImage() {
|
|
2496
|
-
if (this.state ===
|
|
2479
|
+
if (this.state === x.UNFOCUSING)
|
|
2497
2480
|
return;
|
|
2498
2481
|
const t = ++this.focusGeneration;
|
|
2499
2482
|
if (!this.currentFocus || !this.focusData) {
|
|
2500
|
-
if (this.incoming && this.state ===
|
|
2483
|
+
if (this.incoming && this.state === x.FOCUSING) {
|
|
2501
2484
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2502
2485
|
if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2503
2486
|
this.incoming.element,
|
|
2504
2487
|
this.incoming.originalState,
|
|
2505
2488
|
a,
|
|
2506
2489
|
r
|
|
2507
|
-
), this.incoming = null, this.state =
|
|
2490
|
+
), this.incoming = null, this.state = x.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
|
|
2508
2491
|
const s = this.outgoing.element;
|
|
2509
|
-
this.removeFocusedStyling(s, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state =
|
|
2492
|
+
this.removeFocusedStyling(s, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = x.IDLE, this.onUnfocusComplete?.(s);
|
|
2510
2493
|
}
|
|
2511
2494
|
return;
|
|
2512
2495
|
}
|
|
2513
|
-
if (this.state ===
|
|
2496
|
+
if (this.state === x.CROSS_ANIMATING && this.incoming) {
|
|
2514
2497
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2515
2498
|
this.animationEngine.cancelAllAnimations(this.incoming.element);
|
|
2516
2499
|
const s = this.startUnfocusAnimation(
|
|
@@ -2523,15 +2506,15 @@ class je {
|
|
|
2523
2506
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2524
2507
|
this.waitForAnimation(s.animationHandle)
|
|
2525
2508
|
]), this.focusGeneration !== t) return;
|
|
2526
|
-
let
|
|
2527
|
-
this.outgoing && (
|
|
2528
|
-
const
|
|
2529
|
-
this.removeFocusedStyling(
|
|
2509
|
+
let l = null;
|
|
2510
|
+
this.outgoing && (l = this.outgoing.element, this.removeFocusedStyling(l, this.outgoing.originalState.zIndex?.toString() || ""));
|
|
2511
|
+
const c = s.element;
|
|
2512
|
+
this.removeFocusedStyling(c, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE, l && this.onUnfocusComplete?.(l), this.onUnfocusComplete?.(c);
|
|
2530
2513
|
return;
|
|
2531
2514
|
}
|
|
2532
|
-
this.state =
|
|
2515
|
+
this.state = x.UNFOCUSING;
|
|
2533
2516
|
const i = this.currentFocus, e = this.focusData.originalState, n = this.focusData.originalZIndex;
|
|
2534
|
-
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state =
|
|
2517
|
+
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE, this.onUnfocusComplete?.(i));
|
|
2535
2518
|
}
|
|
2536
2519
|
/**
|
|
2537
2520
|
* Swap focus from current image to a new one (alias for focusImage with cross-animation)
|
|
@@ -2549,7 +2532,7 @@ class je {
|
|
|
2549
2532
|
* Check if an image is currently focused (stable state)
|
|
2550
2533
|
*/
|
|
2551
2534
|
isFocused(t) {
|
|
2552
|
-
return this.currentFocus === t && this.state ===
|
|
2535
|
+
return this.currentFocus === t && this.state === x.FOCUSED;
|
|
2553
2536
|
}
|
|
2554
2537
|
/**
|
|
2555
2538
|
* Check if an image is the target of current focus animation
|
|
@@ -2570,7 +2553,7 @@ class je {
|
|
|
2570
2553
|
* Used during swipe gestures for visual feedback
|
|
2571
2554
|
*/
|
|
2572
2555
|
setDragOffset(t) {
|
|
2573
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2556
|
+
if (!this.currentFocus || !this.focusData || this.state !== x.FOCUSED) return;
|
|
2574
2557
|
const i = this.currentFocus, e = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], a = (e.x ?? 0) + t, r = e.y ?? 0;
|
|
2575
2558
|
n.push(`translate(${a}px, ${r}px)`), e.rotation !== void 0 && n.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = n.join(" ");
|
|
2576
2559
|
}
|
|
@@ -2580,13 +2563,13 @@ class je {
|
|
|
2580
2563
|
* @param duration - Animation duration in ms (default 150)
|
|
2581
2564
|
*/
|
|
2582
2565
|
clearDragOffset(t, i = 150) {
|
|
2583
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2566
|
+
if (!this.currentFocus || !this.focusData || this.state !== x.FOCUSED) return;
|
|
2584
2567
|
const e = this.currentFocus, n = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = n.x ?? 0, s = n.y ?? 0;
|
|
2585
2568
|
a.push(`translate(${r}px, ${s}px)`), n.rotation !== void 0 && a.push(`rotate(${n.rotation}deg)`);
|
|
2586
|
-
const
|
|
2587
|
-
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform =
|
|
2569
|
+
const l = a.join(" ");
|
|
2570
|
+
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform = l, setTimeout(() => {
|
|
2588
2571
|
this.currentFocus === e && (e.style.transition = "none");
|
|
2589
|
-
}, i)) : (e.style.transition = "none", e.style.transform =
|
|
2572
|
+
}, i)) : (e.style.transition = "none", e.style.transform = l);
|
|
2590
2573
|
}
|
|
2591
2574
|
/**
|
|
2592
2575
|
* Reset zoom state (cancels all animations)
|
|
@@ -2610,7 +2593,7 @@ class je {
|
|
|
2610
2593
|
this.focusData.originalZIndex,
|
|
2611
2594
|
this.focusData.originalWidth,
|
|
2612
2595
|
this.focusData.originalHeight
|
|
2613
|
-
), this.state =
|
|
2596
|
+
), this.state = x.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2614
2597
|
}
|
|
2615
2598
|
}
|
|
2616
2599
|
const We = 50, Ge = 0.5, qe = 20, Be = 0.3, Xe = 150, Ye = 30, at = class at {
|
|
@@ -2680,7 +2663,7 @@ const We = 50, Ge = 0.5, qe = 20, Be = 0.3, Xe = 150, Ye = 30, at = class at {
|
|
|
2680
2663
|
}
|
|
2681
2664
|
};
|
|
2682
2665
|
at.TOUCH_CLICK_DELAY = 300;
|
|
2683
|
-
let
|
|
2666
|
+
let yt = at;
|
|
2684
2667
|
class Je {
|
|
2685
2668
|
constructor(t) {
|
|
2686
2669
|
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)
|
|
@@ -2776,10 +2759,10 @@ class Je {
|
|
|
2776
2759
|
const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
|
|
2777
2760
|
if (!s.ok)
|
|
2778
2761
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2779
|
-
const
|
|
2762
|
+
const c = (await s.json()).files.filter(
|
|
2780
2763
|
(u) => u.mimeType.startsWith("image/") && i.isAllowed(u.name)
|
|
2781
2764
|
);
|
|
2782
|
-
return this.log(`Found ${
|
|
2765
|
+
return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((u) => {
|
|
2783
2766
|
e.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
|
|
2784
2767
|
}), e;
|
|
2785
2768
|
}
|
|
@@ -2801,8 +2784,8 @@ class Je {
|
|
|
2801
2784
|
try {
|
|
2802
2785
|
const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
|
|
2803
2786
|
if (s.ok) {
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2787
|
+
const l = await s.json();
|
|
2788
|
+
l.mimeType.startsWith("image/") && i.isAllowed(l.name) ? (e.push(`https://lh3.googleusercontent.com/d/${a}=s1600`), this.log(`Added file: ${l.name}`)) : this.log(`Skipping non-image file: ${l.name} (${l.mimeType})`);
|
|
2806
2789
|
} else
|
|
2807
2790
|
this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
|
|
2808
2791
|
} catch (r) {
|
|
@@ -2846,12 +2829,12 @@ class Je {
|
|
|
2846
2829
|
const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
|
|
2847
2830
|
if (!s.ok)
|
|
2848
2831
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2849
|
-
const
|
|
2832
|
+
const l = await s.json(), c = l.files.filter(
|
|
2850
2833
|
(h) => h.mimeType.startsWith("image/") && i.isAllowed(h.name)
|
|
2851
|
-
), u =
|
|
2834
|
+
), u = l.files.filter(
|
|
2852
2835
|
(h) => h.mimeType === "application/vnd.google-apps.folder"
|
|
2853
2836
|
);
|
|
2854
|
-
this.log(`Found ${
|
|
2837
|
+
this.log(`Found ${l.files.length} total items in folder ${t}`), l.files.forEach((h) => this.log(` - File: ${h.name} (${h.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), c.forEach((h) => {
|
|
2855
2838
|
e.push(`https://lh3.googleusercontent.com/d/${h.id}=s1600`), this.log(`Added file: ${h.name}`);
|
|
2856
2839
|
});
|
|
2857
2840
|
for (const h of u) {
|
|
@@ -3235,11 +3218,11 @@ function ti() {
|
|
|
3235
3218
|
}
|
|
3236
3219
|
class ei {
|
|
3237
3220
|
constructor(t = {}) {
|
|
3238
|
-
this.fullConfig = te(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 oe(this.fullConfig.animation), this.layoutEngine = new
|
|
3221
|
+
this.fullConfig = te(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 oe(this.fullConfig.animation), this.layoutEngine = new _e({
|
|
3239
3222
|
layout: this.fullConfig.layout,
|
|
3240
3223
|
image: this.fullConfig.image
|
|
3241
3224
|
}), this.zoomEngine = new je(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = et(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
|
|
3242
|
-
const i = this.fullConfig.animation.entry ||
|
|
3225
|
+
const i = this.fullConfig.animation.entry || R.animation.entry;
|
|
3243
3226
|
this.entryAnimationEngine = new me(
|
|
3244
3227
|
i,
|
|
3245
3228
|
this.fullConfig.layout.algorithm
|
|
@@ -3306,7 +3289,7 @@ class ei {
|
|
|
3306
3289
|
this.containerEl = this.containerRef;
|
|
3307
3290
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
3308
3291
|
throw new Error(`Container #${this.containerId} not found`);
|
|
3309
|
-
this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new
|
|
3292
|
+
this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new yt(this.containerEl, {
|
|
3310
3293
|
onNext: () => this.navigateToNextImage(),
|
|
3311
3294
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3312
3295
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
@@ -3319,7 +3302,7 @@ class ei {
|
|
|
3319
3302
|
}
|
|
3320
3303
|
}
|
|
3321
3304
|
setupUI() {
|
|
3322
|
-
const t = this.fullConfig.
|
|
3305
|
+
const t = this.fullConfig.ui;
|
|
3323
3306
|
t.showLoadingSpinner && (t.loadingElement ? (this.loadingEl = this.resolveElement(t.loadingElement), this.loadingElAutoCreated = !1) : (this.loadingEl = this.createDefaultLoadingElement(), this.loadingElAutoCreated = !0)), t.errorElement ? (this.errorEl = this.resolveElement(t.errorElement), this.errorElAutoCreated = !1) : (this.errorEl = this.createDefaultErrorElement(), this.errorElAutoCreated = !0), t.showImageCounter && (t.counterElement ? (this.counterEl = this.resolveElement(t.counterElement), this.counterElAutoCreated = !1) : (this.counterEl = this.createDefaultCounterElement(), this.counterElAutoCreated = !0));
|
|
3324
3307
|
}
|
|
3325
3308
|
resolveElement(t) {
|
|
@@ -3432,59 +3415,59 @@ class ei {
|
|
|
3432
3415
|
const n = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
|
|
3433
3416
|
this.imageLayouts = a, this.displayQueue = [];
|
|
3434
3417
|
let r = 0;
|
|
3435
|
-
const s = (
|
|
3436
|
-
this.containerEl && (this.containerEl.appendChild(
|
|
3437
|
-
if (
|
|
3418
|
+
const s = (c) => {
|
|
3419
|
+
this.containerEl && (this.containerEl.appendChild(c), this.imageElements.push(c), requestAnimationFrame(() => {
|
|
3420
|
+
if (c.offsetWidth, c.style.opacity = this.defaultStyles.opacity ?? "1", c.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || c.dataset.startRotation !== c.dataset.rotation || c.dataset.startScale !== c.dataset.scale)) {
|
|
3438
3421
|
const d = {
|
|
3439
|
-
x: parseFloat(
|
|
3440
|
-
y: parseFloat(
|
|
3422
|
+
x: parseFloat(c.dataset.startX),
|
|
3423
|
+
y: parseFloat(c.dataset.startY)
|
|
3441
3424
|
}, f = {
|
|
3442
|
-
x: parseFloat(
|
|
3443
|
-
y: parseFloat(
|
|
3444
|
-
},
|
|
3425
|
+
x: parseFloat(c.dataset.endX),
|
|
3426
|
+
y: parseFloat(c.dataset.endY)
|
|
3427
|
+
}, y = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), b = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, w = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, v = this.entryAnimationEngine.getTiming();
|
|
3445
3428
|
ue({
|
|
3446
|
-
element:
|
|
3429
|
+
element: c,
|
|
3447
3430
|
startPosition: d,
|
|
3448
3431
|
endPosition: f,
|
|
3449
3432
|
pathConfig: this.entryAnimationEngine.getPathConfig(),
|
|
3450
3433
|
duration: v.duration,
|
|
3451
|
-
imageWidth:
|
|
3434
|
+
imageWidth: y,
|
|
3452
3435
|
imageHeight: p,
|
|
3453
3436
|
rotation: g,
|
|
3454
3437
|
scale: m,
|
|
3455
3438
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3456
|
-
startRotation:
|
|
3439
|
+
startRotation: b,
|
|
3457
3440
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
3458
3441
|
startScale: w
|
|
3459
3442
|
});
|
|
3460
3443
|
} else {
|
|
3461
|
-
const d =
|
|
3462
|
-
|
|
3444
|
+
const d = c.dataset.finalTransform || "";
|
|
3445
|
+
c.style.transform = d;
|
|
3463
3446
|
}
|
|
3464
|
-
const h = parseInt(
|
|
3447
|
+
const h = parseInt(c.dataset.imageId || "0");
|
|
3465
3448
|
if (this.fullConfig.config.debug?.enabled && h < 3) {
|
|
3466
|
-
const d =
|
|
3449
|
+
const d = c.dataset.finalTransform || "";
|
|
3467
3450
|
console.log(`Image ${h} final state:`, {
|
|
3468
|
-
left:
|
|
3469
|
-
top:
|
|
3470
|
-
width:
|
|
3471
|
-
height:
|
|
3472
|
-
computedWidth:
|
|
3473
|
-
computedHeight:
|
|
3451
|
+
left: c.style.left,
|
|
3452
|
+
top: c.style.top,
|
|
3453
|
+
width: c.style.width,
|
|
3454
|
+
height: c.style.height,
|
|
3455
|
+
computedWidth: c.offsetWidth,
|
|
3456
|
+
computedHeight: c.offsetHeight,
|
|
3474
3457
|
transform: d,
|
|
3475
3458
|
pathType: this.entryAnimationEngine.getPathType()
|
|
3476
3459
|
});
|
|
3477
3460
|
}
|
|
3478
3461
|
if (this.idleAnimationEngine) {
|
|
3479
3462
|
const d = this.entryAnimationEngine.getTiming().duration;
|
|
3480
|
-
this.idleAnimationEngine.register(
|
|
3463
|
+
this.idleAnimationEngine.register(c, h, this.imageElements.length, d);
|
|
3481
3464
|
}
|
|
3482
3465
|
}), r++);
|
|
3483
|
-
},
|
|
3466
|
+
}, l = () => {
|
|
3484
3467
|
if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
|
|
3485
3468
|
for (; this.displayQueue.length > 0; ) {
|
|
3486
|
-
const
|
|
3487
|
-
|
|
3469
|
+
const c = this.displayQueue.shift();
|
|
3470
|
+
c && s(c);
|
|
3488
3471
|
}
|
|
3489
3472
|
return;
|
|
3490
3473
|
}
|
|
@@ -3494,27 +3477,27 @@ class ei {
|
|
|
3494
3477
|
return;
|
|
3495
3478
|
}
|
|
3496
3479
|
if (this.displayQueue.length > 0) {
|
|
3497
|
-
const
|
|
3498
|
-
|
|
3480
|
+
const c = this.displayQueue.shift();
|
|
3481
|
+
c && s(c);
|
|
3499
3482
|
}
|
|
3500
3483
|
r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
|
|
3501
3484
|
}, this.fullConfig.animation.queue.interval);
|
|
3502
3485
|
};
|
|
3503
3486
|
if ("IntersectionObserver" in window && this.containerEl) {
|
|
3504
|
-
const
|
|
3487
|
+
const c = new IntersectionObserver((u) => {
|
|
3505
3488
|
u.forEach((h) => {
|
|
3506
|
-
h.isIntersecting && (
|
|
3489
|
+
h.isIntersecting && (l(), c.disconnect());
|
|
3507
3490
|
});
|
|
3508
3491
|
}, { threshold: 0.1, rootMargin: "50px" });
|
|
3509
|
-
|
|
3492
|
+
c.observe(this.containerEl);
|
|
3510
3493
|
} else
|
|
3511
|
-
|
|
3512
|
-
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((
|
|
3494
|
+
l();
|
|
3495
|
+
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), a.forEach((c, u) => {
|
|
3513
3496
|
const h = document.createElement("div");
|
|
3514
3497
|
h.className = "fbn-ic-debug-center", h.style.position = "absolute", h.style.width = "12px", h.style.height = "12px", h.style.borderRadius = "50%", h.style.backgroundColor = "red", h.style.border = "2px solid yellow", h.style.zIndex = "9999", h.style.pointerEvents = "none";
|
|
3515
|
-
const d =
|
|
3498
|
+
const d = c.x, f = c.y;
|
|
3516
3499
|
h.style.left = `${d - 6}px`, h.style.top = `${f - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(h);
|
|
3517
|
-
})), t.forEach((
|
|
3500
|
+
})), t.forEach((c, u) => {
|
|
3518
3501
|
const h = document.createElement("img");
|
|
3519
3502
|
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.dragging === !1 && (h.draggable = !1), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
|
|
3520
3503
|
const d = a[u];
|
|
@@ -3533,27 +3516,27 @@ class ei {
|
|
|
3533
3516
|
}), h.style.opacity = "0", h.style.transition = this.entryAnimationEngine.getTransitionCSS(), h.onload = () => {
|
|
3534
3517
|
if (n !== this.loadGeneration)
|
|
3535
3518
|
return;
|
|
3536
|
-
const f = h.naturalWidth / h.naturalHeight,
|
|
3537
|
-
h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${
|
|
3538
|
-
const p = { x: d.x, y: d.y }, g = { width:
|
|
3519
|
+
const f = h.naturalWidth / h.naturalHeight, y = i * f;
|
|
3520
|
+
h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${y}`), h.style.width = `${y}px`, h.cachedRenderedWidth = y, h.aspectRatio = f, ft(h, this.fullConfig.styling?.default, i, y);
|
|
3521
|
+
const p = { x: d.x, y: d.y }, g = { width: y, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
|
|
3539
3522
|
p,
|
|
3540
3523
|
g,
|
|
3541
3524
|
e,
|
|
3542
3525
|
u,
|
|
3543
3526
|
t.length
|
|
3544
|
-
),
|
|
3527
|
+
), b = this.entryAnimationEngine.calculateStartRotation(d.rotation), w = this.entryAnimationEngine.calculateStartScale(d.scale), v = this.entryAnimationEngine.buildFinalTransform(
|
|
3545
3528
|
d.rotation,
|
|
3546
3529
|
d.scale,
|
|
3547
|
-
|
|
3530
|
+
y,
|
|
3548
3531
|
i
|
|
3549
|
-
),
|
|
3532
|
+
), S = this.entryAnimationEngine.buildStartTransform(
|
|
3550
3533
|
m,
|
|
3551
3534
|
p,
|
|
3552
3535
|
d.rotation,
|
|
3553
3536
|
d.scale,
|
|
3554
|
-
b,
|
|
3555
|
-
i,
|
|
3556
3537
|
y,
|
|
3538
|
+
i,
|
|
3539
|
+
b,
|
|
3557
3540
|
w
|
|
3558
3541
|
);
|
|
3559
3542
|
this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
|
|
@@ -3562,10 +3545,10 @@ class ei {
|
|
|
3562
3545
|
left: d.x,
|
|
3563
3546
|
top: d.y,
|
|
3564
3547
|
finalTransform: v,
|
|
3565
|
-
renderedWidth:
|
|
3548
|
+
renderedWidth: y,
|
|
3566
3549
|
renderedHeight: i
|
|
3567
|
-
}), h.style.transform =
|
|
3568
|
-
}, h.onerror = () => r++, h.src =
|
|
3550
|
+
}), h.style.transform = S, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || b !== d.rotation || w !== d.scale) && (h.dataset.startX = String(m.x), h.dataset.startY = String(m.y), h.dataset.endX = String(p.x), h.dataset.endY = String(p.y), h.dataset.imageWidth = String(y), h.dataset.imageHeight = String(i), h.dataset.rotation = String(d.rotation), h.dataset.scale = String(d.scale), h.dataset.startRotation = String(b), h.dataset.startScale = String(w)), this.displayQueue.push(h);
|
|
3551
|
+
}, h.onerror = () => r++, h.src = c;
|
|
3569
3552
|
});
|
|
3570
3553
|
}
|
|
3571
3554
|
async handleImageClick(t, i) {
|
|
@@ -3589,7 +3572,7 @@ class ei {
|
|
|
3589
3572
|
this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null), this.loadGeneration++, this.displayQueue = [], this.containerEl && this.containerEl.querySelectorAll(".fbn-ic-image, .fbn-ic-debug-center").forEach((t) => t.remove()), this.imageElements = [], this.imageLayouts = [], this.currentFocusIndex = null, this.hoveredImage = null, this.layoutEngine.reset(), this.zoomEngine.reset(), this.idleAnimationEngine?.stopAll(), this.imagesLoaded = !1;
|
|
3590
3573
|
}
|
|
3591
3574
|
showLoading(t) {
|
|
3592
|
-
!this.fullConfig.
|
|
3575
|
+
!this.fullConfig.ui.showLoadingSpinner || !this.loadingEl || (t ? this.loadingEl.classList.remove("fbn-ic-hidden") : this.loadingEl.classList.add("fbn-ic-hidden"));
|
|
3593
3576
|
}
|
|
3594
3577
|
showError(t) {
|
|
3595
3578
|
this.errorEl && (this.errorEl.textContent = t, this.errorEl.classList.remove("fbn-ic-hidden"));
|
|
@@ -3598,7 +3581,7 @@ class ei {
|
|
|
3598
3581
|
this.errorEl && this.errorEl.classList.add("fbn-ic-hidden");
|
|
3599
3582
|
}
|
|
3600
3583
|
updateCounter(t) {
|
|
3601
|
-
!this.fullConfig.
|
|
3584
|
+
!this.fullConfig.ui.showImageCounter || !this.counterEl || (this.counterEl.textContent = `${t + 1} of ${this.imageElements.length}`, this.counterEl.classList.remove("fbn-ic-hidden"));
|
|
3602
3585
|
}
|
|
3603
3586
|
hideCounter() {
|
|
3604
3587
|
this.counterEl && this.counterEl.classList.add("fbn-ic-hidden");
|
|
@@ -3669,9 +3652,9 @@ const It = class It extends HTMLElement {
|
|
|
3669
3652
|
}
|
|
3670
3653
|
};
|
|
3671
3654
|
It.observedAttributes = ["config", "images", "layout"];
|
|
3672
|
-
let
|
|
3673
|
-
typeof customElements < "u" && !customElements.get("image-cloud") && customElements.define("image-cloud",
|
|
3655
|
+
let bt = It;
|
|
3656
|
+
typeof customElements < "u" && !customElements.get("image-cloud") && customElements.define("image-cloud", bt);
|
|
3674
3657
|
export {
|
|
3675
|
-
|
|
3658
|
+
bt as ImageCloudElement
|
|
3676
3659
|
};
|
|
3677
3660
|
//# sourceMappingURL=web-component.js.map
|