@mingxy/opencode-mascot 0.7.6 → 0.7.8
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/package.json
CHANGED
|
@@ -92,19 +92,21 @@ export function HomeMascot(props: HomeMascotProps): JSX.Element {
|
|
|
92
92
|
curY = finalY;
|
|
93
93
|
applyPos();
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
const shakeSeq = [1, -1, 1, -1, 0];
|
|
97
|
+
let shakeIdx = 0;
|
|
98
|
+
const shakeInterval = setInterval(() => {
|
|
99
|
+
if (shakeIdx >= shakeSeq.length) {
|
|
100
|
+
clearInterval(shakeInterval);
|
|
101
|
+
curX = finalX;
|
|
102
|
+
applyPos();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
curX = finalX + shakeSeq[shakeIdx];
|
|
101
106
|
applyPos();
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
applyPos();
|
|
106
|
-
shakeIdx++;
|
|
107
|
-
}, 60);
|
|
107
|
+
shakeIdx++;
|
|
108
|
+
}, 60);
|
|
109
|
+
}, 2000);
|
|
108
110
|
}
|
|
109
111
|
}, 16);
|
|
110
112
|
|
|
@@ -209,7 +209,7 @@ export function SidebarMascot(props: SidebarMascotProps): JSX.Element {
|
|
|
209
209
|
setTimeout(() => setZBoost(false), 3500);
|
|
210
210
|
});
|
|
211
211
|
|
|
212
|
-
let scattered =
|
|
212
|
+
let scattered = false;
|
|
213
213
|
|
|
214
214
|
onScatter(() => {
|
|
215
215
|
if (scattered) return;
|
|
@@ -217,43 +217,11 @@ export function SidebarMascot(props: SidebarMascotProps): JSX.Element {
|
|
|
217
217
|
renderers[currentName()].scatterIn();
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
renderers[currentName()].setCharacterHidden(true);
|
|
221
|
-
renderers[currentName()].setProp(getProp("box") ?? null);
|
|
222
|
-
|
|
223
|
-
const finalY = posY();
|
|
224
|
-
const finalX = posX();
|
|
225
|
-
const fallStartY = finalY - 15;
|
|
226
|
-
const fallDuration = 500;
|
|
227
|
-
const fallStartTime = Date.now();
|
|
228
|
-
setPosY(fallStartY);
|
|
229
|
-
|
|
230
|
-
const fallInterval = setInterval(() => {
|
|
231
|
-
const elapsed = Date.now() - fallStartTime;
|
|
232
|
-
const t = Math.min(elapsed / fallDuration, 1);
|
|
233
|
-
const eased = t * t;
|
|
234
|
-
setPosY(Math.round(fallStartY + (finalY - fallStartY) * eased));
|
|
235
|
-
if (t >= 1) {
|
|
236
|
-
clearInterval(fallInterval);
|
|
237
|
-
setPosY(finalY);
|
|
238
|
-
|
|
239
|
-
const shakeSeq = [1, -1, 1, -1, 0];
|
|
240
|
-
let shakeIdx = 0;
|
|
241
|
-
const shakeInterval = setInterval(() => {
|
|
242
|
-
if (shakeIdx >= shakeSeq.length) {
|
|
243
|
-
clearInterval(shakeInterval);
|
|
244
|
-
setPosX(finalX);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
setPosX(finalX + shakeSeq[shakeIdx]);
|
|
248
|
-
shakeIdx++;
|
|
249
|
-
}, 60);
|
|
250
|
-
}
|
|
251
|
-
}, 16);
|
|
252
|
-
|
|
253
220
|
setTimeout(() => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
221
|
+
if (scattered) return;
|
|
222
|
+
scattered = true;
|
|
223
|
+
renderers[currentName()].scatterIn();
|
|
224
|
+
}, 2000);
|
|
257
225
|
|
|
258
226
|
return (
|
|
259
227
|
<box
|