@frybynite/image-cloud 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-cloud-auto-init.js +361 -311
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +692 -642
- 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 +23 -19
- package/dist/react.d.ts +23 -19
- package/dist/react.js +698 -648
- package/dist/react.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vue.d.ts +23 -19
- package/dist/vue.js +676 -626
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +23 -19
- package/dist/web-component.js +675 -625
- 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
|
}),
|
|
@@ -178,25 +178,15 @@ const Ut = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
|
|
|
178
178
|
}),
|
|
179
179
|
dragging: !0
|
|
180
180
|
}),
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// STUB: Not implemented yet
|
|
188
|
-
desktop: void 0
|
|
189
|
-
// STUB: Not implemented yet
|
|
190
|
-
}),
|
|
191
|
-
mobileDetection: () => typeof window > "u" ? !1 : window.innerWidth <= 768
|
|
192
|
-
}),
|
|
193
|
-
ui: Object.freeze({
|
|
194
|
-
showLoadingSpinner: !1,
|
|
195
|
-
showImageCounter: !1
|
|
196
|
-
})
|
|
181
|
+
// UI configuration
|
|
182
|
+
ui: Object.freeze({
|
|
183
|
+
showLoadingSpinner: !1,
|
|
184
|
+
showImageCounter: !1,
|
|
185
|
+
showNavButtons: !1,
|
|
186
|
+
showFocusOutline: !1
|
|
197
187
|
}),
|
|
198
188
|
// Image styling
|
|
199
|
-
styling:
|
|
189
|
+
styling: Ft
|
|
200
190
|
});
|
|
201
191
|
function Z(o, t) {
|
|
202
192
|
if (!o) return t || {};
|
|
@@ -284,76 +274,71 @@ function Qt(o = {}) {
|
|
|
284
274
|
}, s = {
|
|
285
275
|
loaders: n,
|
|
286
276
|
config: r,
|
|
287
|
-
image: Vt(
|
|
288
|
-
layout: { ...
|
|
289
|
-
animation: { ...
|
|
290
|
-
interaction: { ...
|
|
291
|
-
|
|
292
|
-
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)
|
|
293
283
|
};
|
|
294
|
-
|
|
295
|
-
...
|
|
284
|
+
o.layout && (s.layout = {
|
|
285
|
+
...C.layout,
|
|
296
286
|
...o.layout
|
|
297
287
|
}, o.layout.responsive && (s.layout.responsive = {
|
|
298
|
-
...
|
|
299
|
-
mobile: o.layout.responsive.mobile ? { ...
|
|
300
|
-
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
|
|
301
291
|
}), o.layout.spacing && (s.layout.spacing = {
|
|
302
|
-
...
|
|
292
|
+
...C.layout.spacing,
|
|
303
293
|
...o.layout.spacing
|
|
304
294
|
})), o.animation && (s.animation = {
|
|
305
|
-
...
|
|
295
|
+
...C.animation,
|
|
306
296
|
...o.animation
|
|
307
297
|
}, o.animation.easing && (s.animation.easing = {
|
|
308
|
-
...
|
|
298
|
+
...C.animation.easing,
|
|
309
299
|
...o.animation.easing
|
|
310
300
|
}), o.animation.queue && (s.animation.queue = {
|
|
311
|
-
...
|
|
301
|
+
...C.animation.queue,
|
|
312
302
|
...o.animation.queue
|
|
313
303
|
}), o.animation.entry && (s.animation.entry = {
|
|
314
|
-
...
|
|
304
|
+
...C.animation.entry,
|
|
315
305
|
...o.animation.entry,
|
|
316
306
|
start: o.animation.entry.start ? {
|
|
317
|
-
...
|
|
307
|
+
...C.animation.entry.start,
|
|
318
308
|
...o.animation.entry.start,
|
|
319
|
-
circular: o.animation.entry.start.circular ? { ...
|
|
320
|
-
} :
|
|
321
|
-
timing: o.animation.entry.timing ? { ...
|
|
322
|
-
path: o.animation.entry.path ? { ...yt, ...o.animation.entry.path } :
|
|
323
|
-
rotation: o.animation.entry.rotation ? { ...vt, ...o.animation.entry.rotation } :
|
|
324
|
-
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
|
|
325
315
|
}), o.animation.idle && (s.animation.idle = {
|
|
326
316
|
...Dt,
|
|
327
317
|
...o.animation.idle
|
|
328
318
|
})), o.interaction && (s.interaction = {
|
|
329
|
-
...
|
|
319
|
+
...C.interaction,
|
|
330
320
|
...o.interaction
|
|
331
321
|
}, o.interaction.focus && (s.interaction.focus = {
|
|
332
|
-
...
|
|
322
|
+
...C.interaction.focus,
|
|
333
323
|
...o.interaction.focus
|
|
334
324
|
}), o.interaction.navigation && (s.interaction.navigation = {
|
|
335
|
-
...
|
|
325
|
+
...C.interaction.navigation,
|
|
336
326
|
...o.interaction.navigation
|
|
337
|
-
}))
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
...
|
|
342
|
-
...o.
|
|
343
|
-
|
|
344
|
-
mobileDetection: o.rendering.responsive.mobileDetection ? o.rendering.responsive.mobileDetection : E.rendering.responsive.mobileDetection
|
|
345
|
-
}), o.rendering.ui && (s.rendering.ui = {
|
|
346
|
-
...E.rendering.ui,
|
|
347
|
-
...o.rendering.ui
|
|
348
|
-
})), s.config.debug = {
|
|
327
|
+
}));
|
|
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,
|
|
332
|
+
...o.ui
|
|
333
|
+
}, s.config.debug = {
|
|
349
334
|
...Ot,
|
|
350
335
|
...o.config?.debug ?? {}
|
|
351
336
|
}, s.layout.algorithm === "honeycomb" && s.styling) {
|
|
352
|
-
const
|
|
337
|
+
const l = { shape: "hexagon", mode: "height-relative" };
|
|
353
338
|
s.styling = {
|
|
354
339
|
...s.styling,
|
|
355
|
-
default: { ...s.styling.default, clipPath:
|
|
356
|
-
hover: { ...s.styling.hover, clipPath:
|
|
340
|
+
default: { ...s.styling.default, clipPath: l },
|
|
341
|
+
hover: { ...s.styling.hover, clipPath: l }
|
|
357
342
|
// focused: untouched — user config respected
|
|
358
343
|
};
|
|
359
344
|
}
|
|
@@ -363,10 +348,10 @@ function te(o, t) {
|
|
|
363
348
|
return { ...o ? It[o] : It.playful, ...t };
|
|
364
349
|
}
|
|
365
350
|
function ee(o, t) {
|
|
366
|
-
return { ...o ?
|
|
351
|
+
return { ...o ? Ct[o] : Ct.gentle, ...t };
|
|
367
352
|
}
|
|
368
353
|
function ie(o, t) {
|
|
369
|
-
return { ...o ?
|
|
354
|
+
return { ...o ? At[o] : At.gentle, ...t };
|
|
370
355
|
}
|
|
371
356
|
class ne {
|
|
372
357
|
constructor(t) {
|
|
@@ -537,14 +522,14 @@ function oe(o, t, i, e) {
|
|
|
537
522
|
}
|
|
538
523
|
const p = (o - h) / (d - h);
|
|
539
524
|
if (b)
|
|
540
|
-
u = 1 + g *
|
|
525
|
+
u = 1 + g * at(p);
|
|
541
526
|
else if (h === 0)
|
|
542
|
-
u =
|
|
527
|
+
u = at(p);
|
|
543
528
|
else {
|
|
544
529
|
const m = 1 + (l.find(
|
|
545
|
-
(y,
|
|
530
|
+
(y, x) => y.time > h && x > 0 && l[x - 1].isOvershoot
|
|
546
531
|
)?.overshoot || g);
|
|
547
|
-
u = V(m, 1,
|
|
532
|
+
u = V(m, 1, at(p));
|
|
548
533
|
}
|
|
549
534
|
return {
|
|
550
535
|
x: t.x + s * u,
|
|
@@ -581,7 +566,7 @@ function re(o, t, i, e) {
|
|
|
581
566
|
y: V(t.y, i.y, m) + f * g
|
|
582
567
|
};
|
|
583
568
|
}
|
|
584
|
-
function
|
|
569
|
+
function at(o) {
|
|
585
570
|
return 1 - (1 - o) * (1 - o);
|
|
586
571
|
}
|
|
587
572
|
function ce(o) {
|
|
@@ -605,7 +590,7 @@ function he(o, t, i) {
|
|
|
605
590
|
let h = 1;
|
|
606
591
|
for (let d = 0; d < a.length; d++)
|
|
607
592
|
if (o <= a[d].time) {
|
|
608
|
-
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);
|
|
609
594
|
h = b + (a[d].scale - b) * f;
|
|
610
595
|
break;
|
|
611
596
|
}
|
|
@@ -627,51 +612,51 @@ function de(o) {
|
|
|
627
612
|
startRotation: d,
|
|
628
613
|
scaleConfig: g,
|
|
629
614
|
startScale: b
|
|
630
|
-
} = o, p = n.type, f = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 },
|
|
631
|
-
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)) {
|
|
632
617
|
u && u();
|
|
633
618
|
return;
|
|
634
619
|
}
|
|
635
620
|
const z = performance.now(), L = -r / 2, _ = -s / 2;
|
|
636
621
|
function O(H) {
|
|
637
|
-
const
|
|
622
|
+
const N = H - z, A = Math.min(N / a, 1);
|
|
638
623
|
let D;
|
|
639
624
|
switch (p) {
|
|
640
625
|
case "bounce": {
|
|
641
|
-
const
|
|
626
|
+
const k = te(
|
|
642
627
|
n.bouncePreset,
|
|
643
628
|
n.bounce
|
|
644
629
|
);
|
|
645
|
-
D = oe(
|
|
630
|
+
D = oe(A, i, e, k);
|
|
646
631
|
break;
|
|
647
632
|
}
|
|
648
633
|
case "elastic": {
|
|
649
|
-
const
|
|
634
|
+
const k = ee(
|
|
650
635
|
n.elasticPreset,
|
|
651
636
|
n.elastic
|
|
652
637
|
);
|
|
653
|
-
D = ae(
|
|
638
|
+
D = ae(A, i, e, k);
|
|
654
639
|
break;
|
|
655
640
|
}
|
|
656
641
|
case "wave": {
|
|
657
|
-
const
|
|
642
|
+
const k = ie(
|
|
658
643
|
n.wavePreset,
|
|
659
644
|
n.wave
|
|
660
645
|
);
|
|
661
|
-
D = re(
|
|
646
|
+
D = re(A, i, e, k);
|
|
662
647
|
break;
|
|
663
648
|
}
|
|
664
649
|
default:
|
|
665
650
|
D = {
|
|
666
|
-
x: V(i.x, e.x,
|
|
667
|
-
y: V(i.y, e.y,
|
|
651
|
+
x: V(i.x, e.x, A),
|
|
652
|
+
y: V(i.y, e.y, A)
|
|
668
653
|
};
|
|
669
654
|
}
|
|
670
|
-
const
|
|
671
|
-
let
|
|
672
|
-
m ?
|
|
673
|
-
let
|
|
674
|
-
|
|
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());
|
|
675
660
|
}
|
|
676
661
|
requestAnimationFrame(O);
|
|
677
662
|
}
|
|
@@ -689,7 +674,7 @@ const fe = {
|
|
|
689
674
|
};
|
|
690
675
|
class ge {
|
|
691
676
|
constructor(t, i) {
|
|
692
|
-
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;
|
|
693
678
|
}
|
|
694
679
|
/**
|
|
695
680
|
* Get the effective start position, considering layout-aware defaults
|
|
@@ -1116,7 +1101,7 @@ class me {
|
|
|
1116
1101
|
}
|
|
1117
1102
|
}
|
|
1118
1103
|
_startWiggle(t) {
|
|
1119
|
-
const i = { ...
|
|
1104
|
+
const i = { ...Gt, ...this.config.wiggle }, e = [
|
|
1120
1105
|
{ transform: "rotate(0deg)", offset: 0 },
|
|
1121
1106
|
{ transform: `rotate(${i.maxAngle}deg)`, offset: 0.25 },
|
|
1122
1107
|
{ transform: "rotate(0deg)", offset: 0.5 },
|
|
@@ -1136,7 +1121,7 @@ class me {
|
|
|
1136
1121
|
});
|
|
1137
1122
|
}
|
|
1138
1123
|
_startPulse(t) {
|
|
1139
|
-
const i = { ...
|
|
1124
|
+
const i = { ...qt, ...this.config.pulse }, e = [
|
|
1140
1125
|
{ transform: "scale(1)", offset: 0 },
|
|
1141
1126
|
{ transform: `scale(${i.maxScale})`, offset: 0.25 },
|
|
1142
1127
|
{ transform: "scale(1)", offset: 0.5 },
|
|
@@ -1229,11 +1214,11 @@ class pe {
|
|
|
1229
1214
|
* @returns Array of layout objects with position, rotation, scale
|
|
1230
1215
|
*/
|
|
1231
1216
|
generate(t, i, e = {}) {
|
|
1232
|
-
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,
|
|
1233
|
-
for (let
|
|
1234
|
-
const
|
|
1235
|
-
id:
|
|
1236
|
-
x:
|
|
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,
|
|
1221
|
+
x: I,
|
|
1237
1222
|
y: z,
|
|
1238
1223
|
rotation: L,
|
|
1239
1224
|
scale: _,
|
|
@@ -1268,7 +1253,7 @@ class be {
|
|
|
1268
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 = {
|
|
1269
1254
|
...Ht,
|
|
1270
1255
|
...this.config.radial
|
|
1271
|
-
}, 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(
|
|
1272
1257
|
m - v - f / 2,
|
|
1273
1258
|
y - v - f / 2
|
|
1274
1259
|
));
|
|
@@ -1286,32 +1271,32 @@ class be {
|
|
|
1286
1271
|
// Center image is highest
|
|
1287
1272
|
});
|
|
1288
1273
|
}
|
|
1289
|
-
let
|
|
1290
|
-
for (;
|
|
1291
|
-
const z =
|
|
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));
|
|
1292
1277
|
if (D === 0) {
|
|
1293
|
-
|
|
1278
|
+
I++;
|
|
1294
1279
|
continue;
|
|
1295
1280
|
}
|
|
1296
|
-
const
|
|
1297
|
-
for (let
|
|
1298
|
-
const
|
|
1299
|
-
let $ = m + Math.cos(
|
|
1300
|
-
const P =
|
|
1301
|
-
$ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P),
|
|
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);
|
|
1302
1287
|
const Y = c === "random" ? this.random(l, u) : 0;
|
|
1303
1288
|
n.push({
|
|
1304
|
-
id:
|
|
1289
|
+
id: w,
|
|
1305
1290
|
x: $,
|
|
1306
|
-
y:
|
|
1291
|
+
y: M,
|
|
1307
1292
|
rotation: Y,
|
|
1308
|
-
scale:
|
|
1309
|
-
baseSize:
|
|
1310
|
-
zIndex: Math.max(1, 100 -
|
|
1293
|
+
scale: q,
|
|
1294
|
+
baseSize: T,
|
|
1295
|
+
zIndex: Math.max(1, 100 - I)
|
|
1311
1296
|
// Outer rings have lower z-index
|
|
1312
|
-
}),
|
|
1297
|
+
}), w++;
|
|
1313
1298
|
}
|
|
1314
|
-
|
|
1299
|
+
I++;
|
|
1315
1300
|
}
|
|
1316
1301
|
return n;
|
|
1317
1302
|
}
|
|
@@ -1344,7 +1329,7 @@ const ye = {
|
|
|
1344
1329
|
alignment: "center",
|
|
1345
1330
|
gap: 10,
|
|
1346
1331
|
overflowOffset: 0.25
|
|
1347
|
-
},
|
|
1332
|
+
}, Rt = [
|
|
1348
1333
|
{ x: 1, y: 1 },
|
|
1349
1334
|
// bottom-right
|
|
1350
1335
|
{ x: -1, y: -1 },
|
|
@@ -1380,59 +1365,59 @@ class ve {
|
|
|
1380
1365
|
p,
|
|
1381
1366
|
l,
|
|
1382
1367
|
s
|
|
1383
|
-
), 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;
|
|
1384
1369
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1385
1370
|
gridConfigColumns: s.columns,
|
|
1386
1371
|
gridConfigRows: s.rows,
|
|
1387
1372
|
columns: f,
|
|
1388
1373
|
rows: m,
|
|
1389
1374
|
cellCount: U,
|
|
1390
|
-
hasFixedGrid:
|
|
1375
|
+
hasFixedGrid: F,
|
|
1391
1376
|
imageCount: t,
|
|
1392
|
-
isOverflowMode:
|
|
1377
|
+
isOverflowMode: R
|
|
1393
1378
|
});
|
|
1394
|
-
const
|
|
1395
|
-
for (let
|
|
1396
|
-
let $,
|
|
1397
|
-
if (
|
|
1398
|
-
const
|
|
1399
|
-
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));
|
|
1400
1385
|
} else
|
|
1401
|
-
s.fillDirection === "row" ? ($ =
|
|
1402
|
-
let P = D + $ * (
|
|
1403
|
-
if (s.stagger === "row" &&
|
|
1404
|
-
const
|
|
1405
|
-
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;
|
|
1406
1391
|
}
|
|
1407
1392
|
if (s.jitter > 0) {
|
|
1408
|
-
const
|
|
1409
|
-
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);
|
|
1410
1395
|
}
|
|
1411
|
-
let Y = P, J =
|
|
1412
|
-
if (!
|
|
1413
|
-
const
|
|
1414
|
-
if (
|
|
1415
|
-
const St =
|
|
1416
|
-
let
|
|
1417
|
-
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;
|
|
1418
1403
|
}
|
|
1419
1404
|
}
|
|
1420
|
-
const
|
|
1421
|
-
Y = Math.max(
|
|
1422
|
-
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;
|
|
1423
1408
|
if (u === "random") {
|
|
1424
|
-
const
|
|
1425
|
-
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);
|
|
1426
1411
|
}
|
|
1427
|
-
let
|
|
1428
|
-
|
|
1429
|
-
id:
|
|
1412
|
+
let ft;
|
|
1413
|
+
R && X > 0 ? ft = 50 - X : ft = R ? 100 + T : T + 1, n.push({
|
|
1414
|
+
id: T,
|
|
1430
1415
|
x: Y,
|
|
1431
1416
|
y: J,
|
|
1432
|
-
rotation:
|
|
1433
|
-
scale:
|
|
1417
|
+
rotation: ut,
|
|
1418
|
+
scale: ct,
|
|
1434
1419
|
baseSize: K,
|
|
1435
|
-
zIndex:
|
|
1420
|
+
zIndex: ft
|
|
1436
1421
|
});
|
|
1437
1422
|
}
|
|
1438
1423
|
return n;
|
|
@@ -1462,7 +1447,7 @@ class ve {
|
|
|
1462
1447
|
return Math.random() * (i - t) + t;
|
|
1463
1448
|
}
|
|
1464
1449
|
}
|
|
1465
|
-
const
|
|
1450
|
+
const xe = Math.PI * (3 - Math.sqrt(5)), we = {
|
|
1466
1451
|
spiralType: "golden",
|
|
1467
1452
|
direction: "counterclockwise",
|
|
1468
1453
|
tightness: 1,
|
|
@@ -1481,35 +1466,35 @@ class Ee {
|
|
|
1481
1466
|
* @returns Array of layout objects with position, rotation, scale
|
|
1482
1467
|
*/
|
|
1483
1468
|
generate(t, i, e = {}) {
|
|
1484
|
-
const n = [], { width: a, height: r } = i, s = { ...
|
|
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(
|
|
1485
1470
|
m - c - l / 2,
|
|
1486
1471
|
y - c - l / 2
|
|
1487
1472
|
), v = s.direction === "clockwise" ? -1 : 1;
|
|
1488
|
-
for (let
|
|
1489
|
-
let
|
|
1473
|
+
for (let S = 0; S < t; S++) {
|
|
1474
|
+
let w, I;
|
|
1490
1475
|
if (s.spiralType === "golden")
|
|
1491
|
-
|
|
1476
|
+
w = S * xe * v + s.startAngle, I = this.calculateGoldenRadius(S, t, x, s.tightness);
|
|
1492
1477
|
else if (s.spiralType === "archimedean") {
|
|
1493
|
-
const P =
|
|
1494
|
-
|
|
1478
|
+
const P = S * 0.5 * s.tightness;
|
|
1479
|
+
w = P * v + s.startAngle, I = this.calculateArchimedeanRadius(P, t, x, s.tightness);
|
|
1495
1480
|
} else {
|
|
1496
|
-
const P =
|
|
1497
|
-
|
|
1481
|
+
const P = S * 0.3 * s.tightness;
|
|
1482
|
+
w = P * v + s.startAngle, I = this.calculateLogarithmicRadius(P, t, x, s.tightness);
|
|
1498
1483
|
}
|
|
1499
|
-
const z = m + Math.cos(
|
|
1500
|
-
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;
|
|
1501
1486
|
if (u === "random") {
|
|
1502
|
-
const P =
|
|
1503
|
-
|
|
1504
|
-
} else u === "tangent" && (
|
|
1505
|
-
const X = t -
|
|
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));
|
|
1490
|
+
const X = t - S;
|
|
1506
1491
|
n.push({
|
|
1507
|
-
id:
|
|
1508
|
-
x:
|
|
1492
|
+
id: S,
|
|
1493
|
+
x: T,
|
|
1509
1494
|
y: $,
|
|
1510
|
-
rotation:
|
|
1511
|
-
scale:
|
|
1512
|
-
baseSize:
|
|
1495
|
+
rotation: M,
|
|
1496
|
+
scale: N,
|
|
1497
|
+
baseSize: A,
|
|
1513
1498
|
zIndex: X
|
|
1514
1499
|
});
|
|
1515
1500
|
}
|
|
@@ -1598,33 +1583,33 @@ class Ie {
|
|
|
1598
1583
|
), y = new Array(f).fill(0);
|
|
1599
1584
|
for (let v = 0; v < t; v++)
|
|
1600
1585
|
y[v % f]++;
|
|
1601
|
-
let
|
|
1586
|
+
let x = 0;
|
|
1602
1587
|
for (let v = 0; v < f; v++) {
|
|
1603
|
-
const
|
|
1604
|
-
for (let
|
|
1588
|
+
const S = m[v], w = y[v];
|
|
1589
|
+
for (let I = 0; I < w; I++) {
|
|
1605
1590
|
let z, L;
|
|
1606
1591
|
if (s.distribution === "gaussian")
|
|
1607
|
-
z = this.gaussianRandom() *
|
|
1592
|
+
z = this.gaussianRandom() * S.spread, L = this.gaussianRandom() * S.spread;
|
|
1608
1593
|
else {
|
|
1609
|
-
const
|
|
1610
|
-
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;
|
|
1611
1596
|
}
|
|
1612
1597
|
const _ = 1 + s.overlap * 0.5, O = 1 + s.overlap * 0.3;
|
|
1613
1598
|
z /= _, L /= _;
|
|
1614
|
-
const H = p ? this.random(g, b) : 1,
|
|
1615
|
-
let D =
|
|
1616
|
-
const
|
|
1617
|
-
D = Math.max(c +
|
|
1618
|
-
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;
|
|
1619
1604
|
n.push({
|
|
1620
|
-
id:
|
|
1605
|
+
id: x,
|
|
1621
1606
|
x: D,
|
|
1622
|
-
y:
|
|
1623
|
-
rotation:
|
|
1624
|
-
scale:
|
|
1625
|
-
baseSize:
|
|
1607
|
+
y: W,
|
|
1608
|
+
rotation: k,
|
|
1609
|
+
scale: N,
|
|
1610
|
+
baseSize: A,
|
|
1626
1611
|
zIndex: $
|
|
1627
|
-
}),
|
|
1612
|
+
}), x++;
|
|
1628
1613
|
}
|
|
1629
1614
|
}
|
|
1630
1615
|
return n;
|
|
@@ -1655,8 +1640,8 @@ class Ie {
|
|
|
1655
1640
|
};
|
|
1656
1641
|
let m = 1 / 0;
|
|
1657
1642
|
for (const y of r) {
|
|
1658
|
-
const
|
|
1659
|
-
m = Math.min(m,
|
|
1643
|
+
const x = f.x - y.x, v = f.y - y.y, S = Math.sqrt(x * x + v * v);
|
|
1644
|
+
m = Math.min(m, S);
|
|
1660
1645
|
}
|
|
1661
1646
|
if ((r.length === 0 || m > b) && (g = f, b = m), m >= a.clusterSpacing)
|
|
1662
1647
|
break;
|
|
@@ -1689,7 +1674,7 @@ class Ie {
|
|
|
1689
1674
|
return Math.random() * (i - t) + t;
|
|
1690
1675
|
}
|
|
1691
1676
|
}
|
|
1692
|
-
class
|
|
1677
|
+
class Ce {
|
|
1693
1678
|
constructor(t, i = {}) {
|
|
1694
1679
|
this.config = t, this.imageConfig = i;
|
|
1695
1680
|
}
|
|
@@ -1702,28 +1687,28 @@ class Re {
|
|
|
1702
1687
|
*/
|
|
1703
1688
|
generate(t, i, e = {}) {
|
|
1704
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 = {
|
|
1705
|
-
...
|
|
1690
|
+
...Nt,
|
|
1706
1691
|
...this.config.wave
|
|
1707
|
-
}, { rows: m, amplitude: y, frequency:
|
|
1708
|
-
let
|
|
1709
|
-
for (let
|
|
1710
|
-
const
|
|
1711
|
-
let
|
|
1712
|
-
|
|
1713
|
-
for (let
|
|
1714
|
-
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;
|
|
1715
1700
|
let J = 0;
|
|
1716
|
-
l === "tangent" ? J = this.calculateRotation($, a, y,
|
|
1717
|
-
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;
|
|
1718
1703
|
n.push({
|
|
1719
|
-
id:
|
|
1720
|
-
x: Math.max(
|
|
1721
|
-
y: Math.max(
|
|
1704
|
+
id: F,
|
|
1705
|
+
x: Math.max(nt, Math.min(X, ot)),
|
|
1706
|
+
y: Math.max(ht, Math.min(P, dt)),
|
|
1722
1707
|
rotation: J,
|
|
1723
|
-
scale:
|
|
1708
|
+
scale: B,
|
|
1724
1709
|
baseSize: Y,
|
|
1725
|
-
zIndex:
|
|
1726
|
-
}),
|
|
1710
|
+
zIndex: F + 1
|
|
1711
|
+
}), F++;
|
|
1727
1712
|
}
|
|
1728
1713
|
}
|
|
1729
1714
|
return n;
|
|
@@ -1766,7 +1751,7 @@ class Re {
|
|
|
1766
1751
|
return Math.random() * (i - t) + t;
|
|
1767
1752
|
}
|
|
1768
1753
|
}
|
|
1769
|
-
const
|
|
1754
|
+
const wt = 100, Q = 100 / Math.sqrt(3), Et = [
|
|
1770
1755
|
[Q / 2, 0],
|
|
1771
1756
|
// upper-left
|
|
1772
1757
|
[3 * Q / 2, 0],
|
|
@@ -1779,21 +1764,21 @@ const xt = 100, Q = 100 / Math.sqrt(3), Et = [
|
|
|
1779
1764
|
// lower-left
|
|
1780
1765
|
[0, 50]
|
|
1781
1766
|
// left
|
|
1782
|
-
],
|
|
1783
|
-
function
|
|
1767
|
+
], Ae = Et[1][0] / wt, Re = Et[2][1] / wt;
|
|
1768
|
+
function Te(o) {
|
|
1784
1769
|
return {
|
|
1785
|
-
colStep:
|
|
1786
|
-
rowOffset:
|
|
1770
|
+
colStep: Ae * o,
|
|
1771
|
+
rowOffset: Re * o
|
|
1787
1772
|
};
|
|
1788
1773
|
}
|
|
1789
1774
|
function Le(o, t, i, e, n, a) {
|
|
1790
|
-
const { colStep: r } =
|
|
1775
|
+
const { colStep: r } = Te(a);
|
|
1791
1776
|
return {
|
|
1792
1777
|
px: e + r * o,
|
|
1793
1778
|
py: n + a * (t + o / 2)
|
|
1794
1779
|
};
|
|
1795
1780
|
}
|
|
1796
|
-
const
|
|
1781
|
+
const Fe = [
|
|
1797
1782
|
[1, 0, -1],
|
|
1798
1783
|
[0, 1, -1],
|
|
1799
1784
|
[-1, 1, 0],
|
|
@@ -1801,11 +1786,11 @@ const Me = [
|
|
|
1801
1786
|
[0, -1, 1],
|
|
1802
1787
|
[1, -1, 0]
|
|
1803
1788
|
];
|
|
1804
|
-
function
|
|
1789
|
+
function Me(o) {
|
|
1805
1790
|
if (o === 0) return [[0, 0, 0]];
|
|
1806
1791
|
const t = [];
|
|
1807
1792
|
let [i, e, n] = [0, -o, o];
|
|
1808
|
-
for (const [a, r, s] of
|
|
1793
|
+
for (const [a, r, s] of Fe)
|
|
1809
1794
|
for (let c = 0; c < o; c++)
|
|
1810
1795
|
t.push([i, e, n]), i += a, e += r, n += s;
|
|
1811
1796
|
return t;
|
|
@@ -1818,18 +1803,18 @@ class ze {
|
|
|
1818
1803
|
}
|
|
1819
1804
|
generate(t, i, e = {}) {
|
|
1820
1805
|
const n = [], { width: a, height: r } = i, s = a / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
|
|
1821
|
-
...
|
|
1806
|
+
...kt,
|
|
1822
1807
|
...this.config.honeycomb
|
|
1823
1808
|
}.spacing ?? 0, d = l + h;
|
|
1824
1809
|
let g = 0, b = 0;
|
|
1825
1810
|
for (; g < t; ) {
|
|
1826
|
-
const p =
|
|
1811
|
+
const p = Me(b);
|
|
1827
1812
|
for (const [f, m, y] of p) {
|
|
1828
1813
|
if (g >= t) break;
|
|
1829
|
-
const { px:
|
|
1814
|
+
const { px: x, py: v } = Le(f, m, y, s, c, d);
|
|
1830
1815
|
n.push({
|
|
1831
1816
|
id: g,
|
|
1832
|
-
x
|
|
1817
|
+
x,
|
|
1833
1818
|
y: v,
|
|
1834
1819
|
rotation: 0,
|
|
1835
1820
|
scale: 1,
|
|
@@ -1862,7 +1847,7 @@ class Oe {
|
|
|
1862
1847
|
case "cluster":
|
|
1863
1848
|
return new Ie(this.config, this.imageConfig);
|
|
1864
1849
|
case "wave":
|
|
1865
|
-
return new
|
|
1850
|
+
return new Ce(this.config, this.imageConfig);
|
|
1866
1851
|
case "honeycomb":
|
|
1867
1852
|
return new ze(this.config, this.imageConfig);
|
|
1868
1853
|
default:
|
|
@@ -1953,8 +1938,8 @@ class Oe {
|
|
|
1953
1938
|
m *= u, m = Math.min(m, e);
|
|
1954
1939
|
let y = this.clamp(m, s, c);
|
|
1955
1940
|
if (y === s && m < s) {
|
|
1956
|
-
const
|
|
1957
|
-
y = Math.max(
|
|
1941
|
+
const x = Math.max(s * 0.05, 20);
|
|
1942
|
+
y = Math.max(x, m);
|
|
1958
1943
|
}
|
|
1959
1944
|
return this.config.algorithm === "honeycomb" && (y = Math.min(y, this.honeycombMaxImageHeight(i, t))), { height: y };
|
|
1960
1945
|
}
|
|
@@ -1978,8 +1963,8 @@ class Oe {
|
|
|
1978
1963
|
return Math.max(i, Math.min(e, t));
|
|
1979
1964
|
}
|
|
1980
1965
|
}
|
|
1981
|
-
var
|
|
1982
|
-
const
|
|
1966
|
+
var E = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(E || {});
|
|
1967
|
+
const Tt = {
|
|
1983
1968
|
// Geometric shapes - uses percentages for responsive sizing
|
|
1984
1969
|
circle: "circle(50%)",
|
|
1985
1970
|
square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
|
|
@@ -2012,7 +1997,7 @@ const Ct = {
|
|
|
2012
1997
|
},
|
|
2013
1998
|
// Hexagon - regular hexagon (reference points imported from hexagonGeometry)
|
|
2014
1999
|
hexagon: {
|
|
2015
|
-
refHeight:
|
|
2000
|
+
refHeight: wt,
|
|
2016
2001
|
points: Et
|
|
2017
2002
|
},
|
|
2018
2003
|
// Octagon - regular octagon
|
|
@@ -2028,7 +2013,7 @@ const Ct = {
|
|
|
2028
2013
|
};
|
|
2029
2014
|
function $e(o) {
|
|
2030
2015
|
if (o)
|
|
2031
|
-
return o in
|
|
2016
|
+
return o in Tt ? Tt[o] : o;
|
|
2032
2017
|
}
|
|
2033
2018
|
function Pe(o, t, i) {
|
|
2034
2019
|
const e = De[o];
|
|
@@ -2066,7 +2051,7 @@ function tt(o) {
|
|
|
2066
2051
|
const t = o.width ?? 0, i = o.style ?? "solid", e = o.color ?? "#000000";
|
|
2067
2052
|
return `${t}px ${i} ${e}`;
|
|
2068
2053
|
}
|
|
2069
|
-
function
|
|
2054
|
+
function it(o, t, i) {
|
|
2070
2055
|
if (!o) return {};
|
|
2071
2056
|
const e = {};
|
|
2072
2057
|
if (o.borderRadiusTopLeft !== void 0 || o.borderRadiusTopRight !== void 0 || o.borderRadiusBottomRight !== void 0 || o.borderRadiusBottomLeft !== void 0) {
|
|
@@ -2096,17 +2081,17 @@ function et(o, t, i) {
|
|
|
2096
2081
|
}
|
|
2097
2082
|
return e;
|
|
2098
2083
|
}
|
|
2099
|
-
function
|
|
2084
|
+
function Ne(o, t) {
|
|
2100
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);
|
|
2101
2086
|
}
|
|
2102
|
-
function
|
|
2103
|
-
const n =
|
|
2104
|
-
|
|
2087
|
+
function st(o, t, i, e) {
|
|
2088
|
+
const n = it(t, i, e);
|
|
2089
|
+
Ne(o, n);
|
|
2105
2090
|
}
|
|
2106
2091
|
function $t(o) {
|
|
2107
2092
|
return o ? Array.isArray(o) ? o.join(" ") : o : "";
|
|
2108
2093
|
}
|
|
2109
|
-
function
|
|
2094
|
+
function et(o, t) {
|
|
2110
2095
|
const i = $t(t);
|
|
2111
2096
|
i && i.split(" ").forEach((e) => {
|
|
2112
2097
|
e.trim() && o.classList.add(e.trim());
|
|
@@ -2122,9 +2107,9 @@ const Lt = {
|
|
|
2122
2107
|
UNFOCUSING: 999,
|
|
2123
2108
|
FOCUSING: 1e3
|
|
2124
2109
|
};
|
|
2125
|
-
class
|
|
2110
|
+
class ke {
|
|
2126
2111
|
constructor(t, i, e) {
|
|
2127
|
-
this.state =
|
|
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;
|
|
2128
2113
|
}
|
|
2129
2114
|
/**
|
|
2130
2115
|
* Set callback to be fired when an unfocus animation fully completes.
|
|
@@ -2142,7 +2127,7 @@ class Ne {
|
|
|
2142
2127
|
* Check if any animation is in progress
|
|
2143
2128
|
*/
|
|
2144
2129
|
isAnimating() {
|
|
2145
|
-
return this.state !==
|
|
2130
|
+
return this.state !== E.IDLE && this.state !== E.FOCUSED;
|
|
2146
2131
|
}
|
|
2147
2132
|
/**
|
|
2148
2133
|
* Normalize scalePercent value
|
|
@@ -2216,8 +2201,8 @@ class Ne {
|
|
|
2216
2201
|
* Applies all focused styling properties, classes, and z-index
|
|
2217
2202
|
*/
|
|
2218
2203
|
applyFocusedStyling(t, i) {
|
|
2219
|
-
if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"),
|
|
2220
|
-
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);
|
|
2221
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);
|
|
2222
2207
|
}
|
|
2223
2208
|
}
|
|
@@ -2227,7 +2212,7 @@ class Ne {
|
|
|
2227
2212
|
*/
|
|
2228
2213
|
removeFocusedStyling(t, i) {
|
|
2229
2214
|
if (t.style.zIndex = i, t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName), this.styling?.default) {
|
|
2230
|
-
const e =
|
|
2215
|
+
const e = it(this.styling.default, t.offsetHeight, t.offsetWidth);
|
|
2231
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);
|
|
2232
2217
|
}
|
|
2233
2218
|
}
|
|
@@ -2239,7 +2224,7 @@ class Ne {
|
|
|
2239
2224
|
let n = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
|
|
2240
2225
|
e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (n = { ...n, clipPath: void 0 });
|
|
2241
2226
|
const a = () => {
|
|
2242
|
-
const r = t.offsetHeight, s = t.offsetWidth, c =
|
|
2227
|
+
const r = t.offsetHeight, s = t.offsetWidth, c = it(n, r, s);
|
|
2243
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);
|
|
2244
2229
|
};
|
|
2245
2230
|
requestAnimationFrame(a);
|
|
@@ -2382,26 +2367,26 @@ class Ne {
|
|
|
2382
2367
|
* Implements cross-animation when swapping focus
|
|
2383
2368
|
*/
|
|
2384
2369
|
async focusImage(t, i, e) {
|
|
2385
|
-
if (this.currentFocus === t && this.state ===
|
|
2370
|
+
if (this.currentFocus === t && this.state === E.FOCUSED)
|
|
2386
2371
|
return this.unfocusImage();
|
|
2387
|
-
if (this.incoming?.element === t && this.state ===
|
|
2372
|
+
if (this.incoming?.element === t && this.state === E.FOCUSING) {
|
|
2388
2373
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
|
|
2389
2374
|
this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
|
|
2390
2375
|
t,
|
|
2391
2376
|
this.incoming.originalState,
|
|
2392
2377
|
a,
|
|
2393
2378
|
r
|
|
2394
|
-
), this.incoming = null, this.state =
|
|
2379
|
+
), this.incoming = null, this.state = E.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE;
|
|
2395
2380
|
return;
|
|
2396
2381
|
}
|
|
2397
2382
|
const n = ++this.focusGeneration;
|
|
2398
2383
|
switch (this.state) {
|
|
2399
|
-
case
|
|
2400
|
-
if (this.state =
|
|
2401
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2384
|
+
case E.IDLE:
|
|
2385
|
+
if (this.state = E.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
|
|
2386
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2402
2387
|
break;
|
|
2403
|
-
case
|
|
2404
|
-
if (this.state =
|
|
2388
|
+
case E.FOCUSED:
|
|
2389
|
+
if (this.state = E.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
|
|
2405
2390
|
this.currentFocus,
|
|
2406
2391
|
this.focusData.originalState
|
|
2407
2392
|
)), this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
|
|
@@ -2413,9 +2398,9 @@ class Ne {
|
|
|
2413
2398
|
const a = this.outgoing.element;
|
|
2414
2399
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2415
2400
|
}
|
|
2416
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2401
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2417
2402
|
break;
|
|
2418
|
-
case
|
|
2403
|
+
case E.FOCUSING:
|
|
2419
2404
|
if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
|
|
2420
2405
|
this.incoming.element,
|
|
2421
2406
|
this.incoming.originalState,
|
|
@@ -2423,10 +2408,10 @@ class Ne {
|
|
|
2423
2408
|
this.focusData?.originalWidth,
|
|
2424
2409
|
this.focusData?.originalHeight
|
|
2425
2410
|
), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
|
|
2426
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2411
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2427
2412
|
break;
|
|
2428
|
-
case
|
|
2429
|
-
if (this.state =
|
|
2413
|
+
case E.UNFOCUSING:
|
|
2414
|
+
if (this.state = E.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
|
|
2430
2415
|
this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
|
|
2431
2416
|
this.waitForAnimation(this.incoming.animationHandle)
|
|
2432
2417
|
]), this.focusGeneration !== n) return;
|
|
@@ -2434,9 +2419,9 @@ class Ne {
|
|
|
2434
2419
|
const a = this.outgoing.element;
|
|
2435
2420
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2436
2421
|
}
|
|
2437
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2422
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2438
2423
|
break;
|
|
2439
|
-
case
|
|
2424
|
+
case E.CROSS_ANIMATING:
|
|
2440
2425
|
if (this.incoming?.element === t)
|
|
2441
2426
|
return;
|
|
2442
2427
|
if (this.outgoing?.element === t) {
|
|
@@ -2459,7 +2444,7 @@ class Ne {
|
|
|
2459
2444
|
const s = this.outgoing.element;
|
|
2460
2445
|
this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
|
|
2461
2446
|
}
|
|
2462
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2447
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2463
2448
|
return;
|
|
2464
2449
|
}
|
|
2465
2450
|
if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
|
|
@@ -2485,7 +2470,7 @@ class Ne {
|
|
|
2485
2470
|
const a = this.outgoing.element;
|
|
2486
2471
|
this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
|
|
2487
2472
|
}
|
|
2488
|
-
this.currentFocus = t, this.incoming = null, this.state =
|
|
2473
|
+
this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
|
|
2489
2474
|
break;
|
|
2490
2475
|
}
|
|
2491
2476
|
}
|
|
@@ -2493,24 +2478,24 @@ class Ne {
|
|
|
2493
2478
|
* Unfocus current image, returning it to original position
|
|
2494
2479
|
*/
|
|
2495
2480
|
async unfocusImage() {
|
|
2496
|
-
if (this.state ===
|
|
2481
|
+
if (this.state === E.UNFOCUSING)
|
|
2497
2482
|
return;
|
|
2498
2483
|
const t = ++this.focusGeneration;
|
|
2499
2484
|
if (!this.currentFocus || !this.focusData) {
|
|
2500
|
-
if (this.incoming && this.state ===
|
|
2485
|
+
if (this.incoming && this.state === E.FOCUSING) {
|
|
2501
2486
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2502
2487
|
if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2503
2488
|
this.incoming.element,
|
|
2504
2489
|
this.incoming.originalState,
|
|
2505
2490
|
a,
|
|
2506
2491
|
r
|
|
2507
|
-
), this.incoming = null, this.state =
|
|
2492
|
+
), this.incoming = null, this.state = E.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
|
|
2508
2493
|
const s = this.outgoing.element;
|
|
2509
|
-
this.removeFocusedStyling(s, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state =
|
|
2494
|
+
this.removeFocusedStyling(s, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = E.IDLE, this.onUnfocusComplete?.(s);
|
|
2510
2495
|
}
|
|
2511
2496
|
return;
|
|
2512
2497
|
}
|
|
2513
|
-
if (this.state ===
|
|
2498
|
+
if (this.state === E.CROSS_ANIMATING && this.incoming) {
|
|
2514
2499
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
|
|
2515
2500
|
this.animationEngine.cancelAllAnimations(this.incoming.element);
|
|
2516
2501
|
const s = this.startUnfocusAnimation(
|
|
@@ -2526,12 +2511,12 @@ class Ne {
|
|
|
2526
2511
|
let c = null;
|
|
2527
2512
|
this.outgoing && (c = this.outgoing.element, this.removeFocusedStyling(c, this.outgoing.originalState.zIndex?.toString() || ""));
|
|
2528
2513
|
const l = s.element;
|
|
2529
|
-
this.removeFocusedStyling(l, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state =
|
|
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);
|
|
2530
2515
|
return;
|
|
2531
2516
|
}
|
|
2532
|
-
this.state =
|
|
2517
|
+
this.state = E.UNFOCUSING;
|
|
2533
2518
|
const i = this.currentFocus, e = this.focusData.originalState, n = this.focusData.originalZIndex;
|
|
2534
|
-
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state =
|
|
2519
|
+
this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE, this.onUnfocusComplete?.(i));
|
|
2535
2520
|
}
|
|
2536
2521
|
/**
|
|
2537
2522
|
* Swap focus from current image to a new one (alias for focusImage with cross-animation)
|
|
@@ -2549,7 +2534,7 @@ class Ne {
|
|
|
2549
2534
|
* Check if an image is currently focused (stable state)
|
|
2550
2535
|
*/
|
|
2551
2536
|
isFocused(t) {
|
|
2552
|
-
return this.currentFocus === t && this.state ===
|
|
2537
|
+
return this.currentFocus === t && this.state === E.FOCUSED;
|
|
2553
2538
|
}
|
|
2554
2539
|
/**
|
|
2555
2540
|
* Check if an image is the target of current focus animation
|
|
@@ -2570,7 +2555,7 @@ class Ne {
|
|
|
2570
2555
|
* Used during swipe gestures for visual feedback
|
|
2571
2556
|
*/
|
|
2572
2557
|
setDragOffset(t) {
|
|
2573
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2558
|
+
if (!this.currentFocus || !this.focusData || this.state !== E.FOCUSED) return;
|
|
2574
2559
|
const i = this.currentFocus, e = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], a = (e.x ?? 0) + t, r = e.y ?? 0;
|
|
2575
2560
|
n.push(`translate(${a}px, ${r}px)`), e.rotation !== void 0 && n.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = n.join(" ");
|
|
2576
2561
|
}
|
|
@@ -2580,7 +2565,7 @@ class Ne {
|
|
|
2580
2565
|
* @param duration - Animation duration in ms (default 150)
|
|
2581
2566
|
*/
|
|
2582
2567
|
clearDragOffset(t, i = 150) {
|
|
2583
|
-
if (!this.currentFocus || !this.focusData || this.state !==
|
|
2568
|
+
if (!this.currentFocus || !this.focusData || this.state !== E.FOCUSED) return;
|
|
2584
2569
|
const e = this.currentFocus, n = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = n.x ?? 0, s = n.y ?? 0;
|
|
2585
2570
|
a.push(`translate(${r}px, ${s}px)`), n.rotation !== void 0 && a.push(`rotate(${n.rotation}deg)`);
|
|
2586
2571
|
const c = a.join(" ");
|
|
@@ -2610,10 +2595,10 @@ class Ne {
|
|
|
2610
2595
|
this.focusData.originalZIndex,
|
|
2611
2596
|
this.focusData.originalWidth,
|
|
2612
2597
|
this.focusData.originalHeight
|
|
2613
|
-
), this.state =
|
|
2598
|
+
), this.state = E.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2614
2599
|
}
|
|
2615
2600
|
}
|
|
2616
|
-
const
|
|
2601
|
+
const Be = 50, je = 0.5, We = 20, Ge = 0.3, qe = 150, Xe = 30, rt = class rt {
|
|
2617
2602
|
constructor(t, i) {
|
|
2618
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);
|
|
2619
2604
|
}
|
|
@@ -2640,7 +2625,7 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2640
2625
|
* Used to prevent click-outside from unfocusing immediately after touch
|
|
2641
2626
|
*/
|
|
2642
2627
|
hadRecentTouch() {
|
|
2643
|
-
return Date.now() - this.recentTouchTimestamp <
|
|
2628
|
+
return Date.now() - this.recentTouchTimestamp < rt.TOUCH_CLICK_DELAY;
|
|
2644
2629
|
}
|
|
2645
2630
|
handleTouchStart(t) {
|
|
2646
2631
|
if (t.touches.length !== 1) return;
|
|
@@ -2664,7 +2649,7 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2664
2649
|
}
|
|
2665
2650
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2666
2651
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
|
|
2667
|
-
const a = e *
|
|
2652
|
+
const a = e * Ge;
|
|
2668
2653
|
this.callbacks.onDragOffset(a);
|
|
2669
2654
|
}
|
|
2670
2655
|
}
|
|
@@ -2673,14 +2658,14 @@ const je = 50, We = 0.5, Ge = 20, qe = 0.3, Be = 150, Xe = 30, at = class at {
|
|
|
2673
2658
|
this.recentTouchTimestamp = Date.now();
|
|
2674
2659
|
const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, n = Math.abs(i) / e, a = Math.abs(i);
|
|
2675
2660
|
let r = !1;
|
|
2676
|
-
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;
|
|
2677
2662
|
}
|
|
2678
2663
|
handleTouchCancel(t) {
|
|
2679
2664
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
2680
2665
|
}
|
|
2681
2666
|
};
|
|
2682
|
-
|
|
2683
|
-
let bt =
|
|
2667
|
+
rt.TOUCH_CLICK_DELAY = 300;
|
|
2668
|
+
let bt = rt;
|
|
2684
2669
|
class Ye {
|
|
2685
2670
|
constructor(t) {
|
|
2686
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)
|
|
@@ -3222,6 +3207,37 @@ const Ze = `
|
|
|
3222
3207
|
pointer-events: none;
|
|
3223
3208
|
}
|
|
3224
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
|
+
|
|
3225
3241
|
.fbn-ic-hidden {
|
|
3226
3242
|
display: none !important;
|
|
3227
3243
|
}
|
|
@@ -3235,11 +3251,11 @@ function Qe() {
|
|
|
3235
3251
|
}
|
|
3236
3252
|
class ti {
|
|
3237
3253
|
constructor(t = {}) {
|
|
3238
|
-
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({
|
|
3239
3255
|
layout: this.fullConfig.layout,
|
|
3240
3256
|
image: this.fullConfig.image
|
|
3241
|
-
}), this.zoomEngine = new
|
|
3242
|
-
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;
|
|
3243
3259
|
this.entryAnimationEngine = new ge(
|
|
3244
3260
|
i,
|
|
3245
3261
|
this.fullConfig.layout.algorithm
|
|
@@ -3250,6 +3266,16 @@ class ti {
|
|
|
3250
3266
|
i.timing?.duration ?? 600
|
|
3251
3267
|
) : this.idleAnimationEngine = null, this.zoomEngine.setOnUnfocusCompleteCallback((n) => {
|
|
3252
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
|
+
});
|
|
3253
3279
|
}), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
3254
3280
|
}
|
|
3255
3281
|
/**
|
|
@@ -3311,7 +3337,7 @@ class ti {
|
|
|
3311
3337
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3312
3338
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
3313
3339
|
onDragEnd: (t) => {
|
|
3314
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
3340
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, qe);
|
|
3315
3341
|
}
|
|
3316
3342
|
})), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3317
3343
|
} catch (t) {
|
|
@@ -3319,8 +3345,12 @@ class ti {
|
|
|
3319
3345
|
}
|
|
3320
3346
|
}
|
|
3321
3347
|
setupUI() {
|
|
3322
|
-
const t = this.fullConfig.
|
|
3323
|
-
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))
|
|
3348
|
+
const t = this.fullConfig.ui;
|
|
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
|
+
}));
|
|
3324
3354
|
}
|
|
3325
3355
|
resolveElement(t) {
|
|
3326
3356
|
return t instanceof HTMLElement ? t : document.getElementById(t);
|
|
@@ -3341,11 +3371,19 @@ class ti {
|
|
|
3341
3371
|
const t = document.createElement("div");
|
|
3342
3372
|
return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
|
|
3343
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
|
+
}
|
|
3344
3382
|
setupEventListeners() {
|
|
3345
3383
|
this.fullConfig.interaction.navigation?.keyboard !== !1 && this.containerEl.addEventListener("keydown", (t) => {
|
|
3346
|
-
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());
|
|
3347
3385
|
}), document.addEventListener("click", (t) => {
|
|
3348
|
-
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());
|
|
3349
3387
|
}), window.addEventListener("resize", () => this.handleResize());
|
|
3350
3388
|
}
|
|
3351
3389
|
/**
|
|
@@ -3358,7 +3396,7 @@ class ti {
|
|
|
3358
3396
|
);
|
|
3359
3397
|
if (!i) return;
|
|
3360
3398
|
const e = this.imageLayouts[t];
|
|
3361
|
-
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());
|
|
3362
3400
|
}
|
|
3363
3401
|
/**
|
|
3364
3402
|
* Navigate to the previous image (Left arrow)
|
|
@@ -3370,7 +3408,7 @@ class ti {
|
|
|
3370
3408
|
);
|
|
3371
3409
|
if (!i) return;
|
|
3372
3410
|
const e = this.imageLayouts[t];
|
|
3373
|
-
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());
|
|
3374
3412
|
}
|
|
3375
3413
|
/**
|
|
3376
3414
|
* Navigate to a specific image by index
|
|
@@ -3441,7 +3479,7 @@ class ti {
|
|
|
3441
3479
|
}, g = {
|
|
3442
3480
|
x: parseFloat(l.dataset.endX),
|
|
3443
3481
|
y: parseFloat(l.dataset.endY)
|
|
3444
|
-
}, 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,
|
|
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();
|
|
3445
3483
|
de({
|
|
3446
3484
|
element: l,
|
|
3447
3485
|
startPosition: d,
|
|
@@ -3455,7 +3493,7 @@ class ti {
|
|
|
3455
3493
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3456
3494
|
startRotation: y,
|
|
3457
3495
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
3458
|
-
startScale:
|
|
3496
|
+
startScale: x
|
|
3459
3497
|
});
|
|
3460
3498
|
} else {
|
|
3461
3499
|
const d = l.dataset.finalTransform || "";
|
|
@@ -3518,15 +3556,15 @@ class ti {
|
|
|
3518
3556
|
const h = document.createElement("img");
|
|
3519
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";
|
|
3520
3558
|
const d = a[u];
|
|
3521
|
-
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", () => {
|
|
3522
3560
|
if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
|
|
3523
3561
|
const g = h.cachedRenderedWidth;
|
|
3524
|
-
|
|
3562
|
+
st(h, this.fullConfig.styling?.hover, i, g), et(h, this.hoverClassName);
|
|
3525
3563
|
}
|
|
3526
3564
|
}), h.addEventListener("mouseleave", () => {
|
|
3527
3565
|
if (this.hoveredImage = null, !this.zoomEngine.isInvolved(h)) {
|
|
3528
3566
|
const g = h.cachedRenderedWidth;
|
|
3529
|
-
|
|
3567
|
+
st(h, this.fullConfig.styling?.default, i, g), pt(h, this.hoverClassName), et(h, this.defaultClassName);
|
|
3530
3568
|
}
|
|
3531
3569
|
}), h.addEventListener("click", (g) => {
|
|
3532
3570
|
g.stopPropagation(), this.handleImageClick(h, d);
|
|
@@ -3534,19 +3572,19 @@ class ti {
|
|
|
3534
3572
|
if (n !== this.loadGeneration)
|
|
3535
3573
|
return;
|
|
3536
3574
|
const g = h.naturalWidth / h.naturalHeight, b = i * g;
|
|
3537
|
-
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);
|
|
3538
3576
|
const p = { x: d.x, y: d.y }, f = { width: b, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
|
|
3539
3577
|
p,
|
|
3540
3578
|
f,
|
|
3541
3579
|
e,
|
|
3542
3580
|
u,
|
|
3543
3581
|
t.length
|
|
3544
|
-
), y = this.entryAnimationEngine.calculateStartRotation(d.rotation),
|
|
3582
|
+
), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), x = this.entryAnimationEngine.calculateStartScale(d.scale), v = this.entryAnimationEngine.buildFinalTransform(
|
|
3545
3583
|
d.rotation,
|
|
3546
3584
|
d.scale,
|
|
3547
3585
|
b,
|
|
3548
3586
|
i
|
|
3549
|
-
),
|
|
3587
|
+
), S = this.entryAnimationEngine.buildStartTransform(
|
|
3550
3588
|
m,
|
|
3551
3589
|
p,
|
|
3552
3590
|
d.rotation,
|
|
@@ -3554,7 +3592,7 @@ class ti {
|
|
|
3554
3592
|
b,
|
|
3555
3593
|
i,
|
|
3556
3594
|
y,
|
|
3557
|
-
|
|
3595
|
+
x
|
|
3558
3596
|
);
|
|
3559
3597
|
this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
|
|
3560
3598
|
finalPosition: p,
|
|
@@ -3564,7 +3602,7 @@ class ti {
|
|
|
3564
3602
|
finalTransform: v,
|
|
3565
3603
|
renderedWidth: b,
|
|
3566
3604
|
renderedHeight: i
|
|
3567
|
-
}), h.style.transform =
|
|
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);
|
|
3568
3606
|
}, h.onerror = () => r++, h.src = l;
|
|
3569
3607
|
});
|
|
3570
3608
|
}
|
|
@@ -3575,21 +3613,21 @@ class ti {
|
|
|
3575
3613
|
height: this.containerEl.offsetHeight
|
|
3576
3614
|
};
|
|
3577
3615
|
if (e)
|
|
3578
|
-
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();
|
|
3579
3617
|
else {
|
|
3580
3618
|
this.idleAnimationEngine?.pauseForImage(t);
|
|
3581
3619
|
const a = t.dataset.imageId;
|
|
3582
|
-
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();
|
|
3583
3621
|
}
|
|
3584
3622
|
}
|
|
3585
3623
|
/**
|
|
3586
3624
|
* Clear the image cloud and reset state
|
|
3587
3625
|
*/
|
|
3588
3626
|
clearImageCloud() {
|
|
3589
|
-
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;
|
|
3590
3628
|
}
|
|
3591
3629
|
showLoading(t) {
|
|
3592
|
-
!this.fullConfig.
|
|
3630
|
+
!this.fullConfig.ui.showLoadingSpinner || !this.loadingEl || (t ? this.loadingEl.classList.remove("fbn-ic-hidden") : this.loadingEl.classList.add("fbn-ic-hidden"));
|
|
3593
3631
|
}
|
|
3594
3632
|
showError(t) {
|
|
3595
3633
|
this.errorEl && (this.errorEl.textContent = t, this.errorEl.classList.remove("fbn-ic-hidden"));
|
|
@@ -3598,16 +3636,28 @@ class ti {
|
|
|
3598
3636
|
this.errorEl && this.errorEl.classList.add("fbn-ic-hidden");
|
|
3599
3637
|
}
|
|
3600
3638
|
updateCounter(t) {
|
|
3601
|
-
!this.fullConfig.
|
|
3639
|
+
!this.fullConfig.ui.showImageCounter || !this.counterEl || (this.counterEl.textContent = `${t + 1} of ${this.imageElements.length}`, this.counterEl.classList.remove("fbn-ic-hidden"));
|
|
3602
3640
|
}
|
|
3603
3641
|
hideCounter() {
|
|
3604
3642
|
this.counterEl && this.counterEl.classList.add("fbn-ic-hidden");
|
|
3605
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
|
+
}
|
|
3606
3656
|
/**
|
|
3607
3657
|
* Destroy the gallery and clean up resources
|
|
3608
3658
|
*/
|
|
3609
3659
|
destroy() {
|
|
3610
|
-
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;
|
|
3611
3661
|
}
|
|
3612
3662
|
}
|
|
3613
3663
|
function ei() {
|