@frybynite/image-cloud 0.7.6 → 0.8.0
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 +665 -572
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +693 -600
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +3 -3
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/react.d.ts +12 -8
- package/dist/react.js +673 -580
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +12 -8
- package/dist/vue.js +665 -572
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +12 -8
- package/dist/web-component.js +639 -546
- package/dist/web-component.js.map +1 -1
- package/package.json +2 -2
package/dist/web-component.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const 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)",
|
|
5
5
|
lg: "0 8px 32px rgba(0,0,0,0.5)",
|
|
6
6
|
glow: "0 0 30px rgba(255,255,255,0.6)"
|
|
7
|
-
}),
|
|
7
|
+
}), Tt = Object.freeze({
|
|
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
|
+
}), At = 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
|
+
}), Ct = 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 }),
|
|
20
20
|
flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
|
|
21
|
-
}), yt = Object.freeze({
|
|
22
|
-
type: "linear"
|
|
23
21
|
}), vt = Object.freeze({
|
|
24
|
-
|
|
22
|
+
type: "linear"
|
|
25
23
|
}), wt = Object.freeze({
|
|
26
24
|
mode: "none"
|
|
27
|
-
}),
|
|
25
|
+
}), xt = Object.freeze({
|
|
26
|
+
mode: "none"
|
|
27
|
+
}), zt = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
30
30
|
width: 0,
|
|
@@ -50,17 +50,19 @@ const ft = Object.freeze({
|
|
|
50
50
|
focused: Object.freeze({
|
|
51
51
|
shadow: "none"
|
|
52
52
|
})
|
|
53
|
-
}),
|
|
53
|
+
}), Ht = Object.freeze({
|
|
54
54
|
rows: 1,
|
|
55
55
|
amplitude: 100,
|
|
56
56
|
frequency: 2,
|
|
57
57
|
phaseShift: 0,
|
|
58
58
|
synchronization: "offset"
|
|
59
59
|
// Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
|
|
60
|
-
}),
|
|
60
|
+
}), Nt = Object.freeze({
|
|
61
|
+
spacing: 0
|
|
62
|
+
}), jt = Object.freeze({
|
|
61
63
|
mobile: Object.freeze({ maxWidth: 767 }),
|
|
62
64
|
tablet: Object.freeze({ maxWidth: 1199 })
|
|
63
|
-
}),
|
|
65
|
+
}), kt = Object.freeze({
|
|
64
66
|
mode: "adaptive",
|
|
65
67
|
// Default to adaptive sizing
|
|
66
68
|
minSize: 50,
|
|
@@ -72,40 +74,40 @@ const ft = Object.freeze({
|
|
|
72
74
|
// No variance by default
|
|
73
75
|
max: 1
|
|
74
76
|
})
|
|
75
|
-
}),
|
|
77
|
+
}), Wt = Object.freeze({
|
|
76
78
|
mode: "none",
|
|
77
79
|
range: Object.freeze({
|
|
78
80
|
min: -15,
|
|
79
81
|
max: 15
|
|
80
82
|
})
|
|
81
|
-
}),
|
|
82
|
-
sizing:
|
|
83
|
-
rotation:
|
|
84
|
-
}),
|
|
83
|
+
}), Ot = Object.freeze({
|
|
84
|
+
sizing: kt,
|
|
85
|
+
rotation: Wt
|
|
86
|
+
}), Dt = Object.freeze({
|
|
85
87
|
validateUrls: !0,
|
|
86
88
|
validationTimeout: 5e3,
|
|
87
89
|
validationMethod: "head",
|
|
88
90
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
|
|
89
|
-
}),
|
|
91
|
+
}), $t = Object.freeze({
|
|
90
92
|
enabled: !1,
|
|
91
93
|
centers: !1,
|
|
92
94
|
loaders: !1
|
|
93
|
-
}),
|
|
95
|
+
}), x = Object.freeze({
|
|
94
96
|
// Loader configuration (always an array, composite behavior is implicit)
|
|
95
97
|
loaders: [],
|
|
96
98
|
// Shared loader settings and debug config
|
|
97
99
|
config: Object.freeze({
|
|
98
|
-
loaders:
|
|
99
|
-
debug:
|
|
100
|
+
loaders: Dt,
|
|
101
|
+
debug: $t
|
|
100
102
|
}),
|
|
101
103
|
// Image sizing and rotation configuration
|
|
102
|
-
image:
|
|
104
|
+
image: Ot,
|
|
103
105
|
// Pattern-based layout configuration
|
|
104
106
|
layout: Object.freeze({
|
|
105
107
|
algorithm: "radial",
|
|
106
108
|
scaleDecay: 0,
|
|
107
109
|
// No decay by default (0-1 for radial/spiral)
|
|
108
|
-
responsive:
|
|
110
|
+
responsive: jt,
|
|
109
111
|
targetCoverage: 0.6,
|
|
110
112
|
// Target 60% of container area
|
|
111
113
|
densityFactor: 1,
|
|
@@ -161,9 +163,9 @@ const ft = Object.freeze({
|
|
|
161
163
|
}),
|
|
162
164
|
easing: "cubic-bezier(0.25, 1, 0.5, 1)",
|
|
163
165
|
// smooth deceleration
|
|
164
|
-
path:
|
|
165
|
-
rotation:
|
|
166
|
-
scale:
|
|
166
|
+
path: vt,
|
|
167
|
+
rotation: wt,
|
|
168
|
+
scale: xt
|
|
167
169
|
})
|
|
168
170
|
}),
|
|
169
171
|
// Pattern-based interaction configuration
|
|
@@ -205,18 +207,10 @@ const ft = Object.freeze({
|
|
|
205
207
|
ui: Object.freeze({
|
|
206
208
|
showLoadingSpinner: !1,
|
|
207
209
|
showImageCounter: !1
|
|
208
|
-
}),
|
|
209
|
-
performance: Object.freeze({
|
|
210
|
-
lazyLoad: void 0,
|
|
211
|
-
// STUB: Not implemented yet
|
|
212
|
-
preloadCount: void 0,
|
|
213
|
-
// STUB: Not implemented yet
|
|
214
|
-
imageQuality: void 0
|
|
215
|
-
// STUB: Not implemented yet
|
|
216
210
|
})
|
|
217
211
|
}),
|
|
218
212
|
// Image styling
|
|
219
|
-
styling:
|
|
213
|
+
styling: zt
|
|
220
214
|
});
|
|
221
215
|
function Z(n, t) {
|
|
222
216
|
if (!n) return t || {};
|
|
@@ -224,7 +218,7 @@ function Z(n, t) {
|
|
|
224
218
|
const i = { ...n };
|
|
225
219
|
return t.border !== void 0 && (i.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (i.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (i.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (i.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (i.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (i.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (i.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (i.shadow = t.shadow), t.clipPath !== void 0 && (i.clipPath = t.clipPath), t.opacity !== void 0 && (i.opacity = t.opacity), t.cursor !== void 0 && (i.cursor = t.cursor), t.className !== void 0 && (i.className = t.className), t.objectFit !== void 0 && (i.objectFit = t.objectFit), t.aspectRatio !== void 0 && (i.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (i.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (i.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (i.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (i.borderRadiusBottomLeft = t.borderRadiusBottomLeft), i;
|
|
226
220
|
}
|
|
227
|
-
function
|
|
221
|
+
function Gt(n, t) {
|
|
228
222
|
if (!t) return { ...n };
|
|
229
223
|
const i = Z(n.default, t.default), e = Z(
|
|
230
224
|
Z(i, n.hover),
|
|
@@ -239,7 +233,7 @@ function Nt(n, t) {
|
|
|
239
233
|
focused: o
|
|
240
234
|
};
|
|
241
235
|
}
|
|
242
|
-
function
|
|
236
|
+
function qt(n, t) {
|
|
243
237
|
if (!t) return { ...n };
|
|
244
238
|
const i = { ...n };
|
|
245
239
|
if (t.sizing !== void 0 && (i.sizing = {
|
|
@@ -258,7 +252,7 @@ function jt(n, t) {
|
|
|
258
252
|
}
|
|
259
253
|
return i;
|
|
260
254
|
}
|
|
261
|
-
function
|
|
255
|
+
function Xt(n) {
|
|
262
256
|
const t = n.layout?.rotation;
|
|
263
257
|
if (t && "enabled" in t)
|
|
264
258
|
return {
|
|
@@ -268,7 +262,7 @@ function kt(n) {
|
|
|
268
262
|
}
|
|
269
263
|
};
|
|
270
264
|
}
|
|
271
|
-
function
|
|
265
|
+
function Yt(n) {
|
|
272
266
|
const t = n.layout?.sizing?.variance;
|
|
273
267
|
if (t)
|
|
274
268
|
return {
|
|
@@ -279,8 +273,8 @@ function Wt(n) {
|
|
|
279
273
|
}
|
|
280
274
|
};
|
|
281
275
|
}
|
|
282
|
-
function
|
|
283
|
-
const t =
|
|
276
|
+
function Bt(n = {}) {
|
|
277
|
+
const t = Xt(n), i = Yt(n);
|
|
284
278
|
let e = n.image;
|
|
285
279
|
(t || i) && (e = {
|
|
286
280
|
...i || {},
|
|
@@ -298,94 +292,100 @@ function Gt(n = {}) {
|
|
|
298
292
|
});
|
|
299
293
|
const r = {
|
|
300
294
|
loaders: {
|
|
301
|
-
...
|
|
295
|
+
...Dt,
|
|
302
296
|
...n.config?.loaders ?? {}
|
|
303
297
|
}
|
|
304
298
|
}, s = {
|
|
305
299
|
loaders: o,
|
|
306
300
|
config: r,
|
|
307
|
-
image:
|
|
308
|
-
layout: { ...
|
|
309
|
-
animation: { ...
|
|
310
|
-
interaction: { ...
|
|
311
|
-
rendering: { ...
|
|
312
|
-
styling:
|
|
301
|
+
image: qt(Ot, e),
|
|
302
|
+
layout: { ...x.layout },
|
|
303
|
+
animation: { ...x.animation },
|
|
304
|
+
interaction: { ...x.interaction },
|
|
305
|
+
rendering: { ...x.rendering },
|
|
306
|
+
styling: Gt(zt, n.styling)
|
|
313
307
|
};
|
|
314
|
-
|
|
315
|
-
...
|
|
308
|
+
if (n.layout && (s.layout = {
|
|
309
|
+
...x.layout,
|
|
316
310
|
...n.layout
|
|
317
311
|
}, n.layout.responsive && (s.layout.responsive = {
|
|
318
|
-
...
|
|
319
|
-
mobile: n.layout.responsive.mobile ? { ...
|
|
320
|
-
tablet: n.layout.responsive.tablet ? { ...
|
|
312
|
+
...x.layout.responsive,
|
|
313
|
+
mobile: n.layout.responsive.mobile ? { ...x.layout.responsive.mobile, ...n.layout.responsive.mobile } : x.layout.responsive.mobile,
|
|
314
|
+
tablet: n.layout.responsive.tablet ? { ...x.layout.responsive.tablet, ...n.layout.responsive.tablet } : x.layout.responsive.tablet
|
|
321
315
|
}), n.layout.spacing && (s.layout.spacing = {
|
|
322
|
-
...
|
|
316
|
+
...x.layout.spacing,
|
|
323
317
|
...n.layout.spacing
|
|
324
318
|
})), n.animation && (s.animation = {
|
|
325
|
-
...
|
|
319
|
+
...x.animation,
|
|
326
320
|
...n.animation
|
|
327
321
|
}, n.animation.easing && (s.animation.easing = {
|
|
328
|
-
...
|
|
322
|
+
...x.animation.easing,
|
|
329
323
|
...n.animation.easing
|
|
330
324
|
}), n.animation.queue && (s.animation.queue = {
|
|
331
|
-
...
|
|
325
|
+
...x.animation.queue,
|
|
332
326
|
...n.animation.queue
|
|
333
327
|
}), n.animation.performance && (s.animation.performance = {
|
|
334
|
-
...
|
|
328
|
+
...x.animation.performance,
|
|
335
329
|
...n.animation.performance
|
|
336
330
|
}), n.animation.entry && (s.animation.entry = {
|
|
337
|
-
...
|
|
331
|
+
...x.animation.entry,
|
|
338
332
|
...n.animation.entry,
|
|
339
333
|
start: n.animation.entry.start ? {
|
|
340
|
-
...
|
|
334
|
+
...x.animation.entry.start,
|
|
341
335
|
...n.animation.entry.start,
|
|
342
|
-
circular: n.animation.entry.start.circular ? { ...
|
|
343
|
-
} :
|
|
344
|
-
timing: n.animation.entry.timing ? { ...
|
|
345
|
-
path: n.animation.entry.path ? { ...
|
|
346
|
-
rotation: n.animation.entry.rotation ? { ...
|
|
347
|
-
scale: n.animation.entry.scale ? { ...
|
|
336
|
+
circular: n.animation.entry.start.circular ? { ...x.animation.entry.start.circular, ...n.animation.entry.start.circular } : x.animation.entry.start.circular
|
|
337
|
+
} : x.animation.entry.start,
|
|
338
|
+
timing: n.animation.entry.timing ? { ...x.animation.entry.timing, ...n.animation.entry.timing } : x.animation.entry.timing,
|
|
339
|
+
path: n.animation.entry.path ? { ...vt, ...n.animation.entry.path } : x.animation.entry.path,
|
|
340
|
+
rotation: n.animation.entry.rotation ? { ...wt, ...n.animation.entry.rotation } : x.animation.entry.rotation,
|
|
341
|
+
scale: n.animation.entry.scale ? { ...xt, ...n.animation.entry.scale } : x.animation.entry.scale
|
|
348
342
|
})), n.interaction && (s.interaction = {
|
|
349
|
-
...
|
|
343
|
+
...x.interaction,
|
|
350
344
|
...n.interaction
|
|
351
345
|
}, n.interaction.focus && (s.interaction.focus = {
|
|
352
|
-
...
|
|
346
|
+
...x.interaction.focus,
|
|
353
347
|
...n.interaction.focus
|
|
354
348
|
}), n.interaction.navigation && (s.interaction.navigation = {
|
|
355
|
-
...
|
|
349
|
+
...x.interaction.navigation,
|
|
356
350
|
...n.interaction.navigation
|
|
357
351
|
}), n.interaction.gestures && (s.interaction.gestures = {
|
|
358
|
-
...
|
|
352
|
+
...x.interaction.gestures,
|
|
359
353
|
...n.interaction.gestures
|
|
360
354
|
})), n.rendering && (s.rendering = {
|
|
361
|
-
...
|
|
355
|
+
...x.rendering,
|
|
362
356
|
...n.rendering
|
|
363
357
|
}, n.rendering.responsive && (s.rendering.responsive = {
|
|
364
|
-
...
|
|
358
|
+
...x.rendering.responsive,
|
|
365
359
|
...n.rendering.responsive,
|
|
366
|
-
breakpoints: n.rendering.responsive.breakpoints ? { ...
|
|
367
|
-
mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection :
|
|
360
|
+
breakpoints: n.rendering.responsive.breakpoints ? { ...x.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : x.rendering.responsive.breakpoints,
|
|
361
|
+
mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : x.rendering.responsive.mobileDetection
|
|
368
362
|
}), n.rendering.ui && (s.rendering.ui = {
|
|
369
|
-
...
|
|
363
|
+
...x.rendering.ui,
|
|
370
364
|
...n.rendering.ui
|
|
371
|
-
}), n.rendering.performance && (s.rendering.performance = {
|
|
372
|
-
...y.rendering.performance,
|
|
373
|
-
...n.rendering.performance
|
|
374
365
|
})), s.config.debug = {
|
|
375
|
-
|
|
366
|
+
...$t,
|
|
376
367
|
...n.config?.debug ?? {}
|
|
377
|
-
}, s
|
|
368
|
+
}, s.layout.algorithm === "honeycomb" && s.styling) {
|
|
369
|
+
const c = { shape: "hexagon", mode: "height-relative" };
|
|
370
|
+
s.styling = {
|
|
371
|
+
...s.styling,
|
|
372
|
+
default: { ...s.styling.default, clipPath: c },
|
|
373
|
+
hover: { ...s.styling.hover, clipPath: c }
|
|
374
|
+
// focused: untouched — user config respected
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
return s;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return { ...n ?
|
|
379
|
+
function Jt(n, t) {
|
|
380
|
+
return { ...n ? Tt[n] : Tt.playful, ...t };
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
return { ...n ?
|
|
382
|
+
function Vt(n, t) {
|
|
383
|
+
return { ...n ? At[n] : At.gentle, ...t };
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
return { ...n ?
|
|
385
|
+
function Kt(n, t) {
|
|
386
|
+
return { ...n ? Ct[n] : Ct.gentle, ...t };
|
|
387
387
|
}
|
|
388
|
-
class
|
|
388
|
+
class Zt {
|
|
389
389
|
constructor(t) {
|
|
390
390
|
this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
|
|
391
391
|
}
|
|
@@ -412,12 +412,12 @@ class Xt {
|
|
|
412
412
|
*/
|
|
413
413
|
animateTransformCancellable(t, i, e, o = null, a = null) {
|
|
414
414
|
this.cancelAllAnimations(t);
|
|
415
|
-
const r = o ?? this.config.duration, s = a ?? this.config.easing.default,
|
|
415
|
+
const r = o ?? this.config.duration, s = a ?? this.config.easing.default, c = this.buildTransformString(i), l = this.buildTransformString(e);
|
|
416
416
|
t.style.transition = "none";
|
|
417
|
-
const
|
|
417
|
+
const u = t.animate(
|
|
418
418
|
[
|
|
419
|
-
{ transform:
|
|
420
|
-
{ transform:
|
|
419
|
+
{ transform: c },
|
|
420
|
+
{ transform: l }
|
|
421
421
|
],
|
|
422
422
|
{
|
|
423
423
|
duration: r,
|
|
@@ -425,20 +425,20 @@ class Xt {
|
|
|
425
425
|
fill: "forwards"
|
|
426
426
|
// Keep final state after animation
|
|
427
427
|
}
|
|
428
|
-
),
|
|
428
|
+
), h = {
|
|
429
429
|
id: `anim-${++this.animationIdCounter}`,
|
|
430
430
|
element: t,
|
|
431
|
-
animation:
|
|
431
|
+
animation: u,
|
|
432
432
|
fromState: i,
|
|
433
433
|
toState: e,
|
|
434
434
|
startTime: performance.now(),
|
|
435
435
|
duration: r
|
|
436
436
|
};
|
|
437
|
-
return this.activeAnimations.set(t,
|
|
438
|
-
t.style.transform =
|
|
437
|
+
return this.activeAnimations.set(t, h), u.finished.then(() => {
|
|
438
|
+
t.style.transform = l, this.activeAnimations.delete(t);
|
|
439
439
|
}).catch(() => {
|
|
440
440
|
this.activeAnimations.delete(t);
|
|
441
|
-
}),
|
|
441
|
+
}), h;
|
|
442
442
|
}
|
|
443
443
|
/**
|
|
444
444
|
* Cancel an active animation
|
|
@@ -481,8 +481,8 @@ class Xt {
|
|
|
481
481
|
const e = getComputedStyle(t).transform;
|
|
482
482
|
if (e === "none" || !e)
|
|
483
483
|
return { x: 0, y: 0, rotation: 0, scale: 1 };
|
|
484
|
-
const o = new DOMMatrix(e), a = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), s = o.e,
|
|
485
|
-
return { x: s, y:
|
|
484
|
+
const o = new DOMMatrix(e), a = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), s = o.e, c = o.f;
|
|
485
|
+
return { x: s, y: c, rotation: r, scale: a };
|
|
486
486
|
}
|
|
487
487
|
/**
|
|
488
488
|
* Check if an element has an active animation
|
|
@@ -544,31 +544,31 @@ class Xt {
|
|
|
544
544
|
function V(n, t, i) {
|
|
545
545
|
return n + (t - n) * i;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const { overshoot: o, bounces: a, decayRatio: r } = e, s = i.x - t.x,
|
|
549
|
-
let
|
|
550
|
-
for (let f = 0; f <
|
|
551
|
-
if (n <=
|
|
552
|
-
|
|
547
|
+
function Qt(n, t, i, e) {
|
|
548
|
+
const { overshoot: o, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l = te(a, r);
|
|
549
|
+
let u = 0, h = 0, d = 1, g = o, b = !1;
|
|
550
|
+
for (let f = 0; f < l.length; f++)
|
|
551
|
+
if (n <= l[f].time) {
|
|
552
|
+
h = f === 0 ? 0 : l[f - 1].time, d = l[f].time, g = l[f].overshoot, b = l[f].isOvershoot;
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
|
|
558
|
-
else if (
|
|
559
|
-
|
|
555
|
+
const m = (n - h) / (d - h);
|
|
556
|
+
if (b)
|
|
557
|
+
u = 1 + g * ot(m);
|
|
558
|
+
else if (h === 0)
|
|
559
|
+
u = ot(m);
|
|
560
560
|
else {
|
|
561
|
-
const
|
|
562
|
-
(
|
|
561
|
+
const p = 1 + (l.find(
|
|
562
|
+
(y, v) => y.time > h && v > 0 && l[v - 1].isOvershoot
|
|
563
563
|
)?.overshoot || g);
|
|
564
|
-
|
|
564
|
+
u = V(p, 1, ot(m));
|
|
565
565
|
}
|
|
566
566
|
return {
|
|
567
|
-
x: t.x + s *
|
|
568
|
-
y: t.y +
|
|
567
|
+
x: t.x + s * u,
|
|
568
|
+
y: t.y + c * u
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function te(n, t) {
|
|
572
572
|
const i = [];
|
|
573
573
|
let e = 0.6;
|
|
574
574
|
i.push({ time: e, overshoot: 0, isOvershoot: !1 });
|
|
@@ -578,57 +578,57 @@ function Vt(n, t) {
|
|
|
578
578
|
e += r, i.push({ time: e, overshoot: o, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: o * t, isOvershoot: !1 }), o *= t;
|
|
579
579
|
return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
const { stiffness: o, damping: a, mass: r, oscillations: s } = e,
|
|
583
|
-
let
|
|
584
|
-
if (
|
|
585
|
-
const g =
|
|
586
|
-
|
|
581
|
+
function ee(n, t, i, e) {
|
|
582
|
+
const { stiffness: o, damping: a, mass: r, oscillations: s } = e, c = i.x - t.x, l = i.y - t.y, u = Math.sqrt(o / r), h = a / (2 * Math.sqrt(o * r));
|
|
583
|
+
let d;
|
|
584
|
+
if (h < 1) {
|
|
585
|
+
const g = u * Math.sqrt(1 - h * h), b = Math.exp(-h * u * n * 3), m = Math.cos(g * n * s * Math.PI);
|
|
586
|
+
d = 1 - b * m;
|
|
587
587
|
} else
|
|
588
|
-
|
|
589
|
-
return
|
|
590
|
-
x: t.x +
|
|
591
|
-
y: t.y +
|
|
588
|
+
d = 1 - Math.exp(-u * n * 3);
|
|
589
|
+
return d = Math.max(0, Math.min(d, 1.3)), {
|
|
590
|
+
x: t.x + c * d,
|
|
591
|
+
y: t.y + l * d
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
const { amplitude: o, frequency: a, decay: r, decayRate: s, phase:
|
|
594
|
+
function ie(n, t, i, e) {
|
|
595
|
+
const { amplitude: o, 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 * n + c, m = r ? Math.pow(1 - n, s) : 1, f = o * Math.sin(b) * m, p = ne(n);
|
|
596
596
|
return {
|
|
597
|
-
x: V(t.x, i.x,
|
|
598
|
-
y: V(t.y, i.y,
|
|
597
|
+
x: V(t.x, i.x, p) + f * d,
|
|
598
|
+
y: V(t.y, i.y, p) + f * g
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function ot(n) {
|
|
602
602
|
return 1 - (1 - n) * (1 - n);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function ne(n) {
|
|
605
605
|
return 1 - Math.pow(1 - n, 3);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
const { amplitude: e, frequency: o, decay: a } = i, r = Math.sin(n * o * Math.PI * 2), s = a ? Math.pow(1 - n, 2) : 1,
|
|
609
|
-
return t +
|
|
607
|
+
function oe(n, t, i) {
|
|
608
|
+
const { amplitude: e, frequency: o, decay: a } = i, r = Math.sin(n * o * Math.PI * 2), s = a ? Math.pow(1 - n, 2) : 1, c = e * r * s;
|
|
609
|
+
return t + c;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function se(n, t, i) {
|
|
612
612
|
const { overshoot: e, bounces: o } = i, a = [];
|
|
613
613
|
a.push({ time: 0.5, scale: e });
|
|
614
614
|
let r = e;
|
|
615
|
-
const s = 0.5,
|
|
616
|
-
let
|
|
617
|
-
for (let
|
|
615
|
+
const s = 0.5, l = 0.5 / (o * 2);
|
|
616
|
+
let u = 0.5;
|
|
617
|
+
for (let d = 0; d < o; d++) {
|
|
618
618
|
const g = 1 - (r - 1) * s;
|
|
619
|
-
|
|
619
|
+
u += l, a.push({ time: u, scale: g }), r = 1 + (r - 1) * s * s, u += l, d < o - 1 && a.push({ time: u, scale: r });
|
|
620
620
|
}
|
|
621
621
|
a.push({ time: 1, scale: 1 });
|
|
622
|
-
let
|
|
623
|
-
for (let
|
|
624
|
-
if (n <= a[
|
|
625
|
-
const g =
|
|
626
|
-
|
|
622
|
+
let h = 1;
|
|
623
|
+
for (let d = 0; d < a.length; d++)
|
|
624
|
+
if (n <= a[d].time) {
|
|
625
|
+
const g = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, m = (n - g) / (a[d].time - g), f = ot(m);
|
|
626
|
+
h = b + (a[d].scale - b) * f;
|
|
627
627
|
break;
|
|
628
628
|
}
|
|
629
|
-
return
|
|
629
|
+
return h * t;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function ae(n) {
|
|
632
632
|
const {
|
|
633
633
|
element: t,
|
|
634
634
|
startPosition: i,
|
|
@@ -637,45 +637,45 @@ function ie(n) {
|
|
|
637
637
|
duration: a,
|
|
638
638
|
imageWidth: r,
|
|
639
639
|
imageHeight: s,
|
|
640
|
-
rotation:
|
|
641
|
-
scale:
|
|
642
|
-
onComplete:
|
|
643
|
-
rotationConfig:
|
|
644
|
-
startRotation:
|
|
640
|
+
rotation: c,
|
|
641
|
+
scale: l,
|
|
642
|
+
onComplete: u,
|
|
643
|
+
rotationConfig: h,
|
|
644
|
+
startRotation: d,
|
|
645
645
|
scaleConfig: g,
|
|
646
|
-
startScale:
|
|
647
|
-
} = n,
|
|
648
|
-
if ((
|
|
649
|
-
|
|
646
|
+
startScale: b
|
|
647
|
+
} = n, m = o.type, f = d !== void 0 && d !== c, p = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = f || p, w = b !== void 0 && b !== l, S = g?.mode === "pop", E = g?.pop || { overshoot: 1.2, bounces: 1 };
|
|
648
|
+
if ((m === "linear" || m === "arc") && !v && !(w || S)) {
|
|
649
|
+
u && u();
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
652
|
const M = performance.now(), F = -r / 2, _ = -s / 2;
|
|
653
|
-
function U(
|
|
654
|
-
const N =
|
|
653
|
+
function U(X) {
|
|
654
|
+
const N = X - M, T = Math.min(N / a, 1);
|
|
655
655
|
let O;
|
|
656
|
-
switch (
|
|
656
|
+
switch (m) {
|
|
657
657
|
case "bounce": {
|
|
658
|
-
const
|
|
658
|
+
const D = Jt(
|
|
659
659
|
o.bouncePreset,
|
|
660
660
|
o.bounce
|
|
661
661
|
);
|
|
662
|
-
O =
|
|
662
|
+
O = Qt(T, i, e, D);
|
|
663
663
|
break;
|
|
664
664
|
}
|
|
665
665
|
case "elastic": {
|
|
666
|
-
const
|
|
666
|
+
const D = Vt(
|
|
667
667
|
o.elasticPreset,
|
|
668
668
|
o.elastic
|
|
669
669
|
);
|
|
670
|
-
O =
|
|
670
|
+
O = ee(T, i, e, D);
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
case "wave": {
|
|
674
|
-
const
|
|
674
|
+
const D = Kt(
|
|
675
675
|
o.wavePreset,
|
|
676
676
|
o.wave
|
|
677
677
|
);
|
|
678
|
-
O =
|
|
678
|
+
O = ie(T, i, e, D);
|
|
679
679
|
break;
|
|
680
680
|
}
|
|
681
681
|
default:
|
|
@@ -686,32 +686,33 @@ function ie(n) {
|
|
|
686
686
|
}
|
|
687
687
|
const k = O.x - e.x, H = O.y - e.y;
|
|
688
688
|
let C;
|
|
689
|
-
|
|
689
|
+
p ? C = oe(T, c, y) : f ? C = V(d, c, T) : C = c;
|
|
690
690
|
let A;
|
|
691
|
-
S ? A =
|
|
691
|
+
S ? A = se(T, l, E) : w ? A = V(b, l, T) : A = l, t.style.transform = `translate(${F}px, ${_}px) translate(${k}px, ${H}px) rotate(${C}deg) scale(${A})`, T < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${F}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
|
|
692
692
|
}
|
|
693
693
|
requestAnimationFrame(U);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function re(n) {
|
|
696
696
|
return n === "bounce" || n === "elastic" || n === "wave";
|
|
697
697
|
}
|
|
698
|
-
const
|
|
698
|
+
const ce = {
|
|
699
699
|
radial: "center",
|
|
700
700
|
spiral: "center",
|
|
701
701
|
grid: "top",
|
|
702
702
|
cluster: "nearest-edge",
|
|
703
703
|
random: "nearest-edge",
|
|
704
|
-
wave: "left"
|
|
704
|
+
wave: "left",
|
|
705
|
+
honeycomb: "center"
|
|
705
706
|
};
|
|
706
|
-
class
|
|
707
|
+
class le {
|
|
707
708
|
constructor(t, i) {
|
|
708
|
-
this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path ||
|
|
709
|
+
this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || vt, this.rotationConfig = t.rotation || wt, this.scaleConfig = t.scale || xt;
|
|
709
710
|
}
|
|
710
711
|
/**
|
|
711
712
|
* Get the effective start position, considering layout-aware defaults
|
|
712
713
|
*/
|
|
713
714
|
resolveStartPosition() {
|
|
714
|
-
return this.config.start.position ? this.config.start.position :
|
|
715
|
+
return this.config.start.position ? this.config.start.position : ce[this.layoutAlgorithm] || "nearest-edge";
|
|
715
716
|
}
|
|
716
717
|
/**
|
|
717
718
|
* Calculate the starting position for an image's entry animation
|
|
@@ -749,9 +750,9 @@ class se {
|
|
|
749
750
|
* Calculate start position from the nearest edge (current default behavior)
|
|
750
751
|
*/
|
|
751
752
|
calculateNearestEdge(t, i, e, o) {
|
|
752
|
-
const a = t.x, r = t.y, s = a,
|
|
753
|
-
let
|
|
754
|
-
return
|
|
753
|
+
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);
|
|
754
|
+
let d = t.x, g = t.y;
|
|
755
|
+
return h === s ? d = -(i.width + o) : h === c ? d = e.width + o : h === l ? g = -(i.height + o) : g = e.height + o, { x: d, y: g };
|
|
755
756
|
}
|
|
756
757
|
/**
|
|
757
758
|
* Calculate start position from a specific edge
|
|
@@ -798,19 +799,19 @@ class se {
|
|
|
798
799
|
*/
|
|
799
800
|
calculateCircularPosition(t, i, e, o, a) {
|
|
800
801
|
const r = this.config.start.circular || {}, s = r.distribution || "even";
|
|
801
|
-
let
|
|
802
|
-
const
|
|
803
|
-
if (typeof
|
|
804
|
-
const
|
|
805
|
-
|
|
802
|
+
let c;
|
|
803
|
+
const l = r.radius || "120%";
|
|
804
|
+
if (typeof l == "string" && l.endsWith("%")) {
|
|
805
|
+
const m = parseFloat(l) / 100;
|
|
806
|
+
c = Math.sqrt(
|
|
806
807
|
e.width ** 2 + e.height ** 2
|
|
807
|
-
) *
|
|
808
|
+
) * m / 2;
|
|
808
809
|
} else
|
|
809
|
-
|
|
810
|
-
let
|
|
811
|
-
s === "even" ?
|
|
812
|
-
const
|
|
813
|
-
return { x: g, y:
|
|
810
|
+
c = typeof l == "number" ? l : 500;
|
|
811
|
+
let u;
|
|
812
|
+
s === "even" ? u = o / a * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
|
|
813
|
+
const h = e.width / 2, d = e.height / 2, g = h + Math.cos(u) * c, b = d + Math.sin(u) * c;
|
|
814
|
+
return { x: g, y: b };
|
|
814
815
|
}
|
|
815
816
|
/**
|
|
816
817
|
* Get animation parameters for an image
|
|
@@ -829,9 +830,9 @@ class se {
|
|
|
829
830
|
* Build a CSS transform string for the start position
|
|
830
831
|
* Uses pixel-based centering offset for reliable cross-browser behavior
|
|
831
832
|
*/
|
|
832
|
-
buildStartTransform(t, i, e, o, a, r, s,
|
|
833
|
-
const
|
|
834
|
-
return t.useScale ? `${
|
|
833
|
+
buildStartTransform(t, i, e, o, a, r, s, c) {
|
|
834
|
+
const l = t.x - i.x, u = t.y - i.y, h = s !== void 0 ? s : e, d = c !== void 0 ? c : o, g = a !== void 0 ? -a / 2 : 0, b = r !== void 0 ? -r / 2 : 0, m = a !== void 0 ? `translate(${g}px, ${b}px)` : "translate(-50%, -50%)";
|
|
835
|
+
return t.useScale ? `${m} translate(${l}px, ${u}px) rotate(${h}deg) scale(0)` : `${m} translate(${l}px, ${u}px) rotate(${h}deg) scale(${d})`;
|
|
835
836
|
}
|
|
836
837
|
/**
|
|
837
838
|
* Build the final CSS transform string
|
|
@@ -856,7 +857,7 @@ class se {
|
|
|
856
857
|
* Check if the current path type requires JavaScript animation
|
|
857
858
|
*/
|
|
858
859
|
requiresJSAnimation() {
|
|
859
|
-
return
|
|
860
|
+
return re(this.pathConfig.type);
|
|
860
861
|
}
|
|
861
862
|
/**
|
|
862
863
|
* Get the path configuration
|
|
@@ -958,8 +959,8 @@ class se {
|
|
|
958
959
|
amplitude: 15,
|
|
959
960
|
frequency: 3,
|
|
960
961
|
decay: !0
|
|
961
|
-
}, { amplitude: o, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2),
|
|
962
|
-
return i +
|
|
962
|
+
}, { amplitude: o, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2), c = r ? Math.pow(1 - t, 2) : 1, l = o * s * c;
|
|
963
|
+
return i + l;
|
|
963
964
|
}
|
|
964
965
|
/**
|
|
965
966
|
* Get the scale configuration
|
|
@@ -1017,10 +1018,10 @@ class se {
|
|
|
1017
1018
|
bounces: 1
|
|
1018
1019
|
}, { overshoot: o, bounces: a } = e, r = this.generateScaleBounceKeyframes(a, o);
|
|
1019
1020
|
let s = i;
|
|
1020
|
-
for (let
|
|
1021
|
-
if (t <= r[
|
|
1022
|
-
const
|
|
1023
|
-
s =
|
|
1021
|
+
for (let c = 0; c < r.length; c++)
|
|
1022
|
+
if (t <= r[c].time) {
|
|
1023
|
+
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);
|
|
1024
|
+
s = u + (r[c].scale - u) * d;
|
|
1024
1025
|
break;
|
|
1025
1026
|
}
|
|
1026
1027
|
return s * i;
|
|
@@ -1033,10 +1034,10 @@ class se {
|
|
|
1033
1034
|
e.push({ time: 0.5, scale: i });
|
|
1034
1035
|
let o = i;
|
|
1035
1036
|
const a = 0.5, s = 0.5 / (t * 2);
|
|
1036
|
-
let
|
|
1037
|
-
for (let
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1037
|
+
let c = 0.5;
|
|
1038
|
+
for (let l = 0; l < t; l++) {
|
|
1039
|
+
const u = 1 - (o - 1) * a;
|
|
1040
|
+
c += s, e.push({ time: c, scale: u }), o = 1 + (o - 1) * a * a, c += s, l < t - 1 && e.push({ time: c, scale: o });
|
|
1040
1041
|
}
|
|
1041
1042
|
return e.push({ time: 1, scale: 1 }), e;
|
|
1042
1043
|
}
|
|
@@ -1047,7 +1048,7 @@ class se {
|
|
|
1047
1048
|
return 1 - (1 - t) * (1 - t);
|
|
1048
1049
|
}
|
|
1049
1050
|
}
|
|
1050
|
-
class
|
|
1051
|
+
class he {
|
|
1051
1052
|
constructor(t, i = {}) {
|
|
1052
1053
|
this.config = t, this.imageConfig = i;
|
|
1053
1054
|
}
|
|
@@ -1059,17 +1060,17 @@ class ae {
|
|
|
1059
1060
|
* @returns Array of layout objects with position, rotation, scale
|
|
1060
1061
|
*/
|
|
1061
1062
|
generate(t, i, e = {}) {
|
|
1062
|
-
const o = [], { width: a, height: r } = i, s = this.config.spacing.padding,
|
|
1063
|
-
for (let
|
|
1064
|
-
const I = this.random(w,
|
|
1065
|
-
id:
|
|
1063
|
+
const o = [], { 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, p = c / 2, y = a - s - f, v = r - s - p, w = s + f, S = s + p;
|
|
1064
|
+
for (let E = 0; E < t; E++) {
|
|
1065
|
+
const I = this.random(w, y), M = this.random(S, v), F = l === "random" ? this.random(u, h) : 0, _ = b ? this.random(d, g) : 1, U = c * _, X = {
|
|
1066
|
+
id: E,
|
|
1066
1067
|
x: I,
|
|
1067
1068
|
y: M,
|
|
1068
1069
|
rotation: F,
|
|
1069
1070
|
scale: _,
|
|
1070
1071
|
baseSize: U
|
|
1071
1072
|
};
|
|
1072
|
-
o.push(
|
|
1073
|
+
o.push(X);
|
|
1073
1074
|
}
|
|
1074
1075
|
return o;
|
|
1075
1076
|
}
|
|
@@ -1083,7 +1084,7 @@ class ae {
|
|
|
1083
1084
|
return Math.random() * (i - t) + t;
|
|
1084
1085
|
}
|
|
1085
1086
|
}
|
|
1086
|
-
class
|
|
1087
|
+
class de {
|
|
1087
1088
|
constructor(t, i = {}) {
|
|
1088
1089
|
this.config = t, this.imageConfig = i;
|
|
1089
1090
|
}
|
|
@@ -1095,39 +1096,39 @@ class re {
|
|
|
1095
1096
|
* @returns Array of layout objects with position, rotation, scale
|
|
1096
1097
|
*/
|
|
1097
1098
|
generate(t, i, e = {}) {
|
|
1098
|
-
const o = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1099
|
+
const o = [], { 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, m = e.fixedHeight ?? s, f = a / 2, p = r / 2, y = Math.ceil(Math.sqrt(t));
|
|
1099
1100
|
if (t > 0) {
|
|
1100
|
-
const S = g ? this.random(
|
|
1101
|
+
const S = g ? this.random(h, d) : 1, E = m * S;
|
|
1101
1102
|
o.push({
|
|
1102
1103
|
id: 0,
|
|
1103
1104
|
x: f,
|
|
1104
|
-
y:
|
|
1105
|
-
rotation:
|
|
1105
|
+
y: p,
|
|
1106
|
+
rotation: c === "random" ? this.random(l * 0.33, u * 0.33) : 0,
|
|
1106
1107
|
// Less rotation for center
|
|
1107
1108
|
scale: S,
|
|
1108
|
-
baseSize:
|
|
1109
|
+
baseSize: E,
|
|
1109
1110
|
zIndex: 100
|
|
1110
1111
|
// Center image is highest
|
|
1111
1112
|
});
|
|
1112
1113
|
}
|
|
1113
1114
|
let v = 1, w = 1;
|
|
1114
1115
|
for (; v < t; ) {
|
|
1115
|
-
const S = w /
|
|
1116
|
+
const S = w / y, E = b > 0 ? 1 - S * b * 0.5 : 1, I = w * (m * 0.8), M = I * 1.5, F = Math.PI * (3 * (M + I) - Math.sqrt((3 * M + I) * (M + 3 * I))), _ = this.estimateWidth(m), U = Math.floor(F / (_ * 0.7));
|
|
1116
1117
|
if (U === 0) {
|
|
1117
1118
|
w++;
|
|
1118
1119
|
continue;
|
|
1119
1120
|
}
|
|
1120
|
-
const
|
|
1121
|
+
const X = 2 * Math.PI / U, N = w * (20 * Math.PI / 180);
|
|
1121
1122
|
for (let T = 0; T < U && v < t; T++) {
|
|
1122
|
-
const O = T *
|
|
1123
|
-
let A = f + Math.cos(O) * M,
|
|
1124
|
-
const
|
|
1125
|
-
A - P <
|
|
1126
|
-
const W =
|
|
1123
|
+
const O = T * X + N, k = g ? this.random(h, d) : 1, H = E * k, C = m * H;
|
|
1124
|
+
let A = f + Math.cos(O) * M, D = p + Math.sin(O) * I;
|
|
1125
|
+
const $ = this.config.spacing.padding ?? 50, P = C * 1.5 / 2, L = C / 2;
|
|
1126
|
+
A - P < $ ? A = $ + P : A + P > a - $ && (A = a - $ - P), D - L < $ ? D = $ + L : D + L > r - $ && (D = r - $ - L);
|
|
1127
|
+
const W = c === "random" ? this.random(l, u) : 0;
|
|
1127
1128
|
o.push({
|
|
1128
1129
|
id: v,
|
|
1129
1130
|
x: A,
|
|
1130
|
-
y:
|
|
1131
|
+
y: D,
|
|
1131
1132
|
rotation: W,
|
|
1132
1133
|
scale: H,
|
|
1133
1134
|
baseSize: C,
|
|
@@ -1158,7 +1159,7 @@ class re {
|
|
|
1158
1159
|
return Math.random() * (i - t) + t;
|
|
1159
1160
|
}
|
|
1160
1161
|
}
|
|
1161
|
-
const
|
|
1162
|
+
const ue = {
|
|
1162
1163
|
columns: "auto",
|
|
1163
1164
|
rows: "auto",
|
|
1164
1165
|
stagger: "none",
|
|
@@ -1168,7 +1169,7 @@ const ce = {
|
|
|
1168
1169
|
alignment: "center",
|
|
1169
1170
|
gap: 10,
|
|
1170
1171
|
overflowOffset: 0.25
|
|
1171
|
-
},
|
|
1172
|
+
}, Lt = [
|
|
1172
1173
|
{ x: 1, y: 1 },
|
|
1173
1174
|
// bottom-right
|
|
1174
1175
|
{ x: -1, y: -1 },
|
|
@@ -1186,7 +1187,7 @@ const ce = {
|
|
|
1186
1187
|
{ x: 0, y: 1 }
|
|
1187
1188
|
// down
|
|
1188
1189
|
];
|
|
1189
|
-
class
|
|
1190
|
+
class ge {
|
|
1190
1191
|
constructor(t, i = {}) {
|
|
1191
1192
|
this.config = t, this.imageConfig = i;
|
|
1192
1193
|
}
|
|
@@ -1198,65 +1199,65 @@ class le {
|
|
|
1198
1199
|
* @returns Array of layout objects with position, rotation, scale
|
|
1199
1200
|
*/
|
|
1200
1201
|
generate(t, i, e = {}) {
|
|
1201
|
-
const o = [], { width: a, height: r } = i, s = { ...
|
|
1202
|
+
const o = [], { width: a, height: r } = i, s = { ...ue, ...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, m = r - 2 * c, { columns: f, rows: p } = this.calculateGridDimensions(
|
|
1202
1203
|
t,
|
|
1203
|
-
p,
|
|
1204
1204
|
b,
|
|
1205
|
-
|
|
1205
|
+
m,
|
|
1206
|
+
l,
|
|
1206
1207
|
s
|
|
1207
|
-
),
|
|
1208
|
+
), y = s.stagger === "row", v = s.stagger === "column", w = y ? f + 0.5 : f, S = v ? p + 0.5 : p, E = (b - s.gap * (f - 1)) / w, I = (m - s.gap * (p - 1)) / S, M = y ? E / 2 : 0, F = v ? I / 2 : 0, _ = 1 + s.overlap, U = Math.min(E, I) * _, X = e.fixedHeight ? Math.min(e.fixedHeight, U) : U, N = f * E + (f - 1) * s.gap + M, T = p * I + (p - 1) * s.gap + F, O = c + (b - N) / 2, k = c + (m - T) / 2, H = f * p, C = s.columns !== "auto" && s.rows !== "auto", A = C && t > H;
|
|
1208
1209
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1209
1210
|
gridConfigColumns: s.columns,
|
|
1210
1211
|
gridConfigRows: s.rows,
|
|
1211
1212
|
columns: f,
|
|
1212
|
-
rows:
|
|
1213
|
+
rows: p,
|
|
1213
1214
|
cellCount: H,
|
|
1214
1215
|
hasFixedGrid: C,
|
|
1215
1216
|
imageCount: t,
|
|
1216
1217
|
isOverflowMode: A
|
|
1217
1218
|
});
|
|
1218
|
-
const
|
|
1219
|
+
const D = A ? new Array(H).fill(0) : [], $ = Math.min(E, I) * s.overflowOffset;
|
|
1219
1220
|
for (let z = 0; z < t; z++) {
|
|
1220
1221
|
let P, L, W = 0;
|
|
1221
1222
|
if (A && z >= H) {
|
|
1222
1223
|
const q = z - H, j = q % H;
|
|
1223
|
-
W = Math.floor(q / H) + 1,
|
|
1224
|
+
W = Math.floor(q / H) + 1, D[j]++, s.fillDirection === "row" ? (P = j % f, L = Math.floor(j / f)) : (L = j % p, P = Math.floor(j / p));
|
|
1224
1225
|
} else
|
|
1225
|
-
s.fillDirection === "row" ? (P = z % f, L = Math.floor(z / f)) : (L = z %
|
|
1226
|
-
let G = O + P * (
|
|
1227
|
-
if (s.stagger === "row" && L % 2 === 1 ? G +=
|
|
1228
|
-
const q = (W - 1) %
|
|
1229
|
-
G += j.x *
|
|
1226
|
+
s.fillDirection === "row" ? (P = z % f, L = Math.floor(z / f)) : (L = z % p, P = Math.floor(z / p));
|
|
1227
|
+
let G = O + P * (E + s.gap) + E / 2, Y = k + L * (I + s.gap) + I / 2;
|
|
1228
|
+
if (s.stagger === "row" && L % 2 === 1 ? G += E / 2 : s.stagger === "column" && P % 2 === 1 && (Y += I / 2), W > 0) {
|
|
1229
|
+
const q = (W - 1) % Lt.length, j = Lt[q];
|
|
1230
|
+
G += j.x * $, Y += j.y * $;
|
|
1230
1231
|
}
|
|
1231
1232
|
if (s.jitter > 0) {
|
|
1232
|
-
const q =
|
|
1233
|
+
const q = E / 2 * s.jitter, j = I / 2 * s.jitter;
|
|
1233
1234
|
G += this.random(-q, q), Y += this.random(-j, j);
|
|
1234
1235
|
}
|
|
1235
|
-
let
|
|
1236
|
+
let B = G, J = Y;
|
|
1236
1237
|
if (!A && s.fillDirection === "row") {
|
|
1237
1238
|
const q = t % f || f;
|
|
1238
1239
|
if (L === Math.floor((t - 1) / f) && q < f) {
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
s.alignment === "center" ?
|
|
1240
|
+
const It = q * E + (q - 1) * s.gap;
|
|
1241
|
+
let gt = 0;
|
|
1242
|
+
s.alignment === "center" ? gt = (N - It) / 2 : s.alignment === "end" && (gt = N - It), B += gt;
|
|
1242
1243
|
}
|
|
1243
1244
|
}
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
let
|
|
1247
|
-
if (
|
|
1245
|
+
const rt = g ? this.random(h, d) : 1, K = X * rt, it = K * 1.5 / 2, nt = K / 2, lt = c + it, ht = a - c - it, _t = c + nt, Ut = r - c - nt;
|
|
1246
|
+
B = Math.max(lt, Math.min(B, ht)), J = Math.max(_t, Math.min(J, Ut));
|
|
1247
|
+
let dt = 0;
|
|
1248
|
+
if (u === "random") {
|
|
1248
1249
|
const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
|
|
1249
|
-
s.jitter > 0 ?
|
|
1250
|
+
s.jitter > 0 ? dt = this.random(q * s.jitter, j * s.jitter) : dt = this.random(q, j);
|
|
1250
1251
|
}
|
|
1251
|
-
let
|
|
1252
|
-
A && W > 0 ?
|
|
1252
|
+
let ut;
|
|
1253
|
+
A && W > 0 ? ut = 50 - W : ut = A ? 100 + z : z + 1, o.push({
|
|
1253
1254
|
id: z,
|
|
1254
|
-
x:
|
|
1255
|
+
x: B,
|
|
1255
1256
|
y: J,
|
|
1256
|
-
rotation:
|
|
1257
|
-
scale:
|
|
1257
|
+
rotation: dt,
|
|
1258
|
+
scale: rt,
|
|
1258
1259
|
baseSize: K,
|
|
1259
|
-
zIndex:
|
|
1260
|
+
zIndex: ut
|
|
1260
1261
|
});
|
|
1261
1262
|
}
|
|
1262
1263
|
return o;
|
|
@@ -1273,8 +1274,8 @@ class le {
|
|
|
1273
1274
|
else if (a.rows !== "auto")
|
|
1274
1275
|
s = a.rows, r = Math.ceil(t / s);
|
|
1275
1276
|
else {
|
|
1276
|
-
const
|
|
1277
|
-
for (r = Math.max(1, Math.round(Math.sqrt(t *
|
|
1277
|
+
const c = i / e;
|
|
1278
|
+
for (r = Math.max(1, Math.round(Math.sqrt(t * c / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
|
|
1278
1279
|
r--;
|
|
1279
1280
|
}
|
|
1280
1281
|
return { columns: Math.max(1, r), rows: Math.max(1, s) };
|
|
@@ -1286,14 +1287,14 @@ class le {
|
|
|
1286
1287
|
return Math.random() * (i - t) + t;
|
|
1287
1288
|
}
|
|
1288
1289
|
}
|
|
1289
|
-
const
|
|
1290
|
+
const fe = Math.PI * (3 - Math.sqrt(5)), me = {
|
|
1290
1291
|
spiralType: "golden",
|
|
1291
1292
|
direction: "counterclockwise",
|
|
1292
1293
|
tightness: 1,
|
|
1293
1294
|
scaleDecay: 0,
|
|
1294
1295
|
startAngle: 0
|
|
1295
1296
|
};
|
|
1296
|
-
class
|
|
1297
|
+
class pe {
|
|
1297
1298
|
constructor(t, i = {}) {
|
|
1298
1299
|
this.config = t, this.imageConfig = i;
|
|
1299
1300
|
}
|
|
@@ -1305,27 +1306,27 @@ class ue {
|
|
|
1305
1306
|
* @returns Array of layout objects with position, rotation, scale
|
|
1306
1307
|
*/
|
|
1307
1308
|
generate(t, i, e = {}) {
|
|
1308
|
-
const o = [], { width: a, height: r } = i, s = { ...
|
|
1309
|
-
|
|
1310
|
-
|
|
1309
|
+
const o = [], { width: a, height: r } = i, s = { ...me, ...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, m = g !== 1 || b !== 1, f = this.config.scaleDecay ?? s.scaleDecay, p = a / 2, y = r / 2, v = Math.min(
|
|
1310
|
+
p - c - l / 2,
|
|
1311
|
+
y - c - l / 2
|
|
1311
1312
|
), w = s.direction === "clockwise" ? -1 : 1;
|
|
1312
1313
|
for (let S = 0; S < t; S++) {
|
|
1313
|
-
let
|
|
1314
|
+
let E, I;
|
|
1314
1315
|
if (s.spiralType === "golden")
|
|
1315
|
-
|
|
1316
|
+
E = S * fe * w + s.startAngle, I = this.calculateGoldenRadius(S, t, v, s.tightness);
|
|
1316
1317
|
else if (s.spiralType === "archimedean") {
|
|
1317
1318
|
const G = S * 0.5 * s.tightness;
|
|
1318
|
-
|
|
1319
|
+
E = G * w + s.startAngle, I = this.calculateArchimedeanRadius(G, t, v, s.tightness);
|
|
1319
1320
|
} else {
|
|
1320
1321
|
const G = S * 0.3 * s.tightness;
|
|
1321
|
-
|
|
1322
|
+
E = G * w + s.startAngle, I = this.calculateLogarithmicRadius(G, t, v, s.tightness);
|
|
1322
1323
|
}
|
|
1323
|
-
const M =
|
|
1324
|
+
const M = p + Math.cos(E) * I, F = y + Math.sin(E) * I, _ = I / v, U = f > 0 ? 1 - _ * f * 0.5 : 1, X = m ? this.random(g, b) : 1, N = U * X, T = l * N, k = T * 1.5 / 2, H = T / 2, C = c + k, A = a - c - k, D = c + H, $ = r - c - H, z = Math.max(C, Math.min(M, A)), P = Math.max(D, Math.min(F, $));
|
|
1324
1325
|
let L = 0;
|
|
1325
|
-
if (
|
|
1326
|
-
const G =
|
|
1326
|
+
if (u === "random") {
|
|
1327
|
+
const G = E * 180 / Math.PI % 360, Y = this.random(h, d);
|
|
1327
1328
|
L = s.spiralType === "golden" ? Y : G * 0.1 + Y * 0.9;
|
|
1328
|
-
} else
|
|
1329
|
+
} else u === "tangent" && (L = this.calculateSpiralTangent(E, I, s));
|
|
1329
1330
|
const W = t - S;
|
|
1330
1331
|
o.push({
|
|
1331
1332
|
id: S,
|
|
@@ -1377,8 +1378,8 @@ class ue {
|
|
|
1377
1378
|
* r = a * e^(b*θ)
|
|
1378
1379
|
*/
|
|
1379
1380
|
calculateLogarithmicRadius(t, i, e, o) {
|
|
1380
|
-
const a = e * 0.05, r = 0.15 / o, s = a * Math.exp(r * t),
|
|
1381
|
-
return s /
|
|
1381
|
+
const a = e * 0.05, r = 0.15 / o, s = a * Math.exp(r * t), c = i * 0.3 * o, l = a * Math.exp(r * c);
|
|
1382
|
+
return s / l * e;
|
|
1382
1383
|
}
|
|
1383
1384
|
/**
|
|
1384
1385
|
* Utility: Generate random number between min and max
|
|
@@ -1387,7 +1388,7 @@ class ue {
|
|
|
1387
1388
|
return Math.random() * (i - t) + t;
|
|
1388
1389
|
}
|
|
1389
1390
|
}
|
|
1390
|
-
const
|
|
1391
|
+
const be = {
|
|
1391
1392
|
clusterCount: "auto",
|
|
1392
1393
|
clusterSpread: 150,
|
|
1393
1394
|
clusterSpacing: 200,
|
|
@@ -1395,7 +1396,7 @@ const ge = {
|
|
|
1395
1396
|
overlap: 0.3,
|
|
1396
1397
|
distribution: "gaussian"
|
|
1397
1398
|
};
|
|
1398
|
-
class
|
|
1399
|
+
class ye {
|
|
1399
1400
|
constructor(t, i = {}) {
|
|
1400
1401
|
this.config = t, this.imageConfig = i;
|
|
1401
1402
|
}
|
|
@@ -1407,25 +1408,25 @@ class fe {
|
|
|
1407
1408
|
* @returns Array of layout objects with position, rotation, scale
|
|
1408
1409
|
*/
|
|
1409
1410
|
generate(t, i, e = {}) {
|
|
1410
|
-
const o = [], { width: a, height: r } = i, s = { ...
|
|
1411
|
+
const o = [], { width: a, height: r } = i, s = { ...be, ...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, m = g !== 1 || b !== 1, f = this.calculateClusterCount(
|
|
1411
1412
|
t,
|
|
1412
1413
|
s.clusterCount,
|
|
1413
1414
|
a,
|
|
1414
1415
|
r,
|
|
1415
1416
|
s.clusterSpacing
|
|
1416
|
-
),
|
|
1417
|
+
), p = this.generateClusterCenters(
|
|
1417
1418
|
f,
|
|
1418
1419
|
a,
|
|
1419
1420
|
r,
|
|
1420
|
-
|
|
1421
|
+
c,
|
|
1421
1422
|
s
|
|
1422
|
-
),
|
|
1423
|
+
), y = new Array(f).fill(0);
|
|
1423
1424
|
for (let w = 0; w < t; w++)
|
|
1424
|
-
|
|
1425
|
+
y[w % f]++;
|
|
1425
1426
|
let v = 0;
|
|
1426
1427
|
for (let w = 0; w < f; w++) {
|
|
1427
|
-
const S =
|
|
1428
|
-
for (let I = 0; I <
|
|
1428
|
+
const S = p[w], E = y[w];
|
|
1429
|
+
for (let I = 0; I < E; I++) {
|
|
1429
1430
|
let M, F;
|
|
1430
1431
|
if (s.distribution === "gaussian")
|
|
1431
1432
|
M = this.gaussianRandom() * S.spread, F = this.gaussianRandom() * S.spread;
|
|
@@ -1435,16 +1436,16 @@ class fe {
|
|
|
1435
1436
|
}
|
|
1436
1437
|
const _ = 1 + s.overlap * 0.5, U = 1 + s.overlap * 0.3;
|
|
1437
1438
|
M /= _, F /= _;
|
|
1438
|
-
const
|
|
1439
|
+
const X = m ? this.random(g, b) : 1, N = U * X, T = l * N;
|
|
1439
1440
|
let O = S.x + M, k = S.y + F;
|
|
1440
1441
|
const C = T * 1.5 / 2, A = T / 2;
|
|
1441
|
-
O = Math.max(
|
|
1442
|
-
const
|
|
1442
|
+
O = Math.max(c + C, Math.min(O, a - c - C)), k = Math.max(c + A, Math.min(k, r - c - A));
|
|
1443
|
+
const D = u === "random" ? this.random(h, d) : 0, z = Math.sqrt(M * M + F * F) / S.spread, P = Math.round((1 - z) * 50) + 1;
|
|
1443
1444
|
o.push({
|
|
1444
1445
|
id: v,
|
|
1445
1446
|
x: O,
|
|
1446
1447
|
y: k,
|
|
1447
|
-
rotation:
|
|
1448
|
+
rotation: D,
|
|
1448
1449
|
scale: N,
|
|
1449
1450
|
baseSize: T,
|
|
1450
1451
|
zIndex: P
|
|
@@ -1459,30 +1460,30 @@ class fe {
|
|
|
1459
1460
|
calculateClusterCount(t, i, e, o, a) {
|
|
1460
1461
|
if (i !== "auto")
|
|
1461
1462
|
return Math.max(1, Math.min(i, t));
|
|
1462
|
-
const s = Math.max(1, Math.ceil(t / 8)),
|
|
1463
|
+
const s = Math.max(1, Math.ceil(t / 8)), c = Math.floor(
|
|
1463
1464
|
e / a * (o / a) * 0.6
|
|
1464
1465
|
);
|
|
1465
|
-
return Math.max(1, Math.min(s,
|
|
1466
|
+
return Math.max(1, Math.min(s, c, 10));
|
|
1466
1467
|
}
|
|
1467
1468
|
/**
|
|
1468
1469
|
* Generate cluster center positions with spacing constraints
|
|
1469
1470
|
*/
|
|
1470
1471
|
generateClusterCenters(t, i, e, o, a) {
|
|
1471
|
-
const r = [],
|
|
1472
|
-
for (let
|
|
1473
|
-
let g = null,
|
|
1474
|
-
for (let
|
|
1472
|
+
const r = [], c = o + a.clusterSpread, l = i - o - a.clusterSpread, u = o + a.clusterSpread, h = e - o - a.clusterSpread;
|
|
1473
|
+
for (let d = 0; d < t; d++) {
|
|
1474
|
+
let g = null, b = -1;
|
|
1475
|
+
for (let m = 0; m < 100; m++) {
|
|
1475
1476
|
const f = {
|
|
1476
|
-
x: this.random(
|
|
1477
|
-
y: this.random(
|
|
1477
|
+
x: this.random(c, l),
|
|
1478
|
+
y: this.random(u, h),
|
|
1478
1479
|
spread: this.calculateClusterSpread(a)
|
|
1479
1480
|
};
|
|
1480
|
-
let
|
|
1481
|
-
for (const
|
|
1482
|
-
const v = f.x -
|
|
1483
|
-
|
|
1481
|
+
let p = 1 / 0;
|
|
1482
|
+
for (const y of r) {
|
|
1483
|
+
const v = f.x - y.x, w = f.y - y.y, S = Math.sqrt(v * v + w * w);
|
|
1484
|
+
p = Math.min(p, S);
|
|
1484
1485
|
}
|
|
1485
|
-
if ((r.length === 0 ||
|
|
1486
|
+
if ((r.length === 0 || p > b) && (g = f, b = p), p >= a.clusterSpacing)
|
|
1486
1487
|
break;
|
|
1487
1488
|
}
|
|
1488
1489
|
g && r.push(g);
|
|
@@ -1513,7 +1514,7 @@ class fe {
|
|
|
1513
1514
|
return Math.random() * (i - t) + t;
|
|
1514
1515
|
}
|
|
1515
1516
|
}
|
|
1516
|
-
class
|
|
1517
|
+
class ve {
|
|
1517
1518
|
constructor(t, i = {}) {
|
|
1518
1519
|
this.config = t, this.imageConfig = i;
|
|
1519
1520
|
}
|
|
@@ -1525,27 +1526,27 @@ class me {
|
|
|
1525
1526
|
* @returns Array of layout objects with position, rotation, scale
|
|
1526
1527
|
*/
|
|
1527
1528
|
generate(t, i, e = {}) {
|
|
1528
|
-
const o = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200,
|
|
1529
|
-
...
|
|
1529
|
+
const o = [], { 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, m = e.fixedHeight ?? s, f = {
|
|
1530
|
+
...Ht,
|
|
1530
1531
|
...this.config.wave
|
|
1531
|
-
}, { rows:
|
|
1532
|
+
}, { rows: p, amplitude: y, frequency: v, phaseShift: w, synchronization: S } = f, E = Math.ceil(t / p), F = m * 1.5 / 2, _ = c + F, U = a - c - F, X = U - _, N = E > 1 ? X / (E - 1) : 0, T = c + y + m / 2, O = r - c - y - m / 2, k = O - T, H = p > 1 ? k / (p - 1) : 0;
|
|
1532
1533
|
let C = 0;
|
|
1533
|
-
for (let A = 0; A <
|
|
1534
|
-
const
|
|
1535
|
-
let
|
|
1536
|
-
S === "offset" ?
|
|
1537
|
-
for (let z = 0; z <
|
|
1538
|
-
const P =
|
|
1534
|
+
for (let A = 0; A < p && C < t; A++) {
|
|
1535
|
+
const D = p === 1 ? (T + O) / 2 : T + A * H;
|
|
1536
|
+
let $ = 0;
|
|
1537
|
+
S === "offset" ? $ = A * w : S === "alternating" && ($ = A * Math.PI);
|
|
1538
|
+
for (let z = 0; z < E && C < t; z++) {
|
|
1539
|
+
const P = E === 1 ? (_ + U) / 2 : _ + z * N, L = this.calculateWaveY(P, a, y, v, $), W = P, G = D + L, Y = b ? this.random(d, g) : 1, B = m * Y;
|
|
1539
1540
|
let J = 0;
|
|
1540
|
-
|
|
1541
|
-
const K =
|
|
1541
|
+
l === "tangent" ? J = this.calculateRotation(P, a, y, v, $) : l === "random" && (J = this.random(u, h));
|
|
1542
|
+
const K = B * 1.5 / 2, ct = B / 2, it = c + K, nt = a - c - K, lt = c + ct, ht = r - c - ct;
|
|
1542
1543
|
o.push({
|
|
1543
1544
|
id: C,
|
|
1544
|
-
x: Math.max(
|
|
1545
|
-
y: Math.max(
|
|
1545
|
+
x: Math.max(it, Math.min(W, nt)),
|
|
1546
|
+
y: Math.max(lt, Math.min(G, ht)),
|
|
1546
1547
|
rotation: J,
|
|
1547
1548
|
scale: Y,
|
|
1548
|
-
baseSize:
|
|
1549
|
+
baseSize: B,
|
|
1549
1550
|
zIndex: C + 1
|
|
1550
1551
|
}), C++;
|
|
1551
1552
|
}
|
|
@@ -1590,7 +1591,84 @@ class me {
|
|
|
1590
1591
|
return Math.random() * (i - t) + t;
|
|
1591
1592
|
}
|
|
1592
1593
|
}
|
|
1593
|
-
|
|
1594
|
+
const Et = 100, Q = 100 / Math.sqrt(3), St = [
|
|
1595
|
+
[Q / 2, 0],
|
|
1596
|
+
// upper-left
|
|
1597
|
+
[3 * Q / 2, 0],
|
|
1598
|
+
// upper-right
|
|
1599
|
+
[2 * Q, 50],
|
|
1600
|
+
// right ← tiling key vertex
|
|
1601
|
+
[3 * Q / 2, 100],
|
|
1602
|
+
// lower-right
|
|
1603
|
+
[Q / 2, 100],
|
|
1604
|
+
// lower-left
|
|
1605
|
+
[0, 50]
|
|
1606
|
+
// left
|
|
1607
|
+
], we = St[1][0] / Et, xe = St[2][1] / Et;
|
|
1608
|
+
function Ee(n) {
|
|
1609
|
+
return {
|
|
1610
|
+
colStep: we * n,
|
|
1611
|
+
rowOffset: xe * n
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
function Se(n, t, i, e, o, a) {
|
|
1615
|
+
const { colStep: r } = Ee(a);
|
|
1616
|
+
return {
|
|
1617
|
+
px: e + r * n,
|
|
1618
|
+
py: o + a * (t + n / 2)
|
|
1619
|
+
};
|
|
1620
|
+
}
|
|
1621
|
+
const Re = [
|
|
1622
|
+
[1, 0, -1],
|
|
1623
|
+
[0, 1, -1],
|
|
1624
|
+
[-1, 1, 0],
|
|
1625
|
+
[-1, 0, 1],
|
|
1626
|
+
[0, -1, 1],
|
|
1627
|
+
[1, -1, 0]
|
|
1628
|
+
];
|
|
1629
|
+
function Ie(n) {
|
|
1630
|
+
if (n === 0) return [[0, 0, 0]];
|
|
1631
|
+
const t = [];
|
|
1632
|
+
let [i, e, o] = [0, -n, n];
|
|
1633
|
+
for (const [a, r, s] of Re)
|
|
1634
|
+
for (let c = 0; c < n; c++)
|
|
1635
|
+
t.push([i, e, o]), i += a, e += r, o += s;
|
|
1636
|
+
return t;
|
|
1637
|
+
}
|
|
1638
|
+
class Te {
|
|
1639
|
+
// imageConfig intentionally not stored — honeycomb forces uniform sizing (rotation/variance
|
|
1640
|
+
// would break hex tiling). Kept as parameter for interface compatibility.
|
|
1641
|
+
constructor(t, i = {}) {
|
|
1642
|
+
this.config = t;
|
|
1643
|
+
}
|
|
1644
|
+
generate(t, i, e = {}) {
|
|
1645
|
+
const o = [], { width: a, height: r } = i, s = a / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
|
|
1646
|
+
...Nt,
|
|
1647
|
+
...this.config.honeycomb
|
|
1648
|
+
}.spacing ?? 0, d = l + h;
|
|
1649
|
+
let g = 0, b = 0;
|
|
1650
|
+
for (; g < t; ) {
|
|
1651
|
+
const m = Ie(b);
|
|
1652
|
+
for (const [f, p, y] of m) {
|
|
1653
|
+
if (g >= t) break;
|
|
1654
|
+
const { px: v, py: w } = Se(f, p, y, s, c, d);
|
|
1655
|
+
o.push({
|
|
1656
|
+
id: g,
|
|
1657
|
+
x: v,
|
|
1658
|
+
y: w,
|
|
1659
|
+
rotation: 0,
|
|
1660
|
+
scale: 1,
|
|
1661
|
+
baseSize: l,
|
|
1662
|
+
// Inner rings render above outer rings
|
|
1663
|
+
zIndex: Math.max(1, 100 - b)
|
|
1664
|
+
}), g++;
|
|
1665
|
+
}
|
|
1666
|
+
b++;
|
|
1667
|
+
}
|
|
1668
|
+
return o;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
class Ae {
|
|
1594
1672
|
constructor(t) {
|
|
1595
1673
|
this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
|
|
1596
1674
|
}
|
|
@@ -1601,17 +1679,19 @@ class pe {
|
|
|
1601
1679
|
initLayout() {
|
|
1602
1680
|
switch (this.config.algorithm) {
|
|
1603
1681
|
case "radial":
|
|
1604
|
-
return new
|
|
1682
|
+
return new de(this.config, this.imageConfig);
|
|
1605
1683
|
case "grid":
|
|
1606
|
-
return new
|
|
1684
|
+
return new ge(this.config, this.imageConfig);
|
|
1607
1685
|
case "spiral":
|
|
1608
|
-
return new
|
|
1686
|
+
return new pe(this.config, this.imageConfig);
|
|
1609
1687
|
case "cluster":
|
|
1610
|
-
return new
|
|
1688
|
+
return new ye(this.config, this.imageConfig);
|
|
1611
1689
|
case "wave":
|
|
1612
|
-
return new
|
|
1690
|
+
return new ve(this.config, this.imageConfig);
|
|
1691
|
+
case "honeycomb":
|
|
1692
|
+
return new Te(this.config, this.imageConfig);
|
|
1613
1693
|
default:
|
|
1614
|
-
return new
|
|
1694
|
+
return new he(this.config, this.imageConfig);
|
|
1615
1695
|
}
|
|
1616
1696
|
}
|
|
1617
1697
|
/**
|
|
@@ -1693,15 +1773,28 @@ class pe {
|
|
|
1693
1773
|
const a = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
|
|
1694
1774
|
if (r !== void 0)
|
|
1695
1775
|
return { height: r };
|
|
1696
|
-
const s = a?.minSize ?? 50,
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1699
|
-
let
|
|
1700
|
-
if (
|
|
1776
|
+
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, m = h * d * l / i;
|
|
1777
|
+
let p = Math.sqrt(m / 1.4);
|
|
1778
|
+
p *= u, p = Math.min(p, e);
|
|
1779
|
+
let y = this.clamp(p, s, c);
|
|
1780
|
+
if (y === s && p < s) {
|
|
1701
1781
|
const v = Math.max(s * 0.05, 20);
|
|
1702
|
-
|
|
1782
|
+
y = Math.max(v, p);
|
|
1703
1783
|
}
|
|
1704
|
-
return { height:
|
|
1784
|
+
return this.config.algorithm === "honeycomb" && (y = Math.min(y, this.honeycombMaxImageHeight(i, t))), { height: y };
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* Returns the largest image height at which all honeycomb rings fit within the container.
|
|
1788
|
+
* Spacing is 0 for this calculation (user spacing is additive on top of the image height;
|
|
1789
|
+
* any non-zero spacing only makes the constraint tighter).
|
|
1790
|
+
*/
|
|
1791
|
+
honeycombMaxImageHeight(t, i) {
|
|
1792
|
+
if (t <= 1) return 1 / 0;
|
|
1793
|
+
let e = 0, o = 1;
|
|
1794
|
+
for (; o < t; )
|
|
1795
|
+
e++, o += 6 * e;
|
|
1796
|
+
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);
|
|
1797
|
+
return Math.max(10, Math.min(h, d));
|
|
1705
1798
|
}
|
|
1706
1799
|
/**
|
|
1707
1800
|
* Utility: Clamp a value between min and max
|
|
@@ -1711,7 +1804,7 @@ class pe {
|
|
|
1711
1804
|
}
|
|
1712
1805
|
}
|
|
1713
1806
|
var R = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(R || {});
|
|
1714
|
-
const
|
|
1807
|
+
const Mt = {
|
|
1715
1808
|
// Geometric shapes - uses percentages for responsive sizing
|
|
1716
1809
|
circle: "circle(50%)",
|
|
1717
1810
|
square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
|
|
@@ -1720,7 +1813,7 @@ const At = {
|
|
|
1720
1813
|
hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
|
|
1721
1814
|
octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
|
|
1722
1815
|
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
|
|
1723
|
-
},
|
|
1816
|
+
}, Ce = {
|
|
1724
1817
|
// Circle - uses radius in pixels (refHeight of 100px = 50px radius)
|
|
1725
1818
|
circle: {
|
|
1726
1819
|
refHeight: 100,
|
|
@@ -1742,10 +1835,10 @@ const At = {
|
|
|
1742
1835
|
refHeight: 100,
|
|
1743
1836
|
points: [[50, 0], [100, 38], [82, 100], [18, 100], [0, 38]]
|
|
1744
1837
|
},
|
|
1745
|
-
// Hexagon - regular hexagon
|
|
1838
|
+
// Hexagon - regular hexagon (reference points imported from hexagonGeometry)
|
|
1746
1839
|
hexagon: {
|
|
1747
|
-
refHeight:
|
|
1748
|
-
points:
|
|
1840
|
+
refHeight: Et,
|
|
1841
|
+
points: St
|
|
1749
1842
|
},
|
|
1750
1843
|
// Octagon - regular octagon
|
|
1751
1844
|
octagon: {
|
|
@@ -1758,29 +1851,29 @@ const At = {
|
|
|
1758
1851
|
points: [[50, 0], [100, 50], [50, 100], [0, 50]]
|
|
1759
1852
|
}
|
|
1760
1853
|
};
|
|
1761
|
-
function
|
|
1854
|
+
function Le(n) {
|
|
1762
1855
|
if (n)
|
|
1763
|
-
return n in
|
|
1856
|
+
return n in Mt ? Mt[n] : n;
|
|
1764
1857
|
}
|
|
1765
|
-
function
|
|
1766
|
-
const e =
|
|
1858
|
+
function Me(n, t, i) {
|
|
1859
|
+
const e = Ce[n];
|
|
1767
1860
|
if (!e) return "";
|
|
1768
1861
|
const o = t / e.refHeight;
|
|
1769
1862
|
if (n === "circle")
|
|
1770
1863
|
return `circle(${Math.round(50 * o * 100) / 100}px)`;
|
|
1771
|
-
const a = e.
|
|
1772
|
-
return `polygon(${e.points.map(([
|
|
1773
|
-
const
|
|
1774
|
-
return `${
|
|
1864
|
+
const a = e.points.map(([m]) => m), r = e.points.map(([, m]) => m), s = (Math.min(...a) + Math.max(...a)) / 2 * o, c = (Math.min(...r) + Math.max(...r)) / 2 * o, l = (Math.max(...a) - Math.min(...a)) * o, u = (i ?? l) / 2, h = t / 2, d = u - s, g = h - c;
|
|
1865
|
+
return `polygon(${e.points.map(([m, f]) => {
|
|
1866
|
+
const p = Math.round((m * o + d) * 100) / 100, y = Math.round((f * o + g) * 100) / 100;
|
|
1867
|
+
return `${p}px ${y}px`;
|
|
1775
1868
|
}).join(", ")})`;
|
|
1776
1869
|
}
|
|
1777
|
-
function
|
|
1778
|
-
return n in
|
|
1870
|
+
function Fe(n) {
|
|
1871
|
+
return n in mt;
|
|
1779
1872
|
}
|
|
1780
|
-
function
|
|
1781
|
-
return n ?
|
|
1873
|
+
function ze(n) {
|
|
1874
|
+
return n ? Fe(n) ? mt[n] : n : mt.md;
|
|
1782
1875
|
}
|
|
1783
|
-
function
|
|
1876
|
+
function Oe(n) {
|
|
1784
1877
|
if (!n) return "";
|
|
1785
1878
|
const t = [];
|
|
1786
1879
|
if (n.grayscale !== void 0 && t.push(`grayscale(${n.grayscale})`), n.blur !== void 0 && t.push(`blur(${n.blur}px)`), n.brightness !== void 0 && t.push(`brightness(${n.brightness})`), n.contrast !== void 0 && t.push(`contrast(${n.contrast})`), n.saturate !== void 0 && t.push(`saturate(${n.saturate})`), n.opacity !== void 0 && t.push(`opacity(${n.opacity})`), n.sepia !== void 0 && t.push(`sepia(${n.sepia})`), n.hueRotate !== void 0 && t.push(`hue-rotate(${n.hueRotate}deg)`), n.invert !== void 0 && t.push(`invert(${n.invert})`), n.dropShadow !== void 0)
|
|
@@ -1792,13 +1885,13 @@ function Ee(n) {
|
|
|
1792
1885
|
}
|
|
1793
1886
|
return t.join(" ");
|
|
1794
1887
|
}
|
|
1795
|
-
function
|
|
1888
|
+
function tt(n) {
|
|
1796
1889
|
if (!n || n.style === "none" || n.width === 0)
|
|
1797
1890
|
return "none";
|
|
1798
1891
|
const t = n.width ?? 0, i = n.style ?? "solid", e = n.color ?? "#000000";
|
|
1799
1892
|
return `${t}px ${i} ${e}`;
|
|
1800
1893
|
}
|
|
1801
|
-
function
|
|
1894
|
+
function et(n, t, i) {
|
|
1802
1895
|
if (!n) return {};
|
|
1803
1896
|
const e = {};
|
|
1804
1897
|
if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
|
|
@@ -1806,55 +1899,55 @@ function tt(n, t, i) {
|
|
|
1806
1899
|
n.borderRadiusTopLeft !== void 0 ? e.borderTopLeftRadius = `${n.borderRadiusTopLeft}px` : s && (e.borderTopLeftRadius = `${s}px`), n.borderRadiusTopRight !== void 0 ? e.borderTopRightRadius = `${n.borderRadiusTopRight}px` : s && (e.borderTopRightRadius = `${s}px`), n.borderRadiusBottomRight !== void 0 ? e.borderBottomRightRadius = `${n.borderRadiusBottomRight}px` : s && (e.borderBottomRightRadius = `${s}px`), n.borderRadiusBottomLeft !== void 0 ? e.borderBottomLeftRadius = `${n.borderRadiusBottomLeft}px` : s && (e.borderBottomLeftRadius = `${s}px`);
|
|
1807
1900
|
} else n.border?.radius !== void 0 && (e.borderRadius = `${n.border.radius}px`);
|
|
1808
1901
|
if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
|
|
1809
|
-
const s = n.border || {},
|
|
1810
|
-
e.borderTop =
|
|
1811
|
-
} else n.border && (e.border =
|
|
1812
|
-
n.shadow !== void 0 && (e.boxShadow =
|
|
1813
|
-
const r =
|
|
1902
|
+
const s = n.border || {}, c = { ...s, ...n.borderTop }, l = { ...s, ...n.borderRight }, u = { ...s, ...n.borderBottom }, h = { ...s, ...n.borderLeft };
|
|
1903
|
+
e.borderTop = tt(c), e.borderRight = tt(l), e.borderBottom = tt(u), e.borderLeft = tt(h);
|
|
1904
|
+
} else n.border && (e.border = tt(n.border));
|
|
1905
|
+
n.shadow !== void 0 && (e.boxShadow = ze(n.shadow));
|
|
1906
|
+
const r = Oe(n.filter);
|
|
1814
1907
|
if (e.filter = r || "none", n.opacity !== void 0 && (e.opacity = String(n.opacity)), n.cursor !== void 0 && (e.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
|
|
1815
|
-
const s = n.outline.width ?? 0,
|
|
1816
|
-
e.outline = `${s}px ${
|
|
1908
|
+
const s = n.outline.width ?? 0, c = n.outline.style ?? "solid", l = n.outline.color ?? "#000000";
|
|
1909
|
+
e.outline = `${s}px ${c} ${l}`, n.outline.offset !== void 0 && (e.outlineOffset = `${n.outline.offset}px`);
|
|
1817
1910
|
}
|
|
1818
1911
|
if (n.objectFit !== void 0 && (e.objectFit = n.objectFit), n.aspectRatio !== void 0 && (e.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
|
|
1819
1912
|
let s;
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1822
|
-
s =
|
|
1913
|
+
const c = typeof n.clipPath == "object" && n.clipPath !== null && "shape" in n.clipPath, l = c ? n.clipPath : void 0;
|
|
1914
|
+
if (l?.mode === "height-relative" && t)
|
|
1915
|
+
s = Me(l.shape, t, i);
|
|
1823
1916
|
else {
|
|
1824
|
-
const
|
|
1825
|
-
s =
|
|
1917
|
+
const u = c && l ? l.shape : n.clipPath;
|
|
1918
|
+
s = Le(u);
|
|
1826
1919
|
}
|
|
1827
1920
|
s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
|
|
1828
1921
|
}
|
|
1829
1922
|
return e;
|
|
1830
1923
|
}
|
|
1831
|
-
function
|
|
1924
|
+
function De(n, t) {
|
|
1832
1925
|
t.borderRadius !== void 0 && (n.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (n.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (n.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (n.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (n.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (n.style.border = t.border), t.borderTop !== void 0 && (n.style.borderTop = t.borderTop), t.borderRight !== void 0 && (n.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (n.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (n.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (n.style.boxShadow = t.boxShadow), t.filter !== void 0 && (n.style.filter = t.filter), t.opacity !== void 0 && (n.style.opacity = t.opacity), t.cursor !== void 0 && (n.style.cursor = t.cursor), t.outline !== void 0 && (n.style.outline = t.outline), t.outlineOffset !== void 0 && (n.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (n.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (n.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (n.style.clipPath = t.clipPath), t.overflow !== void 0 && (n.style.overflow = t.overflow);
|
|
1833
1926
|
}
|
|
1834
|
-
function
|
|
1835
|
-
const o =
|
|
1836
|
-
|
|
1927
|
+
function ft(n, t, i, e) {
|
|
1928
|
+
const o = et(t, i, e);
|
|
1929
|
+
De(n, o);
|
|
1837
1930
|
}
|
|
1838
|
-
function
|
|
1931
|
+
function Pt(n) {
|
|
1839
1932
|
return n ? Array.isArray(n) ? n.join(" ") : n : "";
|
|
1840
1933
|
}
|
|
1841
|
-
function
|
|
1842
|
-
const i =
|
|
1934
|
+
function st(n, t) {
|
|
1935
|
+
const i = Pt(t);
|
|
1843
1936
|
i && i.split(" ").forEach((e) => {
|
|
1844
1937
|
e.trim() && n.classList.add(e.trim());
|
|
1845
1938
|
});
|
|
1846
1939
|
}
|
|
1847
|
-
function
|
|
1848
|
-
const i =
|
|
1940
|
+
function pt(n, t) {
|
|
1941
|
+
const i = Pt(t);
|
|
1849
1942
|
i && i.split(" ").forEach((e) => {
|
|
1850
1943
|
e.trim() && n.classList.remove(e.trim());
|
|
1851
1944
|
});
|
|
1852
1945
|
}
|
|
1853
|
-
const
|
|
1946
|
+
const Ft = {
|
|
1854
1947
|
UNFOCUSING: 999,
|
|
1855
1948
|
FOCUSING: 1e3
|
|
1856
1949
|
};
|
|
1857
|
-
class
|
|
1950
|
+
class $e {
|
|
1858
1951
|
constructor(t, i, e) {
|
|
1859
1952
|
this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
|
|
1860
1953
|
}
|
|
@@ -1882,9 +1975,9 @@ class Re {
|
|
|
1882
1975
|
*/
|
|
1883
1976
|
calculateFocusDimensions(t, i, e) {
|
|
1884
1977
|
const o = this.normalizeScalePercent(this.config.scalePercent), a = e.height * o, r = t / i;
|
|
1885
|
-
let s = a,
|
|
1886
|
-
const
|
|
1887
|
-
return
|
|
1978
|
+
let s = a, c = s * r;
|
|
1979
|
+
const l = e.width * o;
|
|
1980
|
+
return c > l && (c = l, s = c / r), { width: c, height: s };
|
|
1888
1981
|
}
|
|
1889
1982
|
/**
|
|
1890
1983
|
* Calculate the transform needed to center an image (position only, no scale)
|
|
@@ -1915,23 +2008,23 @@ class Re {
|
|
|
1915
2008
|
* Create a Web Animation that animates both transform (position) and dimensions
|
|
1916
2009
|
* This provides sharper zoom by re-rendering at target size instead of scaling pixels
|
|
1917
2010
|
*/
|
|
1918
|
-
animateWithDimensions(t, i, e, o, a, r, s,
|
|
1919
|
-
const
|
|
2011
|
+
animateWithDimensions(t, i, e, o, a, r, s, c) {
|
|
2012
|
+
const l = this.buildDimensionZoomTransform(i), u = this.buildDimensionZoomTransform(e);
|
|
1920
2013
|
return t.style.transition = "none", t.animate(
|
|
1921
2014
|
[
|
|
1922
2015
|
{
|
|
1923
|
-
transform:
|
|
2016
|
+
transform: l,
|
|
1924
2017
|
width: `${o}px`,
|
|
1925
2018
|
height: `${a}px`
|
|
1926
2019
|
},
|
|
1927
2020
|
{
|
|
1928
|
-
transform:
|
|
2021
|
+
transform: u,
|
|
1929
2022
|
width: `${r}px`,
|
|
1930
2023
|
height: `${s}px`
|
|
1931
2024
|
}
|
|
1932
2025
|
],
|
|
1933
2026
|
{
|
|
1934
|
-
duration:
|
|
2027
|
+
duration: c,
|
|
1935
2028
|
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
1936
2029
|
fill: "forwards"
|
|
1937
2030
|
}
|
|
@@ -1942,8 +2035,8 @@ class Re {
|
|
|
1942
2035
|
* Applies all focused styling properties, classes, and z-index
|
|
1943
2036
|
*/
|
|
1944
2037
|
applyFocusedStyling(t, i) {
|
|
1945
|
-
if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"),
|
|
1946
|
-
const e =
|
|
2038
|
+
if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"), st(t, this.focusedClassName), this.styling?.focused) {
|
|
2039
|
+
const e = et(this.styling.focused, t.offsetHeight, t.offsetWidth);
|
|
1947
2040
|
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);
|
|
1948
2041
|
}
|
|
1949
2042
|
}
|
|
@@ -1952,8 +2045,8 @@ class Re {
|
|
|
1952
2045
|
* Restores default styling properties, removes classes, and resets z-index
|
|
1953
2046
|
*/
|
|
1954
2047
|
removeFocusedStyling(t, i) {
|
|
1955
|
-
if (t.style.zIndex = i, t.classList.remove("fbn-ic-focused"),
|
|
1956
|
-
const e =
|
|
2048
|
+
if (t.style.zIndex = i, t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName), this.styling?.default) {
|
|
2049
|
+
const e = et(this.styling.default, t.offsetHeight, t.offsetWidth);
|
|
1957
2050
|
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);
|
|
1958
2051
|
}
|
|
1959
2052
|
}
|
|
@@ -1965,8 +2058,8 @@ class Re {
|
|
|
1965
2058
|
let o = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
|
|
1966
2059
|
e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (o = { ...o, clipPath: void 0 });
|
|
1967
2060
|
const a = () => {
|
|
1968
|
-
const r = t.offsetHeight, s = t.offsetWidth,
|
|
1969
|
-
|
|
2061
|
+
const r = t.offsetHeight, s = t.offsetWidth, c = et(o, r, s);
|
|
2062
|
+
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);
|
|
1970
2063
|
};
|
|
1971
2064
|
requestAnimationFrame(a);
|
|
1972
2065
|
}
|
|
@@ -1977,50 +2070,50 @@ class Re {
|
|
|
1977
2070
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
1978
2071
|
*/
|
|
1979
2072
|
startFocusAnimation(t, i, e, o, a) {
|
|
1980
|
-
const r = t.style.zIndex || "", s = t.offsetWidth,
|
|
2073
|
+
const r = t.style.zIndex || "", s = t.offsetWidth, c = t.offsetHeight, l = this.calculateFocusDimensions(s, c, i), u = this.calculateFocusTransform(i, e);
|
|
1981
2074
|
this.animationEngine.cancelAllAnimations(t);
|
|
1982
|
-
const
|
|
1983
|
-
this.applyFocusedStyling(t,
|
|
1984
|
-
const
|
|
2075
|
+
const h = this.config.animationDuration ?? 600;
|
|
2076
|
+
this.applyFocusedStyling(t, Ft.FOCUSING);
|
|
2077
|
+
const d = o ?? {
|
|
1985
2078
|
x: 0,
|
|
1986
2079
|
y: 0,
|
|
1987
2080
|
rotation: e.rotation,
|
|
1988
2081
|
scale: 1
|
|
1989
2082
|
// No scale - using dimensions
|
|
1990
|
-
}, g = a?.width ?? s,
|
|
2083
|
+
}, g = a?.width ?? s, b = a?.height ?? c, m = this.animateWithDimensions(
|
|
1991
2084
|
t,
|
|
1992
|
-
u,
|
|
1993
2085
|
d,
|
|
2086
|
+
u,
|
|
1994
2087
|
g,
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2088
|
+
b,
|
|
2089
|
+
l.width,
|
|
2090
|
+
l.height,
|
|
2091
|
+
h
|
|
1999
2092
|
), f = {
|
|
2000
2093
|
id: `focus-${Date.now()}`,
|
|
2001
2094
|
element: t,
|
|
2002
|
-
animation:
|
|
2003
|
-
fromState:
|
|
2004
|
-
toState:
|
|
2095
|
+
animation: m,
|
|
2096
|
+
fromState: d,
|
|
2097
|
+
toState: u,
|
|
2005
2098
|
startTime: performance.now(),
|
|
2006
|
-
duration:
|
|
2099
|
+
duration: h
|
|
2007
2100
|
};
|
|
2008
2101
|
return this.focusData = {
|
|
2009
2102
|
element: t,
|
|
2010
2103
|
originalState: e,
|
|
2011
|
-
focusTransform:
|
|
2104
|
+
focusTransform: u,
|
|
2012
2105
|
originalZIndex: r,
|
|
2013
2106
|
originalWidth: s,
|
|
2014
|
-
originalHeight:
|
|
2015
|
-
focusWidth:
|
|
2016
|
-
focusHeight:
|
|
2107
|
+
originalHeight: c,
|
|
2108
|
+
focusWidth: l.width,
|
|
2109
|
+
focusHeight: l.height
|
|
2017
2110
|
}, this.startClipPathAnimation(t, f, !0), {
|
|
2018
2111
|
element: t,
|
|
2019
2112
|
originalState: e,
|
|
2020
2113
|
animationHandle: f,
|
|
2021
2114
|
direction: "in",
|
|
2022
2115
|
originalWidth: s,
|
|
2023
|
-
originalHeight:
|
|
2116
|
+
originalHeight: c
|
|
2024
2117
|
};
|
|
2025
2118
|
}
|
|
2026
2119
|
/**
|
|
@@ -2029,30 +2122,30 @@ class Re {
|
|
|
2029
2122
|
* @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
|
|
2030
2123
|
*/
|
|
2031
2124
|
startUnfocusAnimation(t, i, e, o) {
|
|
2032
|
-
t.style.zIndex = String(
|
|
2125
|
+
t.style.zIndex = String(Ft.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
|
|
2033
2126
|
const a = this.config.animationDuration ?? 600;
|
|
2034
|
-
t.classList.remove("fbn-ic-focused"),
|
|
2035
|
-
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth,
|
|
2127
|
+
t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName);
|
|
2128
|
+
const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, c = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, l = {
|
|
2036
2129
|
x: 0,
|
|
2037
2130
|
y: 0,
|
|
2038
2131
|
rotation: i.rotation,
|
|
2039
2132
|
scale: 1
|
|
2040
2133
|
// No scale - using dimensions
|
|
2041
|
-
},
|
|
2134
|
+
}, u = this.focusData?.originalWidth ?? t.offsetWidth, h = this.focusData?.originalHeight ?? t.offsetHeight, d = this.animateWithDimensions(
|
|
2042
2135
|
t,
|
|
2043
2136
|
r,
|
|
2044
|
-
|
|
2137
|
+
l,
|
|
2045
2138
|
s,
|
|
2139
|
+
c,
|
|
2140
|
+
u,
|
|
2046
2141
|
h,
|
|
2047
|
-
d,
|
|
2048
|
-
l,
|
|
2049
2142
|
a
|
|
2050
2143
|
), g = {
|
|
2051
2144
|
id: `unfocus-${Date.now()}`,
|
|
2052
2145
|
element: t,
|
|
2053
|
-
animation:
|
|
2146
|
+
animation: d,
|
|
2054
2147
|
fromState: r,
|
|
2055
|
-
toState:
|
|
2148
|
+
toState: l,
|
|
2056
2149
|
startTime: performance.now(),
|
|
2057
2150
|
duration: a
|
|
2058
2151
|
};
|
|
@@ -2061,8 +2154,8 @@ class Re {
|
|
|
2061
2154
|
originalState: i,
|
|
2062
2155
|
animationHandle: g,
|
|
2063
2156
|
direction: "out",
|
|
2064
|
-
originalWidth:
|
|
2065
|
-
originalHeight:
|
|
2157
|
+
originalWidth: u,
|
|
2158
|
+
originalHeight: h
|
|
2066
2159
|
};
|
|
2067
2160
|
}
|
|
2068
2161
|
/**
|
|
@@ -2080,9 +2173,9 @@ class Re {
|
|
|
2080
2173
|
* Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
|
|
2081
2174
|
*/
|
|
2082
2175
|
captureMidAnimationState(t) {
|
|
2083
|
-
const i = getComputedStyle(t), e = new DOMMatrix(i.transform), o = t.offsetWidth, a = t.offsetHeight, r = e.e + o * 0.5, s = e.f + a * 0.5,
|
|
2084
|
-
return t.style.width = `${o}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${
|
|
2085
|
-
transform: { x: r, y: s, rotation:
|
|
2176
|
+
const i = getComputedStyle(t), e = new DOMMatrix(i.transform), o = t.offsetWidth, a = t.offsetHeight, r = e.e + o * 0.5, s = e.f + a * 0.5, c = Math.atan2(e.b, e.a) * (180 / Math.PI);
|
|
2177
|
+
return t.style.width = `${o}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${c}deg)`, t.style.transition = "none", {
|
|
2178
|
+
transform: { x: r, y: s, rotation: c, scale: 1 },
|
|
2086
2179
|
dimensions: { width: o, height: a }
|
|
2087
2180
|
};
|
|
2088
2181
|
}
|
|
@@ -2160,12 +2253,12 @@ class Re {
|
|
|
2160
2253
|
if (this.outgoing?.element === t) {
|
|
2161
2254
|
const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
|
|
2162
2255
|
if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
|
|
2163
|
-
const { transform: s, dimensions:
|
|
2256
|
+
const { transform: s, dimensions: c } = this.captureMidAnimationState(this.incoming.element);
|
|
2164
2257
|
this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
|
|
2165
2258
|
this.incoming.element,
|
|
2166
2259
|
this.incoming.originalState,
|
|
2167
2260
|
s,
|
|
2168
|
-
|
|
2261
|
+
c
|
|
2169
2262
|
);
|
|
2170
2263
|
} else
|
|
2171
2264
|
this.outgoing = null;
|
|
@@ -2289,10 +2382,10 @@ class Re {
|
|
|
2289
2382
|
if (!this.currentFocus || !this.focusData || this.state !== R.FOCUSED) return;
|
|
2290
2383
|
const e = this.currentFocus, o = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = o.x ?? 0, s = o.y ?? 0;
|
|
2291
2384
|
a.push(`translate(${r}px, ${s}px)`), o.rotation !== void 0 && a.push(`rotate(${o.rotation}deg)`);
|
|
2292
|
-
const
|
|
2293
|
-
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform =
|
|
2385
|
+
const c = a.join(" ");
|
|
2386
|
+
t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform = c, setTimeout(() => {
|
|
2294
2387
|
this.currentFocus === e && (e.style.transition = "none");
|
|
2295
|
-
}, i)) : (e.style.transition = "none", e.style.transform =
|
|
2388
|
+
}, i)) : (e.style.transition = "none", e.style.transform = c);
|
|
2296
2389
|
}
|
|
2297
2390
|
/**
|
|
2298
2391
|
* Reset zoom state (cancels all animations)
|
|
@@ -2319,7 +2412,7 @@ class Re {
|
|
|
2319
2412
|
), this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
|
|
2320
2413
|
}
|
|
2321
2414
|
}
|
|
2322
|
-
const
|
|
2415
|
+
const Pe = 50, _e = 0.5, Ue = 20, He = 0.3, Ne = 150, je = 30, at = class at {
|
|
2323
2416
|
constructor(t, i) {
|
|
2324
2417
|
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);
|
|
2325
2418
|
}
|
|
@@ -2346,7 +2439,7 @@ const Ie = 50, Te = 0.5, Ae = 20, Ce = 0.3, Le = 150, Me = 30, st = class st {
|
|
|
2346
2439
|
* Used to prevent click-outside from unfocusing immediately after touch
|
|
2347
2440
|
*/
|
|
2348
2441
|
hadRecentTouch() {
|
|
2349
|
-
return Date.now() - this.recentTouchTimestamp <
|
|
2442
|
+
return Date.now() - this.recentTouchTimestamp < at.TOUCH_CLICK_DELAY;
|
|
2350
2443
|
}
|
|
2351
2444
|
handleTouchStart(t) {
|
|
2352
2445
|
if (t.touches.length !== 1) return;
|
|
@@ -2366,11 +2459,11 @@ const Ie = 50, Te = 0.5, Ae = 20, Ce = 0.3, Le = 150, Me = 30, st = class st {
|
|
|
2366
2459
|
const i = t.touches[0], e = i.clientX - this.touchState.startX, o = i.clientY - this.touchState.startY;
|
|
2367
2460
|
if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + o * o) > 10) {
|
|
2368
2461
|
const s = Math.atan2(Math.abs(o), Math.abs(e)) * (180 / Math.PI);
|
|
2369
|
-
this.touchState.isHorizontalSwipe = s <=
|
|
2462
|
+
this.touchState.isHorizontalSwipe = s <= je;
|
|
2370
2463
|
}
|
|
2371
2464
|
if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
|
|
2372
2465
|
t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
|
|
2373
|
-
const a = e *
|
|
2466
|
+
const a = e * He;
|
|
2374
2467
|
this.callbacks.onDragOffset(a);
|
|
2375
2468
|
}
|
|
2376
2469
|
}
|
|
@@ -2379,15 +2472,15 @@ const Ie = 50, Te = 0.5, Ae = 20, Ce = 0.3, Le = 150, Me = 30, st = class st {
|
|
|
2379
2472
|
this.recentTouchTimestamp = Date.now();
|
|
2380
2473
|
const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, o = Math.abs(i) / e, a = Math.abs(i);
|
|
2381
2474
|
let r = !1;
|
|
2382
|
-
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >=
|
|
2475
|
+
this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Pe || o >= _e && a >= Ue) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
|
|
2383
2476
|
}
|
|
2384
2477
|
handleTouchCancel(t) {
|
|
2385
2478
|
this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
|
|
2386
2479
|
}
|
|
2387
2480
|
};
|
|
2388
|
-
|
|
2389
|
-
let
|
|
2390
|
-
class
|
|
2481
|
+
at.TOUCH_CLICK_DELAY = 300;
|
|
2482
|
+
let bt = at;
|
|
2483
|
+
class ke {
|
|
2391
2484
|
constructor(t) {
|
|
2392
2485
|
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)
|
|
2393
2486
|
throw new Error("GoogleDriveLoader requires at least one source to be configured");
|
|
@@ -2482,11 +2575,11 @@ class Fe {
|
|
|
2482
2575
|
const e = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
|
|
2483
2576
|
if (!s.ok)
|
|
2484
2577
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2485
|
-
const
|
|
2486
|
-
(
|
|
2578
|
+
const l = (await s.json()).files.filter(
|
|
2579
|
+
(u) => u.mimeType.startsWith("image/") && i.isAllowed(u.name)
|
|
2487
2580
|
);
|
|
2488
|
-
return this.log(`Found ${
|
|
2489
|
-
e.push(`https://lh3.googleusercontent.com/d/${
|
|
2581
|
+
return this.log(`Found ${l.length} images in folder ${t} (non-recursive)`), l.forEach((u) => {
|
|
2582
|
+
e.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
|
|
2490
2583
|
}), e;
|
|
2491
2584
|
}
|
|
2492
2585
|
/**
|
|
@@ -2507,8 +2600,8 @@ class Fe {
|
|
|
2507
2600
|
try {
|
|
2508
2601
|
const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
|
|
2509
2602
|
if (s.ok) {
|
|
2510
|
-
const
|
|
2511
|
-
|
|
2603
|
+
const c = await s.json();
|
|
2604
|
+
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})`);
|
|
2512
2605
|
} else
|
|
2513
2606
|
this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
|
|
2514
2607
|
} catch (r) {
|
|
@@ -2552,18 +2645,18 @@ class Fe {
|
|
|
2552
2645
|
const e = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
|
|
2553
2646
|
if (!s.ok)
|
|
2554
2647
|
throw new Error(`API request failed: ${s.status} ${s.statusText}`);
|
|
2555
|
-
const
|
|
2556
|
-
(
|
|
2557
|
-
),
|
|
2558
|
-
(
|
|
2648
|
+
const c = await s.json(), l = c.files.filter(
|
|
2649
|
+
(h) => h.mimeType.startsWith("image/") && i.isAllowed(h.name)
|
|
2650
|
+
), u = c.files.filter(
|
|
2651
|
+
(h) => h.mimeType === "application/vnd.google-apps.folder"
|
|
2559
2652
|
);
|
|
2560
|
-
this.log(`Found ${
|
|
2561
|
-
e.push(`https://lh3.googleusercontent.com/d/${
|
|
2653
|
+
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) => {
|
|
2654
|
+
e.push(`https://lh3.googleusercontent.com/d/${h.id}=s1600`), this.log(`Added file: ${h.name}`);
|
|
2562
2655
|
});
|
|
2563
|
-
for (const
|
|
2564
|
-
this.log(`Loading images from subfolder: ${
|
|
2565
|
-
const
|
|
2566
|
-
e.push(...
|
|
2656
|
+
for (const h of u) {
|
|
2657
|
+
this.log(`Loading images from subfolder: ${h.name}`);
|
|
2658
|
+
const d = await this.loadImagesRecursively(h.id, i);
|
|
2659
|
+
e.push(...d);
|
|
2567
2660
|
}
|
|
2568
2661
|
return e;
|
|
2569
2662
|
}
|
|
@@ -2580,8 +2673,8 @@ class Fe {
|
|
|
2580
2673
|
if (!o.ok)
|
|
2581
2674
|
throw new Error("Cannot access folder directly (CORS or permissions issue)");
|
|
2582
2675
|
const a = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, s = [...a.matchAll(r)];
|
|
2583
|
-
return [...new Set(s.map((
|
|
2584
|
-
(
|
|
2676
|
+
return [...new Set(s.map((u) => u[1]))].map(
|
|
2677
|
+
(u) => `https://drive.google.com/uc?export=view&id=${u}`
|
|
2585
2678
|
);
|
|
2586
2679
|
} catch (e) {
|
|
2587
2680
|
throw console.error("Direct loading failed:", e), new Error(
|
|
@@ -2608,7 +2701,7 @@ class Fe {
|
|
|
2608
2701
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2609
2702
|
}
|
|
2610
2703
|
}
|
|
2611
|
-
class
|
|
2704
|
+
class We {
|
|
2612
2705
|
constructor(t) {
|
|
2613
2706
|
if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
|
|
2614
2707
|
throw new Error("StaticImageLoader requires at least one source to be configured");
|
|
@@ -2788,7 +2881,7 @@ class ze {
|
|
|
2788
2881
|
this.debugLogging && typeof console < "u" && console.log(...t);
|
|
2789
2882
|
}
|
|
2790
2883
|
}
|
|
2791
|
-
class
|
|
2884
|
+
class Ge {
|
|
2792
2885
|
constructor(t) {
|
|
2793
2886
|
if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
|
|
2794
2887
|
throw new Error("CompositeLoader requires at least one loader to be configured");
|
|
@@ -2845,7 +2938,7 @@ class Oe {
|
|
|
2845
2938
|
this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
|
|
2846
2939
|
}
|
|
2847
2940
|
}
|
|
2848
|
-
class
|
|
2941
|
+
class qe {
|
|
2849
2942
|
/**
|
|
2850
2943
|
* Create a new ImageFilter
|
|
2851
2944
|
* @param extensions - Array of allowed file extensions (without dots)
|
|
@@ -2882,7 +2975,7 @@ class $e {
|
|
|
2882
2975
|
// isAllowedDate(date: Date): boolean
|
|
2883
2976
|
// isAllowedDimensions(width: number, height: number): boolean
|
|
2884
2977
|
}
|
|
2885
|
-
const
|
|
2978
|
+
const Xe = `
|
|
2886
2979
|
.fbn-ic-gallery {
|
|
2887
2980
|
position: relative;
|
|
2888
2981
|
width: 100%;
|
|
@@ -2932,21 +3025,21 @@ const De = `
|
|
|
2932
3025
|
display: none !important;
|
|
2933
3026
|
}
|
|
2934
3027
|
`;
|
|
2935
|
-
function
|
|
3028
|
+
function Ye() {
|
|
2936
3029
|
if (typeof document > "u") return;
|
|
2937
3030
|
const n = "fbn-ic-functional-styles";
|
|
2938
3031
|
if (document.getElementById(n)) return;
|
|
2939
3032
|
const t = document.createElement("style");
|
|
2940
|
-
t.id = n, t.textContent =
|
|
3033
|
+
t.id = n, t.textContent = Xe, document.head.appendChild(t);
|
|
2941
3034
|
}
|
|
2942
|
-
class
|
|
3035
|
+
class Be {
|
|
2943
3036
|
constructor(t = {}) {
|
|
2944
|
-
this.fullConfig =
|
|
3037
|
+
this.fullConfig = Bt(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 Zt(this.fullConfig.animation), this.layoutEngine = new Ae({
|
|
2945
3038
|
layout: this.fullConfig.layout,
|
|
2946
3039
|
image: this.fullConfig.image
|
|
2947
|
-
}), this.zoomEngine = new
|
|
2948
|
-
const i = this.fullConfig.animation.entry ||
|
|
2949
|
-
this.entryAnimationEngine = new
|
|
3040
|
+
}), this.zoomEngine = new $e(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = et(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
|
|
3041
|
+
const i = this.fullConfig.animation.entry || x.animation.entry;
|
|
3042
|
+
this.entryAnimationEngine = new le(
|
|
2950
3043
|
i,
|
|
2951
3044
|
this.fullConfig.layout.algorithm
|
|
2952
3045
|
), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
|
|
@@ -2956,7 +3049,7 @@ class _e {
|
|
|
2956
3049
|
*/
|
|
2957
3050
|
createImageFilter() {
|
|
2958
3051
|
const t = this.fullConfig.config.loaders?.allowedExtensions;
|
|
2959
|
-
return new
|
|
3052
|
+
return new qe(t);
|
|
2960
3053
|
}
|
|
2961
3054
|
/**
|
|
2962
3055
|
* Create appropriate image loader based on config
|
|
@@ -2967,7 +3060,7 @@ class _e {
|
|
|
2967
3060
|
if (!t || t.length === 0)
|
|
2968
3061
|
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
|
|
2969
3062
|
const e = t.map((o) => this.createLoaderFromEntry(o, i));
|
|
2970
|
-
return e.length === 1 ? e[0] : new
|
|
3063
|
+
return e.length === 1 ? e[0] : new Ge({
|
|
2971
3064
|
loaders: e,
|
|
2972
3065
|
debugLogging: this.fullConfig.config.debug?.loaders
|
|
2973
3066
|
});
|
|
@@ -2985,14 +3078,14 @@ class _e {
|
|
|
2985
3078
|
allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
|
|
2986
3079
|
debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2987
3080
|
};
|
|
2988
|
-
return new
|
|
3081
|
+
return new We(o);
|
|
2989
3082
|
} else if ("googleDrive" in t) {
|
|
2990
3083
|
const e = t.googleDrive, o = {
|
|
2991
3084
|
...e,
|
|
2992
3085
|
allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
|
|
2993
3086
|
debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
|
|
2994
3087
|
};
|
|
2995
|
-
return new
|
|
3088
|
+
return new ke(o);
|
|
2996
3089
|
} else
|
|
2997
3090
|
throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
|
|
2998
3091
|
}
|
|
@@ -3001,16 +3094,16 @@ class _e {
|
|
|
3001
3094
|
*/
|
|
3002
3095
|
async init() {
|
|
3003
3096
|
try {
|
|
3004
|
-
if (
|
|
3097
|
+
if (Ye(), this.containerRef)
|
|
3005
3098
|
this.containerEl = this.containerRef;
|
|
3006
3099
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
3007
3100
|
throw new Error(`Container #${this.containerId} not found`);
|
|
3008
|
-
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new
|
|
3101
|
+
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new bt(this.containerEl, {
|
|
3009
3102
|
onNext: () => this.navigateToNextImage(),
|
|
3010
3103
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3011
3104
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
3012
3105
|
onDragEnd: (t) => {
|
|
3013
|
-
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0,
|
|
3106
|
+
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ne);
|
|
3014
3107
|
}
|
|
3015
3108
|
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3016
3109
|
} catch (t) {
|
|
@@ -3131,55 +3224,55 @@ class _e {
|
|
|
3131
3224
|
const o = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
|
|
3132
3225
|
this.imageLayouts = a, this.displayQueue = [];
|
|
3133
3226
|
let r = 0;
|
|
3134
|
-
const s = (
|
|
3135
|
-
this.containerEl && (this.containerEl.appendChild(
|
|
3136
|
-
if (
|
|
3137
|
-
const
|
|
3138
|
-
x: parseFloat(
|
|
3139
|
-
y: parseFloat(
|
|
3227
|
+
const s = (l) => {
|
|
3228
|
+
this.containerEl && (this.containerEl.appendChild(l), this.imageElements.push(l), requestAnimationFrame(() => {
|
|
3229
|
+
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)) {
|
|
3230
|
+
const d = {
|
|
3231
|
+
x: parseFloat(l.dataset.startX),
|
|
3232
|
+
y: parseFloat(l.dataset.startY)
|
|
3140
3233
|
}, g = {
|
|
3141
|
-
x: parseFloat(
|
|
3142
|
-
y: parseFloat(
|
|
3143
|
-
},
|
|
3144
|
-
|
|
3145
|
-
element:
|
|
3146
|
-
startPosition:
|
|
3234
|
+
x: parseFloat(l.dataset.endX),
|
|
3235
|
+
y: parseFloat(l.dataset.endY)
|
|
3236
|
+
}, b = parseFloat(l.dataset.imageWidth), m = parseFloat(l.dataset.imageHeight), f = parseFloat(l.dataset.rotation), p = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : f, v = l.dataset.startScale ? parseFloat(l.dataset.startScale) : p, w = this.entryAnimationEngine.getTiming();
|
|
3237
|
+
ae({
|
|
3238
|
+
element: l,
|
|
3239
|
+
startPosition: d,
|
|
3147
3240
|
endPosition: g,
|
|
3148
3241
|
pathConfig: this.entryAnimationEngine.getPathConfig(),
|
|
3149
3242
|
duration: w.duration,
|
|
3150
|
-
imageWidth:
|
|
3151
|
-
imageHeight:
|
|
3243
|
+
imageWidth: b,
|
|
3244
|
+
imageHeight: m,
|
|
3152
3245
|
rotation: f,
|
|
3153
|
-
scale:
|
|
3246
|
+
scale: p,
|
|
3154
3247
|
rotationConfig: this.entryAnimationEngine.getRotationConfig(),
|
|
3155
|
-
startRotation:
|
|
3248
|
+
startRotation: y,
|
|
3156
3249
|
scaleConfig: this.entryAnimationEngine.getScaleConfig(),
|
|
3157
3250
|
startScale: v
|
|
3158
3251
|
});
|
|
3159
3252
|
} else {
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3253
|
+
const d = l.dataset.finalTransform || "";
|
|
3254
|
+
l.style.transform = d;
|
|
3162
3255
|
}
|
|
3163
|
-
const
|
|
3164
|
-
if (this.fullConfig.config.debug?.enabled &&
|
|
3165
|
-
const
|
|
3166
|
-
console.log(`Image ${
|
|
3167
|
-
left:
|
|
3168
|
-
top:
|
|
3169
|
-
width:
|
|
3170
|
-
height:
|
|
3171
|
-
computedWidth:
|
|
3172
|
-
computedHeight:
|
|
3173
|
-
transform:
|
|
3256
|
+
const h = parseInt(l.dataset.imageId || "0");
|
|
3257
|
+
if (this.fullConfig.config.debug?.enabled && h < 3) {
|
|
3258
|
+
const d = l.dataset.finalTransform || "";
|
|
3259
|
+
console.log(`Image ${h} final state:`, {
|
|
3260
|
+
left: l.style.left,
|
|
3261
|
+
top: l.style.top,
|
|
3262
|
+
width: l.style.width,
|
|
3263
|
+
height: l.style.height,
|
|
3264
|
+
computedWidth: l.offsetWidth,
|
|
3265
|
+
computedHeight: l.offsetHeight,
|
|
3266
|
+
transform: d,
|
|
3174
3267
|
pathType: this.entryAnimationEngine.getPathType()
|
|
3175
3268
|
});
|
|
3176
3269
|
}
|
|
3177
3270
|
}), r++);
|
|
3178
|
-
},
|
|
3271
|
+
}, c = () => {
|
|
3179
3272
|
if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
|
|
3180
3273
|
for (; this.displayQueue.length > 0; ) {
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3274
|
+
const l = this.displayQueue.shift();
|
|
3275
|
+
l && s(l);
|
|
3183
3276
|
}
|
|
3184
3277
|
return;
|
|
3185
3278
|
}
|
|
@@ -3189,78 +3282,78 @@ class _e {
|
|
|
3189
3282
|
return;
|
|
3190
3283
|
}
|
|
3191
3284
|
if (this.displayQueue.length > 0) {
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3285
|
+
const l = this.displayQueue.shift();
|
|
3286
|
+
l && s(l);
|
|
3194
3287
|
}
|
|
3195
3288
|
r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
|
|
3196
3289
|
}, this.fullConfig.animation.queue.interval);
|
|
3197
3290
|
};
|
|
3198
3291
|
if ("IntersectionObserver" in window && this.containerEl) {
|
|
3199
|
-
const
|
|
3200
|
-
|
|
3201
|
-
|
|
3292
|
+
const l = new IntersectionObserver((u) => {
|
|
3293
|
+
u.forEach((h) => {
|
|
3294
|
+
h.isIntersecting && (c(), l.disconnect());
|
|
3202
3295
|
});
|
|
3203
3296
|
}, { threshold: 0.1, rootMargin: "50px" });
|
|
3204
|
-
|
|
3297
|
+
l.observe(this.containerEl);
|
|
3205
3298
|
} else
|
|
3206
|
-
|
|
3207
|
-
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((
|
|
3208
|
-
const
|
|
3209
|
-
|
|
3210
|
-
const
|
|
3211
|
-
|
|
3212
|
-
})), t.forEach((
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3217
|
-
if (this.hoveredImage = { element:
|
|
3218
|
-
const g =
|
|
3219
|
-
|
|
3299
|
+
c();
|
|
3300
|
+
this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), a.forEach((l, u) => {
|
|
3301
|
+
const h = document.createElement("div");
|
|
3302
|
+
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";
|
|
3303
|
+
const d = l.x, g = l.y;
|
|
3304
|
+
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);
|
|
3305
|
+
})), t.forEach((l, u) => {
|
|
3306
|
+
const h = document.createElement("img");
|
|
3307
|
+
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
|
|
3308
|
+
const d = a[u];
|
|
3309
|
+
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)), st(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
|
|
3310
|
+
if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
|
|
3311
|
+
const g = h.cachedRenderedWidth;
|
|
3312
|
+
ft(h, this.fullConfig.styling?.hover, i, g), st(h, this.hoverClassName);
|
|
3220
3313
|
}
|
|
3221
|
-
}),
|
|
3222
|
-
if (this.hoveredImage = null, !this.zoomEngine.isInvolved(
|
|
3223
|
-
const g =
|
|
3224
|
-
|
|
3314
|
+
}), h.addEventListener("mouseleave", () => {
|
|
3315
|
+
if (this.hoveredImage = null, !this.zoomEngine.isInvolved(h)) {
|
|
3316
|
+
const g = h.cachedRenderedWidth;
|
|
3317
|
+
ft(h, this.fullConfig.styling?.default, i, g), pt(h, this.hoverClassName), st(h, this.defaultClassName);
|
|
3225
3318
|
}
|
|
3226
|
-
}),
|
|
3227
|
-
g.stopPropagation(), this.handleImageClick(
|
|
3228
|
-
}),
|
|
3319
|
+
}), h.addEventListener("click", (g) => {
|
|
3320
|
+
g.stopPropagation(), this.handleImageClick(h, d);
|
|
3321
|
+
}), h.style.opacity = "0", h.style.transition = this.entryAnimationEngine.getTransitionCSS(), h.onload = () => {
|
|
3229
3322
|
if (o !== this.loadGeneration)
|
|
3230
3323
|
return;
|
|
3231
|
-
const g =
|
|
3232
|
-
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3324
|
+
const g = h.naturalWidth / h.naturalHeight, b = i * g;
|
|
3325
|
+
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, ft(h, this.fullConfig.styling?.default, i, b);
|
|
3326
|
+
const m = { x: d.x, y: d.y }, f = { width: b, height: i }, p = this.entryAnimationEngine.calculateStartPosition(
|
|
3327
|
+
m,
|
|
3235
3328
|
f,
|
|
3236
3329
|
e,
|
|
3237
|
-
|
|
3330
|
+
u,
|
|
3238
3331
|
t.length
|
|
3239
|
-
),
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3332
|
+
), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
|
|
3333
|
+
d.rotation,
|
|
3334
|
+
d.scale,
|
|
3335
|
+
b,
|
|
3243
3336
|
i
|
|
3244
3337
|
), S = this.entryAnimationEngine.buildStartTransform(
|
|
3338
|
+
p,
|
|
3245
3339
|
m,
|
|
3340
|
+
d.rotation,
|
|
3341
|
+
d.scale,
|
|
3246
3342
|
b,
|
|
3247
|
-
u.rotation,
|
|
3248
|
-
u.scale,
|
|
3249
|
-
p,
|
|
3250
3343
|
i,
|
|
3251
|
-
|
|
3344
|
+
y,
|
|
3252
3345
|
v
|
|
3253
3346
|
);
|
|
3254
|
-
this.fullConfig.config.debug?.enabled &&
|
|
3255
|
-
finalPosition:
|
|
3347
|
+
this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
|
|
3348
|
+
finalPosition: m,
|
|
3256
3349
|
imageSize: f,
|
|
3257
|
-
left:
|
|
3258
|
-
top:
|
|
3350
|
+
left: d.x,
|
|
3351
|
+
top: d.y,
|
|
3259
3352
|
finalTransform: w,
|
|
3260
|
-
renderedWidth:
|
|
3353
|
+
renderedWidth: b,
|
|
3261
3354
|
renderedHeight: i
|
|
3262
|
-
}),
|
|
3263
|
-
},
|
|
3355
|
+
}), h.style.transform = S, h.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || v !== d.scale) && (h.dataset.startX = String(p.x), h.dataset.startY = String(p.y), h.dataset.endX = String(m.x), h.dataset.endY = String(m.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(v)), this.displayQueue.push(h);
|
|
3356
|
+
}, h.onerror = () => r++, h.src = l;
|
|
3264
3357
|
});
|
|
3265
3358
|
}
|
|
3266
3359
|
async handleImageClick(t, i) {
|
|
@@ -3304,7 +3397,7 @@ class _e {
|
|
|
3304
3397
|
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();
|
|
3305
3398
|
}
|
|
3306
3399
|
}
|
|
3307
|
-
const
|
|
3400
|
+
const Rt = class Rt extends HTMLElement {
|
|
3308
3401
|
constructor() {
|
|
3309
3402
|
super(...arguments), this._instance = null, this._container = null;
|
|
3310
3403
|
}
|
|
@@ -3346,7 +3439,7 @@ const xt = class xt extends HTMLElement {
|
|
|
3346
3439
|
if (this._container)
|
|
3347
3440
|
try {
|
|
3348
3441
|
const t = this._getOptions();
|
|
3349
|
-
this._instance = new
|
|
3442
|
+
this._instance = new Be({
|
|
3350
3443
|
container: this._container,
|
|
3351
3444
|
...t
|
|
3352
3445
|
}), this._instance.init().then(() => {
|
|
@@ -3362,10 +3455,10 @@ const xt = class xt extends HTMLElement {
|
|
|
3362
3455
|
this._instance?.destroy(), this._instance = null;
|
|
3363
3456
|
}
|
|
3364
3457
|
};
|
|
3365
|
-
|
|
3366
|
-
let
|
|
3367
|
-
typeof customElements < "u" && !customElements.get("image-cloud") && customElements.define("image-cloud",
|
|
3458
|
+
Rt.observedAttributes = ["config", "images", "layout"];
|
|
3459
|
+
let yt = Rt;
|
|
3460
|
+
typeof customElements < "u" && !customElements.get("image-cloud") && customElements.define("image-cloud", yt);
|
|
3368
3461
|
export {
|
|
3369
|
-
|
|
3462
|
+
yt as ImageCloudElement
|
|
3370
3463
|
};
|
|
3371
3464
|
//# sourceMappingURL=web-component.js.map
|