@frybynite/image-cloud 0.9.6 → 0.10.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/README.md +14 -15
- package/dist/image-cloud-auto-init.js +47 -46
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +79 -74
- 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 +2 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +101 -101
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +2 -0
- package/dist/vue.js +53 -53
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +2 -0
- package/dist/web-component.js +3 -3
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/image-cloud.js
CHANGED
|
@@ -13,7 +13,7 @@ const mt = Object.freeze({
|
|
|
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 }),
|
|
@@ -24,7 +24,7 @@ const mt = Object.freeze({
|
|
|
24
24
|
mode: "none"
|
|
25
25
|
}), Et = Object.freeze({
|
|
26
26
|
mode: "none"
|
|
27
|
-
}),
|
|
27
|
+
}), Mt = Object.freeze({
|
|
28
28
|
default: Object.freeze({
|
|
29
29
|
border: Object.freeze({
|
|
30
30
|
width: 0,
|
|
@@ -82,7 +82,7 @@ const mt = Object.freeze({
|
|
|
82
82
|
min: -15,
|
|
83
83
|
max: 15
|
|
84
84
|
})
|
|
85
|
-
}),
|
|
85
|
+
}), Ft = Object.freeze({
|
|
86
86
|
sizing: Bt,
|
|
87
87
|
rotation: jt
|
|
88
88
|
}), zt = Object.freeze({
|
|
@@ -103,7 +103,7 @@ const mt = Object.freeze({
|
|
|
103
103
|
debug: Ot
|
|
104
104
|
}),
|
|
105
105
|
// Image sizing and rotation configuration
|
|
106
|
-
image:
|
|
106
|
+
image: Ft,
|
|
107
107
|
// Pattern-based layout configuration
|
|
108
108
|
layout: Object.freeze({
|
|
109
109
|
algorithm: "radial",
|
|
@@ -186,7 +186,7 @@ const mt = Object.freeze({
|
|
|
186
186
|
showFocusOutline: !1
|
|
187
187
|
}),
|
|
188
188
|
// Image styling
|
|
189
|
-
styling:
|
|
189
|
+
styling: Mt
|
|
190
190
|
});
|
|
191
191
|
function Z(o, t) {
|
|
192
192
|
if (!o) return t || {};
|
|
@@ -274,12 +274,12 @@ function Zt(o = {}) {
|
|
|
274
274
|
}, a = {
|
|
275
275
|
loaders: n,
|
|
276
276
|
config: r,
|
|
277
|
-
image: Vt(
|
|
277
|
+
image: Vt(Ft, e),
|
|
278
278
|
layout: { ...A.layout },
|
|
279
279
|
animation: { ...A.animation },
|
|
280
280
|
interaction: { ...A.interaction },
|
|
281
281
|
ui: { ...A.ui },
|
|
282
|
-
styling: Yt(
|
|
282
|
+
styling: Yt(Mt, o.styling)
|
|
283
283
|
};
|
|
284
284
|
o.layout && (a.layout = {
|
|
285
285
|
...A.layout,
|
|
@@ -351,7 +351,7 @@ function te(o, t) {
|
|
|
351
351
|
return { ...o ? At[o] : At.gentle, ...t };
|
|
352
352
|
}
|
|
353
353
|
function ee(o, t) {
|
|
354
|
-
return { ...o ?
|
|
354
|
+
return { ...o ? Ct[o] : Ct.gentle, ...t };
|
|
355
355
|
}
|
|
356
356
|
class ie {
|
|
357
357
|
constructor(t) {
|
|
@@ -619,7 +619,7 @@ function he(o) {
|
|
|
619
619
|
}
|
|
620
620
|
const z = performance.now(), L = -r / 2, _ = -a / 2;
|
|
621
621
|
function O(H) {
|
|
622
|
-
const N = H - z,
|
|
622
|
+
const N = H - z, C = Math.min(N / s, 1);
|
|
623
623
|
let D;
|
|
624
624
|
switch (p) {
|
|
625
625
|
case "bounce": {
|
|
@@ -627,7 +627,7 @@ function he(o) {
|
|
|
627
627
|
n.bouncePreset,
|
|
628
628
|
n.bounce
|
|
629
629
|
);
|
|
630
|
-
D = ne(
|
|
630
|
+
D = ne(C, i, e, k);
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
633
|
case "elastic": {
|
|
@@ -635,7 +635,7 @@ function he(o) {
|
|
|
635
635
|
n.elasticPreset,
|
|
636
636
|
n.elastic
|
|
637
637
|
);
|
|
638
|
-
D = se(
|
|
638
|
+
D = se(C, i, e, k);
|
|
639
639
|
break;
|
|
640
640
|
}
|
|
641
641
|
case "wave": {
|
|
@@ -643,20 +643,20 @@ function he(o) {
|
|
|
643
643
|
n.wavePreset,
|
|
644
644
|
n.wave
|
|
645
645
|
);
|
|
646
|
-
D = ae(
|
|
646
|
+
D = ae(C, i, e, k);
|
|
647
647
|
break;
|
|
648
648
|
}
|
|
649
649
|
default:
|
|
650
650
|
D = {
|
|
651
|
-
x: J(i.x, e.x,
|
|
652
|
-
y: J(i.y, e.y,
|
|
651
|
+
x: J(i.x, e.x, C),
|
|
652
|
+
y: J(i.y, e.y, C)
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
const W = D.x - e.x, U = D.y - e.y;
|
|
656
|
-
let
|
|
657
|
-
m ?
|
|
658
|
-
let
|
|
659
|
-
S ?
|
|
656
|
+
let M;
|
|
657
|
+
m ? M = ce(C, c, y) : f ? M = J(d, c, C) : M = c;
|
|
658
|
+
let R;
|
|
659
|
+
S ? R = le(C, l, w) : v ? R = J(b, l, C) : R = l, t.style.transform = `translate(${L}px, ${_}px) translate(${W}px, ${U}px) rotate(${M}deg) scale(${R})`, C < 1 ? requestAnimationFrame(O) : (t.style.transform = `translate(${L}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
|
|
660
660
|
}
|
|
661
661
|
requestAnimationFrame(O);
|
|
662
662
|
}
|
|
@@ -1273,22 +1273,22 @@ class pe {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
let w = 1, I = 1;
|
|
1275
1275
|
for (; w < t; ) {
|
|
1276
|
-
const z = I / E, L = b > 0 ? 1 - z * b * 0.5 : 1, _ = Math.max(f * 0.8, S / E * 1.5 / p.tightness), O = I * _, H = O * 1.5, N = Math.PI * (3 * (H + O) - Math.sqrt((3 * H + O) * (H + 3 * O))),
|
|
1276
|
+
const z = I / E, L = b > 0 ? 1 - z * b * 0.5 : 1, _ = Math.max(f * 0.8, S / E * 1.5 / p.tightness), O = I * _, H = O * 1.5, N = Math.PI * (3 * (H + O) - Math.sqrt((3 * H + O) * (H + 3 * O))), C = this.estimateWidth(f), D = Math.floor(N / (C * 0.7));
|
|
1277
1277
|
if (D === 0) {
|
|
1278
1278
|
I++;
|
|
1279
1279
|
continue;
|
|
1280
1280
|
}
|
|
1281
1281
|
const W = 2 * Math.PI / D, U = I * (20 * Math.PI / 180);
|
|
1282
|
-
for (let
|
|
1283
|
-
const
|
|
1284
|
-
let $ = m + Math.cos(
|
|
1282
|
+
for (let M = 0; M < D && w < t; M++) {
|
|
1283
|
+
const R = M * W + U, k = g ? this.random(h, d) : 1, q = L * k, T = f * q;
|
|
1284
|
+
let $ = m + Math.cos(R) * H, F = y + Math.sin(R) * O;
|
|
1285
1285
|
const P = T * 1.5 / 2, B = T / 2;
|
|
1286
|
-
$ - P < v ? $ = v + P : $ + P > s - v && ($ = s - v - P),
|
|
1286
|
+
$ - P < v ? $ = v + P : $ + P > s - v && ($ = s - v - P), F - B < v ? F = v + B : F + B > r - v && (F = r - v - B);
|
|
1287
1287
|
const Y = c === "random" ? this.random(l, u) : 0;
|
|
1288
1288
|
n.push({
|
|
1289
1289
|
id: w,
|
|
1290
1290
|
x: $,
|
|
1291
|
-
y:
|
|
1291
|
+
y: F,
|
|
1292
1292
|
rotation: Y,
|
|
1293
1293
|
scale: q,
|
|
1294
1294
|
baseSize: T,
|
|
@@ -1329,7 +1329,7 @@ const be = {
|
|
|
1329
1329
|
alignment: "center",
|
|
1330
1330
|
gap: 10,
|
|
1331
1331
|
overflowOffset: 0.25
|
|
1332
|
-
},
|
|
1332
|
+
}, Rt = [
|
|
1333
1333
|
{ x: 1, y: 1 },
|
|
1334
1334
|
// bottom-right
|
|
1335
1335
|
{ x: -1, y: -1 },
|
|
@@ -1365,28 +1365,28 @@ class ye {
|
|
|
1365
1365
|
p,
|
|
1366
1366
|
l,
|
|
1367
1367
|
a
|
|
1368
|
-
), y = a.stagger === "row", E = a.stagger === "column", v = y ? f + 0.5 : f, S = E ? m + 0.5 : m, w = (b - a.gap * (f - 1)) / v, I = (p - a.gap * (m - 1)) / S, z = y ? w / 2 : 0, L = E ? I / 2 : 0, _ = 1 + a.overlap, O = Math.min(w, I) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, O) : O, N = f * w + (f - 1) * a.gap + z,
|
|
1368
|
+
), y = a.stagger === "row", E = a.stagger === "column", v = y ? f + 0.5 : f, S = E ? m + 0.5 : m, w = (b - a.gap * (f - 1)) / v, I = (p - a.gap * (m - 1)) / S, z = y ? w / 2 : 0, L = E ? I / 2 : 0, _ = 1 + a.overlap, O = Math.min(w, I) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, O) : O, N = f * w + (f - 1) * a.gap + z, C = m * I + (m - 1) * a.gap + L, D = c + (b - N) / 2, W = c + (p - C) / 2, U = f * m, M = a.columns !== "auto" && a.rows !== "auto", R = M && t > U;
|
|
1369
1369
|
typeof window < "u" && (window.__gridOverflowDebug = {
|
|
1370
1370
|
gridConfigColumns: a.columns,
|
|
1371
1371
|
gridConfigRows: a.rows,
|
|
1372
1372
|
columns: f,
|
|
1373
1373
|
rows: m,
|
|
1374
1374
|
cellCount: U,
|
|
1375
|
-
hasFixedGrid:
|
|
1375
|
+
hasFixedGrid: M,
|
|
1376
1376
|
imageCount: t,
|
|
1377
|
-
isOverflowMode:
|
|
1377
|
+
isOverflowMode: R
|
|
1378
1378
|
});
|
|
1379
|
-
const k =
|
|
1379
|
+
const k = R ? new Array(U).fill(0) : [], q = Math.min(w, I) * a.overflowOffset;
|
|
1380
1380
|
for (let T = 0; T < t; T++) {
|
|
1381
|
-
let $,
|
|
1382
|
-
if (
|
|
1381
|
+
let $, F, X = 0;
|
|
1382
|
+
if (R && T >= U) {
|
|
1383
1383
|
const G = T - U, j = G % U;
|
|
1384
|
-
X = Math.floor(G / U) + 1, k[j]++, a.fillDirection === "row" ? ($ = j % f,
|
|
1384
|
+
X = Math.floor(G / U) + 1, k[j]++, a.fillDirection === "row" ? ($ = j % f, F = Math.floor(j / f)) : (F = j % m, $ = Math.floor(j / m));
|
|
1385
1385
|
} else
|
|
1386
|
-
a.fillDirection === "row" ? ($ = T % f,
|
|
1387
|
-
let P = D + $ * (w + a.gap) + w / 2, B = W +
|
|
1388
|
-
if (a.stagger === "row" &&
|
|
1389
|
-
const G = (X - 1) %
|
|
1386
|
+
a.fillDirection === "row" ? ($ = T % f, F = Math.floor(T / f)) : (F = T % m, $ = Math.floor(T / m));
|
|
1387
|
+
let P = D + $ * (w + a.gap) + w / 2, B = W + F * (I + a.gap) + I / 2;
|
|
1388
|
+
if (a.stagger === "row" && F % 2 === 1 ? P += w / 2 : a.stagger === "column" && $ % 2 === 1 && (B += I / 2), X > 0) {
|
|
1389
|
+
const G = (X - 1) % Rt.length, j = Rt[G];
|
|
1390
1390
|
P += j.x * q, B += j.y * q;
|
|
1391
1391
|
}
|
|
1392
1392
|
if (a.jitter > 0) {
|
|
@@ -1394,9 +1394,9 @@ class ye {
|
|
|
1394
1394
|
P += this.random(-G, G), B += this.random(-j, j);
|
|
1395
1395
|
}
|
|
1396
1396
|
let Y = P, V = B;
|
|
1397
|
-
if (!
|
|
1397
|
+
if (!R && a.fillDirection === "row") {
|
|
1398
1398
|
const G = t % f || f;
|
|
1399
|
-
if (
|
|
1399
|
+
if (F === Math.floor((t - 1) / f) && G < f) {
|
|
1400
1400
|
const St = G * w + (G - 1) * a.gap;
|
|
1401
1401
|
let gt = 0;
|
|
1402
1402
|
a.alignment === "center" ? gt = (N - St) / 2 : a.alignment === "end" && (gt = N - St), Y += gt;
|
|
@@ -1410,7 +1410,7 @@ class ye {
|
|
|
1410
1410
|
a.jitter > 0 ? ut = this.random(G * a.jitter, j * a.jitter) : ut = this.random(G, j);
|
|
1411
1411
|
}
|
|
1412
1412
|
let ft;
|
|
1413
|
-
|
|
1413
|
+
R && X > 0 ? ft = 50 - X : ft = R ? 100 + T : T + 1, n.push({
|
|
1414
1414
|
id: T,
|
|
1415
1415
|
x: Y,
|
|
1416
1416
|
y: V,
|
|
@@ -1481,20 +1481,20 @@ class we {
|
|
|
1481
1481
|
const P = S * 0.3 * a.tightness;
|
|
1482
1482
|
w = P * v + a.startAngle, I = this.calculateLogarithmicRadius(P, t, E, a.tightness);
|
|
1483
1483
|
}
|
|
1484
|
-
const z = m + Math.cos(w) * I, L = y + Math.sin(w) * I, _ = I / E, O = f > 0 ? 1 - _ * f * 0.5 : 1, H = p ? this.random(g, b) : 1, N = O * H,
|
|
1485
|
-
let
|
|
1484
|
+
const z = m + Math.cos(w) * I, L = y + Math.sin(w) * I, _ = I / E, O = f > 0 ? 1 - _ * f * 0.5 : 1, H = p ? this.random(g, b) : 1, N = O * H, C = l * N, W = C * 1.5 / 2, U = C / 2, M = c + W, R = s - c - W, k = c + U, q = r - c - U, T = Math.max(M, Math.min(z, R)), $ = Math.max(k, Math.min(L, q));
|
|
1485
|
+
let F = 0;
|
|
1486
1486
|
if (u === "random") {
|
|
1487
1487
|
const P = w * 180 / Math.PI % 360, B = this.random(h, d);
|
|
1488
|
-
|
|
1489
|
-
} else u === "tangent" && (
|
|
1488
|
+
F = a.spiralType === "golden" ? B : P * 0.1 + B * 0.9;
|
|
1489
|
+
} else u === "tangent" && (F = this.calculateSpiralTangent(w, I, a));
|
|
1490
1490
|
const X = t - S;
|
|
1491
1491
|
n.push({
|
|
1492
1492
|
id: S,
|
|
1493
1493
|
x: T,
|
|
1494
1494
|
y: $,
|
|
1495
|
-
rotation:
|
|
1495
|
+
rotation: F,
|
|
1496
1496
|
scale: N,
|
|
1497
|
-
baseSize:
|
|
1497
|
+
baseSize: C,
|
|
1498
1498
|
zIndex: X
|
|
1499
1499
|
});
|
|
1500
1500
|
}
|
|
@@ -1591,15 +1591,15 @@ class Se {
|
|
|
1591
1591
|
if (a.distribution === "gaussian")
|
|
1592
1592
|
z = this.gaussianRandom() * S.spread, L = this.gaussianRandom() * S.spread;
|
|
1593
1593
|
else {
|
|
1594
|
-
const
|
|
1595
|
-
z = Math.cos(
|
|
1594
|
+
const F = this.random(0, Math.PI * 2), X = this.random(0, S.spread);
|
|
1595
|
+
z = Math.cos(F) * X, L = Math.sin(F) * X;
|
|
1596
1596
|
}
|
|
1597
1597
|
const _ = 1 + a.overlap * 0.5, O = 1 + a.overlap * 0.3;
|
|
1598
1598
|
z /= _, L /= _;
|
|
1599
|
-
const H = p ? this.random(g, b) : 1, N = O * H,
|
|
1599
|
+
const H = p ? this.random(g, b) : 1, N = O * H, C = l * N;
|
|
1600
1600
|
let D = S.x + z, W = S.y + L;
|
|
1601
|
-
const
|
|
1602
|
-
D = Math.max(c +
|
|
1601
|
+
const M = C * 1.5 / 2, R = C / 2;
|
|
1602
|
+
D = Math.max(c + M, Math.min(D, s - c - M)), W = Math.max(c + R, Math.min(W, r - c - R));
|
|
1603
1603
|
const k = u === "random" ? this.random(h, d) : 0, T = Math.sqrt(z * z + L * L) / S.spread, $ = Math.round((1 - T) * 50) + 1;
|
|
1604
1604
|
n.push({
|
|
1605
1605
|
id: E,
|
|
@@ -1607,7 +1607,7 @@ class Se {
|
|
|
1607
1607
|
y: W,
|
|
1608
1608
|
rotation: k,
|
|
1609
1609
|
scale: N,
|
|
1610
|
-
baseSize:
|
|
1610
|
+
baseSize: C,
|
|
1611
1611
|
zIndex: $
|
|
1612
1612
|
}), E++;
|
|
1613
1613
|
}
|
|
@@ -1689,26 +1689,26 @@ class Ie {
|
|
|
1689
1689
|
const n = [], { width: s, height: r } = i, a = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || g !== 1, p = e.fixedHeight ?? a, f = {
|
|
1690
1690
|
...Ht,
|
|
1691
1691
|
...this.config.wave
|
|
1692
|
-
}, { rows: m, amplitude: y, frequency: E, phaseShift: v, synchronization: S } = f, w = Math.ceil(t / m), L = p * 1.5 / 2, _ = c + L, O = s - c - L, H = O - _, N = w > 1 ? H / (w - 1) : 0,
|
|
1693
|
-
let
|
|
1694
|
-
for (let
|
|
1695
|
-
const k = m === 1 ? (
|
|
1692
|
+
}, { rows: m, amplitude: y, frequency: E, phaseShift: v, synchronization: S } = f, w = Math.ceil(t / m), L = p * 1.5 / 2, _ = c + L, O = s - c - L, H = O - _, N = w > 1 ? H / (w - 1) : 0, C = c + y + p / 2, D = r - c - y - p / 2, W = D - C, U = m > 1 ? W / (m - 1) : 0;
|
|
1693
|
+
let M = 0;
|
|
1694
|
+
for (let R = 0; R < m && M < t; R++) {
|
|
1695
|
+
const k = m === 1 ? (C + D) / 2 : C + R * U;
|
|
1696
1696
|
let q = 0;
|
|
1697
|
-
S === "offset" ? q =
|
|
1698
|
-
for (let T = 0; T < w &&
|
|
1699
|
-
const $ = w === 1 ? (_ + O) / 2 : _ + T * N,
|
|
1697
|
+
S === "offset" ? q = R * v : S === "alternating" && (q = R * Math.PI);
|
|
1698
|
+
for (let T = 0; T < w && M < t; T++) {
|
|
1699
|
+
const $ = w === 1 ? (_ + O) / 2 : _ + T * N, F = this.calculateWaveY($, s, y, E, q), X = $, P = k + F, B = b ? this.random(d, g) : 1, Y = p * B;
|
|
1700
1700
|
let V = 0;
|
|
1701
1701
|
l === "tangent" ? V = this.calculateRotation($, s, y, E, q) : l === "random" && (V = this.random(u, h));
|
|
1702
1702
|
const K = Y * 1.5 / 2, lt = Y / 2, nt = c + K, ot = s - c - K, ht = c + lt, dt = r - c - lt;
|
|
1703
1703
|
n.push({
|
|
1704
|
-
id:
|
|
1704
|
+
id: M,
|
|
1705
1705
|
x: Math.max(nt, Math.min(X, ot)),
|
|
1706
1706
|
y: Math.max(ht, Math.min(P, dt)),
|
|
1707
1707
|
rotation: V,
|
|
1708
1708
|
scale: B,
|
|
1709
1709
|
baseSize: Y,
|
|
1710
|
-
zIndex:
|
|
1711
|
-
}),
|
|
1710
|
+
zIndex: M + 1
|
|
1711
|
+
}), M++;
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
return n;
|
|
@@ -1764,15 +1764,15 @@ const wt = 100, Q = 100 / Math.sqrt(3), xt = [
|
|
|
1764
1764
|
// lower-left
|
|
1765
1765
|
[0, 50]
|
|
1766
1766
|
// left
|
|
1767
|
-
], Ae = xt[1][0] / wt,
|
|
1768
|
-
function
|
|
1767
|
+
], Ae = xt[1][0] / wt, Ce = xt[2][1] / wt;
|
|
1768
|
+
function Re(o) {
|
|
1769
1769
|
return {
|
|
1770
1770
|
colStep: Ae * o,
|
|
1771
|
-
rowOffset:
|
|
1771
|
+
rowOffset: Ce * o
|
|
1772
1772
|
};
|
|
1773
1773
|
}
|
|
1774
1774
|
function Te(o, t, i, e, n, s) {
|
|
1775
|
-
const { colStep: r } =
|
|
1775
|
+
const { colStep: r } = Re(s);
|
|
1776
1776
|
return {
|
|
1777
1777
|
px: e + r * o,
|
|
1778
1778
|
py: n + s * (t + o / 2)
|
|
@@ -1786,7 +1786,7 @@ const Le = [
|
|
|
1786
1786
|
[0, -1, 1],
|
|
1787
1787
|
[1, -1, 0]
|
|
1788
1788
|
];
|
|
1789
|
-
function
|
|
1789
|
+
function Me(o) {
|
|
1790
1790
|
if (o === 0) return [[0, 0, 0]];
|
|
1791
1791
|
const t = [];
|
|
1792
1792
|
let [i, e, n] = [0, -o, o];
|
|
@@ -1795,7 +1795,7 @@ function Fe(o) {
|
|
|
1795
1795
|
t.push([i, e, n]), i += s, e += r, n += a;
|
|
1796
1796
|
return t;
|
|
1797
1797
|
}
|
|
1798
|
-
class
|
|
1798
|
+
class Fe {
|
|
1799
1799
|
// imageConfig intentionally not stored — honeycomb forces uniform sizing (rotation/variance
|
|
1800
1800
|
// would break hex tiling). Kept as parameter for interface compatibility.
|
|
1801
1801
|
constructor(t, i = {}) {
|
|
@@ -1808,7 +1808,7 @@ class Me {
|
|
|
1808
1808
|
}.spacing ?? 0, d = l + h;
|
|
1809
1809
|
let g = 0, b = 0;
|
|
1810
1810
|
for (; g < t; ) {
|
|
1811
|
-
const p =
|
|
1811
|
+
const p = Me(b);
|
|
1812
1812
|
for (const [f, m, y] of p) {
|
|
1813
1813
|
if (g >= t) break;
|
|
1814
1814
|
const { px: E, py: v } = Te(f, m, y, a, c, d);
|
|
@@ -1849,7 +1849,7 @@ class ze {
|
|
|
1849
1849
|
case "wave":
|
|
1850
1850
|
return new Ie(this.config, this.imageConfig);
|
|
1851
1851
|
case "honeycomb":
|
|
1852
|
-
return new
|
|
1852
|
+
return new Fe(this.config, this.imageConfig);
|
|
1853
1853
|
default:
|
|
1854
1854
|
return new me(this.config, this.imageConfig);
|
|
1855
1855
|
}
|
|
@@ -3292,7 +3292,7 @@ class Qe {
|
|
|
3292
3292
|
createLoader() {
|
|
3293
3293
|
const t = this.fullConfig.loaders, i = this.fullConfig.config.loaders ?? {};
|
|
3294
3294
|
if (!t || t.length === 0)
|
|
3295
|
-
throw new Error("No loaders configured. Provide `images`, `loaders`, or both
|
|
3295
|
+
throw new Error("No loaders configured. Provide `images`, `loaders`, or both.\n Example: imageCloud({ container: 'id', images: ['https://...'] })");
|
|
3296
3296
|
const e = t.map((n) => this.createLoaderFromEntry(n, i));
|
|
3297
3297
|
return e.length === 1 ? e[0] : new Ve({
|
|
3298
3298
|
loaders: e,
|
|
@@ -3331,7 +3331,7 @@ class Qe {
|
|
|
3331
3331
|
if (Ze(), this.containerRef)
|
|
3332
3332
|
this.containerEl = this.containerRef;
|
|
3333
3333
|
else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
|
|
3334
|
-
throw new Error(`Container #${this.containerId} not found
|
|
3334
|
+
throw new Error(`Container "#${this.containerId}" not found. Ensure an element with id="${this.containerId}" exists in the DOM before calling imageCloud().`);
|
|
3335
3335
|
this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new bt(this.containerEl, {
|
|
3336
3336
|
onNext: () => this.navigateToNextImage(),
|
|
3337
3337
|
onPrev: () => this.navigateToPreviousImage(),
|
|
@@ -3341,7 +3341,7 @@ class Qe {
|
|
|
3341
3341
|
}
|
|
3342
3342
|
})), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
|
|
3343
3343
|
} catch (t) {
|
|
3344
|
-
console.error(
|
|
3344
|
+
console.error(`ImageCloud initialization failed (container: "${this.containerId ?? "element"}"):`, t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
3347
|
setupUI() {
|
|
@@ -3660,6 +3660,10 @@ class Qe {
|
|
|
3660
3660
|
this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.prevButtonElAutoCreated && this.prevButtonEl && (this.prevButtonEl.remove(), this.prevButtonEl = null), this.nextButtonElAutoCreated && this.nextButtonEl && (this.nextButtonEl.remove(), this.nextButtonEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy(), this.idleAnimationEngine?.stopAll(), this.idleAnimationEngine = null;
|
|
3661
3661
|
}
|
|
3662
3662
|
}
|
|
3663
|
+
async function ti(o) {
|
|
3664
|
+
const t = new Qe(o);
|
|
3665
|
+
return await t.init(), t;
|
|
3666
|
+
}
|
|
3663
3667
|
export {
|
|
3664
3668
|
ie as AnimationEngine,
|
|
3665
3669
|
It as BOUNCE_PRESETS,
|
|
@@ -3672,7 +3676,7 @@ export {
|
|
|
3672
3676
|
Ke as FUNCTIONAL_CSS,
|
|
3673
3677
|
Xe as GoogleDriveLoader,
|
|
3674
3678
|
ye as GridPlacementLayout,
|
|
3675
|
-
|
|
3679
|
+
Fe as HoneycombPlacementLayout,
|
|
3676
3680
|
Qe as ImageCloud,
|
|
3677
3681
|
Je as ImageFilter,
|
|
3678
3682
|
Qe as ImageGallery,
|
|
@@ -3681,10 +3685,11 @@ export {
|
|
|
3681
3685
|
me as RandomPlacementLayout,
|
|
3682
3686
|
we as SpiralPlacementLayout,
|
|
3683
3687
|
Ye as StaticImageLoader,
|
|
3684
|
-
|
|
3688
|
+
Ct as WAVE_PATH_PRESETS,
|
|
3685
3689
|
Ie as WavePlacementLayout,
|
|
3686
3690
|
Ne as ZoomEngine,
|
|
3687
3691
|
he as animatePath,
|
|
3692
|
+
ti as imageCloud,
|
|
3688
3693
|
Ze as injectFunctionalStyles,
|
|
3689
3694
|
de as requiresJSAnimation
|
|
3690
3695
|
};
|