@digilogiclabs/saas-factory-ui 2.8.2 → 2.9.1
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/index.d.mts +43 -7
- package/dist/index.d.ts +43 -7
- package/dist/index.js +329 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +330 -146
- package/dist/index.mjs.map +1 -1
- package/dist/web/index.d.mts +43 -7
- package/dist/web/index.d.ts +43 -7
- package/dist/web/index.js +329 -146
- package/dist/web/index.js.map +1 -1
- package/dist/web/index.mjs +330 -146
- package/dist/web/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562,6 +562,7 @@ __export(index_exports, {
|
|
|
562
562
|
audioAppTabs: () => audioAppTabs,
|
|
563
563
|
audioPlayerVariants: () => audioPlayerVariants,
|
|
564
564
|
breadcrumbsVariants: () => breadcrumbsVariants,
|
|
565
|
+
buildPolyhedron: () => buildPolyhedron,
|
|
565
566
|
cn: () => cn,
|
|
566
567
|
commonValidators: () => commonValidators,
|
|
567
568
|
containerVariants: () => containerVariants2,
|
|
@@ -574,6 +575,7 @@ __export(index_exports, {
|
|
|
574
575
|
createTransition: () => createTransition,
|
|
575
576
|
d6LandingRotation: () => d6LandingRotation,
|
|
576
577
|
dailyTrendingConfig: () => dailyTrendingConfig,
|
|
578
|
+
dealFaceValues: () => dealFaceValues,
|
|
577
579
|
detectAuthProvider: () => detectAuthProvider,
|
|
578
580
|
detectDelimiter: () => detectDelimiter,
|
|
579
581
|
detectHeader: () => detectHeader,
|
|
@@ -30532,17 +30534,226 @@ function d6LandingRotation(value) {
|
|
|
30532
30534
|
y: Math.abs(p.y) === 180 ? 180 : -p.y || 0
|
|
30533
30535
|
};
|
|
30534
30536
|
}
|
|
30535
|
-
var
|
|
30536
|
-
|
|
30537
|
-
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
|
|
30543
|
-
|
|
30537
|
+
var PHI = (1 + Math.sqrt(5)) / 2;
|
|
30538
|
+
var dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
30539
|
+
var cross3 = (a, b) => [
|
|
30540
|
+
a[1] * b[2] - a[2] * b[1],
|
|
30541
|
+
a[2] * b[0] - a[0] * b[2],
|
|
30542
|
+
a[0] * b[1] - a[1] * b[0]
|
|
30543
|
+
];
|
|
30544
|
+
var sub3 = (a, b) => [
|
|
30545
|
+
a[0] - b[0],
|
|
30546
|
+
a[1] - b[1],
|
|
30547
|
+
a[2] - b[2]
|
|
30548
|
+
];
|
|
30549
|
+
var scale3 = (a, s) => [a[0] * s, a[1] * s, a[2] * s];
|
|
30550
|
+
var len3 = (a) => Math.hypot(a[0], a[1], a[2]);
|
|
30551
|
+
var norm3 = (a) => scale3(a, 1 / len3(a));
|
|
30552
|
+
function rotateAround(p, axis, angle) {
|
|
30553
|
+
const cosA = Math.cos(angle);
|
|
30554
|
+
const sinA = Math.sin(angle);
|
|
30555
|
+
const t1 = scale3(p, cosA);
|
|
30556
|
+
const t2 = scale3(cross3(axis, p), sinA);
|
|
30557
|
+
const t3 = scale3(axis, dot3(axis, p) * (1 - cosA));
|
|
30558
|
+
return [t1[0] + t2[0] + t3[0], t1[1] + t2[1] + t3[1], t1[2] + t2[2] + t3[2]];
|
|
30559
|
+
}
|
|
30560
|
+
function rotationTo(from, to) {
|
|
30561
|
+
const c = dot3(from, to);
|
|
30562
|
+
if (c > 1 - 1e-9) return (p) => p;
|
|
30563
|
+
const axis = c < -1 + 1e-9 ? norm3(
|
|
30564
|
+
Math.abs(from[0]) < 0.9 ? cross3(from, [1, 0, 0]) : cross3(from, [0, 1, 0])
|
|
30565
|
+
) : norm3(cross3(from, to));
|
|
30566
|
+
const angle = Math.acos(Math.max(-1, Math.min(1, c)));
|
|
30567
|
+
return (p) => rotateAround(p, axis, angle);
|
|
30568
|
+
}
|
|
30569
|
+
function solidVertices(sides) {
|
|
30570
|
+
switch (sides) {
|
|
30571
|
+
case 4:
|
|
30572
|
+
return [
|
|
30573
|
+
[1, 1, 1],
|
|
30574
|
+
[1, -1, -1],
|
|
30575
|
+
[-1, 1, -1],
|
|
30576
|
+
[-1, -1, 1]
|
|
30577
|
+
];
|
|
30578
|
+
case 8:
|
|
30579
|
+
return [
|
|
30580
|
+
[1, 0, 0],
|
|
30581
|
+
[-1, 0, 0],
|
|
30582
|
+
[0, 1, 0],
|
|
30583
|
+
[0, -1, 0],
|
|
30584
|
+
[0, 0, 1],
|
|
30585
|
+
[0, 0, -1]
|
|
30586
|
+
];
|
|
30587
|
+
case 10: {
|
|
30588
|
+
const h = 0.15;
|
|
30589
|
+
const cos36 = Math.cos(Math.PI / 5);
|
|
30590
|
+
const zApex = 2 * h / (1 - cos36) * cos36 + h;
|
|
30591
|
+
const verts = [
|
|
30592
|
+
[0, 0, zApex],
|
|
30593
|
+
[0, 0, -zApex]
|
|
30594
|
+
];
|
|
30595
|
+
for (let k = 0; k < 10; k++) {
|
|
30596
|
+
const a = k * Math.PI / 5;
|
|
30597
|
+
verts.push([Math.cos(a), Math.sin(a), k % 2 === 0 ? h : -h]);
|
|
30598
|
+
}
|
|
30599
|
+
return verts;
|
|
30600
|
+
}
|
|
30601
|
+
case 12: {
|
|
30602
|
+
const v = [];
|
|
30603
|
+
for (const sx of [1, -1])
|
|
30604
|
+
for (const sy of [1, -1])
|
|
30605
|
+
for (const sz of [1, -1]) v.push([sx, sy, sz]);
|
|
30606
|
+
const b = 1 / PHI;
|
|
30607
|
+
for (const s1 of [1, -1])
|
|
30608
|
+
for (const s2 of [1, -1]) {
|
|
30609
|
+
v.push([0, s1 * b, s2 * PHI]);
|
|
30610
|
+
v.push([s1 * b, s2 * PHI, 0]);
|
|
30611
|
+
v.push([s2 * PHI, 0, s1 * b]);
|
|
30612
|
+
}
|
|
30613
|
+
return v;
|
|
30614
|
+
}
|
|
30615
|
+
case 20: {
|
|
30616
|
+
const v = [];
|
|
30617
|
+
for (const s1 of [1, -1])
|
|
30618
|
+
for (const s2 of [1, -1]) {
|
|
30619
|
+
v.push([0, s1, s2 * PHI]);
|
|
30620
|
+
v.push([s1, s2 * PHI, 0]);
|
|
30621
|
+
v.push([s2 * PHI, 0, s1]);
|
|
30622
|
+
}
|
|
30623
|
+
return v;
|
|
30624
|
+
}
|
|
30544
30625
|
}
|
|
30545
|
-
}
|
|
30626
|
+
}
|
|
30627
|
+
function computeFaces(verts) {
|
|
30628
|
+
const faces = [];
|
|
30629
|
+
const seen = /* @__PURE__ */ new Set();
|
|
30630
|
+
for (let i = 0; i < verts.length; i++)
|
|
30631
|
+
for (let j = i + 1; j < verts.length; j++)
|
|
30632
|
+
for (let k = j + 1; k < verts.length; k++) {
|
|
30633
|
+
let n = cross3(sub3(verts[j], verts[i]), sub3(verts[k], verts[i]));
|
|
30634
|
+
if (len3(n) < 1e-9) continue;
|
|
30635
|
+
n = norm3(n);
|
|
30636
|
+
let d = dot3(n, verts[i]);
|
|
30637
|
+
if (d < 0) {
|
|
30638
|
+
n = scale3(n, -1);
|
|
30639
|
+
d = -d;
|
|
30640
|
+
}
|
|
30641
|
+
if (verts.some((p) => dot3(n, p) > d + 1e-4)) continue;
|
|
30642
|
+
const ids = verts.flatMap(
|
|
30643
|
+
(p, idx) => Math.abs(dot3(n, p) - d) < 1e-4 ? [idx] : []
|
|
30644
|
+
);
|
|
30645
|
+
const key = ids.join(",");
|
|
30646
|
+
if (seen.has(key)) continue;
|
|
30647
|
+
seen.add(key);
|
|
30648
|
+
faces.push({ normal: n, ids });
|
|
30649
|
+
}
|
|
30650
|
+
return faces;
|
|
30651
|
+
}
|
|
30652
|
+
var polyhedronCache = /* @__PURE__ */ new Map();
|
|
30653
|
+
function buildPolyhedron(sides) {
|
|
30654
|
+
const cached = polyhedronCache.get(sides);
|
|
30655
|
+
if (cached) return cached;
|
|
30656
|
+
let verts = solidVertices(sides);
|
|
30657
|
+
const rough = computeFaces(verts);
|
|
30658
|
+
const front = rough.reduce(
|
|
30659
|
+
(best, f) => f.normal[2] > best.normal[2] + 1e-9 ? f : best
|
|
30660
|
+
);
|
|
30661
|
+
const rot = rotationTo(front.normal, [0, 0, 1]);
|
|
30662
|
+
verts = verts.map(rot);
|
|
30663
|
+
const rMax = Math.max(...verts.map(len3));
|
|
30664
|
+
verts = verts.map((p) => scale3(p, 1 / rMax));
|
|
30665
|
+
const raw = computeFaces(verts);
|
|
30666
|
+
const built = raw.map((f) => {
|
|
30667
|
+
const faceVerts = f.ids.map((i) => verts[i]);
|
|
30668
|
+
const centroid = scale3(
|
|
30669
|
+
faceVerts.reduce((a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2]]),
|
|
30670
|
+
1 / faceVerts.length
|
|
30671
|
+
);
|
|
30672
|
+
const w = f.normal;
|
|
30673
|
+
let vRaw = sub3([0, 1, 0], scale3(w, w[1]));
|
|
30674
|
+
if (len3(vRaw) < 1e-6) vRaw = sub3([0, 0, 1], scale3(w, w[2]));
|
|
30675
|
+
const v = norm3(vRaw);
|
|
30676
|
+
const u = cross3(v, w);
|
|
30677
|
+
const pts = faceVerts.map((p) => [
|
|
30678
|
+
dot3(sub3(p, centroid), u),
|
|
30679
|
+
dot3(sub3(p, centroid), v)
|
|
30680
|
+
]).sort((a, b) => Math.atan2(a[1], a[0]) - Math.atan2(b[1], b[0]));
|
|
30681
|
+
return { normal: w, centroid, u, v, pts, value: 0 };
|
|
30682
|
+
});
|
|
30683
|
+
built.sort((a, b) => b.normal[2] - a.normal[2]);
|
|
30684
|
+
const oppOf = (i) => built.findIndex((g) => dot3(built[i].normal, g.normal) < -0.9999);
|
|
30685
|
+
const pool = [];
|
|
30686
|
+
for (let v2 = 1; v2 < sides; v2++) pool.push(v2);
|
|
30687
|
+
built[0].value = sides;
|
|
30688
|
+
const opp0 = oppOf(0);
|
|
30689
|
+
if (opp0 >= 0) {
|
|
30690
|
+
built[opp0].value = 1;
|
|
30691
|
+
pool.splice(pool.indexOf(1), 1);
|
|
30692
|
+
}
|
|
30693
|
+
for (let i = 1; i < built.length; i++) {
|
|
30694
|
+
if (built[i].value !== 0) continue;
|
|
30695
|
+
const v2 = pool.shift();
|
|
30696
|
+
built[i].value = v2;
|
|
30697
|
+
const j = oppOf(i);
|
|
30698
|
+
if (j >= 0 && built[j].value === 0) {
|
|
30699
|
+
built[j].value = sides + 1 - v2;
|
|
30700
|
+
pool.splice(pool.indexOf(sides + 1 - v2), 1);
|
|
30701
|
+
}
|
|
30702
|
+
}
|
|
30703
|
+
const faceRadius = Math.max(
|
|
30704
|
+
...built.flatMap((f) => f.pts.map(([x, y]) => Math.hypot(x, y)))
|
|
30705
|
+
);
|
|
30706
|
+
const edgeDist = (pts) => Math.min(
|
|
30707
|
+
...pts.map((p1, i2) => {
|
|
30708
|
+
const p2 = pts[(i2 + 1) % pts.length];
|
|
30709
|
+
const dx = p2[0] - p1[0];
|
|
30710
|
+
const dy = p2[1] - p1[1];
|
|
30711
|
+
const t = Math.max(
|
|
30712
|
+
0,
|
|
30713
|
+
Math.min(1, -(p1[0] * dx + p1[1] * dy) / (dx * dx + dy * dy))
|
|
30714
|
+
);
|
|
30715
|
+
return Math.hypot(p1[0] + t * dx, p1[1] + t * dy);
|
|
30716
|
+
})
|
|
30717
|
+
);
|
|
30718
|
+
const faceInradius = Math.min(...built.map((f) => edgeDist(f.pts)));
|
|
30719
|
+
const opposite = built.map((_, i) => oppOf(i));
|
|
30720
|
+
const result = {
|
|
30721
|
+
faces: built,
|
|
30722
|
+
opposite,
|
|
30723
|
+
faceRadius,
|
|
30724
|
+
faceInradius
|
|
30725
|
+
};
|
|
30726
|
+
polyhedronCache.set(sides, result);
|
|
30727
|
+
return result;
|
|
30728
|
+
}
|
|
30729
|
+
function dealFaceValues(geo, sides, rolled) {
|
|
30730
|
+
const n = geo.faces.length;
|
|
30731
|
+
const out = new Array(n).fill(0);
|
|
30732
|
+
const used = /* @__PURE__ */ new Set([rolled]);
|
|
30733
|
+
out[0] = rolled;
|
|
30734
|
+
const opp0 = geo.opposite[0];
|
|
30735
|
+
if (opp0 >= 0) {
|
|
30736
|
+
out[opp0] = sides + 1 - rolled;
|
|
30737
|
+
used.add(sides + 1 - rolled);
|
|
30738
|
+
}
|
|
30739
|
+
const values = [];
|
|
30740
|
+
for (let v = 1; v <= sides; v++) if (!used.has(v)) values.push(v);
|
|
30741
|
+
for (let i = values.length - 1; i > 0; i--) {
|
|
30742
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
30743
|
+
[values[i], values[j]] = [values[j], values[i]];
|
|
30744
|
+
}
|
|
30745
|
+
for (let fi = 1; fi < n; fi++) {
|
|
30746
|
+
if (out[fi] !== 0) continue;
|
|
30747
|
+
const v = values.shift();
|
|
30748
|
+
out[fi] = v;
|
|
30749
|
+
const o = geo.opposite[fi];
|
|
30750
|
+
if (o >= 0 && out[o] === 0) {
|
|
30751
|
+
out[o] = sides + 1 - v;
|
|
30752
|
+
values.splice(values.indexOf(sides + 1 - v), 1);
|
|
30753
|
+
}
|
|
30754
|
+
}
|
|
30755
|
+
return out;
|
|
30756
|
+
}
|
|
30546
30757
|
function formatDieValue(v, sides) {
|
|
30547
30758
|
return sides > 8 && (v === 6 || v === 9) ? `${v}.` : String(v);
|
|
30548
30759
|
}
|
|
@@ -30728,7 +30939,7 @@ function DiceRoller({
|
|
|
30728
30939
|
const dieWrapperRefs = (0, import_react68.useRef)([]);
|
|
30729
30940
|
const cubeRefs = (0, import_react68.useRef)([]);
|
|
30730
30941
|
const shadowRefs = (0, import_react68.useRef)([]);
|
|
30731
|
-
const
|
|
30942
|
+
const faceTextRefs = (0, import_react68.useRef)([]);
|
|
30732
30943
|
const currentPositionsRef = (0, import_react68.useRef)(null);
|
|
30733
30944
|
const rollingRef = (0, import_react68.useRef)(false);
|
|
30734
30945
|
const dieSetters = (0, import_react68.useRef)([]);
|
|
@@ -30758,15 +30969,18 @@ function DiceRoller({
|
|
|
30758
30969
|
}
|
|
30759
30970
|
return shadowSetters.current[i];
|
|
30760
30971
|
};
|
|
30761
|
-
const
|
|
30762
|
-
const
|
|
30763
|
-
if (!
|
|
30764
|
-
|
|
30765
|
-
|
|
30972
|
+
const faceTextSetters = (0, import_react68.useRef)([]);
|
|
30973
|
+
const getFaceTextSetter = (i, fi) => {
|
|
30974
|
+
if (!faceTextSetters.current[i]) faceTextSetters.current[i] = [];
|
|
30975
|
+
if (!faceTextSetters.current[i][fi]) {
|
|
30976
|
+
faceTextSetters.current[i][fi] = (el) => {
|
|
30977
|
+
if (!faceTextRefs.current[i]) faceTextRefs.current[i] = [];
|
|
30978
|
+
faceTextRefs.current[i][fi] = el;
|
|
30766
30979
|
};
|
|
30767
30980
|
}
|
|
30768
|
-
return
|
|
30981
|
+
return faceTextSetters.current[i][fi];
|
|
30769
30982
|
};
|
|
30983
|
+
const sheenGradientId = (0, import_react68.useId)();
|
|
30770
30984
|
const timersRef = (0, import_react68.useRef)([]);
|
|
30771
30985
|
const rafHandleRef = (0, import_react68.useRef)(null);
|
|
30772
30986
|
const arenaRef = (0, import_react68.useRef)(null);
|
|
@@ -30970,12 +31184,15 @@ function DiceRoller({
|
|
|
30970
31184
|
for (let f = 1; f <= flickerTicks; f++) {
|
|
30971
31185
|
const t = setTimeout(() => {
|
|
30972
31186
|
for (let i = 0; i < clampedCount; i++) {
|
|
30973
|
-
const
|
|
30974
|
-
if (
|
|
30975
|
-
|
|
30976
|
-
|
|
30977
|
-
|
|
30978
|
-
|
|
31187
|
+
const texts = faceTextRefs.current[i];
|
|
31188
|
+
if (!texts) continue;
|
|
31189
|
+
for (const el of texts) {
|
|
31190
|
+
if (el)
|
|
31191
|
+
el.textContent = formatDieValue(
|
|
31192
|
+
Math.floor(Math.random() * sides) + 1,
|
|
31193
|
+
sides
|
|
31194
|
+
);
|
|
31195
|
+
}
|
|
30979
31196
|
}
|
|
30980
31197
|
}, f * flickerStep);
|
|
30981
31198
|
timersRef.current.push(t);
|
|
@@ -31002,9 +31219,19 @@ function DiceRoller({
|
|
|
31002
31219
|
});
|
|
31003
31220
|
const settleTimer = setTimeout(() => {
|
|
31004
31221
|
if (sides !== 6) {
|
|
31222
|
+
const geo = buildPolyhedron(sides);
|
|
31005
31223
|
for (let i = 0; i < clampedCount; i++) {
|
|
31006
|
-
const
|
|
31007
|
-
if (
|
|
31224
|
+
const texts = faceTextRefs.current[i];
|
|
31225
|
+
if (!texts) continue;
|
|
31226
|
+
const dealt = dealFaceValues(
|
|
31227
|
+
geo,
|
|
31228
|
+
sides,
|
|
31229
|
+
vals[i]
|
|
31230
|
+
);
|
|
31231
|
+
for (let fi = 0; fi < dealt.length; fi++) {
|
|
31232
|
+
const el = texts[fi];
|
|
31233
|
+
if (el) el.textContent = formatDieValue(dealt[fi], sides);
|
|
31234
|
+
}
|
|
31008
31235
|
}
|
|
31009
31236
|
}
|
|
31010
31237
|
setResults(vals);
|
|
@@ -31152,99 +31379,97 @@ function DiceRoller({
|
|
|
31152
31379
|
},
|
|
31153
31380
|
val
|
|
31154
31381
|
)) : (() => {
|
|
31155
|
-
const
|
|
31382
|
+
const geo = buildPolyhedron(sides);
|
|
31383
|
+
const R = effectiveSize / 2;
|
|
31384
|
+
const S = Math.ceil(geo.faceRadius * R * 2) + 6;
|
|
31385
|
+
const fontSize = geo.faceInradius * R * 1.15;
|
|
31156
31386
|
const shown = results?.[d] ?? sides;
|
|
31157
|
-
|
|
31158
|
-
|
|
31159
|
-
|
|
31160
|
-
|
|
31161
|
-
|
|
31162
|
-
|
|
31163
|
-
|
|
31164
|
-
backfaceVisibility: "hidden"
|
|
31165
|
-
};
|
|
31166
|
-
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
|
|
31167
|
-
Array.from({ length: edgeLayers }, (_2, li) => {
|
|
31168
|
-
const z = -depth / 2 + depth * (li + 0.5) / edgeLayers;
|
|
31169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
31170
|
-
"svg",
|
|
31171
|
-
{
|
|
31172
|
-
viewBox: "0 0 100 100",
|
|
31173
|
-
width: "100%",
|
|
31174
|
-
height: "100%",
|
|
31175
|
-
style: {
|
|
31176
|
-
position: "absolute",
|
|
31177
|
-
inset: 0,
|
|
31178
|
-
display: "block",
|
|
31179
|
-
overflow: "visible",
|
|
31180
|
-
transform: `translateZ(${z}px)`
|
|
31181
|
-
},
|
|
31182
|
-
"aria-hidden": "true",
|
|
31183
|
-
children: [
|
|
31184
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31185
|
-
"polygon",
|
|
31186
|
-
{
|
|
31187
|
-
points: shape.points,
|
|
31188
|
-
fill: colors.face
|
|
31189
|
-
}
|
|
31190
|
-
),
|
|
31191
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31192
|
-
"polygon",
|
|
31193
|
-
{
|
|
31194
|
-
points: shape.points,
|
|
31195
|
-
fill: "#000",
|
|
31196
|
-
opacity: 0.22
|
|
31197
|
-
}
|
|
31198
|
-
)
|
|
31199
|
-
]
|
|
31200
|
-
},
|
|
31201
|
-
li
|
|
31202
|
-
);
|
|
31203
|
-
}),
|
|
31204
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
31387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_jsx_runtime114.Fragment, { children: geo.faces.map((f, fi) => {
|
|
31388
|
+
const m = `matrix3d(${f.u[0]},${f.u[1]},${f.u[2]},0,${f.v[0]},${f.v[1]},${f.v[2]},0,${f.normal[0]},${f.normal[1]},${f.normal[2]},0,${f.centroid[0] * R},${f.centroid[1] * R},${f.centroid[2] * R},1)`;
|
|
31389
|
+
const gid = `${sheenGradientId}-${d}-${fi}`;
|
|
31390
|
+
const pts = f.pts.map(
|
|
31391
|
+
([x, y]) => `${(x * R + S / 2).toFixed(2)},${(y * R + S / 2).toFixed(2)}`
|
|
31392
|
+
).join(" ");
|
|
31393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
31205
31394
|
"svg",
|
|
31206
31395
|
{
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31396
|
+
width: S,
|
|
31397
|
+
height: S,
|
|
31398
|
+
viewBox: `0 0 ${S} ${S}`,
|
|
31210
31399
|
style: {
|
|
31211
|
-
|
|
31212
|
-
|
|
31400
|
+
position: "absolute",
|
|
31401
|
+
left: "50%",
|
|
31402
|
+
top: "50%",
|
|
31403
|
+
marginLeft: -S / 2,
|
|
31404
|
+
marginTop: -S / 2,
|
|
31405
|
+
overflow: "visible",
|
|
31406
|
+
transform: m,
|
|
31407
|
+
// Convex solid: a face is either front-
|
|
31408
|
+
// facing or hidden behind nearer faces,
|
|
31409
|
+
// so hiding backfaces is both correct
|
|
31410
|
+
// and the mirrored-numeral guard.
|
|
31411
|
+
backfaceVisibility: "hidden"
|
|
31213
31412
|
},
|
|
31214
31413
|
"aria-hidden": "true",
|
|
31215
31414
|
children: [
|
|
31216
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31217
|
-
"
|
|
31415
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
31416
|
+
"radialGradient",
|
|
31218
31417
|
{
|
|
31219
|
-
|
|
31220
|
-
|
|
31221
|
-
|
|
31222
|
-
|
|
31223
|
-
|
|
31224
|
-
|
|
31418
|
+
id: gid,
|
|
31419
|
+
cx: "32%",
|
|
31420
|
+
cy: "26%",
|
|
31421
|
+
r: "80%",
|
|
31422
|
+
children: [
|
|
31423
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31424
|
+
"stop",
|
|
31425
|
+
{
|
|
31426
|
+
offset: "0%",
|
|
31427
|
+
stopColor: "#fff",
|
|
31428
|
+
stopOpacity: "0.38"
|
|
31429
|
+
}
|
|
31430
|
+
),
|
|
31431
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31432
|
+
"stop",
|
|
31433
|
+
{
|
|
31434
|
+
offset: "55%",
|
|
31435
|
+
stopColor: "#fff",
|
|
31436
|
+
stopOpacity: "0.08"
|
|
31437
|
+
}
|
|
31438
|
+
),
|
|
31439
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31440
|
+
"stop",
|
|
31441
|
+
{
|
|
31442
|
+
offset: "100%",
|
|
31443
|
+
stopColor: "#fff",
|
|
31444
|
+
stopOpacity: "0"
|
|
31445
|
+
}
|
|
31446
|
+
)
|
|
31447
|
+
]
|
|
31225
31448
|
}
|
|
31226
|
-
),
|
|
31449
|
+
) }),
|
|
31227
31450
|
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31228
31451
|
"polygon",
|
|
31229
31452
|
{
|
|
31230
|
-
points:
|
|
31231
|
-
fill:
|
|
31453
|
+
points: pts,
|
|
31454
|
+
fill: colors.face,
|
|
31232
31455
|
stroke: colors.faceBorder,
|
|
31233
31456
|
strokeWidth: 1.5,
|
|
31234
31457
|
strokeLinejoin: "round",
|
|
31235
|
-
|
|
31236
|
-
|
|
31458
|
+
style: {
|
|
31459
|
+
transition: "fill 0.3s, stroke 0.3s"
|
|
31460
|
+
}
|
|
31237
31461
|
}
|
|
31238
31462
|
),
|
|
31463
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("polygon", { points: pts, fill: `url(#${gid})` }),
|
|
31239
31464
|
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31240
31465
|
"text",
|
|
31241
31466
|
{
|
|
31242
|
-
ref:
|
|
31243
|
-
x:
|
|
31244
|
-
y:
|
|
31467
|
+
ref: getFaceTextSetter(d, fi),
|
|
31468
|
+
x: S / 2,
|
|
31469
|
+
y: S / 2,
|
|
31245
31470
|
textAnchor: "middle",
|
|
31246
31471
|
dominantBaseline: "central",
|
|
31247
|
-
fontSize
|
|
31472
|
+
fontSize,
|
|
31248
31473
|
fontWeight: 800,
|
|
31249
31474
|
fill: colors.pip,
|
|
31250
31475
|
style: {
|
|
@@ -31252,59 +31477,17 @@ function DiceRoller({
|
|
|
31252
31477
|
transition: "fill 0.3s",
|
|
31253
31478
|
userSelect: "none"
|
|
31254
31479
|
},
|
|
31255
|
-
children: formatDieValue(
|
|
31480
|
+
children: formatDieValue(
|
|
31481
|
+
fi === 0 ? shown : f.value,
|
|
31482
|
+
sides
|
|
31483
|
+
)
|
|
31256
31484
|
}
|
|
31257
31485
|
)
|
|
31258
31486
|
]
|
|
31259
|
-
}
|
|
31260
|
-
|
|
31261
|
-
|
|
31262
|
-
|
|
31263
|
-
{
|
|
31264
|
-
viewBox: "0 0 100 100",
|
|
31265
|
-
width: "100%",
|
|
31266
|
-
height: "100%",
|
|
31267
|
-
style: {
|
|
31268
|
-
...cardFaceStyle,
|
|
31269
|
-
transform: `rotateY(180deg) translateZ(${depth / 2}px)`
|
|
31270
|
-
},
|
|
31271
|
-
"aria-hidden": "true",
|
|
31272
|
-
children: [
|
|
31273
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31274
|
-
"polygon",
|
|
31275
|
-
{
|
|
31276
|
-
points: shape.points,
|
|
31277
|
-
fill: colors.face,
|
|
31278
|
-
stroke: colors.faceBorder,
|
|
31279
|
-
strokeWidth: 2.5,
|
|
31280
|
-
strokeLinejoin: "round",
|
|
31281
|
-
style: { transition: "fill 0.3s, stroke 0.3s" }
|
|
31282
|
-
}
|
|
31283
|
-
),
|
|
31284
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31285
|
-
"polygon",
|
|
31286
|
-
{
|
|
31287
|
-
points: shape.points,
|
|
31288
|
-
fill: "none",
|
|
31289
|
-
stroke: colors.faceBorder,
|
|
31290
|
-
strokeWidth: 1.5,
|
|
31291
|
-
strokeLinejoin: "round",
|
|
31292
|
-
opacity: 0.55,
|
|
31293
|
-
transform: "translate(50 50) scale(0.76) translate(-50 -50)"
|
|
31294
|
-
}
|
|
31295
|
-
),
|
|
31296
|
-
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
31297
|
-
"polygon",
|
|
31298
|
-
{
|
|
31299
|
-
points: shape.points,
|
|
31300
|
-
fill: "#000",
|
|
31301
|
-
opacity: 0.14
|
|
31302
|
-
}
|
|
31303
|
-
)
|
|
31304
|
-
]
|
|
31305
|
-
}
|
|
31306
|
-
)
|
|
31307
|
-
] });
|
|
31487
|
+
},
|
|
31488
|
+
fi
|
|
31489
|
+
);
|
|
31490
|
+
}) });
|
|
31308
31491
|
})()
|
|
31309
31492
|
}
|
|
31310
31493
|
)
|