diff --git a/src/routes/zhen/Comps/TopAnimatedBackground.svelte b/src/routes/zhen/Comps/TopAnimatedBackground.svelte index ab32c2c..e72bace 100644 --- a/src/routes/zhen/Comps/TopAnimatedBackground.svelte +++ b/src/routes/zhen/Comps/TopAnimatedBackground.svelte @@ -51,9 +51,15 @@ windowRef.addEventListener("resize", updateDimensions); + const RevertToOrigin = () => { + updateAnimation(new Vector2(windowWidth/2, windowHeight/2)); + }; + document.documentElement.addEventListener('mouseleave', RevertToOrigin) + return () => { windowRef.removeEventListener("resize", updateDimensions); }; + }); const programmingLanguages: string[] = [