@bedard/hexboard 0.0.1 → 0.0.3
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/.github/workflows/build.yml +1 -0
- package/.github/workflows/release.yml +45 -0
- package/CHANGELOG.md +3 -0
- package/README.md +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +209 -232
- package/package.json +5 -1
- package/src/lib/components/hexboard/Hexboard.vue +0 -7
- package/src/lib/components/hexboard/constants.ts +0 -1
- package/src/lib/components/hexboard/types.ts +0 -2
- package/src/lib/components/hexboard/haptics.ts +0 -56
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
uses: ./.github/workflows/build.yml
|
|
14
|
+
|
|
15
|
+
release:
|
|
16
|
+
needs: build
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Setup pnpm
|
|
24
|
+
uses: pnpm/action-setup@v4
|
|
25
|
+
with:
|
|
26
|
+
version: latest
|
|
27
|
+
|
|
28
|
+
- name: Setup Node.js
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: 22
|
|
32
|
+
cache: pnpm
|
|
33
|
+
registry-url: https://registry.npmjs.org
|
|
34
|
+
|
|
35
|
+
- name: Update NPM
|
|
36
|
+
run: npm install -g npm@latest
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: pnpm install --frozen-lockfile
|
|
40
|
+
|
|
41
|
+
- name: Build library
|
|
42
|
+
run: pnpm build
|
|
43
|
+
|
|
44
|
+
- name: Publish package
|
|
45
|
+
run: npm publish --access public --provenance
|
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# `<Hexboard />`
|
|
2
2
|
|
|
3
3
|
[](https://github.com/scottbedard/hexboard/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@bedard/hexboard)
|
|
4
5
|
[](https://github.com/scottbedard/hexboard/blob/main/LICENSE)
|
|
5
6
|
|
|
6
7
|
User interfaces for [hexchess.club](https://hexchess.club).
|
package/dist/index.d.ts
CHANGED
|
@@ -103,8 +103,6 @@ export declare const Hexboard: __VLS_WithTemplateSlots<typeof __VLS_component, _
|
|
|
103
103
|
declare interface HexboardOptions {
|
|
104
104
|
/** position colors */
|
|
105
105
|
colors: [string, string, string];
|
|
106
|
-
/** haptic feedback vibrations */
|
|
107
|
-
haptics: boolean;
|
|
108
106
|
/** color of highlighted position */
|
|
109
107
|
highlightColor: string;
|
|
110
108
|
/** color of active label relative to mouseover */
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Hexchess as
|
|
3
|
-
function
|
|
4
|
-
return [
|
|
1
|
+
import { defineComponent as c2, createElementBlock as g, createCommentVNode as de, openBlock as v, createStaticVNode as B, mergeModels as i2, useModel as Q1, shallowRef as t1, useTemplateRef as k2, computed as j, onMounted as y2, onUnmounted as x2, watch as r2, unref as f, normalizeStyle as u1, createElementVNode as M2, Fragment as o1, renderList as n1, mergeProps as z2, toDisplayString as G2, createBlock as s2, resolveDynamicComponent as l2, withModifiers as P2, renderSlot as U2, h as C2 } from "vue";
|
|
2
|
+
import { Hexchess as a2, position as R, San as d1, isPromotionPosition as S2 } from "@bedard/hexchess";
|
|
3
|
+
function l(c, P, s) {
|
|
4
|
+
return [c[0] + s * (P[0] - c[0]), c[1] + s * (P[1] - c[1])];
|
|
5
5
|
}
|
|
6
|
-
function n(
|
|
7
|
-
return
|
|
6
|
+
function n(c) {
|
|
7
|
+
return c.map(t);
|
|
8
8
|
}
|
|
9
|
-
function e(
|
|
9
|
+
function e(c) {
|
|
10
10
|
return [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
x(c, -300, le),
|
|
12
|
+
x(c, 0, le),
|
|
13
|
+
x(c, -60, le),
|
|
14
|
+
x(c, -120, le),
|
|
15
|
+
x(c, -180, le),
|
|
16
|
+
x(c, -240, le)
|
|
17
17
|
];
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const K =
|
|
19
|
+
function x(c, P, s) {
|
|
20
|
+
const K = T2(P);
|
|
21
21
|
return [
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
s * Math.cos(K) + c[0],
|
|
23
|
+
s * Math.sin(K) + c[1]
|
|
24
24
|
];
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function T2(c) {
|
|
27
|
+
return c * (Math.PI / 180);
|
|
28
28
|
}
|
|
29
|
-
function t(
|
|
30
|
-
return [-
|
|
29
|
+
function t(c) {
|
|
30
|
+
return [-c[0], -c[1]];
|
|
31
31
|
}
|
|
32
|
-
function i(
|
|
33
|
-
return [
|
|
32
|
+
function i(c, P) {
|
|
33
|
+
return [c[0] + P[0], c[1] + P[1]];
|
|
34
34
|
}
|
|
35
|
-
function fe(
|
|
36
|
-
return he / 2 +
|
|
35
|
+
function fe(c) {
|
|
36
|
+
return he / 2 + c;
|
|
37
37
|
}
|
|
38
|
-
function pe(
|
|
39
|
-
return he / 2 -
|
|
38
|
+
function pe(c) {
|
|
39
|
+
return he / 2 - c;
|
|
40
40
|
}
|
|
41
|
-
const he = 23.6,
|
|
41
|
+
const he = 23.6, E2 = {
|
|
42
42
|
colors: [
|
|
43
43
|
"oklch(0.9015 0.0729 70.7)",
|
|
44
44
|
"oklch(0.8366 0.1165 66.29)",
|
|
45
45
|
"oklch(0.6806 0.1423 75.83)"
|
|
46
46
|
],
|
|
47
|
-
haptics: !0,
|
|
48
47
|
highlightColor: "oklch(90.5% 0.182 98.111 / 75%)",
|
|
49
48
|
// yellow-300 / 75% opacity
|
|
50
49
|
labelActiveColor: "oklch(76.9% 0.188 70.08)",
|
|
@@ -58,7 +57,7 @@ const he = 23.6, Ot = {
|
|
|
58
57
|
// red-500
|
|
59
58
|
targetColor: "oklch(63.7% 0.237 25.331)"
|
|
60
59
|
// red-500
|
|
61
|
-
},
|
|
60
|
+
}, B2 = "b/qbk/n1b1n/r5r/ppppppppp/11/5P5/4P1P4/3P1B1P3/2P2B2P2/1PRNQBKNRP1 w - 0 1", a = 1.7, Q = 1.7, le = 2 / Math.sqrt(3), w = le * (Math.sqrt(3) / 2) * 2, k = w * 2, y = w * 3, M = w * 4, G = w * 5, m = [0, 0], H = x(m, 150, G), O = x(m, 150, M), F = x(m, 150, y), $ = x(m, 150, k), S = x(m, 150, w), T = x(m, 30, w), L = x(m, 30, k), D = x(m, 30, y), q = x(m, 30, M), N = x(m, 30, G), X = i(H, [0, -G]), Y = i(O, [0, -G]), ve = i(F, [0, -G]), ge = i($, [0, -G]), we = i(S, [0, -G]), me = i(m, [0, -G]), be = i(T, [0, -G]), ke = i(L, [0, -G]), ye = i(D, [0, -G]), Z = i(q, [0, -G]), J = i(N, [0, -G]), I = i(H, [0, -M]), _ = i(O, [0, -M]), xe = i(F, [0, -M]), Me = i($, [0, -M]), ze = i(S, [0, -M]), Ge = i(m, [0, -M]), Pe = i(T, [0, -M]), Ue = i(L, [0, -M]), Ce = i(D, [0, -M]), ee = i(q, [0, -M]), te = i(N, [0, -M]), Se = i(H, [0, -y]), Te = i(O, [0, -y]), f1 = i(F, [0, -y]), p1 = i($, [0, -y]), h1 = i(S, [0, -y]), v1 = i(m, [0, -y]), g1 = i(T, [0, -y]), w1 = i(L, [0, -y]), m1 = i(D, [0, -y]), Ee = i(q, [0, -y]), Be = i(N, [0, -y]), Oe = i(H, [0, -k]), $e = i(O, [0, -k]), b1 = i(F, [0, -k]), k1 = i($, [0, -k]), y1 = i(S, [0, -k]), x1 = i(m, [0, -k]), M1 = i(T, [0, -k]), z1 = i(L, [0, -k]), G1 = i(D, [0, -k]), Le = i(q, [0, -k]), qe = i(N, [0, -k]), je = i(H, [0, -w]), Re = i(O, [0, -w]), P1 = i(F, [0, -w]), U1 = i($, [0, -w]), C1 = i(S, [0, -w]), S1 = i(m, [0, -w]), T1 = i(T, [0, -w]), E1 = i(L, [0, -w]), B1 = i(D, [0, -w]), He = i(q, [0, -w]), Fe = i(N, [0, -w]), De = i(O, [0, w]), Ne = i(F, [0, w]), O1 = i($, [0, w]), $1 = i(S, [0, w]), L1 = i(m, [0, w]), q1 = i(T, [0, w]), j1 = i(L, [0, w]), We = i(D, [0, w]), Ve = i(q, [0, w]), Ae = i(F, [0, k]), Ke = i($, [0, k]), R1 = i(S, [0, k]), H1 = i(m, [0, k]), F1 = i(T, [0, k]), Qe = i(L, [0, k]), Xe = i(D, [0, k]), Ye = i($, [0, y]), Ze = i(S, [0, y]), D1 = i(m, [0, y]), Je = i(T, [0, y]), Ie = i(L, [0, y]), oe = i(S, [0, M]), ne = i(m, [0, M]), ie = i(T, [0, M]), re = i(m, [0, G]), o = [
|
|
62
61
|
[2, re, t(re), e(re), n(e(re))],
|
|
63
62
|
[1, oe, t(oe), e(oe), n(e(oe))],
|
|
64
63
|
[0, ne, t(ne), e(ne), n(e(ne))],
|
|
@@ -68,7 +67,7 @@ const he = 23.6, Ot = {
|
|
|
68
67
|
[1, D1, t(D1), e(D1), n(e(D1))],
|
|
69
68
|
[2, Je, t(Je), e(Je), n(e(Je))],
|
|
70
69
|
[0, Ie, t(Ie), e(Ie), n(e(Ie))],
|
|
71
|
-
[2,
|
|
70
|
+
[2, Ae, t(Ae), e(Ae), n(e(Ae))],
|
|
72
71
|
[1, Ke, t(Ke), e(Ke), n(e(Ke))],
|
|
73
72
|
[0, R1, t(R1), e(R1), n(e(R1))],
|
|
74
73
|
[2, H1, t(H1), e(H1), n(e(H1))],
|
|
@@ -83,12 +82,12 @@ const he = 23.6, Ot = {
|
|
|
83
82
|
[1, q1, t(q1), e(q1), n(e(q1))],
|
|
84
83
|
[2, j1, t(j1), e(j1), n(e(j1))],
|
|
85
84
|
[0, We, t(We), e(We), n(e(We))],
|
|
86
|
-
[1,
|
|
85
|
+
[1, Ve, t(Ve), e(Ve), n(e(Ve))],
|
|
87
86
|
[0, H, t(H), e(H), n(e(H))],
|
|
88
87
|
[2, O, t(O), e(O), n(e(O))],
|
|
89
88
|
[1, F, t(F), e(F), n(e(F))],
|
|
90
89
|
[0, $, t($), e($), n(e($))],
|
|
91
|
-
[2,
|
|
90
|
+
[2, S, t(S), e(S), n(e(S))],
|
|
92
91
|
[1, m, t(m), e(m), n(e(m))],
|
|
93
92
|
[2, T, t(T), e(T), n(e(T))],
|
|
94
93
|
[0, L, t(L), e(L), n(e(L))],
|
|
@@ -100,9 +99,9 @@ const he = 23.6, Ot = {
|
|
|
100
99
|
[2, P1, t(P1), e(P1), n(e(P1))],
|
|
101
100
|
[1, U1, t(U1), e(U1), n(e(U1))],
|
|
102
101
|
[0, C1, t(C1), e(C1), n(e(C1))],
|
|
103
|
-
[2,
|
|
102
|
+
[2, S1, t(S1), e(S1), n(e(S1))],
|
|
104
103
|
[0, T1, t(T1), e(T1), n(e(T1))],
|
|
105
|
-
[1,
|
|
104
|
+
[1, E1, t(E1), e(E1), n(e(E1))],
|
|
106
105
|
[2, B1, t(B1), e(B1), n(e(B1))],
|
|
107
106
|
[0, He, t(He), e(He), n(e(He))],
|
|
108
107
|
[1, Fe, t(Fe), e(Fe), n(e(Fe))],
|
|
@@ -117,7 +116,7 @@ const he = 23.6, Ot = {
|
|
|
117
116
|
[0, G1, t(G1), e(G1), n(e(G1))],
|
|
118
117
|
[1, Le, t(Le), e(Le), n(e(Le))],
|
|
119
118
|
[2, qe, t(qe), e(qe), n(e(qe))],
|
|
120
|
-
[0,
|
|
119
|
+
[0, Se, t(Se), e(Se), n(e(Se))],
|
|
121
120
|
[2, Te, t(Te), e(Te), n(e(Te))],
|
|
122
121
|
[1, f1, t(f1), e(f1), n(e(f1))],
|
|
123
122
|
[0, p1, t(p1), e(p1), n(e(p1))],
|
|
@@ -126,7 +125,7 @@ const he = 23.6, Ot = {
|
|
|
126
125
|
[2, g1, t(g1), e(g1), n(e(g1))],
|
|
127
126
|
[0, w1, t(w1), e(w1), n(e(w1))],
|
|
128
127
|
[1, m1, t(m1), e(m1), n(e(m1))],
|
|
129
|
-
[2,
|
|
128
|
+
[2, Ee, t(Ee), e(Ee), n(e(Ee))],
|
|
130
129
|
[0, Be, t(Be), e(Be), n(e(Be))],
|
|
131
130
|
[1, I, t(I), e(I), n(e(I))],
|
|
132
131
|
[0, _, t(_), e(_), n(e(_))],
|
|
@@ -150,41 +149,41 @@ const he = 23.6, Ot = {
|
|
|
150
149
|
[0, ye, t(ye), e(ye), n(e(ye))],
|
|
151
150
|
[1, Z, t(Z), e(Z), n(e(Z))],
|
|
152
151
|
[2, J, t(J), e(J), n(e(J))]
|
|
153
|
-
],
|
|
154
|
-
["11",
|
|
155
|
-
["10",
|
|
156
|
-
["9",
|
|
157
|
-
["8",
|
|
158
|
-
["7",
|
|
159
|
-
["6",
|
|
160
|
-
["5",
|
|
161
|
-
["4",
|
|
162
|
-
["3",
|
|
163
|
-
["2",
|
|
164
|
-
["1",
|
|
165
|
-
["a",
|
|
166
|
-
["b",
|
|
167
|
-
["c",
|
|
168
|
-
["d",
|
|
169
|
-
["e",
|
|
170
|
-
["f",
|
|
171
|
-
["g",
|
|
172
|
-
["h",
|
|
173
|
-
["i",
|
|
174
|
-
["k",
|
|
175
|
-
["l",
|
|
176
|
-
["1",
|
|
177
|
-
["2",
|
|
178
|
-
["3",
|
|
179
|
-
["4",
|
|
180
|
-
["5",
|
|
181
|
-
["6",
|
|
182
|
-
["7",
|
|
183
|
-
["8",
|
|
184
|
-
["9",
|
|
185
|
-
["10",
|
|
186
|
-
["11",
|
|
187
|
-
],
|
|
152
|
+
], O2 = [
|
|
153
|
+
["11", l(ie, re, a), t(l(ie, re, a))],
|
|
154
|
+
["10", l(ne, oe, a), t(l(ne, oe, a))],
|
|
155
|
+
["9", l(Ze, Ye, a), t(l(Ze, Ye, a))],
|
|
156
|
+
["8", l(Ke, Ae, a), t(l(Ke, Ae, a))],
|
|
157
|
+
["7", l(Ne, De, a), t(l(Ne, De, a))],
|
|
158
|
+
["6", l(O, H, a), t(l(O, H, a))],
|
|
159
|
+
["5", l(Re, je, a), t(l(Re, je, a))],
|
|
160
|
+
["4", l($e, Oe, a), t(l($e, Oe, a))],
|
|
161
|
+
["3", l(Te, Se, a), t(l(Te, Se, a))],
|
|
162
|
+
["2", l(_, I, a), t(l(_, I, a))],
|
|
163
|
+
["1", l(Y, X, a), t(l(Y, X, a))],
|
|
164
|
+
["a", l(I, X, a), t(l(I, X, a))],
|
|
165
|
+
["b", l(_, Y, a), t(l(_, Y, a))],
|
|
166
|
+
["c", l(xe, ve, a), t(l(xe, ve, a))],
|
|
167
|
+
["d", l(Me, ge, a), t(l(Me, ge, a))],
|
|
168
|
+
["e", l(ze, we, a), t(l(ze, we, a))],
|
|
169
|
+
["f", l(Ge, me, a), t(l(Ge, me, a))],
|
|
170
|
+
["g", l(Pe, be, a), t(l(Pe, be, a))],
|
|
171
|
+
["h", l(Ue, ke, a), t(l(Ue, ke, a))],
|
|
172
|
+
["i", l(Ce, ye, a), t(l(Ce, ye, a))],
|
|
173
|
+
["k", l(ee, Z, a), t(l(ee, Z, a))],
|
|
174
|
+
["l", l(te, J, a), t(l(te, J, a))],
|
|
175
|
+
["1", l(Z, J, a), t(l(Z, J, a))],
|
|
176
|
+
["2", l(ee, te, a), t(l(ee, te, a))],
|
|
177
|
+
["3", l(Ee, Be, a), t(l(Ee, Be, a))],
|
|
178
|
+
["4", l(Le, qe, a), t(l(Le, qe, a))],
|
|
179
|
+
["5", l(He, Fe, a), t(l(He, Fe, a))],
|
|
180
|
+
["6", l(q, N, a), t(l(q, N, a))],
|
|
181
|
+
["7", l(We, Ve, a), t(l(We, Ve, a))],
|
|
182
|
+
["8", l(Qe, Xe, a), t(l(Qe, Xe, a))],
|
|
183
|
+
["9", l(Je, Ie, a), t(l(Je, Ie, a))],
|
|
184
|
+
["10", l(ne, ie, a), t(l(ne, ie, a))],
|
|
185
|
+
["11", l(oe, re, a), t(l(oe, re, a))]
|
|
186
|
+
], $2 = [
|
|
188
187
|
o[
|
|
189
188
|
0
|
|
190
189
|
/* f11 */
|
|
@@ -558,130 +557,108 @@ const he = 23.6, Ot = {
|
|
|
558
557
|
/* e10 */
|
|
559
558
|
][3][0]
|
|
560
559
|
];
|
|
561
|
-
function N1(
|
|
562
|
-
if (
|
|
560
|
+
function N1(c) {
|
|
561
|
+
if (c.length === 0)
|
|
563
562
|
return "";
|
|
564
|
-
const [
|
|
565
|
-
let K = `M ${fe(
|
|
566
|
-
for (const
|
|
567
|
-
K += `${fe(
|
|
563
|
+
const [P, ...s] = c;
|
|
564
|
+
let K = `M ${fe(P[0])} ${pe(P[1])} L `;
|
|
565
|
+
for (const E of s)
|
|
566
|
+
K += `${fe(E[0])} ${pe(E[1])} `;
|
|
568
567
|
return `${K} Z`;
|
|
569
568
|
}
|
|
570
|
-
const
|
|
571
|
-
function ct() {
|
|
572
|
-
try {
|
|
573
|
-
if (navigator.vibrate) {
|
|
574
|
-
navigator.vibrate(50);
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
if (!jt) return;
|
|
578
|
-
const s = document.createElement("label");
|
|
579
|
-
s.ariaHidden = "true", s.style.display = "none";
|
|
580
|
-
const x = document.createElement("input");
|
|
581
|
-
x.type = "checkbox", x.setAttribute("switch", ""), s.appendChild(x), document.head.appendChild(s), s.click(), document.head.removeChild(s);
|
|
582
|
-
} catch {
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
function ut() {
|
|
586
|
-
if (navigator.vibrate) {
|
|
587
|
-
navigator.vibrate([50, 70, 50]);
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
ct(), setTimeout(ct, 120);
|
|
591
|
-
}
|
|
592
|
-
const Rt = {
|
|
569
|
+
const L2 = {
|
|
593
570
|
key: 0,
|
|
594
571
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
572
|
viewBox: "0 0 50 50"
|
|
596
|
-
},
|
|
573
|
+
}, q2 = {
|
|
597
574
|
key: 1,
|
|
598
575
|
xmlns: "http://www.w3.org/2000/svg",
|
|
599
576
|
viewBox: "0 0 50 50"
|
|
600
|
-
},
|
|
577
|
+
}, j2 = {
|
|
601
578
|
key: 2,
|
|
602
579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
603
580
|
viewBox: "0 0 50 50"
|
|
604
|
-
},
|
|
581
|
+
}, R2 = {
|
|
605
582
|
key: 3,
|
|
606
583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
607
584
|
viewBox: "0 0 50 50"
|
|
608
|
-
},
|
|
585
|
+
}, H2 = {
|
|
609
586
|
key: 4,
|
|
610
587
|
xmlns: "http://www.w3.org/2000/svg",
|
|
611
588
|
viewBox: "0 0 50 50"
|
|
612
|
-
},
|
|
589
|
+
}, F2 = {
|
|
613
590
|
key: 5,
|
|
614
591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
615
592
|
viewBox: "0 0 50 50"
|
|
616
|
-
},
|
|
593
|
+
}, D2 = {
|
|
617
594
|
key: 6,
|
|
618
595
|
xmlns: "http://www.w3.org/2000/svg",
|
|
619
596
|
viewBox: "0 0 50 50"
|
|
620
|
-
},
|
|
597
|
+
}, N2 = {
|
|
621
598
|
key: 7,
|
|
622
599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
623
600
|
viewBox: "0 0 50 50"
|
|
624
|
-
},
|
|
601
|
+
}, W2 = {
|
|
625
602
|
key: 8,
|
|
626
603
|
xmlns: "http://www.w3.org/2000/svg",
|
|
627
604
|
viewBox: "0 0 50 50"
|
|
628
|
-
},
|
|
605
|
+
}, V2 = {
|
|
629
606
|
key: 9,
|
|
630
607
|
xmlns: "http://www.w3.org/2000/svg",
|
|
631
608
|
viewBox: "0 0 50 50"
|
|
632
|
-
},
|
|
609
|
+
}, A2 = {
|
|
633
610
|
key: 10,
|
|
634
611
|
xmlns: "http://www.w3.org/2000/svg",
|
|
635
612
|
viewBox: "0 0 50 50"
|
|
636
|
-
},
|
|
613
|
+
}, K2 = {
|
|
637
614
|
key: 11,
|
|
638
615
|
xmlns: "http://www.w3.org/2000/svg",
|
|
639
616
|
viewBox: "0 0 50 50"
|
|
640
|
-
},
|
|
617
|
+
}, Q2 = /* @__PURE__ */ c2({
|
|
641
618
|
__name: "Gioco",
|
|
642
619
|
props: {
|
|
643
620
|
type: {}
|
|
644
621
|
},
|
|
645
|
-
setup(
|
|
646
|
-
return (
|
|
622
|
+
setup(c) {
|
|
623
|
+
return (P, s) => c.type === "p" ? (v(), g("svg", L2, [...s[0] || (s[0] = [
|
|
647
624
|
B('<defs><linearGradient id="gioco-a-bp" gradientTransform="matrix(.94331 0 0 1 615.66 493.37)" gradientUnits="userSpaceOnUse" x1="-639.4" x2="-612.91" y1="-465.15" y2="-465.15"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient></defs><path d="M25 12.264c-3.56 0-6.447 2.655-6.447 5.93 0 1.705.799 3.326 2.19 4.45h-1.666c-1.312 0-2.4.978-2.4 2.158v.438c0 1.18 1.088 2.157 2.4 2.157h2.376c0 7.293-9.342 6.457-8.689 16.78L25 44.167l12.236.008c.653-10.323-8.689-9.486-8.689-16.779h2.376c1.312 0 2.4-.978 2.4-2.157v-.438c0-1.18-1.087-2.157-2.4-2.157h-1.666c1.391-1.125 2.19-2.747 2.19-4.45 0-3.276-2.886-5.93-6.446-5.931z" fill="url(#gioco-a-bp)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6"></path><path d="M24.999 12.264c-.521 0-1.028.058-1.513.166 6.257.692 7.675 6.466 4.917 9.222-2.016 1.69-7.662.993-7.662.993 2.56.443 4.97 1.954 7.252 2.488-6.033 11.435 9.7 9.026 9.242 19.043.995-10.592-7.673-8.148-8.689-16.78h2.377c1.312 0 2.398-.977 2.398-2.156v-.438c0-1.18-1.086-2.158-2.398-2.158h-1.667c1.391-1.125 2.191-2.746 2.19-4.449 0-3.276-2.886-5.932-6.447-5.932z" opacity=".15"></path><path d="M22.959 13.401c-1.77 1.602-2.968 3.612-3.476 6.19 0 0-1.16-4.235 3.476-6.19zM13.342 43.419c.273-5.321 2.572-6.184 7.538-11.434-1.03 3.566-7.387 5.868-7.538 11.434z" fill="#fff" opacity=".25"></path>', 4)
|
|
648
|
-
])])) :
|
|
625
|
+
])])) : c.type === "n" ? (v(), g("svg", q2, [...s[1] || (s[1] = [
|
|
649
626
|
B('<defs><linearGradient gradientTransform="matrix(1.0621 0 0 1.0589 -3487.5 459.63)" gradientUnits="userSpaceOnUse" x1="3295.1" x2="3321.5" xlink:href="#gioco-a-bn" id="gioco-b-bn" y1="-411.88" y2="-411.88"></linearGradient><linearGradient id="gioco-a-bn"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient><linearGradient gradientTransform="matrix(1.1509 0 0 1.1499 214.24 -138.92)" gradientUnits="userSpaceOnUse" x1="-177.63" x2="-151.24" xlink:href="#gioco-a-bn" id="gioco-c-bn" y1="156.68" y2="156.68"></linearGradient></defs><path class="st28" d="m25.987 23.546-11.592 1.097-1.454-5.216 14.468-6.815 1.763-3.9 10.2 11.892-4.116 17.678H14.74c.245-11.292 9.64-8.1 11.247-14.736z" fill="url(#gioco-b-bn)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6"></path><path d="m29.173 8.72-.879 1.945.426-.943c2.692 3.722 5.608 7.279 8.45 10.888l-5.285 17.671h3.372l4.117-17.671z" opacity=".15"></path><path d="M13.24 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.748l.013-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-bn)" stroke="#1e1e1e" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><path d="M15.62 37.633c.159-4.472 2.145-6.971 8.667-9.837-.987 1.107-6.405 2.237-8.667 9.837zM14.418 21.67l-.523-1.803L28.03 13.21l1.217-2.764-.671 3.558-14.35 5.921z" fill="#fff" opacity=".25"></path>', 5)
|
|
650
|
-
])])) :
|
|
627
|
+
])])) : c.type === "b" ? (v(), g("svg", j2, [...s[2] || (s[2] = [
|
|
651
628
|
B('<defs><linearGradient gradientTransform="matrix(1.019 0 0 1.0751 -3392.3 527.45)" gradientUnits="userSpaceOnUse" x1="3341.2" x2="3366.2" xlink:href="#gioco-a-bb" id="gioco-b-bb" y1="-469.28" y2="-469.28"></linearGradient><linearGradient id="gioco-a-bb"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient><linearGradient gradientTransform="matrix(1.1509 0 0 1.1499 214.24 -138.92)" gradientUnits="userSpaceOnUse" x1="-177.63" x2="-151.24" xlink:href="#gioco-a-bb" id="gioco-c-bb" y1="156.68" y2="156.68"></linearGradient></defs><path d="M26.87 8.223c-5.797-2.298-6.952 2.527-4.668 5.86-9.898 10.6-11.253 16.425-6.195 24.204h17.99c6.084-6.912 2.558-14.515-4.823-22.3-2.883 4.119-3.274 7.35-3.946 11.131l-3.62-.071c-.66-6.006 7.622-15.14 5.261-18.823z" fill="url(#gioco-b-bb)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6"></path><path d="M24.933 7.654c-.625.02-.207.197-.771.567 0 .003.01.006.01.008 3.582-.311-2.369 11.772-3.394 18.894.536-3.014 1.325-5.68 3.082-8.725 2.003-4.351 4.237-8.681 3.008-10.169-.411-.38-1.144-.601-1.934-.575zm4.24 8.338c-.6.856-.517.67-.972 1.462 6.004 6.049 8.728 13.787 3.097 20.838h2.696c6.085-6.912 2.56-14.515-4.822-22.3z" opacity=".15"></path><path d="M13.24 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.749l.012-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-bb)" stroke="#1e1e1e" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><path d="M14.895 34.327c-.716-1.396-3.266-6.812 4.513-15.739-2.1 4.86-5.958 8.69-4.513 15.739z" fill="#fff" opacity=".25"></path>', 5)
|
|
652
|
-
])])) :
|
|
629
|
+
])])) : c.type === "r" ? (v(), g("svg", R2, [...s[3] || (s[3] = [
|
|
653
630
|
B('<defs><linearGradient gradientTransform="matrix(.23554 0 0 .25454 -3002.1 473.49)" gradientUnits="userSpaceOnUse" x1="12797" x2="12909" xlink:href="#gioco-a-br" id="gioco-b-br" y1="-1764.6" y2="-1764.6"></linearGradient><linearGradient id="gioco-a-br"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient><linearGradient gradientTransform="translate(40.423 -.922)" gradientUnits="userSpaceOnUse" x1="-30.611" x2="-.235" xlink:href="#gioco-a-br" id="gioco-c-br" y1="42.165" y2="42.165"></linearGradient></defs><path d="M12.855 10.383v7.663c0 3.268 6.53 3.774 6.53 3.774-.352 9.864-5.036 16.486-5.036 16.486l21.428-.039s-4.651-6.62-5-16.446c0 0 6.896-.507 6.896-3.774v-7.663h-4.72s.459 2.25-.47 3.26c-1.035 1.126-2.418 1.126-3.454 0-.928-1.01-.47-3.26-.47-3.26h-6.59s.459 2.25-.47 3.26c-1.122 1.22-2.699 1.22-3.82 0-.929-1.01-.47-3.26-.47-3.26z" fill="url(#gioco-b-br)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6"></path><path d="m37.543 10.462.014 7.585c.263 3.48-24.58 2.135-24.523 1.03 2.098 2.532 4.445 2.613 6.352 2.744 7.292.498 9.8 8.89 13.306 16.446h2.97s-4.65-6.62-5-16.446c2.547-.395 2.954-.812 4.037-1.058h.018l-.002-.004c1.023-.236 2.81-1.376 2.842-2.713v-7.663z" opacity=".15"></path><path d="M13.239 38.286c-1.437 0-2.627 1.216-2.627 2.685v.544l.013 2.685h28.75l.012-2.685v-.544c0-1.469-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-br)" stroke="#1e1e1e" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M13.656 11.168v5.54c.48-1.867.299-4.088 1.554-5.54zM22.877 11.163c.055.896-.154 1.748-.269 2.616.48-1.866 1.823-2.616 1.823-2.616zM16.947 35.312c.875-1.143 3.603-10.333 3.233-13.244.7.39.658 10.057-3.233 13.244zM33.863 11.209c.005.598-.055 1.226-.187 2.02.48-1.867 1.295-2.04 1.295-2.04z" opacity=".25"></path></g>', 5)
|
|
654
|
-
])])) :
|
|
631
|
+
])])) : c.type === "q" ? (v(), g("svg", H2, [...s[4] || (s[4] = [
|
|
655
632
|
B('<defs><linearGradient gradientTransform="translate(209.27 -109.27) scale(.31419)" gradientUnits="userSpaceOnUse" x1="-647.27" x2="-525.69" xlink:href="#gioco-a-bq" id="gioco-b-bq" y1="418.44" y2="418.44"></linearGradient><linearGradient id="gioco-a-bq"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient><linearGradient gradientTransform="matrix(1.1509 0 0 1.1499 214.23 -138.92)" gradientUnits="userSpaceOnUse" x1="-177.63" x2="-151.24" xlink:href="#gioco-a-bq" id="gioco-c-bq" y1="156.68" y2="156.68"></linearGradient></defs><path d="M25 6.122c-2.635 0-4.771 2.098-4.771 4.685.002 1.855 1.118 3.534 2.846 4.283-.369 2.286-1.51 7.558-4.68 8.009-2.355.334-3.855-1.287-4.88-3.144a4.19 4.19 0 0 0 1.767-3.4c0-2.327-1.921-4.214-4.291-4.214S6.699 14.228 6.7 16.555c0 2.142 1.64 3.943 3.809 4.183l4.973 17.54h19.036l4.973-17.54c2.169-.24 3.807-2.041 3.809-4.183 0-2.327-1.922-4.214-4.292-4.214s-4.29 1.887-4.29 4.214a4.19 4.19 0 0 0 1.766 3.4c-1.025 1.857-2.525 3.478-4.88 3.144-3.17-.45-4.31-5.723-4.68-8.01 1.729-.748 2.845-2.427 2.847-4.282 0-2.587-2.136-4.685-4.77-4.685z" fill="url(#gioco-b-bq)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6"></path><path d="M39.002 12.342a4.348 4.348 0 0 0-1.567.296c4.741 1.678 3.877 6.805.591 7.316L30.414 38.28h4.2l4.87-17.541c2.17-.241 3.808-2.042 3.81-4.184 0-2.327-1.922-4.214-4.292-4.213z" opacity=".15"></path><path d="M13.227 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684H39.36l.013-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685h-11.76z" fill="url(#gioco-c-bq)" stroke="#1e1e1e" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M9.515 13.489c-.794 1.17-1.726 2.667-1.554 4.779 0 0-1.604-3.01 1.554-4.779zM23.659 7.23c-.853.874-2.37 2.934-2.133 5.374-.207-.084-1.73-3.893 2.133-5.374zM12.062 23.328l5.244 14.111-1.17.023z" opacity=".25"></path></g>', 5)
|
|
656
|
-
])])) :
|
|
633
|
+
])])) : c.type === "k" ? (v(), g("svg", F2, [...s[5] || (s[5] = [
|
|
657
634
|
B('<defs><linearGradient gradientTransform="matrix(.26458 0 0 .25357 227.43 -666.55)" gradientUnits="userSpaceOnUse" x1="-825.75" x2="-704.44" xlink:href="#gioco-a-bk" id="gioco-b-bk" y1="2712.8" y2="2712.8"></linearGradient><linearGradient id="gioco-a-bk"><stop offset="0" stop-color="#796c60"></stop><stop offset="1" stop-color="#4b403b"></stop></linearGradient><linearGradient gradientTransform="translate(225.05 -690.53)" gradientUnits="userSpaceOnUse" x1="-215.24" x2="-184.86" xlink:href="#gioco-a-bk" id="gioco-c-bk" y1="731.78" y2="731.78"></linearGradient></defs><path d="M25.006 3.868c-1.803.1-3.228 1.234-3.228 2.618 0 .565.244 1.644.693 2.097h-5.766v5.106h6.306l-2.61 2.833 2.673 2.167c-5.584.362-12.02 1.643-13.154 3.997-1.268 2.638 6.215 15.6 6.215 15.6h17.73s7.484-12.963 6.215-15.6c-1.133-2.357-7.594-3.64-13.179-3.999l2.71-2.165-2.61-2.833h6.306V8.583H27.54c.449-.453.693-1.531.693-2.097 0-1.384-1.425-2.518-3.228-2.618z" fill="url(#gioco-b-bk)" stroke="#1e1e1e" stroke-linejoin="round" stroke-width="1.6" style="paint-order:fill markers;"></path><path d="m31.289 38.283 2.573-.005s7.482-12.428 6.214-15.065c-4.136-3.824-13.18-4.525-13.18-4.525 11.05 2.822 12.618 5.028 4.393 19.595z" opacity=".15"></path><path d="M13.242 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.749l.012-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685h-11.76z" fill="url(#gioco-c-bk)" stroke="#1e1e1e" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M13.283 31.138s-3.074-6.555-2.666-8.092c.408-1.536 5.987-2.736 5.987-2.736-6.486 2.71-4.786 4.558-3.321 10.828zM17.521 12.884v-3.52l1.532-.011c-.891.007-1.532 2.147-1.532 3.531zM24.798 4.67s-2.614.92-1.53 3.522c-.178-.007-2.142-2.72 1.53-3.522z" opacity=".25"></path></g>', 5)
|
|
658
|
-
])])) :
|
|
635
|
+
])])) : c.type === "P" ? (v(), g("svg", D2, [...s[6] || (s[6] = [
|
|
659
636
|
B('<defs><linearGradient id="gioco-a-wp" gradientTransform="matrix(.94331 0 0 1 615.66 493.37)" gradientUnits="userSpaceOnUse" x1="-639.4" x2="-612.91" y1="-465.15" y2="-465.15"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient></defs><path d="M25 12.264c-3.56 0-6.447 2.655-6.447 5.93 0 1.705.799 3.326 2.19 4.45h-1.666c-1.312 0-2.4.978-2.4 2.158v.438c0 1.18 1.088 2.157 2.4 2.157h2.376c0 7.293-9.342 6.457-8.689 16.78L25 44.167l12.236.008c.653-10.323-8.689-9.486-8.689-16.779h2.376c1.312 0 2.4-.978 2.4-2.157v-.438c0-1.18-1.087-2.157-2.4-2.157h-1.666c1.391-1.125 2.19-2.747 2.19-4.45 0-3.276-2.886-5.93-6.446-5.931z" fill="url(#gioco-a-wp)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6"></path><path d="M24.999 12.264c-.521 0-1.028.058-1.513.166 6.257.692 7.675 6.466 4.917 9.222-2.016 1.69-7.662.993-7.662.993 2.56.443 4.97 1.954 7.252 2.488-6.033 11.435 9.7 9.026 9.242 19.043.995-10.592-7.673-8.148-8.689-16.78h2.377c1.312 0 2.398-.977 2.398-2.156v-.438c0-1.18-1.086-2.158-2.398-2.158h-1.667c1.391-1.125 2.191-2.746 2.19-4.449 0-3.276-2.886-5.932-6.447-5.932z" opacity=".15"></path><path d="M22.959 13.401c-1.77 1.602-2.968 3.612-3.476 6.19 0 0-1.16-4.235 3.476-6.19zM13.342 43.419c.273-5.321 2.572-6.184 7.538-11.434-1.03 3.566-7.387 5.868-7.538 11.434z" fill="#fff"></path>', 4)
|
|
660
|
-
])])) :
|
|
637
|
+
])])) : c.type === "N" ? (v(), g("svg", N2, [...s[7] || (s[7] = [
|
|
661
638
|
B('<defs><linearGradient gradientTransform="translate(474.35 493.34)" gradientUnits="userSpaceOnUse" x1="-462.21" x2="-434.18" xlink:href="#gioco-a-wn" id="gioco-b-wn" y1="-469.84" y2="-469.84"></linearGradient><linearGradient id="gioco-a-wn"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient><linearGradient gradientTransform="translate(474.35 493.34)" gradientUnits="userSpaceOnUse" x1="-464.54" x2="-434.16" xlink:href="#gioco-a-wn" id="gioco-c-wn" y1="-452.1" y2="-452.1"></linearGradient></defs><path class="st28" d="m25.987 23.546-11.592 1.097-1.454-5.216 14.468-6.815 1.763-3.9 10.2 11.892-4.116 17.678H14.74c.245-11.292 9.64-8.1 11.247-14.736z" fill="url(#gioco-b-wn)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6"></path><path d="m29.173 8.72-.879 1.945.426-.943c2.692 3.722 5.608 7.279 8.45 10.888l-5.285 17.671h3.372l4.117-17.671z" opacity=".1"></path><path d="M13.24 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.748l.013-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-wn)" stroke="#323232" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><path d="M15.62 37.633c.159-4.472 2.145-6.971 8.667-9.837-.987 1.107-6.405 2.237-8.667 9.837zM14.418 21.67l-.523-1.803L28.03 13.21l1.217-2.764-.671 3.558-14.35 5.921z" fill="#fff"></path>', 5)
|
|
662
|
-
])])) :
|
|
639
|
+
])])) : c.type === "B" ? (v(), g("svg", W2, [...s[8] || (s[8] = [
|
|
663
640
|
B('<defs><linearGradient gradientTransform="matrix(1.019 0 0 1.0751 -3392.3 527.45)" gradientUnits="userSpaceOnUse" x1="3341.2" x2="3366.2" xlink:href="#gioco-a-wb" id="gioco-b-wb" y1="-469.26" y2="-469.26"></linearGradient><linearGradient id="gioco-a-wb"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient><linearGradient gradientTransform="matrix(1.1509 0 0 1.1499 214.24 -138.92)" gradientUnits="userSpaceOnUse" x1="-177.63" x2="-151.24" xlink:href="#gioco-a-wb" id="gioco-c-wb" y1="156.68" y2="156.68"></linearGradient></defs><path d="M26.87 8.223c-5.797-2.298-6.952 2.527-4.668 5.86-9.898 10.6-11.253 16.425-6.195 24.204h17.99c6.084-6.912 2.558-14.515-4.823-22.3-2.883 4.119-3.274 7.35-3.946 11.131l-3.62-.071c-.66-6.006 7.622-15.14 5.261-18.823z" fill="url(#gioco-b-wb)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6"></path><path d="M24.933 7.654c-.625.02-.207.197-.771.567 0 .003.01.006.01.008 3.582-.311-2.369 11.772-3.394 18.894.536-3.014 1.325-5.68 3.082-8.725 2.003-4.351 4.237-8.681 3.008-10.169-.411-.38-1.144-.601-1.934-.575zm4.24 8.338c-.6.856-.517.67-.972 1.462 6.004 6.049 8.728 13.787 3.097 20.838h2.696c6.085-6.912 2.56-14.515-4.822-22.3z" opacity=".1"></path><path d="M13.24 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.749l.012-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-wb)" stroke="#323232" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><path d="M14.895 34.327c-.716-1.396-3.266-6.812 4.513-15.739-2.1 4.86-5.958 8.69-4.513 15.739z" fill="#fff"></path>', 5)
|
|
664
|
-
])])) :
|
|
641
|
+
])])) : c.type === "R" ? (v(), g("svg", V2, [...s[9] || (s[9] = [
|
|
665
642
|
B('<defs><linearGradient gradientTransform="translate(582.87 492.95)" gradientUnits="userSpaceOnUse" x1="-570.82" x2="-544.4" xlink:href="#gioco-a-wr" id="gioco-b-wr" y1="-468.61" y2="-468.61"></linearGradient><linearGradient id="gioco-a-wr"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient><linearGradient gradientTransform="translate(582.87 492.95)" gradientUnits="userSpaceOnUse" x1="-573.06" x2="-542.69" xlink:href="#gioco-a-wr" id="gioco-c-wr" y1="-451.71" y2="-451.71"></linearGradient></defs><path d="M12.855 10.383v7.663c0 3.268 6.53 3.774 6.53 3.774-.352 9.864-5.036 16.486-5.036 16.486l21.428-.039s-4.651-6.62-5-16.446c0 0 6.896-.507 6.896-3.774v-7.663h-4.72s.459 2.25-.47 3.26c-1.035 1.126-2.418 1.126-3.454 0-.928-1.01-.47-3.26-.47-3.26h-6.59s.459 2.25-.47 3.26c-1.122 1.22-2.699 1.22-3.82 0-.929-1.01-.47-3.26-.47-3.26z" fill="url(#gioco-b-wr)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6"></path><path d="m37.543 10.462.014 7.585c.263 3.48-24.58 2.135-24.523 1.03 2.098 2.532 4.445 2.613 6.352 2.744 7.292.498 9.8 8.89 13.306 16.446h2.97s-4.65-6.62-5-16.446c2.547-.395 2.954-.812 4.037-1.058h.018l-.002-.004c1.023-.236 2.81-1.376 2.842-2.713v-7.663z" opacity=".1"></path><path d="M13.239 38.286c-1.437 0-2.627 1.216-2.627 2.685v.544l.013 2.685h28.75l.012-2.685v-.544c0-1.469-1.19-2.685-2.627-2.685H25z" fill="url(#gioco-c-wr)" stroke="#323232" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M13.656 11.168v5.54c.48-1.867.299-4.088 1.554-5.54zM22.877 11.163c.055.896-.154 1.748-.269 2.616.48-1.866 1.823-2.616 1.823-2.616zM16.947 35.312c.875-1.143 3.603-10.333 3.233-13.244.7.39.658 10.057-3.233 13.244zM33.863 11.209c.005.598-.055 1.226-.187 2.02.48-1.867 1.295-2.04 1.295-2.04z"></path></g>', 5)
|
|
666
|
-
])])) :
|
|
643
|
+
])])) : c.type === "Q" ? (v(), g("svg", A2, [...s[10] || (s[10] = [
|
|
667
644
|
B('<defs><linearGradient gradientTransform="translate(545.92 492.79)" gradientUnits="userSpaceOnUse" x1="-540.02" x2="-501.82" xlink:href="#gioco-a-wq" id="gioco-b-wq" y1="-470.59" y2="-470.59"></linearGradient><linearGradient id="gioco-a-wq"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient><linearGradient gradientTransform="translate(545.92 492.79)" gradientUnits="userSpaceOnUse" x1="-536.12" x2="-505.75" xlink:href="#gioco-a-wq" id="gioco-c-wq" y1="-451.55" y2="-451.55"></linearGradient></defs><path d="M25 6.122c-2.635 0-4.771 2.098-4.771 4.685.002 1.855 1.118 3.534 2.846 4.283-.369 2.286-1.51 7.558-4.68 8.009-2.355.334-3.855-1.287-4.88-3.144a4.19 4.19 0 0 0 1.767-3.4c0-2.327-1.921-4.214-4.291-4.214S6.699 14.228 6.7 16.555c0 2.142 1.64 3.943 3.809 4.183l4.973 17.54h19.036l4.973-17.54c2.169-.24 3.807-2.041 3.809-4.183 0-2.327-1.922-4.214-4.292-4.214s-4.29 1.887-4.29 4.214a4.19 4.19 0 0 0 1.766 3.4c-1.025 1.857-2.525 3.478-4.88 3.144-3.17-.45-4.31-5.723-4.68-8.01 1.729-.748 2.845-2.427 2.847-4.282 0-2.587-2.136-4.685-4.77-4.685z" fill="url(#gioco-b-wq)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6"></path><path d="M39.002 12.342a4.348 4.348 0 0 0-1.567.296c4.741 1.678 3.877 6.805.591 7.316L30.414 38.28h4.2l4.87-17.541c2.17-.241 3.808-2.042 3.81-4.184 0-2.327-1.922-4.214-4.292-4.213z" opacity=".1"></path><path d="M13.227 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684H39.36l.013-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685h-11.76z" fill="url(#gioco-c-wq)" stroke="#323232" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M9.515 13.489c-.794 1.17-1.726 2.667-1.554 4.779 0 0-1.604-3.01 1.554-4.779zM23.659 7.23c-.853.874-2.37 2.934-2.133 5.374-.207-.084-1.73-3.893 2.133-5.374zM12.062 23.328l5.244 14.111-1.17.023z"></path></g>', 5)
|
|
668
|
-
])])) :
|
|
645
|
+
])])) : c.type === "K" ? (v(), g("svg", K2, [...s[11] || (s[11] = [
|
|
669
646
|
B('<defs><linearGradient gradientTransform="matrix(.26458 0 0 .25357 227.43 -666.55)" gradientUnits="userSpaceOnUse" x1="-825.75" x2="-704.44" xlink:href="#gioco-a-wk" id="gioco-b-wk" y1="2712.8" y2="2712.8"></linearGradient><linearGradient id="gioco-a-wk"><stop offset="0" stop-color="#fff"></stop><stop offset="1" stop-color="#bba38a"></stop></linearGradient><linearGradient gradientTransform="translate(225.05 -690.53)" gradientUnits="userSpaceOnUse" x1="-215.24" x2="-184.86" xlink:href="#gioco-a-wk" id="gioco-c-wk" y1="731.78" y2="731.78"></linearGradient></defs><path d="M25.006 3.868c-1.803.1-3.228 1.234-3.228 2.618 0 .565.244 1.644.693 2.097h-5.766v5.106h6.306l-2.61 2.833 2.673 2.167c-5.584.362-12.02 1.643-13.154 3.997-1.268 2.638 6.215 15.6 6.215 15.6h17.73s7.484-12.963 6.215-15.6c-1.133-2.357-7.594-3.64-13.179-3.999l2.71-2.165-2.61-2.833h6.306V8.583H27.54c.449-.453.693-1.531.693-2.097 0-1.384-1.425-2.518-3.228-2.618z" fill="url(#gioco-b-wk)" stroke="#323232" stroke-linejoin="round" stroke-width="1.6" style="paint-order:fill markers;"></path><path d="m31.289 38.283 2.573-.005s7.482-12.428 6.214-15.065c-4.136-3.824-13.18-4.525-13.18-4.525 11.05 2.822 12.618 5.028 4.393 19.595z" opacity=".1"></path><path d="M13.242 38.286c-1.437 0-2.627 1.216-2.627 2.685v.545l.013 2.684h28.749l.012-2.684v-.545c0-1.468-1.19-2.685-2.627-2.685h-11.76z" fill="url(#gioco-c-wk)" stroke="#323232" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6"></path><g fill="#fff"><path d="M13.283 31.138s-3.074-6.555-2.666-8.092c.408-1.536 5.987-2.736 5.987-2.736-6.486 2.71-4.786 4.558-3.321 10.828zM17.521 12.884v-3.52l1.532-.011c-.891.007-1.532 2.147-1.532 3.531zM24.798 4.67s-2.614.92-1.53 3.522c-.178-.007-2.142-2.72 1.53-3.522z"></path></g>', 5)
|
|
670
647
|
])])) : de("", !0);
|
|
671
648
|
}
|
|
672
|
-
}),
|
|
649
|
+
}), X2 = ["viewBox"], Y2 = ["d", "fill"], Z2 = ["d", "data-hexboard-position", "data-testid", "fill"], J2 = ["d", "data-testid", "fill"], I2 = ["d", "data-testid", "fill"], _2 = ["textContent", "data-testid", "x", "y"], et = ["cx", "cy", "data-testid", "fill"], tt = ["viewBox"], it = /* @__PURE__ */ c2({
|
|
673
650
|
__name: "Hexboard",
|
|
674
|
-
props: /* @__PURE__ */
|
|
651
|
+
props: /* @__PURE__ */ i2({
|
|
675
652
|
active: { type: Boolean, default: !1 },
|
|
676
653
|
autoselect: { type: Boolean, default: !1 },
|
|
677
654
|
flipped: { type: Boolean, default: !1 },
|
|
678
|
-
hexchess: { default: () =>
|
|
655
|
+
hexchess: { default: () => a2.init() },
|
|
679
656
|
highlight: { default: () => [] },
|
|
680
657
|
ignoreTurn: { type: Boolean, default: !1 },
|
|
681
658
|
options: { default: () => ({}) },
|
|
682
|
-
pieces: { default: () =>
|
|
659
|
+
pieces: { default: () => Q2 },
|
|
683
660
|
playing: { type: [String, Boolean], default: !1 },
|
|
684
|
-
position: { default:
|
|
661
|
+
position: { default: B2 }
|
|
685
662
|
}, {
|
|
686
663
|
"mouseover-position": {
|
|
687
664
|
default: null,
|
|
@@ -699,44 +676,44 @@ const Rt = {
|
|
|
699
676
|
},
|
|
700
677
|
targetsModifiers: {}
|
|
701
678
|
}),
|
|
702
|
-
emits: /* @__PURE__ */
|
|
703
|
-
setup(
|
|
704
|
-
const
|
|
679
|
+
emits: /* @__PURE__ */ i2(["clickPosition", "move"], ["update:mouseover-position", "update:selected", "update:targets"]),
|
|
680
|
+
setup(c, { emit: P }) {
|
|
681
|
+
const s = c, K = P, E = Q1(c, "mouseover-position"), U = Q1(c, "selected"), W = Q1(c, "targets"), _e = t1({ x: 0, y: 0 }), C = t1(null), ae = t1(new DOMRect()), h = t1({
|
|
705
682
|
hexchess: null,
|
|
706
683
|
promotionEl: null,
|
|
707
684
|
promotionFrom: null,
|
|
708
685
|
promotionTo: null,
|
|
709
686
|
selected: null
|
|
710
|
-
}), W1 =
|
|
711
|
-
let
|
|
712
|
-
const
|
|
687
|
+
}), W1 = k2("svgEl"), V = t1(new DOMRect());
|
|
688
|
+
let V1 = !1;
|
|
689
|
+
const u2 = j(() => h.value.hexchess ? [] : W.value), ce = j(() => h.value.hexchess ? h.value.hexchess : s.hexchess ? s.hexchess : a2.init()), d2 = j(() => ce.value.board.reduce(
|
|
713
690
|
(r, d, u) => (d && u !== C.value && r.push({ piece: d, index: u }), r),
|
|
714
691
|
[]
|
|
715
692
|
)), i1 = j(() => typeof h.value.selected == "number" ? null : U.value), X1 = j(() => {
|
|
716
693
|
var r, d, u;
|
|
717
|
-
if (
|
|
694
|
+
if (A1.value)
|
|
718
695
|
return "grabbing";
|
|
719
|
-
if (!(!
|
|
720
|
-
if (U.value !== null && W.value.includes(
|
|
696
|
+
if (!(!s.active || E.value === null || h.value.hexchess)) {
|
|
697
|
+
if (U.value !== null && W.value.includes(E.value)) {
|
|
721
698
|
const p = (r = ce.value) == null ? void 0 : r.board[U.value];
|
|
722
699
|
if (p) {
|
|
723
|
-
const b = p === p.toLowerCase() ? "b" : "w",
|
|
724
|
-
if ((
|
|
700
|
+
const b = p === p.toLowerCase() ? "b" : "w", z = ((d = ce.value) == null ? void 0 : d.turn) === b;
|
|
701
|
+
if ((s.playing === !0 || z) && l1(U.value))
|
|
725
702
|
return "pointer";
|
|
726
703
|
}
|
|
727
704
|
}
|
|
728
705
|
if (r1.value)
|
|
729
|
-
return
|
|
706
|
+
return s.playing === !0 || s.playing && Z1.value === ((u = ce.value) == null ? void 0 : u.turn) && s.playing === Z1.value ? "grab" : "pointer";
|
|
730
707
|
}
|
|
731
708
|
}), Y1 = j(() => ({
|
|
732
709
|
x: _e.value.x - V.value.width / 2,
|
|
733
710
|
y: _e.value.y - V.value.height / 2
|
|
734
|
-
})),
|
|
711
|
+
})), A1 = j(() => !s.hexchess || h.value.hexchess || C.value === null ? null : s.hexchess.board[C.value]), A = j(() => ({ ...E2, ...s.options })), Z1 = j(() => r1.value ? r1.value === r1.value.toLowerCase() ? "b" : "w" : null), r1 = j(() => {
|
|
735
712
|
var r;
|
|
736
|
-
return
|
|
713
|
+
return E.value === null ? null : ((r = ce.value) == null ? void 0 : r.board[E.value]) ?? null;
|
|
737
714
|
}), s1 = j(() => {
|
|
738
715
|
var p;
|
|
739
|
-
const r = (p = h.value.hexchess) == null ? void 0 : p.board[h.value.selected ?? -1], d = r === (r == null ? void 0 : r.toUpperCase()), u = (b) => (
|
|
716
|
+
const r = (p = h.value.hexchess) == null ? void 0 : p.board[h.value.selected ?? -1], d = r === (r == null ? void 0 : r.toUpperCase()), u = (b) => (z) => C2(s.pieces, { ...z, type: b });
|
|
740
717
|
return {
|
|
741
718
|
n: u(d ? "N" : "n"),
|
|
742
719
|
b: u(d ? "B" : "b"),
|
|
@@ -744,27 +721,27 @@ const Rt = {
|
|
|
744
721
|
q: u(d ? "Q" : "q")
|
|
745
722
|
};
|
|
746
723
|
});
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}),
|
|
724
|
+
y2(() => {
|
|
725
|
+
s.active && J1();
|
|
726
|
+
}), x2(n2), r2(X1, (r) => {
|
|
750
727
|
document.body.style.setProperty(
|
|
751
728
|
"cursor",
|
|
752
729
|
r === "grabbing" ? "grabbing" : null
|
|
753
730
|
);
|
|
754
|
-
}),
|
|
755
|
-
() =>
|
|
756
|
-
(r) => r ? J1() :
|
|
731
|
+
}), r2(
|
|
732
|
+
() => s.active,
|
|
733
|
+
(r) => r ? J1() : n2()
|
|
757
734
|
);
|
|
758
735
|
function K1(r, d) {
|
|
759
|
-
var
|
|
736
|
+
var z, se;
|
|
760
737
|
if (!W.value.includes(r.to))
|
|
761
738
|
return;
|
|
762
|
-
const u = (
|
|
739
|
+
const u = (z = s.hexchess) == null ? void 0 : z.board[r.from];
|
|
763
740
|
if (!u)
|
|
764
741
|
return;
|
|
765
|
-
const p = u === u.toLowerCase() ? "b" : "w", b = ((se =
|
|
766
|
-
if (
|
|
767
|
-
const ue =
|
|
742
|
+
const p = u === u.toLowerCase() ? "b" : "w", b = ((se = s.hexchess) == null ? void 0 : se.turn) === p;
|
|
743
|
+
if (s.hexchess && (u === "p" || u === "P") && S2(r.to, p)) {
|
|
744
|
+
const ue = s.hexchess.clone();
|
|
768
745
|
ue.board[r.from] = null, ue.board[r.to] = u, h.value = {
|
|
769
746
|
hexchess: ue,
|
|
770
747
|
promotionEl: (d == null ? void 0 : d.target) instanceof Element ? d.target : null,
|
|
@@ -774,31 +751,31 @@ const Rt = {
|
|
|
774
751
|
}, (d == null ? void 0 : d.target) instanceof Element && (ae.value = d.target.getBoundingClientRect());
|
|
775
752
|
return;
|
|
776
753
|
}
|
|
777
|
-
l1(r.from) && (
|
|
754
|
+
l1(r.from) && (s.ignoreTurn || b) && _1(r);
|
|
778
755
|
}
|
|
779
756
|
function l1(r) {
|
|
780
757
|
var p;
|
|
781
|
-
const d = (p =
|
|
758
|
+
const d = (p = s.hexchess) == null ? void 0 : p.board[r];
|
|
782
759
|
if (!d)
|
|
783
760
|
return !1;
|
|
784
761
|
const u = d === d.toLowerCase() ? "b" : "w";
|
|
785
|
-
return
|
|
762
|
+
return s.playing === !0 || s.playing === u;
|
|
786
763
|
}
|
|
787
|
-
function
|
|
764
|
+
function f2(r) {
|
|
788
765
|
var d, u;
|
|
789
|
-
return
|
|
766
|
+
return E.value === null ? A.value.labelColor : (d = R(E.value)) != null && d.startsWith(r) || (u = R(E.value)) != null && u.endsWith(r) ? A.value.labelActiveColor : A.value.labelInactiveColor;
|
|
790
767
|
}
|
|
791
768
|
function J1() {
|
|
792
|
-
_e.value = { x: 0, y: 0 }, window.addEventListener("keyup", I1), window.addEventListener("pointermove",
|
|
769
|
+
_e.value = { x: 0, y: 0 }, window.addEventListener("keyup", I1), window.addEventListener("pointermove", e2), window.addEventListener("pointerup", o2), window.addEventListener("resize", a1), window.addEventListener("scroll", a1), window.addEventListener("touchmove", t2, { passive: !1 });
|
|
793
770
|
}
|
|
794
771
|
function a1() {
|
|
795
772
|
var r;
|
|
796
773
|
ae.value = ((r = h.value.promotionEl) == null ? void 0 : r.getBoundingClientRect()) ?? new DOMRect();
|
|
797
774
|
}
|
|
798
|
-
function
|
|
799
|
-
if (
|
|
800
|
-
if (
|
|
801
|
-
|
|
775
|
+
function p2(r, d) {
|
|
776
|
+
if (s.active) {
|
|
777
|
+
if (V1) {
|
|
778
|
+
V1 = !1;
|
|
802
779
|
return;
|
|
803
780
|
}
|
|
804
781
|
if (h.value.hexchess) {
|
|
@@ -810,7 +787,7 @@ const Rt = {
|
|
|
810
787
|
K1(u, d);
|
|
811
788
|
return;
|
|
812
789
|
}
|
|
813
|
-
|
|
790
|
+
s.autoselect && !s.hexchess.board[r] && (U.value = null, W.value = []), K("clickPosition", r);
|
|
814
791
|
}
|
|
815
792
|
}
|
|
816
793
|
function I1(r) {
|
|
@@ -819,21 +796,21 @@ const Rt = {
|
|
|
819
796
|
e1();
|
|
820
797
|
return;
|
|
821
798
|
}
|
|
822
|
-
|
|
799
|
+
s.autoselect && (U.value = null, W.value = []);
|
|
823
800
|
}
|
|
824
801
|
}
|
|
825
802
|
function _1(r) {
|
|
826
803
|
K("move", r), c1();
|
|
827
804
|
}
|
|
828
|
-
function
|
|
805
|
+
function h2(r, d) {
|
|
829
806
|
var u;
|
|
830
807
|
if (d.stopPropagation(), C.value !== null) {
|
|
831
808
|
let p = r;
|
|
832
809
|
const b = document.elementFromPoint(
|
|
833
810
|
d.clientX,
|
|
834
811
|
d.clientY
|
|
835
|
-
),
|
|
836
|
-
|
|
812
|
+
), z = b == null ? void 0 : b.getAttribute("data-hexboard-position");
|
|
813
|
+
z !== null && (p = Number(z));
|
|
837
814
|
const se = new d1({ from: C.value, to: p });
|
|
838
815
|
if (K1(se, d), h.value.hexchess)
|
|
839
816
|
return;
|
|
@@ -848,7 +825,7 @@ const Rt = {
|
|
|
848
825
|
e1();
|
|
849
826
|
return;
|
|
850
827
|
}
|
|
851
|
-
if ((u =
|
|
828
|
+
if ((u = s.hexchess) != null && u.board[r]) {
|
|
852
829
|
C.value = null, V.value = new DOMRect();
|
|
853
830
|
return;
|
|
854
831
|
}
|
|
@@ -862,31 +839,31 @@ const Rt = {
|
|
|
862
839
|
promotionFrom: null,
|
|
863
840
|
promotionTo: null,
|
|
864
841
|
selected: null
|
|
865
|
-
}, typeof r == "number" && (U.value = r, W.value =
|
|
842
|
+
}, typeof r == "number" && (U.value = r, W.value = s.hexchess.movesFrom(r).map((d) => d.to) ?? []), C.value = null, V1 = !0;
|
|
866
843
|
}
|
|
867
|
-
function
|
|
868
|
-
var
|
|
869
|
-
if (d.preventDefault(),
|
|
844
|
+
function v2(r, d) {
|
|
845
|
+
var z, se, ue;
|
|
846
|
+
if (d.preventDefault(), h.value.hexchess)
|
|
870
847
|
return;
|
|
871
|
-
const u = (
|
|
872
|
-
if (!u || (
|
|
848
|
+
const u = (z = s.hexchess) == null ? void 0 : z.board[r];
|
|
849
|
+
if (!u || (s.autoselect && (U.value = r, W.value = ((se = s.hexchess) == null ? void 0 : se.movesFrom(r).map((b2) => b2.to)) ?? []), !l1(r)))
|
|
873
850
|
return;
|
|
874
|
-
const p = u === u.toLowerCase() ? "b" : "w", b = ((ue =
|
|
875
|
-
!
|
|
851
|
+
const p = u === u.toLowerCase() ? "b" : "w", b = ((ue = s.hexchess) == null ? void 0 : ue.turn) === p;
|
|
852
|
+
!s.ignoreTurn && !b || (C.value = r, _e.value = { x: d.clientX, y: d.clientY }, W1.value instanceof Element && (V.value = W1.value.getBoundingClientRect()));
|
|
876
853
|
}
|
|
877
|
-
function
|
|
878
|
-
|
|
854
|
+
function g2(r) {
|
|
855
|
+
E.value = r;
|
|
879
856
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
857
|
+
function w2() {
|
|
858
|
+
E.value = null;
|
|
882
859
|
}
|
|
883
|
-
function
|
|
884
|
-
|
|
860
|
+
function e2(r) {
|
|
861
|
+
s.active && (_e.value = { x: r.clientX, y: r.clientY });
|
|
885
862
|
}
|
|
886
|
-
function
|
|
863
|
+
function t2(r) {
|
|
887
864
|
C.value !== null && r.preventDefault();
|
|
888
865
|
}
|
|
889
|
-
function
|
|
866
|
+
function o2() {
|
|
890
867
|
if (h.value.hexchess) {
|
|
891
868
|
e1();
|
|
892
869
|
return;
|
|
@@ -897,7 +874,7 @@ const Rt = {
|
|
|
897
874
|
}
|
|
898
875
|
c1();
|
|
899
876
|
}
|
|
900
|
-
function
|
|
877
|
+
function m2(r) {
|
|
901
878
|
if (typeof h.value.promotionFrom == "number" && l1(h.value.promotionFrom)) {
|
|
902
879
|
const d = new d1({
|
|
903
880
|
from: h.value.promotionFrom ?? 0,
|
|
@@ -916,8 +893,8 @@ const Rt = {
|
|
|
916
893
|
selected: null
|
|
917
894
|
}, V.value = new DOMRect(), W.value = [];
|
|
918
895
|
}
|
|
919
|
-
function
|
|
920
|
-
c1(), window.removeEventListener("keyup", I1), window.removeEventListener("pointermove",
|
|
896
|
+
function n2() {
|
|
897
|
+
c1(), window.removeEventListener("keyup", I1), window.removeEventListener("pointermove", e2), window.removeEventListener("pointerup", o2), window.removeEventListener("resize", a1), window.removeEventListener("scroll", a1), window.removeEventListener("touchmove", t2);
|
|
921
898
|
}
|
|
922
899
|
return (r, d) => (v(), g("div", null, [
|
|
923
900
|
(v(), g("svg", {
|
|
@@ -927,59 +904,59 @@ const Rt = {
|
|
|
927
904
|
style: u1({ cursor: X1.value }),
|
|
928
905
|
viewBox: `0 0 ${f(he)} ${f(he)}`
|
|
929
906
|
}, [
|
|
930
|
-
|
|
931
|
-
d: f(N1)(f(
|
|
907
|
+
M2("path", {
|
|
908
|
+
d: f(N1)(f($2)),
|
|
932
909
|
fill: A.value.colors[1],
|
|
933
910
|
style: { pointerEvents: "none" }
|
|
934
|
-
}, null, 8,
|
|
935
|
-
(v(!0), g(o1, null, n1(f(o), (u, p) => (v(), g("path",
|
|
911
|
+
}, null, 8, Y2),
|
|
912
|
+
(v(!0), g(o1, null, n1(f(o), (u, p) => (v(), g("path", z2(
|
|
936
913
|
{ ref_for: !0 },
|
|
937
|
-
|
|
938
|
-
onClick: (b) =>
|
|
939
|
-
onMouseenter: () =>
|
|
940
|
-
onMouseleave: () =>
|
|
941
|
-
onPointerdown: (b) =>
|
|
942
|
-
onPointerup: (b) =>
|
|
914
|
+
c.active ? {
|
|
915
|
+
onClick: (b) => p2(p, b),
|
|
916
|
+
onMouseenter: () => g2(p),
|
|
917
|
+
onMouseleave: () => w2(),
|
|
918
|
+
onPointerdown: (b) => v2(p, b),
|
|
919
|
+
onPointerup: (b) => h2(p, b)
|
|
943
920
|
} : {},
|
|
944
921
|
{
|
|
945
|
-
d: f(N1)(
|
|
922
|
+
d: f(N1)(c.flipped ? u[4] : u[3]),
|
|
946
923
|
"data-hexboard-position": p,
|
|
947
924
|
"data-testid": `position-${f(R)(p)}`,
|
|
948
925
|
fill: A.value.colors[f(o)[p][0]],
|
|
949
926
|
key: p
|
|
950
927
|
}
|
|
951
|
-
), null, 16,
|
|
952
|
-
(v(!0), g(o1, null, n1(
|
|
953
|
-
d: f(N1)(
|
|
928
|
+
), null, 16, Z2))), 128)),
|
|
929
|
+
(v(!0), g(o1, null, n1(c.highlight, (u) => (v(), g("path", {
|
|
930
|
+
d: f(N1)(c.flipped ? f(o)[u][4] : f(o)[u][3]),
|
|
954
931
|
"data-testid": `highlight-${f(R)(u)}`,
|
|
955
932
|
fill: A.value.highlightColor,
|
|
956
933
|
key: `highlight-${u}`,
|
|
957
934
|
style: { pointerEvents: "none" }
|
|
958
|
-
}, null, 8,
|
|
935
|
+
}, null, 8, J2))), 128)),
|
|
959
936
|
typeof i1.value == "number" ? (v(), g("path", {
|
|
960
937
|
key: 0,
|
|
961
|
-
d: f(N1)(
|
|
938
|
+
d: f(N1)(c.flipped ? f(o)[i1.value][4] : f(o)[i1.value][3]),
|
|
962
939
|
"data-testid": `selected-${f(R)(i1.value)}`,
|
|
963
940
|
fill: A.value.selectedColor,
|
|
964
941
|
ref: "selectedEl",
|
|
965
942
|
style: { pointerEvents: "none" }
|
|
966
|
-
}, null, 8,
|
|
967
|
-
A.value.labels ? (v(!0), g(o1, { key: 1 }, n1(f(
|
|
968
|
-
textContent:
|
|
943
|
+
}, null, 8, I2)) : de("", !0),
|
|
944
|
+
A.value.labels ? (v(!0), g(o1, { key: 1 }, n1(f(O2), ([u, p, b], z) => (v(), g("text", {
|
|
945
|
+
textContent: G2(u),
|
|
969
946
|
"dominant-baseline": "central",
|
|
970
947
|
"text-anchor": "middle",
|
|
971
948
|
"data-testid": `label-${u}`,
|
|
972
|
-
key: `label-${
|
|
949
|
+
key: `label-${z}`,
|
|
973
950
|
style: u1({
|
|
974
|
-
fill:
|
|
951
|
+
fill: f2(u),
|
|
975
952
|
fontSize: ".5px",
|
|
976
953
|
pointerEvents: "none",
|
|
977
954
|
userSelect: "none"
|
|
978
955
|
}),
|
|
979
|
-
x: f(fe)(
|
|
980
|
-
y: f(pe)(
|
|
981
|
-
}, null, 12,
|
|
982
|
-
ce.value ? (v(!0), g(o1, { key: 2 }, n1(
|
|
956
|
+
x: f(fe)(c.flipped ? b[0] : p[0]),
|
|
957
|
+
y: f(pe)(c.flipped ? b[1] : p[1])
|
|
958
|
+
}, null, 12, _2))), 128)) : de("", !0),
|
|
959
|
+
ce.value ? (v(!0), g(o1, { key: 2 }, n1(d2.value, ({ piece: u, index: p }) => (v(), s2(l2(c.pieces), {
|
|
983
960
|
"data-piece-type": u,
|
|
984
961
|
"data-testid": `piece-${f(R)(p)}`,
|
|
985
962
|
height: f(Q),
|
|
@@ -987,20 +964,20 @@ const Rt = {
|
|
|
987
964
|
style: { pointerEvents: "none" },
|
|
988
965
|
type: u,
|
|
989
966
|
width: f(Q),
|
|
990
|
-
x: f(fe)(f(o)[p][
|
|
991
|
-
y: f(pe)(f(o)[p][
|
|
967
|
+
x: f(fe)(f(o)[p][c.flipped ? 2 : 1][0] - f(Q) / 2),
|
|
968
|
+
y: f(pe)(f(o)[p][c.flipped ? 2 : 1][1] + f(Q) / 2)
|
|
992
969
|
}, null, 8, ["data-piece-type", "data-testid", "height", "type", "width", "x", "y"]))), 128)) : de("", !0),
|
|
993
|
-
(v(!0), g(o1, null, n1(
|
|
994
|
-
cx: f(fe)(f(o)[u][
|
|
995
|
-
cy: f(pe)(f(o)[u][
|
|
970
|
+
(v(!0), g(o1, null, n1(u2.value, (u) => (v(), g("circle", {
|
|
971
|
+
cx: f(fe)(f(o)[u][c.flipped ? 2 : 1][0]),
|
|
972
|
+
cy: f(pe)(f(o)[u][c.flipped ? 2 : 1][1]),
|
|
996
973
|
"data-testid": `target-${f(R)(u)}`,
|
|
997
974
|
fill: A.value.targetColor,
|
|
998
975
|
key: `target-${f(R)(u)}`,
|
|
999
976
|
r: 0.3,
|
|
1000
977
|
style: { pointerEvents: "none" }
|
|
1001
|
-
}, null, 8,
|
|
1002
|
-
], 12,
|
|
1003
|
-
|
|
978
|
+
}, null, 8, et))), 128))
|
|
979
|
+
], 12, X2)),
|
|
980
|
+
A1.value ? (v(), g("svg", {
|
|
1004
981
|
key: 0,
|
|
1005
982
|
"data-testid": "drag-piece",
|
|
1006
983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1016,15 +993,15 @@ const Rt = {
|
|
|
1016
993
|
}),
|
|
1017
994
|
viewBox: `0 0 ${f(he)} ${f(he)}`
|
|
1018
995
|
}, [
|
|
1019
|
-
(v(),
|
|
996
|
+
(v(), s2(l2(c.pieces), {
|
|
1020
997
|
height: f(Q),
|
|
1021
998
|
style: { pointerEvents: "none" },
|
|
1022
|
-
type:
|
|
999
|
+
type: A1.value,
|
|
1023
1000
|
width: f(Q),
|
|
1024
1001
|
x: f(fe)(f(Q) / -2),
|
|
1025
1002
|
y: f(pe)(f(Q) / 2)
|
|
1026
1003
|
}, null, 8, ["height", "type", "width", "x", "y"]))
|
|
1027
|
-
], 12,
|
|
1004
|
+
], 12, tt)) : de("", !0),
|
|
1028
1005
|
typeof h.value.selected == "number" ? (v(), g("div", {
|
|
1029
1006
|
key: 1,
|
|
1030
1007
|
style: u1({
|
|
@@ -1034,15 +1011,15 @@ const Rt = {
|
|
|
1034
1011
|
top: ae.value.top + "px",
|
|
1035
1012
|
width: ae.value.width + "px"
|
|
1036
1013
|
}),
|
|
1037
|
-
onPointerup: d[0] || (d[0] =
|
|
1014
|
+
onPointerup: d[0] || (d[0] = P2(() => {
|
|
1038
1015
|
}, ["stop"]))
|
|
1039
1016
|
}, [
|
|
1040
|
-
|
|
1017
|
+
U2(r.$slots, "promotion", {
|
|
1041
1018
|
b: s1.value.b,
|
|
1042
1019
|
cancel: e1,
|
|
1043
1020
|
file: f(R)(h.value.selected)[0],
|
|
1044
1021
|
n: s1.value.n,
|
|
1045
|
-
promote:
|
|
1022
|
+
promote: m2,
|
|
1046
1023
|
q: s1.value.q,
|
|
1047
1024
|
r: s1.value.r,
|
|
1048
1025
|
rank: Number(f(R)(h.value.selected).slice(1))
|
|
@@ -1052,5 +1029,5 @@ const Rt = {
|
|
|
1052
1029
|
}
|
|
1053
1030
|
});
|
|
1054
1031
|
export {
|
|
1055
|
-
|
|
1032
|
+
it as Hexboard
|
|
1056
1033
|
};
|
package/package.json
CHANGED
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"main": "dist/index.js",
|
|
39
39
|
"module": "dist/index.js",
|
|
40
40
|
"name": "@bedard/hexboard",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/scottbedard/hexboard"
|
|
44
|
+
},
|
|
41
45
|
"peerDependencies": {
|
|
42
46
|
"@bedard/hexchess": "^2.5.0",
|
|
43
47
|
"vue": "^3.5.0"
|
|
@@ -54,5 +58,5 @@
|
|
|
54
58
|
"license": "MIT",
|
|
55
59
|
"type": "module",
|
|
56
60
|
"types": "dist/index.d.ts",
|
|
57
|
-
"version": "0.0.
|
|
61
|
+
"version": "0.0.3"
|
|
58
62
|
}
|
|
@@ -190,7 +190,6 @@ import {
|
|
|
190
190
|
} from './constants'
|
|
191
191
|
import { d } from './dom'
|
|
192
192
|
import { x, y } from './geometry'
|
|
193
|
-
import { hapticConfirm } from './haptics'
|
|
194
193
|
import GiocoPieces from './pieces/Gioco.vue'
|
|
195
194
|
import type { HexboardOptions } from './types'
|
|
196
195
|
|
|
@@ -734,8 +733,6 @@ function cancelPromotion() {
|
|
|
734
733
|
function onPointerdownPosition(index: number, evt: PointerEvent) {
|
|
735
734
|
evt.preventDefault()
|
|
736
735
|
|
|
737
|
-
hapticConfirm()
|
|
738
|
-
|
|
739
736
|
// Don't start new interactions during promotion
|
|
740
737
|
if (staging.value.hexchess) {
|
|
741
738
|
return
|
|
@@ -750,10 +747,6 @@ function onPointerdownPosition(index: number, evt: PointerEvent) {
|
|
|
750
747
|
if (props.autoselect) {
|
|
751
748
|
selected.value = index
|
|
752
749
|
targets.value = props.hexchess?.movesFrom(index).map(san => san.to) ?? []
|
|
753
|
-
|
|
754
|
-
if (normalizedOptions.value.haptics) {
|
|
755
|
-
hapticConfirm()
|
|
756
|
-
}
|
|
757
750
|
}
|
|
758
751
|
|
|
759
752
|
if (!isPlayingPosition(index)) {
|
|
@@ -10,7 +10,6 @@ export const defaultOptions: HexboardOptions = {
|
|
|
10
10
|
'oklch(0.8366 0.1165 66.29)',
|
|
11
11
|
'oklch(0.6806 0.1423 75.83)',
|
|
12
12
|
],
|
|
13
|
-
haptics: true,
|
|
14
13
|
highlightColor: 'oklch(90.5% 0.182 98.111 / 75%)', // yellow-300 / 75% opacity
|
|
15
14
|
labelActiveColor: 'oklch(76.9% 0.188 70.08)', // amber-500
|
|
16
15
|
labelColor: 'oklch(55.4% 0.046 257.417)', // slate-500
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
export interface HexboardOptions {
|
|
3
3
|
/** position colors */
|
|
4
4
|
colors: [string, string, string]
|
|
5
|
-
/** haptic feedback vibrations */
|
|
6
|
-
haptics: boolean
|
|
7
5
|
/** color of highlighted position */
|
|
8
6
|
highlightColor: string
|
|
9
7
|
/** color of active label relative to mouseover */
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/** check if haptics are supported */
|
|
2
|
-
export const supportsHaptics
|
|
3
|
-
= typeof window === 'undefined'
|
|
4
|
-
? false
|
|
5
|
-
: window.matchMedia('(pointer: coarse)').matches
|
|
6
|
-
|
|
7
|
-
/** trigger haptic feedback */
|
|
8
|
-
function tick() {
|
|
9
|
-
try {
|
|
10
|
-
// use the native api if supported
|
|
11
|
-
if (navigator.vibrate) {
|
|
12
|
-
navigator.vibrate(50)
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (!supportsHaptics) return
|
|
17
|
-
|
|
18
|
-
// otherwise simulate a tep using a checkbox
|
|
19
|
-
const labelEl = document.createElement('label')
|
|
20
|
-
labelEl.ariaHidden = 'true'
|
|
21
|
-
labelEl.style.display = 'none'
|
|
22
|
-
|
|
23
|
-
const inputEl = document.createElement('input')
|
|
24
|
-
inputEl.type = 'checkbox'
|
|
25
|
-
inputEl.setAttribute('switch', '')
|
|
26
|
-
labelEl.appendChild(inputEl)
|
|
27
|
-
|
|
28
|
-
document.head.appendChild(labelEl)
|
|
29
|
-
labelEl.click()
|
|
30
|
-
document.head.removeChild(labelEl)
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// do nothing
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function hapticConfirm() {
|
|
38
|
-
if (navigator.vibrate) {
|
|
39
|
-
navigator.vibrate([50, 70, 50])
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
tick()
|
|
44
|
-
setTimeout(tick, 120)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function hapticError() {
|
|
48
|
-
if (navigator.vibrate) {
|
|
49
|
-
navigator.vibrate([50, 70, 50, 70, 50])
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
tick()
|
|
54
|
-
setTimeout(tick, 120)
|
|
55
|
-
setTimeout(tick, 240)
|
|
56
|
-
}
|