@mingxy/opencode-mascot 0.4.35 → 0.4.37
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
|
@@ -44,6 +44,7 @@ export function SidebarMascot(props: SidebarMascotProps): JSX.Element {
|
|
|
44
44
|
const [posY, setPosY] = createSignal(2);
|
|
45
45
|
const [containerWidth, setContainerWidth] = createSignal(0);
|
|
46
46
|
const [zBoost, setZBoost] = createSignal(false);
|
|
47
|
+
let firstStatus = true;
|
|
47
48
|
let dragStartX = 0;
|
|
48
49
|
let dragStartY = 0;
|
|
49
50
|
let dragAnchorX = 0;
|
|
@@ -146,6 +147,10 @@ export function SidebarMascot(props: SidebarMascotProps): JSX.Element {
|
|
|
146
147
|
props.api.event.on("session.status", (data: unknown) => {
|
|
147
148
|
const payload = data as { type?: string; properties?: { sessionID?: string; status?: { type?: string } } } | null;
|
|
148
149
|
const statusType = payload?.properties?.status?.type;
|
|
150
|
+
if (firstStatus) {
|
|
151
|
+
firstStatus = false;
|
|
152
|
+
renderers[currentName()].scatterIn();
|
|
153
|
+
}
|
|
149
154
|
if (statusType === "busy" || statusType === "retry") {
|
|
150
155
|
if (hideSide) returnToView();
|
|
151
156
|
renderers[currentName()].setState("busy");
|
|
@@ -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
|
-
|
|
473
|
+
fallTimers.push(setTimeout(() => {
|
|
468
474
|
scatterIn();
|
|
475
|
+
fallTimers = [];
|
|
469
476
|
}, 1500));
|
|
470
477
|
};
|
|
471
478
|
|