@mingxy/opencode-mascot 0.4.35 → 0.4.36

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/opencode-mascot",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "OpenCode TUI mascot plugin framework - customizable ASCII mascots for your terminal",
5
5
  "author": "mingxy",
6
6
  "license": "MIT",
@@ -78,6 +78,7 @@ export function createAnimatedRenderer(pack: MascotPack): {
78
78
  let bounceTimers: ReturnType<typeof setTimeout>[] = [];
79
79
  let celebrateTimers: ReturnType<typeof setTimeout>[] = [];
80
80
  let versionTimer: ReturnType<typeof setTimeout> | null = null;
81
+ let fallTimers: ReturnType<typeof setTimeout>[] = [];
81
82
 
82
83
  const stopFlash = () => {
83
84
  if (flashTimer) { clearInterval(flashTimer); flashTimer = null; }
@@ -90,6 +91,10 @@ export function createAnimatedRenderer(pack: MascotPack): {
90
91
  bounceTimers.forEach(t => { clearTimeout(t); });
91
92
  bounceTimers = [];
92
93
  };
94
+ const stopFall = () => {
95
+ fallTimers.forEach(t => { clearTimeout(t); });
96
+ fallTimers = [];
97
+ };
93
98
  const stopCelebrate = () => {
94
99
  celebrateTimers.forEach(t => { clearTimeout(t); });
95
100
  celebrateTimers = [];
@@ -279,6 +284,7 @@ export function createAnimatedRenderer(pack: MascotPack): {
279
284
  stopCelebrate();
280
285
  stopVersion();
281
286
  stopScatter();
287
+ stopFall();
282
288
  if (zzzTimer) { clearInterval(zzzTimer); zzzTimer = null; }
283
289
  });
284
290
 
@@ -464,8 +470,9 @@ export function createAnimatedRenderer(pack: MascotPack): {
464
470
  dy: i === 0 ? 2 : Math.floor(Math.random() * 3) + 1,
465
471
  }));
466
472
  setScatter(offsets);
467
- bounceTimers.push(setTimeout(() => {
473
+ fallTimers.push(setTimeout(() => {
468
474
  scatterIn();
475
+ fallTimers = [];
469
476
  }, 1500));
470
477
  };
471
478