@frybynite/image-cloud 0.9.1 → 0.9.2
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 +401 -423
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +9 -30
- 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 +9 -14
- package/dist/react.d.ts +9 -14
- package/dist/react.js +8 -30
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +9 -14
- package/dist/vue.js +8 -30
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +9 -14
- package/dist/web-component.js +44 -66
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/web-component.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare interface AnimationConfig {
|
|
|
11
11
|
duration: number;
|
|
12
12
|
easing: AnimationEasingConfig;
|
|
13
13
|
queue: AnimationQueueConfig;
|
|
14
|
-
performance?: AnimationPerformanceConfig;
|
|
15
14
|
entry?: EntryAnimationConfig;
|
|
16
15
|
idle?: IdleAnimationConfig;
|
|
17
16
|
}
|
|
@@ -123,11 +122,6 @@ declare interface AnimationParams {
|
|
|
123
122
|
easing: string;
|
|
124
123
|
}
|
|
125
124
|
|
|
126
|
-
declare interface AnimationPerformanceConfig {
|
|
127
|
-
useGPU?: boolean;
|
|
128
|
-
reduceMotion?: boolean;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
125
|
declare interface AnimationQueueConfig {
|
|
132
126
|
enabled: boolean;
|
|
133
127
|
interval: number;
|
|
@@ -562,11 +556,6 @@ export declare const FUNCTIONAL_CSS = "\n.fbn-ic-gallery {\n position: relative
|
|
|
562
556
|
|
|
563
557
|
export declare type GalleryConfig = ImageCloudConfig;
|
|
564
558
|
|
|
565
|
-
declare interface GestureInteractionConfig {
|
|
566
|
-
pinchToZoom?: boolean;
|
|
567
|
-
doubleTapToFocus?: boolean;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
559
|
export declare interface GoogleDriveFilesSource {
|
|
571
560
|
files: string[];
|
|
572
561
|
}
|
|
@@ -721,6 +710,14 @@ declare interface HoneycombAlgorithmConfig {
|
|
|
721
710
|
spacing?: number;
|
|
722
711
|
}
|
|
723
712
|
|
|
713
|
+
export declare class HoneycombPlacementLayout implements PlacementLayout {
|
|
714
|
+
private config;
|
|
715
|
+
constructor(config: LayoutConfig, _imageConfig?: ImageConfig);
|
|
716
|
+
generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig> & {
|
|
717
|
+
fixedHeight?: number;
|
|
718
|
+
}): ImageLayout[];
|
|
719
|
+
}
|
|
720
|
+
|
|
724
721
|
declare interface IdleAnimationConfig {
|
|
725
722
|
type: IdleAnimationType;
|
|
726
723
|
wiggle?: IdleWiggleConfig;
|
|
@@ -1056,8 +1053,7 @@ export declare function injectFunctionalStyles(): void;
|
|
|
1056
1053
|
declare interface InteractionConfig {
|
|
1057
1054
|
focus: FocusInteractionConfig;
|
|
1058
1055
|
navigation?: NavigationInteractionConfig;
|
|
1059
|
-
|
|
1060
|
-
disableDragging?: boolean;
|
|
1056
|
+
dragging?: boolean;
|
|
1061
1057
|
}
|
|
1062
1058
|
|
|
1063
1059
|
export declare type LayoutAlgorithm = 'random' | 'radial' | 'grid' | 'spiral' | 'cluster' | 'wave' | 'honeycomb';
|
|
@@ -1153,7 +1149,6 @@ declare interface LayoutEngineConfig {
|
|
|
1153
1149
|
|
|
1154
1150
|
declare interface LayoutSpacingConfig {
|
|
1155
1151
|
padding: number;
|
|
1156
|
-
minGap: number;
|
|
1157
1152
|
}
|
|
1158
1153
|
|
|
1159
1154
|
export declare type LoaderEntry = StaticLoaderEntry | GoogleDriveLoaderEntry;
|
package/dist/web-component.js
CHANGED
|
@@ -4,11 +4,11 @@ const mt = Object.freeze({
|
|
|
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
|
+
}), At = 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
|
+
}), Tt = 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 }),
|
|
@@ -115,10 +115,8 @@ const mt = Object.freeze({
|
|
|
115
115
|
densityFactor: 1,
|
|
116
116
|
// Default density
|
|
117
117
|
spacing: Object.freeze({
|
|
118
|
-
padding: 50
|
|
118
|
+
padding: 50
|
|
119
119
|
// padding from viewport edges
|
|
120
|
-
minGap: 20
|
|
121
|
-
// minimum spacing between images
|
|
122
120
|
})
|
|
123
121
|
}),
|
|
124
122
|
// Pattern-based animation configuration
|
|
@@ -139,12 +137,6 @@ const mt = Object.freeze({
|
|
|
139
137
|
interval: 150
|
|
140
138
|
// ms between processing queue items (when enabled)
|
|
141
139
|
}),
|
|
142
|
-
performance: Object.freeze({
|
|
143
|
-
useGPU: void 0,
|
|
144
|
-
// STUB: Not implemented yet
|
|
145
|
-
reduceMotion: void 0
|
|
146
|
-
// STUB: Not implemented yet
|
|
147
|
-
}),
|
|
148
140
|
entry: Object.freeze({
|
|
149
141
|
start: Object.freeze({
|
|
150
142
|
position: "nearest-edge",
|
|
@@ -179,20 +171,12 @@ const mt = Object.freeze({
|
|
|
179
171
|
// Use default animation duration
|
|
180
172
|
}),
|
|
181
173
|
navigation: Object.freeze({
|
|
182
|
-
keyboard:
|
|
183
|
-
|
|
184
|
-
swipe: void 0,
|
|
185
|
-
// STUB: Not implemented yet
|
|
174
|
+
keyboard: !0,
|
|
175
|
+
swipe: !0,
|
|
186
176
|
mouseWheel: void 0
|
|
187
177
|
// STUB: Not implemented yet
|
|
188
178
|
}),
|
|
189
|
-
|
|
190
|
-
pinchToZoom: void 0,
|
|
191
|
-
// STUB: Not implemented yet
|
|
192
|
-
doubleTapToFocus: void 0
|
|
193
|
-
// STUB: Not implemented yet
|
|
194
|
-
}),
|
|
195
|
-
disableDragging: !1
|
|
179
|
+
dragging: !0
|
|
196
180
|
}),
|
|
197
181
|
// Pattern-based rendering configuration
|
|
198
182
|
rendering: Object.freeze({
|
|
@@ -326,9 +310,6 @@ function te(o = {}) {
|
|
|
326
310
|
}), o.animation.queue && (s.animation.queue = {
|
|
327
311
|
...x.animation.queue,
|
|
328
312
|
...o.animation.queue
|
|
329
|
-
}), o.animation.performance && (s.animation.performance = {
|
|
330
|
-
...x.animation.performance,
|
|
331
|
-
...o.animation.performance
|
|
332
313
|
}), o.animation.entry && (s.animation.entry = {
|
|
333
314
|
...x.animation.entry,
|
|
334
315
|
...o.animation.entry,
|
|
@@ -353,9 +334,6 @@ function te(o = {}) {
|
|
|
353
334
|
}), o.interaction.navigation && (s.interaction.navigation = {
|
|
354
335
|
...x.interaction.navigation,
|
|
355
336
|
...o.interaction.navigation
|
|
356
|
-
}), o.interaction.gestures && (s.interaction.gestures = {
|
|
357
|
-
...x.interaction.gestures,
|
|
358
|
-
...o.interaction.gestures
|
|
359
337
|
})), o.rendering && (s.rendering = {
|
|
360
338
|
...x.rendering,
|
|
361
339
|
...o.rendering
|
|
@@ -382,10 +360,10 @@ function te(o = {}) {
|
|
|
382
360
|
return s;
|
|
383
361
|
}
|
|
384
362
|
function ee(o, t) {
|
|
385
|
-
return { ...o ?
|
|
363
|
+
return { ...o ? At[o] : At.playful, ...t };
|
|
386
364
|
}
|
|
387
365
|
function ie(o, t) {
|
|
388
|
-
return { ...o ?
|
|
366
|
+
return { ...o ? Tt[o] : Tt.gentle, ...t };
|
|
389
367
|
}
|
|
390
368
|
function ne(o, t) {
|
|
391
369
|
return { ...o ? Ct[o] : Ct.gentle, ...t };
|
|
@@ -656,7 +634,7 @@ function ue(o) {
|
|
|
656
634
|
}
|
|
657
635
|
const O = performance.now(), L = -r / 2, P = -s / 2;
|
|
658
636
|
function z(H) {
|
|
659
|
-
const k = H - O,
|
|
637
|
+
const k = H - O, A = Math.min(k / a, 1);
|
|
660
638
|
let D;
|
|
661
639
|
switch (p) {
|
|
662
640
|
case "bounce": {
|
|
@@ -664,7 +642,7 @@ function ue(o) {
|
|
|
664
642
|
n.bouncePreset,
|
|
665
643
|
n.bounce
|
|
666
644
|
);
|
|
667
|
-
D = se(
|
|
645
|
+
D = se(A, i, e, N);
|
|
668
646
|
break;
|
|
669
647
|
}
|
|
670
648
|
case "elastic": {
|
|
@@ -672,7 +650,7 @@ function ue(o) {
|
|
|
672
650
|
n.elasticPreset,
|
|
673
651
|
n.elastic
|
|
674
652
|
);
|
|
675
|
-
D = re(
|
|
653
|
+
D = re(A, i, e, N);
|
|
676
654
|
break;
|
|
677
655
|
}
|
|
678
656
|
case "wave": {
|
|
@@ -680,20 +658,20 @@ function ue(o) {
|
|
|
680
658
|
n.wavePreset,
|
|
681
659
|
n.wave
|
|
682
660
|
);
|
|
683
|
-
D = ce(
|
|
661
|
+
D = ce(A, i, e, N);
|
|
684
662
|
break;
|
|
685
663
|
}
|
|
686
664
|
default:
|
|
687
665
|
D = {
|
|
688
|
-
x: V(i.x, e.x,
|
|
689
|
-
y: V(i.y, e.y,
|
|
666
|
+
x: V(i.x, e.x, A),
|
|
667
|
+
y: V(i.y, e.y, A)
|
|
690
668
|
};
|
|
691
669
|
}
|
|
692
670
|
const G = D.x - e.x, U = D.y - e.y;
|
|
693
671
|
let M;
|
|
694
|
-
m ? M = he(
|
|
695
|
-
let
|
|
696
|
-
I ?
|
|
672
|
+
m ? M = he(A, c, y) : g ? M = V(d, c, A) : M = c;
|
|
673
|
+
let T;
|
|
674
|
+
I ? T = de(A, l, E) : v ? T = V(b, l, A) : T = l, t.style.transform = `translate(${L}px, ${P}px) translate(${G}px, ${U}px) rotate(${M}deg) scale(${T})`, A < 1 ? requestAnimationFrame(z) : (t.style.transform = `translate(${L}px, ${P}px) rotate(${c}deg) scale(${l})`, u && u());
|
|
697
675
|
}
|
|
698
676
|
requestAnimationFrame(z);
|
|
699
677
|
}
|
|
@@ -1310,15 +1288,15 @@ class ye {
|
|
|
1310
1288
|
}
|
|
1311
1289
|
let E = 1, R = 1;
|
|
1312
1290
|
for (; E < t; ) {
|
|
1313
|
-
const O = R / w, L = b > 0 ? 1 - O * b * 0.5 : 1, P = Math.max(g * 0.8, I / w * 1.5 / p.tightness), z = R * P, H = z * 1.5, k = Math.PI * (3 * (H + z) - Math.sqrt((3 * H + z) * (H + 3 * z))),
|
|
1291
|
+
const O = R / w, L = b > 0 ? 1 - O * b * 0.5 : 1, P = Math.max(g * 0.8, I / w * 1.5 / p.tightness), z = R * P, H = z * 1.5, k = Math.PI * (3 * (H + z) - Math.sqrt((3 * H + z) * (H + 3 * z))), A = this.estimateWidth(g), D = Math.floor(k / (A * 0.7));
|
|
1314
1292
|
if (D === 0) {
|
|
1315
1293
|
R++;
|
|
1316
1294
|
continue;
|
|
1317
1295
|
}
|
|
1318
1296
|
const G = 2 * Math.PI / D, U = R * (20 * Math.PI / 180);
|
|
1319
1297
|
for (let M = 0; M < D && E < t; M++) {
|
|
1320
|
-
const
|
|
1321
|
-
let _ = m + Math.cos(
|
|
1298
|
+
const T = M * G + U, N = f ? this.random(h, d) : 1, B = L * N, C = g * B;
|
|
1299
|
+
let _ = m + Math.cos(T) * H, F = y + Math.sin(T) * z;
|
|
1322
1300
|
const $ = C * 1.5 / 2, j = C / 2;
|
|
1323
1301
|
_ - $ < v ? _ = v + $ : _ + $ > a - v && (_ = a - v - $), F - j < v ? F = v + j : F + j > r - v && (F = r - v - j);
|
|
1324
1302
|
const Y = c === "random" ? this.random(l, u) : 0;
|
|
@@ -1402,7 +1380,7 @@ class we {
|
|
|
1402
1380
|
p,
|
|
1403
1381
|
l,
|
|
1404
1382
|
s
|
|
1405
|
-
), y = s.stagger === "row", w = s.stagger === "column", v = y ? g + 0.5 : g, I = w ? m + 0.5 : m, E = (b - s.gap * (g - 1)) / v, R = (p - s.gap * (m - 1)) / I, O = y ? E / 2 : 0, L = w ? R / 2 : 0, P = 1 + s.overlap, z = Math.min(E, R) * P, H = e.fixedHeight ? Math.min(e.fixedHeight, z) : z, k = g * E + (g - 1) * s.gap + O,
|
|
1383
|
+
), y = s.stagger === "row", w = s.stagger === "column", v = y ? g + 0.5 : g, I = w ? m + 0.5 : m, E = (b - s.gap * (g - 1)) / v, R = (p - s.gap * (m - 1)) / I, O = y ? E / 2 : 0, L = w ? R / 2 : 0, P = 1 + s.overlap, z = Math.min(E, R) * P, H = e.fixedHeight ? Math.min(e.fixedHeight, z) : z, k = g * E + (g - 1) * s.gap + O, A = m * R + (m - 1) * s.gap + L, D = c + (b - k) / 2, G = c + (p - A) / 2, U = g * m, M = s.columns !== "auto" && s.rows !== "auto", T = M && t > U;
|
|
1406
1384
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1407
1385
|
gridConfigColumns: s.columns,
|
|
1408
1386
|
gridConfigRows: s.rows,
|
|
@@ -1411,12 +1389,12 @@ class we {
|
|
|
1411
1389
|
cellCount: U,
|
|
1412
1390
|
hasFixedGrid: M,
|
|
1413
1391
|
imageCount: t,
|
|
1414
|
-
isOverflowMode:
|
|
1392
|
+
isOverflowMode: T
|
|
1415
1393
|
});
|
|
1416
|
-
const N =
|
|
1394
|
+
const N = T ? new Array(U).fill(0) : [], B = Math.min(E, R) * s.overflowOffset;
|
|
1417
1395
|
for (let C = 0; C < t; C++) {
|
|
1418
1396
|
let _, F, X = 0;
|
|
1419
|
-
if (
|
|
1397
|
+
if (T && C >= U) {
|
|
1420
1398
|
const q = C - U, W = q % U;
|
|
1421
1399
|
X = Math.floor(q / U) + 1, N[W]++, s.fillDirection === "row" ? (_ = W % g, F = Math.floor(W / g)) : (F = W % m, _ = Math.floor(W / m));
|
|
1422
1400
|
} else
|
|
@@ -1431,7 +1409,7 @@ class we {
|
|
|
1431
1409
|
$ += this.random(-q, q), j += this.random(-W, W);
|
|
1432
1410
|
}
|
|
1433
1411
|
let Y = $, J = j;
|
|
1434
|
-
if (!
|
|
1412
|
+
if (!T && s.fillDirection === "row") {
|
|
1435
1413
|
const q = t % g || g;
|
|
1436
1414
|
if (F === Math.floor((t - 1) / g) && q < g) {
|
|
1437
1415
|
const Rt = q * E + (q - 1) * s.gap;
|
|
@@ -1447,7 +1425,7 @@ class we {
|
|
|
1447
1425
|
s.jitter > 0 ? dt = this.random(q * s.jitter, W * s.jitter) : dt = this.random(q, W);
|
|
1448
1426
|
}
|
|
1449
1427
|
let ut;
|
|
1450
|
-
|
|
1428
|
+
T && X > 0 ? ut = 50 - X : ut = T ? 100 + C : C + 1, n.push({
|
|
1451
1429
|
id: C,
|
|
1452
1430
|
x: Y,
|
|
1453
1431
|
y: J,
|
|
@@ -1518,7 +1496,7 @@ class Se {
|
|
|
1518
1496
|
const $ = I * 0.3 * s.tightness;
|
|
1519
1497
|
E = $ * v + s.startAngle, R = this.calculateLogarithmicRadius($, t, w, s.tightness);
|
|
1520
1498
|
}
|
|
1521
|
-
const O = m + Math.cos(E) * R, L = y + Math.sin(E) * R, P = R / w, z = g > 0 ? 1 - P * g * 0.5 : 1, H = p ? this.random(f, b) : 1, k = z * H,
|
|
1499
|
+
const O = m + Math.cos(E) * R, L = y + Math.sin(E) * R, P = R / w, z = g > 0 ? 1 - P * g * 0.5 : 1, H = p ? this.random(f, b) : 1, k = z * H, A = l * k, G = A * 1.5 / 2, U = A / 2, M = c + G, T = a - c - G, N = c + U, B = r - c - U, C = Math.max(M, Math.min(O, T)), _ = Math.max(N, Math.min(L, B));
|
|
1522
1500
|
let F = 0;
|
|
1523
1501
|
if (u === "random") {
|
|
1524
1502
|
const $ = E * 180 / Math.PI % 360, j = this.random(h, d);
|
|
@@ -1531,7 +1509,7 @@ class Se {
|
|
|
1531
1509
|
y: _,
|
|
1532
1510
|
rotation: F,
|
|
1533
1511
|
scale: k,
|
|
1534
|
-
baseSize:
|
|
1512
|
+
baseSize: A,
|
|
1535
1513
|
zIndex: X
|
|
1536
1514
|
});
|
|
1537
1515
|
}
|
|
@@ -1633,10 +1611,10 @@ class Re {
|
|
|
1633
1611
|
}
|
|
1634
1612
|
const P = 1 + s.overlap * 0.5, z = 1 + s.overlap * 0.3;
|
|
1635
1613
|
O /= P, L /= P;
|
|
1636
|
-
const H = p ? this.random(f, b) : 1, k = z * H,
|
|
1614
|
+
const H = p ? this.random(f, b) : 1, k = z * H, A = l * k;
|
|
1637
1615
|
let D = I.x + O, G = I.y + L;
|
|
1638
|
-
const M =
|
|
1639
|
-
D = Math.max(c + M, Math.min(D, a - c - M)), G = Math.max(c +
|
|
1616
|
+
const M = A * 1.5 / 2, T = A / 2;
|
|
1617
|
+
D = Math.max(c + M, Math.min(D, a - c - M)), G = Math.max(c + T, Math.min(G, r - c - T));
|
|
1640
1618
|
const N = u === "random" ? this.random(h, d) : 0, C = Math.sqrt(O * O + L * L) / I.spread, _ = Math.round((1 - C) * 50) + 1;
|
|
1641
1619
|
n.push({
|
|
1642
1620
|
id: w,
|
|
@@ -1644,7 +1622,7 @@ class Re {
|
|
|
1644
1622
|
y: G,
|
|
1645
1623
|
rotation: N,
|
|
1646
1624
|
scale: k,
|
|
1647
|
-
baseSize:
|
|
1625
|
+
baseSize: A,
|
|
1648
1626
|
zIndex: _
|
|
1649
1627
|
}), w++;
|
|
1650
1628
|
}
|
|
@@ -1711,7 +1689,7 @@ class Re {
|
|
|
1711
1689
|
return Math.random() * (i - t) + t;
|
|
1712
1690
|
}
|
|
1713
1691
|
}
|
|
1714
|
-
class
|
|
1692
|
+
class Ae {
|
|
1715
1693
|
constructor(t, i = {}) {
|
|
1716
1694
|
this.config = t, this.imageConfig = i;
|
|
1717
1695
|
}
|
|
@@ -1726,12 +1704,12 @@ class Te {
|
|
|
1726
1704
|
const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = e.fixedHeight ?? s, g = {
|
|
1727
1705
|
...Nt,
|
|
1728
1706
|
...this.config.wave
|
|
1729
|
-
}, { rows: m, amplitude: y, frequency: w, phaseShift: v, synchronization: I } = g, E = Math.ceil(t / m), L = p * 1.5 / 2, P = c + L, z = a - c - L, H = z - P, k = E > 1 ? H / (E - 1) : 0,
|
|
1707
|
+
}, { rows: m, amplitude: y, frequency: w, phaseShift: v, synchronization: I } = g, E = Math.ceil(t / m), L = p * 1.5 / 2, P = c + L, z = a - c - L, H = z - P, k = E > 1 ? H / (E - 1) : 0, A = c + y + p / 2, D = r - c - y - p / 2, G = D - A, U = m > 1 ? G / (m - 1) : 0;
|
|
1730
1708
|
let M = 0;
|
|
1731
|
-
for (let
|
|
1732
|
-
const N = m === 1 ? (
|
|
1709
|
+
for (let T = 0; T < m && M < t; T++) {
|
|
1710
|
+
const N = m === 1 ? (A + D) / 2 : A + T * U;
|
|
1733
1711
|
let B = 0;
|
|
1734
|
-
I === "offset" ? B =
|
|
1712
|
+
I === "offset" ? B = T * v : I === "alternating" && (B = T * Math.PI);
|
|
1735
1713
|
for (let C = 0; C < E && M < t; C++) {
|
|
1736
1714
|
const _ = E === 1 ? (P + z) / 2 : P + C * k, F = this.calculateWaveY(_, a, y, w, B), X = _, $ = N + F, j = b ? this.random(d, f) : 1, Y = p * j;
|
|
1737
1715
|
let J = 0;
|
|
@@ -1801,10 +1779,10 @@ const xt = 100, Q = 100 / Math.sqrt(3), St = [
|
|
|
1801
1779
|
// lower-left
|
|
1802
1780
|
[0, 50]
|
|
1803
1781
|
// left
|
|
1804
|
-
],
|
|
1782
|
+
], Te = St[1][0] / xt, Ce = St[2][1] / xt;
|
|
1805
1783
|
function Le(o) {
|
|
1806
1784
|
return {
|
|
1807
|
-
colStep:
|
|
1785
|
+
colStep: Te * o,
|
|
1808
1786
|
rowOffset: Ce * o
|
|
1809
1787
|
};
|
|
1810
1788
|
}
|
|
@@ -1884,7 +1862,7 @@ class De {
|
|
|
1884
1862
|
case "cluster":
|
|
1885
1863
|
return new Re(this.config, this.imageConfig);
|
|
1886
1864
|
case "wave":
|
|
1887
|
-
return new
|
|
1865
|
+
return new Ae(this.config, this.imageConfig);
|
|
1888
1866
|
case "honeycomb":
|
|
1889
1867
|
return new ze(this.config, this.imageConfig);
|
|
1890
1868
|
default:
|
|
@@ -3328,14 +3306,14 @@ class ei {
|
|
|
3328
3306
|
this.containerEl = this.containerRef;
|
|
3329
3307
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
3330
3308
|
throw new Error(`Container #${this.containerId} not found`);
|
|
3331
|
-
this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new bt(this.containerEl, {
|
|
3309
|
+
this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new bt(this.containerEl, {
|
|
3332
3310
|
onNext: () => this.navigateToNextImage(),
|
|
3333
3311
|
onPrev: () => this.navigateToPreviousImage(),
|
|
3334
3312
|
onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
|
|
3335
3313
|
onDragEnd: (t) => {
|
|
3336
3314
|
t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Xe);
|
|
3337
3315
|
}
|
|
3338
|
-
}), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3316
|
+
})), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3339
3317
|
} catch (t) {
|
|
3340
3318
|
console.error("Gallery initialization failed:", t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
|
|
3341
3319
|
}
|
|
@@ -3364,7 +3342,7 @@ class ei {
|
|
|
3364
3342
|
return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
|
|
3365
3343
|
}
|
|
3366
3344
|
setupEventListeners() {
|
|
3367
|
-
|
|
3345
|
+
this.fullConfig.interaction.navigation?.keyboard !== !1 && this.containerEl.addEventListener("keydown", (t) => {
|
|
3368
3346
|
t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
|
|
3369
3347
|
}), document.addEventListener("click", (t) => {
|
|
3370
3348
|
this.swipeEngine?.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter());
|
|
@@ -3538,7 +3516,7 @@ class ei {
|
|
|
3538
3516
|
h.style.left = `${d - 6}px`, h.style.top = `${f - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(h);
|
|
3539
3517
|
})), t.forEach((l, u) => {
|
|
3540
3518
|
const h = document.createElement("img");
|
|
3541
|
-
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.
|
|
3519
|
+
h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.dragging === !1 && (h.draggable = !1), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
|
|
3542
3520
|
const d = a[u];
|
|
3543
3521
|
h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)), st(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
|
|
3544
3522
|
if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
|