Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: add "queue" emotion to mascot and update image source logic

Tonho36e5665d170c
diff --git a/src/components/mascot/Mascot.svelte b/src/components/mascot/Mascot.svelte
index 4f4315ea..cb18624d 100644
--- a/src/components/mascot/Mascot.svelte
+++ b/src/components/mascot/Mascot.svelte
@@ -1,5 +1,10 @@
<script lang="ts">
- type MascotEmotion = "idle" | "downloading" | "error" | "stalled";
+ type MascotEmotion = "idle" | "downloading" | "error" | "stalled" | "queue";
+
+ function emotionToSrc(e: MascotEmotion): string {
+ if (e === "queue") return "/mascot/downloading.png";
+ return `/mascot/${e}.png`;
+ }
let { emotion = "idle" }: { emotion?: MascotEmotion } = $props();
let currentSrc = $state("/mascot/idle.png");
@@ -10,7 +15,7 @@
let transitioning = $state(false);
$effect(() => {
- const target = `/mascot/${emotion}.png`;
+ const target = emotionToSrc(emotion);
if (target === currentSrc && !transitioning) return;
if (transitioning) return;