From 655d47745ce136603ff8222868b440e641fb9407 Mon Sep 17 00:00:00 2001
From: HsiangNianian <i@jyunko.cn>
Date: Thu, 15 Jan 2026 20:02:23 +0800
Subject: feat: Add interactive Saturn effect controls in HomeView and enhance
 ParticleBackground for external mouse handling

---
 ui/src/components/ParticleBackground.svelte | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

(limited to 'ui/src/components/ParticleBackground.svelte')

diff --git a/ui/src/components/ParticleBackground.svelte b/ui/src/components/ParticleBackground.svelte
index 080f1f2..7644b1a 100644
--- a/ui/src/components/ParticleBackground.svelte
+++ b/ui/src/components/ParticleBackground.svelte
@@ -1,7 +1,17 @@
+<script lang="ts" module>
+  import { SaturnEffect } from "../lib/effects/SaturnEffect";
+  
+  // Global reference to the active Saturn effect for external control
+  let globalSaturnEffect: SaturnEffect | null = null;
+  
+  export function getSaturnEffect(): SaturnEffect | null {
+    return globalSaturnEffect;
+  }
+</script>
+
 <script lang="ts">
   import { onMount, onDestroy } from "svelte";
   import { ConstellationEffect } from "../lib/effects/ConstellationEffect";
-  import { SaturnEffect } from "../lib/effects/SaturnEffect";
   import { settingsState } from "../stores/settings.svelte";
 
   let canvas: HTMLCanvasElement;
@@ -16,8 +26,10 @@
 
     if (settingsState.settings.active_effect === "saturn") {
       activeEffect = new SaturnEffect(canvas);
+      globalSaturnEffect = activeEffect;
     } else {
       activeEffect = new ConstellationEffect(canvas);
+      globalSaturnEffect = null;
     }
     
     // Ensure correct size immediately
@@ -48,6 +60,7 @@
   
   onDestroy(() => {
     if (activeEffect) activeEffect.destroy();
+    globalSaturnEffect = null;
   });
 </script>
 
-- 
cgit v1.2.3-70-g09d2

