@frybynite/image-cloud 0.9.3 → 0.9.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 +455 -388
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +1005 -938
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +34 -3
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/react.d.ts +16 -2
- package/dist/react.js +913 -846
- package/dist/react.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vue.d.ts +16 -2
- package/dist/vue.js +994 -927
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +16 -2
- package/dist/web-component.js +740 -673
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const Ut = ".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}", mt = Object.freeze({
|
|
1
|
+
const Ut = ".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-gallery.fbn-ic-suppress-outline.fbn-ic-has-focus{outline:2px solid var(--fbn-ic-accent-primary);outline-offset:-4px}.fbn-ic-nav-btn{background:#0009;color:#fff;width:44px;height:44px;border-radius:50%;font-family:system-ui,sans-serif;font-size:28px;display:flex;align-items:center;justify-content:center;transition:background .2s ease,opacity .2s ease;opacity:.8}.fbn-ic-nav-btn:hover{background:#000000d9;opacity:1}.fbn-ic-hidden{display:none!important}", mt = Object.freeze({
|
|
2
2
|
none: "none",
|
|
3
3
|
sm: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4
4
|
md: "0 4px 16px rgba(0,0,0,0.4)",
|
|
@@ -8,12 +8,12 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
8
8
|
energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
|
|
9
9
|
playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
|
|
10
10
|
subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
|
|
11
|
-
}),
|
|
11
|
+
}), Ct = Object.freeze({
|
|
12
12
|
gentle: Object.freeze({ stiffness: 150, damping: 30, mass: 1, oscillations: 2 }),
|
|
13
13
|
bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
|
|
14
14
|
wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
|
|
15
15
|
snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
|
|
16
|
-
}),
|
|
16
|
+
}), At = Object.freeze({
|
|
17
17
|
gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
|
|
18
18
|
playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
|
|
19
19
|
serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
|
|
@@ -22,9 +22,9 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
22
22
|
type: "linear"
|
|
23
23
|
}), vt = Object.freeze({
|
|
24
24
|
mode: "none"
|
|
25
|
-
}),
|
|
25
|
+
}), xt = Object.freeze({
|
|
26
26
|
mode: "none"
|
|
27
|
-
}),
|
|
27
|
+
}), Ft = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
30
30
|
width: 0,
|
|
@@ -52,19 +52,19 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
52
52
|
})
|
|
53
53
|
}), Ht = Object.freeze({
|
|
54
54
|
tightness: 1
|
|
55
|
-
}),
|
|
55
|
+
}), Nt = Object.freeze({
|
|
56
56
|
rows: 1,
|
|
57
57
|
amplitude: 100,
|
|
58
58
|
frequency: 2,
|
|
59
59
|
phaseShift: 0,
|
|
60
60
|
synchronization: "offset"
|
|
61
61
|
// Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
|
|
62
|
-
}),
|
|
62
|
+
}), kt = Object.freeze({
|
|
63
63
|
spacing: 0
|
|
64
|
-
}),
|
|
64
|
+
}), Bt = Object.freeze({
|
|
65
65
|
mobile: Object.freeze({ maxWidth: 767 }),
|
|
66
66
|
tablet: Object.freeze({ maxWidth: 1199 })
|
|
67
|
-
}),
|
|
67
|
+
}), jt = Object.freeze({
|
|
68
68
|
mode: "adaptive",
|
|
69
69
|
// Default to adaptive sizing
|
|
70
70
|
minSize: 50,
|
|
@@ -76,15 +76,15 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
76
76
|
// No variance by default
|
|
77
77
|
max: 1
|
|
78
78
|
})
|
|
79
|
-
}),
|
|
79
|
+
}), Wt = Object.freeze({
|
|
80
80
|
mode: "none",
|
|
81
81
|
range: Object.freeze({
|
|
82
82
|
min: -15,
|
|
83
83
|
max: 15
|
|
84
84
|
})
|
|
85
|
-
}),
|
|
86
|
-
sizing:
|
|
87
|
-
rotation:
|
|
85
|
+
}), Mt = Object.freeze({
|
|
86
|
+
sizing: jt,
|
|
87
|
+
rotation: Wt
|
|
88
88
|
}), zt = Object.freeze({
|
|
89
89
|
validateUrls: !0,
|
|
90
90
|
validationTimeout: 5e3,
|
|
@@ -94,7 +94,7 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
94
94
|
enabled: !1,
|
|
95
95
|
centers: !1,
|
|
96
96
|
loaders: !1
|
|
97
|
-
}),
|
|
97
|
+
}), Gt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), qt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Xt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Yt = Object.freeze({ speed: 4e3, direction: "clockwise" }), Dt = Object.freeze({ type: "none" }), C = Object.freeze({
|
|
98
98
|
// Loader configuration (always an array, composite behavior is implicit)
|
|
99
99
|
loaders: [],
|
|
100
100
|
// Shared loader settings and debug config
|
|
@@ -103,13 +103,13 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
103
103
|
debug: Ot
|
|
104
104
|
}),
|
|
105
105
|
// Image sizing and rotation configuration
|
|
106
|
-
image:
|
|
106
|
+
image: Mt,
|
|
107
107
|
// Pattern-based layout configuration
|
|
108
108
|
layout: Object.freeze({
|
|
109
109
|
algorithm: "radial",
|
|
110
110
|
scaleDecay: 0,
|
|
111
111
|
// No decay by default (0-1 for radial/spiral)
|
|
112
|
-
responsive:
|
|
112
|
+
responsive: Bt,
|
|
113
113
|
targetCoverage: 0.6,
|
|
114
114
|
// Target 60% of container area
|
|
115
115
|
densityFactor: 1,
|
|
@@ -157,7 +157,7 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
157
157
|
// smooth deceleration
|
|
158
158
|
path: yt,
|
|
159
159
|
rotation: vt,
|
|
160
|
-
scale:
|
|
160
|
+
scale: xt
|
|
161
161
|
}),
|
|
162
162
|
idle: Dt
|
|
163
163
|
}),
|
|
@@ -181,10 +181,12 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
181
181
|
// UI configuration
|
|
182
182
|
ui: Object.freeze({
|
|
183
183
|
showLoadingSpinner: !1,
|
|
184
|
-
showImageCounter: !1
|
|
184
|
+
showImageCounter: !1,
|
|
185
|
+
showNavButtons: !1,
|
|
186
|
+
showFocusOutline: !1
|
|
185
187
|
}),
|
|
186
188
|
// Image styling
|
|
187
|
-
styling:
|
|
189
|
+
styling: Ft
|
|
188
190
|
});
|
|
189
191
|
function Z(o, t) {
|
|
190
192
|
if (!o) return t || {};
|
|
@@ -272,71 +274,71 @@ function Qt(o = {}) {
|
|
|
272
274
|
}, s = {
|
|
273
275
|
loaders: n,
|
|
274
276
|
config: r,
|
|
275
|
-
image: Vt(
|
|
276
|
-
layout: { ...
|
|
277
|
-
animation: { ...
|
|
278
|
-
interaction: { ...
|
|
279
|
-
ui: { ...
|
|
280
|
-
styling: Jt(
|
|
277
|
+
image: Vt(Mt, e),
|
|
278
|
+
layout: { ...C.layout },
|
|
279
|
+
animation: { ...C.animation },
|
|
280
|
+
interaction: { ...C.interaction },
|
|
281
|
+
ui: { ...C.ui },
|
|
282
|
+
styling: Jt(Ft, o.styling)
|
|
281
283
|
};
|
|
282
284
|
o.layout && (s.layout = {
|
|
283
|
-
...
|
|
285
|
+
...C.layout,
|
|
284
286
|
...o.layout
|
|
285
287
|
}, o.layout.responsive && (s.layout.responsive = {
|
|
286
|
-
...
|
|
287
|
-
mobile: o.layout.responsive.mobile ? { ...
|
|
288
|
-
tablet: o.layout.responsive.tablet ? { ...
|
|
288
|
+
...C.layout.responsive,
|
|
289
|
+
mobile: o.layout.responsive.mobile ? { ...C.layout.responsive.mobile, ...o.layout.responsive.mobile } : C.layout.responsive.mobile,
|
|
290
|
+
tablet: o.layout.responsive.tablet ? { ...C.layout.responsive.tablet, ...o.layout.responsive.tablet } : C.layout.responsive.tablet
|
|
289
291
|
}), o.layout.spacing && (s.layout.spacing = {
|
|
290
|
-
...
|
|
292
|
+
...C.layout.spacing,
|
|
291
293
|
...o.layout.spacing
|
|
292
294
|
})), o.animation && (s.animation = {
|
|
293
|
-
...
|
|
295
|
+
...C.animation,
|
|
294
296
|
...o.animation
|
|
295
297
|
}, o.animation.easing && (s.animation.easing = {
|
|
296
|
-
...
|
|
298
|
+
...C.animation.easing,
|
|
297
299
|
...o.animation.easing
|
|
298
300
|
}), o.animation.queue && (s.animation.queue = {
|
|
299
|
-
...
|
|
301
|
+
...C.animation.queue,
|
|
300
302
|
...o.animation.queue
|
|
301
303
|
}), o.animation.entry && (s.animation.entry = {
|
|
302
|
-
...
|
|
304
|
+
...C.animation.entry,
|
|
303
305
|
...o.animation.entry,
|
|
304
306
|
start: o.animation.entry.start ? {
|
|
305
|
-
...
|
|
307
|
+
...C.animation.entry.start,
|
|
306
308
|
...o.animation.entry.start,
|
|
307
|
-
circular: o.animation.entry.start.circular ? { ...
|
|
308
|
-
} :
|
|
309
|
-
timing: o.animation.entry.timing ? { ...
|
|
310
|
-
path: o.animation.entry.path ? { ...yt, ...o.animation.entry.path } :
|
|
311
|
-
rotation: o.animation.entry.rotation ? { ...vt, ...o.animation.entry.rotation } :
|
|
312
|
-
scale: o.animation.entry.scale ? { ...
|
|
309
|
+
circular: o.animation.entry.start.circular ? { ...C.animation.entry.start.circular, ...o.animation.entry.start.circular } : C.animation.entry.start.circular
|
|
310
|
+
} : C.animation.entry.start,
|
|
311
|
+
timing: o.animation.entry.timing ? { ...C.animation.entry.timing, ...o.animation.entry.timing } : C.animation.entry.timing,
|
|
312
|
+
path: o.animation.entry.path ? { ...yt, ...o.animation.entry.path } : C.animation.entry.path,
|
|
313
|
+
rotation: o.animation.entry.rotation ? { ...vt, ...o.animation.entry.rotation } : C.animation.entry.rotation,
|
|
314
|
+
scale: o.animation.entry.scale ? { ...xt, ...o.animation.entry.scale } : C.animation.entry.scale
|
|
313
315
|
}), o.animation.idle && (s.animation.idle = {
|
|
314
316
|
...Dt,
|
|
315
317
|
...o.animation.idle
|
|
316
318
|
})), o.interaction && (s.interaction = {
|
|
317
|
-
...
|
|
319
|
+
...C.interaction,
|
|
318
320
|
...o.interaction
|
|
319
321
|
}, o.interaction.focus && (s.interaction.focus = {
|
|
320
|
-
...
|
|
322
|
+
...C.interaction.focus,
|
|
321
323
|
...o.interaction.focus
|
|
322
324
|
}), o.interaction.navigation && (s.interaction.navigation = {
|
|
323
|
-
...
|
|
325
|
+
...C.interaction.navigation,
|
|
324
326
|
...o.interaction.navigation
|
|
325
327
|
}));
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
...
|
|
329
|
-
...
|
|
328
|
+
const c = o.rendering?.ui;
|
|
329
|
+
if (c && console.warn("[ImageCloud] rendering.ui is deprecated. Use top-level ui instead."), s.ui = {
|
|
330
|
+
...C.ui,
|
|
331
|
+
...c,
|
|
330
332
|
...o.ui
|
|
331
333
|
}, s.config.debug = {
|
|
332
334
|
...Ot,
|
|
333
335
|
...o.config?.debug ?? {}
|
|
334
336
|
}, s.layout.algorithm === "honeycomb" && s.styling) {
|
|
335
|
-
const
|
|
337
|
+
const l = { shape: "hexagon", mode: "height-relative" };
|
|
336
338
|
s.styling = {
|
|
337
339
|
...s.styling,
|
|
338
|
-
default: { ...s.styling.default, clipPath:
|
|
339
|
-
hover: { ...s.styling.hover, clipPath:
|
|
340
|
+
default: { ...s.styling.default, clipPath: l },
|
|
341
|
+
hover: { ...s.styling.hover, clipPath: l }
|
|
340
342
|
// focused: untouched — user config respected
|
|
341
343
|
};
|
|
342
344
|
}
|
|
@@ -346,10 +348,10 @@ function te(o, t) {
|
|
|
346
348
|
return { ...o ? It[o] : It.playful, ...t };
|
|
347
349
|
}
|
|
348
350
|
function ee(o, t) {
|
|
349
|
-
return { ...o ?
|
|
351
|
+
return { ...o ? Ct[o] : Ct.gentle, ...t };
|
|
350
352
|
}
|
|
351
353
|
function ie(o, t) {
|
|
352
|
-
return { ...o ?
|
|
354
|
+
return { ...o ? At[o] : At.gentle, ...t };
|
|
353
355
|
}
|
|
354
356
|
class ne {
|
|
355
357
|
constructor(t) {
|
|
@@ -378,12 +380,12 @@ class ne {
|
|
|
378
380
|
*/
|
|
379
381
|
animateTransformCancellable(t, i, e, n = null, a = null) {
|
|
380
382
|
this.cancelAllAnimations(t);
|
|
381
|
-
const r = n ?? this.config.duration, s = a ?? this.config.easing.default,
|
|
383
|
+
const r = n ?? this.config.duration, s = a ?? this.config.easing.default, c = this.buildTransformString(i), l = this.buildTransformString(e);
|
|
382
384
|
t.style.transition = "none";
|
|
383
385
|
const u = t.animate(
|
|
384
386
|
[
|
|
385
|
-
{ transform:
|
|
386
|
-
{ transform:
|
|
387
|
+
{ transform: c },
|
|
388
|
+
{ transform: l }
|
|
387
389
|
],
|
|
388
390
|
{
|
|
389
391
|
duration: r,
|
|
@@ -401,7 +403,7 @@ class ne {
|
|
|
401
403
|
duration: r
|
|
402
404
|
};
|
|
403
405
|
return this.activeAnimations.set(t, h), u.finished.then(() => {
|
|
404
|
-
t.style.transform =
|
|
406
|
+
t.style.transform = l, this.activeAnimations.delete(t);
|
|
405
407
|
}).catch(() => {
|
|
406
408
|
this.activeAnimations.delete(t);
|
|
407
409
|
}), h;
|
|
@@ -447,8 +449,8 @@ class ne {
|
|
|
447
449
|
const e = getComputedStyle(t).transform;
|
|
448
450
|
if (e === "none" || !e)
|
|
449
451
|
return { x: 0, y: 0, rotation: 0, scale: 1 };
|
|
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,
|
|
451
|
-
return { x: s, y:
|
|
452
|
+
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, c = n.f;
|
|
453
|
+
return { x: s, y: c, rotation: r, scale: a };
|
|
452
454
|
}
|
|
453
455
|
/**
|
|
454
456
|
* Check if an element has an active animation
|
|
@@ -511,27 +513,27 @@ function V(o, t, i) {
|
|
|
511
513
|
return o + (t - o) * i;
|
|
512
514
|
}
|
|
513
515
|
function oe(o, t, i, e) {
|
|
514
|
-
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x,
|
|
516
|
+
const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l = se(a, r);
|
|
515
517
|
let u = 0, h = 0, d = 1, g = n, b = !1;
|
|
516
|
-
for (let f = 0; f <
|
|
517
|
-
if (o <=
|
|
518
|
-
h = f === 0 ? 0 :
|
|
518
|
+
for (let f = 0; f < l.length; f++)
|
|
519
|
+
if (o <= l[f].time) {
|
|
520
|
+
h = f === 0 ? 0 : l[f - 1].time, d = l[f].time, g = l[f].overshoot, b = l[f].isOvershoot;
|
|
519
521
|
break;
|
|
520
522
|
}
|
|
521
523
|
const p = (o - h) / (d - h);
|
|
522
524
|
if (b)
|
|
523
|
-
u = 1 + g *
|
|
525
|
+
u = 1 + g * at(p);
|
|
524
526
|
else if (h === 0)
|
|
525
|
-
u =
|
|
527
|
+
u = at(p);
|
|
526
528
|
else {
|
|
527
|
-
const m = 1 + (
|
|
528
|
-
(y,
|
|
529
|
+
const m = 1 + (l.find(
|
|
530
|
+
(y, x) => y.time > h && x > 0 && l[x - 1].isOvershoot
|
|
529
531
|
)?.overshoot || g);
|
|
530
|
-
u = V(m, 1,
|
|
532
|
+
u = V(m, 1, at(p));
|
|
531
533
|
}
|
|
532
534
|
return {
|
|
533
535
|
x: t.x + s * u,
|
|
534
|
-
y: t.y +
|
|
536
|
+
y: t.y + c * u
|
|
535
537
|
};
|
|
536
538
|
}
|
|
537
539
|
function se(o, t) {
|
|
@@ -545,7 +547,7 @@ function se(o, t) {
|
|
|
545
547
|
return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
|
|
546
548
|
}
|
|
547
549
|
function ae(o, t, i, e) {
|
|
548
|
-
const { stiffness: n, damping: a, mass: r, oscillations: s } = e,
|
|
550
|
+
const { stiffness: n, damping: a, mass: r, oscillations: s } = e, c = i.x - t.x, l = i.y - t.y, u = Math.sqrt(n / r), h = a / (2 * Math.sqrt(n * r));
|
|
549
551
|
let d;
|
|
550
552
|
if (h < 1) {
|
|
551
553
|
const g = u * Math.sqrt(1 - h * h), b = Math.exp(-h * u * o * 3), p = Math.cos(g * o * s * Math.PI);
|
|
@@ -553,42 +555,42 @@ function ae(o, t, i, e) {
|
|
|
553
555
|
} else
|
|
554
556
|
d = 1 - Math.exp(-u * o * 3);
|
|
555
557
|
return d = Math.max(0, Math.min(d, 1.3)), {
|
|
556
|
-
x: t.x +
|
|
557
|
-
y: t.y +
|
|
558
|
+
x: t.x + c * d,
|
|
559
|
+
y: t.y + l * d
|
|
558
560
|
};
|
|
559
561
|
}
|
|
560
562
|
function re(o, t, i, e) {
|
|
561
|
-
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase:
|
|
563
|
+
const { amplitude: n, frequency: a, decay: r, decayRate: s, phase: c } = e, l = i.x - t.x, u = i.y - t.y, h = Math.sqrt(l * l + u * u), d = h > 0 ? -u / h : 0, g = h > 0 ? l / h : 1, b = a * Math.PI * 2 * o + c, p = r ? Math.pow(1 - o, s) : 1, f = n * Math.sin(b) * p, m = ce(o);
|
|
562
564
|
return {
|
|
563
565
|
x: V(t.x, i.x, m) + f * d,
|
|
564
566
|
y: V(t.y, i.y, m) + f * g
|
|
565
567
|
};
|
|
566
568
|
}
|
|
567
|
-
function
|
|
569
|
+
function at(o) {
|
|
568
570
|
return 1 - (1 - o) * (1 - o);
|
|
569
571
|
}
|
|
570
572
|
function ce(o) {
|
|
571
573
|
return 1 - Math.pow(1 - o, 3);
|
|
572
574
|
}
|
|
573
575
|
function le(o, t, i) {
|
|
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,
|
|
575
|
-
return t +
|
|
576
|
+
const { amplitude: e, frequency: n, decay: a } = i, r = Math.sin(o * n * Math.PI * 2), s = a ? Math.pow(1 - o, 2) : 1, c = e * r * s;
|
|
577
|
+
return t + c;
|
|
576
578
|
}
|
|
577
579
|
function he(o, t, i) {
|
|
578
580
|
const { overshoot: e, bounces: n } = i, a = [];
|
|
579
581
|
a.push({ time: 0.5, scale: e });
|
|
580
582
|
let r = e;
|
|
581
|
-
const s = 0.5,
|
|
583
|
+
const s = 0.5, l = 0.5 / (n * 2);
|
|
582
584
|
let u = 0.5;
|
|
583
585
|
for (let d = 0; d < n; d++) {
|
|
584
586
|
const g = 1 - (r - 1) * s;
|
|
585
|
-
u +=
|
|
587
|
+
u += l, a.push({ time: u, scale: g }), r = 1 + (r - 1) * s * s, u += l, d < n - 1 && a.push({ time: u, scale: r });
|
|
586
588
|
}
|
|
587
589
|
a.push({ time: 1, scale: 1 });
|
|
588
590
|
let h = 1;
|
|
589
591
|
for (let d = 0; d < a.length; d++)
|
|
590
592
|
if (o <= a[d].time) {
|
|
591
|
-
const g = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (o - g) / (a[d].time - g), f =
|
|
593
|
+
const g = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (o - g) / (a[d].time - g), f = at(p);
|
|
592
594
|
h = b + (a[d].scale - b) * f;
|
|
593
595
|
break;
|
|
594
596
|
}
|
|
@@ -603,58 +605,58 @@ function de(o) {
|
|
|
603
605
|
duration: a,
|
|
604
606
|
imageWidth: r,
|
|
605
607
|
imageHeight: s,
|
|
606
|
-
rotation:
|
|
607
|
-
scale:
|
|
608
|
+
rotation: c,
|
|
609
|
+
scale: l,
|
|
608
610
|
onComplete: u,
|
|
609
611
|
rotationConfig: h,
|
|
610
612
|
startRotation: d,
|
|
611
613
|
scaleConfig: g,
|
|
612
614
|
startScale: b
|
|
613
|
-
} = o, p = n.type, f = d !== void 0 && d !==
|
|
614
|
-
if ((p === "linear" || p === "arc") && !
|
|
615
|
+
} = o, p = n.type, f = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, x = f || m, v = b !== void 0 && b !== l, S = g?.mode === "pop", w = g?.pop || { overshoot: 1.2, bounces: 1 };
|
|
616
|
+
if ((p === "linear" || p === "arc") && !x && !(v || S)) {
|
|
615
617
|
u && u();
|
|
616
618
|
return;
|
|
617
619
|
}
|
|
618
620
|
const z = performance.now(), L = -r / 2, _ = -s / 2;
|
|
619
621
|
function O(H) {
|
|
620
|
-
const
|
|
622
|
+
const N = H - z, A = Math.min(N / a, 1);
|
|
621
623
|
let D;
|
|
622
624
|
switch (p) {
|
|
623
625
|
case "bounce": {
|
|
624
|
-
const
|
|
626
|
+
const k = te(
|
|
625
627
|
n.bouncePreset,
|
|
626
628
|
n.bounce
|
|
627
629
|
);
|
|
628
|
-
D = oe(
|
|
630
|
+
D = oe(A, i, e, k);
|
|
629
631
|
break;
|
|
630
632
|
}
|
|
631
633
|
case "elastic": {
|
|
632
|
-
const
|
|
634
|
+
const k = ee(
|
|
633
635
|
n.elasticPreset,
|
|
634
636
|
n.elastic
|
|
635
637
|
);
|
|
636
|
-
D = ae(
|
|
638
|
+
D = ae(A, i, e, k);
|
|
637
639
|
break;
|
|
638
640
|
}
|
|
639
641
|
case "wave": {
|
|
640
|
-
const
|
|
642
|
+
const k = ie(
|
|
641
643
|
n.wavePreset,
|
|
642
644
|
n.wave
|
|
643
645
|
);
|
|
644
|
-
D = re(
|
|
646
|
+
D = re(A, i, e, k);
|
|
645
647
|
break;
|
|
646
648
|
}
|
|
647
649
|
default:
|
|
648
650
|
D = {
|
|
649
|
-
x: V(i.x, e.x,
|
|
650
|
-
y: V(i.y, e.y,
|
|
651
|
+
x: V(i.x, e.x, A),
|
|
652
|
+
y: V(i.y, e.y, A)
|
|
651
653
|
};
|
|
652
654
|
}
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
m ?
|
|
656
|
-
let
|
|
657
|
-
S ?
|
|
655
|
+
const W = D.x - e.x, U = D.y - e.y;
|
|
656
|
+
let F;
|
|
657
|
+
m ? F = le(A, c, y) : f ? F = V(d, c, A) : F = c;
|
|
658
|
+
let R;
|
|
659
|
+
S ? R = he(A, l, w) : v ? R = V(b, l, A) : R = l, t.style.transform = `translate(${L}px, ${_}px) translate(${W}px, ${U}px) rotate(${F}deg) scale(${R})`, A < 1 ? requestAnimationFrame(O) : (t.style.transform = `translate(${L}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
|
|
658
660
|
}
|
|
659
661
|
requestAnimationFrame(O);
|
|
660
662
|
}
|
|
@@ -672,7 +674,7 @@ const fe = {
|
|
|
672
674
|
};
|
|
673
675
|
class ge {
|
|
674
676
|
constructor(t, i) {
|
|
675
|
-
this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || yt, this.rotationConfig = t.rotation || vt, this.scaleConfig = t.scale ||
|
|
677
|
+
this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || yt, this.rotationConfig = t.rotation || vt, this.scaleConfig = t.scale || xt;
|
|
676
678
|
}
|
|
677
679
|
/**
|
|
678
680
|
* Get the effective start position, considering layout-aware defaults
|
|
@@ -716,9 +718,9 @@ class ge {
|
|
|
716
718
|
* Calculate start position from the nearest edge (current default behavior)
|
|
717
719
|
*/
|
|
718
720
|
calculateNearestEdge(t, i, e, n) {
|
|
719
|
-
const a = t.x, r = t.y, s = a,
|
|
721
|
+
const a = t.x, r = t.y, s = a, c = e.width - a, l = r, u = e.height - r, h = Math.min(s, c, l, u);
|
|
720
722
|
let d = t.x, g = t.y;
|
|
721
|
-
return h === s ? d = -(i.width + n) : h ===
|
|
723
|
+
return h === s ? d = -(i.width + n) : h === c ? d = e.width + n : h === l ? g = -(i.height + n) : g = e.height + n, { x: d, y: g };
|
|
722
724
|
}
|
|
723
725
|
/**
|
|
724
726
|
* Calculate start position from a specific edge
|
|
@@ -765,18 +767,18 @@ class ge {
|
|
|
765
767
|
*/
|
|
766
768
|
calculateCircularPosition(t, i, e, n, a) {
|
|
767
769
|
const r = this.config.start.circular || {}, s = r.distribution || "even";
|
|
768
|
-
let
|
|
769
|
-
const
|
|
770
|
-
if (typeof
|
|
771
|
-
const p = parseFloat(
|
|
772
|
-
|
|
770
|
+
let c;
|
|
771
|
+
const l = r.radius || "120%";
|
|
772
|
+
if (typeof l == "string" && l.endsWith("%")) {
|
|
773
|
+
const p = parseFloat(l) / 100;
|
|
774
|
+
c = Math.sqrt(
|
|
773
775
|
e.width ** 2 + e.height ** 2
|
|
774
776
|
) * p / 2;
|
|
775
777
|
} else
|
|
776
|
-
|
|
778
|
+
c = typeof l == "number" ? l : 500;
|
|
777
779
|
let u;
|
|
778
780
|
s === "even" ? u = n / a * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
|
|
779
|
-
const h = e.width / 2, d = e.height / 2, g = h + Math.cos(u) *
|
|
781
|
+
const h = e.width / 2, d = e.height / 2, g = h + Math.cos(u) * c, b = d + Math.sin(u) * c;
|
|
780
782
|
return { x: g, y: b };
|
|
781
783
|
}
|
|
782
784
|
/**
|
|
@@ -796,9 +798,9 @@ class ge {
|
|
|
796
798
|
* Build a CSS transform string for the start position
|
|
797
799
|
* Uses pixel-based centering offset for reliable cross-browser behavior
|
|
798
800
|
*/
|
|
799
|
-
buildStartTransform(t, i, e, n, a, r, s,
|
|
800
|
-
const
|
|
801
|
-
return t.useScale ? `${p} translate(${
|
|
801
|
+
buildStartTransform(t, i, e, n, a, r, s, c) {
|
|
802
|
+
const l = t.x - i.x, u = t.y - i.y, h = s !== void 0 ? s : e, d = c !== void 0 ? c : n, g = a !== void 0 ? -a / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = a !== void 0 ? `translate(${g}px, ${b}px)` : "translate(-50%, -50%)";
|
|
803
|
+
return t.useScale ? `${p} translate(${l}px, ${u}px) rotate(${h}deg) scale(0)` : `${p} translate(${l}px, ${u}px) rotate(${h}deg) scale(${d})`;
|
|
802
804
|
}
|
|
803
805
|
/**
|
|
804
806
|
* Build the final CSS transform string
|
|
@@ -925,8 +927,8 @@ class ge {
|
|
|
925
927
|
amplitude: 15,
|
|
926
928
|
frequency: 3,
|
|
927
929
|
decay: !0
|
|
928
|
-
}, { amplitude: n, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2),
|
|
929
|
-
return i +
|
|
930
|
+
}, { amplitude: n, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2), c = r ? Math.pow(1 - t, 2) : 1, l = n * s * c;
|
|
931
|
+
return i + l;
|
|
930
932
|
}
|
|
931
933
|
/**
|
|
932
934
|
* Get the scale configuration
|
|
@@ -984,10 +986,10 @@ class ge {
|
|
|
984
986
|
bounces: 1
|
|
985
987
|
}, { overshoot: n, bounces: a } = e, r = this.generateScaleBounceKeyframes(a, n);
|
|
986
988
|
let s = i;
|
|
987
|
-
for (let
|
|
988
|
-
if (t <= r[
|
|
989
|
-
const
|
|
990
|
-
s = u + (r[
|
|
989
|
+
for (let c = 0; c < r.length; c++)
|
|
990
|
+
if (t <= r[c].time) {
|
|
991
|
+
const l = c === 0 ? 0 : r[c - 1].time, u = c === 0 ? i : r[c - 1].scale, h = (t - l) / (r[c].time - l), d = this.easeOutQuad(h);
|
|
992
|
+
s = u + (r[c].scale - u) * d;
|
|
991
993
|
break;
|
|
992
994
|
}
|
|
993
995
|
return s * i;
|
|
@@ -1000,10 +1002,10 @@ class ge {
|
|
|
1000
1002
|
e.push({ time: 0.5, scale: i });
|
|
1001
1003
|
let n = i;
|
|
1002
1004
|
const a = 0.5, s = 0.5 / (t * 2);
|
|
1003
|
-
let
|
|
1004
|
-
for (let
|
|
1005
|
+
let c = 0.5;
|
|
1006
|
+
for (let l = 0; l < t; l++) {
|
|
1005
1007
|
const u = 1 - (n - 1) * a;
|
|
1006
|
-
|
|
1008
|
+
c += s, e.push({ time: c, scale: u }), n = 1 + (n - 1) * a * a, c += s, l < t - 1 && e.push({ time: c, scale: n });
|
|
1007
1009
|
}
|
|
1008
1010
|
return e.push({ time: 1, scale: 1 }), e;
|
|
1009
1011
|
}
|
|
@@ -1099,7 +1101,7 @@ class me {
|
|
|
1099
1101
|
}
|
|
1100
1102
|
}
|
|
1101
1103
|
_startWiggle(t) {
|
|
1102
|
-
const i = { ...
|
|
1104
|
+
const i = { ...Gt, ...this.config.wiggle }, e = [
|
|
1103
1105
|
{ transform: "rotate(0deg)", offset: 0 },
|
|
1104
1106
|
{ transform: `rotate(${i.maxAngle}deg)`, offset: 0.25 },
|
|
1105
1107
|
{ transform: "rotate(0deg)", offset: 0.5 },
|
|
@@ -1119,7 +1121,7 @@ class me {
|
|
|
1119
1121
|
});
|
|
1120
1122
|
}
|
|
1121
1123
|
_startPulse(t) {
|
|
1122
|
-
const i = { ...
|
|
1124
|
+
const i = { ...qt, ...this.config.pulse }, e = [
|
|
1123
1125
|
{ transform: "scale(1)", offset: 0 },
|
|
1124
1126
|
{ transform: `scale(${i.maxScale})`, offset: 0.25 },
|
|
1125
1127
|
{ transform: "scale(1)", offset: 0.5 },
|
|
@@ -1212,10 +1214,10 @@ class pe {
|
|
|
1212
1214
|
* @returns Array of layout objects with position, rotation, scale
|
|
1213
1215
|
*/
|
|
1214
1216
|
generate(t, i, e = {}) {
|
|
1215
|
-
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding,
|
|
1216
|
-
for (let
|
|
1217
|
-
const I = this.random(v, y), z = this.random(S,
|
|
1218
|
-
id:
|
|
1217
|
+
const n = [], { width: a, height: r } = i, s = this.config.spacing.padding, c = e.fixedHeight ?? 200, l = 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, g = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || g !== 1, f = c * 1.5 / 2, m = c / 2, y = a - s - f, x = r - s - m, v = s + f, S = s + m;
|
|
1218
|
+
for (let w = 0; w < t; w++) {
|
|
1219
|
+
const I = this.random(v, y), z = this.random(S, x), L = l === "random" ? this.random(u, h) : 0, _ = b ? this.random(d, g) : 1, O = c * _, H = {
|
|
1220
|
+
id: w,
|
|
1219
1221
|
x: I,
|
|
1220
1222
|
y: z,
|
|
1221
1223
|
rotation: L,
|
|
@@ -1248,10 +1250,10 @@ class be {
|
|
|
1248
1250
|
* @returns Array of layout objects with position, rotation, scale
|
|
1249
1251
|
*/
|
|
1250
1252
|
generate(t, i, e = {}) {
|
|
1251
|
-
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1253
|
+
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", l = 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, g = h !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = {
|
|
1252
1254
|
...Ht,
|
|
1253
1255
|
...this.config.radial
|
|
1254
|
-
}, f = e.fixedHeight ?? s, m = a / 2, y = r / 2,
|
|
1256
|
+
}, f = e.fixedHeight ?? s, m = a / 2, y = r / 2, x = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50, S = Math.max(f * 0.8, Math.min(
|
|
1255
1257
|
m - v - f / 2,
|
|
1256
1258
|
y - v - f / 2
|
|
1257
1259
|
));
|
|
@@ -1261,7 +1263,7 @@ class be {
|
|
|
1261
1263
|
id: 0,
|
|
1262
1264
|
x: m,
|
|
1263
1265
|
y,
|
|
1264
|
-
rotation:
|
|
1266
|
+
rotation: c === "random" ? this.random(l * 0.33, u * 0.33) : 0,
|
|
1265
1267
|
// Less rotation for center
|
|
1266
1268
|
scale: z,
|
|
1267
1269
|
baseSize: L,
|
|
@@ -1269,30 +1271,30 @@ class be {
|
|
|
1269
1271
|
// Center image is highest
|
|
1270
1272
|
});
|
|
1271
1273
|
}
|
|
1272
|
-
let
|
|
1273
|
-
for (;
|
|
1274
|
-
const z = I /
|
|
1274
|
+
let w = 1, I = 1;
|
|
1275
|
+
for (; w < t; ) {
|
|
1276
|
+
const z = I / x, L = b > 0 ? 1 - z * b * 0.5 : 1, _ = Math.max(f * 0.8, S / x * 1.5 / p.tightness), O = I * _, H = O * 1.5, N = Math.PI * (3 * (H + O) - Math.sqrt((3 * H + O) * (H + 3 * O))), A = this.estimateWidth(f), D = Math.floor(N / (A * 0.7));
|
|
1275
1277
|
if (D === 0) {
|
|
1276
1278
|
I++;
|
|
1277
1279
|
continue;
|
|
1278
1280
|
}
|
|
1279
|
-
const
|
|
1280
|
-
for (let
|
|
1281
|
-
const
|
|
1282
|
-
let $ = m + Math.cos(
|
|
1283
|
-
const P =
|
|
1284
|
-
$ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P),
|
|
1285
|
-
const Y =
|
|
1281
|
+
const W = 2 * Math.PI / D, U = I * (20 * Math.PI / 180);
|
|
1282
|
+
for (let F = 0; F < D && w < t; F++) {
|
|
1283
|
+
const R = F * W + U, k = g ? this.random(h, d) : 1, q = L * k, T = f * q;
|
|
1284
|
+
let $ = m + Math.cos(R) * H, M = y + Math.sin(R) * O;
|
|
1285
|
+
const P = T * 1.5 / 2, B = T / 2;
|
|
1286
|
+
$ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P), M - B < v ? M = v + B : M + B > r - v && (M = r - v - B);
|
|
1287
|
+
const Y = c === "random" ? this.random(l, u) : 0;
|
|
1286
1288
|
n.push({
|
|
1287
|
-
id:
|
|
1289
|
+
id: w,
|
|
1288
1290
|
x: $,
|
|
1289
|
-
y:
|
|
1291
|
+
y: M,
|
|
1290
1292
|
rotation: Y,
|
|
1291
|
-
scale:
|
|
1292
|
-
baseSize:
|
|
1293
|
+
scale: q,
|
|
1294
|
+
baseSize: T,
|
|
1293
1295
|
zIndex: Math.max(1, 100 - I)
|
|
1294
1296
|
// Outer rings have lower z-index
|
|
1295
|
-
}),
|
|
1297
|
+
}), w++;
|
|
1296
1298
|
}
|
|
1297
1299
|
I++;
|
|
1298
1300
|
}
|
|
@@ -1327,7 +1329,7 @@ const ye = {
|
|
|
1327
1329
|
alignment: "center",
|
|
1328
1330
|
gap: 10,
|
|
1329
1331
|
overflowOffset: 0.25
|
|
1330
|
-
},
|
|
1332
|
+
}, Rt = [
|
|
1331
1333
|
{ x: 1, y: 1 },
|
|
1332
1334
|
// bottom-right
|
|
1333
1335
|
{ x: -1, y: -1 },
|
|
@@ -1357,65 +1359,65 @@ class ve {
|
|
|
1357
1359
|
* @returns Array of layout objects with position, rotation, scale
|
|
1358
1360
|
*/
|
|
1359
1361
|
generate(t, i, e = {}) {
|
|
1360
|
-
const n = [], { width: a, height: r } = i, s = { ...ye, ...this.config.grid },
|
|
1362
|
+
const n = [], { width: a, height: r } = i, s = { ...ye, ...this.config.grid }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, g = h !== 1 || d !== 1, b = a - 2 * c, p = r - 2 * c, { columns: f, rows: m } = this.calculateGridDimensions(
|
|
1361
1363
|
t,
|
|
1362
1364
|
b,
|
|
1363
1365
|
p,
|
|
1364
|
-
|
|
1366
|
+
l,
|
|
1365
1367
|
s
|
|
1366
|
-
), y = s.stagger === "row",
|
|
1368
|
+
), y = s.stagger === "row", x = s.stagger === "column", v = y ? f + 0.5 : f, S = x ? m + 0.5 : m, w = (b - s.gap * (f - 1)) / v, I = (p - s.gap * (m - 1)) / S, z = y ? w / 2 : 0, L = x ? I / 2 : 0, _ = 1 + s.overlap, O = Math.min(w, I) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, O) : O, N = f * w + (f - 1) * s.gap + z, A = m * I + (m - 1) * s.gap + L, D = c + (b - N) / 2, W = c + (p - A) / 2, U = f * m, F = s.columns !== "auto" && s.rows !== "auto", R = F && t > U;
|
|
1367
1369
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1368
1370
|
gridConfigColumns: s.columns,
|
|
1369
1371
|
gridConfigRows: s.rows,
|
|
1370
1372
|
columns: f,
|
|
1371
1373
|
rows: m,
|
|
1372
1374
|
cellCount: U,
|
|
1373
|
-
hasFixedGrid:
|
|
1375
|
+
hasFixedGrid: F,
|
|
1374
1376
|
imageCount: t,
|
|
1375
|
-
isOverflowMode:
|
|
1377
|
+
isOverflowMode: R
|
|
1376
1378
|
});
|
|
1377
|
-
const
|
|
1378
|
-
for (let
|
|
1379
|
-
let $,
|
|
1380
|
-
if (
|
|
1381
|
-
const
|
|
1382
|
-
X = Math.floor(
|
|
1379
|
+
const k = R ? new Array(U).fill(0) : [], q = Math.min(w, I) * s.overflowOffset;
|
|
1380
|
+
for (let T = 0; T < t; T++) {
|
|
1381
|
+
let $, M, X = 0;
|
|
1382
|
+
if (R && T >= U) {
|
|
1383
|
+
const G = T - U, j = G % U;
|
|
1384
|
+
X = Math.floor(G / U) + 1, k[j]++, s.fillDirection === "row" ? ($ = j % f, M = Math.floor(j / f)) : (M = j % m, $ = Math.floor(j / m));
|
|
1383
1385
|
} else
|
|
1384
|
-
s.fillDirection === "row" ? ($ =
|
|
1385
|
-
let P = D + $ * (
|
|
1386
|
-
if (s.stagger === "row" &&
|
|
1387
|
-
const
|
|
1388
|
-
P +=
|
|
1386
|
+
s.fillDirection === "row" ? ($ = T % f, M = Math.floor(T / f)) : (M = T % m, $ = Math.floor(T / m));
|
|
1387
|
+
let P = D + $ * (w + s.gap) + w / 2, B = W + M * (I + s.gap) + I / 2;
|
|
1388
|
+
if (s.stagger === "row" && M % 2 === 1 ? P += w / 2 : s.stagger === "column" && $ % 2 === 1 && (B += I / 2), X > 0) {
|
|
1389
|
+
const G = (X - 1) % Rt.length, j = Rt[G];
|
|
1390
|
+
P += j.x * q, B += j.y * q;
|
|
1389
1391
|
}
|
|
1390
1392
|
if (s.jitter > 0) {
|
|
1391
|
-
const
|
|
1392
|
-
P += this.random(-
|
|
1393
|
+
const G = w / 2 * s.jitter, j = I / 2 * s.jitter;
|
|
1394
|
+
P += this.random(-G, G), B += this.random(-j, j);
|
|
1393
1395
|
}
|
|
1394
|
-
let Y = P, J =
|
|
1395
|
-
if (!
|
|
1396
|
-
const
|
|
1397
|
-
if (
|
|
1398
|
-
const St =
|
|
1399
|
-
let
|
|
1400
|
-
s.alignment === "center" ?
|
|
1396
|
+
let Y = P, J = B;
|
|
1397
|
+
if (!R && s.fillDirection === "row") {
|
|
1398
|
+
const G = t % f || f;
|
|
1399
|
+
if (M === Math.floor((t - 1) / f) && G < f) {
|
|
1400
|
+
const St = G * w + (G - 1) * s.gap;
|
|
1401
|
+
let gt = 0;
|
|
1402
|
+
s.alignment === "center" ? gt = (N - St) / 2 : s.alignment === "end" && (gt = N - St), Y += gt;
|
|
1401
1403
|
}
|
|
1402
1404
|
}
|
|
1403
|
-
const
|
|
1404
|
-
Y = Math.max(
|
|
1405
|
-
let
|
|
1405
|
+
const ct = g ? this.random(h, d) : 1, K = H * ct, nt = K * 1.5 / 2, ot = K / 2, ht = c + nt, dt = a - c - nt, Pt = c + ot, _t = r - c - ot;
|
|
1406
|
+
Y = Math.max(ht, Math.min(Y, dt)), J = Math.max(Pt, Math.min(J, _t));
|
|
1407
|
+
let ut = 0;
|
|
1406
1408
|
if (u === "random") {
|
|
1407
|
-
const
|
|
1408
|
-
s.jitter > 0 ?
|
|
1409
|
+
const G = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
|
|
1410
|
+
s.jitter > 0 ? ut = this.random(G * s.jitter, j * s.jitter) : ut = this.random(G, j);
|
|
1409
1411
|
}
|
|
1410
|
-
let
|
|
1411
|
-
|
|
1412
|
-
id:
|
|
1412
|
+
let ft;
|
|
1413
|
+
R && X > 0 ? ft = 50 - X : ft = R ? 100 + T : T + 1, n.push({
|
|
1414
|
+
id: T,
|
|
1413
1415
|
x: Y,
|
|
1414
1416
|
y: J,
|
|
1415
|
-
rotation:
|
|
1416
|
-
scale:
|
|
1417
|
+
rotation: ut,
|
|
1418
|
+
scale: ct,
|
|
1417
1419
|
baseSize: K,
|
|
1418
|
-
zIndex:
|
|
1420
|
+
zIndex: ft
|
|
1419
1421
|
});
|
|
1420
1422
|
}
|
|
1421
1423
|
return n;
|
|
@@ -1432,8 +1434,8 @@ class ve {
|
|
|
1432
1434
|
else if (a.rows !== "auto")
|
|
1433
1435
|
s = a.rows, r = Math.ceil(t / s);
|
|
1434
1436
|
else {
|
|
1435
|
-
const
|
|
1436
|
-
for (r = Math.max(1, Math.round(Math.sqrt(t *
|
|
1437
|
+
const c = i / e;
|
|
1438
|
+
for (r = Math.max(1, Math.round(Math.sqrt(t * c / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
|
|
1437
1439
|
r--;
|
|
1438
1440
|
}
|
|
1439
1441
|
return { columns: Math.max(1, r), rows: Math.max(1, s) };
|
|
@@ -1445,7 +1447,7 @@ class ve {
|
|
|
1445
1447
|
return Math.random() * (i - t) + t;
|
|
1446
1448
|
}
|
|
1447
1449
|
}
|
|
1448
|
-
const
|
|
1450
|
+
const xe = Math.PI * (3 - Math.sqrt(5)), we = {
|
|
1449
1451
|
spiralType: "golden",
|
|
1450
1452
|
direction: "counterclockwise",
|
|
1451
1453
|
tightness: 1,
|
|
@@ -1464,35 +1466,35 @@ class Ee {
|
|
|
1464
1466
|
* @returns Array of layout objects with position, rotation, scale
|
|
1465
1467
|
*/
|
|
1466
1468
|
generate(t, i, e = {}) {
|
|
1467
|
-
const n = [], { width: a, height: r } = i, s = { ...
|
|
1468
|
-
m -
|
|
1469
|
-
y -
|
|
1469
|
+
const n = [], { width: a, height: r } = i, s = { ...we, ...this.config.spiral }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = g !== 1 || b !== 1, f = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, y = r / 2, x = Math.min(
|
|
1470
|
+
m - c - l / 2,
|
|
1471
|
+
y - c - l / 2
|
|
1470
1472
|
), v = s.direction === "clockwise" ? -1 : 1;
|
|
1471
1473
|
for (let S = 0; S < t; S++) {
|
|
1472
|
-
let
|
|
1474
|
+
let w, I;
|
|
1473
1475
|
if (s.spiralType === "golden")
|
|
1474
|
-
|
|
1476
|
+
w = S * xe * v + s.startAngle, I = this.calculateGoldenRadius(S, t, x, s.tightness);
|
|
1475
1477
|
else if (s.spiralType === "archimedean") {
|
|
1476
1478
|
const P = S * 0.5 * s.tightness;
|
|
1477
|
-
|
|
1479
|
+
w = P * v + s.startAngle, I = this.calculateArchimedeanRadius(P, t, x, s.tightness);
|
|
1478
1480
|
} else {
|
|
1479
1481
|
const P = S * 0.3 * s.tightness;
|
|
1480
|
-
|
|
1482
|
+
w = P * v + s.startAngle, I = this.calculateLogarithmicRadius(P, t, x, s.tightness);
|
|
1481
1483
|
}
|
|
1482
|
-
const z = m + Math.cos(
|
|
1483
|
-
let
|
|
1484
|
+
const z = m + Math.cos(w) * I, L = y + Math.sin(w) * I, _ = I / x, O = f > 0 ? 1 - _ * f * 0.5 : 1, H = p ? this.random(g, b) : 1, N = O * H, A = l * N, W = A * 1.5 / 2, U = A / 2, F = c + W, R = a - c - W, k = c + U, q = r - c - U, T = Math.max(F, Math.min(z, R)), $ = Math.max(k, Math.min(L, q));
|
|
1485
|
+
let M = 0;
|
|
1484
1486
|
if (u === "random") {
|
|
1485
|
-
const P =
|
|
1486
|
-
|
|
1487
|
-
} else u === "tangent" && (
|
|
1487
|
+
const P = w * 180 / Math.PI % 360, B = this.random(h, d);
|
|
1488
|
+
M = s.spiralType === "golden" ? B : P * 0.1 + B * 0.9;
|
|
1489
|
+
} else u === "tangent" && (M = this.calculateSpiralTangent(w, I, s));
|
|
1488
1490
|
const X = t - S;
|
|
1489
1491
|
n.push({
|
|
1490
1492
|
id: S,
|
|
1491
|
-
x:
|
|
1493
|
+
x: T,
|
|
1492
1494
|
y: $,
|
|
1493
|
-
rotation:
|
|
1494
|
-
scale:
|
|
1495
|
-
baseSize:
|
|
1495
|
+
rotation: M,
|
|
1496
|
+
scale: N,
|
|
1497
|
+
baseSize: A,
|
|
1496
1498
|
zIndex: X
|
|
1497
1499
|
});
|
|
1498
1500
|
}
|
|
@@ -1536,8 +1538,8 @@ class Ee {
|
|
|
1536
1538
|
* r = a * e^(b*θ)
|
|
1537
1539
|
*/
|
|
1538
1540
|
calculateLogarithmicRadius(t, i, e, n) {
|
|
1539
|
-
const a = e * 0.05, r = 0.15 / n, s = a * Math.exp(r * t),
|
|
1540
|
-
return s /
|
|
1541
|
+
const a = e * 0.05, r = 0.15 / n, s = a * Math.exp(r * t), c = i * 0.3 * n, l = a * Math.exp(r * c);
|
|
1542
|
+
return s / l * e;
|
|
1541
1543
|
}
|
|
1542
1544
|
/**
|
|
1543
1545
|
* Utility: Generate random number between min and max
|
|
@@ -1566,7 +1568,7 @@ class Ie {
|
|
|
1566
1568
|
* @returns Array of layout objects with position, rotation, scale
|
|
1567
1569
|
*/
|
|
1568
1570
|
generate(t, i, e = {}) {
|
|
1569
|
-
const n = [], { width: a, height: r } = i, s = { ...Se, ...this.config.cluster },
|
|
1571
|
+
const n = [], { width: a, height: r } = i, s = { ...Se, ...this.config.cluster }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = g !== 1 || b !== 1, f = this.calculateClusterCount(
|
|
1570
1572
|
t,
|
|
1571
1573
|
s.clusterCount,
|
|
1572
1574
|
a,
|
|
@@ -1576,38 +1578,38 @@ class Ie {
|
|
|
1576
1578
|
f,
|
|
1577
1579
|
a,
|
|
1578
1580
|
r,
|
|
1579
|
-
|
|
1581
|
+
c,
|
|
1580
1582
|
s
|
|
1581
1583
|
), y = new Array(f).fill(0);
|
|
1582
1584
|
for (let v = 0; v < t; v++)
|
|
1583
1585
|
y[v % f]++;
|
|
1584
|
-
let
|
|
1586
|
+
let x = 0;
|
|
1585
1587
|
for (let v = 0; v < f; v++) {
|
|
1586
|
-
const S = m[v],
|
|
1587
|
-
for (let I = 0; I <
|
|
1588
|
+
const S = m[v], w = y[v];
|
|
1589
|
+
for (let I = 0; I < w; I++) {
|
|
1588
1590
|
let z, L;
|
|
1589
1591
|
if (s.distribution === "gaussian")
|
|
1590
1592
|
z = this.gaussianRandom() * S.spread, L = this.gaussianRandom() * S.spread;
|
|
1591
1593
|
else {
|
|
1592
|
-
const
|
|
1593
|
-
z = Math.cos(
|
|
1594
|
+
const M = this.random(0, Math.PI * 2), X = this.random(0, S.spread);
|
|
1595
|
+
z = Math.cos(M) * X, L = Math.sin(M) * X;
|
|
1594
1596
|
}
|
|
1595
1597
|
const _ = 1 + s.overlap * 0.5, O = 1 + s.overlap * 0.3;
|
|
1596
1598
|
z /= _, L /= _;
|
|
1597
|
-
const H = p ? this.random(g, b) : 1,
|
|
1598
|
-
let D = S.x + z,
|
|
1599
|
-
const
|
|
1600
|
-
D = Math.max(
|
|
1601
|
-
const
|
|
1599
|
+
const H = p ? this.random(g, b) : 1, N = O * H, A = l * N;
|
|
1600
|
+
let D = S.x + z, W = S.y + L;
|
|
1601
|
+
const F = A * 1.5 / 2, R = A / 2;
|
|
1602
|
+
D = Math.max(c + F, Math.min(D, a - c - F)), W = Math.max(c + R, Math.min(W, r - c - R));
|
|
1603
|
+
const k = u === "random" ? this.random(h, d) : 0, T = Math.sqrt(z * z + L * L) / S.spread, $ = Math.round((1 - T) * 50) + 1;
|
|
1602
1604
|
n.push({
|
|
1603
|
-
id:
|
|
1605
|
+
id: x,
|
|
1604
1606
|
x: D,
|
|
1605
|
-
y:
|
|
1606
|
-
rotation:
|
|
1607
|
-
scale:
|
|
1608
|
-
baseSize:
|
|
1607
|
+
y: W,
|
|
1608
|
+
rotation: k,
|
|
1609
|
+
scale: N,
|
|
1610
|
+
baseSize: A,
|
|
1609
1611
|
zIndex: $
|
|
1610
|
-
}),
|
|
1612
|
+
}), x++;
|
|
1611
1613
|
}
|
|
1612
1614
|
}
|
|
1613
1615
|
return n;
|
|
@@ -1618,27 +1620,27 @@ class Ie {
|
|
|
1618
1620
|
calculateClusterCount(t, i, e, n, a) {
|
|
1619
1621
|
if (i !== "auto")
|
|
1620
1622
|
return Math.max(1, Math.min(i, t));
|
|
1621
|
-
const s = Math.max(1, Math.ceil(t / 8)),
|
|
1623
|
+
const s = Math.max(1, Math.ceil(t / 8)), c = Math.floor(
|
|
1622
1624
|
e / a * (n / a) * 0.6
|
|
1623
1625
|
);
|
|
1624
|
-
return Math.max(1, Math.min(s,
|
|
1626
|
+
return Math.max(1, Math.min(s, c, 10));
|
|
1625
1627
|
}
|
|
1626
1628
|
/**
|
|
1627
1629
|
* Generate cluster center positions with spacing constraints
|
|
1628
1630
|
*/
|
|
1629
1631
|
generateClusterCenters(t, i, e, n, a) {
|
|
1630
|
-
const r = [],
|
|
1632
|
+
const r = [], c = n + a.clusterSpread, l = i - n - a.clusterSpread, u = n + a.clusterSpread, h = e - n - a.clusterSpread;
|
|
1631
1633
|
for (let d = 0; d < t; d++) {
|
|
1632
1634
|
let g = null, b = -1;
|
|
1633
1635
|
for (let p = 0; p < 100; p++) {
|
|
1634
1636
|
const f = {
|
|
1635
|
-
x: this.random(
|
|
1637
|
+
x: this.random(c, l),
|
|
1636
1638
|
y: this.random(u, h),
|
|
1637
1639
|
spread: this.calculateClusterSpread(a)
|
|
1638
1640
|
};
|
|
1639
1641
|
let m = 1 / 0;
|
|
1640
1642
|
for (const y of r) {
|
|
1641
|
-
const
|
|
1643
|
+
const x = f.x - y.x, v = f.y - y.y, S = Math.sqrt(x * x + v * v);
|
|
1642
1644
|
m = Math.min(m, S);
|
|
1643
1645
|
}
|
|
1644
1646
|
if ((r.length === 0 || m > b) && (g = f, b = m), m >= a.clusterSpacing)
|
|
@@ -1672,7 +1674,7 @@ class Ie {
|
|
|
1672
1674
|
return Math.random() * (i - t) + t;
|
|
1673
1675
|
}
|
|
1674
1676
|
}
|
|
1675
|
-
class
|
|
1677
|
+
class Ce {
|
|
1676
1678
|
constructor(t, i = {}) {
|
|
1677
1679
|
this.config = t, this.imageConfig = i;
|
|
1678
1680
|
}
|
|
@@ -1684,29 +1686,29 @@ class Re {
|
|
|
1684
1686
|
* @returns Array of layout objects with position, rotation, scale
|
|
1685
1687
|
*/
|
|
1686
1688
|
generate(t, i, e = {}) {
|
|
1687
|
-
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1688
|
-
...
|
|
1689
|
+
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, l = 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, g = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || g !== 1, p = e.fixedHeight ?? s, f = {
|
|
1690
|
+
...Nt,
|
|
1689
1691
|
...this.config.wave
|
|
1690
|
-
}, { rows: m, amplitude: y, frequency:
|
|
1691
|
-
let
|
|
1692
|
-
for (let
|
|
1693
|
-
const
|
|
1694
|
-
let
|
|
1695
|
-
S === "offset" ?
|
|
1696
|
-
for (let
|
|
1697
|
-
const $ =
|
|
1692
|
+
}, { rows: m, amplitude: y, frequency: x, phaseShift: v, synchronization: S } = f, w = Math.ceil(t / m), L = p * 1.5 / 2, _ = c + L, O = a - c - L, H = O - _, N = w > 1 ? H / (w - 1) : 0, A = c + y + p / 2, D = r - c - y - p / 2, W = D - A, U = m > 1 ? W / (m - 1) : 0;
|
|
1693
|
+
let F = 0;
|
|
1694
|
+
for (let R = 0; R < m && F < t; R++) {
|
|
1695
|
+
const k = m === 1 ? (A + D) / 2 : A + R * U;
|
|
1696
|
+
let q = 0;
|
|
1697
|
+
S === "offset" ? q = R * v : S === "alternating" && (q = R * Math.PI);
|
|
1698
|
+
for (let T = 0; T < w && F < t; T++) {
|
|
1699
|
+
const $ = w === 1 ? (_ + O) / 2 : _ + T * N, M = this.calculateWaveY($, a, y, x, q), X = $, P = k + M, B = b ? this.random(d, g) : 1, Y = p * B;
|
|
1698
1700
|
let J = 0;
|
|
1699
|
-
|
|
1700
|
-
const K = Y * 1.5 / 2,
|
|
1701
|
+
l === "tangent" ? J = this.calculateRotation($, a, y, x, q) : l === "random" && (J = this.random(u, h));
|
|
1702
|
+
const K = Y * 1.5 / 2, lt = Y / 2, nt = c + K, ot = a - c - K, ht = c + lt, dt = r - c - lt;
|
|
1701
1703
|
n.push({
|
|
1702
|
-
id:
|
|
1703
|
-
x: Math.max(
|
|
1704
|
-
y: Math.max(
|
|
1704
|
+
id: F,
|
|
1705
|
+
x: Math.max(nt, Math.min(X, ot)),
|
|
1706
|
+
y: Math.max(ht, Math.min(P, dt)),
|
|
1705
1707
|
rotation: J,
|
|
1706
|
-
scale:
|
|
1708
|
+
scale: B,
|
|
1707
1709
|
baseSize: Y,
|
|
1708
|
-
zIndex:
|
|
1709
|
-
}),
|
|
1710
|
+
zIndex: F + 1
|
|
1711
|
+
}), F++;
|
|
1710
1712
|
}
|
|
1711
1713
|
}
|
|
1712
1714
|
return n;
|
|
@@ -1749,7 +1751,7 @@ class Re {
|
|
|
1749
1751
|
return Math.random() * (i - t) + t;
|
|
1750
1752
|
}
|
|
1751
1753
|
}
|
|
1752
|
-
const
|
|
1754
|
+
const wt = 100, Q = 100 / Math.sqrt(3), Et = [
|
|
1753
1755
|
[Q / 2, 0],
|
|
1754
1756
|
// upper-left
|
|
1755
1757
|
[3 * Q / 2, 0],
|
|
@@ -1762,21 +1764,21 @@ const xt = 100, Q = 100 / Math.sqrt(3), Et = [
|
|
|
1762
1764
|
// lower-left
|
|
1763
1765
|
[0, 50]
|
|
1764
1766
|
// left
|
|
1765
|
-
],
|
|
1766
|
-
function
|
|
1767
|
+
], Ae = Et[1][0] / wt, Re = Et[2][1] / wt;
|
|
1768
|
+
function Te(o) {
|
|
1767
1769
|
return {
|
|
1768
|
-
colStep:
|
|
1769
|
-
rowOffset:
|
|
1770
|
+
colStep: Ae * o,
|
|
1771
|
+
rowOffset: Re * o
|
|
1770
1772
|
};
|
|
1771
1773
|
}
|
|
1772
1774
|
function Le(o, t, i, e, n, a) {
|
|
1773
|
-
const { colStep: r } =
|
|
1775
|
+
const { colStep: r } = Te(a);
|
|
1774
1776
|
return {
|
|
1775
1777
|
px: e + r * o,
|
|
1776
1778
|
py: n + a * (t + o / 2)
|
|
1777
1779
|
};
|
|
1778
1780
|
}
|
|
1779
|
-
const
|
|
1781
|
+
const Fe = [
|
|
1780
1782
|
[1, 0, -1],
|
|
1781
1783
|
[0, 1, -1],
|
|
1782
1784
|
[-1, 1, 0],
|
|
@@ -1784,12 +1786,12 @@ const Me = [
|
|
|
1784
1786
|
[0, -1, 1],
|
|
1785
1787
|
[1, -1, 0]
|
|
1786
1788
|
];
|
|
1787
|
-
function
|
|
1789
|
+
function Me(o) {
|
|
1788
1790
|
if (o === 0) return [[0, 0, 0]];
|
|
1789
1791
|
const t = [];
|
|
1790
1792
|
let [i, e, n] = [0, -o, o];
|
|
1791
|
-
for (const [a, r, s] of
|
|
1792
|
-
for (let
|
|
1793
|
+
for (const [a, r, s] of Fe)
|
|
1794
|
+
for (let c = 0; c < o; c++)
|
|
1793
1795
|
t.push([i, e, n]), i += a, e += r, n += s;
|
|
1794
1796
|
return t;
|
|
1795
1797
|
}
|
|
@@ -1800,23 +1802,23 @@ class ze {
|
|
|
1800
1802
|
this.config = t;
|
|
1801
1803
|
}
|
|
1802
1804
|
generate(t, i, e = {}) {
|
|
1803
|
-
const n = [], { width: a, height: r } = i, s = a / 2,
|
|
1804
|
-
...
|
|
1805
|
+
const n = [], { width: a, height: r } = i, s = a / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
|
|
1806
|
+
...kt,
|
|
1805
1807
|
...this.config.honeycomb
|
|
1806
|
-
}.spacing ?? 0, d =
|
|
1808
|
+
}.spacing ?? 0, d = l + h;
|
|
1807
1809
|
let g = 0, b = 0;
|
|
1808
1810
|
for (; g < t; ) {
|
|
1809
|
-
const p =
|
|
1811
|
+
const p = Me(b);
|
|
1810
1812
|
for (const [f, m, y] of p) {
|
|
1811
1813
|
if (g >= t) break;
|
|
1812
|
-
const { px:
|
|
1814
|
+
const { px: x, py: v } = Le(f, m, y, s, c, d);
|
|
1813
1815
|
n.push({
|
|
1814
1816
|
id: g,
|
|
1815
|
-
x
|
|
1817
|
+
x,
|
|
1816
1818
|
y: v,
|
|
1817
1819
|
rotation: 0,
|
|
1818
1820
|
scale: 1,
|
|
1819
|
-
baseSize:
|
|
1821
|
+
baseSize: l,
|
|
1820
1822
|
// Inner rings render above outer rings
|
|
1821
1823
|
zIndex: Math.max(1, 100 - b)
|
|
1822
1824
|
}), g++;
|
|
@@ -1845,7 +1847,7 @@ class Oe {
|
|
|
1845
1847
|
case "cluster":
|
|
1846
1848
|
return new Ie(this.config, this.imageConfig);
|
|
1847
1849
|
case "wave":
|
|
1848
|
-
return new
|
|
1850
|
+
return new Ce(this.config, this.imageConfig);
|
|
1849
1851
|
case "honeycomb":
|
|
1850
1852
|
return new ze(this.config, this.imageConfig);
|
|
1851
1853
|
default:
|
|
@@ -1931,13 +1933,13 @@ class Oe {
|
|
|
1931
1933
|
const a = this.imageConfig.sizing, r = this.resolveBaseHeight(n);
|
|
1932
1934
|
if (r !== void 0)
|
|
1933
1935
|
return { height: r };
|
|
1934
|
-
const s = a?.minSize ?? 50,
|
|
1936
|
+
const s = a?.minSize ?? 50, c = a?.maxSize ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: h, height: d } = t, p = h * d * l / i;
|
|
1935
1937
|
let m = Math.sqrt(p / 1.4);
|
|
1936
1938
|
m *= u, m = Math.min(m, e);
|
|
1937
|
-
let y = this.clamp(m, s,
|
|
1939
|
+
let y = this.clamp(m, s, c);
|
|
1938
1940
|
if (y === s && m < s) {
|
|
1939
|
-
const
|
|
1940
|
-
y = Math.max(
|
|
1941
|
+
const x = Math.max(s * 0.05, 20);
|
|
1942
|
+
y = Math.max(x, m);
|
|
1941
1943
|
}
|
|
1942
1944
|
return this.config.algorithm === "honeycomb" && (y = Math.min(y, this.honeycombMaxImageHeight(i, t))), { height: y };
|
|
1943
1945
|
}
|
|
@@ -1951,7 +1953,7 @@ class Oe {
|
|
|
1951
1953
|
let e = 0, n = 1;
|
|
1952
1954
|
for (; n < t; )
|
|
1953
1955
|
e++, n += 6 * e;
|
|
1954
|
-
const a = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, s = i.width / 2,
|
|
1956
|
+
const a = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, s = i.width / 2, c = i.height / 2, l = Math.sqrt(3) / 2, u = 1 / Math.sqrt(3), h = (c - a - r * e) / (e + 0.5), d = (s - a - l * r * e) / (l * e + u);
|
|
1955
1957
|
return Math.max(10, Math.min(h, d));
|
|
1956
1958
|
}
|
|
1957
1959
|
/**
|
|
@@ -1962,7 +1964,7 @@ class Oe {
|
|
|
1962
1964
|
}
|
|
1963
1965
|
}
|
|
1964
1966
|
var E = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(E || {});
|
|
1965
|
-
const
|
|
1967
|
+
const Tt = {
|
|
1966
1968
|
// Geometric shapes - uses percentages for responsive sizing
|
|
1967
1969
|
circle: "circle(50%)",
|
|
1968
1970
|
square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
|
|
@@ -1995,7 +1997,7 @@ const At = {
|
|
|
1995
1997
|
},
|
|
1996
1998
|
// Hexagon - regular hexagon (reference points imported from hexagonGeometry)
|
|
1997
1999
|
hexagon: {
|
|
1998
|
-
refHeight:
|
|
2000
|
+
refHeight: wt,
|
|
1999
2001
|
points: Et
|
|
2000
2002
|
},
|
|
2001
2003
|
// Octagon - regular octagon
|
|
@@ -2011,7 +2013,7 @@ const At = {
|
|
|
2011
2013
|
};
|
|
2012
2014
|
function $e(o) {
|
|
2013
2015
|
if (o)
|
|
2014
|
-
return o in
|
|
2016
|
+
return o in Tt ? Tt[o] : o;
|
|
2015
2017
|
}
|
|
2016
2018
|
function Pe(o, t, i) {
|
|
2017
2019
|
const e = De[o];
|
|
@@ -2019,7 +2021,7 @@ function Pe(o, t, i) {
|
|
|
2019
2021
|
const n = t / e.refHeight;
|
|
2020
2022
|
if (o === "circle")
|
|
2021
2023
|
return `circle(${Math.round(50 * n * 100) / 100}px)`;
|
|
2022
|
-
const a = e.points.map(([p]) => p), r = e.points.map(([, p]) => p), s = (Math.min(...a) + Math.max(...a)) / 2 * n,
|
|
2024
|
+
const a = e.points.map(([p]) => p), r = e.points.map(([, p]) => p), s = (Math.min(...a) + Math.max(...a)) / 2 * n, c = (Math.min(...r) + Math.max(...r)) / 2 * n, l = (Math.max(...a) - Math.min(...a)) * n, u = (i ?? l) / 2, h = t / 2, d = u - s, g = h - c;
|
|
2023
2025
|
return `polygon(${e.points.map(([p, f]) => {
|
|
2024
2026
|
const m = Math.round((p * n + d) * 100) / 100, y = Math.round((f * n + g) * 100) / 100;
|
|
2025
2027
|
return `${m}px ${y}px`;
|
|
@@ -2049,7 +2051,7 @@ function tt(o) {
|
|
|
2049
2051
|
const t = o.width ?? 0, i = o.style ?? "solid", e = o.color ?? "#000000";
|
|
2050
2052
|
return `${t}px ${i} ${e}`;
|
|
2051
2053
|
}
|
|
2052
|
-
function
|
|
2054
|
+
function it(o, t, i) {
|
|
2053
2055
|
if (!o) return {};
|
|
2054
2056
|
const e = {};
|
|
2055
2057
|
if (o.borderRadiusTopLeft !== void 0 || o.borderRadiusTopRight !== void 0 || o.borderRadiusBottomRight !== void 0 || o.borderRadiusBottomLeft !== void 0) {
|
|
@@ -2057,39 +2059,39 @@ function et(o, t, i) {
|
|
|
2057
2059
|
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`);
|
|
2058
2060
|
} else o.border?.radius !== void 0 && (e.borderRadius = `${o.border.radius}px`);
|
|
2059
2061
|
if (o.borderTop || o.borderRight || o.borderBottom || o.borderLeft) {
|
|
2060
|
-
const s = o.border || {},
|
|
2061
|
-
e.borderTop = tt(
|
|
2062
|
+
const s = o.border || {}, c = { ...s, ...o.borderTop }, l = { ...s, ...o.borderRight }, u = { ...s, ...o.borderBottom }, h = { ...s, ...o.borderLeft };
|
|
2063
|
+
e.borderTop = tt(c), e.borderRight = tt(l), e.borderBottom = tt(u), e.borderLeft = tt(h);
|
|
2062
2064
|
} else o.border && (e.border = tt(o.border));
|
|
2063
2065
|
o.shadow !== void 0 && (e.boxShadow = Ue(o.shadow));
|
|
2064
2066
|
const r = He(o.filter);
|
|
2065
2067
|
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) {
|
|
2066
|
-
const s = o.outline.width ?? 0,
|
|
2067
|
-
e.outline = `${s}px ${
|
|
2068
|
+
const s = o.outline.width ?? 0, c = o.outline.style ?? "solid", l = o.outline.color ?? "#000000";
|
|
2069
|
+
e.outline = `${s}px ${c} ${l}`, o.outline.offset !== void 0 && (e.outlineOffset = `${o.outline.offset}px`);
|
|
2068
2070
|
}
|
|
2069
2071
|
if (o.objectFit !== void 0 && (e.objectFit = o.objectFit), o.aspectRatio !== void 0 && (e.aspectRatio = o.aspectRatio), o.clipPath !== void 0) {
|
|
2070
2072
|
let s;
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
2073
|
-
s = Pe(
|
|
2073
|
+
const c = typeof o.clipPath == "object" && o.clipPath !== null && "shape" in o.clipPath, l = c ? o.clipPath : void 0;
|
|
2074
|
+
if (l?.mode === "height-relative" && t)
|
|
2075
|
+
s = Pe(l.shape, t, i);
|
|
2074
2076
|
else {
|
|
2075
|
-
const u =
|
|
2077
|
+
const u = c && l ? l.shape : o.clipPath;
|
|
2076
2078
|
s = $e(u);
|
|
2077
2079
|
}
|
|
2078
2080
|
s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
|
|
2079
2081
|
}
|
|
2080
2082
|
return e;
|
|
2081
2083
|
}
|
|
2082
|
-
function
|
|
2084
|
+
function Ne(o, t) {
|
|
2083
2085
|
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);
|
|
2084
2086
|
}
|
|
2085
|
-
function
|
|
2086
|
-
const n =
|
|
2087
|
-
|
|
2087
|
+
function st(o, t, i, e) {
|
|
2088
|
+
const n = it(t, i, e);
|
|
2089
|
+
Ne(o, n);
|
|
2088
2090
|
}
|
|
2089
2091
|
function $t(o) {
|
|
2090
2092
|
return o ? Array.isArray(o) ? o.join(" ") : o : "";
|
|
2091
2093
|
}
|
|
2092
|
-
function
|
|
2094
|
+
function et(o, t) {
|
|
2093
2095
|
const i = $t(t);
|
|
2094
2096
|
i && i.split(" ").forEach((e) => {
|
|
2095
2097
|
e.trim() && o.classList.add(e.trim());
|
|
@@ -2105,7 +2107,7 @@ const Lt = {
|
|
|
2105
2107
|
UNFOCUSING: 999,
|
|
2106
2108
|
FOCUSING: 1e3
|
|
2107
2109
|
};
|
|
2108
|
-
class
|
|
2110
|
+
class ke {
|
|
2109
2111
|
constructor(t, i, e) {
|
|
2110
2112
|
this.state = E.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;
|
|
2111
2113
|
}
|
|
@@ -2139,9 +2141,9 @@ class Ne {
|
|
|
2139
2141
|
*/
|
|
2140
2142
|
calculateFocusDimensions(t, i, e) {
|
|
2141
2143
|
const n = this.normalizeScalePercent(this.config.scalePercent), a = e.height * n, r = t / i;
|
|
2142
|
-
let s = a,
|
|
2143
|
-
const
|
|
2144
|
-
return
|
|
2144
|
+
let s = a, c = s * r;
|
|
2145
|
+
const l = e.width * n;
|
|
2146
|
+
return c > l && (c = l, s = c / r), { width: c, height: s };
|
|
2145
2147
|
}
|
|
2146
2148
|
/**
|
|
2147
2149
|
* Calculate the transform needed to center an image (position only, no scale)
|
|
@@ -2172,12 +2174,12 @@ class Ne {
|
|
|
2172
2174
|
* Create a Web Animation that animates both transform (position) and dimensions
|
|
2173
2175
|
* This provides sharper zoom by re-rendering at target size instead of scaling pixels
|
|
2174
2176
|
*/
|
|
2175
|
-
animateWithDimensions(t, i, e, n, a, r, s,
|
|
2176
|
-
const
|
|
2177
|
+
animateWithDimensions(t, i, e, n, a, r, s, c) {
|
|
2178
|
+
const l = this.buildDimensionZoomTransform(i), u = this.buildDimensionZoomTransform(e);
|
|
2177
2179
|
return t.style.transition = "none", t.animate(
|
|
2178
2180
|
[
|
|
2179
2181
|
{
|
|
2180
|
-
transform:
|
|
2182
|
+
transform: l,
|
|
2181
2183
|
width: `${n}px`,
|
|
2182
2184
|
height: `${a}px`
|
|
2183
2185
|
},
|
|
@@ -2188,7 +2190,7 @@ class Ne {
|
|
|
2188
2190
|
}
|
|
2189
2191
|
],
|
|
2190
2192
|
{
|
|
2191
|
-
duration:
|
|
2193
|
+
duration: c,
|
|
2192
2194
|
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
2193
2195
|
fill: "forwards"
|
|
2194
2196
|
}
|
|
@@ -2199,8 +2201,8 @@ class Ne {
|
|
|
2199
2201
|
* Applies all focused styling properties, classes, and z-index
|
|
2200
2202
|
*/
|
|
2201
2203
|
applyFocusedStyling(t, i) {
|
|
2202
|
-
if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"),
|
|
2203
|
-
const e =
|
|
2204
|
+
if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"), et(t, this.focusedClassName), this.styling?.focused) {
|
|
2205
|
+
const e = it(this.styling.focused, t.offsetHeight, t.offsetWidth);
|
|
2204
2206
|
e.borderRadius !== void 0 && (t.style.borderRadius = e.borderRadius), e.borderTopLeftRadius !== void 0 && (t.style.borderTopLeftRadius = e.borderTopLeftRadius), e.borderTopRightRadius !== void 0 && (t.style.borderTopRightRadius = e.borderTopRightRadius), e.borderBottomRightRadius !== void 0 && (t.style.borderBottomRightRadius = e.borderBottomRightRadius), e.borderBottomLeftRadius !== void 0 && (t.style.borderBottomLeftRadius = e.borderBottomLeftRadius), e.border !== void 0 && (t.style.border = e.border), e.borderTop !== void 0 && (t.style.borderTop = e.borderTop), e.borderRight !== void 0 && (t.style.borderRight = e.borderRight), e.borderBottom !== void 0 && (t.style.borderBottom = e.borderBottom), e.borderLeft !== void 0 && (t.style.borderLeft = e.borderLeft), e.boxShadow !== void 0 && (t.style.boxShadow = e.boxShadow), e.filter !== void 0 && (t.style.filter = e.filter), e.opacity !== void 0 && (t.style.opacity = e.opacity), e.cursor !== void 0 && (t.style.cursor = e.cursor), e.outline !== void 0 && (t.style.outline = e.outline), e.outlineOffset !== void 0 && (t.style.outlineOffset = e.outlineOffset), e.objectFit !== void 0 && (t.style.objectFit = e.objectFit), e.aspectRatio !== void 0 && (t.style.aspectRatio = e.aspectRatio);
|
|
2205
2207
|
}
|
|
2206
2208
|
}
|
|
@@ -2210,7 +2212,7 @@ class Ne {
|
|
|
2210
2212
|
*/
|
|
2211
2213
|
removeFocusedStyling(t, i) {
|
|
2212
2214
|
if (t.style.zIndex = i, t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName), this.styling?.default) {
|
|
2213
|
-
const e =
|
|
2215
|
+
const e = it(this.styling.default, t.offsetHeight, t.offsetWidth);
|
|
2214
2216
|
e.borderRadius !== void 0 && (t.style.borderRadius = e.borderRadius), e.borderTopLeftRadius !== void 0 && (t.style.borderTopLeftRadius = e.borderTopLeftRadius), e.borderTopRightRadius !== void 0 && (t.style.borderTopRightRadius = e.borderTopRightRadius), e.borderBottomRightRadius !== void 0 && (t.style.borderBottomRightRadius = e.borderBottomRightRadius), e.borderBottomLeftRadius !== void 0 && (t.style.borderBottomLeftRadius = e.borderBottomLeftRadius), e.border !== void 0 && (t.style.border = e.border), e.borderTop !== void 0 && (t.style.borderTop = e.borderTop), e.borderRight !== void 0 && (t.style.borderRight = e.borderRight), e.borderBottom !== void 0 && (t.style.borderBottom = e.borderBottom), e.borderLeft !== void 0 && (t.style.borderLeft = e.borderLeft), e.boxShadow !== void 0 && (t.style.boxShadow = e.boxShadow), e.filter !== void 0 && (t.style.filter = e.filter), e.opacity !== void 0 && (t.style.opacity = e.opacity), e.cursor !== void 0 && (t.style.cursor = e.cursor), e.outline !== void 0 && (t.style.outline = e.outline), e.outlineOffset !== void 0 && (t.style.outlineOffset = e.outlineOffset), e.objectFit !== void 0 && (t.style.objectFit = e.objectFit), e.aspectRatio !== void 0 && (t.style.aspectRatio = e.aspectRatio);
|
|
2215
2217
|
}
|
|
2216
2218
|
}
|
|
@@ -2222,8 +2224,8 @@ class Ne {
|
|
|
2222
2224
|
let n = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
|
|
2223
2225
|
e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (n = { ...n, clipPath: void 0 });
|
|
2224
2226
|
const a = () => {
|
|
2225
|
-
const r = t.offsetHeight, s = t.offsetWidth,
|
|
2226
|
-
|
|
2227
|
+
const r = t.offsetHeight, s = t.offsetWidth, c = it(n, r, s);
|
|
2228
|
+
c.clipPath !== void 0 ? t.style.clipPath = c.clipPath : t.style.clipPath = "unset", c.overflow !== void 0 && (t.style.overflow = c.overflow), i.animation.playState === "running" && requestAnimationFrame(a);
|
|
2227
2229
|
};
|
|
2228
2230
|
requestAnimationFrame(a);
|
|
2229
2231
|
}
|
|
@@ -2234,7 +2236,7 @@ class Ne {
|
|
|
2234
2236
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
2235
2237
|
*/
|
|
2236
2238
|
startFocusAnimation(t, i, e, n, a) {
|
|
2237
|
-
const r = t.style.zIndex || "", s = t.offsetWidth,
|
|
2239
|
+
const r = t.style.zIndex || "", s = t.offsetWidth, c = t.offsetHeight, l = this.calculateFocusDimensions(s, c, i), u = this.calculateFocusTransform(i, e);
|
|
2238
2240
|
this.animationEngine.cancelAllAnimations(t);
|
|
2239
2241
|
const h = this.config.animationDuration ?? 600;
|
|
2240
2242
|
this.applyFocusedStyling(t, Lt.FOCUSING);
|
|
@@ -2244,14 +2246,14 @@ class Ne {
|
|
|
2244
2246
|
rotation: e.rotation,
|
|
2245
2247
|
scale: 1
|
|
2246
2248
|
// No scale - using dimensions
|
|
2247
|
-
}, g = a?.width ?? s, b = a?.height ??
|
|
2249
|
+
}, g = a?.width ?? s, b = a?.height ?? c, p = this.animateWithDimensions(
|
|
2248
2250
|
t,
|
|
2249
2251
|
d,
|
|
2250
2252
|
u,
|
|
2251
2253
|
g,
|
|
2252
2254
|
b,
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
+
l.width,
|
|
2256
|
+
l.height,
|
|
2255
2257
|
h
|
|
2256
2258
|
), f = {
|
|
2257
2259
|
id: `focus-${Date.now()}`,
|
|
@@ -2268,16 +2270,16 @@ class Ne {
|
|
|
2268
2270
|
focusTransform: u,
|
|
2269
2271
|
originalZIndex: r,
|
|
2270
2272
|
originalWidth: s,
|
|
2271
|
-
originalHeight:
|
|
2272
|
-
focusWidth:
|
|
2273
|
-
focusHeight:
|
|
2273
|
+
originalHeight: c,
|
|
2274
|
+
focusWidth: l.width,
|
|
2275
|
+
focusHeight: l.height
|
|
2274
2276
|
}, this.startClipPathAnimation(t, f, !0), {
|
|
2275
2277
|
element: t,
|
|
2276
2278
|
originalState: e,
|
|
2277
2279
|
animationHandle: f,
|
|
2278
2280
|
direction: "in",
|
|
2279
2281
|
originalWidth: s,
|
|
2280
|
-
originalHeight:
|
|
2282
|
+
originalHeight: c
|
|
2281
2283
|
};
|
|
2282
2284
|
}
|
|
2283
2285
|
/**
|
|
@@ -2289,7 +2291,7 @@ class Ne {
|
|
|
2289
2291
|
t.style.zIndex = String(Lt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
2290
2292
|
const a = this.config.animationDuration ?? 600;
|
|
2291
2293
|
t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName);
|
|
2292
|
-
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth,
|
|
2294
|
+
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, c = n?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, l = {
|
|
2293
2295
|
x: 0,
|
|
2294
2296
|
y: 0,
|
|
2295
2297
|
rotation: i.rotation,
|
|
@@ -2298,9 +2300,9 @@ class Ne {
|
|
|
2298
2300
|
}, u = this.focusData?.originalWidth ?? t.offsetWidth, h = this.focusData?.originalHeight ?? t.offsetHeight, d = this.animateWithDimensions(
|
|
2299
2301
|
t,
|
|
2300
2302
|
r,
|
|
2301
|
-
c,
|
|
2302
|
-
s,
|
|
2303
2303
|
l,
|
|
2304
|
+
s,
|
|
2305
|
+
c,
|
|
2304
2306
|
u,
|
|
2305
2307
|
h,
|
|
2306
2308
|
a
|
|
@@ -2309,7 +2311,7 @@ class Ne {
|
|
|
2309
2311
|
element: t,
|
|
2310
2312
|
animation: d,
|
|
2311
2313
|
fromState: r,
|
|
2312
|
-
toState:
|
|
2314
|
+
toState: l,
|
|
2313
2315
|
startTime: performance.now(),
|
|
2314
2316
|
duration: a
|
|
2315
2317
|
};
|
|
@@ -2337,9 +2339,9 @@ class Ne {
|
|
|
2337
2339
|
* Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
|
|
2338
2340
|
*/
|
|
2339
2341
|
captureMidAnimationState(t) {
|
|
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,
|
|
2341
|
-
return t.style.width = `${n}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${
|
|
2342
|
-
transform: { x: r, y: s, rotation:
|
|
2342
|
+
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, c = Math.atan2(e.b, e.a) * (180 / Math.PI);
|
|
2343
|
+
return t.style.width = `${n}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${c}deg)`, t.style.transition = "none", {
|
|
2344
|
+
transform: { x: r, y: s, rotation: c, scale: 1 },
|
|
2343
2345
|
dimensions: { width: n, height: a }
|
|
2344
2346
|
};
|
|
2345
2347
|
}
|
|
@@ -2425,12 +2427,12 @@ class Ne {
|
|
|
2425
2427
|
if (this.outgoing?.element === t) {
|
|
2426
2428
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
|
|
2427
2429
|
if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
|
|
2428
|
-
const { transform: s, dimensions:
|
|
2430
|
+
const { transform: s, dimensions: c } = this.captureMidAnimationState(this.incoming.element);
|
|
2429
2431
|
this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2430
2432
|
this.incoming.element,
|
|
2431
2433
|
this.incoming.originalState,
|
|
2432
2434
|
s,
|
|
2433
|
-
|
|
2435
|
+
c
|
|
2434
2436
|
);
|
|
2435
2437
|
} else
|
|
2436
2438
|
this.outgoing = null;
|
|
@@ -2506,10 +2508,10 @@ class Ne {
|
|
|
2506
2508
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2507
2509
|
this.waitForAnimation(s.animationHandle)
|
|
2508
2510
|
]), this.focusGeneration !== t) return;
|
|
2509
|
-
let
|
|
2510
|
-
this.outgoing && (
|
|
2511
|
-
const
|
|
2512
|
-
this.removeFocusedStyling(
|
|
2511
|
+
let c = null;
|
|
2512
|
+
this.outgoing && (c = this.outgoing.element, this.removeFocusedStyling(c, this.outgoing.originalState.zIndex?.toString() || ""));
|
|
2513
|
+
const l = s.element;
|
|
2514
|
+
this.removeFocusedStyling(l, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE, c && this.onUnfocusComplete?.(c), this.onUnfocusComplete?.(l);
|
|
2513
2515
|
return;
|
|
2514
2516
|
}
|
|
2515
2517
|
this.state = E.UNFOCUSING;
|
|
@@ -2566,10 +2568,10 @@ class Ne {
|
|
|
2566
2568
|
if (!this.currentFocus || !this.focusData || this.state !== E.FOCUSED) return;
|
|
2567
2569
|
const e = this.currentFocus, n = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = n.x ?? 0, s = n.y ?? 0;
|
|
2568
2570
|
a.push(`translate(${r}px, ${s}px)`), n.rotation !== void 0 && a.push(`rotate(${n.rotation}deg)`);
|
|
2569
|
-
const
|
|
2570
|
-
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform =
|
|
2571
|
+
const c = a.join(" ");
|
|
2572
|
+
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform = c, setTimeout(() => {
|
|
2571
2573
|
this.currentFocus === e && (e.style.transition = "none");
|
|
2572
|
-
}, i)) : (e.style.transition = "none", e.style.transform =
|
|
2574
|
+
}, i)) : (e.style.transition = "none", e.style.transform = c);
|
|
2573
2575
|
}
|
|
2574
2576
|
/**
|
|
2575
2577
|
* Reset zoom state (cancels all animations)
|
|
@@ -2596,7 +2598,7 @@ class Ne {
|
|
|
2596
2598
|
), this.state = E.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2597
2599
|
}
|
|
2598
2600
|
}
|
|
2599
|
-
const
|
|
2601
|
+
const Be = 50, je = 0.5, We = 20, Ge = 0.3, qe = 150, Xe = 30, rt = class rt {
|
|
2600
2602
|
constructor(t, i) {
|
|
2601
2603
|
this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = i, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
|
|
2602
2604
|
}
|
|
@@ -2623,7 +2625,7 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2623
2625
|
* Used to prevent click-outside from unfocusing immediately after touch
|
|
2624
2626
|
*/
|
|
2625
2627
|
hadRecentTouch() {
|
|
2626
|
-
return Date.now() - this.recentTouchTimestamp <
|
|
2628
|
+
return Date.now() - this.recentTouchTimestamp < rt.TOUCH_CLICK_DELAY;
|
|
2627
2629
|
}
|
|
2628
2630
|
handleTouchStart(t) {
|
|
2629
2631
|
if (t.touches.length !== 1) return;
|
|
@@ -2647,7 +2649,7 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2647
2649
|
}
|
|
2648
2650
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2649
2651
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
|
|
2650
|
-
const a = e *
|
|
2652
|
+
const a = e * Ge;
|
|
2651
2653
|
this.callbacks.onDragOffset(a);
|
|
2652
2654
|
}
|
|
2653
2655
|
}
|
|
@@ -2656,14 +2658,14 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2656
2658
|
this.recentTouchTimestamp = Date.now();
|
|
2657
2659
|
const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, n = Math.abs(i) / e, a = Math.abs(i);
|
|
2658
2660
|
let r = !1;
|
|
2659
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >=
|
|
2661
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Be || n >= je && a >= We) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2660
2662
|
}
|
|
2661
2663
|
handleTouchCancel(t) {
|
|
2662
2664
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
2663
2665
|
}
|
|
2664
2666
|
};
|
|
2665
|
-
|
|
2666
|
-
let bt =
|
|
2667
|
+
rt.TOUCH_CLICK_DELAY = 300;
|
|
2668
|
+
let bt = rt;
|
|
2667
2669
|
class Ye {
|
|
2668
2670
|
constructor(t) {
|
|
2669
2671
|
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)
|
|
@@ -2759,10 +2761,10 @@ class Ye {
|
|
|
2759
2761
|
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);
|
|
2760
2762
|
if (!s.ok)
|
|
2761
2763
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2762
|
-
const
|
|
2764
|
+
const l = (await s.json()).files.filter(
|
|
2763
2765
|
(u) => u.mimeType.startsWith("image/") && i.isAllowed(u.name)
|
|
2764
2766
|
);
|
|
2765
|
-
return this.log(`Found ${
|
|
2767
|
+
return this.log(`Found ${l.length} images in folder ${t} (non-recursive)`), l.forEach((u) => {
|
|
2766
2768
|
e.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
|
|
2767
2769
|
}), e;
|
|
2768
2770
|
}
|
|
@@ -2784,8 +2786,8 @@ class Ye {
|
|
|
2784
2786
|
try {
|
|
2785
2787
|
const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
|
|
2786
2788
|
if (s.ok) {
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
+
const c = await s.json();
|
|
2790
|
+
c.mimeType.startsWith("image/") && i.isAllowed(c.name) ? (e.push(`https://lh3.googleusercontent.com/d/${a}=s1600`), this.log(`Added file: ${c.name}`)) : this.log(`Skipping non-image file: ${c.name} (${c.mimeType})`);
|
|
2789
2791
|
} else
|
|
2790
2792
|
this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
|
|
2791
2793
|
} catch (r) {
|
|
@@ -2829,12 +2831,12 @@ class Ye {
|
|
|
2829
2831
|
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);
|
|
2830
2832
|
if (!s.ok)
|
|
2831
2833
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2832
|
-
const
|
|
2834
|
+
const c = await s.json(), l = c.files.filter(
|
|
2833
2835
|
(h) => h.mimeType.startsWith("image/") && i.isAllowed(h.name)
|
|
2834
|
-
), u =
|
|
2836
|
+
), u = c.files.filter(
|
|
2835
2837
|
(h) => h.mimeType === "application/vnd.google-apps.folder"
|
|
2836
2838
|
);
|
|
2837
|
-
this.log(`Found ${
|
|
2839
|
+
this.log(`Found ${c.files.length} total items in folder ${t}`), c.files.forEach((h) => this.log(` - File: ${h.name} (${h.mimeType})`)), this.log(`- ${l.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), l.forEach((h) => {
|
|
2838
2840
|
e.push(`https://lh3.googleusercontent.com/d/${h.id}=s1600`), this.log(`Added file: ${h.name}`);
|
|
2839
2841
|
});
|
|
2840
2842
|
for (const h of u) {
|
|
@@ -3205,6 +3207,37 @@ const Ze = `
|
|
|
3205
3207
|
pointer-events: none;
|
|
3206
3208
|
}
|
|
3207
3209
|
|
|
3210
|
+
.fbn-ic-gallery:focus,
|
|
3211
|
+
.fbn-ic-gallery.fbn-ic-has-focus {
|
|
3212
|
+
outline: 2px solid rgba(147, 197, 253, 0.8);
|
|
3213
|
+
outline-offset: -4px;
|
|
3214
|
+
}
|
|
3215
|
+
.fbn-ic-gallery.fbn-ic-suppress-outline:focus {
|
|
3216
|
+
outline: none;
|
|
3217
|
+
}
|
|
3218
|
+
.fbn-ic-gallery.fbn-ic-suppress-outline.fbn-ic-has-focus {
|
|
3219
|
+
outline: 2px solid rgba(99, 102, 241, 0.6);
|
|
3220
|
+
outline-offset: -4px;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
.fbn-ic-nav-btn {
|
|
3224
|
+
position: absolute;
|
|
3225
|
+
top: 50%;
|
|
3226
|
+
transform: translateY(-50%);
|
|
3227
|
+
z-index: 10001;
|
|
3228
|
+
cursor: pointer;
|
|
3229
|
+
border: none;
|
|
3230
|
+
background: none;
|
|
3231
|
+
padding: 0;
|
|
3232
|
+
line-height: 1;
|
|
3233
|
+
}
|
|
3234
|
+
.fbn-ic-nav-btn-prev {
|
|
3235
|
+
left: 12px;
|
|
3236
|
+
}
|
|
3237
|
+
.fbn-ic-nav-btn-next {
|
|
3238
|
+
right: 12px;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3208
3241
|
.fbn-ic-hidden {
|
|
3209
3242
|
display: none !important;
|
|
3210
3243
|
}
|
|
@@ -3218,11 +3251,11 @@ function Qe() {
|
|
|
3218
3251
|
}
|
|
3219
3252
|
class ti {
|
|
3220
3253
|
constructor(t = {}) {
|
|
3221
|
-
this.fullConfig = Qt(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 ne(this.fullConfig.animation), this.layoutEngine = new Oe({
|
|
3254
|
+
this.fullConfig = Qt(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.prevButtonEl = null, this.nextButtonEl = null, this.prevButtonElAutoCreated = !1, this.nextButtonElAutoCreated = !1, this.animationEngine = new ne(this.fullConfig.animation), this.layoutEngine = new Oe({
|
|
3222
3255
|
layout: this.fullConfig.layout,
|
|
3223
3256
|
image: this.fullConfig.image
|
|
3224
|
-
}), this.zoomEngine = new
|
|
3225
|
-
const i = this.fullConfig.animation.entry ||
|
|
3257
|
+
}), this.zoomEngine = new ke(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = it(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
|
|
3258
|
+
const i = this.fullConfig.animation.entry || C.animation.entry;
|
|
3226
3259
|
this.entryAnimationEngine = new ge(
|
|
3227
3260
|
i,
|
|
3228
3261
|
this.fullConfig.layout.algorithm
|
|
@@ -3233,6 +3266,16 @@ class ti {
|
|
|
3233
3266
|
i.timing?.duration ?? 600
|
|
3234
3267
|
) : this.idleAnimationEngine = null, this.zoomEngine.setOnUnfocusCompleteCallback((n) => {
|
|
3235
3268
|
this.idleAnimationEngine?.resumeForImage(n);
|
|
3269
|
+
const a = n;
|
|
3270
|
+
requestAnimationFrame(() => {
|
|
3271
|
+
if (a.matches(":hover") && this.fullConfig.styling?.hover) {
|
|
3272
|
+
const r = this.imageElements.indexOf(a);
|
|
3273
|
+
if (r !== -1) {
|
|
3274
|
+
const s = a.offsetHeight, c = a.cachedRenderedWidth;
|
|
3275
|
+
st(a, this.fullConfig.styling.hover, s, c), et(a, this.hoverClassName), this.hoveredImage = { element: a, layout: this.imageLayouts[r] };
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
});
|
|
3236
3279
|
}), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
3237
3280
|
}
|
|
3238
3281
|
/**
|
|
@@ -3294,7 +3337,7 @@ class ti {
|
|
|
3294
3337
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3295
3338
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
3296
3339
|
onDragEnd: (t) => {
|
|
3297
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
3340
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, qe);
|
|
3298
3341
|
}
|
|
3299
3342
|
})), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3300
3343
|
} catch (t) {
|
|
@@ -3303,7 +3346,11 @@ class ti {
|
|
|
3303
3346
|
}
|
|
3304
3347
|
setupUI() {
|
|
3305
3348
|
const t = this.fullConfig.ui;
|
|
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))
|
|
3349
|
+
t.showFocusOutline ? this.containerEl?.classList.remove("fbn-ic-suppress-outline") : this.containerEl?.classList.add("fbn-ic-suppress-outline"), 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)), t.showNavButtons && (t.prevButtonElement ? (this.prevButtonEl = this.resolveElement(t.prevButtonElement), this.prevButtonElAutoCreated = !1) : (this.prevButtonEl = this.createDefaultPrevButtonElement(), this.prevButtonElAutoCreated = !0), t.nextButtonElement ? (this.nextButtonEl = this.resolveElement(t.nextButtonElement), this.nextButtonElAutoCreated = !1) : (this.nextButtonEl = this.createDefaultNextButtonElement(), this.nextButtonElAutoCreated = !0), this.prevButtonEl?.addEventListener("click", (i) => {
|
|
3350
|
+
i.stopPropagation(), this.navigateToPreviousImage();
|
|
3351
|
+
}), this.nextButtonEl?.addEventListener("click", (i) => {
|
|
3352
|
+
i.stopPropagation(), this.navigateToNextImage();
|
|
3353
|
+
}));
|
|
3307
3354
|
}
|
|
3308
3355
|
resolveElement(t) {
|
|
3309
3356
|
return t instanceof HTMLElement ? t : document.getElementById(t);
|
|
@@ -3324,11 +3371,19 @@ class ti {
|
|
|
3324
3371
|
const t = document.createElement("div");
|
|
3325
3372
|
return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
|
|
3326
3373
|
}
|
|
3374
|
+
createDefaultPrevButtonElement() {
|
|
3375
|
+
const t = document.createElement("button");
|
|
3376
|
+
return t.className = "fbn-ic-nav-btn fbn-ic-nav-btn-prev fbn-ic-hidden", t.textContent = "‹", t.setAttribute("aria-label", "Previous image"), t.setAttribute("tabindex", "-1"), this.containerEl.appendChild(t), t;
|
|
3377
|
+
}
|
|
3378
|
+
createDefaultNextButtonElement() {
|
|
3379
|
+
const t = document.createElement("button");
|
|
3380
|
+
return t.className = "fbn-ic-nav-btn fbn-ic-nav-btn-next fbn-ic-hidden", t.textContent = "›", t.setAttribute("aria-label", "Next image"), t.setAttribute("tabindex", "-1"), this.containerEl.appendChild(t), t;
|
|
3381
|
+
}
|
|
3327
3382
|
setupEventListeners() {
|
|
3328
3383
|
this.fullConfig.interaction.navigation?.keyboard !== !1 && this.containerEl.addEventListener("keydown", (t) => {
|
|
3329
|
-
t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.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());
|
|
3384
|
+
t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter(), this.hideNavButtons(), this.hideFocusIndicator()) : 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());
|
|
3330
3385
|
}), document.addEventListener("click", (t) => {
|
|
3331
|
-
this.swipeEngine?.hadRecentTouch() || t.target.closest(".fbn-ic-image")
|
|
3386
|
+
this.swipeEngine?.hadRecentTouch() || !t.target.closest(".fbn-ic-image") && !t.target.closest(".fbn-ic-nav-btn") && (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter(), this.hideNavButtons(), this.hideFocusIndicator());
|
|
3332
3387
|
}), window.addEventListener("resize", () => this.handleResize());
|
|
3333
3388
|
}
|
|
3334
3389
|
/**
|
|
@@ -3341,7 +3396,7 @@ class ti {
|
|
|
3341
3396
|
);
|
|
3342
3397
|
if (!i) return;
|
|
3343
3398
|
const e = this.imageLayouts[t];
|
|
3344
|
-
e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t));
|
|
3399
|
+
e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t), this.showNavButtons(), this.showFocusIndicator());
|
|
3345
3400
|
}
|
|
3346
3401
|
/**
|
|
3347
3402
|
* Navigate to the previous image (Left arrow)
|
|
@@ -3353,7 +3408,7 @@ class ti {
|
|
|
3353
3408
|
);
|
|
3354
3409
|
if (!i) return;
|
|
3355
3410
|
const e = this.imageLayouts[t];
|
|
3356
|
-
e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t));
|
|
3411
|
+
e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t), this.showNavButtons(), this.showFocusIndicator());
|
|
3357
3412
|
}
|
|
3358
3413
|
/**
|
|
3359
3414
|
* Navigate to a specific image by index
|
|
@@ -3415,18 +3470,18 @@ class ti {
|
|
|
3415
3470
|
const n = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
|
|
3416
3471
|
this.imageLayouts = a, this.displayQueue = [];
|
|
3417
3472
|
let r = 0;
|
|
3418
|
-
const s = (
|
|
3419
|
-
this.containerEl && (this.containerEl.appendChild(
|
|
3420
|
-
if (
|
|
3473
|
+
const s = (l) => {
|
|
3474
|
+
this.containerEl && (this.containerEl.appendChild(l), this.imageElements.push(l), requestAnimationFrame(() => {
|
|
3475
|
+
if (l.offsetWidth, l.style.opacity = this.defaultStyles.opacity ?? "1", l.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || l.dataset.startRotation !== l.dataset.rotation || l.dataset.startScale !== l.dataset.scale)) {
|
|
3421
3476
|
const d = {
|
|
3422
|
-
x: parseFloat(
|
|
3423
|
-
y: parseFloat(
|
|
3477
|
+
x: parseFloat(l.dataset.startX),
|
|
3478
|
+
y: parseFloat(l.dataset.startY)
|
|
3424
3479
|
}, g = {
|
|
3425
|
-
x: parseFloat(
|
|
3426
|
-
y: parseFloat(
|
|
3427
|
-
}, b = parseFloat(
|
|
3480
|
+
x: parseFloat(l.dataset.endX),
|
|
3481
|
+
y: parseFloat(l.dataset.endY)
|
|
3482
|
+
}, b = parseFloat(l.dataset.imageWidth), p = parseFloat(l.dataset.imageHeight), f = parseFloat(l.dataset.rotation), m = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : f, x = l.dataset.startScale ? parseFloat(l.dataset.startScale) : m, v = this.entryAnimationEngine.getTiming();
|
|
3428
3483
|
de({
|
|
3429
|
-
element:
|
|
3484
|
+
element: l,
|
|
3430
3485
|
startPosition: d,
|
|
3431
3486
|
endPosition: g,
|
|
3432
3487
|
pathConfig: this.entryAnimationEngine.getPathConfig(),
|
|
@@ -3438,36 +3493,36 @@ class ti {
|
|
|
3438
3493
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3439
3494
|
startRotation: y,
|
|
3440
3495
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
3441
|
-
startScale:
|
|
3496
|
+
startScale: x
|
|
3442
3497
|
});
|
|
3443
3498
|
} else {
|
|
3444
|
-
const d =
|
|
3445
|
-
|
|
3499
|
+
const d = l.dataset.finalTransform || "";
|
|
3500
|
+
l.style.transform = d;
|
|
3446
3501
|
}
|
|
3447
|
-
const h = parseInt(
|
|
3502
|
+
const h = parseInt(l.dataset.imageId || "0");
|
|
3448
3503
|
if (this.fullConfig.config.debug?.enabled && h < 3) {
|
|
3449
|
-
const d =
|
|
3504
|
+
const d = l.dataset.finalTransform || "";
|
|
3450
3505
|
console.log(`Image ${h} final state:`, {
|
|
3451
|
-
left:
|
|
3452
|
-
top:
|
|
3453
|
-
width:
|
|
3454
|
-
height:
|
|
3455
|
-
computedWidth:
|
|
3456
|
-
computedHeight:
|
|
3506
|
+
left: l.style.left,
|
|
3507
|
+
top: l.style.top,
|
|
3508
|
+
width: l.style.width,
|
|
3509
|
+
height: l.style.height,
|
|
3510
|
+
computedWidth: l.offsetWidth,
|
|
3511
|
+
computedHeight: l.offsetHeight,
|
|
3457
3512
|
transform: d,
|
|
3458
3513
|
pathType: this.entryAnimationEngine.getPathType()
|
|
3459
3514
|
});
|
|
3460
3515
|
}
|
|
3461
3516
|
if (this.idleAnimationEngine) {
|
|
3462
3517
|
const d = this.entryAnimationEngine.getTiming().duration;
|
|
3463
|
-
this.idleAnimationEngine.register(
|
|
3518
|
+
this.idleAnimationEngine.register(l, h, this.imageElements.length, d);
|
|
3464
3519
|
}
|
|
3465
3520
|
}), r++);
|
|
3466
|
-
},
|
|
3521
|
+
}, c = () => {
|
|
3467
3522
|
if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
|
|
3468
3523
|
for (; this.displayQueue.length > 0; ) {
|
|
3469
|
-
const
|
|
3470
|
-
|
|
3524
|
+
const l = this.displayQueue.shift();
|
|
3525
|
+
l && s(l);
|
|
3471
3526
|
}
|
|
3472
3527
|
return;
|
|
3473
3528
|
}
|
|
@@ -3477,39 +3532,39 @@ class ti {
|
|
|
3477
3532
|
return;
|
|
3478
3533
|
}
|
|
3479
3534
|
if (this.displayQueue.length > 0) {
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3535
|
+
const l = this.displayQueue.shift();
|
|
3536
|
+
l && s(l);
|
|
3482
3537
|
}
|
|
3483
3538
|
r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
|
|
3484
3539
|
}, this.fullConfig.animation.queue.interval);
|
|
3485
3540
|
};
|
|
3486
3541
|
if ("IntersectionObserver" in window && this.containerEl) {
|
|
3487
|
-
const
|
|
3542
|
+
const l = new IntersectionObserver((u) => {
|
|
3488
3543
|
u.forEach((h) => {
|
|
3489
|
-
h.isIntersecting && (
|
|
3544
|
+
h.isIntersecting && (c(), l.disconnect());
|
|
3490
3545
|
});
|
|
3491
3546
|
}, { threshold: 0.1, rootMargin: "50px" });
|
|
3492
|
-
|
|
3547
|
+
l.observe(this.containerEl);
|
|
3493
3548
|
} else
|
|
3494
|
-
|
|
3495
|
-
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((
|
|
3549
|
+
c();
|
|
3550
|
+
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), a.forEach((l, u) => {
|
|
3496
3551
|
const h = document.createElement("div");
|
|
3497
3552
|
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";
|
|
3498
|
-
const d =
|
|
3553
|
+
const d = l.x, g = l.y;
|
|
3499
3554
|
h.style.left = `${d - 6}px`, h.style.top = `${g - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(g)})`, this.containerEl.appendChild(h);
|
|
3500
|
-
})), t.forEach((
|
|
3555
|
+
})), t.forEach((l, u) => {
|
|
3501
3556
|
const h = document.createElement("img");
|
|
3502
3557
|
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";
|
|
3503
3558
|
const d = a[u];
|
|
3504
|
-
h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)),
|
|
3559
|
+
h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)), et(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
|
|
3505
3560
|
if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
|
|
3506
3561
|
const g = h.cachedRenderedWidth;
|
|
3507
|
-
|
|
3562
|
+
st(h, this.fullConfig.styling?.hover, i, g), et(h, this.hoverClassName);
|
|
3508
3563
|
}
|
|
3509
3564
|
}), h.addEventListener("mouseleave", () => {
|
|
3510
3565
|
if (this.hoveredImage = null, !this.zoomEngine.isInvolved(h)) {
|
|
3511
3566
|
const g = h.cachedRenderedWidth;
|
|
3512
|
-
|
|
3567
|
+
st(h, this.fullConfig.styling?.default, i, g), pt(h, this.hoverClassName), et(h, this.defaultClassName);
|
|
3513
3568
|
}
|
|
3514
3569
|
}), h.addEventListener("click", (g) => {
|
|
3515
3570
|
g.stopPropagation(), this.handleImageClick(h, d);
|
|
@@ -3517,14 +3572,14 @@ class ti {
|
|
|
3517
3572
|
if (n !== this.loadGeneration)
|
|
3518
3573
|
return;
|
|
3519
3574
|
const g = h.naturalWidth / h.naturalHeight, b = i * g;
|
|
3520
|
-
h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${b}`), h.style.width = `${b}px`, h.cachedRenderedWidth = b, h.aspectRatio = g,
|
|
3575
|
+
h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${b}`), h.style.width = `${b}px`, h.cachedRenderedWidth = b, h.aspectRatio = g, st(h, this.fullConfig.styling?.default, i, b);
|
|
3521
3576
|
const p = { x: d.x, y: d.y }, f = { width: b, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
|
|
3522
3577
|
p,
|
|
3523
3578
|
f,
|
|
3524
3579
|
e,
|
|
3525
3580
|
u,
|
|
3526
3581
|
t.length
|
|
3527
|
-
), y = this.entryAnimationEngine.calculateStartRotation(d.rotation),
|
|
3582
|
+
), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), x = this.entryAnimationEngine.calculateStartScale(d.scale), v = this.entryAnimationEngine.buildFinalTransform(
|
|
3528
3583
|
d.rotation,
|
|
3529
3584
|
d.scale,
|
|
3530
3585
|
b,
|
|
@@ -3537,7 +3592,7 @@ class ti {
|
|
|
3537
3592
|
b,
|
|
3538
3593
|
i,
|
|
3539
3594
|
y,
|
|
3540
|
-
|
|
3595
|
+
x
|
|
3541
3596
|
);
|
|
3542
3597
|
this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
|
|
3543
3598
|
finalPosition: p,
|
|
@@ -3547,8 +3602,8 @@ class ti {
|
|
|
3547
3602
|
finalTransform: v,
|
|
3548
3603
|
renderedWidth: b,
|
|
3549
3604
|
renderedHeight: i
|
|
3550
|
-
}), h.style.transform = S, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation ||
|
|
3551
|
-
}, h.onerror = () => r++, h.src =
|
|
3605
|
+
}), h.style.transform = S, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || x !== 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(b), h.dataset.imageHeight = String(i), h.dataset.rotation = String(d.rotation), h.dataset.scale = String(d.scale), h.dataset.startRotation = String(y), h.dataset.startScale = String(x)), this.displayQueue.push(h);
|
|
3606
|
+
}, h.onerror = () => r++, h.src = l;
|
|
3552
3607
|
});
|
|
3553
3608
|
}
|
|
3554
3609
|
async handleImageClick(t, i) {
|
|
@@ -3558,18 +3613,18 @@ class ti {
|
|
|
3558
3613
|
height: this.containerEl.offsetHeight
|
|
3559
3614
|
};
|
|
3560
3615
|
if (e)
|
|
3561
|
-
await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter();
|
|
3616
|
+
await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter(), this.hideNavButtons(), this.hideFocusIndicator();
|
|
3562
3617
|
else {
|
|
3563
3618
|
this.idleAnimationEngine?.pauseForImage(t);
|
|
3564
3619
|
const a = t.dataset.imageId;
|
|
3565
|
-
this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, n, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
|
|
3620
|
+
this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, this.swipeEngine?.enable(), this.containerEl?.focus({ preventScroll: !0 }), await this.zoomEngine.focusImage(t, n, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex), this.showNavButtons(), this.showFocusIndicator();
|
|
3566
3621
|
}
|
|
3567
3622
|
}
|
|
3568
3623
|
/**
|
|
3569
3624
|
* Clear the image cloud and reset state
|
|
3570
3625
|
*/
|
|
3571
3626
|
clearImageCloud() {
|
|
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;
|
|
3627
|
+
this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null), this.loadGeneration++, this.displayQueue = [], this.hideFocusIndicator(), 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;
|
|
3573
3628
|
}
|
|
3574
3629
|
showLoading(t) {
|
|
3575
3630
|
!this.fullConfig.ui.showLoadingSpinner || !this.loadingEl || (t ? this.loadingEl.classList.remove("fbn-ic-hidden") : this.loadingEl.classList.add("fbn-ic-hidden"));
|
|
@@ -3586,11 +3641,23 @@ class ti {
|
|
|
3586
3641
|
hideCounter() {
|
|
3587
3642
|
this.counterEl && this.counterEl.classList.add("fbn-ic-hidden");
|
|
3588
3643
|
}
|
|
3644
|
+
showFocusIndicator() {
|
|
3645
|
+
this.containerEl?.classList.add("fbn-ic-has-focus");
|
|
3646
|
+
}
|
|
3647
|
+
hideFocusIndicator() {
|
|
3648
|
+
this.containerEl?.classList.remove("fbn-ic-has-focus");
|
|
3649
|
+
}
|
|
3650
|
+
showNavButtons() {
|
|
3651
|
+
this.prevButtonEl?.classList.remove("fbn-ic-hidden"), this.nextButtonEl?.classList.remove("fbn-ic-hidden");
|
|
3652
|
+
}
|
|
3653
|
+
hideNavButtons() {
|
|
3654
|
+
this.prevButtonEl?.classList.add("fbn-ic-hidden"), this.nextButtonEl?.classList.add("fbn-ic-hidden");
|
|
3655
|
+
}
|
|
3589
3656
|
/**
|
|
3590
3657
|
* Destroy the gallery and clean up resources
|
|
3591
3658
|
*/
|
|
3592
3659
|
destroy() {
|
|
3593
|
-
this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy(), this.idleAnimationEngine?.stopAll(), this.idleAnimationEngine = null;
|
|
3660
|
+
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.prevButtonElAutoCreated && this.prevButtonEl && (this.prevButtonEl.remove(), this.prevButtonEl = null), this.nextButtonElAutoCreated && this.nextButtonEl && (this.nextButtonEl.remove(), this.nextButtonEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy(), this.idleAnimationEngine?.stopAll(), this.idleAnimationEngine = null;
|
|
3594
3661
|
}
|
|
3595
3662
|
}
|
|
3596
3663
|
function ei() {
|