wissive 0.1.0 → 0.1.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/README.md +194 -193
- package/dist/index.d.ts +86 -0
- package/dist/wissive.cjs +149 -131
- package/dist/wissive.cjs.map +1 -1
- package/dist/wissive.js +1412 -1087
- package/dist/wissive.js.map +1 -1
- package/dist/wissive.umd.js +149 -131
- package/dist/wissive.umd.js.map +1 -1
- package/package.json +10 -2
package/dist/wissive.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Mt = (o, t, e) => t in o ? xt(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var v = (o, t, e) => Mt(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function $(o = {}) {
|
|
5
5
|
return {
|
|
6
6
|
eyeOpen: 1,
|
|
7
7
|
eyeScale: 1,
|
|
@@ -13,6 +13,7 @@ function f(o = {}) {
|
|
|
13
13
|
mouthWidth: 0.8,
|
|
14
14
|
mouthOpen: 0,
|
|
15
15
|
mouthType: 0,
|
|
16
|
+
showBrows: 0,
|
|
16
17
|
browY: 0,
|
|
17
18
|
browTilt: 0,
|
|
18
19
|
cheek: 0,
|
|
@@ -34,7 +35,7 @@ function f(o = {}) {
|
|
|
34
35
|
...o
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
const
|
|
38
|
+
const rt = {
|
|
38
39
|
name: "mochi",
|
|
39
40
|
emotion: "happy",
|
|
40
41
|
baseColor: "#F2A9B8",
|
|
@@ -50,27 +51,27 @@ const Re = {
|
|
|
50
51
|
},
|
|
51
52
|
expressions: {
|
|
52
53
|
idle: [
|
|
53
|
-
|
|
54
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0 }),
|
|
54
55
|
// >‿<
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -1.5 }),
|
|
57
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: 1 }),
|
|
57
58
|
// ^‿^
|
|
58
|
-
|
|
59
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0 })
|
|
59
60
|
],
|
|
60
61
|
near: [
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -1.5 }),
|
|
63
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -2.5 })
|
|
63
64
|
],
|
|
64
65
|
hover: [
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.3, bob: -4 }),
|
|
67
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.3, bob: -4.5 })
|
|
67
68
|
],
|
|
68
69
|
click: [
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.5, bob: -7 }),
|
|
71
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.5, bob: -6 })
|
|
71
72
|
]
|
|
72
73
|
}
|
|
73
|
-
},
|
|
74
|
+
}, Ft = {
|
|
74
75
|
name: "zumi",
|
|
75
76
|
emotion: "flutter",
|
|
76
77
|
baseColor: "#F2CB4E",
|
|
@@ -86,21 +87,21 @@ const Re = {
|
|
|
86
87
|
},
|
|
87
88
|
expressions: {
|
|
88
89
|
idle: [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.3 }),
|
|
91
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.4, bob: -1.5 }),
|
|
92
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.35, bob: 1 })
|
|
92
93
|
],
|
|
93
94
|
near: [
|
|
94
|
-
|
|
95
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.5, bob: -2 })
|
|
95
96
|
],
|
|
96
97
|
hover: [
|
|
97
|
-
|
|
98
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.7, bob: -4 })
|
|
98
99
|
],
|
|
99
100
|
click: [
|
|
100
|
-
|
|
101
|
+
$({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.9, bob: -6 })
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
|
-
},
|
|
104
|
+
}, kt = {
|
|
104
105
|
name: "suri",
|
|
105
106
|
emotion: "pleasure",
|
|
106
107
|
baseColor: "#F28FC2",
|
|
@@ -116,20 +117,20 @@ const Re = {
|
|
|
116
117
|
},
|
|
117
118
|
expressions: {
|
|
118
119
|
idle: [
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
$({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.4 }),
|
|
121
|
+
$({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.5, bob: 1 })
|
|
121
122
|
],
|
|
122
123
|
near: [
|
|
123
|
-
|
|
124
|
+
$({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.6, bob: 2 })
|
|
124
125
|
],
|
|
125
126
|
hover: [
|
|
126
|
-
|
|
127
|
+
$({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.75, bob: 3.5 })
|
|
127
128
|
],
|
|
128
129
|
click: [
|
|
129
|
-
|
|
130
|
+
$({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.9, bob: 5 })
|
|
130
131
|
]
|
|
131
132
|
}
|
|
132
|
-
},
|
|
133
|
+
}, vt = {
|
|
133
134
|
name: "nima",
|
|
134
135
|
emotion: "peaceful",
|
|
135
136
|
baseColor: "#9AC9A0",
|
|
@@ -145,20 +146,20 @@ const Re = {
|
|
|
145
146
|
},
|
|
146
147
|
expressions: {
|
|
147
148
|
idle: [
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
$({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0 }),
|
|
150
|
+
$({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, bob: 1.5 })
|
|
150
151
|
],
|
|
151
152
|
near: [
|
|
152
|
-
|
|
153
|
+
$({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, bob: 2 })
|
|
153
154
|
],
|
|
154
155
|
hover: [
|
|
155
|
-
|
|
156
|
+
$({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, cheek: 0.3, bob: 3 })
|
|
156
157
|
],
|
|
157
158
|
click: [
|
|
158
|
-
|
|
159
|
+
$({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, cheek: 0.5, bob: 4.5 })
|
|
159
160
|
]
|
|
160
161
|
}
|
|
161
|
-
},
|
|
162
|
+
}, De = {
|
|
162
163
|
name: "cota",
|
|
163
164
|
emotion: "normal",
|
|
164
165
|
baseColor: "#C9DCD3",
|
|
@@ -174,20 +175,20 @@ const Re = {
|
|
|
174
175
|
},
|
|
175
176
|
expressions: {
|
|
176
177
|
idle: [
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
$({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0 }),
|
|
179
|
+
$({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: -0.8 })
|
|
179
180
|
],
|
|
180
181
|
near: [
|
|
181
|
-
|
|
182
|
+
$({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 1.2 })
|
|
182
183
|
],
|
|
183
184
|
hover: [
|
|
184
|
-
|
|
185
|
+
$({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, cheek: 0.2, bob: 2.5 })
|
|
185
186
|
],
|
|
186
187
|
click: [
|
|
187
|
-
|
|
188
|
+
$({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, cheek: 0.4, bob: 4 })
|
|
188
189
|
]
|
|
189
190
|
}
|
|
190
|
-
},
|
|
191
|
+
}, Ct = {
|
|
191
192
|
name: "dozy",
|
|
192
193
|
emotion: "tired",
|
|
193
194
|
baseColor: "#D6DBCF",
|
|
@@ -205,20 +206,20 @@ const Re = {
|
|
|
205
206
|
// Cansado de verdad: párpados caídos + gotas de sudor + resoplido —
|
|
206
207
|
// sin zzz, que es "dormido"; Dozy está agotado pero despierto.
|
|
207
208
|
idle: [
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
$({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 1.5 }),
|
|
210
|
+
$({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 2.5 })
|
|
210
211
|
],
|
|
211
212
|
near: [
|
|
212
|
-
|
|
213
|
+
$({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 3.5 })
|
|
213
214
|
],
|
|
214
215
|
hover: [
|
|
215
|
-
|
|
216
|
+
$({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.85, bob: 4.5 })
|
|
216
217
|
],
|
|
217
218
|
click: [
|
|
218
|
-
|
|
219
|
+
$({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 1, bob: 6.5 })
|
|
219
220
|
]
|
|
220
221
|
}
|
|
221
|
-
},
|
|
222
|
+
}, wt = {
|
|
222
223
|
name: "lumo",
|
|
223
224
|
emotion: "sad",
|
|
224
225
|
baseColor: "#7FA6D9",
|
|
@@ -234,20 +235,20 @@ const Re = {
|
|
|
234
235
|
},
|
|
235
236
|
expressions: {
|
|
236
237
|
idle: [
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
$({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 1.8 }),
|
|
239
|
+
$({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 2.8 })
|
|
239
240
|
],
|
|
240
241
|
near: [
|
|
241
|
-
|
|
242
|
+
$({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 3.5 })
|
|
242
243
|
],
|
|
243
244
|
hover: [
|
|
244
|
-
|
|
245
|
+
$({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 4.8 })
|
|
245
246
|
],
|
|
246
247
|
click: [
|
|
247
|
-
|
|
248
|
+
$({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 6 })
|
|
248
249
|
]
|
|
249
250
|
}
|
|
250
|
-
},
|
|
251
|
+
}, Tt = {
|
|
251
252
|
name: "fidge",
|
|
252
253
|
emotion: "anxiety",
|
|
253
254
|
baseColor: "#A99BD9",
|
|
@@ -263,20 +264,20 @@ const Re = {
|
|
|
263
264
|
},
|
|
264
265
|
expressions: {
|
|
265
266
|
idle: [
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
$({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0 }),
|
|
268
|
+
$({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 1.5 })
|
|
268
269
|
],
|
|
269
270
|
near: [
|
|
270
|
-
|
|
271
|
+
$({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 2.5 })
|
|
271
272
|
],
|
|
272
273
|
hover: [
|
|
273
|
-
|
|
274
|
+
$({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 4 })
|
|
274
275
|
],
|
|
275
276
|
click: [
|
|
276
|
-
|
|
277
|
+
$({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 6 })
|
|
277
278
|
]
|
|
278
279
|
}
|
|
279
|
-
},
|
|
280
|
+
}, St = {
|
|
280
281
|
name: "brix",
|
|
281
282
|
emotion: "anger",
|
|
282
283
|
baseColor: "#D9566A",
|
|
@@ -292,20 +293,20 @@ const Re = {
|
|
|
292
293
|
},
|
|
293
294
|
expressions: {
|
|
294
295
|
idle: [
|
|
295
|
-
|
|
296
|
-
|
|
296
|
+
$({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 }),
|
|
297
|
+
$({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
|
|
297
298
|
],
|
|
298
299
|
near: [
|
|
299
|
-
|
|
300
|
+
$({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
|
|
300
301
|
],
|
|
301
302
|
hover: [
|
|
302
|
-
|
|
303
|
+
$({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
|
|
303
304
|
],
|
|
304
305
|
click: [
|
|
305
|
-
|
|
306
|
+
$({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
|
|
306
307
|
]
|
|
307
308
|
}
|
|
308
|
-
},
|
|
309
|
+
}, Yt = {
|
|
309
310
|
name: "wilt",
|
|
310
311
|
emotion: "disappointed",
|
|
311
312
|
baseColor: "#EBD98A",
|
|
@@ -321,20 +322,20 @@ const Re = {
|
|
|
321
322
|
},
|
|
322
323
|
expressions: {
|
|
323
324
|
idle: [
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
$({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 1.5 }),
|
|
326
|
+
$({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 2.5 })
|
|
326
327
|
],
|
|
327
328
|
near: [
|
|
328
|
-
|
|
329
|
+
$({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 3.5 })
|
|
329
330
|
],
|
|
330
331
|
hover: [
|
|
331
|
-
|
|
332
|
+
$({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 4.5 })
|
|
332
333
|
],
|
|
333
334
|
click: [
|
|
334
|
-
|
|
335
|
+
$({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 6 })
|
|
335
336
|
]
|
|
336
337
|
}
|
|
337
|
-
},
|
|
338
|
+
}, Et = {
|
|
338
339
|
name: "knot",
|
|
339
340
|
emotion: "stress",
|
|
340
341
|
baseColor: "#C97F76",
|
|
@@ -353,20 +354,20 @@ const Re = {
|
|
|
353
354
|
// pero el sello de Knot es cargar con la nube de tormenta Y el garabato
|
|
354
355
|
// de confusión encima a la vez — agobiado por todos lados, no solo mareado.
|
|
355
356
|
idle: [
|
|
356
|
-
|
|
357
|
-
|
|
357
|
+
$({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1 }),
|
|
358
|
+
$({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 1.5 })
|
|
358
359
|
],
|
|
359
360
|
near: [
|
|
360
|
-
|
|
361
|
+
$({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 3 })
|
|
361
362
|
],
|
|
362
363
|
hover: [
|
|
363
|
-
|
|
364
|
+
$({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 4.5 })
|
|
364
365
|
],
|
|
365
366
|
click: [
|
|
366
|
-
|
|
367
|
+
$({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 6.5 })
|
|
367
368
|
]
|
|
368
369
|
}
|
|
369
|
-
},
|
|
370
|
+
}, At = {
|
|
370
371
|
name: "snug",
|
|
371
372
|
emotion: "sleepy",
|
|
372
373
|
baseColor: "#AFCBE0",
|
|
@@ -382,20 +383,20 @@ const Re = {
|
|
|
382
383
|
},
|
|
383
384
|
expressions: {
|
|
384
385
|
idle: [
|
|
385
|
-
|
|
386
|
-
|
|
386
|
+
$({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 0.5 }),
|
|
387
|
+
$({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 1.5 })
|
|
387
388
|
],
|
|
388
389
|
near: [
|
|
389
|
-
|
|
390
|
+
$({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 2.5 })
|
|
390
391
|
],
|
|
391
392
|
hover: [
|
|
392
|
-
|
|
393
|
+
$({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 3.8 })
|
|
393
394
|
],
|
|
394
395
|
click: [
|
|
395
|
-
|
|
396
|
+
$({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 5.5 })
|
|
396
397
|
]
|
|
397
398
|
}
|
|
398
|
-
},
|
|
399
|
+
}, zt = {
|
|
399
400
|
name: "pip",
|
|
400
401
|
emotion: "surprised",
|
|
401
402
|
baseColor: "#F0B98A",
|
|
@@ -411,20 +412,20 @@ const Re = {
|
|
|
411
412
|
},
|
|
412
413
|
expressions: {
|
|
413
414
|
idle: [
|
|
414
|
-
|
|
415
|
-
|
|
415
|
+
$({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0 }),
|
|
416
|
+
$({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -2 })
|
|
416
417
|
],
|
|
417
418
|
near: [
|
|
418
|
-
|
|
419
|
+
$({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -3 })
|
|
419
420
|
],
|
|
420
421
|
hover: [
|
|
421
|
-
|
|
422
|
+
$({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -5 })
|
|
422
423
|
],
|
|
423
424
|
click: [
|
|
424
|
-
|
|
425
|
+
$({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -8 })
|
|
425
426
|
]
|
|
426
427
|
}
|
|
427
|
-
},
|
|
428
|
+
}, Pt = {
|
|
428
429
|
name: "void",
|
|
429
430
|
emotion: "numbness",
|
|
430
431
|
baseColor: "#D9C6E0",
|
|
@@ -440,92 +441,123 @@ const Re = {
|
|
|
440
441
|
},
|
|
441
442
|
expressions: {
|
|
442
443
|
idle: [
|
|
443
|
-
|
|
444
|
-
|
|
444
|
+
$({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0 }),
|
|
445
|
+
$({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 1 })
|
|
445
446
|
],
|
|
446
447
|
near: [
|
|
447
|
-
|
|
448
|
+
$({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 2 })
|
|
448
449
|
],
|
|
449
450
|
hover: [
|
|
450
|
-
|
|
451
|
+
$({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 3 })
|
|
451
452
|
],
|
|
452
453
|
click: [
|
|
453
|
-
|
|
454
|
+
$({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 4.5 })
|
|
454
455
|
]
|
|
455
456
|
}
|
|
456
|
-
},
|
|
457
|
-
mochi:
|
|
458
|
-
zumi:
|
|
459
|
-
suri:
|
|
460
|
-
nima:
|
|
461
|
-
cota:
|
|
462
|
-
dozy:
|
|
463
|
-
lumo:
|
|
464
|
-
fidge:
|
|
465
|
-
brix:
|
|
466
|
-
wilt:
|
|
467
|
-
knot:
|
|
468
|
-
snug:
|
|
469
|
-
pip:
|
|
470
|
-
void:
|
|
457
|
+
}, ne = {
|
|
458
|
+
mochi: rt,
|
|
459
|
+
zumi: Ft,
|
|
460
|
+
suri: kt,
|
|
461
|
+
nima: vt,
|
|
462
|
+
cota: De,
|
|
463
|
+
dozy: Ct,
|
|
464
|
+
lumo: wt,
|
|
465
|
+
fidge: Tt,
|
|
466
|
+
brix: St,
|
|
467
|
+
wilt: Yt,
|
|
468
|
+
knot: Et,
|
|
469
|
+
snug: At,
|
|
470
|
+
pip: zt,
|
|
471
|
+
void: Pt
|
|
471
472
|
};
|
|
472
|
-
function
|
|
473
|
+
function et(o) {
|
|
473
474
|
const t = o.toLowerCase();
|
|
474
|
-
return
|
|
475
|
+
return ne[t] ? ne[t] : Object.values(ne).find((i) => i.emotion === t) || rt;
|
|
475
476
|
}
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
const tt = {
|
|
478
|
+
// Suave / Natural: balance equilibrado
|
|
479
|
+
smooth: { stiffness: 170, damping: 18, mass: 1 },
|
|
480
|
+
// Elástico / Rebote: oscilación amortiguada con rebote visible
|
|
481
|
+
bouncy: { stiffness: 280, damping: 8, mass: 0.8 },
|
|
482
|
+
// Snappy / Rápido: rápido y preciso sin rebote
|
|
483
|
+
snappy: { stiffness: 420, damping: 30, mass: 0.6 },
|
|
484
|
+
// Gentle / Lento: movimiento relajado y suave
|
|
485
|
+
gentle: { stiffness: 55, damping: 14, mass: 1.4 },
|
|
486
|
+
// Instantáneo: transición directa
|
|
487
|
+
instant: { stiffness: 99999, damping: 9999, mass: 1e-3 }
|
|
488
|
+
};
|
|
489
|
+
function Xt(o, t = {}) {
|
|
490
|
+
let { stiffness: e = 170, damping: i = 18, mass: a = 1 } = t;
|
|
491
|
+
const r = {
|
|
478
492
|
current: o,
|
|
479
493
|
target: o,
|
|
480
494
|
velocity: 0
|
|
481
495
|
};
|
|
482
496
|
return {
|
|
483
|
-
state:
|
|
484
|
-
|
|
485
|
-
|
|
497
|
+
state: r,
|
|
498
|
+
setConfig(n) {
|
|
499
|
+
n.stiffness !== void 0 && (e = n.stiffness), n.damping !== void 0 && (i = n.damping), n.mass !== void 0 && (a = n.mass);
|
|
500
|
+
},
|
|
501
|
+
setTarget(n) {
|
|
502
|
+
r.target = n;
|
|
486
503
|
},
|
|
487
|
-
setCurrent(
|
|
488
|
-
|
|
504
|
+
setCurrent(n) {
|
|
505
|
+
r.current = n, r.target = n, r.velocity = 0;
|
|
489
506
|
},
|
|
490
|
-
update(
|
|
491
|
-
const
|
|
492
|
-
let
|
|
507
|
+
update(n) {
|
|
508
|
+
const f = n / 4;
|
|
509
|
+
let y = !1;
|
|
493
510
|
for (let d = 0; d < 4; d++) {
|
|
494
|
-
const
|
|
495
|
-
|
|
511
|
+
const x = r.current - r.target, M = -e * x, T = -i * r.velocity, E = (M + T) / a;
|
|
512
|
+
r.velocity += E * f, r.current += r.velocity * f, (Math.abs(r.velocity) > 1e-4 || Math.abs(r.current - r.target) > 1e-4) && (y = !0);
|
|
496
513
|
}
|
|
497
|
-
return
|
|
514
|
+
return y || (r.current = r.target, r.velocity = 0), y;
|
|
498
515
|
}
|
|
499
516
|
};
|
|
500
517
|
}
|
|
501
|
-
|
|
518
|
+
const Dt = /* @__PURE__ */ new Set(["eyeType", "mouthType", "cascadeTears", "showBrows"]);
|
|
519
|
+
function Lt(o, t) {
|
|
502
520
|
const e = Object.keys(o), i = {};
|
|
503
|
-
|
|
504
|
-
|
|
521
|
+
let a = null;
|
|
522
|
+
for (const r of e)
|
|
523
|
+
i[r] = Xt(o[r], t);
|
|
505
524
|
return {
|
|
506
525
|
getValues() {
|
|
507
|
-
const
|
|
508
|
-
for (const
|
|
509
|
-
n
|
|
510
|
-
return
|
|
526
|
+
const r = {};
|
|
527
|
+
for (const n of e)
|
|
528
|
+
r[n] = i[n].state.current;
|
|
529
|
+
return r;
|
|
511
530
|
},
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
531
|
+
setConfig(r) {
|
|
532
|
+
if (typeof r == "string") {
|
|
533
|
+
a = r;
|
|
534
|
+
const n = tt[r] || tt.smooth;
|
|
535
|
+
for (const c of e)
|
|
536
|
+
i[c].setConfig(n);
|
|
537
|
+
} else {
|
|
538
|
+
a = null;
|
|
539
|
+
for (const n of e)
|
|
540
|
+
i[n].setConfig(r);
|
|
541
|
+
}
|
|
515
542
|
},
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
543
|
+
setTargets(r) {
|
|
544
|
+
const n = a === "instant";
|
|
545
|
+
for (const c in r)
|
|
546
|
+
c in i && (n || Dt.has(c) ? i[c].setCurrent(r[c]) : i[c].setTarget(r[c]));
|
|
519
547
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
548
|
+
setValues(r) {
|
|
549
|
+
for (const n in r)
|
|
550
|
+
n in i && i[n].setCurrent(r[n]);
|
|
551
|
+
},
|
|
552
|
+
update(r) {
|
|
553
|
+
let n = !1;
|
|
554
|
+
for (const c of e)
|
|
555
|
+
i[c].update(r) && (n = !0);
|
|
556
|
+
return n;
|
|
525
557
|
}
|
|
526
558
|
};
|
|
527
559
|
}
|
|
528
|
-
function
|
|
560
|
+
function It(o, t) {
|
|
529
561
|
const e = { ...o };
|
|
530
562
|
switch (t) {
|
|
531
563
|
case "sleeping":
|
|
@@ -603,10 +635,11 @@ function pt(o, t) {
|
|
|
603
635
|
}
|
|
604
636
|
return e;
|
|
605
637
|
}
|
|
606
|
-
class
|
|
607
|
-
constructor() {
|
|
608
|
-
|
|
609
|
-
|
|
638
|
+
class lt {
|
|
639
|
+
constructor(t = "idle") {
|
|
640
|
+
v(this, "currentState");
|
|
641
|
+
v(this, "lastIndices", {});
|
|
642
|
+
this.currentState = t;
|
|
610
643
|
}
|
|
611
644
|
getState() {
|
|
612
645
|
return this.currentState;
|
|
@@ -665,7 +698,7 @@ class $t {
|
|
|
665
698
|
i = t[e] || t.idle;
|
|
666
699
|
break;
|
|
667
700
|
}
|
|
668
|
-
return i.map((
|
|
701
|
+
return i.map((a) => It(a, e));
|
|
669
702
|
}
|
|
670
703
|
pickVariant(t, e = this.currentState) {
|
|
671
704
|
if (!t || t.length === 0)
|
|
@@ -673,17 +706,20 @@ class $t {
|
|
|
673
706
|
if (t.length === 1)
|
|
674
707
|
return this.lastIndices[e] = 0, t[0];
|
|
675
708
|
const i = this.lastIndices[e] ?? -1;
|
|
676
|
-
let
|
|
677
|
-
for (;
|
|
678
|
-
|
|
679
|
-
return this.lastIndices[e] =
|
|
709
|
+
let a = Math.floor(Math.random() * t.length);
|
|
710
|
+
for (; a === i; )
|
|
711
|
+
a = Math.floor(Math.random() * t.length);
|
|
712
|
+
return this.lastIndices[e] = a, t[a];
|
|
680
713
|
}
|
|
681
714
|
}
|
|
682
|
-
|
|
715
|
+
function Do(o = "idle") {
|
|
716
|
+
return new lt(o);
|
|
717
|
+
}
|
|
718
|
+
class Gt {
|
|
683
719
|
constructor() {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
720
|
+
v(this, "callbacks", /* @__PURE__ */ new Set());
|
|
721
|
+
v(this, "handle", null);
|
|
722
|
+
v(this, "lastTime", 0);
|
|
687
723
|
}
|
|
688
724
|
add(t) {
|
|
689
725
|
this.callbacks.add(t), this.handle || (this.lastTime = performance.now(), this.tick = this.tick.bind(this), this.handle = requestAnimationFrame(this.tick));
|
|
@@ -699,16 +735,238 @@ class bt {
|
|
|
699
735
|
this.lastTime = t, this.callbacks.forEach((i) => i(e)), this.callbacks.size > 0 ? this.handle = requestAnimationFrame(this.tick) : this.handle = null;
|
|
700
736
|
}
|
|
701
737
|
}
|
|
702
|
-
const
|
|
703
|
-
function
|
|
738
|
+
const B = new Gt();
|
|
739
|
+
function ct(o = 2.2, t = 0.25) {
|
|
704
740
|
const e = [], i = o * Math.PI * 2;
|
|
705
|
-
for (let
|
|
706
|
-
const
|
|
707
|
-
e.push([Math.cos(
|
|
741
|
+
for (let a = 0; a <= i; a += t) {
|
|
742
|
+
const r = a / i;
|
|
743
|
+
e.push([Math.cos(a) * r, Math.sin(a) * r]);
|
|
708
744
|
}
|
|
709
745
|
return e;
|
|
710
746
|
}
|
|
711
|
-
|
|
747
|
+
const ae = 64, ht = Math.PI * 2, j = Array.from({ length: ae }, (o, t) => t / ae * ht), ce = j.map(Math.cos), $e = j.map(Math.sin), le = (o) => Math.round(o * 100) / 100, Lo = (o, t = 0, e = 1) => o < t ? t : o > e ? e : o, Wt = (o, t, e) => o + (t - o) * e;
|
|
748
|
+
function Ot(o, t = 1, e = 1) {
|
|
749
|
+
return j.map((i, a) => {
|
|
750
|
+
const r = Math.abs((ce[a] ?? 0) / t) ** o, n = Math.abs(($e[a] ?? 0) / e) ** o;
|
|
751
|
+
return (r + n) ** (-1 / o);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
function I(o, t = 1) {
|
|
755
|
+
const e = Math.max(...o);
|
|
756
|
+
if (e <= 0) return o;
|
|
757
|
+
const i = t / e;
|
|
758
|
+
return o.map((a) => a * i);
|
|
759
|
+
}
|
|
760
|
+
function Le(o, t = 0, e = 0) {
|
|
761
|
+
const i = new Array(ae).fill(1), a = o.length;
|
|
762
|
+
for (let r = 0; r < ae; r++) {
|
|
763
|
+
const n = ce[r] ?? 0, c = $e[r] ?? 0;
|
|
764
|
+
let f = 0;
|
|
765
|
+
for (let y = 0; y < a; y++) {
|
|
766
|
+
const d = o[y], x = o[(y + 1) % a], M = x.x - d.x, T = x.y - d.y, E = n * T - c * M;
|
|
767
|
+
if (Math.abs(E) < 1e-9) continue;
|
|
768
|
+
const R = d.x - t, z = d.y - e, Z = (R * T - z * M) / E, G = (R * c - z * n) / E;
|
|
769
|
+
Z > f && G >= 0 && G <= 1 && (f = Z);
|
|
770
|
+
}
|
|
771
|
+
i[r] = f || 1;
|
|
772
|
+
}
|
|
773
|
+
return i;
|
|
774
|
+
}
|
|
775
|
+
function _e(o, t, e, i, a, r, n = 96) {
|
|
776
|
+
const c = i - o, f = a - t, y = Math.hypot(c, f) || 1e-6, d = Math.atan2(f, c), x = Math.acos(Math.max(-1, Math.min(1, (e - r) / y))), M = [];
|
|
777
|
+
for (let T = 0; T <= n / 2; T++) {
|
|
778
|
+
const E = d + x + (ht - 2 * x) * T / (n / 2);
|
|
779
|
+
M.push({ x: o + Math.cos(E) * e, y: t + Math.sin(E) * e });
|
|
780
|
+
}
|
|
781
|
+
for (let T = 0; T <= n / 2; T++) {
|
|
782
|
+
const E = d - x + 2 * x * T / (n / 2);
|
|
783
|
+
M.push({ x: i + Math.cos(E) * r, y: a + Math.sin(E) * r });
|
|
784
|
+
}
|
|
785
|
+
return M;
|
|
786
|
+
}
|
|
787
|
+
function Bt(o, t, e, i, a) {
|
|
788
|
+
const r = 1 - a, n = r * r, c = a * a;
|
|
789
|
+
return {
|
|
790
|
+
x: n * r * o.x + 3 * n * a * t.x + 3 * r * c * e.x + c * a * i.x,
|
|
791
|
+
y: n * r * o.y + 3 * n * a * t.y + 3 * r * c * e.y + c * a * i.y
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
function jt() {
|
|
795
|
+
const o = [
|
|
796
|
+
[{ x: 50, y: 21.67 }, { x: 54.17, y: 17.5 }, { x: 65, y: 12.5 }, { x: 74.17, y: 16.67 }],
|
|
797
|
+
[{ x: 74.17, y: 16.67 }, { x: 85, y: 21.67 }, { x: 89.17, y: 35.83 }, { x: 85, y: 48.33 }],
|
|
798
|
+
[{ x: 85, y: 48.33 }, { x: 80.83, y: 61.67 }, { x: 66.67, y: 74.17 }, { x: 50, y: 74.17 }],
|
|
799
|
+
[{ x: 50, y: 74.17 }, { x: 33.33, y: 74.17 }, { x: 19.17, y: 61.67 }, { x: 15, y: 48.33 }],
|
|
800
|
+
[{ x: 15, y: 48.33 }, { x: 10.83, y: 35.83 }, { x: 15, y: 21.67 }, { x: 25.83, y: 16.67 }],
|
|
801
|
+
[{ x: 25.83, y: 16.67 }, { x: 35, y: 12.5 }, { x: 45.83, y: 17.5 }, { x: 50, y: 21.67 }]
|
|
802
|
+
], t = [], e = 50, i = 46, a = 20;
|
|
803
|
+
for (const r of o)
|
|
804
|
+
for (let n = 0; n < a; n++) {
|
|
805
|
+
const c = Bt(r[0], r[1], r[2], r[3], n / a);
|
|
806
|
+
t.push({ x: (c.x - e) / 36, y: (c.y - i) / 36 });
|
|
807
|
+
}
|
|
808
|
+
return I(Le(t, 0, 0), 1.05);
|
|
809
|
+
}
|
|
810
|
+
const dt = {
|
|
811
|
+
// Círculo neutro
|
|
812
|
+
circle: new Array(ae).fill(1),
|
|
813
|
+
// Corazón
|
|
814
|
+
heart: jt(),
|
|
815
|
+
// Round Blob (Armónicos sutiles orgánicos)
|
|
816
|
+
"round-blob": I(
|
|
817
|
+
j.map((o) => 1 + 0.075 * Math.cos(2 * o + 0.5) + 0.035 * Math.cos(3 * o + 2.1)),
|
|
818
|
+
1.02
|
|
819
|
+
),
|
|
820
|
+
// Cápsula horizontal
|
|
821
|
+
capsule: I(
|
|
822
|
+
Le(_e(-0.45, 0, 0.62, 0.45, 0, 0.62), 0, 0),
|
|
823
|
+
1.08
|
|
824
|
+
),
|
|
825
|
+
// Squircle (Superelipse n=4.2)
|
|
826
|
+
"rounded-squircle": I(Ot(4.2), 1.12),
|
|
827
|
+
// Pera (Base ancha, parte superior cónica)
|
|
828
|
+
"pear-blob": I(
|
|
829
|
+
j.map((o) => 1 + 0.22 * Math.sin(o) + 0.08 * Math.cos(2 * o)),
|
|
830
|
+
1.06
|
|
831
|
+
),
|
|
832
|
+
// Huevo (Parte superior abovedada, base algo más compacta, proporción vertical exacta)
|
|
833
|
+
"egg-oval": I(
|
|
834
|
+
j.map((o, t) => {
|
|
835
|
+
const e = (ce[t] ?? 0) / 0.86, i = (($e[t] ?? 0) + 0.12 * (1 - Math.abs(ce[t] ?? 0))) / 1.16;
|
|
836
|
+
return Math.sqrt(e * e + i * i) ** -1;
|
|
837
|
+
}),
|
|
838
|
+
1.08
|
|
839
|
+
),
|
|
840
|
+
// Estrella / Puff (4 lóbulos hinchados)
|
|
841
|
+
"starburst-puff": I(
|
|
842
|
+
j.map((o) => 1 + 0.16 * Math.cos(4 * o)),
|
|
843
|
+
1.08
|
|
844
|
+
),
|
|
845
|
+
// Cápsula vertical (Píldora alta)
|
|
846
|
+
"pill-vertical": I(
|
|
847
|
+
Le(_e(0, -0.42, 0.6, 0, 0.42, 0.6), 0, 0),
|
|
848
|
+
1.08
|
|
849
|
+
),
|
|
850
|
+
// Fantasma (Cúpula arriba y ondas ruffle abajo)
|
|
851
|
+
"ghost-blob": I(
|
|
852
|
+
j.map((o) => {
|
|
853
|
+
const t = Math.sin(o), e = t > 0.2 ? 0.12 * Math.sin(o * 6) : 0;
|
|
854
|
+
return 1 + (t < 0 ? 0.08 : 0.02) + e;
|
|
855
|
+
}),
|
|
856
|
+
1.06
|
|
857
|
+
),
|
|
858
|
+
// Óvalo suave
|
|
859
|
+
oval: I(
|
|
860
|
+
j.map((o, t) => {
|
|
861
|
+
const e = (ce[t] ?? 0) / 1.15, i = ($e[t] ?? 0) / 0.9;
|
|
862
|
+
return Math.sqrt(e * e + i * i) ** -1;
|
|
863
|
+
}),
|
|
864
|
+
1.05
|
|
865
|
+
),
|
|
866
|
+
// Óvalo alargado
|
|
867
|
+
"elongated-oval": I(
|
|
868
|
+
j.map((o, t) => {
|
|
869
|
+
const e = (ce[t] ?? 0) / 1.25, i = ($e[t] ?? 0) / 0.82;
|
|
870
|
+
return Math.sqrt(e * e + i * i) ** -1;
|
|
871
|
+
}),
|
|
872
|
+
1.08
|
|
873
|
+
),
|
|
874
|
+
// Gota / Teardrop (Punta afilada arriba, base redonda abajo)
|
|
875
|
+
"teardrop-blob": I(
|
|
876
|
+
Le(_e(0, 0.26, 0.66, 0, -0.92, 0.06), 0, 0),
|
|
877
|
+
1.08
|
|
878
|
+
),
|
|
879
|
+
// Llama (3 crestas arriba, cuerpo curvo abajo)
|
|
880
|
+
"flame-blob": I(
|
|
881
|
+
j.map((o) => 1 + (Math.sin(o) < 0 ? 0.24 * Math.abs(Math.sin(o * 2.5)) : -0.04 * Math.cos(o * 2))),
|
|
882
|
+
1.08
|
|
883
|
+
),
|
|
884
|
+
// Droopy / Wilt (Caído)
|
|
885
|
+
"droopy-blob": I(
|
|
886
|
+
j.map((o) => {
|
|
887
|
+
const t = Math.sin(o);
|
|
888
|
+
return 1 + 0.18 * Math.max(0, t) - 0.08 * Math.max(0, -t);
|
|
889
|
+
}),
|
|
890
|
+
1.05
|
|
891
|
+
),
|
|
892
|
+
// Spiky blob
|
|
893
|
+
"spiky-blob": I(
|
|
894
|
+
j.map((o) => 1 + 0.18 * Math.sin(8 * o)),
|
|
895
|
+
1.06
|
|
896
|
+
),
|
|
897
|
+
// Cloud blob
|
|
898
|
+
"cloud-blob": I(
|
|
899
|
+
j.map((o) => 1 + 0.14 * Math.sin(5 * o + 0.4)),
|
|
900
|
+
1.06
|
|
901
|
+
),
|
|
902
|
+
// Wide oval
|
|
903
|
+
"wide-oval": I(
|
|
904
|
+
j.map((o, t) => {
|
|
905
|
+
const e = (ce[t] ?? 0) / 1.28, i = ($e[t] ?? 0) / 0.78;
|
|
906
|
+
return Math.sqrt(e * e + i * i) ** -1;
|
|
907
|
+
}),
|
|
908
|
+
1.08
|
|
909
|
+
),
|
|
910
|
+
// Soft round
|
|
911
|
+
"soft-round": I(
|
|
912
|
+
j.map((o) => 1 + 0.04 * Math.cos(4 * o)),
|
|
913
|
+
1.02
|
|
914
|
+
),
|
|
915
|
+
// Octopus blob
|
|
916
|
+
"octopus-blob": I(
|
|
917
|
+
j.map((o) => 1 + (Math.sin(o) > 0.3 ? 0.15 * Math.sin(o * 7) : 0)),
|
|
918
|
+
1.06
|
|
919
|
+
),
|
|
920
|
+
// Wave blob
|
|
921
|
+
"wave-blob": I(
|
|
922
|
+
j.map((o) => 1 + 0.12 * Math.sin(3 * o + 0.8)),
|
|
923
|
+
1.04
|
|
924
|
+
),
|
|
925
|
+
// Bear blob (Cuerpo redondeado con dos orejitas en -45° y -135°)
|
|
926
|
+
"bear-blob": I(
|
|
927
|
+
j.map((o) => {
|
|
928
|
+
const t = Math.exp(-Math.pow(Math.atan2(Math.sin(o - -Math.PI * 0.25), Math.cos(o - -Math.PI * 0.25)), 2) / 0.12) * 0.35, e = Math.exp(-Math.pow(Math.atan2(Math.sin(o - -Math.PI * 0.75), Math.cos(o - -Math.PI * 0.75)), 2) / 0.12) * 0.35;
|
|
929
|
+
return 1 + t + e;
|
|
930
|
+
}),
|
|
931
|
+
1.12
|
|
932
|
+
)
|
|
933
|
+
};
|
|
934
|
+
function ot(o) {
|
|
935
|
+
return Rt.get(o) || dt.circle;
|
|
936
|
+
}
|
|
937
|
+
const Rt = new Map(
|
|
938
|
+
Object.entries(dt)
|
|
939
|
+
);
|
|
940
|
+
function Zt(o, t, e) {
|
|
941
|
+
const i = new Array(ae);
|
|
942
|
+
for (let a = 0; a < ae; a++)
|
|
943
|
+
i[a] = Wt(o[a] ?? 1, t[a] ?? 1, e);
|
|
944
|
+
return i;
|
|
945
|
+
}
|
|
946
|
+
function _t(o, t = 50, e = 50, i = 37, a = 1, r = 1) {
|
|
947
|
+
const n = new Array(ae);
|
|
948
|
+
for (let c = 0; c < ae; c++) {
|
|
949
|
+
const f = (o[c] ?? 1) * i, y = t + (ce[c] ?? 0) * f * a, d = e + ($e[c] ?? 0) * f * r;
|
|
950
|
+
n[c] = { x: y, y: d };
|
|
951
|
+
}
|
|
952
|
+
return n;
|
|
953
|
+
}
|
|
954
|
+
function Nt(o, t = 1 / 6) {
|
|
955
|
+
const e = o.length;
|
|
956
|
+
if (e < 3) return "";
|
|
957
|
+
const i = o[0];
|
|
958
|
+
let a = `M ${le(i.x)} ${le(i.y)}`;
|
|
959
|
+
for (let r = 0; r < e; r++) {
|
|
960
|
+
const n = o[(r - 1 + e) % e], c = o[r], f = o[(r + 1) % e], y = o[(r + 2) % e], d = c.x + (f.x - n.x) * t, x = c.y + (f.y - n.y) * t, M = f.x - (y.x - c.x) * t, T = f.y - (y.y - c.y) * t;
|
|
961
|
+
a += ` C ${le(d)} ${le(x)} ${le(M)} ${le(T)} ${le(f.x)} ${le(f.y)}`;
|
|
962
|
+
}
|
|
963
|
+
return `${a} Z`;
|
|
964
|
+
}
|
|
965
|
+
function qt(o, t = 50, e = 50, i = 37) {
|
|
966
|
+
const a = _t(o, t, e, i);
|
|
967
|
+
return Nt(a);
|
|
968
|
+
}
|
|
969
|
+
function Qt(o) {
|
|
712
970
|
switch (o) {
|
|
713
971
|
case "circle":
|
|
714
972
|
return "M 50 13 A 37 37 0 1 0 50 87 A 37 37 0 1 0 50 13 Z";
|
|
@@ -747,7 +1005,7 @@ function gt(o) {
|
|
|
747
1005
|
case "cloud-blob":
|
|
748
1006
|
return "M 50 12.5 C 60 9.17 69.17 15.83 71.67 21.67 C 79.17 24.17 83.33 32.5 80.83 40 C 85.83 47.5 83.33 57.5 78.33 61.67 C 76.67 70.83 68.33 76.67 60 74.17 C 53.33 80 42.5 80 35.83 74.17 C 27.5 76.67 20 70 18.33 61.67 C 13.33 56.67 11.67 47.5 16.67 40 C 14.17 32.5 20 24.17 27.5 21.67 C 30.83 15 40 9.17 50 12.5 Z";
|
|
749
1007
|
case "wide-oval":
|
|
750
|
-
return "M 50
|
|
1008
|
+
return "M 50 25 C 74 25 88 35 88 56 C 88 74 72 82 50 82 C 28 82 12 74 12 56 C 12 35 26 25 50 25 Z";
|
|
751
1009
|
case "soft-round":
|
|
752
1010
|
return "M 50 15 C 73.33 15 85 26.67 85 48.33 C 85 70 73.33 80 50 80 C 26.67 80 15 70 15 48.33 C 15 26.67 26.67 15 50 15 Z";
|
|
753
1011
|
case "octopus-blob":
|
|
@@ -758,398 +1016,428 @@ function gt(o) {
|
|
|
758
1016
|
return "M 50 12 C 78 12 90 26 90 52 C 90 78 78 88 50 88 C 22 88 10 78 10 52 C 10 26 22 12 50 12 Z";
|
|
759
1017
|
}
|
|
760
1018
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
return `<g transform="translate(${o.toFixed(2)}, ${t.toFixed(2)}) scale(${e.toFixed(3)})" ${
|
|
764
|
-
<path d="${
|
|
1019
|
+
const Vt = "M -4 2 C 2 2 5 -2 1 -5 C -3 -8 -10 -6 -10 -1 C -10 5 -2 8 4 4 C 9 1 7 -6 0 -7";
|
|
1020
|
+
function Ht(o, t, e, i, a, r = "") {
|
|
1021
|
+
return `<g transform="translate(${o.toFixed(2)}, ${t.toFixed(2)}) scale(${e.toFixed(3)})" ${r}>
|
|
1022
|
+
<path d="${Vt}" stroke="${i}" stroke-width="${(a / e).toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" fill="none" />
|
|
765
1023
|
</g>`;
|
|
766
1024
|
}
|
|
767
|
-
function
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
},
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1025
|
+
function ut(o, t, e, i, a = {}, r = 0) {
|
|
1026
|
+
const n = r || (typeof performance < "u" ? performance.now() / 1e3 : Date.now() / 1e3), c = "#2C2C2A", f = "#F0997B", y = 3.5;
|
|
1027
|
+
let d = "";
|
|
1028
|
+
a.radii && a.radii.length > 0 ? d = `<path class="wissive-silhouette-path" d="${qt(a.radii)}" fill="${t}" />` : d = Qt(o).split(/(?=M )/).map((l) => l.trim()).filter(Boolean).map((l) => `<path class="wissive-silhouette-path" d="${l}" fill="${t}" />`).join("");
|
|
1029
|
+
const { flipX: x = !1, emphasis: M = !1 } = a, T = Math.max(-13.2, Math.min(13.2, e.gazeX ?? 0)), E = Math.max(-8.4, Math.min(8.4, e.gazeY ?? 0)), R = (e.eyeGap ?? 32) / 2, z = (e.eyeY ?? 45) + E, Z = 50 - R + T, G = 50 + R + T, _ = 40, he = 50 + (e.shiftX ?? 0), xe = e.turnAngle ?? 0, K = (s) => {
|
|
1030
|
+
const l = s - he, C = Math.max(-_, Math.min(_, l)), S = Math.asin(C / _), w = S + xe, b = Math.cos(w), V = b > 0, ee = he + _ * Math.sin(w), k = V ? Math.max(0, b / Math.cos(S)) : 0;
|
|
1031
|
+
return { projX: ee, scaleX: k, isVisible: V };
|
|
1032
|
+
}, W = K(Z), D = K(G), h = (e.eyeScale ?? 1) * (M ? 1.15 : 1), L = Math.round(e.eyeType ?? 0);
|
|
1033
|
+
let we = "", Me = "";
|
|
1034
|
+
const Te = (s, l, C, S) => {
|
|
1035
|
+
if (C <= 0.01) return "";
|
|
1036
|
+
const w = h * C, b = `transform="translate(${s}, ${l}) scale(${C.toFixed(2)}, 1) translate(${-s}, ${-l})"`;
|
|
1037
|
+
switch (L) {
|
|
777
1038
|
case 1:
|
|
778
|
-
return `<g ${
|
|
1039
|
+
return `<g ${b}><path d="M ${s - 5.83 * h} ${l + 2.5 * h} Q ${s} ${l - 5.83 * h} ${s + 5.83 * h} ${l + 2.5 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
779
1040
|
case 2:
|
|
780
|
-
return
|
|
1041
|
+
return S ? `<g ${b}><path d="M ${s - 5 * h} ${l - 5 * h} L ${s + 4.17 * h} ${l} L ${s - 5 * h} ${l + 5 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>` : `<g ${b}><path d="M ${s + 5 * h} ${l - 5 * h} L ${s - 4.17 * h} ${l} L ${s + 5 * h} ${l + 5 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
|
|
781
1042
|
case 3:
|
|
782
|
-
return
|
|
1043
|
+
return S ? `<g ${b}><path d="M ${s - 5.83 * h} ${l - 4.17 * h} L ${s + 5 * h} ${l + 4.17 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>` : `<g ${b}><path d="M ${s + 5.83 * h} ${l - 4.17 * h} L ${s - 5 * h} ${l + 4.17 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
783
1044
|
case 4:
|
|
784
|
-
return
|
|
1045
|
+
return S ? `<g ${b}><path d="M ${s - 5 * h} ${l + 4.17 * h} L ${s + 5.83 * h} ${l - 4.17 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>` : `<g ${b}><path d="M ${s + 5 * h} ${l + 4.17 * h} L ${s - 5.83 * h} ${l - 4.17 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
785
1046
|
case 5:
|
|
786
|
-
return `<g ${
|
|
787
|
-
<ellipse cx="${
|
|
788
|
-
<circle cx="${
|
|
1047
|
+
return `<g ${b}>
|
|
1048
|
+
<ellipse cx="${s}" cy="${l}" rx="${3.33 * w}" ry="${3.33 * w}" fill="${c}" />
|
|
1049
|
+
<circle cx="${s - 1.25 * h}" cy="${l - 1.25 * h}" r="${1.25 * h}" fill="#FFFFFF" />
|
|
789
1050
|
</g>`;
|
|
790
|
-
case 6:
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1051
|
+
case 6: {
|
|
1052
|
+
const k = 5.5 * h;
|
|
1053
|
+
return `<g ${b}><path d="M ${s} ${l + k * 0.7} C ${s - k * 1.1} ${l - k * 0.1} ${s - k * 0.9} ${l - k * 0.9} ${s} ${l - k * 0.35} C ${s + k * 0.9} ${l - k * 0.9} ${s + k * 1.1} ${l - k * 0.1} ${s} ${l + k * 0.7} Z" fill="#E84855" /></g>`;
|
|
1054
|
+
}
|
|
1055
|
+
case 7: {
|
|
1056
|
+
const k = 4.2 * h;
|
|
1057
|
+
return `<g ${b}>
|
|
1058
|
+
<line x1="${s - k}" y1="${l - k}" x2="${s + k}" y2="${l + k}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />
|
|
1059
|
+
<line x1="${s + k}" y1="${l - k}" x2="${s - k}" y2="${l + k}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />
|
|
796
1060
|
</g>`;
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
1061
|
+
}
|
|
1062
|
+
case 8: {
|
|
1063
|
+
const k = 5 * h;
|
|
1064
|
+
return `<g ${b}>
|
|
1065
|
+
<line x1="${s - k}" y1="${l - 2.2 * h}" x2="${s + k}" y2="${l - 2.2 * h}" stroke="${c}" stroke-width="${y * 0.8}" stroke-linecap="round" />
|
|
1066
|
+
<line x1="${s - k}" y1="${l + 2.2 * h}" x2="${s + k}" y2="${l + 2.2 * h}" stroke="${c}" stroke-width="${y * 0.8}" stroke-linecap="round" />
|
|
801
1067
|
</g>`;
|
|
1068
|
+
}
|
|
802
1069
|
case 9:
|
|
803
|
-
return
|
|
804
|
-
<
|
|
805
|
-
|
|
806
|
-
<rect x="${E.projX - 7}" y="${l - 6}" width="16" height="12" rx="3" fill="${h}" />
|
|
1070
|
+
return `<g ${b}>
|
|
1071
|
+
<circle cx="${s}" cy="${l}" r="${5.8 * h}" fill="none" stroke="${c}" stroke-width="2.6" />
|
|
1072
|
+
${S ? `<line x1="${s - 5.8 * h}" y1="${l}" x2="${s - 10 * h}" y2="${l}" stroke="${c}" stroke-width="2.6" stroke-linecap="round" />` : ""}
|
|
807
1073
|
</g>`;
|
|
808
1074
|
case 10:
|
|
809
|
-
return
|
|
1075
|
+
return S ? `<g ${b}><path d="M ${s - 5.83 * h} ${l + 1 * h} Q ${s} ${l - 5 * h} ${s + 5.83 * h} ${l + 1 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>` : `<ellipse cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" rx="${(2.83 * w).toFixed(2)}" ry="${Math.max(0.5, 2.83 * w * Math.max(0.05, e.eyeOpen)).toFixed(2)}" fill="${c}" />`;
|
|
810
1076
|
case 11:
|
|
811
|
-
return
|
|
1077
|
+
return S ? `<g ${b}><line x1="${s - 5 * h}" y1="${l}" x2="${s + 5 * h}" y2="${l}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" /></g>` : `<ellipse cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" rx="${(2.83 * w).toFixed(2)}" ry="${(2.83 * w).toFixed(2)}" fill="${c}" />`;
|
|
812
1078
|
case 12:
|
|
813
|
-
return `<
|
|
814
|
-
<ellipse cx="${r}" cy="${l}" rx="${3 * s}" ry="${6 * s}" fill="${h}" />
|
|
815
|
-
</g>`;
|
|
1079
|
+
return `<ellipse cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" rx="${(2.2 * w).toFixed(2)}" ry="${(5.5 * w).toFixed(2)}" fill="${c}" />`;
|
|
816
1080
|
case 13:
|
|
817
|
-
return `<
|
|
1081
|
+
return `<circle cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" r="${(4.5 * w).toFixed(2)}" fill="${c}" />`;
|
|
818
1082
|
case 14:
|
|
819
|
-
return `<g ${
|
|
1083
|
+
return `<g ${b}><path d="M ${s - 5.83 * h} ${l - 1.67 * h} Q ${s} ${l + 5.83 * h} ${s + 5.83 * h} ${l - 1.67 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
820
1084
|
case 15:
|
|
821
|
-
return
|
|
1085
|
+
return S ? `<g ${b}><path d="M ${s - 5.5 * h} ${l - 1.5 * h} Q ${s + 1 * h} ${l - 3 * h} ${s + 6 * h} ${l + 3 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>` : `<g ${b}><path d="M ${s + 5.5 * h} ${l - 1.5 * h} Q ${s - 1 * h} ${l - 3 * h} ${s - 6 * h} ${l + 3 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
822
1086
|
case 16:
|
|
823
|
-
return `<g ${
|
|
1087
|
+
return `<g ${b}><path d="M ${s} ${l - 4.17 * h} L ${s} ${l + 3.33 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
824
1088
|
case 17:
|
|
825
|
-
return
|
|
1089
|
+
return S ? `<g ${b}><path d="M ${s + 5.83 * h} ${l - 6.67 * h} L ${s - 5 * h} ${l + 0.83 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>` : `<g ${b}><path d="M ${s - 5.83 * h} ${l - 6.67 * h} L ${s + 5 * h} ${l + 0.83 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
826
1090
|
case 18: {
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
return `${
|
|
1091
|
+
const k = 4.6 * h, P = ct().map(([A, J], me) => {
|
|
1092
|
+
const ye = (s + A * k).toFixed(2), te = (l + J * k).toFixed(2);
|
|
1093
|
+
return `${me === 0 ? "M" : "L"} ${ye} ${te}`;
|
|
830
1094
|
}).join(" ");
|
|
831
|
-
return `<g ${
|
|
1095
|
+
return `<g ${b}><path d="${P}" stroke="${c}" stroke-width="1.3" stroke-linecap="round" fill="none" /></g>`;
|
|
832
1096
|
}
|
|
833
1097
|
case 19:
|
|
834
|
-
return `<g ${
|
|
835
|
-
<circle cx="${
|
|
836
|
-
<path d="M ${
|
|
1098
|
+
return `<g ${b}>
|
|
1099
|
+
<circle cx="${s}" cy="${l}" r="${4.5 * h}" fill="none" stroke="${c}" stroke-width="2.63" />
|
|
1100
|
+
<path d="M ${s - 2.83 * h} ${l - 0.42 * h} Q ${s} ${l + 2.83 * h} ${s + 2.83 * h} ${l - 0.42 * h}" stroke="${c}" stroke-width="2.63" stroke-linecap="round" fill="none" />
|
|
837
1101
|
</g>`;
|
|
838
1102
|
case 20:
|
|
839
|
-
return `<g ${
|
|
1103
|
+
return `<g ${b}><circle cx="${s}" cy="${l}" r="${3.67 * h}" fill="none" stroke="${c}" stroke-width="2.8" /></g>`;
|
|
840
1104
|
case 21: {
|
|
841
|
-
const
|
|
842
|
-
|
|
1105
|
+
const k = 6 * h, P = k * 0.45, J = [
|
|
1106
|
+
[s, l - k],
|
|
1107
|
+
[s + P * 0.59, l - P * 0.81],
|
|
1108
|
+
[s + k * 0.95, l - k * 0.31],
|
|
1109
|
+
[s + P * 0.95, l + P * 0.31],
|
|
1110
|
+
[s + k * 0.59, l + k * 0.81],
|
|
1111
|
+
[s, l + P],
|
|
1112
|
+
[s - k * 0.59, l + k * 0.81],
|
|
1113
|
+
[s - P * 0.95, l + P * 0.31],
|
|
1114
|
+
[s - k * 0.95, l - k * 0.31],
|
|
1115
|
+
[s - P * 0.59, l - P * 0.81]
|
|
1116
|
+
].map((me, ye) => `${ye === 0 ? "M" : "L"} ${me[0].toFixed(2)} ${me[1].toFixed(2)}`).join(" ") + " Z";
|
|
1117
|
+
return `<g ${b}><path d="${J}" fill="${c}" /></g>`;
|
|
843
1118
|
}
|
|
844
1119
|
case 22:
|
|
845
|
-
return `<g ${
|
|
846
|
-
<ellipse cx="${r}" cy="${l}" rx="${5.5 * s}" ry="${3.3 * s}" fill="#ffffff" stroke="${h}" stroke-width="1.4" />
|
|
847
|
-
<circle cx="${r - 2.2 * s}" cy="${l}" r="${1.8 * s}" fill="${h}" />
|
|
848
|
-
</g>`;
|
|
1120
|
+
return S ? `<g ${b}><path d="M ${s - 5 * h} ${l - 3 * h} L ${s + 4 * h} ${l - 3 * h} L ${s + 4 * h} ${l + 3 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>` : `<g ${b}><path d="M ${s + 5 * h} ${l - 3 * h} L ${s - 4 * h} ${l - 3 * h} L ${s - 4 * h} ${l + 3 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
|
|
849
1121
|
case 23:
|
|
850
|
-
return
|
|
851
|
-
case 24:
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
<
|
|
855
|
-
<circle cx="${
|
|
1122
|
+
return S ? `<ellipse cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" rx="${(2.83 * w).toFixed(2)}" ry="${Math.max(0.5, 2.83 * w * Math.max(0.05, e.eyeOpen)).toFixed(2)}" fill="${c}" />` : `<g ${b}><path d="M ${s - 5.83 * h} ${l + 1 * h} Q ${s} ${l - 5 * h} ${s + 5.83 * h} ${l + 1 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
1123
|
+
case 24:
|
|
1124
|
+
return `<g ${b}>
|
|
1125
|
+
<ellipse cx="${s}" cy="${l}" rx="${4.2 * w}" ry="${4.8 * w}" fill="${c}" />
|
|
1126
|
+
<circle cx="${s - 1.5 * h}" cy="${l - 1.8 * h}" r="${1.6 * h}" fill="#FFFFFF" />
|
|
1127
|
+
<circle cx="${s + 1.5 * h}" cy="${l + 1.5 * h}" r="${0.9 * h}" fill="#FFFFFF" />
|
|
856
1128
|
</g>`;
|
|
857
|
-
}
|
|
858
1129
|
case 25:
|
|
859
|
-
return
|
|
860
|
-
<path d="M ${
|
|
861
|
-
<line x1="${
|
|
862
|
-
</g>` : `<g ${
|
|
863
|
-
<path d="M ${
|
|
864
|
-
<line x1="${
|
|
1130
|
+
return S ? `<g ${b}>
|
|
1131
|
+
<path d="M ${s - 5.5 * h} ${l - 1 * h} Q ${s} ${l + 5.5 * h} ${s + 5.5 * h} ${l - 1 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />
|
|
1132
|
+
<line x1="${s + 4.5 * h}" y1="${l}" x2="${s + 7.5 * h}" y2="${l - 3 * h}" stroke="${c}" stroke-width="${y * 0.75}" stroke-linecap="round" />
|
|
1133
|
+
</g>` : `<g ${b}>
|
|
1134
|
+
<path d="M ${s - 5.5 * h} ${l - 1 * h} Q ${s} ${l + 5.5 * h} ${s + 5.5 * h} ${l - 1 * h}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />
|
|
1135
|
+
<line x1="${s - 4.5 * h}" y1="${l}" x2="${s - 7.5 * h}" y2="${l - 3 * h}" stroke="${c}" stroke-width="${y * 0.75}" stroke-linecap="round" />
|
|
865
1136
|
</g>`;
|
|
866
1137
|
case 26:
|
|
867
|
-
return `<g ${
|
|
868
|
-
<circle cx="${
|
|
869
|
-
<circle cx="${
|
|
1138
|
+
return `<g ${b}>
|
|
1139
|
+
<circle cx="${s}" cy="${l}" r="${5.8 * w}" fill="#FFFFFF" stroke="${c}" stroke-width="2.2" />
|
|
1140
|
+
<circle cx="${s + (e.gazeX ? e.gazeX * 0.15 : 0)}" cy="${l + (e.gazeY ? e.gazeY * 0.15 : 0)}" r="${2.5 * w}" fill="${c}" />
|
|
870
1141
|
</g>`;
|
|
871
|
-
case 27:
|
|
872
|
-
|
|
873
|
-
return `<g ${p}><path d="M ${r - T} ${l + x} L ${r - T} ${l - x} L ${r + T} ${l - x} L ${r + T} ${l + x}" stroke="${h}" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
|
|
874
|
-
}
|
|
1142
|
+
case 27:
|
|
1143
|
+
return `<g ${b}><path d="M ${s - 6 * h} ${l} Q ${s} ${l - 5 * h} ${s + 6 * h} ${l}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" /></g>`;
|
|
875
1144
|
case 28:
|
|
876
|
-
return `<g ${
|
|
1145
|
+
return `<g ${b}><line x1="${s - 5.5 * h}" y1="${l}" x2="${s + 5.5 * h}" y2="${l}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" /></g>`;
|
|
877
1146
|
case 29:
|
|
878
|
-
return `<g ${
|
|
879
|
-
<
|
|
880
|
-
<
|
|
1147
|
+
return `<g ${b}>
|
|
1148
|
+
<ellipse cx="${s}" cy="${l + 1 * h}" rx="${2.8 * w}" ry="${2.8 * w}" fill="${c}" />
|
|
1149
|
+
<path d="M ${s - 4 * h} ${l - 4 * h} Q ${s} ${l - 7 * h} ${s + 4 * h} ${l - 5 * h}" stroke="${c}" stroke-width="2.2" stroke-linecap="round" fill="none" />
|
|
881
1150
|
</g>`;
|
|
882
1151
|
case 30:
|
|
883
|
-
return
|
|
1152
|
+
return `<g ${b}><path d="M ${s - 5 * h} ${l - 3 * h} L ${s - 1.5 * h} ${l + 3 * h} L ${s + 1.5 * h} ${l - 3 * h} L ${s + 5 * h} ${l + 3 * h}" stroke="${c}" stroke-width="${y * 0.8}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
|
|
884
1153
|
case 31:
|
|
885
|
-
return `<g ${
|
|
886
|
-
<circle cx="${
|
|
887
|
-
<circle cx="${
|
|
1154
|
+
return `<g ${b}>
|
|
1155
|
+
<circle cx="${s}" cy="${l}" r="${4.8 * w}" fill="none" stroke="${c}" stroke-width="2.2" />
|
|
1156
|
+
<circle cx="${s}" cy="${l}" r="${1.8 * w}" fill="${c}" />
|
|
888
1157
|
</g>`;
|
|
889
1158
|
case 0:
|
|
890
1159
|
default:
|
|
891
|
-
const
|
|
892
|
-
return `<ellipse cx="${
|
|
1160
|
+
const V = 2.83 * w, ee = Math.max(0.5, V * Math.max(0.05, e.eyeOpen));
|
|
1161
|
+
return `<ellipse cx="${s.toFixed(2)}" cy="${l.toFixed(2)}" rx="${V.toFixed(2)}" ry="${ee.toFixed(2)}" fill="${c}" />`;
|
|
893
1162
|
}
|
|
894
1163
|
};
|
|
895
|
-
|
|
896
|
-
let
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
const
|
|
900
|
-
let
|
|
1164
|
+
we = W.isVisible ? Te(W.projX, z, W.scaleX, !1) : "", Me = D.isVisible ? Te(D.projX, z, D.scaleX, !0) : "";
|
|
1165
|
+
let be = "";
|
|
1166
|
+
const Fe = e.tears ?? 0;
|
|
1167
|
+
if (Fe > 0.01) {
|
|
1168
|
+
const s = Math.min(1, Fe), l = n * 0.36 % 1;
|
|
1169
|
+
let C = 0, S = s, w = 1;
|
|
901
1170
|
if (l < 0.25) {
|
|
902
|
-
const
|
|
903
|
-
|
|
1171
|
+
const b = l / 0.25;
|
|
1172
|
+
C = b * 1.2, w = 0.75 + b * 0.35, S = s * (0.3 + b * 0.7);
|
|
904
1173
|
} else if (l < 0.82) {
|
|
905
|
-
const
|
|
906
|
-
|
|
1174
|
+
const b = (l - 0.25) / 0.57;
|
|
1175
|
+
C = 1.2 + b * 10.5, w = 1.1 - b * 0.2, S = s;
|
|
907
1176
|
} else {
|
|
908
|
-
const
|
|
909
|
-
|
|
1177
|
+
const b = (l - 0.82) / 0.18;
|
|
1178
|
+
C = 11.7 + b * 2.5, w = 0.9 - b * 0.4, S = s * (1 - b);
|
|
910
1179
|
}
|
|
911
1180
|
if (e.cascadeTears)
|
|
912
|
-
|
|
913
|
-
<g opacity="${
|
|
914
|
-
<path d="M ${
|
|
915
|
-
<path d="M ${
|
|
1181
|
+
be = `
|
|
1182
|
+
<g opacity="${S.toFixed(2)}">
|
|
1183
|
+
<path d="M ${W.projX - 3} ${z + 4} L ${W.projX - 6} 88 L ${W.projX + 2} 88 Z" fill="#7FA6D9" opacity="0.85" />
|
|
1184
|
+
<path d="M ${D.projX - 2} ${z + 4} L ${D.projX - 2} 88 L ${D.projX + 6} 88 Z" fill="#7FA6D9" opacity="0.85" />
|
|
916
1185
|
</g>
|
|
917
1186
|
`;
|
|
918
1187
|
else {
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
<g opacity="${
|
|
922
|
-
<g
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
<path d="M ${P} ${(
|
|
1188
|
+
const b = (z + 7).toFixed(2), V = (W.projX - 1.2).toFixed(2), ee = (D.projX + 1.2).toFixed(2), k = parseFloat(V), P = parseFloat(ee), A = parseFloat(b);
|
|
1189
|
+
be = `
|
|
1190
|
+
<g opacity="${S.toFixed(2)}">
|
|
1191
|
+
<g class="wissive-anim-tear" style="transform-origin: ${k}px ${A}px;">
|
|
1192
|
+
<path d="M ${k} ${(A + C - 2.5).toFixed(2)} C ${(k - 2).toFixed(2)} ${(A + C).toFixed(2)} ${(k - 2.5).toFixed(2)} ${(A + C + 2.5).toFixed(2)} ${k} ${(A + C + 3.2).toFixed(2)} C ${(k + 2.5).toFixed(2)} ${(A + C + 2.5).toFixed(2)} ${(k + 2).toFixed(2)} ${(A + C).toFixed(2)} ${k} ${(A + C - 2.5).toFixed(2)} Z" fill="#7FA6D9" transform="scale(1, ${w.toFixed(2)})" />
|
|
1193
|
+
</g>
|
|
1194
|
+
<g class="wissive-anim-tear" style="transform-origin: ${P}px ${A}px; animation-delay: -0.9s;">
|
|
1195
|
+
<path d="M ${P} ${(A + C - 2.5).toFixed(2)} C ${(P - 2).toFixed(2)} ${(A + C).toFixed(2)} ${(P - 2.5).toFixed(2)} ${(A + C + 2.5).toFixed(2)} ${P} ${(A + C + 3.2).toFixed(2)} C ${(P + 2.5).toFixed(2)} ${(A + C + 2.5).toFixed(2)} ${(P + 2).toFixed(2)} ${(A + C).toFixed(2)} ${P} ${(A + C - 2.5).toFixed(2)} Z" fill="#7FA6D9" transform="scale(1, ${w.toFixed(2)})" />
|
|
927
1196
|
</g>
|
|
928
1197
|
</g>
|
|
929
1198
|
`;
|
|
930
1199
|
}
|
|
931
1200
|
}
|
|
932
|
-
let
|
|
933
|
-
if (e.
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1201
|
+
let de = "";
|
|
1202
|
+
if (e.showBrows !== void 0 ? e.showBrows > 0.5 : e.browY !== 0 || e.browTilt !== 0) {
|
|
1203
|
+
const s = 32 + (e.browY ?? 0), l = W.projX, C = D.projX, S = 6 * h, w = e.browTilt ?? 0, b = -w;
|
|
1204
|
+
de = `
|
|
1205
|
+
<g>
|
|
1206
|
+
<line
|
|
1207
|
+
x1="${l - S}"
|
|
1208
|
+
y1="${s}"
|
|
1209
|
+
x2="${l + S}"
|
|
1210
|
+
y2="${s}"
|
|
1211
|
+
stroke="${c}"
|
|
1212
|
+
stroke-width="2.6"
|
|
1213
|
+
stroke-linecap="round"
|
|
1214
|
+
transform="rotate(${w}, ${l}, ${s})"
|
|
1215
|
+
/>
|
|
1216
|
+
<line
|
|
1217
|
+
x1="${C - S}"
|
|
1218
|
+
y1="${s}"
|
|
1219
|
+
x2="${C + S}"
|
|
1220
|
+
y2="${s}"
|
|
1221
|
+
stroke="${c}"
|
|
1222
|
+
stroke-width="2.6"
|
|
1223
|
+
stroke-linecap="round"
|
|
1224
|
+
transform="rotate(${b}, ${C}, ${s})"
|
|
1225
|
+
/>
|
|
1226
|
+
</g>
|
|
1227
|
+
`;
|
|
945
1228
|
}
|
|
1229
|
+
let ie = "";
|
|
946
1230
|
if (e.sweat) {
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1231
|
+
const s = Math.min(1, e.sweat);
|
|
1232
|
+
ie += `
|
|
1233
|
+
<g class="wissive-anim-sweat" opacity="${s.toFixed(2)}" fill="#7FA6D9">
|
|
1234
|
+
<path d="M 80 28 C 78 30 77 33 79 35 C 81 37 84 36 84 33 C 84 30 81 28 80 28 Z" />
|
|
1235
|
+
<path d="M 73 22 C 72 23 71.5 25 72.8 26.5 C 74 27.5 76 27 76 25 C 76 23 74 22 73 22 Z" opacity="0.75" />
|
|
1236
|
+
</g>
|
|
1237
|
+
`;
|
|
1238
|
+
}
|
|
1239
|
+
if (e.zzz) {
|
|
1240
|
+
const s = Math.min(1, e.zzz);
|
|
1241
|
+
ie += `
|
|
1242
|
+
<g opacity="${s.toFixed(2)}" fill="#383835" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-weight="900">
|
|
1243
|
+
<text class="wissive-zzz-1" x="78" y="24" font-size="9" letter-spacing="-0.5">Z</text>
|
|
1244
|
+
<text class="wissive-zzz-2" x="84" y="16" font-size="7.5" letter-spacing="-0.5">z</text>
|
|
1245
|
+
<text class="wissive-zzz-3" x="89" y="9" font-size="6" letter-spacing="-0.5">z</text>
|
|
1246
|
+
</g>
|
|
1247
|
+
`;
|
|
962
1248
|
}
|
|
963
1249
|
if (e.storm) {
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
<g opacity="${
|
|
967
|
-
<path transform="translate(${l.toFixed(2)}, ${(Math.abs(l) * -0.4).toFixed(2)})" opacity="${
|
|
968
|
-
<path transform="translate(${
|
|
1250
|
+
const s = Math.min(1, e.storm), l = Math.sin(n * 1.4) * 1.2, C = Math.sin(n * 1.4 + 1.8) * 1.2, S = 0.85 + Math.sin(n * 1.4) * 0.15, w = 0.85 + Math.sin(n * 1.4 + 1.8) * 0.15;
|
|
1251
|
+
ie += `
|
|
1252
|
+
<g opacity="${s.toFixed(2)}" fill="#8a8a86">
|
|
1253
|
+
<path transform="translate(${l.toFixed(2)}, ${(Math.abs(l) * -0.4).toFixed(2)})" opacity="${S.toFixed(2)}" d="M 22 6 C 22 3 25 1.5 27 2.3 C 27.6 0.5 30 -0.3 31.7 1 C 33.3 -0.7 36.5 0.3 36.5 3 C 38.2 3 39.5 4.5 39 6.2 C 39 8 37.3 9 35.6 9 L 24 9 C 22.3 9 22 7.5 22 6 Z" />
|
|
1254
|
+
<path transform="translate(${C.toFixed(2)}, ${(Math.abs(C) * -0.4).toFixed(2)})" opacity="${w.toFixed(2)}" d="M 62 8 C 62 5.3 64.8 3.9 66.6 4.6 C 67.2 3 69.4 2.3 71 3.5 C 72.5 1.9 75.4 2.8 75.4 5.3 C 77 5.3 78.2 6.7 77.7 8.2 C 77.7 9.8 76.1 10.7 74.6 10.7 L 63.8 10.7 C 62.3 10.7 62 9.4 62 8 Z" />
|
|
969
1255
|
</g>
|
|
970
1256
|
`;
|
|
971
1257
|
}
|
|
972
1258
|
if (e.scribble) {
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
<g transform="translate(50, 3) rotate(${l.toFixed(2)}) translate(-50, -3)" opacity="${
|
|
976
|
-
${
|
|
1259
|
+
const s = Math.min(1, e.scribble), l = Math.sin(n * 1.6) * 6, C = 1 + Math.sin(n * 2.3) * 0.06;
|
|
1260
|
+
ie += `
|
|
1261
|
+
<g transform="translate(50, 3) rotate(${l.toFixed(2)}) translate(-50, -3)" opacity="${s.toFixed(2)}">
|
|
1262
|
+
${Ht(50, 3, C, "#5B7FD6", 2.3)}
|
|
977
1263
|
</g>
|
|
978
1264
|
`;
|
|
979
1265
|
}
|
|
980
1266
|
if (e.puff) {
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
<g fill="#B9BDB6" opacity="${
|
|
1267
|
+
const s = n * 0.55 % 1, l = e.mouthY ?? 63, C = 68 + s * 12, S = l - s * 10, w = 0.4 + s * 0.9, b = Math.min(1, e.puff) * Math.sin(s * Math.PI) * 0.8;
|
|
1268
|
+
b > 0.01 && (ie += `
|
|
1269
|
+
<g fill="#B9BDB6" opacity="${b.toFixed(2)}" transform="translate(${C.toFixed(2)}, ${S.toFixed(2)}) scale(${w.toFixed(2)})">
|
|
984
1270
|
<circle cx="0" cy="0" r="3.4" />
|
|
985
1271
|
<circle cx="3" cy="-1.2" r="2.1" />
|
|
986
1272
|
<circle cx="-2.4" cy="-1" r="1.8" />
|
|
987
1273
|
</g>
|
|
988
1274
|
`);
|
|
989
1275
|
}
|
|
990
|
-
let
|
|
991
|
-
if (e.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
<line x1="${
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
<line x1="${E.projX - 6}" y1="${r}" x2="${E.projX + 6}" y2="${r}" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />
|
|
1276
|
+
let ge = "";
|
|
1277
|
+
if (e.whiskers)
|
|
1278
|
+
ge = `
|
|
1279
|
+
<g stroke="${c}" stroke-width="2" stroke-linecap="round" opacity="${(e.cheek || 0.7).toFixed(2)}">
|
|
1280
|
+
<line x1="${W.projX - 10}" y1="52" x2="${W.projX - 18}" y2="50" />
|
|
1281
|
+
<line x1="${W.projX - 10}" y1="56" x2="${W.projX - 17}" y2="58" />
|
|
1282
|
+
<line x1="${D.projX + 10}" y1="52" x2="${D.projX + 18}" y2="50" />
|
|
1283
|
+
<line x1="${D.projX + 10}" y1="56" x2="${D.projX + 17}" y2="58" />
|
|
999
1284
|
</g>
|
|
1000
1285
|
`;
|
|
1286
|
+
else if (e.cheek > 0.05) {
|
|
1287
|
+
const s = (e.cheekRadius ?? 5.5) * (M ? 1.2 : 1), l = (e.cheekY ?? 54) + E * 0.5, C = Math.min(1, e.cheek);
|
|
1288
|
+
ge = `
|
|
1289
|
+
<ellipse cx="${W.projX - 3.5}" cy="${l}" rx="${(s * W.scaleX).toFixed(2)}" ry="${(s * 0.7).toFixed(2)}" fill="${f}" opacity="${C.toFixed(2)}" />
|
|
1290
|
+
<ellipse cx="${D.projX + 3.5}" cy="${l}" rx="${(s * D.scaleX).toFixed(2)}" ry="${(s * 0.7).toFixed(2)}" fill="${f}" opacity="${C.toFixed(2)}" />
|
|
1291
|
+
`;
|
|
1001
1292
|
}
|
|
1002
|
-
const
|
|
1003
|
-
let
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
const r = w * 2 / 4;
|
|
1010
|
-
let l = `M ${m - w} ${u}`;
|
|
1011
|
-
for (let k = 1; k <= 4; k++) l += ` L ${m - w + r * k} ${u + (k % 2 ? 2.83 : 0)}`;
|
|
1012
|
-
S = `<path d="${l}" fill="none" stroke="${h}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round" />`;
|
|
1293
|
+
const Se = 50 + T * 0.8, ke = (e.mouthY ?? 63) + E * 0.6, g = (e.mouthScale ?? 1) * (M ? 1.15 : 1), ve = e.mouthCurve ?? 0, se = e.mouthOpen ?? 0, q = Math.round(e.mouthType ?? 0);
|
|
1294
|
+
let Y = "";
|
|
1295
|
+
const u = Se, m = ke, F = 5.83 * g;
|
|
1296
|
+
switch (q) {
|
|
1297
|
+
case 1: {
|
|
1298
|
+
const s = Math.max(1.8, (2.8 + se * 3.5) * g);
|
|
1299
|
+
Y = `<ellipse cx="${u.toFixed(2)}" cy="${m.toFixed(2)}" rx="${s.toFixed(2)}" ry="${(s * (1 + se * 0.4)).toFixed(2)}" fill="${c}" />`;
|
|
1013
1300
|
break;
|
|
1014
1301
|
}
|
|
1015
|
-
case
|
|
1016
|
-
|
|
1017
|
-
break;
|
|
1018
|
-
case 13:
|
|
1019
|
-
S = `<circle cx="${m}" cy="${u}" r="${w * 2}" fill="none" stroke="${h}" stroke-width="2.8" />`;
|
|
1302
|
+
case 2:
|
|
1303
|
+
Y = `<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${(u - F * 0.5).toFixed(2)} ${(m - 2.5 * g).toFixed(2)} ${u.toFixed(2)} ${m.toFixed(2)} Q ${(u + F * 0.5).toFixed(2)} ${(m + 2.5 * g).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1020
1304
|
break;
|
|
1021
|
-
case
|
|
1022
|
-
|
|
1305
|
+
case 3:
|
|
1306
|
+
Y = `<line x1="${(u - F).toFixed(2)}" y1="${m.toFixed(2)}" x2="${(u + F).toFixed(2)}" y2="${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />`;
|
|
1023
1307
|
break;
|
|
1024
|
-
case 4:
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
<
|
|
1028
|
-
<line x1="${
|
|
1029
|
-
<line x1="${
|
|
1308
|
+
case 4: {
|
|
1309
|
+
const s = 7.5 * g, l = 4.2 * g;
|
|
1310
|
+
Y = `
|
|
1311
|
+
<rect x="${(u - s).toFixed(2)}" y="${(m - l * 0.5).toFixed(2)}" width="${(s * 2).toFixed(2)}" height="${l.toFixed(2)}" rx="2" fill="#FFFFFF" stroke="${c}" stroke-width="2.2" />
|
|
1312
|
+
<line x1="${(u - s).toFixed(2)}" y1="${m.toFixed(2)}" x2="${(u + s).toFixed(2)}" y2="${m.toFixed(2)}" stroke="${c}" stroke-width="1.8" />
|
|
1313
|
+
<line x1="${(u - s * 0.33).toFixed(2)}" y1="${(m - l * 0.5).toFixed(2)}" x2="${(u - s * 0.33).toFixed(2)}" y2="${(m + l * 0.5).toFixed(2)}" stroke="${c}" stroke-width="1.8" />
|
|
1314
|
+
<line x1="${(u + s * 0.33).toFixed(2)}" y1="${(m - l * 0.5).toFixed(2)}" x2="${(u + s * 0.33).toFixed(2)}" y2="${(m + l * 0.5).toFixed(2)}" stroke="${c}" stroke-width="1.8" />
|
|
1030
1315
|
`;
|
|
1031
1316
|
break;
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1317
|
+
}
|
|
1318
|
+
case 5: {
|
|
1319
|
+
const s = (3.5 + se * 4.5) * g;
|
|
1320
|
+
Y = `
|
|
1321
|
+
<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(m + s * 2.2).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)} Z" fill="${c}" />
|
|
1322
|
+
<path d="M ${(u - F * 0.8).toFixed(2)} ${m.toFixed(2)} L ${(u + F * 0.8).toFixed(2)} ${m.toFixed(2)} L ${(u + F * 0.7).toFixed(2)} ${(m + s * 0.6).toFixed(2)} L ${(u - F * 0.7).toFixed(2)} ${(m + s * 0.6).toFixed(2)} Z" fill="#FFFFFF" />
|
|
1036
1323
|
`;
|
|
1037
1324
|
break;
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
<
|
|
1045
|
-
<line x1="${m - 5}" y1="${u + 5}" x2="${m + 5}" y2="${u - 5}" />
|
|
1325
|
+
}
|
|
1326
|
+
case 6: {
|
|
1327
|
+
const s = (4 + se * 5.5) * g;
|
|
1328
|
+
Y = `
|
|
1329
|
+
<g>
|
|
1330
|
+
<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(m + s * 2.2).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)} Z" fill="${c}" />
|
|
1331
|
+
<path d="M ${(u - F * 0.5).toFixed(2)} ${(m + s * 1.3).toFixed(2)} Q ${u.toFixed(2)} ${(m + s * 0.8).toFixed(2)} ${(u + F * 0.5).toFixed(2)} ${(m + s * 1.3).toFixed(2)} Q ${u.toFixed(2)} ${(m + s * 2.1).toFixed(2)} ${(u - F * 0.5).toFixed(2)} ${(m + s * 1.3).toFixed(2)} Z" fill="#FF7B89" />
|
|
1046
1332
|
</g>
|
|
1047
1333
|
`;
|
|
1048
1334
|
break;
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1335
|
+
}
|
|
1336
|
+
case 7: {
|
|
1337
|
+
const s = 3.5 * g;
|
|
1338
|
+
Y = `
|
|
1339
|
+
<line x1="${(u - s).toFixed(2)}" y1="${(m - s).toFixed(2)}" x2="${(u + s).toFixed(2)}" y2="${(m + s).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />
|
|
1340
|
+
<line x1="${(u + s).toFixed(2)}" y1="${(m - s).toFixed(2)}" x2="${(u - s).toFixed(2)}" y2="${(m + s).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />
|
|
1341
|
+
`;
|
|
1342
|
+
break;
|
|
1343
|
+
}
|
|
1344
|
+
case 8: {
|
|
1345
|
+
const s = 12 * g, l = 7.5 * g;
|
|
1346
|
+
Y = `
|
|
1347
|
+
<rect x="${(u - s).toFixed(2)}" y="${(m - l * 0.4).toFixed(2)}" width="${(s * 2).toFixed(2)}" height="${l.toFixed(2)}" rx="3" fill="#FFFFFF" stroke="#8A9BA8" stroke-width="1.8" />
|
|
1348
|
+
<line x1="${(u - s).toFixed(2)}" y1="${m.toFixed(2)}" x2="${(u + s).toFixed(2)}" y2="${m.toFixed(2)}" stroke="#C8D4DE" stroke-width="1.2" />
|
|
1058
1349
|
`;
|
|
1059
1350
|
break;
|
|
1351
|
+
}
|
|
1060
1352
|
case 9:
|
|
1061
|
-
|
|
1353
|
+
Y = `
|
|
1354
|
+
<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${(u - F * 0.5).toFixed(2)} ${(m + 3.2 * g).toFixed(2)} ${u.toFixed(2)} ${m.toFixed(2)} Q ${(u + F * 0.5).toFixed(2)} ${(m + 3.2 * g).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />
|
|
1355
|
+
`;
|
|
1062
1356
|
break;
|
|
1063
1357
|
case 10:
|
|
1064
|
-
|
|
1358
|
+
Y = `<circle cx="${u.toFixed(2)}" cy="${m.toFixed(2)}" r="${(1.9 * g).toFixed(2)}" fill="${c}" />`;
|
|
1065
1359
|
break;
|
|
1066
1360
|
case 11:
|
|
1067
|
-
|
|
1361
|
+
Y = `<line x1="${(u - F * 0.8).toFixed(2)}" y1="${(m + 2.5 * g).toFixed(2)}" x2="${(u + F * 0.8).toFixed(2)}" y2="${(m - 2.5 * g).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />`;
|
|
1068
1362
|
break;
|
|
1069
1363
|
case 12:
|
|
1070
|
-
|
|
1364
|
+
Y = `<path d="M ${(u - F).toFixed(2)} ${(m + 2 * g).toFixed(2)} Q ${u.toFixed(2)} ${(m - 4.5 * g).toFixed(2)} ${(u + F).toFixed(2)} ${(m + 2 * g).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1365
|
+
break;
|
|
1366
|
+
case 13:
|
|
1367
|
+
Y = `<circle cx="${u.toFixed(2)}" cy="${m.toFixed(2)}" r="${(3.2 * g).toFixed(2)}" fill="none" stroke="${c}" stroke-width="${y}" />`;
|
|
1368
|
+
break;
|
|
1369
|
+
case 14:
|
|
1370
|
+
Y = "";
|
|
1071
1371
|
break;
|
|
1072
|
-
case 15:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
<
|
|
1372
|
+
case 15: {
|
|
1373
|
+
const s = 3.2 * g, l = 4.8 * g;
|
|
1374
|
+
Y = `
|
|
1375
|
+
<line x1="${(u - F).toFixed(2)}" y1="${m.toFixed(2)}" x2="${(u + F).toFixed(2)}" y2="${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />
|
|
1376
|
+
<path d="M ${(u - s * 0.7).toFixed(2)} ${m.toFixed(2)} C ${(u - s).toFixed(2)} ${(m + l).toFixed(2)} ${(u + s).toFixed(2)} ${(m + l).toFixed(2)} ${(u + s * 0.7).toFixed(2)} ${m.toFixed(2)} Z" fill="#FF5E7E" stroke="${c}" stroke-width="1.8" />
|
|
1377
|
+
<line x1="${u.toFixed(2)}" y1="${m.toFixed(2)}" x2="${u.toFixed(2)}" y2="${(m + l * 0.65).toFixed(2)}" stroke="#D93856" stroke-width="1.2" />
|
|
1076
1378
|
`;
|
|
1077
1379
|
break;
|
|
1380
|
+
}
|
|
1078
1381
|
case 16:
|
|
1079
|
-
|
|
1382
|
+
Y = `<path d="M ${(u - F * 0.4).toFixed(2)} ${m.toFixed(2)} Q ${(u + F * 0.4).toFixed(2)} ${(m + 0.5).toFixed(2)} ${(u + F * 1.1).toFixed(2)} ${(m - 3.5 * g).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1080
1383
|
break;
|
|
1081
1384
|
case 17:
|
|
1082
|
-
|
|
1385
|
+
Y = `<path d="M ${(u - F * 0.6).toFixed(2)} ${(m + 2.5 * g).toFixed(2)} L ${u.toFixed(2)} ${(m - 2.5 * g).toFixed(2)} L ${(u + F * 0.6).toFixed(2)} ${(m + 2.5 * g).toFixed(2)} Z" fill="${c}" />`;
|
|
1083
1386
|
break;
|
|
1084
1387
|
case 18:
|
|
1085
|
-
|
|
1388
|
+
Y = `<path d="M ${(u - F * 0.6).toFixed(2)} ${(m - 2.2 * g).toFixed(2)} Q ${(u + 1).toFixed(2)} ${m.toFixed(2)} ${(u - F * 0.6).toFixed(2)} ${(m + 2.2 * g).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1086
1389
|
break;
|
|
1087
|
-
case 19:
|
|
1088
|
-
|
|
1390
|
+
case 19: {
|
|
1391
|
+
const s = 5 * g, l = 5.5 * g;
|
|
1392
|
+
Y = `<rect x="${(u - s).toFixed(2)}" y="${(m - l * 0.5).toFixed(2)}" width="${(s * 2).toFixed(2)}" height="${l.toFixed(2)}" rx="1.5" fill="${c}" />`;
|
|
1089
1393
|
break;
|
|
1394
|
+
}
|
|
1090
1395
|
case 20:
|
|
1091
|
-
|
|
1396
|
+
Y = `<path d="M ${(u - F * 0.7).toFixed(2)} ${(m - 1).toFixed(2)} Q ${u.toFixed(2)} ${(m + 2 * g).toFixed(2)} ${(u + F * 0.7).toFixed(2)} ${(m - 1).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1092
1397
|
break;
|
|
1093
1398
|
case 21: {
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1399
|
+
const s = 8 * g, l = 3.8 * g;
|
|
1400
|
+
Y = `
|
|
1401
|
+
<rect x="${(u - s).toFixed(2)}" y="${(m - l * 0.5).toFixed(2)}" width="${(s * 2).toFixed(2)}" height="${l.toFixed(2)}" rx="2" fill="#FFFFFF" stroke="${c}" stroke-width="2.2" />
|
|
1402
|
+
<line x1="${(u - s * 0.5).toFixed(2)}" y1="${(m - l * 0.5).toFixed(2)}" x2="${(u - s * 0.5).toFixed(2)}" y2="${(m + l * 0.5).toFixed(2)}" stroke="${c}" stroke-width="1.5" />
|
|
1403
|
+
<line x1="${u.toFixed(2)}" y1="${(m - l * 0.5).toFixed(2)}" x2="${u.toFixed(2)}" y2="${(m + l * 0.5).toFixed(2)}" stroke="${c}" stroke-width="1.5" />
|
|
1404
|
+
<line x1="${(u + s * 0.5).toFixed(2)}" y1="${(m - l * 0.5).toFixed(2)}" x2="${(u + s * 0.5).toFixed(2)}" y2="${(m + l * 0.5).toFixed(2)}" stroke="${c}" stroke-width="1.5" />
|
|
1405
|
+
`;
|
|
1101
1406
|
break;
|
|
1102
1407
|
}
|
|
1103
|
-
case 22:
|
|
1104
|
-
|
|
1105
|
-
<path d="M ${
|
|
1106
|
-
<path d="M ${
|
|
1408
|
+
case 22: {
|
|
1409
|
+
Y = `
|
|
1410
|
+
<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(m + 3 * g).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />
|
|
1411
|
+
<path d="M ${(u + F * 0.2).toFixed(2)} ${(m + 1).toFixed(2)} C ${(u + F * 0.2).toFixed(2)} ${(m + 5 * g).toFixed(2)} ${(u + F * 0.8).toFixed(2)} ${(m + 5 * g).toFixed(2)} ${(u + F * 0.8).toFixed(2)} ${(m + 1).toFixed(2)} Z" fill="#FF5E7E" stroke="${c}" stroke-width="1.5" />
|
|
1107
1412
|
`;
|
|
1108
1413
|
break;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1414
|
+
}
|
|
1415
|
+
case 23: {
|
|
1416
|
+
const s = 5.5 * g;
|
|
1417
|
+
Y = `
|
|
1418
|
+
<path d="M ${(u - F * 1.1).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(m + s * 2.2).toFixed(2)} ${(u + F * 1.1).toFixed(2)} ${m.toFixed(2)} Z" fill="${c}" />
|
|
1419
|
+
<ellipse cx="${u.toFixed(2)}" cy="${(m + s * 1.4).toFixed(2)}" rx="${(F * 0.65).toFixed(2)}" ry="${(s * 0.65).toFixed(2)}" fill="#FF6584" />
|
|
1113
1420
|
`;
|
|
1114
1421
|
break;
|
|
1422
|
+
}
|
|
1115
1423
|
case 24:
|
|
1116
|
-
|
|
1117
|
-
<path d="M ${m - w} ${u} Q ${m} ${u + 7} ${m + w} ${u - 2}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />
|
|
1118
|
-
<ellipse cx="${m + w * 0.3}" cy="${u + 3}" rx="2" ry="1.2" fill="#E3536C" opacity="0.7" />
|
|
1119
|
-
`;
|
|
1424
|
+
Y = `<path d="M ${(u - F * 0.5).toFixed(2)} ${(m - 1).toFixed(2)} Q ${(u - 1).toFixed(2)} ${(m + 4 * g).toFixed(2)} ${(u + F * 0.9).toFixed(2)} ${(m + 1).toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1120
1425
|
break;
|
|
1121
1426
|
case 0:
|
|
1122
1427
|
default:
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1125
|
-
else {
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1428
|
+
if (Math.abs(ve) < 0.05 && se < 0.05)
|
|
1429
|
+
Y = `<line x1="${(u - F).toFixed(2)}" y1="${m.toFixed(2)}" x2="${(u + F).toFixed(2)}" y2="${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" />`;
|
|
1430
|
+
else if (se > 0.1) {
|
|
1431
|
+
const s = (se * 5 + 1.5) * g, l = m + ve * 5 * g;
|
|
1432
|
+
Y = `<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(l + s).toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${(l - s * 0.3).toFixed(2)} ${(u - F).toFixed(2)} ${m.toFixed(2)} Z" fill="${c}" stroke="${c}" stroke-width="1.5" stroke-linejoin="round" />`;
|
|
1433
|
+
} else {
|
|
1434
|
+
const s = m + ve * 5 * g;
|
|
1435
|
+
Y = `<path d="M ${(u - F).toFixed(2)} ${m.toFixed(2)} Q ${u.toFixed(2)} ${s.toFixed(2)} ${(u + F).toFixed(2)} ${m.toFixed(2)}" stroke="${c}" stroke-width="${y}" stroke-linecap="round" fill="none" />`;
|
|
1128
1436
|
}
|
|
1129
1437
|
break;
|
|
1130
1438
|
}
|
|
1131
|
-
const ue = Math.max(0, Math.min(1, e.cheek));
|
|
1132
|
-
let j = "";
|
|
1133
|
-
e.blushStripes ? j = `
|
|
1134
|
-
<g stroke="#E3536C" stroke-width="2" opacity="0.75" stroke-linecap="round">
|
|
1135
|
-
<line x1="20" y1="52" x2="24" y2="58" />
|
|
1136
|
-
<line x1="24" y1="52" x2="28" y2="58" />
|
|
1137
|
-
<line x1="28" y1="52" x2="32" y2="58" />
|
|
1138
|
-
<line x1="68" y1="52" x2="72" y2="58" />
|
|
1139
|
-
<line x1="72" y1="52" x2="76" y2="58" />
|
|
1140
|
-
<line x1="76" y1="52" x2="80" y2="58" />
|
|
1141
|
-
</g>
|
|
1142
|
-
` : ue > 0.01 && (j = `
|
|
1143
|
-
<ellipse cx="${27 + A * 0.4}" cy="${56 + B * 0.4}" rx="6" ry="4" fill="${$}" opacity="${ue.toFixed(2)}" />
|
|
1144
|
-
<ellipse cx="${73 + A * 0.4}" cy="${56 + B * 0.4}" rx="6" ry="4" fill="${$}" opacity="${ue.toFixed(2)}" />
|
|
1145
|
-
`);
|
|
1146
|
-
const re = [
|
|
1147
|
-
`translate(${(e.shiftX ?? 0).toFixed(2)}, ${e.bob.toFixed(2)})`,
|
|
1148
|
-
v ? "translate(100, 0) scale(-1, 1)" : "",
|
|
1149
|
-
Y ? "translate(50, 50) scale(1.1) translate(-50, -50)" : ""
|
|
1150
|
-
].filter(Boolean).join(" ");
|
|
1151
1439
|
return `
|
|
1152
|
-
<svg width="${i}" height="${i}"
|
|
1440
|
+
<svg viewBox="0 0 100 100" width="${i}" height="${i}" xmlns="http://www.w3.org/2000/svg">
|
|
1153
1441
|
<defs>
|
|
1154
1442
|
<style>
|
|
1155
1443
|
@keyframes wissive-zzz-loop {
|
|
@@ -1170,6 +1458,9 @@ function _e(o, t, e, i, n = {}, c = 0) {
|
|
|
1170
1458
|
50% { transform: translateY(5px); opacity: 0.95; }
|
|
1171
1459
|
100% { transform: translateY(9px); opacity: 0.15; }
|
|
1172
1460
|
}
|
|
1461
|
+
.wissive-silhouette-path {
|
|
1462
|
+
transition: fill 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
1463
|
+
}
|
|
1173
1464
|
.wissive-zzz-1 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite 0s; transform-box: fill-box; transform-origin: center; }
|
|
1174
1465
|
.wissive-zzz-2 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -1s; transform-box: fill-box; transform-origin: center; }
|
|
1175
1466
|
.wissive-zzz-3 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -2s; transform-box: fill-box; transform-origin: center; }
|
|
@@ -1177,110 +1468,110 @@ function _e(o, t, e, i, n = {}, c = 0) {
|
|
|
1177
1468
|
.wissive-anim-sweat { animation: wissive-sweat-slide 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
|
|
1178
1469
|
</style>
|
|
1179
1470
|
</defs>
|
|
1180
|
-
<g transform="${
|
|
1471
|
+
<g transform="${x ? "translate(100, 0) scale(-1, 1)" : ""}">
|
|
1181
1472
|
<!-- Silueta del cuerpo (una o varias subformas: cuerpo + orejas, brazos…) -->
|
|
1182
|
-
${
|
|
1473
|
+
${d}
|
|
1183
1474
|
<!-- Mejillas o Rayas -->
|
|
1184
|
-
${
|
|
1475
|
+
${ge}
|
|
1185
1476
|
<!-- Accesorios (ZZZ, Gotas) -->
|
|
1186
|
-
${
|
|
1477
|
+
${ie}
|
|
1187
1478
|
<!-- Lágrimas -->
|
|
1188
|
-
${
|
|
1479
|
+
${be}
|
|
1189
1480
|
<!-- Ojos -->
|
|
1190
|
-
${
|
|
1191
|
-
${
|
|
1481
|
+
${we}
|
|
1482
|
+
${Me}
|
|
1192
1483
|
<!-- Cejas -->
|
|
1193
|
-
${
|
|
1484
|
+
${de}
|
|
1194
1485
|
<!-- Boca -->
|
|
1195
|
-
${
|
|
1486
|
+
${Y}
|
|
1196
1487
|
</g>
|
|
1197
1488
|
</svg>
|
|
1198
1489
|
`;
|
|
1199
1490
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1491
|
+
function Io(o, t, e, i, a = {}) {
|
|
1492
|
+
return ut(o, t, e, i, a);
|
|
1202
1493
|
}
|
|
1203
|
-
function
|
|
1494
|
+
function mt() {
|
|
1204
1495
|
return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(hover: hover)").matches;
|
|
1205
1496
|
}
|
|
1206
|
-
function
|
|
1497
|
+
function Ut() {
|
|
1207
1498
|
return typeof window > "u" ? !1 : typeof window.matchMedia == "function" && window.matchMedia("(hover: none)").matches || "ontouchstart" in window || typeof navigator < "u" && navigator.maxTouchPoints > 0;
|
|
1208
1499
|
}
|
|
1209
|
-
const
|
|
1210
|
-
let
|
|
1211
|
-
function
|
|
1212
|
-
const t = o.clientX, e = o.clientY, i = (typeof window < "u" ? window.innerWidth : 1e3) / 2 || 1,
|
|
1213
|
-
for (const
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1500
|
+
const Ie = /* @__PURE__ */ new Set();
|
|
1501
|
+
let Ge = !1;
|
|
1502
|
+
function yt(o) {
|
|
1503
|
+
const t = o.clientX, e = o.clientY, i = (typeof window < "u" ? window.innerWidth : 1e3) / 2 || 1, a = (typeof window < "u" ? window.innerHeight : 1e3) / 2 || 1;
|
|
1504
|
+
for (const r of Ie) {
|
|
1505
|
+
const n = r.element.getBoundingClientRect(), c = n.left + n.width / 2, f = n.top + n.height / 2;
|
|
1506
|
+
if (r.onGazeMove) {
|
|
1507
|
+
const x = Math.max(-0.6, Math.min(0.6, (t - c) / i)), M = Math.max(-0.6, Math.min(0.6, (e - f) / a));
|
|
1508
|
+
r.onGazeMove(22 * x, 14 * M);
|
|
1218
1509
|
}
|
|
1219
|
-
if (
|
|
1510
|
+
if (r.isActive())
|
|
1220
1511
|
continue;
|
|
1221
|
-
const d = Math.hypot(t -
|
|
1222
|
-
d !==
|
|
1512
|
+
const d = Math.hypot(t - c, e - f) <= r.nearRadius;
|
|
1513
|
+
d !== r.isNear && (r.isNear = d, r.onNearChange(d));
|
|
1223
1514
|
}
|
|
1224
1515
|
}
|
|
1225
|
-
function
|
|
1226
|
-
|
|
1516
|
+
function Jt(o) {
|
|
1517
|
+
Ie.add(o), !Ge && typeof window < "u" && (window.addEventListener("mousemove", yt, { passive: !0 }), Ge = !0);
|
|
1227
1518
|
}
|
|
1228
|
-
function
|
|
1229
|
-
|
|
1519
|
+
function Kt(o) {
|
|
1520
|
+
Ie.delete(o), Ie.size === 0 && Ge && typeof window < "u" && (window.removeEventListener("mousemove", yt), Ge = !1);
|
|
1230
1521
|
}
|
|
1231
|
-
function
|
|
1522
|
+
function eo(o, t, e = 120) {
|
|
1232
1523
|
if (typeof window > "u")
|
|
1233
1524
|
return () => {
|
|
1234
1525
|
};
|
|
1235
|
-
let i = !1,
|
|
1236
|
-
const
|
|
1526
|
+
let i = !1, a = !1, r = !1, n = !1;
|
|
1527
|
+
const c = () => {
|
|
1237
1528
|
i = !0, t.onHoverStart();
|
|
1238
|
-
},
|
|
1239
|
-
i = !1,
|
|
1240
|
-
},
|
|
1241
|
-
_.button === 0 && (
|
|
1529
|
+
}, f = () => {
|
|
1530
|
+
i = !1, a = !1, t.onHoverEnd();
|
|
1531
|
+
}, y = (_) => {
|
|
1532
|
+
_.button === 0 && (a = !0, t.onClickStart());
|
|
1242
1533
|
}, d = () => {
|
|
1243
|
-
|
|
1534
|
+
a && (a = !1, t.onClickEnd());
|
|
1535
|
+
}, x = () => {
|
|
1536
|
+
a = !0, t.onClickStart();
|
|
1244
1537
|
}, M = () => {
|
|
1245
|
-
|
|
1246
|
-
},
|
|
1247
|
-
|
|
1248
|
-
},
|
|
1249
|
-
|
|
1250
|
-
},
|
|
1251
|
-
|
|
1252
|
-
},
|
|
1253
|
-
|
|
1254
|
-
},
|
|
1255
|
-
(_.key === "Enter" || _.key === " ") && (_.preventDefault(),
|
|
1256
|
-
}, G = (_) => {
|
|
1257
|
-
(_.key === "Enter" || _.key === " ") && (_.preventDefault(), a && (a = !1, n = !1, t.onClickEnd()));
|
|
1538
|
+
a && (a = !1, t.onClickEnd());
|
|
1539
|
+
}, T = () => {
|
|
1540
|
+
a && (a = !1, t.onClickEnd());
|
|
1541
|
+
}, E = () => {
|
|
1542
|
+
r = !0, t.onHoverStart();
|
|
1543
|
+
}, R = () => {
|
|
1544
|
+
r = !1, n && (n = !1, a = !1, t.onClickEnd()), t.onHoverEnd();
|
|
1545
|
+
}, z = (_) => {
|
|
1546
|
+
(_.key === "Enter" || _.key === " ") && (_.preventDefault(), n || (n = !0, a = !0, t.onClickStart()));
|
|
1547
|
+
}, Z = (_) => {
|
|
1548
|
+
(_.key === "Enter" || _.key === " ") && (_.preventDefault(), n && (n = !1, a = !1, t.onClickEnd()));
|
|
1258
1549
|
};
|
|
1259
|
-
o.addEventListener("mouseenter",
|
|
1260
|
-
const
|
|
1550
|
+
o.addEventListener("mouseenter", c), o.addEventListener("mouseleave", f), o.addEventListener("mousedown", y), window.addEventListener("mouseup", d), o.addEventListener("focus", E), o.addEventListener("blur", R), o.addEventListener("keydown", z), o.addEventListener("keyup", Z), o.addEventListener("touchstart", x, { passive: !0 }), window.addEventListener("touchend", M, { passive: !0 }), window.addEventListener("touchcancel", T, { passive: !0 });
|
|
1551
|
+
const G = {
|
|
1261
1552
|
element: o,
|
|
1262
1553
|
nearRadius: e,
|
|
1263
1554
|
isNear: !1,
|
|
1264
|
-
isActive: () => i ||
|
|
1555
|
+
isActive: () => i || a || r,
|
|
1265
1556
|
onNearChange: t.onNearChange,
|
|
1266
1557
|
onGazeMove: t.onGazeMove
|
|
1267
1558
|
};
|
|
1268
|
-
return (
|
|
1269
|
-
o.removeEventListener("mouseenter",
|
|
1559
|
+
return (mt() || t.onGazeMove) && Jt(G), () => {
|
|
1560
|
+
o.removeEventListener("mouseenter", c), o.removeEventListener("mouseleave", f), o.removeEventListener("mousedown", y), window.removeEventListener("mouseup", d), o.removeEventListener("focus", E), o.removeEventListener("blur", R), o.removeEventListener("keydown", z), o.removeEventListener("keyup", Z), o.removeEventListener("touchstart", x), window.removeEventListener("touchend", M), window.removeEventListener("touchcancel", T), Kt(G);
|
|
1270
1561
|
};
|
|
1271
1562
|
}
|
|
1272
|
-
let
|
|
1273
|
-
function
|
|
1274
|
-
return
|
|
1563
|
+
let Ne;
|
|
1564
|
+
function qe() {
|
|
1565
|
+
return Ne || (Ne = import(
|
|
1275
1566
|
/* @vite-ignore */
|
|
1276
1567
|
"cuelume"
|
|
1277
|
-
).catch(() => null)),
|
|
1568
|
+
).catch(() => null)), Ne;
|
|
1278
1569
|
}
|
|
1279
|
-
class
|
|
1570
|
+
class to {
|
|
1280
1571
|
constructor() {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1572
|
+
v(this, "enabled", !0);
|
|
1573
|
+
v(this, "volume", 0.6);
|
|
1574
|
+
qe().then((t) => {
|
|
1284
1575
|
try {
|
|
1285
1576
|
t == null || t.setVolume(this.volume);
|
|
1286
1577
|
} catch {
|
|
@@ -1294,7 +1585,7 @@ class St {
|
|
|
1294
1585
|
return this.enabled;
|
|
1295
1586
|
}
|
|
1296
1587
|
setVolumeLevel(t) {
|
|
1297
|
-
this.volume = Math.max(0, Math.min(1, t)),
|
|
1588
|
+
this.volume = Math.max(0, Math.min(1, t)), qe().then((e) => {
|
|
1298
1589
|
try {
|
|
1299
1590
|
e == null || e.setVolume(this.volume);
|
|
1300
1591
|
} catch {
|
|
@@ -1305,7 +1596,7 @@ class St {
|
|
|
1305
1596
|
return this.volume;
|
|
1306
1597
|
}
|
|
1307
1598
|
playCue(t, e = {}) {
|
|
1308
|
-
this.enabled &&
|
|
1599
|
+
this.enabled && qe().then((i) => {
|
|
1309
1600
|
try {
|
|
1310
1601
|
i == null || i.play(t, { volume: e.volume ?? this.volume });
|
|
1311
1602
|
} catch {
|
|
@@ -1359,39 +1650,39 @@ class St {
|
|
|
1359
1650
|
this.playCue(i);
|
|
1360
1651
|
}
|
|
1361
1652
|
}
|
|
1362
|
-
const
|
|
1363
|
-
function
|
|
1364
|
-
|
|
1653
|
+
const oe = new to();
|
|
1654
|
+
function oo(o) {
|
|
1655
|
+
oe.setEnabled(o);
|
|
1365
1656
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return
|
|
1657
|
+
function io() {
|
|
1658
|
+
return oe.isEnabled();
|
|
1368
1659
|
}
|
|
1369
|
-
function
|
|
1370
|
-
|
|
1660
|
+
function so(o) {
|
|
1661
|
+
oe.setVolumeLevel(o);
|
|
1371
1662
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1663
|
+
function no() {
|
|
1664
|
+
return oe.getVolumeLevel();
|
|
1374
1665
|
}
|
|
1375
|
-
class
|
|
1666
|
+
class ao {
|
|
1376
1667
|
constructor(t, e) {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1668
|
+
v(this, "particles", []);
|
|
1669
|
+
v(this, "canvas");
|
|
1670
|
+
v(this, "ctx");
|
|
1671
|
+
v(this, "animating", !1);
|
|
1672
|
+
v(this, "rafId", null);
|
|
1673
|
+
v(this, "size");
|
|
1674
|
+
v(this, "dpr");
|
|
1675
|
+
v(this, "tick", () => {
|
|
1385
1676
|
const t = this.canvas.width, e = this.canvas.height;
|
|
1386
1677
|
this.ctx.clearRect(0, 0, t, e);
|
|
1387
1678
|
const i = 0.016;
|
|
1388
|
-
for (let
|
|
1389
|
-
const
|
|
1390
|
-
if (
|
|
1391
|
-
this.particles.splice(
|
|
1679
|
+
for (let a = this.particles.length - 1; a >= 0; a--) {
|
|
1680
|
+
const r = this.particles[a];
|
|
1681
|
+
if (r.life -= i, r.life <= 0) {
|
|
1682
|
+
this.particles.splice(a, 1);
|
|
1392
1683
|
continue;
|
|
1393
1684
|
}
|
|
1394
|
-
|
|
1685
|
+
r.vx *= 0.95, r.vy *= 0.95, r.swayFreq && r.swayAmp && (r.x += Math.sin((r.maxLife - r.life) * r.swayFreq) * r.swayAmp), r.x += r.vx, r.y += r.vy, r.rotation += r.rotSpeed, this.drawParticle(r);
|
|
1395
1686
|
}
|
|
1396
1687
|
this.particles.length > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.animating = !1, this.ctx.clearRect(0, 0, t, e));
|
|
1397
1688
|
});
|
|
@@ -1412,202 +1703,202 @@ class At {
|
|
|
1412
1703
|
resize(t) {
|
|
1413
1704
|
this.size = t, this.dpr = typeof window < "u" && window.devicePixelRatio || 1, this.setupCanvas();
|
|
1414
1705
|
}
|
|
1415
|
-
burst(t, e = 8, i,
|
|
1416
|
-
const
|
|
1417
|
-
for (let
|
|
1418
|
-
const
|
|
1419
|
-
this.particles.push(
|
|
1706
|
+
burst(t, e = 8, i, a) {
|
|
1707
|
+
const r = this.size * 2.5, n = i ?? r / 2, c = a ?? r / 2;
|
|
1708
|
+
for (let f = 0; f < e; f++) {
|
|
1709
|
+
const y = Math.PI * 2 * f / e + (Math.random() - 0.5) * 0.7, d = 2.5 + Math.random() * 3.5, x = this.createParticle(t, n, c, y, d);
|
|
1710
|
+
this.particles.push(x);
|
|
1420
1711
|
}
|
|
1421
1712
|
this.animating || (this.animating = !0, this.tick());
|
|
1422
1713
|
}
|
|
1423
|
-
createParticle(t, e, i,
|
|
1424
|
-
const
|
|
1425
|
-
x:
|
|
1426
|
-
y:
|
|
1427
|
-
vx: Math.cos(
|
|
1428
|
-
vy: Math.sin(
|
|
1429
|
-
life:
|
|
1430
|
-
maxLife:
|
|
1714
|
+
createParticle(t, e, i, a, r) {
|
|
1715
|
+
const n = 10 + Math.random() * 15, c = e + Math.cos(a) * n, f = i + Math.sin(a) * n, y = 0.6 + Math.random() * 0.5, d = {
|
|
1716
|
+
x: c,
|
|
1717
|
+
y: f,
|
|
1718
|
+
vx: Math.cos(a) * r,
|
|
1719
|
+
vy: Math.sin(a) * r - 1.2,
|
|
1720
|
+
life: y,
|
|
1721
|
+
maxLife: y,
|
|
1431
1722
|
size: (6 + Math.random() * 8) * (this.size / 120),
|
|
1432
1723
|
rotation: Math.random() * Math.PI * 2,
|
|
1433
1724
|
rotSpeed: (Math.random() - 0.5) * 0.2,
|
|
1434
1725
|
shape: "circle",
|
|
1435
1726
|
color: "#F2A9B8",
|
|
1436
1727
|
opacity: 1
|
|
1437
|
-
},
|
|
1728
|
+
}, x = Math.random() > 0.6, M = (T) => T[Math.floor(Math.random() * T.length)];
|
|
1438
1729
|
switch (t) {
|
|
1439
1730
|
case "happy":
|
|
1440
|
-
d.shape =
|
|
1731
|
+
d.shape = x ? "sparkle" : "heart", d.color = M(["#F2A9B8", "#E3536C", "#FF8FAB", "#FFD1DC", "#FFF0F5"]), d.vy -= 0.6;
|
|
1441
1732
|
break;
|
|
1442
1733
|
case "pleasure":
|
|
1443
|
-
d.shape =
|
|
1734
|
+
d.shape = x ? "circle" : "petal", d.color = M(["#F28FC2", "#FFC2DE", "#FFE3F0", "#E5739F"]), d.vy += 0.9, d.vx *= 0.6, d.rotSpeed *= 2.5, d.swayFreq = 5 + Math.random() * 3, d.swayAmp = 0.9 + Math.random() * 0.5;
|
|
1444
1735
|
break;
|
|
1445
1736
|
case "flutter":
|
|
1446
|
-
d.shape =
|
|
1737
|
+
d.shape = x ? "sparkle" : "star", d.color = M(["#F2CB4E", "#FFD700", "#FFA500", "#FFF4CC"]), d.vy -= 1, d.vx *= 1.5, d.rotSpeed *= 2;
|
|
1447
1738
|
break;
|
|
1448
1739
|
case "peaceful":
|
|
1449
|
-
d.shape =
|
|
1740
|
+
d.shape = x ? "circle" : "ring", d.color = M(["#9AC9A0", "#B5E8B5", "#7FD17F", "#E8F5E9"]), d.vy -= 0.8, d.swayFreq = 8 + Math.random() * 4, d.swayAmp = 0.4 + Math.random() * 0.4;
|
|
1450
1741
|
break;
|
|
1451
1742
|
case "normal":
|
|
1452
|
-
d.shape =
|
|
1743
|
+
d.shape = x ? "circle" : "dot", d.color = M(["#C9DCD3", "#A8C7BB", "#E4F0EA", "#8FB3A4"]), d.size *= 0.65, d.vx *= 0.5, d.vy *= 0.5;
|
|
1453
1744
|
break;
|
|
1454
1745
|
case "tired":
|
|
1455
|
-
d.shape =
|
|
1746
|
+
d.shape = x ? "ring" : "zzz", d.color = M(["#D6DBCF", "#BFC7B8", "#EDF0E8", "#A9B3A0"]), d.vy -= 1.2, d.vx *= 0.25, d.swayFreq = 6 + Math.random() * 4, d.swayAmp = 0.5;
|
|
1456
1747
|
break;
|
|
1457
1748
|
case "sleepy":
|
|
1458
|
-
d.shape =
|
|
1749
|
+
d.shape = x ? "zzz" : "bubble", d.color = M(["#AFCBE0", "#D3E8F5", "#ffffff", "#8FB6D1"]), d.size *= 1.35, d.vy -= 1.5, d.vx *= 0.2, d.swayFreq = 3 + Math.random() * 2, d.swayAmp = 0.7;
|
|
1459
1750
|
break;
|
|
1460
1751
|
case "sad":
|
|
1461
|
-
d.shape =
|
|
1752
|
+
d.shape = x ? "circle" : "drop", d.color = M(["#7FA6D9", "#A0C4E8", "#6B9ACF", "#E1F5FE"]), d.vy += 1.8, d.vx *= 0.3;
|
|
1462
1753
|
break;
|
|
1463
1754
|
case "disappointed":
|
|
1464
|
-
d.shape =
|
|
1755
|
+
d.shape = x ? "drop" : "shard", d.color = M(["#EBD98A", "#C9B86B", "#F5E9B8", "#A89550"]), d.vy += 1.2, d.vx *= 0.8, d.rotSpeed *= 4;
|
|
1465
1756
|
break;
|
|
1466
1757
|
case "anxiety":
|
|
1467
|
-
d.shape =
|
|
1758
|
+
d.shape = x ? "circle" : "zigzag", d.color = M(["#A99BD9", "#C4B5F0", "#8B7BC4", "#D1C4E9"]), d.size *= 0.8, d.vx *= 1.4;
|
|
1468
1759
|
break;
|
|
1469
1760
|
case "stress":
|
|
1470
|
-
d.shape =
|
|
1761
|
+
d.shape = x ? "zigzag" : "spiral", d.color = M(["#C97F76", "#E09A91", "#A85F57", "#F0BDB6"]), d.size *= 0.9, d.rotSpeed *= 6, d.swayFreq = 12 + Math.random() * 6, d.swayAmp = 0.6;
|
|
1471
1762
|
break;
|
|
1472
1763
|
case "anger":
|
|
1473
|
-
d.shape =
|
|
1764
|
+
d.shape = x ? "diamond" : "ember", d.color = M(["#D9566A", "#FF4444", "#FF6B35", "#FFA033"]), d.vy -= 1.4, d.vx *= 0.7, d.size *= 0.9;
|
|
1474
1765
|
break;
|
|
1475
1766
|
case "surprised":
|
|
1476
|
-
d.shape =
|
|
1767
|
+
d.shape = x ? "dot" : "burst", d.color = M(["#F0B98A", "#FFCFA3", "#FF9F1C", "#FFE8D1"]), d.size *= 1.15, d.vx *= 1.8, d.vy *= 1.8;
|
|
1477
1768
|
break;
|
|
1478
1769
|
case "numbness":
|
|
1479
|
-
d.shape =
|
|
1770
|
+
d.shape = x ? "dot" : "glitch", d.color = M(["#D9C6E0", "#C0A8CC", "#EDE2F0", "#A98FB8"]), d.vx *= 0.25, d.vy *= 0.25, d.life *= 0.6, d.rotSpeed = 0;
|
|
1480
1771
|
break;
|
|
1481
1772
|
default:
|
|
1482
|
-
d.shape =
|
|
1773
|
+
d.shape = x ? "sparkle" : "circle", d.color = M(["#F2A9B8", "#F2CB4E", "#9AC9A0"]);
|
|
1483
1774
|
break;
|
|
1484
1775
|
}
|
|
1485
1776
|
return d;
|
|
1486
1777
|
}
|
|
1487
1778
|
drawParticle(t) {
|
|
1488
|
-
const e = this.ctx, i = this.dpr,
|
|
1489
|
-
let
|
|
1490
|
-
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
const
|
|
1494
|
-
switch (e.save(), e.translate(t.x * i, t.y * i), e.rotate(t.rotation), e.globalAlpha =
|
|
1779
|
+
const e = this.ctx, i = this.dpr, a = 1 - t.life / t.maxLife;
|
|
1780
|
+
let r = 1;
|
|
1781
|
+
a < 0.18 ? r = a / 0.18 : a > 0.65 && (r = (1 - a) / 0.35), r = Math.max(0, Math.min(1.2, r));
|
|
1782
|
+
const n = t.size * r;
|
|
1783
|
+
if (n <= 0.1) return;
|
|
1784
|
+
const c = Math.max(0, Math.min(1, t.life / t.maxLife * 1.2));
|
|
1785
|
+
switch (e.save(), e.translate(t.x * i, t.y * i), e.rotate(t.rotation), e.globalAlpha = c, t.shape) {
|
|
1495
1786
|
case "heart":
|
|
1496
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0,
|
|
1497
|
-
-
|
|
1498
|
-
-
|
|
1499
|
-
-
|
|
1500
|
-
-
|
|
1787
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, n * 0.35 * i), e.bezierCurveTo(
|
|
1788
|
+
-n * 0.7 * i,
|
|
1789
|
+
-n * 0.1 * i,
|
|
1790
|
+
-n * 0.8 * i,
|
|
1791
|
+
-n * 0.8 * i,
|
|
1501
1792
|
0,
|
|
1502
|
-
-
|
|
1793
|
+
-n * 0.45 * i
|
|
1503
1794
|
), e.bezierCurveTo(
|
|
1504
|
-
|
|
1505
|
-
-
|
|
1506
|
-
|
|
1507
|
-
-
|
|
1795
|
+
n * 0.8 * i,
|
|
1796
|
+
-n * 0.8 * i,
|
|
1797
|
+
n * 0.7 * i,
|
|
1798
|
+
-n * 0.1 * i,
|
|
1508
1799
|
0,
|
|
1509
|
-
|
|
1800
|
+
n * 0.35 * i
|
|
1510
1801
|
), e.closePath(), e.fill();
|
|
1511
1802
|
break;
|
|
1512
1803
|
case "star": {
|
|
1513
1804
|
e.fillStyle = t.color, e.beginPath();
|
|
1514
|
-
const
|
|
1515
|
-
for (let
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1805
|
+
const f = 5, y = n * i, d = n * 0.45 * i;
|
|
1806
|
+
for (let x = 0; x < f * 2; x++) {
|
|
1807
|
+
const M = x % 2 === 0 ? y : d, T = x * Math.PI / f - Math.PI / 2, E = Math.cos(T) * M, R = Math.sin(T) * M;
|
|
1808
|
+
x === 0 ? e.moveTo(E, R) : e.lineTo(E, R);
|
|
1518
1809
|
}
|
|
1519
1810
|
e.closePath(), e.fill();
|
|
1520
1811
|
break;
|
|
1521
1812
|
}
|
|
1522
1813
|
case "sparkle": {
|
|
1523
1814
|
e.fillStyle = t.color, e.beginPath();
|
|
1524
|
-
const
|
|
1525
|
-
e.moveTo(0,
|
|
1815
|
+
const f = n * 1.1 * i;
|
|
1816
|
+
e.moveTo(0, -f), e.quadraticCurveTo(0, 0, f, 0), e.quadraticCurveTo(0, 0, 0, f), e.quadraticCurveTo(0, 0, -f, 0), e.quadraticCurveTo(0, 0, 0, -f), e.closePath(), e.fill();
|
|
1526
1817
|
break;
|
|
1527
1818
|
}
|
|
1528
1819
|
case "drop":
|
|
1529
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -
|
|
1530
|
-
|
|
1531
|
-
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1820
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -n * 0.8 * i), e.bezierCurveTo(
|
|
1821
|
+
n * 0.7 * i,
|
|
1822
|
+
-n * 0.2 * i,
|
|
1823
|
+
n * 0.6 * i,
|
|
1824
|
+
n * 0.7 * i,
|
|
1534
1825
|
0,
|
|
1535
|
-
|
|
1826
|
+
n * 0.7 * i
|
|
1536
1827
|
), e.bezierCurveTo(
|
|
1537
|
-
-
|
|
1538
|
-
|
|
1539
|
-
-
|
|
1540
|
-
-
|
|
1828
|
+
-n * 0.6 * i,
|
|
1829
|
+
n * 0.7 * i,
|
|
1830
|
+
-n * 0.7 * i,
|
|
1831
|
+
-n * 0.2 * i,
|
|
1541
1832
|
0,
|
|
1542
|
-
-
|
|
1833
|
+
-n * 0.8 * i
|
|
1543
1834
|
), e.closePath(), e.fill();
|
|
1544
1835
|
break;
|
|
1545
1836
|
case "diamond":
|
|
1546
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -
|
|
1837
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -n * i), e.lineTo(n * 0.65 * i, 0), e.lineTo(0, n * i), e.lineTo(-n * 0.65 * i, 0), e.closePath(), e.fill();
|
|
1547
1838
|
break;
|
|
1548
1839
|
case "zigzag":
|
|
1549
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(2,
|
|
1840
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(2, n * 0.25) * i, e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(-n * 0.6 * i, -n * 0.5 * i), e.lineTo(-n * 0.1 * i, -n * 0.1 * i), e.lineTo(-n * 0.3 * i, n * 0.1 * i), e.lineTo(n * 0.6 * i, n * 0.5 * i), e.stroke();
|
|
1550
1841
|
break;
|
|
1551
1842
|
case "ring":
|
|
1552
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5,
|
|
1843
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, n * 0.25) * i, e.beginPath(), e.arc(0, 0, n * 0.55 * i, 0, Math.PI * 2), e.stroke();
|
|
1553
1844
|
break;
|
|
1554
1845
|
case "zzz":
|
|
1555
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(2,
|
|
1846
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(2, n * 0.25) * i, e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(-n * 0.4 * i, -n * 0.5 * i), e.lineTo(n * 0.4 * i, -n * 0.5 * i), e.lineTo(-n * 0.4 * i, n * 0.5 * i), e.lineTo(n * 0.4 * i, n * 0.5 * i), e.stroke();
|
|
1556
1847
|
break;
|
|
1557
1848
|
case "petal":
|
|
1558
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -
|
|
1849
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -n * 0.9 * i), e.quadraticCurveTo(n * 0.75 * i, -n * 0.1 * i, 0, n * 0.9 * i), e.quadraticCurveTo(-n * 0.75 * i, -n * 0.1 * i, 0, -n * 0.9 * i), e.closePath(), e.fill();
|
|
1559
1850
|
break;
|
|
1560
1851
|
case "spiral": {
|
|
1561
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5,
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1852
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, n * 0.2) * i, e.lineCap = "round", e.beginPath();
|
|
1853
|
+
const f = n * 0.85 * i;
|
|
1854
|
+
ct().forEach(([y, d], x) => {
|
|
1855
|
+
const M = y * f, T = d * f;
|
|
1856
|
+
x === 0 ? e.moveTo(M, T) : e.lineTo(M, T);
|
|
1566
1857
|
}), e.stroke();
|
|
1567
1858
|
break;
|
|
1568
1859
|
}
|
|
1569
1860
|
case "bubble":
|
|
1570
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(1,
|
|
1861
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(1, n * 0.14) * i, e.beginPath(), e.arc(0, 0, n * 0.6 * i, 0, Math.PI * 2), e.stroke(), e.fillStyle = t.color, e.globalAlpha *= 0.7, e.beginPath(), e.arc(-n * 0.22 * i, -n * 0.24 * i, n * 0.13 * i, 0, Math.PI * 2), e.fill();
|
|
1571
1862
|
break;
|
|
1572
1863
|
case "ember": {
|
|
1573
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -
|
|
1574
|
-
|
|
1575
|
-
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1864
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -n * 0.95 * i), e.bezierCurveTo(
|
|
1865
|
+
n * 0.5 * i,
|
|
1866
|
+
-n * 0.2 * i,
|
|
1867
|
+
n * 0.62 * i,
|
|
1868
|
+
n * 0.55 * i,
|
|
1578
1869
|
0,
|
|
1579
|
-
|
|
1870
|
+
n * 0.75 * i
|
|
1580
1871
|
), e.bezierCurveTo(
|
|
1581
|
-
-
|
|
1582
|
-
|
|
1583
|
-
-
|
|
1584
|
-
-
|
|
1872
|
+
-n * 0.62 * i,
|
|
1873
|
+
n * 0.55 * i,
|
|
1874
|
+
-n * 0.5 * i,
|
|
1875
|
+
-n * 0.2 * i,
|
|
1585
1876
|
0,
|
|
1586
|
-
-
|
|
1877
|
+
-n * 0.95 * i
|
|
1587
1878
|
), e.closePath(), e.fill();
|
|
1588
1879
|
break;
|
|
1589
1880
|
}
|
|
1590
1881
|
case "shard":
|
|
1591
|
-
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -
|
|
1882
|
+
e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -n * 0.9 * i), e.lineTo(n * 0.55 * i, -n * 0.15 * i), e.lineTo(n * 0.2 * i, n * 0.85 * i), e.lineTo(-n * 0.45 * i, n * 0.3 * i), e.closePath(), e.fill();
|
|
1592
1883
|
break;
|
|
1593
1884
|
case "burst": {
|
|
1594
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5,
|
|
1595
|
-
for (let
|
|
1596
|
-
const
|
|
1597
|
-
e.moveTo(Math.cos(
|
|
1885
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, n * 0.22) * i, e.lineCap = "round", e.beginPath();
|
|
1886
|
+
for (let f = 0; f < 4; f++) {
|
|
1887
|
+
const y = f * Math.PI / 2, d = n * 0.3 * i, x = n * i;
|
|
1888
|
+
e.moveTo(Math.cos(y) * d, Math.sin(y) * d), e.lineTo(Math.cos(y) * x, Math.sin(y) * x);
|
|
1598
1889
|
}
|
|
1599
1890
|
e.stroke();
|
|
1600
1891
|
break;
|
|
1601
1892
|
}
|
|
1602
1893
|
case "dot":
|
|
1603
|
-
e.fillStyle = t.color, e.beginPath(), e.arc(0, 0,
|
|
1894
|
+
e.fillStyle = t.color, e.beginPath(), e.arc(0, 0, n * 0.28 * i, 0, Math.PI * 2), e.fill();
|
|
1604
1895
|
break;
|
|
1605
1896
|
case "glitch":
|
|
1606
|
-
e.fillStyle = t.color, e.fillRect(-
|
|
1897
|
+
e.fillStyle = t.color, e.fillRect(-n * 0.6 * i, -n * 0.28 * i, n * 1.2 * i, n * 0.22 * i), e.globalAlpha *= 0.6, e.fillRect(-n * 0.25 * i, n * 0.06 * i, n * 0.9 * i, n * 0.16 * i);
|
|
1607
1898
|
break;
|
|
1608
1899
|
case "circle":
|
|
1609
1900
|
default:
|
|
1610
|
-
e.fillStyle = t.color, e.beginPath(), e.arc(0, 0,
|
|
1901
|
+
e.fillStyle = t.color, e.beginPath(), e.arc(0, 0, n * 0.5 * i, 0, Math.PI * 2), e.fill();
|
|
1611
1902
|
break;
|
|
1612
1903
|
}
|
|
1613
1904
|
e.restore();
|
|
@@ -1616,75 +1907,75 @@ class At {
|
|
|
1616
1907
|
this.rafId !== null && cancelAnimationFrame(this.rafId), this.particles = [], this.canvas.remove();
|
|
1617
1908
|
}
|
|
1618
1909
|
}
|
|
1619
|
-
class
|
|
1910
|
+
class ro {
|
|
1620
1911
|
constructor(t, e, i) {
|
|
1621
1912
|
// Position
|
|
1622
|
-
|
|
1623
|
-
|
|
1913
|
+
v(this, "posX", 0);
|
|
1914
|
+
v(this, "posY", 0);
|
|
1624
1915
|
// Velocity
|
|
1625
|
-
|
|
1626
|
-
|
|
1916
|
+
v(this, "velX", 0);
|
|
1917
|
+
v(this, "velY", 0);
|
|
1627
1918
|
// Drag tracking
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1919
|
+
v(this, "dragging", !1);
|
|
1920
|
+
v(this, "startPointerX", 0);
|
|
1921
|
+
v(this, "startPointerY", 0);
|
|
1922
|
+
v(this, "lastPointerX", 0);
|
|
1923
|
+
v(this, "lastPointerY", 0);
|
|
1924
|
+
v(this, "lastPointerTime", 0);
|
|
1634
1925
|
// Velocity samples for a smooth toss (ring buffer of last N moves)
|
|
1635
|
-
|
|
1636
|
-
|
|
1926
|
+
v(this, "velocitySamples", []);
|
|
1927
|
+
v(this, "MAX_SAMPLES", 6);
|
|
1637
1928
|
// Spring constants for the return-to-origin bounce
|
|
1638
|
-
|
|
1929
|
+
v(this, "springK", 0.08);
|
|
1639
1930
|
// stiffness — lower = softer jelly
|
|
1640
|
-
|
|
1931
|
+
v(this, "springD", 0.82);
|
|
1641
1932
|
// damping — lower = bouncier
|
|
1642
|
-
|
|
1933
|
+
v(this, "tossDecay", 0.96);
|
|
1643
1934
|
// air friction on free flight
|
|
1644
1935
|
// Stretch limits
|
|
1645
|
-
|
|
1936
|
+
v(this, "maxStretch", 0.25);
|
|
1646
1937
|
// Physics loop
|
|
1647
|
-
|
|
1648
|
-
|
|
1938
|
+
v(this, "animating", !1);
|
|
1939
|
+
v(this, "rafId", null);
|
|
1649
1940
|
// Callbacks
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1941
|
+
v(this, "onUpdate");
|
|
1942
|
+
v(this, "onDragStart");
|
|
1943
|
+
v(this, "onDragEnd");
|
|
1653
1944
|
// Element ref
|
|
1654
|
-
|
|
1945
|
+
v(this, "el");
|
|
1655
1946
|
// ─── Pointer Abstraction ───────────────────────────────────────────
|
|
1656
|
-
|
|
1947
|
+
v(this, "handlePointerDown", (t) => {
|
|
1657
1948
|
t.preventDefault(), this.startDrag(t.clientX, t.clientY);
|
|
1658
1949
|
});
|
|
1659
|
-
|
|
1950
|
+
v(this, "handlePointerMove", (t) => {
|
|
1660
1951
|
this.dragging && this.moveDrag(t.clientX, t.clientY);
|
|
1661
1952
|
});
|
|
1662
|
-
|
|
1953
|
+
v(this, "handlePointerUp", () => {
|
|
1663
1954
|
this.dragging && this.endDrag();
|
|
1664
1955
|
});
|
|
1665
|
-
|
|
1956
|
+
v(this, "handleTouchDown", (t) => {
|
|
1666
1957
|
t.preventDefault();
|
|
1667
1958
|
const e = t.touches[0];
|
|
1668
1959
|
this.startDrag(e.clientX, e.clientY);
|
|
1669
1960
|
});
|
|
1670
|
-
|
|
1961
|
+
v(this, "handleTouchMove", (t) => {
|
|
1671
1962
|
if (!this.dragging) return;
|
|
1672
1963
|
t.preventDefault();
|
|
1673
1964
|
const e = t.touches[0];
|
|
1674
1965
|
this.moveDrag(e.clientX, e.clientY);
|
|
1675
1966
|
});
|
|
1676
|
-
|
|
1967
|
+
v(this, "handleTouchUp", () => {
|
|
1677
1968
|
this.dragging && this.endDrag();
|
|
1678
1969
|
});
|
|
1679
|
-
|
|
1970
|
+
v(this, "physicsTick", () => {
|
|
1680
1971
|
if (this.dragging) {
|
|
1681
1972
|
this.emitState(), this.rafId = requestAnimationFrame(this.physicsTick);
|
|
1682
1973
|
return;
|
|
1683
1974
|
}
|
|
1684
1975
|
const t = -this.springK * this.posX, e = -this.springK * this.posY;
|
|
1685
1976
|
this.velX = (this.velX + t) * this.springD, this.velY = (this.velY + e) * this.springD, this.velX *= this.tossDecay, this.velY *= this.tossDecay, this.posX += this.velX, this.posY += this.velY, this.emitState();
|
|
1686
|
-
const i = Math.hypot(this.posX, this.posY),
|
|
1687
|
-
if (i < 0.3 &&
|
|
1977
|
+
const i = Math.hypot(this.posX, this.posY), a = Math.hypot(this.velX, this.velY);
|
|
1978
|
+
if (i < 0.3 && a < 0.1) {
|
|
1688
1979
|
this.posX = 0, this.posY = 0, this.velX = 0, this.velY = 0, this.animating = !1, this.emitState();
|
|
1689
1980
|
return;
|
|
1690
1981
|
}
|
|
@@ -1698,22 +1989,22 @@ class zt {
|
|
|
1698
1989
|
this.dragging = !0, this.startPointerX = t - this.posX, this.startPointerY = e - this.posY, this.lastPointerX = t, this.lastPointerY = e, this.lastPointerTime = performance.now(), this.velocitySamples = [], this.velX = 0, this.velY = 0, this.el.style.cursor = "grabbing", (i = this.onDragStart) == null || i.call(this), this.startPhysicsLoop();
|
|
1699
1990
|
}
|
|
1700
1991
|
moveDrag(t, e) {
|
|
1701
|
-
const i = performance.now(),
|
|
1992
|
+
const i = performance.now(), a = Math.max(1, i - this.lastPointerTime);
|
|
1702
1993
|
this.velocitySamples.push({
|
|
1703
|
-
x: (t - this.lastPointerX) /
|
|
1704
|
-
y: (e - this.lastPointerY) /
|
|
1994
|
+
x: (t - this.lastPointerX) / a,
|
|
1995
|
+
y: (e - this.lastPointerY) / a
|
|
1705
1996
|
}), this.velocitySamples.length > this.MAX_SAMPLES && this.velocitySamples.shift(), this.posX = t - this.startPointerX, this.posY = e - this.startPointerY, this.lastPointerX = t, this.lastPointerY = e, this.lastPointerTime = i;
|
|
1706
1997
|
}
|
|
1707
1998
|
endDrag() {
|
|
1708
1999
|
var t;
|
|
1709
2000
|
if (this.dragging = !1, this.el.style.cursor = "pointer", this.velocitySamples.length > 0) {
|
|
1710
2001
|
let e = 0, i = 0;
|
|
1711
|
-
for (const
|
|
1712
|
-
e +=
|
|
1713
|
-
const
|
|
1714
|
-
this.velX = e /
|
|
1715
|
-
const
|
|
1716
|
-
|
|
2002
|
+
for (const c of this.velocitySamples)
|
|
2003
|
+
e += c.x, i += c.y;
|
|
2004
|
+
const a = this.velocitySamples.length;
|
|
2005
|
+
this.velX = e / a * 16, this.velY = i / a * 16;
|
|
2006
|
+
const r = 25, n = Math.hypot(this.velX, this.velY);
|
|
2007
|
+
n > r && (this.velX = this.velX / n * r, this.velY = this.velY / n * r);
|
|
1717
2008
|
}
|
|
1718
2009
|
(t = this.onDragEnd) == null || t.call(this), this.startPhysicsLoop();
|
|
1719
2010
|
}
|
|
@@ -1724,11 +2015,11 @@ class zt {
|
|
|
1724
2015
|
emitState() {
|
|
1725
2016
|
let t = 1, e = 1, i = 0;
|
|
1726
2017
|
if (this.dragging) {
|
|
1727
|
-
const
|
|
1728
|
-
t = 1 +
|
|
2018
|
+
const a = this.posX, r = this.posY, n = Math.hypot(a, r), c = Math.min(this.maxStretch, n * 2e-3), f = Math.atan2(r, a);
|
|
2019
|
+
t = 1 + c * Math.abs(Math.cos(f)), e = 1 - c * 0.5 * Math.abs(Math.cos(f)), Math.abs(Math.sin(f)) > Math.abs(Math.cos(f)) && (e = 1 + c * Math.abs(Math.sin(f)), t = 1 - c * 0.5 * Math.abs(Math.sin(f))), i = Math.atan2(r, a) * 0.06;
|
|
1729
2020
|
} else {
|
|
1730
|
-
const
|
|
1731
|
-
t = 1 +
|
|
2021
|
+
const a = Math.hypot(this.velX, this.velY), r = Math.min(this.maxStretch, a * 0.012), n = Math.atan2(this.velY, this.velX);
|
|
2022
|
+
t = 1 + r * Math.abs(Math.cos(n)), e = 1 - r * 0.6 * Math.abs(Math.cos(n)), Math.abs(Math.sin(n)) > Math.abs(Math.cos(n)) && (e = 1 + r * Math.abs(Math.sin(n)), t = 1 - r * 0.6 * Math.abs(Math.sin(n))), i = Math.atan2(this.velY, this.velX) * 0.04;
|
|
1732
2023
|
}
|
|
1733
2024
|
this.onUpdate({
|
|
1734
2025
|
offsetX: this.posX,
|
|
@@ -1743,17 +2034,17 @@ class zt {
|
|
|
1743
2034
|
this.rafId !== null && cancelAnimationFrame(this.rafId), this.el.removeEventListener("mousedown", this.handlePointerDown), window.removeEventListener("mousemove", this.handlePointerMove), window.removeEventListener("mouseup", this.handlePointerUp), this.el.removeEventListener("touchstart", this.handleTouchDown), window.removeEventListener("touchmove", this.handleTouchMove), window.removeEventListener("touchend", this.handleTouchUp);
|
|
1744
2035
|
}
|
|
1745
2036
|
}
|
|
1746
|
-
function
|
|
2037
|
+
function lo() {
|
|
1747
2038
|
return typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1748
2039
|
}
|
|
1749
|
-
function
|
|
2040
|
+
function co(o) {
|
|
1750
2041
|
if (typeof window > "u" || !window.matchMedia)
|
|
1751
2042
|
return () => {
|
|
1752
2043
|
};
|
|
1753
2044
|
const t = window.matchMedia("(prefers-reduced-motion: reduce)"), e = (i) => o(i.matches);
|
|
1754
2045
|
return t.addEventListener ? (t.addEventListener("change", e), () => t.removeEventListener("change", e)) : (t.addListener(e), () => t.removeListener(e));
|
|
1755
2046
|
}
|
|
1756
|
-
function
|
|
2047
|
+
function ho(o) {
|
|
1757
2048
|
let t = o.trim().replace("#", "");
|
|
1758
2049
|
if (t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6) {
|
|
1759
2050
|
const e = parseInt(t, 16);
|
|
@@ -1761,22 +2052,22 @@ function Lt(o) {
|
|
|
1761
2052
|
}
|
|
1762
2053
|
return [0, 0, 0];
|
|
1763
2054
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const [t, e, i] =
|
|
1766
|
-
return 0.2126 *
|
|
2055
|
+
function it(o) {
|
|
2056
|
+
const [t, e, i] = ho(o), a = (f) => f <= 0.03928 ? f / 12.92 : Math.pow((f + 0.055) / 1.055, 2.4), r = a(t), n = a(e), c = a(i);
|
|
2057
|
+
return 0.2126 * r + 0.7152 * n + 0.0722 * c;
|
|
1767
2058
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const e =
|
|
1770
|
-
return (
|
|
2059
|
+
function uo(o, t) {
|
|
2060
|
+
const e = it(o), i = it(t), a = Math.max(e, i), r = Math.min(e, i);
|
|
2061
|
+
return (a + 0.05) / (r + 0.05);
|
|
1771
2062
|
}
|
|
1772
|
-
function
|
|
1773
|
-
const i =
|
|
2063
|
+
function Go(o, t, e = 3) {
|
|
2064
|
+
const i = uo(o, t);
|
|
1774
2065
|
return {
|
|
1775
2066
|
ratio: Number(i.toFixed(2)),
|
|
1776
2067
|
passes: i >= e
|
|
1777
2068
|
};
|
|
1778
2069
|
}
|
|
1779
|
-
const
|
|
2070
|
+
const Wo = {
|
|
1780
2071
|
// Emociones positivas & energía
|
|
1781
2072
|
happy: { baseColor: "#F7C6CE", strokeColor: "#1c1917" },
|
|
1782
2073
|
excited: { baseColor: "#FFD54F", strokeColor: "#1c1917" },
|
|
@@ -1814,7 +2105,7 @@ const ro = {
|
|
|
1814
2105
|
waking: { baseColor: "#FFF59D", strokeColor: "#F57F17" },
|
|
1815
2106
|
spawning: { baseColor: "#E1BEE7", strokeColor: "#4A148C" }
|
|
1816
2107
|
};
|
|
1817
|
-
function
|
|
2108
|
+
function st(o) {
|
|
1818
2109
|
let t = o.trim().replace("#", "");
|
|
1819
2110
|
t.length === 3 && (t = t.split("").map((i) => i + i).join(""));
|
|
1820
2111
|
const e = parseInt(t, 16);
|
|
@@ -1824,35 +2115,35 @@ function Be(o) {
|
|
|
1824
2115
|
b: e & 255
|
|
1825
2116
|
};
|
|
1826
2117
|
}
|
|
1827
|
-
function
|
|
1828
|
-
const i =
|
|
1829
|
-
return `#${
|
|
2118
|
+
function mo(o, t, e) {
|
|
2119
|
+
const i = st(o), a = st(t), r = Math.max(0, Math.min(1, e)), n = Math.round(i.r + (a.r - i.r) * r), c = Math.round(i.g + (a.g - i.g) * r), f = Math.round(i.b + (a.b - i.b) * r), y = (d) => d.toString(16).padStart(2, "0");
|
|
2120
|
+
return `#${y(n)}${y(c)}${y(f)}`;
|
|
1830
2121
|
}
|
|
1831
|
-
function
|
|
2122
|
+
function Oo(o, t) {
|
|
1832
2123
|
return {
|
|
1833
2124
|
baseColor: t,
|
|
1834
2125
|
strokeColor: "#1c1917"
|
|
1835
2126
|
};
|
|
1836
2127
|
}
|
|
1837
|
-
function
|
|
2128
|
+
function U(o, t, e) {
|
|
1838
2129
|
const i = o / t % 1;
|
|
1839
2130
|
return i < e ? Math.sin(i / e * Math.PI) : 0;
|
|
1840
2131
|
}
|
|
1841
|
-
const
|
|
2132
|
+
const nt = {
|
|
1842
2133
|
// Mochi — saltitos alegres, mejillas que florecen en el apogeo
|
|
1843
2134
|
bouncy(o, t, e, i) {
|
|
1844
|
-
const
|
|
1845
|
-
o.bob +=
|
|
2135
|
+
const a = Math.abs(Math.sin(t * e));
|
|
2136
|
+
o.bob += a * i - i * 0.5, o.cheek += a * 0.15, o.eyeScale += a * 0.04, o.turnAngle += Math.sin(t * e * 0.5) * 0.05;
|
|
1846
2137
|
},
|
|
1847
2138
|
// Zumi — aleteo rápido lateral, entrecierra los ojos por el zumbido
|
|
1848
2139
|
flutter(o, t, e, i) {
|
|
1849
|
-
const
|
|
1850
|
-
o.shiftX +=
|
|
2140
|
+
const a = Math.sin(t * e);
|
|
2141
|
+
o.shiftX += a * i, o.bob += Math.cos(t * e * 0.7) * i * 0.5, o.turnAngle += a * 0.06, o.eyeScale -= Math.abs(a) * 0.03;
|
|
1851
2142
|
},
|
|
1852
2143
|
// Suri — respiración profunda y lenta, inclinación que va por detrás
|
|
1853
2144
|
serene(o, t, e, i) {
|
|
1854
|
-
const
|
|
1855
|
-
o.bob +=
|
|
2145
|
+
const a = Math.sin(t * e);
|
|
2146
|
+
o.bob += a * i, o.eyeScale += a * 0.05, o.cheek += (a + 1) * 0.06, o.turnAngle += Math.sin(t * e * 0.4 - 0.6) * 0.045;
|
|
1856
2147
|
},
|
|
1857
2148
|
// Nima — deriva fantasmal en ocho (frecuencias 2:1)
|
|
1858
2149
|
float(o, t, e, i) {
|
|
@@ -1860,18 +2151,18 @@ const je = {
|
|
|
1860
2151
|
},
|
|
1861
2152
|
// Cota — respiración mínima y mirada que divaga sin rumbo
|
|
1862
2153
|
calm(o, t, e, i) {
|
|
1863
|
-
const
|
|
1864
|
-
o.bob +=
|
|
2154
|
+
const a = Math.sin(t * e);
|
|
2155
|
+
o.bob += a * i, o.eyeScale += a * 0.025, o.gazeX += Math.sin(t * e * 0.23) * 2.5, o.turnAngle += Math.sin(t * e * 0.31) * 0.03;
|
|
1865
2156
|
},
|
|
1866
2157
|
// Dozy — cabecea hasta dormirse y despierta de golpe
|
|
1867
2158
|
droop(o, t, e, i) {
|
|
1868
|
-
const
|
|
1869
|
-
o.bob +=
|
|
2159
|
+
const a = t * e * 0.18 % 1, r = a < 0.82 ? a / 0.82 : 1 - (a - 0.82) / 0.18;
|
|
2160
|
+
o.bob += r * i * 2.2, o.eyeOpen = Math.max(0, o.eyeOpen - r * 0.45), o.browY += r * 2, o.turnAngle += r * 0.12;
|
|
1870
2161
|
},
|
|
1871
2162
|
// Lumo — respiración entrecortada del llanto, mirada baja
|
|
1872
2163
|
sob(o, t, e, i) {
|
|
1873
|
-
const
|
|
1874
|
-
o.bob +=
|
|
2164
|
+
const a = Math.sin(t * e) + Math.sin(t * e * 2.7) * 0.4;
|
|
2165
|
+
o.bob += a * i, o.browY += 1 + Math.sin(t * e) * 0.8, o.gazeY += 1.5, o.mouthCurve -= 0.05 + Math.abs(Math.sin(t * e)) * 0.05;
|
|
1875
2166
|
},
|
|
1876
2167
|
// Fidge — temblor nervioso y mirada que se dispara de un lado a otro
|
|
1877
2168
|
jitter(o, t, e, i) {
|
|
@@ -1879,13 +2170,13 @@ const je = {
|
|
|
1879
2170
|
},
|
|
1880
2171
|
// Brix — rumor contenido que estalla en llamaradas puntuales
|
|
1881
2172
|
fiery(o, t, e, i) {
|
|
1882
|
-
const
|
|
1883
|
-
o.bob +=
|
|
2173
|
+
const a = Math.sin(t * e * 3.1) * 0.35, r = Math.pow(Math.max(0, Math.sin(t * e * 0.35)), 6);
|
|
2174
|
+
o.bob += a * i - r * i * 1.8, o.shiftX += a * i * 0.5, o.eyeScale += r * 0.18, o.browY -= r * 2.5, o.browTilt -= r * 0.25;
|
|
1884
2175
|
},
|
|
1885
2176
|
// Wilt — se desinfla y se vuelve a inflar, resignado
|
|
1886
2177
|
wilt(o, t, e, i) {
|
|
1887
|
-
const
|
|
1888
|
-
o.bob +=
|
|
2178
|
+
const a = (Math.sin(t * e * 0.6) + 1) / 2;
|
|
2179
|
+
o.bob += a * i * 1.8, o.mouthCurve -= a * 0.12, o.browY += a * 1.6, o.eyeScale -= a * 0.05;
|
|
1889
2180
|
},
|
|
1890
2181
|
// Knot — bamboleo circular con la cabeza rodando
|
|
1891
2182
|
dizzy(o, t, e, i) {
|
|
@@ -1893,36 +2184,36 @@ const je = {
|
|
|
1893
2184
|
},
|
|
1894
2185
|
// Snug — respiración profunda de sueño, párpados pesados
|
|
1895
2186
|
snooze(o, t, e, i) {
|
|
1896
|
-
const
|
|
1897
|
-
o.bob +=
|
|
2187
|
+
const a = Math.sin(t * e);
|
|
2188
|
+
o.bob += a * i * 1.6, o.eyeScale += a * 0.06, o.eyeOpen *= 0.35, o.cheek += (a + 1) * 0.05, o.turnAngle += Math.sin(t * e - 0.8) * 0.05;
|
|
1898
2189
|
},
|
|
1899
2190
|
// Pip — sobresaltos secos; entre uno y otro aguanta la respiración con tensión
|
|
1900
2191
|
pop(o, t, e, i) {
|
|
1901
|
-
const
|
|
1902
|
-
o.bob +=
|
|
2192
|
+
const a = U(t, 1 / (e * 0.1), 0.18), r = Math.sin(t * e * 1.6) * 0.18;
|
|
2193
|
+
o.bob += r * i - a * i * 2.2, o.eyeScale += r * 0.02 + a * 0.22, o.browY -= a * 3, o.mouthOpen += a * 0.25;
|
|
1903
2194
|
},
|
|
1904
2195
|
// Void — casi inmóvil, con micro-fallos tipo glitch
|
|
1905
2196
|
drift(o, t, e, i) {
|
|
1906
2197
|
o.bob += Math.sin(t * e) * i * 0.6;
|
|
1907
|
-
const
|
|
1908
|
-
o.shiftX +=
|
|
2198
|
+
const a = U(t, 3.7, 0.04);
|
|
2199
|
+
o.shiftX += a * (Math.random() - 0.5) * 5, o.gazeX += a * (Math.random() - 0.5) * 6, o.eyeScale -= a * 0.08;
|
|
1909
2200
|
}
|
|
1910
2201
|
};
|
|
1911
|
-
function
|
|
1912
|
-
(
|
|
2202
|
+
function yo(o, t, e, i, a, r = 1) {
|
|
2203
|
+
(nt[o] || nt.calm)(t, e, i, a * r);
|
|
1913
2204
|
}
|
|
1914
|
-
const
|
|
2205
|
+
const po = {
|
|
1915
2206
|
// ── Ciclo de vida ──────────────────────────────────────────────────
|
|
1916
2207
|
sleeping(o, t) {
|
|
1917
2208
|
const e = Math.sin(t * 0.9);
|
|
1918
|
-
o.eyeOpen = 0.05, o.bob += e * 2.4, o.eyeScale += e * 0.04, o.bob +=
|
|
2209
|
+
o.eyeOpen = 0.05, o.bob += e * 2.4, o.eyeScale += e * 0.04, o.bob += U(t, 9, 0.15) * 1.8;
|
|
1919
2210
|
},
|
|
1920
2211
|
waking(o, t) {
|
|
1921
|
-
const e =
|
|
2212
|
+
const e = U(t, 4, 0.4);
|
|
1922
2213
|
o.bob += Math.sin(t * 2.2) * 1.6 - e * 3, o.eyeOpen = Math.min(1, 0.35 + e * 0.65), o.eyeScale += e * 0.1, o.turnAngle += Math.sin(t * 1.1) * 0.06;
|
|
1923
2214
|
},
|
|
1924
2215
|
listening(o, t) {
|
|
1925
|
-
o.turnAngle += 0.1 + Math.sin(t * 1.4) * 0.03, o.bob +=
|
|
2216
|
+
o.turnAngle += 0.1 + Math.sin(t * 1.4) * 0.03, o.bob += U(t, 2.6, 0.25) * 2.2, o.eyeScale += 0.06, o.gazeY -= 0.8;
|
|
1926
2217
|
},
|
|
1927
2218
|
thinking(o, t) {
|
|
1928
2219
|
o.gazeX += -6 + Math.sin(t * 0.9) * 3, o.gazeY += -4 + Math.cos(t * 0.7) * 2, o.browY -= 1 + Math.sin(t * 1.3) * 0.8, o.turnAngle += Math.sin(t * 0.6) * 0.05;
|
|
@@ -1945,12 +2236,12 @@ const Wt = {
|
|
|
1945
2236
|
},
|
|
1946
2237
|
angry(o, t) {
|
|
1947
2238
|
o.shiftX += (Math.random() - 0.5) * 3, o.bob += (Math.random() - 0.5) * 2;
|
|
1948
|
-
const e =
|
|
2239
|
+
const e = U(t, 2.2, 0.3);
|
|
1949
2240
|
o.browY -= e * 2, o.browTilt -= e * 0.2;
|
|
1950
2241
|
},
|
|
1951
2242
|
drowsy(o, t) {
|
|
1952
2243
|
const e = (Math.sin(t * 0.8) + 1) / 2;
|
|
1953
|
-
o.bob += e * 3, o.eyeOpen = Math.max(0.08, 0.5 - e * 0.4), o.eyeOpen +=
|
|
2244
|
+
o.bob += e * 3, o.eyeOpen = Math.max(0.08, 0.5 - e * 0.4), o.eyeOpen += U(t, 6.5, 0.08) * 0.5, o.browY += e * 2;
|
|
1954
2245
|
},
|
|
1955
2246
|
happy(o, t) {
|
|
1956
2247
|
o.bob += -Math.abs(Math.sin(t * 3.2)) * 2.4, o.cheek += 0.15 + Math.abs(Math.sin(t * 3.2)) * 0.1, o.turnAngle += Math.sin(t * 1.6) * 0.05;
|
|
@@ -1962,7 +2253,7 @@ const Wt = {
|
|
|
1962
2253
|
o.turnAngle += Math.sin(t * 0.9) * 0.16, o.shiftX += Math.sin(t * 0.9) * 1.8, o.browTilt += 0.15 + Math.sin(t * 1.7) * 0.1, o.gazeX += Math.sin(t * 0.6) * 4;
|
|
1963
2254
|
},
|
|
1964
2255
|
bored(o, t) {
|
|
1965
|
-
o.shiftX += Math.sin(t * 0.5) * 2.2, o.gazeX += 6 + Math.sin(t * 0.3) * 3, o.eyeOpen = Math.min(o.eyeOpen, 0.5), o.bob +=
|
|
2256
|
+
o.shiftX += Math.sin(t * 0.5) * 2.2, o.gazeX += 6 + Math.sin(t * 0.3) * 3, o.eyeOpen = Math.min(o.eyeOpen, 0.5), o.bob += U(t, 7, 0.2) * 2;
|
|
1966
2257
|
},
|
|
1967
2258
|
proud(o, t) {
|
|
1968
2259
|
o.bob += -2 + Math.sin(t * 1.1) * 0.8, o.turnAngle += Math.sin(t * 0.7) * 0.04, o.gazeY -= 2, o.cheek += 0.1;
|
|
@@ -2015,11 +2306,11 @@ const Wt = {
|
|
|
2015
2306
|
o.gazeY += 4, o.gazeX += Math.sin(t * 4.5) * 5, o.bob += Math.abs(Math.sin(t * 4.5)) * 1.2;
|
|
2016
2307
|
},
|
|
2017
2308
|
sending(o, t) {
|
|
2018
|
-
const e =
|
|
2309
|
+
const e = U(t, 1.6, 0.3);
|
|
2019
2310
|
o.shiftX += e * 4, o.bob += -e * 2, o.turnAngle += e * 0.08;
|
|
2020
2311
|
},
|
|
2021
2312
|
receiving(o, t) {
|
|
2022
|
-
const e =
|
|
2313
|
+
const e = U(t, 1.6, 0.3);
|
|
2023
2314
|
o.shiftX += -e * 4, o.bob += e * 1.5, o.eyeScale += e * 0.12;
|
|
2024
2315
|
},
|
|
2025
2316
|
uploading(o, t) {
|
|
@@ -2027,7 +2318,7 @@ const Wt = {
|
|
|
2027
2318
|
o.bob += e * 4 - 2, o.gazeY -= 2, o.eyeScale += (1 - e) * 0.05;
|
|
2028
2319
|
},
|
|
2029
2320
|
notifying(o, t) {
|
|
2030
|
-
const e =
|
|
2321
|
+
const e = U(t, 2.4, 0.12) + U(t - 0.22, 2.4, 0.12);
|
|
2031
2322
|
o.bob += -e * 4, o.eyeScale += e * 0.12, o.turnAngle += e * 0.06;
|
|
2032
2323
|
},
|
|
2033
2324
|
alerting(o, t) {
|
|
@@ -2041,45 +2332,45 @@ const Wt = {
|
|
|
2041
2332
|
},
|
|
2042
2333
|
"powering-down"(o, t) {
|
|
2043
2334
|
const e = Math.min(1, t % 8 / 8);
|
|
2044
|
-
o.bob += e * 4, o.eyeOpen = Math.max(0.03, 0.4 - e * 0.37), o.eyeOpen +=
|
|
2335
|
+
o.bob += e * 4, o.eyeOpen = Math.max(0.03, 0.4 - e * 0.37), o.eyeOpen += U(t, 2.7, 0.05) * 0.3, o.eyeScale -= e * 0.1;
|
|
2045
2336
|
}
|
|
2046
2337
|
};
|
|
2047
|
-
function
|
|
2048
|
-
const
|
|
2049
|
-
return
|
|
2338
|
+
function fo(o, t, e, i, a) {
|
|
2339
|
+
const r = po[o];
|
|
2340
|
+
return r ? (r(t, e, i, a), !0) : !1;
|
|
2050
2341
|
}
|
|
2051
|
-
const
|
|
2052
|
-
function
|
|
2342
|
+
const $o = 600;
|
|
2343
|
+
function bo(o) {
|
|
2053
2344
|
let t = null, e = !1;
|
|
2054
2345
|
const i = () => {
|
|
2055
2346
|
t !== null && (clearTimeout(t), t = null), e = !1;
|
|
2056
2347
|
};
|
|
2057
|
-
return { play: (
|
|
2058
|
-
if (i(),
|
|
2059
|
-
const
|
|
2348
|
+
return { play: (r, n = {}) => {
|
|
2349
|
+
if (i(), r.length === 0) return;
|
|
2350
|
+
const c = n.mode ?? "once";
|
|
2060
2351
|
e = !0;
|
|
2061
|
-
let
|
|
2352
|
+
let f = 0, y = 1;
|
|
2062
2353
|
const d = () => {
|
|
2063
2354
|
if (!e) return;
|
|
2064
|
-
const
|
|
2065
|
-
o.applyStep(o.resolveStep(
|
|
2066
|
-
var
|
|
2067
|
-
if (
|
|
2068
|
-
|
|
2069
|
-
else if (
|
|
2070
|
-
if (
|
|
2071
|
-
|
|
2355
|
+
const x = r[f];
|
|
2356
|
+
o.applyStep(o.resolveStep(x)), t = setTimeout(() => {
|
|
2357
|
+
var M;
|
|
2358
|
+
if (c === "ping-pong")
|
|
2359
|
+
r.length > 1 && ((f + y >= r.length || f + y < 0) && (y = -y), f += y);
|
|
2360
|
+
else if (f += 1, f >= r.length)
|
|
2361
|
+
if (c === "loop")
|
|
2362
|
+
f = 0;
|
|
2072
2363
|
else {
|
|
2073
|
-
i(), (
|
|
2364
|
+
i(), (M = n.onComplete) == null || M.call(n);
|
|
2074
2365
|
return;
|
|
2075
2366
|
}
|
|
2076
2367
|
d();
|
|
2077
|
-
},
|
|
2368
|
+
}, x.duration ?? $o);
|
|
2078
2369
|
};
|
|
2079
2370
|
d();
|
|
2080
2371
|
}, stop: i, isPlaying: () => e };
|
|
2081
2372
|
}
|
|
2082
|
-
const
|
|
2373
|
+
const pt = [
|
|
2083
2374
|
{
|
|
2084
2375
|
label: "Interacción",
|
|
2085
2376
|
states: ["idle", "near", "hover", "click"]
|
|
@@ -2132,50 +2423,50 @@ const Ve = [
|
|
|
2132
2423
|
"powering-down"
|
|
2133
2424
|
]
|
|
2134
2425
|
}
|
|
2135
|
-
],
|
|
2136
|
-
(o) => !
|
|
2426
|
+
], go = pt.flatMap((o) => o.states), xo = ["idle", "near", "hover", "click"], Mo = pt.find((o) => o.label === "Reacciones").states, Fo = go.filter(
|
|
2427
|
+
(o) => !xo.includes(o)
|
|
2137
2428
|
);
|
|
2138
|
-
function
|
|
2139
|
-
return o ?? t ??
|
|
2429
|
+
function ko(o, t) {
|
|
2430
|
+
return o ?? t ?? Mo;
|
|
2140
2431
|
}
|
|
2141
|
-
function
|
|
2432
|
+
function vo(o, t) {
|
|
2142
2433
|
if (o.length <= 1) return o[0];
|
|
2143
2434
|
let e = o[Math.floor(Math.random() * o.length)];
|
|
2144
2435
|
for (; e === t; )
|
|
2145
2436
|
e = o[Math.floor(Math.random() * o.length)];
|
|
2146
2437
|
return e;
|
|
2147
2438
|
}
|
|
2148
|
-
class
|
|
2439
|
+
class Co {
|
|
2149
2440
|
constructor(t = [], e = {}) {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2441
|
+
v(this, "instances", /* @__PURE__ */ new Map());
|
|
2442
|
+
v(this, "options");
|
|
2443
|
+
v(this, "connectedPairs", /* @__PURE__ */ new Map());
|
|
2444
|
+
v(this, "isRunning", !1);
|
|
2445
|
+
v(this, "update", () => {
|
|
2155
2446
|
const t = Array.from(this.instances.values());
|
|
2156
2447
|
if (t.length < 2) return;
|
|
2157
2448
|
const e = /* @__PURE__ */ new Set();
|
|
2158
2449
|
for (let i = 0; i < t.length; i++)
|
|
2159
|
-
for (let
|
|
2160
|
-
const
|
|
2161
|
-
if (
|
|
2162
|
-
const
|
|
2163
|
-
if (e.add(
|
|
2164
|
-
const
|
|
2165
|
-
|
|
2450
|
+
for (let a = i + 1; a < t.length; a++) {
|
|
2451
|
+
const r = t[i], n = t[a], c = r.getPosition(), f = n.getPosition(), y = f.x - c.x, d = f.y - c.y, x = Math.hypot(y, d);
|
|
2452
|
+
if (x <= this.options.proximityThreshold && x > 0) {
|
|
2453
|
+
const M = this.getPairKey(r.id, n.id);
|
|
2454
|
+
if (e.add(M), this.options.enableGazeSync) {
|
|
2455
|
+
const E = Math.max(-0.8, Math.min(0.8, y / 160)) * 22, R = Math.max(-0.8, Math.min(0.8, d / 160)) * 14;
|
|
2456
|
+
r.setGaze({ x: E, y: R }), n.setGaze({ x: -E, y: -R });
|
|
2166
2457
|
}
|
|
2167
|
-
let
|
|
2168
|
-
|
|
2169
|
-
idA:
|
|
2170
|
-
idB:
|
|
2458
|
+
let T = this.connectedPairs.get(M);
|
|
2459
|
+
T ? Math.random() < 0.08 && this.options.enableSynergies && (r.triggerParticles(1), n.triggerParticles(1)) : (T = {
|
|
2460
|
+
idA: r.id,
|
|
2461
|
+
idB: n.id,
|
|
2171
2462
|
connectedSince: Date.now()
|
|
2172
|
-
}, this.connectedPairs.set(
|
|
2463
|
+
}, this.connectedPairs.set(M, T), this.triggerSynergy(r, n));
|
|
2173
2464
|
}
|
|
2174
2465
|
}
|
|
2175
|
-
for (const [i,
|
|
2466
|
+
for (const [i, a] of this.connectedPairs.entries())
|
|
2176
2467
|
if (!e.has(i)) {
|
|
2177
|
-
const
|
|
2178
|
-
|
|
2468
|
+
const r = this.instances.get(a.idA), n = this.instances.get(a.idB);
|
|
2469
|
+
r && r.setGaze({ x: 0, y: 0 }), n && n.setGaze({ x: 0, y: 0 }), this.connectedPairs.delete(i);
|
|
2179
2470
|
}
|
|
2180
2471
|
});
|
|
2181
2472
|
this.options = {
|
|
@@ -2191,10 +2482,10 @@ class Vt {
|
|
|
2191
2482
|
!t || !t.id || this.instances.delete(t.id);
|
|
2192
2483
|
}
|
|
2193
2484
|
start() {
|
|
2194
|
-
this.isRunning || (this.isRunning = !0,
|
|
2485
|
+
this.isRunning || (this.isRunning = !0, B.add(this.update));
|
|
2195
2486
|
}
|
|
2196
2487
|
stop() {
|
|
2197
|
-
this.isRunning && (this.isRunning = !1,
|
|
2488
|
+
this.isRunning && (this.isRunning = !1, B.remove(this.update));
|
|
2198
2489
|
}
|
|
2199
2490
|
getPairKey(t, e) {
|
|
2200
2491
|
return t < e ? `${t}:${e}` : `${e}:${t}`;
|
|
@@ -2204,40 +2495,40 @@ class Vt {
|
|
|
2204
2495
|
*/
|
|
2205
2496
|
triggerSynergy(t, e) {
|
|
2206
2497
|
if (!this.options.enableSynergies) return;
|
|
2207
|
-
const i = t.emotionCategory || "happy",
|
|
2208
|
-
if (
|
|
2498
|
+
const i = t.emotionCategory || "happy", a = e.emotionCategory || "happy";
|
|
2499
|
+
if (oe.playSound(i, "hover"), t.triggerParticles(6), e.triggerParticles(6), i === "happy" && a === "happy")
|
|
2209
2500
|
t.bounce(), e.bounce();
|
|
2210
|
-
else if (i === "happy" &&
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2213
|
-
} else (i === "intense" ||
|
|
2501
|
+
else if (i === "happy" && a === "sad" || i === "sad" && a === "happy") {
|
|
2502
|
+
const r = i === "happy" ? t : e, n = i === "sad" ? t : e;
|
|
2503
|
+
r.setEmotion("hover"), n.setEmotion("near");
|
|
2504
|
+
} else (i === "intense" || a === "intense") && (t.spin(0.5), e.spin(0.5));
|
|
2214
2505
|
}
|
|
2215
2506
|
destroy() {
|
|
2216
2507
|
this.stop(), this.instances.clear(), this.connectedPairs.clear();
|
|
2217
2508
|
}
|
|
2218
2509
|
}
|
|
2219
|
-
function
|
|
2220
|
-
return new
|
|
2510
|
+
function wo(o = [], t = {}) {
|
|
2511
|
+
return new Co(o, t);
|
|
2221
2512
|
}
|
|
2222
|
-
const
|
|
2223
|
-
function
|
|
2513
|
+
const ft = "wissive:custom:";
|
|
2514
|
+
function To(o) {
|
|
2224
2515
|
const t = {};
|
|
2225
2516
|
for (const e in o)
|
|
2226
2517
|
t[e] = o[e].map((i) => ({ ...i }));
|
|
2227
2518
|
return t;
|
|
2228
2519
|
}
|
|
2229
|
-
function
|
|
2230
|
-
var
|
|
2231
|
-
const e = t.eyesFrom ?
|
|
2232
|
-
for (const
|
|
2233
|
-
const
|
|
2234
|
-
|
|
2235
|
-
...
|
|
2236
|
-
...
|
|
2237
|
-
...
|
|
2238
|
-
mouthType:
|
|
2239
|
-
mouthCurve:
|
|
2240
|
-
mouthWidth:
|
|
2520
|
+
function So(o, t = {}) {
|
|
2521
|
+
var y, d, x;
|
|
2522
|
+
const e = t.eyesFrom ? ne[t.eyesFrom] : void 0, i = t.mouthFrom ? ne[t.mouthFrom] : void 0, a = t.motionFrom ? ne[t.motionFrom] : void 0, r = t.particlesFrom ? ne[t.particlesFrom] : void 0, n = t.soundFrom ? ne[t.soundFrom] : void 0, c = To(De.expressions);
|
|
2523
|
+
for (const M in c) {
|
|
2524
|
+
const T = e && (((y = e.expressions[M]) == null ? void 0 : y[0]) ?? e.expressions.idle[0]), E = i && (((d = i.expressions[M]) == null ? void 0 : d[0]) ?? i.expressions.idle[0]);
|
|
2525
|
+
c[M] = c[M].map((R) => ({
|
|
2526
|
+
...R,
|
|
2527
|
+
...T && { eyeType: T.eyeType, eyeScale: T.eyeScale },
|
|
2528
|
+
...E && {
|
|
2529
|
+
mouthType: E.mouthType,
|
|
2530
|
+
mouthCurve: E.mouthCurve,
|
|
2531
|
+
mouthWidth: E.mouthWidth
|
|
2241
2532
|
},
|
|
2242
2533
|
// Los overrides van al final y ganan: son para los tipos nuevos que
|
|
2243
2534
|
// ningún personaje del catálogo tiene todavía, así que no hay un
|
|
@@ -2246,36 +2537,36 @@ function Jt(o, t = {}) {
|
|
|
2246
2537
|
...t.mouthTypeOverride !== void 0 && { mouthType: t.mouthTypeOverride }
|
|
2247
2538
|
}));
|
|
2248
2539
|
}
|
|
2249
|
-
const
|
|
2540
|
+
const f = (x = t.stateBank) == null ? void 0 : x.filter((M) => Fo.includes(M));
|
|
2250
2541
|
return {
|
|
2251
2542
|
name: o,
|
|
2252
2543
|
emotion: "custom",
|
|
2253
|
-
baseColor: t.baseColor ||
|
|
2544
|
+
baseColor: t.baseColor || De.baseColor,
|
|
2254
2545
|
silhouette: t.silhouette || "circle",
|
|
2255
|
-
motion:
|
|
2256
|
-
expressions:
|
|
2257
|
-
particleEmotion:
|
|
2258
|
-
soundEmotion:
|
|
2259
|
-
|
|
2546
|
+
motion: a ? { ...a.motion } : { ...De.motion },
|
|
2547
|
+
expressions: c,
|
|
2548
|
+
particleEmotion: r == null ? void 0 : r.emotion,
|
|
2549
|
+
soundEmotion: n == null ? void 0 : n.emotion,
|
|
2550
|
+
...f && f.length > 0 && { autonomousStatePool: f }
|
|
2260
2551
|
};
|
|
2261
2552
|
}
|
|
2262
|
-
function
|
|
2263
|
-
localStorage.setItem(
|
|
2553
|
+
function Yo(o, t) {
|
|
2554
|
+
localStorage.setItem(ft + o, JSON.stringify(t));
|
|
2264
2555
|
}
|
|
2265
|
-
function
|
|
2266
|
-
const t = localStorage.getItem(
|
|
2556
|
+
function Bo(o) {
|
|
2557
|
+
const t = localStorage.getItem(ft + o);
|
|
2267
2558
|
return t ? JSON.parse(t) : null;
|
|
2268
2559
|
}
|
|
2269
|
-
function
|
|
2270
|
-
const e =
|
|
2271
|
-
return
|
|
2560
|
+
function jo(o, t = {}) {
|
|
2561
|
+
const e = So(o, t);
|
|
2562
|
+
return ne[o] = e, Yo(o, e), e;
|
|
2272
2563
|
}
|
|
2273
|
-
const
|
|
2564
|
+
const Eo = {
|
|
2274
2565
|
idle: 1,
|
|
2275
2566
|
near: 0.7,
|
|
2276
2567
|
hover: 0.5,
|
|
2277
2568
|
click: 0.35
|
|
2278
|
-
},
|
|
2569
|
+
}, Ao = {
|
|
2279
2570
|
xs: 48,
|
|
2280
2571
|
sm: 80,
|
|
2281
2572
|
base: 120,
|
|
@@ -2283,405 +2574,439 @@ const eo = {
|
|
|
2283
2574
|
xl: 200,
|
|
2284
2575
|
"2xl": 240
|
|
2285
2576
|
};
|
|
2286
|
-
function
|
|
2287
|
-
return typeof o == "number" ? o :
|
|
2577
|
+
function at(o = "base") {
|
|
2578
|
+
return typeof o == "number" ? o : Ao[o] ?? 120;
|
|
2288
2579
|
}
|
|
2289
|
-
function
|
|
2580
|
+
function zo(o, t) {
|
|
2290
2581
|
const {
|
|
2291
2582
|
target: e,
|
|
2292
2583
|
size: i = "base",
|
|
2293
|
-
interactive:
|
|
2294
|
-
draggable:
|
|
2295
|
-
nearRadius:
|
|
2296
|
-
sound:
|
|
2297
|
-
flipX:
|
|
2298
|
-
emphasis:
|
|
2584
|
+
interactive: a = !0,
|
|
2585
|
+
draggable: r = !0,
|
|
2586
|
+
nearRadius: n = 120,
|
|
2587
|
+
sound: c = !0,
|
|
2588
|
+
flipX: f = !1,
|
|
2589
|
+
emphasis: y = !1,
|
|
2299
2590
|
gazeTracking: d = !1,
|
|
2300
|
-
ambientParticles:
|
|
2301
|
-
autonomousStates:
|
|
2302
|
-
autonomousStatePool:
|
|
2303
|
-
reducedMotion:
|
|
2304
|
-
theme:
|
|
2305
|
-
} = t,
|
|
2306
|
-
let
|
|
2307
|
-
const K =
|
|
2308
|
-
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2311
|
-
const
|
|
2591
|
+
ambientParticles: x = !0,
|
|
2592
|
+
autonomousStates: M = !0,
|
|
2593
|
+
autonomousStatePool: T,
|
|
2594
|
+
reducedMotion: E = "auto",
|
|
2595
|
+
theme: R = "auto"
|
|
2596
|
+
} = t, z = et(o) || et("mochi"), Z = z.motion;
|
|
2597
|
+
let G = at(i), _ = E, he = R, xe = z.baseColor;
|
|
2598
|
+
const K = z.particleEmotion || z.emotion, W = z.soundEmotion || z.emotion, D = () => typeof _ == "boolean" ? _ : lo(), h = document.createElement("div");
|
|
2599
|
+
h.className = "wissive-wrapper", h.style.width = `${G}px`, h.style.height = `${G}px`, h.style.display = "inline-block", h.style.position = "relative";
|
|
2600
|
+
const L = document.createElement("div");
|
|
2601
|
+
L.className = "wissive-emoji", L.setAttribute("role", "img"), a && L.setAttribute("tabindex", "0");
|
|
2602
|
+
const we = {
|
|
2312
2603
|
idle: "Reposo",
|
|
2313
2604
|
near: "Cerca",
|
|
2314
2605
|
hover: "Hover",
|
|
2315
2606
|
click: "Presionado"
|
|
2316
|
-
},
|
|
2317
|
-
|
|
2607
|
+
}, Me = (p) => {
|
|
2608
|
+
L.setAttribute(
|
|
2318
2609
|
"aria-label",
|
|
2319
|
-
`${
|
|
2610
|
+
`${z.name} (${z.emotion}) emoji - Estado: ${we[p] || p}`
|
|
2320
2611
|
);
|
|
2321
2612
|
};
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2613
|
+
Me("idle"), L.style.width = `${G}px`, L.style.height = `${G}px`, L.style.display = "inline-block", L.style.userSelect = "none", L.style.cursor = a ? "pointer" : "default", L.style.willChange = "transform", L.style.transformOrigin = "center center", h.appendChild(L), e.appendChild(h);
|
|
2614
|
+
const Te = co(() => {
|
|
2615
|
+
te();
|
|
2325
2616
|
});
|
|
2326
|
-
let
|
|
2327
|
-
|
|
2328
|
-
|
|
2617
|
+
let be = f, Fe = y, de = d, ue = c, ie = r, ge = x, Se = M, ke = ko(
|
|
2618
|
+
T,
|
|
2619
|
+
z.autonomousStatePool
|
|
2329
2620
|
);
|
|
2330
|
-
const
|
|
2331
|
-
stiffness:
|
|
2332
|
-
damping:
|
|
2621
|
+
const g = new lt(), ve = z.expressions.idle, se = g.pickVariant(ve, "idle"), q = Lt(se, {
|
|
2622
|
+
stiffness: Z.stiffness,
|
|
2623
|
+
damping: Z.damping
|
|
2333
2624
|
});
|
|
2334
|
-
let
|
|
2335
|
-
const
|
|
2336
|
-
let
|
|
2625
|
+
let Y = z.silhouette, u = [...ot(Y)], m = [...u], F = [...u], We = 0, s = 400, l = !1, C = !1, S = !1, w = !1, b = Math.random() * 100, V = !1, ee = null, k = null;
|
|
2626
|
+
const P = new ao(h, G);
|
|
2627
|
+
let A = {
|
|
2337
2628
|
offsetX: 0,
|
|
2338
2629
|
offsetY: 0,
|
|
2339
2630
|
scaleX: 1,
|
|
2340
2631
|
scaleY: 1,
|
|
2341
2632
|
rotation: 0
|
|
2342
|
-
},
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
(
|
|
2347
|
-
|
|
2633
|
+
}, J = null;
|
|
2634
|
+
const me = () => {
|
|
2635
|
+
J || (J = new ro(
|
|
2636
|
+
L,
|
|
2637
|
+
(p) => {
|
|
2638
|
+
A = p, ye();
|
|
2348
2639
|
},
|
|
2349
2640
|
{
|
|
2350
2641
|
onDragStart: () => {
|
|
2351
|
-
|
|
2642
|
+
ue && oe.playSound(W, "click");
|
|
2352
2643
|
},
|
|
2353
2644
|
onDragEnd: () => {
|
|
2354
|
-
|
|
2645
|
+
P.burst(K, 10), ue && oe.playSound(W, "bounce");
|
|
2355
2646
|
}
|
|
2356
2647
|
}
|
|
2357
2648
|
));
|
|
2358
2649
|
};
|
|
2359
|
-
|
|
2360
|
-
const
|
|
2361
|
-
const
|
|
2362
|
-
let
|
|
2363
|
-
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2366
|
-
},
|
|
2367
|
-
const
|
|
2368
|
-
let
|
|
2369
|
-
if (typeof
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2650
|
+
ie && a && me();
|
|
2651
|
+
const ye = () => {
|
|
2652
|
+
const p = D(), X = p ? 0 : Z.idleSpeed * 0.35, O = p ? 0 : 0.04, H = 1 + O * Math.cos(b * X), Q = 1 - O * Math.sin(b * X), fe = A.offsetX !== 0 || A.offsetY !== 0 || A.scaleX !== 1 || A.scaleY !== 1;
|
|
2653
|
+
let je, Re, Ze;
|
|
2654
|
+
fe ? (je = H * A.scaleX, Re = Q * A.scaleY, Ze = A.rotation) : (je = H, Re = Q, Ze = 0);
|
|
2655
|
+
const bt = A.offsetX, gt = A.offsetY;
|
|
2656
|
+
L.style.transform = `translate(${bt.toFixed(1)}px, ${gt.toFixed(1)}px) rotate(${(Ze * 180 / Math.PI).toFixed(2)}deg) scale(${je.toFixed(4)}, ${Re.toFixed(4)})`;
|
|
2657
|
+
}, te = () => {
|
|
2658
|
+
const p = q.getValues(), X = g.getState();
|
|
2659
|
+
let O = z.baseColor;
|
|
2660
|
+
if (typeof he == "object" && he.baseColor && (O = he.baseColor), xe = mo(xe, O, 0.15), V && (p.eyeOpen = 0.05), !D() && !fo(
|
|
2661
|
+
X,
|
|
2662
|
+
p,
|
|
2663
|
+
b,
|
|
2664
|
+
Z.idleSpeed,
|
|
2665
|
+
Z.idleAmplitude
|
|
2375
2666
|
)) {
|
|
2376
|
-
const Q =
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2667
|
+
const Q = Eo[X] ?? 1;
|
|
2668
|
+
yo(
|
|
2669
|
+
Z.motionType,
|
|
2670
|
+
p,
|
|
2671
|
+
b,
|
|
2672
|
+
Z.idleSpeed,
|
|
2673
|
+
Z.idleAmplitude,
|
|
2383
2674
|
Q
|
|
2384
2675
|
);
|
|
2385
2676
|
}
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
{
|
|
2392
|
-
|
|
2677
|
+
ye(), L.innerHTML = ut(
|
|
2678
|
+
z.silhouette,
|
|
2679
|
+
xe,
|
|
2680
|
+
p,
|
|
2681
|
+
G,
|
|
2682
|
+
{
|
|
2683
|
+
flipX: be,
|
|
2684
|
+
emphasis: Fe,
|
|
2685
|
+
radii: u
|
|
2686
|
+
},
|
|
2687
|
+
b
|
|
2393
2688
|
);
|
|
2394
|
-
},
|
|
2395
|
-
|
|
2396
|
-
const
|
|
2397
|
-
if (!(!
|
|
2398
|
-
if (
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2689
|
+
}, Oe = (p = g.getState()) => {
|
|
2690
|
+
g.setState(p);
|
|
2691
|
+
const X = g.resolvePool(z.expressions, p);
|
|
2692
|
+
if (!(!X || X.length === 0)) {
|
|
2693
|
+
if (X.length === 1) {
|
|
2694
|
+
const O = g.pickVariant(X, p);
|
|
2695
|
+
q.setTargets(O), B.add(N);
|
|
2401
2696
|
return;
|
|
2402
2697
|
}
|
|
2403
|
-
|
|
2404
|
-
const
|
|
2405
|
-
|
|
2406
|
-
|
|
2698
|
+
V = !0, B.add(N), setTimeout(() => {
|
|
2699
|
+
const O = g.pickVariant(X, p);
|
|
2700
|
+
q.setTargets(O), B.add(N), setTimeout(() => {
|
|
2701
|
+
V = !1, B.add(N);
|
|
2407
2702
|
}, 120);
|
|
2408
2703
|
}, 100);
|
|
2409
2704
|
}
|
|
2410
|
-
},
|
|
2411
|
-
|
|
2412
|
-
},
|
|
2413
|
-
resolveStep(
|
|
2414
|
-
return { ...
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
) : {}, ...
|
|
2705
|
+
}, re = (p) => {
|
|
2706
|
+
Me(p), Oe(p);
|
|
2707
|
+
}, pe = bo({
|
|
2708
|
+
resolveStep(p) {
|
|
2709
|
+
return { ...p.state ? g.pickVariant(
|
|
2710
|
+
g.resolvePool(z.expressions, p.state),
|
|
2711
|
+
p.state
|
|
2712
|
+
) : {}, ...p.params };
|
|
2418
2713
|
},
|
|
2419
|
-
applyStep(
|
|
2420
|
-
|
|
2714
|
+
applyStep(p) {
|
|
2715
|
+
q.setTargets(p), B.add(N);
|
|
2716
|
+
}
|
|
2717
|
+
}), N = (p) => {
|
|
2718
|
+
b += p;
|
|
2719
|
+
const X = q.update(p);
|
|
2720
|
+
if (l) {
|
|
2721
|
+
const H = (typeof performance < "u" ? performance.now() : Date.now()) - We, Q = Math.min(1, Math.max(0, H / s)), fe = 1 - Math.pow(1 - Q, 4);
|
|
2722
|
+
u = Zt(F, m, fe), Q >= 1 && (l = !1, u = [...m]);
|
|
2421
2723
|
}
|
|
2422
|
-
|
|
2423
|
-
k += y;
|
|
2424
|
-
const F = j.update(y);
|
|
2425
|
-
ee(), !F && u.getState() !== "idle" && O.remove(N);
|
|
2724
|
+
te(), !X && !l && g.getState() !== "idle" && B.remove(N);
|
|
2426
2725
|
};
|
|
2427
|
-
|
|
2428
|
-
const
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
}, 180)),
|
|
2434
|
-
},
|
|
2726
|
+
B.add(N);
|
|
2727
|
+
const Qe = () => {
|
|
2728
|
+
const O = 3e3 + Math.random() * 4e3;
|
|
2729
|
+
k = window.setTimeout(() => {
|
|
2730
|
+
g.getState() === "idle" && !V && (V = !0, B.add(N), ee = window.setTimeout(() => {
|
|
2731
|
+
V = !1, B.add(N);
|
|
2732
|
+
}, 180)), Qe();
|
|
2733
|
+
}, O);
|
|
2435
2734
|
};
|
|
2436
|
-
|
|
2437
|
-
let
|
|
2438
|
-
const
|
|
2439
|
-
const
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
},
|
|
2735
|
+
Qe();
|
|
2736
|
+
let Ye = null;
|
|
2737
|
+
const Ve = () => {
|
|
2738
|
+
const p = Z.idleIntervalMin, X = Z.idleIntervalMax, O = p + Math.random() * (X - p);
|
|
2739
|
+
Ye = window.setTimeout(() => {
|
|
2740
|
+
g.getState() === "idle" && !pe.isPlaying() && Oe("idle"), Ve();
|
|
2741
|
+
}, O);
|
|
2443
2742
|
};
|
|
2444
|
-
|
|
2445
|
-
let
|
|
2446
|
-
const
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2449
|
-
if (
|
|
2450
|
-
const
|
|
2743
|
+
Ve();
|
|
2744
|
+
let Ee = null, Ae = null;
|
|
2745
|
+
const He = () => {
|
|
2746
|
+
const O = 3500 + Math.random() * 4500;
|
|
2747
|
+
Ee = window.setTimeout(() => {
|
|
2748
|
+
if (g.getState() === "idle" && !de && !pe.isPlaying()) {
|
|
2749
|
+
const H = [
|
|
2451
2750
|
{ x: -9, y: 0 },
|
|
2452
2751
|
{ x: 9, y: 0 },
|
|
2453
2752
|
{ x: -7, y: -4 },
|
|
2454
2753
|
{ x: 7, y: -4 },
|
|
2455
2754
|
{ x: 0, y: -5 },
|
|
2456
2755
|
{ x: 0, y: 4 }
|
|
2457
|
-
], Q =
|
|
2458
|
-
|
|
2459
|
-
const
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
},
|
|
2756
|
+
], Q = H[Math.floor(Math.random() * H.length)];
|
|
2757
|
+
q.setTargets({ gazeX: Q.x, gazeY: Q.y }), B.add(N);
|
|
2758
|
+
const fe = 1200 + Math.random() * 1500;
|
|
2759
|
+
Ae = window.setTimeout(() => {
|
|
2760
|
+
de || (q.setTargets({ gazeX: 0, gazeY: 0 }), B.add(N));
|
|
2761
|
+
}, fe);
|
|
2463
2762
|
}
|
|
2464
|
-
|
|
2465
|
-
},
|
|
2763
|
+
He();
|
|
2764
|
+
}, O);
|
|
2466
2765
|
};
|
|
2467
|
-
|
|
2468
|
-
let
|
|
2469
|
-
const
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
if (
|
|
2473
|
-
const
|
|
2474
|
-
if (
|
|
2766
|
+
He();
|
|
2767
|
+
let ze = null;
|
|
2768
|
+
const Ue = () => {
|
|
2769
|
+
const O = 3500 + Math.random() * 5e3;
|
|
2770
|
+
ze = window.setTimeout(() => {
|
|
2771
|
+
if (ge && !D()) {
|
|
2772
|
+
const H = g.getState();
|
|
2773
|
+
if (H === "idle" || H === "near" || H === "hover") {
|
|
2475
2774
|
const Q = Math.floor(2 + Math.random() * 3);
|
|
2476
|
-
|
|
2775
|
+
P.burst(K, Q);
|
|
2477
2776
|
}
|
|
2478
2777
|
}
|
|
2479
|
-
|
|
2480
|
-
},
|
|
2778
|
+
Ue();
|
|
2779
|
+
}, O);
|
|
2481
2780
|
};
|
|
2482
|
-
|
|
2483
|
-
let
|
|
2484
|
-
const
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2487
|
-
if (
|
|
2488
|
-
const Q =
|
|
2489
|
-
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
},
|
|
2781
|
+
Ue();
|
|
2782
|
+
let Pe = null, Xe = null, Je = null;
|
|
2783
|
+
const Ke = () => {
|
|
2784
|
+
const O = 5e3 + Math.random() * 6e3;
|
|
2785
|
+
Pe = window.setTimeout(() => {
|
|
2786
|
+
if (Se && ke.length > 0 && !D() && !pe.isPlaying() && g.getState() === "idle" && !C && !S && !w) {
|
|
2787
|
+
const Q = vo(ke, Je);
|
|
2788
|
+
Je = Q, re(Q);
|
|
2789
|
+
const fe = 1800 + Math.random() * 2200;
|
|
2790
|
+
Xe = window.setTimeout(() => {
|
|
2791
|
+
g.getState() === Q && !C && !S && !w && re("idle");
|
|
2792
|
+
}, fe);
|
|
2494
2793
|
}
|
|
2495
|
-
|
|
2496
|
-
},
|
|
2794
|
+
Ke();
|
|
2795
|
+
}, O);
|
|
2497
2796
|
};
|
|
2498
|
-
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2797
|
+
Ke();
|
|
2798
|
+
const $t = () => {
|
|
2799
|
+
Ye !== null && (clearTimeout(Ye), Ye = null), k !== null && (clearTimeout(k), k = null), ee !== null && (clearTimeout(ee), ee = null), Ee !== null && (clearTimeout(Ee), Ee = null), Ae !== null && (clearTimeout(Ae), Ae = null), ze !== null && (clearTimeout(ze), ze = null), Pe !== null && (clearTimeout(Pe), Pe = null), Xe !== null && (clearTimeout(Xe), Xe = null);
|
|
2501
2800
|
};
|
|
2502
|
-
let
|
|
2503
|
-
const
|
|
2504
|
-
return
|
|
2505
|
-
|
|
2801
|
+
let Be = null;
|
|
2802
|
+
const Ce = () => w ? "click" : S ? "hover" : C ? "near" : "idle";
|
|
2803
|
+
return a && (Be = eo(
|
|
2804
|
+
L,
|
|
2506
2805
|
{
|
|
2507
2806
|
onHoverStart: () => {
|
|
2508
|
-
|
|
2807
|
+
S = !0, ue && oe.playSound(W, "hover"), re(Ce());
|
|
2509
2808
|
},
|
|
2510
2809
|
onHoverEnd: () => {
|
|
2511
|
-
|
|
2810
|
+
S = !1, re(Ce());
|
|
2512
2811
|
},
|
|
2513
2812
|
onClickStart: () => {
|
|
2514
|
-
|
|
2813
|
+
w = !0, ue && oe.playSound(W, "click"), D() || P.burst(K, 8), re(Ce());
|
|
2515
2814
|
},
|
|
2516
2815
|
onClickEnd: () => {
|
|
2517
|
-
|
|
2816
|
+
w = !1, re(Ce());
|
|
2518
2817
|
},
|
|
2519
|
-
onNearChange: (
|
|
2520
|
-
|
|
2818
|
+
onNearChange: (p) => {
|
|
2819
|
+
C = p, re(Ce());
|
|
2521
2820
|
},
|
|
2522
|
-
onGazeMove: (
|
|
2523
|
-
|
|
2821
|
+
onGazeMove: (p, X) => {
|
|
2822
|
+
de && (q.setTargets({ gazeX: p, gazeY: X }), B.add(N));
|
|
2524
2823
|
}
|
|
2525
2824
|
},
|
|
2526
|
-
|
|
2825
|
+
n
|
|
2527
2826
|
)), {
|
|
2528
2827
|
id: "wissive-" + Math.random().toString(36).substring(2, 9),
|
|
2529
|
-
name:
|
|
2530
|
-
emotionCategory:
|
|
2828
|
+
name: z.name,
|
|
2829
|
+
emotionCategory: z.emotion,
|
|
2531
2830
|
getElement() {
|
|
2532
|
-
return
|
|
2831
|
+
return L;
|
|
2533
2832
|
},
|
|
2534
2833
|
getPosition() {
|
|
2535
|
-
const
|
|
2834
|
+
const p = L.getBoundingClientRect();
|
|
2536
2835
|
return {
|
|
2537
|
-
x:
|
|
2538
|
-
y:
|
|
2836
|
+
x: p.left + p.width / 2,
|
|
2837
|
+
y: p.top + p.height / 2
|
|
2539
2838
|
};
|
|
2540
2839
|
},
|
|
2541
2840
|
getCurrentState() {
|
|
2542
|
-
return
|
|
2841
|
+
return g.getState();
|
|
2543
2842
|
},
|
|
2544
|
-
setEmotion(
|
|
2545
|
-
|
|
2843
|
+
setEmotion(p) {
|
|
2844
|
+
D() || (p === "click" ? P.burst(K, 8) : p === "hover" && P.burst(K, 4)), re(p);
|
|
2546
2845
|
},
|
|
2547
|
-
spin(
|
|
2548
|
-
const
|
|
2549
|
-
|
|
2846
|
+
spin(p = 1) {
|
|
2847
|
+
const X = q.getValues().turnAngle || 0;
|
|
2848
|
+
q.setTargets({ turnAngle: X + Math.PI * 2 * p }), B.add(N);
|
|
2550
2849
|
},
|
|
2551
2850
|
bounce() {
|
|
2552
|
-
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2851
|
+
ue && oe.playSound(W, "bounce"), D() || P.burst(K, 5);
|
|
2852
|
+
const p = q.getValues().bob || 0;
|
|
2853
|
+
q.setTargets({ bob: p - 14 }), B.add(N);
|
|
2854
|
+
},
|
|
2855
|
+
setGaze(p) {
|
|
2856
|
+
q.setTargets({ gazeX: p.x, gazeY: p.y }), B.add(N);
|
|
2857
|
+
},
|
|
2858
|
+
setGazeTracking(p) {
|
|
2859
|
+
de = p, p || (q.setTargets({ gazeX: 0, gazeY: 0 }), B.add(N));
|
|
2555
2860
|
},
|
|
2556
|
-
|
|
2557
|
-
|
|
2861
|
+
setSound(p) {
|
|
2862
|
+
ue = p;
|
|
2558
2863
|
},
|
|
2559
|
-
|
|
2560
|
-
|
|
2864
|
+
setDraggable(p) {
|
|
2865
|
+
ie = p, p && !J && a ? me() : !p && J && (J.destroy(), J = null, A = { offsetX: 0, offsetY: 0, scaleX: 1, scaleY: 1, rotation: 0, isDragging: !1 }, ye());
|
|
2561
2866
|
},
|
|
2562
|
-
|
|
2563
|
-
|
|
2867
|
+
setFlipX(p) {
|
|
2868
|
+
be = p, te();
|
|
2564
2869
|
},
|
|
2565
|
-
|
|
2566
|
-
|
|
2870
|
+
setEmphasis(p) {
|
|
2871
|
+
Fe = p, te();
|
|
2567
2872
|
},
|
|
2568
|
-
|
|
2569
|
-
|
|
2873
|
+
setAmbientParticles(p) {
|
|
2874
|
+
ge = p;
|
|
2570
2875
|
},
|
|
2571
|
-
|
|
2572
|
-
|
|
2876
|
+
setAutonomousStates(p) {
|
|
2877
|
+
Se = p;
|
|
2573
2878
|
},
|
|
2574
|
-
|
|
2575
|
-
|
|
2879
|
+
setAutonomousStatePool(p) {
|
|
2880
|
+
ke = p;
|
|
2576
2881
|
},
|
|
2577
|
-
|
|
2578
|
-
|
|
2882
|
+
setReducedMotion(p) {
|
|
2883
|
+
_ = p, te();
|
|
2579
2884
|
},
|
|
2580
|
-
|
|
2581
|
-
|
|
2885
|
+
setTheme(p) {
|
|
2886
|
+
he = p, te();
|
|
2582
2887
|
},
|
|
2583
|
-
|
|
2584
|
-
|
|
2888
|
+
setSize(p) {
|
|
2889
|
+
G = at(p), h.style.width = `${G}px`, h.style.height = `${G}px`, L.style.width = `${G}px`, L.style.height = `${G}px`, P.resize(G), te();
|
|
2585
2890
|
},
|
|
2586
|
-
|
|
2587
|
-
|
|
2891
|
+
setSilhouette(p, X = 400) {
|
|
2892
|
+
Y === p && !l || (Y = p, z.silhouette = p, F = [...u], m = ot(p), We = typeof performance < "u" ? performance.now() : Date.now(), s = D() ? 0 : X, s === 0 ? (u = [...m], l = !1) : l = !0, B.add(N), te());
|
|
2588
2893
|
},
|
|
2589
|
-
|
|
2590
|
-
|
|
2894
|
+
setSpringConfig(p) {
|
|
2895
|
+
q.setConfig(p);
|
|
2591
2896
|
},
|
|
2592
|
-
triggerParticles(
|
|
2593
|
-
|
|
2897
|
+
triggerParticles(p = 8) {
|
|
2898
|
+
D() || P.burst(K, p);
|
|
2594
2899
|
},
|
|
2595
|
-
playSequence(
|
|
2596
|
-
|
|
2900
|
+
playSequence(p, X) {
|
|
2901
|
+
pe.play(p, X);
|
|
2597
2902
|
},
|
|
2598
2903
|
stopSequence() {
|
|
2599
|
-
|
|
2904
|
+
pe.stop(), Oe(g.getState());
|
|
2600
2905
|
},
|
|
2601
2906
|
isSequencePlaying() {
|
|
2602
|
-
return
|
|
2907
|
+
return pe.isPlaying();
|
|
2603
2908
|
},
|
|
2604
2909
|
destroy() {
|
|
2605
|
-
|
|
2910
|
+
pe.stop(), $t(), Te(), B.remove(N), P.destroy(), J && J.destroy(), Be && Be(), h.remove();
|
|
2606
2911
|
}
|
|
2607
2912
|
};
|
|
2608
2913
|
}
|
|
2609
|
-
const
|
|
2610
|
-
create:
|
|
2611
|
-
createGroup:
|
|
2612
|
-
setGlobalSound:
|
|
2613
|
-
isGlobalSoundEnabled:
|
|
2614
|
-
setGlobalVolume:
|
|
2615
|
-
getGlobalVolume:
|
|
2616
|
-
supportsHover:
|
|
2617
|
-
isTouchDevice:
|
|
2914
|
+
const Ro = {
|
|
2915
|
+
create: zo,
|
|
2916
|
+
createGroup: wo,
|
|
2917
|
+
setGlobalSound: oo,
|
|
2918
|
+
isGlobalSoundEnabled: io,
|
|
2919
|
+
setGlobalVolume: so,
|
|
2920
|
+
getGlobalVolume: no,
|
|
2921
|
+
supportsHover: mt,
|
|
2922
|
+
isTouchDevice: Ut
|
|
2618
2923
|
};
|
|
2619
2924
|
export {
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
qt as
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2925
|
+
go as ALL_STATES,
|
|
2926
|
+
Fo as ALL_WANDERABLE_STATES,
|
|
2927
|
+
j as ANGLES,
|
|
2928
|
+
Mo as AUTONOMOUS_STATES,
|
|
2929
|
+
ce as COS,
|
|
2930
|
+
$o as DEFAULT_STEP_MS,
|
|
2931
|
+
ro as DragPhysics,
|
|
2932
|
+
St as EMOJI_BRIX,
|
|
2933
|
+
De as EMOJI_COTA,
|
|
2934
|
+
Ct as EMOJI_DOZY,
|
|
2935
|
+
Tt as EMOJI_FIDGE,
|
|
2936
|
+
Et as EMOJI_KNOT,
|
|
2937
|
+
wt as EMOJI_LUMO,
|
|
2938
|
+
rt as EMOJI_MOCHI,
|
|
2939
|
+
vt as EMOJI_NIMA,
|
|
2940
|
+
zt as EMOJI_PIP,
|
|
2941
|
+
At as EMOJI_SNUG,
|
|
2942
|
+
kt as EMOJI_SURI,
|
|
2943
|
+
Pt as EMOJI_VOID,
|
|
2944
|
+
Yt as EMOJI_WILT,
|
|
2945
|
+
Ft as EMOJI_ZUMI,
|
|
2946
|
+
Co as EmojiGroup,
|
|
2947
|
+
nt as IDLE_MOTIONS,
|
|
2948
|
+
ne as LIB,
|
|
2949
|
+
xo as PERSONALITY_DRIVEN_STATES,
|
|
2950
|
+
ae as PROFILE_SAMPLES,
|
|
2951
|
+
ao as ParticleEmitter,
|
|
2952
|
+
dt as SILHOUETTE_PROFILES,
|
|
2953
|
+
$e as SIN,
|
|
2954
|
+
Ao as SIZE_PRESETS,
|
|
2955
|
+
tt as SPRING_PRESETS,
|
|
2956
|
+
pt as STATE_GROUPS,
|
|
2957
|
+
po as STATE_MOTIONS,
|
|
2958
|
+
Wo as STATE_THEME_MAP,
|
|
2959
|
+
to as SoundEngine,
|
|
2960
|
+
lt as StateManager,
|
|
2961
|
+
ht as TAU,
|
|
2962
|
+
Ro as Wissive,
|
|
2963
|
+
yo as applyIdleMotion,
|
|
2964
|
+
fo as applyStateMotion,
|
|
2965
|
+
eo as attachEventListeners,
|
|
2966
|
+
mo as blendColors,
|
|
2967
|
+
Zt as blendProfiles,
|
|
2968
|
+
So as buildCustomEmoji,
|
|
2969
|
+
ut as buildFace,
|
|
2970
|
+
Go as checkContrast,
|
|
2971
|
+
Lo as clamp,
|
|
2972
|
+
Nt as closedCatmullRomPath,
|
|
2973
|
+
jo as createCustomEmoji,
|
|
2974
|
+
zo as createEmoji,
|
|
2975
|
+
wo as createEmojiGroup,
|
|
2976
|
+
Lt as createMultiSpring,
|
|
2977
|
+
bo as createSequencePlayer,
|
|
2978
|
+
Do as createStateManager,
|
|
2979
|
+
Ro as default,
|
|
2980
|
+
qt as generateSilhouettePath,
|
|
2981
|
+
uo as getContrastRatio,
|
|
2982
|
+
et as getEmojiDefinition,
|
|
2983
|
+
no as getGlobalVolume,
|
|
2984
|
+
it as getLuminance,
|
|
2985
|
+
Qt as getSilhouettePath,
|
|
2986
|
+
ot as getSilhouetteProfile,
|
|
2987
|
+
Oo as getThemeForState,
|
|
2988
|
+
_e as hullOfCircles,
|
|
2989
|
+
io as isGlobalSoundEnabled,
|
|
2990
|
+
lo as isReducedMotionPreferred,
|
|
2991
|
+
Ut as isTouchDevice,
|
|
2992
|
+
Wt as lerp,
|
|
2993
|
+
Bo as loadCustomEmoji,
|
|
2994
|
+
Xt as makeSpring,
|
|
2995
|
+
I as normalizeRadii,
|
|
2996
|
+
vo as pickWithoutRepeat,
|
|
2997
|
+
Le as profileFromPolygon,
|
|
2998
|
+
le as r2,
|
|
2999
|
+
Io as renderSvgElement,
|
|
3000
|
+
ko as resolveAutonomousStatePool,
|
|
3001
|
+
at as resolveSize,
|
|
3002
|
+
Yo as saveCustomEmoji,
|
|
3003
|
+
oo as setGlobalSound,
|
|
3004
|
+
so as setGlobalVolume,
|
|
3005
|
+
B as sharedLoop,
|
|
3006
|
+
oe as soundEngine,
|
|
3007
|
+
co as subscribeToReducedMotion,
|
|
3008
|
+
Ot as superellipseProfile,
|
|
3009
|
+
mt as supportsHover,
|
|
3010
|
+
_t as toPoints
|
|
2686
3011
|
};
|
|
2687
3012
|
//# sourceMappingURL=wissive.js.map
|