@frybynite/image-cloud 0.3.3 → 0.3.5
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 +169 -151
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +206 -188
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +11 -2
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const kt = ".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-hidden{display:none!important}",
|
|
1
|
+
const kt = ".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}", St = 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)",
|
|
@@ -20,10 +20,10 @@ const kt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
20
20
|
flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
|
|
21
21
|
}), Tt = Object.freeze({
|
|
22
22
|
type: "linear"
|
|
23
|
-
}), Rt = Object.freeze({
|
|
24
|
-
mode: "none"
|
|
25
23
|
}), At = Object.freeze({
|
|
26
24
|
mode: "none"
|
|
25
|
+
}), Ct = Object.freeze({
|
|
26
|
+
mode: "none"
|
|
27
27
|
}), $t = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
@@ -87,7 +87,7 @@ const kt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
87
87
|
failOnAllMissing: !0,
|
|
88
88
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"],
|
|
89
89
|
debugLogging: !1
|
|
90
|
-
}),
|
|
90
|
+
}), E = Object.freeze({
|
|
91
91
|
// Loader configuration (always an array, composite behavior is implicit)
|
|
92
92
|
loaders: [],
|
|
93
93
|
// Shared loader settings
|
|
@@ -162,8 +162,8 @@ const kt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
162
162
|
easing: "cubic-bezier(0.25, 1, 0.5, 1)",
|
|
163
163
|
// smooth deceleration
|
|
164
164
|
path: Tt,
|
|
165
|
-
rotation:
|
|
166
|
-
scale:
|
|
165
|
+
rotation: At,
|
|
166
|
+
scale: Ct
|
|
167
167
|
})
|
|
168
168
|
}),
|
|
169
169
|
// Pattern-based interaction configuration
|
|
@@ -204,8 +204,7 @@ const kt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
204
204
|
}),
|
|
205
205
|
ui: Object.freeze({
|
|
206
206
|
showLoadingSpinner: !1,
|
|
207
|
-
showImageCounter:
|
|
208
|
-
// STUB: Not implemented yet
|
|
207
|
+
showImageCounter: !1,
|
|
209
208
|
showThumbnails: void 0,
|
|
210
209
|
// STUB: Not implemented yet
|
|
211
210
|
theme: void 0
|
|
@@ -316,72 +315,72 @@ function Vt(n = {}) {
|
|
|
316
315
|
loaders: o,
|
|
317
316
|
config: r,
|
|
318
317
|
image: Xt(Dt, i),
|
|
319
|
-
layout: { ...
|
|
320
|
-
animation: { ...
|
|
321
|
-
interaction: { ...
|
|
322
|
-
rendering: { ...
|
|
318
|
+
layout: { ...E.layout },
|
|
319
|
+
animation: { ...E.animation },
|
|
320
|
+
interaction: { ...E.interaction },
|
|
321
|
+
rendering: { ...E.rendering },
|
|
323
322
|
styling: Yt($t, n.styling),
|
|
324
|
-
debug:
|
|
323
|
+
debug: E.debug
|
|
325
324
|
};
|
|
326
325
|
return n.layout && (s.layout = {
|
|
327
|
-
...
|
|
326
|
+
...E.layout,
|
|
328
327
|
...n.layout
|
|
329
328
|
}, n.layout.responsive && (s.layout.responsive = {
|
|
330
|
-
...
|
|
331
|
-
mobile: n.layout.responsive.mobile ? { ...
|
|
332
|
-
tablet: n.layout.responsive.tablet ? { ...
|
|
329
|
+
...E.layout.responsive,
|
|
330
|
+
mobile: n.layout.responsive.mobile ? { ...E.layout.responsive.mobile, ...n.layout.responsive.mobile } : E.layout.responsive.mobile,
|
|
331
|
+
tablet: n.layout.responsive.tablet ? { ...E.layout.responsive.tablet, ...n.layout.responsive.tablet } : E.layout.responsive.tablet
|
|
333
332
|
}), n.layout.spacing && (s.layout.spacing = {
|
|
334
|
-
...
|
|
333
|
+
...E.layout.spacing,
|
|
335
334
|
...n.layout.spacing
|
|
336
335
|
})), n.animation && (s.animation = {
|
|
337
|
-
...
|
|
336
|
+
...E.animation,
|
|
338
337
|
...n.animation
|
|
339
338
|
}, n.animation.easing && (s.animation.easing = {
|
|
340
|
-
...
|
|
339
|
+
...E.animation.easing,
|
|
341
340
|
...n.animation.easing
|
|
342
341
|
}), n.animation.queue && (s.animation.queue = {
|
|
343
|
-
...
|
|
342
|
+
...E.animation.queue,
|
|
344
343
|
...n.animation.queue
|
|
345
344
|
}), n.animation.performance && (s.animation.performance = {
|
|
346
|
-
...
|
|
345
|
+
...E.animation.performance,
|
|
347
346
|
...n.animation.performance
|
|
348
347
|
}), n.animation.entry && (s.animation.entry = {
|
|
349
|
-
...
|
|
348
|
+
...E.animation.entry,
|
|
350
349
|
...n.animation.entry,
|
|
351
350
|
start: n.animation.entry.start ? {
|
|
352
|
-
...
|
|
351
|
+
...E.animation.entry.start,
|
|
353
352
|
...n.animation.entry.start,
|
|
354
|
-
circular: n.animation.entry.start.circular ? { ...
|
|
355
|
-
} :
|
|
356
|
-
timing: n.animation.entry.timing ? { ...
|
|
357
|
-
path: n.animation.entry.path ? { ...Tt, ...n.animation.entry.path } :
|
|
358
|
-
rotation: n.animation.entry.rotation ? { ...
|
|
359
|
-
scale: n.animation.entry.scale ? { ...
|
|
353
|
+
circular: n.animation.entry.start.circular ? { ...E.animation.entry.start.circular, ...n.animation.entry.start.circular } : E.animation.entry.start.circular
|
|
354
|
+
} : E.animation.entry.start,
|
|
355
|
+
timing: n.animation.entry.timing ? { ...E.animation.entry.timing, ...n.animation.entry.timing } : E.animation.entry.timing,
|
|
356
|
+
path: n.animation.entry.path ? { ...Tt, ...n.animation.entry.path } : E.animation.entry.path,
|
|
357
|
+
rotation: n.animation.entry.rotation ? { ...At, ...n.animation.entry.rotation } : E.animation.entry.rotation,
|
|
358
|
+
scale: n.animation.entry.scale ? { ...Ct, ...n.animation.entry.scale } : E.animation.entry.scale
|
|
360
359
|
})), n.interaction && (s.interaction = {
|
|
361
|
-
...
|
|
360
|
+
...E.interaction,
|
|
362
361
|
...n.interaction
|
|
363
362
|
}, n.interaction.focus && (s.interaction.focus = {
|
|
364
|
-
...
|
|
363
|
+
...E.interaction.focus,
|
|
365
364
|
...n.interaction.focus
|
|
366
365
|
}), n.interaction.navigation && (s.interaction.navigation = {
|
|
367
|
-
...
|
|
366
|
+
...E.interaction.navigation,
|
|
368
367
|
...n.interaction.navigation
|
|
369
368
|
}), n.interaction.gestures && (s.interaction.gestures = {
|
|
370
|
-
...
|
|
369
|
+
...E.interaction.gestures,
|
|
371
370
|
...n.interaction.gestures
|
|
372
371
|
})), n.rendering && (s.rendering = {
|
|
373
|
-
...
|
|
372
|
+
...E.rendering,
|
|
374
373
|
...n.rendering
|
|
375
374
|
}, n.rendering.responsive && (s.rendering.responsive = {
|
|
376
|
-
...
|
|
375
|
+
...E.rendering.responsive,
|
|
377
376
|
...n.rendering.responsive,
|
|
378
|
-
breakpoints: n.rendering.responsive.breakpoints ? { ...
|
|
379
|
-
mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection :
|
|
377
|
+
breakpoints: n.rendering.responsive.breakpoints ? { ...E.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : E.rendering.responsive.breakpoints,
|
|
378
|
+
mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : E.rendering.responsive.mobileDetection
|
|
380
379
|
}), n.rendering.ui && (s.rendering.ui = {
|
|
381
|
-
...
|
|
380
|
+
...E.rendering.ui,
|
|
382
381
|
...n.rendering.ui
|
|
383
382
|
}), n.rendering.performance && (s.rendering.performance = {
|
|
384
|
-
...
|
|
383
|
+
...E.rendering.performance,
|
|
385
384
|
...n.rendering.performance
|
|
386
385
|
})), n.debug !== void 0 && (s.debug = n.debug), s;
|
|
387
386
|
}
|
|
@@ -653,22 +652,22 @@ function ce(n) {
|
|
|
653
652
|
startRotation: d,
|
|
654
653
|
scaleConfig: m,
|
|
655
654
|
startScale: b
|
|
656
|
-
} = n, p = o.type, g = d !== void 0 && d !== h, f = (c == null ? void 0 : c.mode) === "wobble", y = (c == null ? void 0 : c.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, I = b !== void 0 && b !== l,
|
|
657
|
-
if ((p === "linear" || p === "arc") && !v && !(I ||
|
|
655
|
+
} = n, p = o.type, g = d !== void 0 && d !== h, f = (c == null ? void 0 : c.mode) === "wobble", y = (c == null ? void 0 : c.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, I = b !== void 0 && b !== l, A = (m == null ? void 0 : m.mode) === "pop", w = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
|
|
656
|
+
if ((p === "linear" || p === "arc") && !v && !(I || A)) {
|
|
658
657
|
u && u();
|
|
659
658
|
return;
|
|
660
659
|
}
|
|
661
660
|
const N = performance.now(), P = -r / 2, D = -s / 2;
|
|
662
661
|
function U(k) {
|
|
663
662
|
const z = k - N, x = Math.min(z / a, 1);
|
|
664
|
-
let
|
|
663
|
+
let C;
|
|
665
664
|
switch (p) {
|
|
666
665
|
case "bounce": {
|
|
667
666
|
const H = Kt(
|
|
668
667
|
o.bouncePreset,
|
|
669
668
|
o.bounce
|
|
670
669
|
);
|
|
671
|
-
|
|
670
|
+
C = ee(x, e, i, H);
|
|
672
671
|
break;
|
|
673
672
|
}
|
|
674
673
|
case "elastic": {
|
|
@@ -676,7 +675,7 @@ function ce(n) {
|
|
|
676
675
|
o.elasticPreset,
|
|
677
676
|
o.elastic
|
|
678
677
|
);
|
|
679
|
-
|
|
678
|
+
C = ne(x, e, i, H);
|
|
680
679
|
break;
|
|
681
680
|
}
|
|
682
681
|
case "wave": {
|
|
@@ -684,20 +683,20 @@ function ce(n) {
|
|
|
684
683
|
o.wavePreset,
|
|
685
684
|
o.wave
|
|
686
685
|
);
|
|
687
|
-
|
|
686
|
+
C = oe(x, e, i, H);
|
|
688
687
|
break;
|
|
689
688
|
}
|
|
690
689
|
default:
|
|
691
|
-
|
|
690
|
+
C = {
|
|
692
691
|
x: st(e.x, i.x, x),
|
|
693
692
|
y: st(e.y, i.y, x)
|
|
694
693
|
};
|
|
695
694
|
}
|
|
696
|
-
const O =
|
|
695
|
+
const O = C.x - i.x, M = C.y - i.y;
|
|
697
696
|
let T;
|
|
698
697
|
f ? T = ae(x, h, y) : g ? T = st(d, h, x) : T = h;
|
|
699
|
-
let
|
|
700
|
-
|
|
698
|
+
let R;
|
|
699
|
+
A ? R = re(x, l, w) : I ? R = st(b, l, x) : R = l, t.style.transform = `translate(${P}px, ${D}px) translate(${O}px, ${M}px) rotate(${T}deg) scale(${R})`, x < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${P}px, ${D}px) rotate(${h}deg) scale(${l})`, u && u());
|
|
701
700
|
}
|
|
702
701
|
requestAnimationFrame(U);
|
|
703
702
|
}
|
|
@@ -714,7 +713,7 @@ const he = {
|
|
|
714
713
|
};
|
|
715
714
|
class de {
|
|
716
715
|
constructor(t, e) {
|
|
717
|
-
this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || Tt, this.rotationConfig = t.rotation ||
|
|
716
|
+
this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || Tt, this.rotationConfig = t.rotation || At, this.scaleConfig = t.scale || Ct;
|
|
718
717
|
}
|
|
719
718
|
/**
|
|
720
719
|
* Get the effective start position, considering layout-aware defaults
|
|
@@ -1069,14 +1068,14 @@ class ue {
|
|
|
1069
1068
|
*/
|
|
1070
1069
|
generate(t, e, i = {}) {
|
|
1071
1070
|
var w, F, N, P, D, U, k, z, x;
|
|
1072
|
-
const o = [], { width: a, height: r } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((w = this.imageConfig.rotation) == null ? void 0 : w.mode) ?? "none", u = ((N = (F = this.imageConfig.rotation) == null ? void 0 : F.range) == null ? void 0 : N.min) ?? -15, c = ((D = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : D.max) ?? 15, d = ((k = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : k.min) ?? 1, m = ((x = (z = this.imageConfig.sizing) == null ? void 0 : z.variance) == null ? void 0 : x.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, y = a - s - g, v = r - s - f, I = s + g,
|
|
1073
|
-
for (let
|
|
1074
|
-
const O = this.random(I, y), M = this.random(
|
|
1075
|
-
id:
|
|
1071
|
+
const o = [], { width: a, height: r } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((w = this.imageConfig.rotation) == null ? void 0 : w.mode) ?? "none", u = ((N = (F = this.imageConfig.rotation) == null ? void 0 : F.range) == null ? void 0 : N.min) ?? -15, c = ((D = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : D.max) ?? 15, d = ((k = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : k.min) ?? 1, m = ((x = (z = this.imageConfig.sizing) == null ? void 0 : z.variance) == null ? void 0 : x.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, y = a - s - g, v = r - s - f, I = s + g, A = s + f;
|
|
1072
|
+
for (let C = 0; C < t; C++) {
|
|
1073
|
+
const O = this.random(I, y), M = this.random(A, v), T = l === "random" ? this.random(u, c) : 0, R = b ? this.random(d, m) : 1, H = h * R, K = {
|
|
1074
|
+
id: C,
|
|
1076
1075
|
x: O,
|
|
1077
1076
|
y: M,
|
|
1078
1077
|
rotation: T,
|
|
1079
|
-
scale:
|
|
1078
|
+
scale: R,
|
|
1080
1079
|
baseSize: H
|
|
1081
1080
|
};
|
|
1082
1081
|
o.push(K);
|
|
@@ -1105,8 +1104,8 @@ class ge {
|
|
|
1105
1104
|
* @returns Array of layout objects with position, rotation, scale
|
|
1106
1105
|
*/
|
|
1107
1106
|
generate(t, e, i = {}) {
|
|
1108
|
-
var F, N, P, D, U, k, z, x,
|
|
1109
|
-
const o = [], { width: a, height: r } = e, { debugRadials: s } = this.config, h = i.fixedHeight ?? 200, l = ((F = this.imageConfig.rotation) == null ? void 0 : F.mode) ?? "none", u = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.min) ?? -15, c = ((U = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : U.max) ?? 15, d = ((z = (k = this.imageConfig.sizing) == null ? void 0 : k.variance) == null ? void 0 : z.min) ?? 1, m = ((
|
|
1107
|
+
var F, N, P, D, U, k, z, x, C;
|
|
1108
|
+
const o = [], { width: a, height: r } = e, { debugRadials: s } = this.config, h = i.fixedHeight ?? 200, l = ((F = this.imageConfig.rotation) == null ? void 0 : F.mode) ?? "none", u = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.min) ?? -15, c = ((U = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : U.max) ?? 15, d = ((z = (k = this.imageConfig.sizing) == null ? void 0 : k.variance) == null ? void 0 : z.min) ?? 1, m = ((C = (x = this.imageConfig.sizing) == null ? void 0 : x.variance) == null ? void 0 : C.max) ?? 1, b = d !== 1 || m !== 1, p = this.config.scaleDecay ?? 0, g = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, y = a / 2, v = r / 2, I = Math.ceil(Math.sqrt(t));
|
|
1110
1109
|
if (t > 0) {
|
|
1111
1110
|
const O = b ? this.random(d, m) : 1, M = f * O;
|
|
1112
1111
|
o.push({
|
|
@@ -1122,22 +1121,22 @@ class ge {
|
|
|
1122
1121
|
borderColor: s ? "cyan" : void 0
|
|
1123
1122
|
});
|
|
1124
1123
|
}
|
|
1125
|
-
let
|
|
1126
|
-
for (;
|
|
1127
|
-
const O = w / I, M = p > 0 ? 1 - O * p * 0.5 : 1, T = w * (f * 0.8),
|
|
1124
|
+
let A = 1, w = 1;
|
|
1125
|
+
for (; A < t; ) {
|
|
1126
|
+
const O = w / I, M = p > 0 ? 1 - O * p * 0.5 : 1, T = w * (f * 0.8), R = T * 1.5, H = Math.PI * (3 * (R + T) - Math.sqrt((3 * R + T) * (R + 3 * T))), K = this.estimateWidth(f), X = Math.floor(H / (K * 0.7));
|
|
1128
1127
|
if (X === 0) {
|
|
1129
1128
|
w++;
|
|
1130
1129
|
continue;
|
|
1131
1130
|
}
|
|
1132
1131
|
const B = 2 * Math.PI / X, Z = w * (20 * Math.PI / 180);
|
|
1133
|
-
for (let W = 0; W < X &&
|
|
1132
|
+
for (let W = 0; W < X && A < t; W++) {
|
|
1134
1133
|
const Q = W * B + Z, tt = b ? this.random(d, m) : 1, q = M * tt, et = f * q;
|
|
1135
|
-
let Y = y + Math.cos(Q) *
|
|
1134
|
+
let Y = y + Math.cos(Q) * R, L = v + Math.sin(Q) * T;
|
|
1136
1135
|
const $ = this.config.spacing.padding ?? 50, G = et * 1.5 / 2, _ = et / 2;
|
|
1137
1136
|
Y - G < $ ? Y = $ + G : Y + G > a - $ && (Y = a - $ - G), L - _ < $ ? L = $ + _ : L + _ > r - $ && (L = r - $ - _);
|
|
1138
1137
|
const it = l === "random" ? this.random(u, c) : 0;
|
|
1139
1138
|
o.push({
|
|
1140
|
-
id:
|
|
1139
|
+
id: A,
|
|
1141
1140
|
x: Y,
|
|
1142
1141
|
y: L,
|
|
1143
1142
|
rotation: it,
|
|
@@ -1146,7 +1145,7 @@ class ge {
|
|
|
1146
1145
|
zIndex: Math.max(1, 100 - w),
|
|
1147
1146
|
// Outer rings have lower z-index
|
|
1148
1147
|
borderColor: s ? g[(w - 1) % g.length] : void 0
|
|
1149
|
-
}),
|
|
1148
|
+
}), A++;
|
|
1150
1149
|
}
|
|
1151
1150
|
w++;
|
|
1152
1151
|
}
|
|
@@ -1218,7 +1217,7 @@ class me {
|
|
|
1218
1217
|
p,
|
|
1219
1218
|
l,
|
|
1220
1219
|
s
|
|
1221
|
-
), y = s.stagger === "row", v = s.stagger === "column", I = y ? g + 0.5 : g,
|
|
1220
|
+
), y = s.stagger === "row", v = s.stagger === "column", I = y ? g + 0.5 : g, A = v ? f + 0.5 : f, w = (b - s.gap * (g - 1)) / I, F = (p - s.gap * (f - 1)) / A, N = y ? w / 2 : 0, P = v ? F / 2 : 0, D = 1 + s.overlap, U = Math.min(w, F) * D, k = i.fixedHeight ? Math.min(i.fixedHeight, U) : U, z = g * w + (g - 1) * s.gap + N, x = f * F + (f - 1) * s.gap + P, C = h + (b - z) / 2, O = h + (p - x) / 2, M = g * f, T = s.columns !== "auto" && s.rows !== "auto", R = T && t > M;
|
|
1222
1221
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1223
1222
|
gridConfigColumns: s.columns,
|
|
1224
1223
|
gridConfigRows: s.rows,
|
|
@@ -1227,17 +1226,17 @@ class me {
|
|
|
1227
1226
|
cellCount: M,
|
|
1228
1227
|
hasFixedGrid: T,
|
|
1229
1228
|
imageCount: t,
|
|
1230
|
-
isOverflowMode:
|
|
1229
|
+
isOverflowMode: R
|
|
1231
1230
|
});
|
|
1232
|
-
const H =
|
|
1231
|
+
const H = R ? new Array(M).fill(0) : [], K = Math.min(w, F) * s.overflowOffset;
|
|
1233
1232
|
for (let L = 0; L < t; L++) {
|
|
1234
1233
|
let $, j, G = 0;
|
|
1235
|
-
if (
|
|
1234
|
+
if (R && L >= M) {
|
|
1236
1235
|
const V = L - M, J = V % M;
|
|
1237
1236
|
G = Math.floor(V / M) + 1, H[J]++, s.fillDirection === "row" ? ($ = J % g, j = Math.floor(J / g)) : (j = J % f, $ = Math.floor(J / f));
|
|
1238
1237
|
} else
|
|
1239
1238
|
s.fillDirection === "row" ? ($ = L % g, j = Math.floor(L / g)) : (j = L % f, $ = Math.floor(L / f));
|
|
1240
|
-
let _ =
|
|
1239
|
+
let _ = C + $ * (w + s.gap) + w / 2, it = O + j * (F + s.gap) + F / 2;
|
|
1241
1240
|
if (s.stagger === "row" && j % 2 === 1 ? _ += w / 2 : s.stagger === "column" && $ % 2 === 1 && (it += F / 2), G > 0) {
|
|
1242
1241
|
const V = (G - 1) % Ft.length, J = Ft[V];
|
|
1243
1242
|
_ += J.x * K, it += J.y * K;
|
|
@@ -1247,12 +1246,12 @@ class me {
|
|
|
1247
1246
|
_ += this.random(-V, V), it += this.random(-J, J);
|
|
1248
1247
|
}
|
|
1249
1248
|
let nt = _, ot = it;
|
|
1250
|
-
if (!
|
|
1249
|
+
if (!R && s.fillDirection === "row") {
|
|
1251
1250
|
const V = t % g || g;
|
|
1252
1251
|
if (j === Math.floor((t - 1) / g) && V < g) {
|
|
1253
|
-
const
|
|
1254
|
-
let
|
|
1255
|
-
s.alignment === "center" ?
|
|
1252
|
+
const Rt = V * w + (V - 1) * s.gap;
|
|
1253
|
+
let Et = 0;
|
|
1254
|
+
s.alignment === "center" ? Et = (z - Rt) / 2 : s.alignment === "end" && (Et = z - Rt), nt += Et;
|
|
1256
1255
|
}
|
|
1257
1256
|
}
|
|
1258
1257
|
const pt = m ? this.random(c, d) : 1, at = k * pt, dt = at * 1.5 / 2, ut = at / 2, yt = h + dt, vt = a - h - dt, Ht = h + ut, Nt = r - h - ut;
|
|
@@ -1263,7 +1262,7 @@ class me {
|
|
|
1263
1262
|
s.jitter > 0 ? wt = this.random(V * s.jitter, J * s.jitter) : wt = this.random(V, J);
|
|
1264
1263
|
}
|
|
1265
1264
|
let xt;
|
|
1266
|
-
|
|
1265
|
+
R && G > 0 ? xt = 50 - G : xt = R ? 100 + L : L + 1, o.push({
|
|
1267
1266
|
id: L,
|
|
1268
1267
|
x: nt,
|
|
1269
1268
|
y: ot,
|
|
@@ -1319,28 +1318,28 @@ class ye {
|
|
|
1319
1318
|
* @returns Array of layout objects with position, rotation, scale
|
|
1320
1319
|
*/
|
|
1321
1320
|
generate(t, e, i = {}) {
|
|
1322
|
-
var
|
|
1323
|
-
const o = [], { width: a, height: r } = e, s = { ...be, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((
|
|
1321
|
+
var A, w, F, N, P, D, U, k, z;
|
|
1322
|
+
const o = [], { width: a, height: r } = e, s = { ...be, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((A = this.imageConfig.rotation) == null ? void 0 : A.mode) ?? "none", c = ((F = (w = this.imageConfig.rotation) == null ? void 0 : w.range) == null ? void 0 : F.min) ?? -15, d = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.max) ?? 15, m = ((U = (D = this.imageConfig.sizing) == null ? void 0 : D.variance) == null ? void 0 : U.min) ?? 1, b = ((z = (k = this.imageConfig.sizing) == null ? void 0 : k.variance) == null ? void 0 : z.max) ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, f = a / 2, y = r / 2, v = Math.min(
|
|
1324
1323
|
f - h - l / 2,
|
|
1325
1324
|
y - h - l / 2
|
|
1326
1325
|
), I = s.direction === "clockwise" ? -1 : 1;
|
|
1327
1326
|
for (let x = 0; x < t; x++) {
|
|
1328
|
-
let
|
|
1327
|
+
let C, O;
|
|
1329
1328
|
if (s.spiralType === "golden")
|
|
1330
|
-
|
|
1329
|
+
C = x * pe * I + s.startAngle, O = this.calculateGoldenRadius(x, t, v, s.tightness);
|
|
1331
1330
|
else if (s.spiralType === "archimedean") {
|
|
1332
1331
|
const _ = x * 0.5 * s.tightness;
|
|
1333
|
-
|
|
1332
|
+
C = _ * I + s.startAngle, O = this.calculateArchimedeanRadius(_, t, v, s.tightness);
|
|
1334
1333
|
} else {
|
|
1335
1334
|
const _ = x * 0.3 * s.tightness;
|
|
1336
|
-
|
|
1335
|
+
C = _ * I + s.startAngle, O = this.calculateLogarithmicRadius(_, t, v, s.tightness);
|
|
1337
1336
|
}
|
|
1338
|
-
const M = f + Math.cos(
|
|
1337
|
+
const M = f + Math.cos(C) * O, T = y + Math.sin(C) * O, R = O / v, H = g > 0 ? 1 - R * g * 0.5 : 1, K = p ? this.random(m, b) : 1, X = H * K, B = l * X, W = B * 1.5 / 2, Q = B / 2, tt = h + W, q = a - h - W, et = h + Q, Y = r - h - Q, L = Math.max(tt, Math.min(M, q)), $ = Math.max(et, Math.min(T, Y));
|
|
1339
1338
|
let j = 0;
|
|
1340
1339
|
if (u === "random") {
|
|
1341
|
-
const _ =
|
|
1340
|
+
const _ = C * 180 / Math.PI % 360, it = this.random(c, d);
|
|
1342
1341
|
j = s.spiralType === "golden" ? it : _ * 0.1 + it * 0.9;
|
|
1343
|
-
} else u === "tangent" && (j = this.calculateSpiralTangent(
|
|
1342
|
+
} else u === "tangent" && (j = this.calculateSpiralTangent(C, O, s));
|
|
1344
1343
|
const G = t - x;
|
|
1345
1344
|
o.push({
|
|
1346
1345
|
id: x,
|
|
@@ -1422,8 +1421,8 @@ class we {
|
|
|
1422
1421
|
* @returns Array of layout objects with position, rotation, scale
|
|
1423
1422
|
*/
|
|
1424
1423
|
generate(t, e, i = {}) {
|
|
1425
|
-
var I,
|
|
1426
|
-
const o = [], { width: a, height: r } = e, s = { ...ve, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((I = this.imageConfig.rotation) == null ? void 0 : I.mode) ?? "none", c = ((w = (
|
|
1424
|
+
var I, A, w, F, N, P, D, U, k;
|
|
1425
|
+
const o = [], { width: a, height: r } = e, s = { ...ve, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((I = this.imageConfig.rotation) == null ? void 0 : I.mode) ?? "none", c = ((w = (A = this.imageConfig.rotation) == null ? void 0 : A.range) == null ? void 0 : w.min) ?? -15, d = ((N = (F = this.imageConfig.rotation) == null ? void 0 : F.range) == null ? void 0 : N.max) ?? 15, m = ((D = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : D.min) ?? 1, b = ((k = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : k.max) ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
|
|
1427
1426
|
t,
|
|
1428
1427
|
s.clusterCount,
|
|
1429
1428
|
a,
|
|
@@ -1440,8 +1439,8 @@ class we {
|
|
|
1440
1439
|
y[z % g]++;
|
|
1441
1440
|
let v = 0;
|
|
1442
1441
|
for (let z = 0; z < g; z++) {
|
|
1443
|
-
const x = f[z],
|
|
1444
|
-
for (let O = 0; O <
|
|
1442
|
+
const x = f[z], C = y[z];
|
|
1443
|
+
for (let O = 0; O < C; O++) {
|
|
1445
1444
|
let M, T;
|
|
1446
1445
|
if (s.distribution === "gaussian")
|
|
1447
1446
|
M = this.gaussianRandom() * x.spread, T = this.gaussianRandom() * x.spread;
|
|
@@ -1449,8 +1448,8 @@ class we {
|
|
|
1449
1448
|
const j = this.random(0, Math.PI * 2), G = this.random(0, x.spread);
|
|
1450
1449
|
M = Math.cos(j) * G, T = Math.sin(j) * G;
|
|
1451
1450
|
}
|
|
1452
|
-
const
|
|
1453
|
-
M /=
|
|
1451
|
+
const R = 1 + s.overlap * 0.5, H = 1 + s.overlap * 0.3;
|
|
1452
|
+
M /= R, T /= R;
|
|
1454
1453
|
const K = p ? this.random(m, b) : 1, X = H * K, B = l * X;
|
|
1455
1454
|
let Z = x.x + M, W = x.y + T;
|
|
1456
1455
|
const tt = B * 1.5 / 2, q = B / 2;
|
|
@@ -1495,8 +1494,8 @@ class we {
|
|
|
1495
1494
|
};
|
|
1496
1495
|
let f = 1 / 0;
|
|
1497
1496
|
for (const y of r) {
|
|
1498
|
-
const v = g.x - y.x, I = g.y - y.y,
|
|
1499
|
-
f = Math.min(f,
|
|
1497
|
+
const v = g.x - y.x, I = g.y - y.y, A = Math.sqrt(v * v + I * I);
|
|
1498
|
+
f = Math.min(f, A);
|
|
1500
1499
|
}
|
|
1501
1500
|
if ((r.length === 0 || f > b) && (m = g, b = f), f >= a.clusterSpacing)
|
|
1502
1501
|
break;
|
|
@@ -1541,16 +1540,16 @@ class xe {
|
|
|
1541
1540
|
* @returns Array of layout objects with position, rotation, scale
|
|
1542
1541
|
*/
|
|
1543
1542
|
generate(t, e, i = {}) {
|
|
1544
|
-
var
|
|
1545
|
-
const o = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((
|
|
1543
|
+
var R, H, K, X, B, Z, W, Q, tt;
|
|
1544
|
+
const o = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((R = this.imageConfig.rotation) == null ? void 0 : R.mode) ?? "none", u = ((K = (H = this.imageConfig.rotation) == null ? void 0 : H.range) == null ? void 0 : K.min) ?? -15, c = ((B = (X = this.imageConfig.rotation) == null ? void 0 : X.range) == null ? void 0 : B.max) ?? 15, d = ((W = (Z = this.imageConfig.sizing) == null ? void 0 : Z.variance) == null ? void 0 : W.min) ?? 1, m = ((tt = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : tt.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? s, g = {
|
|
1546
1545
|
...jt,
|
|
1547
1546
|
...this.config.wave
|
|
1548
|
-
}, { rows: f, amplitude: y, frequency: v, phaseShift: I, synchronization:
|
|
1547
|
+
}, { rows: f, amplitude: y, frequency: v, phaseShift: I, synchronization: A } = g, w = Math.ceil(t / f), P = p * 1.5 / 2, D = h + P, U = a - h - P, k = U - D, z = w > 1 ? k / (w - 1) : 0, x = h + y + p / 2, C = r - h - y - p / 2, O = C - x, M = f > 1 ? O / (f - 1) : 0;
|
|
1549
1548
|
let T = 0;
|
|
1550
1549
|
for (let q = 0; q < f && T < t; q++) {
|
|
1551
|
-
const et = f === 1 ? (x +
|
|
1550
|
+
const et = f === 1 ? (x + C) / 2 : x + q * M;
|
|
1552
1551
|
let Y = 0;
|
|
1553
|
-
|
|
1552
|
+
A === "offset" ? Y = q * I : A === "alternating" && (Y = q * Math.PI);
|
|
1554
1553
|
for (let L = 0; L < w && T < t; L++) {
|
|
1555
1554
|
const $ = w === 1 ? (D + U) / 2 : D + L * z, j = this.calculateWaveY($, a, y, v, Y), G = $, _ = et + j, it = b ? this.random(d, m) : 1, nt = p * it;
|
|
1556
1555
|
let ot = 0;
|
|
@@ -1607,7 +1606,7 @@ class xe {
|
|
|
1607
1606
|
return Math.random() * (e - t) + t;
|
|
1608
1607
|
}
|
|
1609
1608
|
}
|
|
1610
|
-
class
|
|
1609
|
+
class Ee {
|
|
1611
1610
|
constructor(t) {
|
|
1612
1611
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.generator = this.initGenerator();
|
|
1613
1612
|
}
|
|
@@ -1728,12 +1727,12 @@ class Se {
|
|
|
1728
1727
|
return Math.max(e, Math.min(i, t));
|
|
1729
1728
|
}
|
|
1730
1729
|
}
|
|
1731
|
-
var
|
|
1732
|
-
function
|
|
1733
|
-
return n in
|
|
1730
|
+
var S = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(S || {});
|
|
1731
|
+
function Se(n) {
|
|
1732
|
+
return n in St;
|
|
1734
1733
|
}
|
|
1735
1734
|
function Ie(n) {
|
|
1736
|
-
return n ?
|
|
1735
|
+
return n ? Se(n) ? St[n] : n : St.md;
|
|
1737
1736
|
}
|
|
1738
1737
|
function Te(n) {
|
|
1739
1738
|
if (!n) return "";
|
|
@@ -1795,10 +1794,10 @@ const Ot = {
|
|
|
1795
1794
|
UNFOCUSING: 999,
|
|
1796
1795
|
FOCUSING: 1e3
|
|
1797
1796
|
};
|
|
1798
|
-
class
|
|
1797
|
+
class Ae {
|
|
1799
1798
|
constructor(t, e, i) {
|
|
1800
1799
|
var o, a;
|
|
1801
|
-
this.state =
|
|
1800
|
+
this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = ft(i == null ? void 0 : i.default), this.focusedStyles = ft(i == null ? void 0 : i.focused), this.defaultClassName = (o = i == null ? void 0 : i.default) == null ? void 0 : o.className, this.focusedClassName = (a = i == null ? void 0 : i.focused) == null ? void 0 : a.className;
|
|
1802
1801
|
}
|
|
1803
1802
|
/**
|
|
1804
1803
|
* Get current state machine state
|
|
@@ -1810,7 +1809,7 @@ class Re {
|
|
|
1810
1809
|
* Check if any animation is in progress
|
|
1811
1810
|
*/
|
|
1812
1811
|
isAnimating() {
|
|
1813
|
-
return this.state !==
|
|
1812
|
+
return this.state !== S.IDLE && this.state !== S.FOCUSED;
|
|
1814
1813
|
}
|
|
1815
1814
|
/**
|
|
1816
1815
|
* Normalize scalePercent value
|
|
@@ -2006,9 +2005,9 @@ class Re {
|
|
|
2006
2005
|
*/
|
|
2007
2006
|
async focusImage(t, e, i) {
|
|
2008
2007
|
var a, r, s, h, l, u, c, d, m, b, p, g;
|
|
2009
|
-
if (this.currentFocus === t && this.state ===
|
|
2008
|
+
if (this.currentFocus === t && this.state === S.FOCUSED)
|
|
2010
2009
|
return this.unfocusImage();
|
|
2011
|
-
if (((a = this.incoming) == null ? void 0 : a.element) === t && this.state ===
|
|
2010
|
+
if (((a = this.incoming) == null ? void 0 : a.element) === t && this.state === S.FOCUSING) {
|
|
2012
2011
|
const f = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), y = {
|
|
2013
2012
|
x: f.x,
|
|
2014
2013
|
y: f.y,
|
|
@@ -2024,17 +2023,17 @@ class Re {
|
|
|
2024
2023
|
this.incoming.originalState,
|
|
2025
2024
|
y,
|
|
2026
2025
|
v
|
|
2027
|
-
), this.incoming = null, this.state =
|
|
2026
|
+
), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, ((r = this.focusData) == null ? void 0 : r.originalZIndex) || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE;
|
|
2028
2027
|
return;
|
|
2029
2028
|
}
|
|
2030
2029
|
const o = ++this.focusGeneration;
|
|
2031
2030
|
switch (this.state) {
|
|
2032
|
-
case
|
|
2033
|
-
if (this.state =
|
|
2034
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2031
|
+
case S.IDLE:
|
|
2032
|
+
if (this.state = S.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
|
|
2033
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2035
2034
|
break;
|
|
2036
|
-
case
|
|
2037
|
-
if (this.state =
|
|
2035
|
+
case S.FOCUSED:
|
|
2036
|
+
if (this.state = S.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
|
|
2038
2037
|
this.currentFocus,
|
|
2039
2038
|
this.focusData.originalState
|
|
2040
2039
|
)), this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
|
|
@@ -2042,9 +2041,9 @@ class Re {
|
|
|
2042
2041
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2043
2042
|
]), this.focusGeneration !== o)
|
|
2044
2043
|
return;
|
|
2045
|
-
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((s = this.outgoing.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state =
|
|
2044
|
+
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((s = this.outgoing.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2046
2045
|
break;
|
|
2047
|
-
case
|
|
2046
|
+
case S.FOCUSING:
|
|
2048
2047
|
if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
|
|
2049
2048
|
this.incoming.element,
|
|
2050
2049
|
this.incoming.originalState,
|
|
@@ -2052,16 +2051,16 @@ class Re {
|
|
|
2052
2051
|
(l = this.focusData) == null ? void 0 : l.originalWidth,
|
|
2053
2052
|
(u = this.focusData) == null ? void 0 : u.originalHeight
|
|
2054
2053
|
), this.incoming = null), this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
|
|
2055
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2054
|
+
this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2056
2055
|
break;
|
|
2057
|
-
case
|
|
2058
|
-
if (this.state =
|
|
2056
|
+
case S.UNFOCUSING:
|
|
2057
|
+
if (this.state = S.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
|
|
2059
2058
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2060
2059
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2061
2060
|
]), this.focusGeneration !== o) return;
|
|
2062
|
-
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state =
|
|
2061
|
+
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2063
2062
|
break;
|
|
2064
|
-
case
|
|
2063
|
+
case S.CROSS_ANIMATING:
|
|
2065
2064
|
if (((d = this.incoming) == null ? void 0 : d.element) === t)
|
|
2066
2065
|
return;
|
|
2067
2066
|
if (((m = this.outgoing) == null ? void 0 : m.element) === t) {
|
|
@@ -2076,7 +2075,7 @@ class Re {
|
|
|
2076
2075
|
height: t.offsetHeight
|
|
2077
2076
|
};
|
|
2078
2077
|
if (this.incoming) {
|
|
2079
|
-
const I = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0),
|
|
2078
|
+
const I = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), A = {
|
|
2080
2079
|
x: I.x,
|
|
2081
2080
|
y: I.y,
|
|
2082
2081
|
rotation: I.rotation,
|
|
@@ -2089,7 +2088,7 @@ class Re {
|
|
|
2089
2088
|
this.outgoing = this.startUnfocusAnimation(
|
|
2090
2089
|
this.incoming.element,
|
|
2091
2090
|
this.incoming.originalState,
|
|
2092
|
-
|
|
2091
|
+
A,
|
|
2093
2092
|
w
|
|
2094
2093
|
);
|
|
2095
2094
|
} else
|
|
@@ -2098,7 +2097,7 @@ class Re {
|
|
|
2098
2097
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2099
2098
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2100
2099
|
]), this.focusGeneration !== o) return;
|
|
2101
|
-
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((b = this.outgoing.originalState.zIndex) == null ? void 0 : b.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state =
|
|
2100
|
+
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((b = this.outgoing.originalState.zIndex) == null ? void 0 : b.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2102
2101
|
return;
|
|
2103
2102
|
}
|
|
2104
2103
|
if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
|
|
@@ -2129,7 +2128,7 @@ class Re {
|
|
|
2129
2128
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2130
2129
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2131
2130
|
]), this.focusGeneration !== o) return;
|
|
2132
|
-
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((g = this.outgoing.originalState.zIndex) == null ? void 0 : g.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state =
|
|
2131
|
+
this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((g = this.outgoing.originalState.zIndex) == null ? void 0 : g.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
|
|
2133
2132
|
break;
|
|
2134
2133
|
}
|
|
2135
2134
|
}
|
|
@@ -2140,7 +2139,7 @@ class Re {
|
|
|
2140
2139
|
var a, r, s;
|
|
2141
2140
|
const t = ++this.focusGeneration;
|
|
2142
2141
|
if (!this.currentFocus || !this.focusData) {
|
|
2143
|
-
if (this.incoming && this.state ===
|
|
2142
|
+
if (this.incoming && this.state === S.FOCUSING) {
|
|
2144
2143
|
const h = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), l = {
|
|
2145
2144
|
x: h.x,
|
|
2146
2145
|
y: h.y,
|
|
@@ -2156,12 +2155,12 @@ class Re {
|
|
|
2156
2155
|
this.incoming.originalState,
|
|
2157
2156
|
l,
|
|
2158
2157
|
u
|
|
2159
|
-
), this.incoming = null, this.state =
|
|
2160
|
-
this.removeFocusedStyling(this.outgoing.element, ((a = this.focusData) == null ? void 0 : a.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state =
|
|
2158
|
+
), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
|
|
2159
|
+
this.removeFocusedStyling(this.outgoing.element, ((a = this.focusData) == null ? void 0 : a.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state = S.IDLE;
|
|
2161
2160
|
}
|
|
2162
2161
|
return;
|
|
2163
2162
|
}
|
|
2164
|
-
if (this.state ===
|
|
2163
|
+
if (this.state === S.CROSS_ANIMATING && this.incoming) {
|
|
2165
2164
|
const h = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), l = {
|
|
2166
2165
|
x: h.x,
|
|
2167
2166
|
y: h.y,
|
|
@@ -2181,12 +2180,12 @@ class Re {
|
|
|
2181
2180
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2182
2181
|
this.waitForAnimation(c.animationHandle)
|
|
2183
2182
|
]), this.focusGeneration !== t) return;
|
|
2184
|
-
this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.removeFocusedStyling(c.element, ((s = this.incoming.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state =
|
|
2183
|
+
this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.removeFocusedStyling(c.element, ((s = this.incoming.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE;
|
|
2185
2184
|
return;
|
|
2186
2185
|
}
|
|
2187
|
-
this.state =
|
|
2186
|
+
this.state = S.UNFOCUSING;
|
|
2188
2187
|
const e = this.currentFocus, i = this.focusData.originalState, o = this.focusData.originalZIndex;
|
|
2189
|
-
this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, o), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state =
|
|
2188
|
+
this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, o), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE);
|
|
2190
2189
|
}
|
|
2191
2190
|
/**
|
|
2192
2191
|
* Swap focus from current image to a new one (alias for focusImage with cross-animation)
|
|
@@ -2204,7 +2203,7 @@ class Re {
|
|
|
2204
2203
|
* Check if an image is currently focused (stable state)
|
|
2205
2204
|
*/
|
|
2206
2205
|
isFocused(t) {
|
|
2207
|
-
return this.currentFocus === t && this.state ===
|
|
2206
|
+
return this.currentFocus === t && this.state === S.FOCUSED;
|
|
2208
2207
|
}
|
|
2209
2208
|
/**
|
|
2210
2209
|
* Check if an image is the target of current focus animation
|
|
@@ -2227,7 +2226,7 @@ class Re {
|
|
|
2227
2226
|
* Used during swipe gestures for visual feedback
|
|
2228
2227
|
*/
|
|
2229
2228
|
setDragOffset(t) {
|
|
2230
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2229
|
+
if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
|
|
2231
2230
|
const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], a = (i.x ?? 0) + t, r = i.y ?? 0;
|
|
2232
2231
|
o.push(`translate(${a}px, ${r}px)`), i.rotation !== void 0 && o.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = o.join(" ");
|
|
2233
2232
|
}
|
|
@@ -2237,7 +2236,7 @@ class Re {
|
|
|
2237
2236
|
* @param duration - Animation duration in ms (default 150)
|
|
2238
2237
|
*/
|
|
2239
2238
|
clearDragOffset(t, e = 150) {
|
|
2240
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2239
|
+
if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
|
|
2241
2240
|
const i = this.currentFocus, o = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = o.x ?? 0, s = o.y ?? 0;
|
|
2242
2241
|
a.push(`translate(${r}px, ${s}px)`), o.rotation !== void 0 && a.push(`rotate(${o.rotation}deg)`);
|
|
2243
2242
|
const h = a.join(" ");
|
|
@@ -2268,10 +2267,10 @@ class Re {
|
|
|
2268
2267
|
this.focusData.originalZIndex,
|
|
2269
2268
|
this.focusData.originalWidth,
|
|
2270
2269
|
this.focusData.originalHeight
|
|
2271
|
-
), this.state =
|
|
2270
|
+
), this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2272
2271
|
}
|
|
2273
2272
|
}
|
|
2274
|
-
const
|
|
2273
|
+
const Ce = 50, Re = 0.5, Me = 20, ze = 0.3, Le = 150, Fe = 30, mt = class mt {
|
|
2275
2274
|
constructor(t, e) {
|
|
2276
2275
|
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);
|
|
2277
2276
|
}
|
|
@@ -2332,7 +2331,7 @@ const Ae = 50, Ce = 0.5, Me = 20, ze = 0.3, Le = 150, Fe = 30, mt = class mt {
|
|
|
2332
2331
|
this.recentTouchTimestamp = Date.now();
|
|
2333
2332
|
const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, a = Math.abs(e);
|
|
2334
2333
|
let r = !1;
|
|
2335
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >=
|
|
2334
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Ce || o >= Re && a >= Me) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2336
2335
|
}
|
|
2337
2336
|
handleTouchCancel(t) {
|
|
2338
2337
|
var e;
|
|
@@ -2874,6 +2873,15 @@ const Pe = `
|
|
|
2874
2873
|
will-change: auto;
|
|
2875
2874
|
}
|
|
2876
2875
|
|
|
2876
|
+
.fbn-ic-counter {
|
|
2877
|
+
position: fixed;
|
|
2878
|
+
bottom: 24px;
|
|
2879
|
+
left: 50%;
|
|
2880
|
+
transform: translateX(-50%);
|
|
2881
|
+
z-index: 10001;
|
|
2882
|
+
pointer-events: none;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2877
2885
|
.fbn-ic-hidden {
|
|
2878
2886
|
display: none !important;
|
|
2879
2887
|
}
|
|
@@ -2888,11 +2896,11 @@ function _e() {
|
|
|
2888
2896
|
class He {
|
|
2889
2897
|
constructor(t = {}) {
|
|
2890
2898
|
var i, o, a, r, s, h;
|
|
2891
|
-
this.fullConfig = Vt(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.animationEngine = new te(this.fullConfig.animation), this.layoutEngine = new
|
|
2899
|
+
this.fullConfig = Vt(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 te(this.fullConfig.animation), this.layoutEngine = new Ee({
|
|
2892
2900
|
layout: this.fullConfig.layout,
|
|
2893
2901
|
image: this.fullConfig.image
|
|
2894
|
-
}), this.zoomEngine = new
|
|
2895
|
-
const e = this.fullConfig.animation.entry ||
|
|
2902
|
+
}), this.zoomEngine = new Ae(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = ft((i = this.fullConfig.styling) == null ? void 0 : i.default), this.hoverStyles = ft((o = this.fullConfig.styling) == null ? void 0 : o.hover), this.defaultClassName = (r = (a = this.fullConfig.styling) == null ? void 0 : a.default) == null ? void 0 : r.className, this.hoverClassName = (h = (s = this.fullConfig.styling) == null ? void 0 : s.hover) == null ? void 0 : h.className;
|
|
2903
|
+
const e = this.fullConfig.animation.entry || E.animation.entry;
|
|
2896
2904
|
this.entryAnimationEngine = new de(
|
|
2897
2905
|
e,
|
|
2898
2906
|
this.fullConfig.layout.algorithm
|
|
@@ -2968,7 +2976,7 @@ class He {
|
|
|
2968
2976
|
}
|
|
2969
2977
|
setupUI() {
|
|
2970
2978
|
const t = this.fullConfig.rendering.ui;
|
|
2971
|
-
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);
|
|
2979
|
+
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));
|
|
2972
2980
|
}
|
|
2973
2981
|
resolveElement(t) {
|
|
2974
2982
|
return t instanceof HTMLElement ? t : document.getElementById(t);
|
|
@@ -2985,13 +2993,17 @@ class He {
|
|
|
2985
2993
|
const t = document.createElement("div");
|
|
2986
2994
|
return t.className = "fbn-ic-error fbn-ic-hidden", this.containerEl.appendChild(t), t;
|
|
2987
2995
|
}
|
|
2996
|
+
createDefaultCounterElement() {
|
|
2997
|
+
const t = document.createElement("div");
|
|
2998
|
+
return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
|
|
2999
|
+
}
|
|
2988
3000
|
setupEventListeners() {
|
|
2989
3001
|
document.addEventListener("keydown", (t) => {
|
|
2990
3002
|
var e;
|
|
2991
|
-
t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (e = this.swipeEngine) == null || e.disable()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
|
|
3003
|
+
t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (e = this.swipeEngine) == null || e.disable(), this.hideCounter()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
|
|
2992
3004
|
}), document.addEventListener("click", (t) => {
|
|
2993
3005
|
var e, i;
|
|
2994
|
-
(e = this.swipeEngine) != null && e.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (i = this.swipeEngine) == null || i.disable());
|
|
3006
|
+
(e = this.swipeEngine) != null && e.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (i = this.swipeEngine) == null || i.disable(), this.hideCounter());
|
|
2995
3007
|
}), window.addEventListener("resize", () => this.handleResize());
|
|
2996
3008
|
}
|
|
2997
3009
|
/**
|
|
@@ -3000,7 +3012,7 @@ class He {
|
|
|
3000
3012
|
navigateToNextImage() {
|
|
3001
3013
|
if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
|
|
3002
3014
|
const t = (this.currentFocusIndex + 1) % this.imageElements.length;
|
|
3003
|
-
this.navigateToImage(t);
|
|
3015
|
+
this.navigateToImage(t), this.updateCounter(t);
|
|
3004
3016
|
}
|
|
3005
3017
|
/**
|
|
3006
3018
|
* Navigate to the previous image (Left arrow)
|
|
@@ -3008,7 +3020,7 @@ class He {
|
|
|
3008
3020
|
navigateToPreviousImage() {
|
|
3009
3021
|
if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
|
|
3010
3022
|
const t = (this.currentFocusIndex - 1 + this.imageElements.length) % this.imageElements.length;
|
|
3011
|
-
this.navigateToImage(t);
|
|
3023
|
+
this.navigateToImage(t), this.updateCounter(t);
|
|
3012
3024
|
}
|
|
3013
3025
|
/**
|
|
3014
3026
|
* Navigate to a specific image by index
|
|
@@ -3175,7 +3187,7 @@ class He {
|
|
|
3175
3187
|
i,
|
|
3176
3188
|
u,
|
|
3177
3189
|
t.length
|
|
3178
|
-
), I = this.entryAnimationEngine.calculateStartRotation(d.rotation),
|
|
3190
|
+
), I = this.entryAnimationEngine.calculateStartRotation(d.rotation), A = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
|
|
3179
3191
|
d.rotation,
|
|
3180
3192
|
d.scale,
|
|
3181
3193
|
g,
|
|
@@ -3188,7 +3200,7 @@ class He {
|
|
|
3188
3200
|
g,
|
|
3189
3201
|
e,
|
|
3190
3202
|
I,
|
|
3191
|
-
|
|
3203
|
+
A
|
|
3192
3204
|
);
|
|
3193
3205
|
this.fullConfig.debug && u < 3 && console.log(`Image ${u}:`, {
|
|
3194
3206
|
finalPosition: f,
|
|
@@ -3198,7 +3210,7 @@ class He {
|
|
|
3198
3210
|
finalTransform: w,
|
|
3199
3211
|
renderedWidth: g,
|
|
3200
3212
|
renderedHeight: e
|
|
3201
|
-
}), c.style.transform = F, c.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || I !== d.rotation ||
|
|
3213
|
+
}), c.style.transform = F, c.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || I !== d.rotation || A !== d.scale) && (c.dataset.startX = String(v.x), c.dataset.startY = String(v.y), c.dataset.endX = String(f.x), c.dataset.endY = String(f.y), c.dataset.imageWidth = String(g), c.dataset.imageHeight = String(e), c.dataset.rotation = String(d.rotation), c.dataset.scale = String(d.scale), c.dataset.startRotation = String(I), c.dataset.startScale = String(A)), this.displayQueue.push(c);
|
|
3202
3214
|
}, c.onerror = () => r++, c.src = l;
|
|
3203
3215
|
});
|
|
3204
3216
|
}
|
|
@@ -3210,10 +3222,10 @@ class He {
|
|
|
3210
3222
|
height: this.containerEl.offsetHeight
|
|
3211
3223
|
};
|
|
3212
3224
|
if (i)
|
|
3213
|
-
await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (a = this.swipeEngine) == null || a.disable();
|
|
3225
|
+
await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (a = this.swipeEngine) == null || a.disable(), this.hideCounter();
|
|
3214
3226
|
else {
|
|
3215
3227
|
const s = t.dataset.imageId;
|
|
3216
|
-
this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, (r = this.swipeEngine) == null || r.enable(), await this.zoomEngine.focusImage(t, o, e);
|
|
3228
|
+
this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, (r = this.swipeEngine) == null || r.enable(), await this.zoomEngine.focusImage(t, o, e), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
|
|
3217
3229
|
}
|
|
3218
3230
|
}
|
|
3219
3231
|
/**
|
|
@@ -3231,12 +3243,18 @@ class He {
|
|
|
3231
3243
|
hideError() {
|
|
3232
3244
|
this.errorEl && this.errorEl.classList.add("fbn-ic-hidden");
|
|
3233
3245
|
}
|
|
3246
|
+
updateCounter(t) {
|
|
3247
|
+
!this.fullConfig.rendering.ui.showImageCounter || !this.counterEl || (this.counterEl.textContent = `${t + 1} of ${this.imageElements.length}`, this.counterEl.classList.remove("fbn-ic-hidden"));
|
|
3248
|
+
}
|
|
3249
|
+
hideCounter() {
|
|
3250
|
+
this.counterEl && this.counterEl.classList.add("fbn-ic-hidden");
|
|
3251
|
+
}
|
|
3234
3252
|
/**
|
|
3235
3253
|
* Destroy the gallery and clean up resources
|
|
3236
3254
|
*/
|
|
3237
3255
|
destroy() {
|
|
3238
3256
|
var t;
|
|
3239
|
-
this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), (t = this.swipeEngine) == null || t.destroy();
|
|
3257
|
+
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), (t = this.swipeEngine) == null || t.destroy();
|
|
3240
3258
|
}
|
|
3241
3259
|
}
|
|
3242
3260
|
function Ne() {
|