@mingxy/opencode-mascot 0.7.7 → 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
|
@@ -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,45 +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
|
-
setTimeout(() => {
|
|
240
|
-
const shakeSeq = [1, -1, 1, -1, 0];
|
|
241
|
-
let shakeIdx = 0;
|
|
242
|
-
const shakeInterval = setInterval(() => {
|
|
243
|
-
if (shakeIdx >= shakeSeq.length) {
|
|
244
|
-
clearInterval(shakeInterval);
|
|
245
|
-
setPosX(finalX);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
setPosX(finalX + shakeSeq[shakeIdx]);
|
|
249
|
-
shakeIdx++;
|
|
250
|
-
}, 60);
|
|
251
|
-
}, 2000);
|
|
252
|
-
}
|
|
253
|
-
}, 16);
|
|
254
|
-
|
|
255
220
|
setTimeout(() => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
221
|
+
if (scattered) return;
|
|
222
|
+
scattered = true;
|
|
223
|
+
renderers[currentName()].scatterIn();
|
|
224
|
+
}, 2000);
|
|
259
225
|
|
|
260
226
|
return (
|
|
261
227
|
<box
|