From 878c1f6b5f36f9a8dd14c2e201ee585131b5443d Mon Sep 17 00:00:00 2001 From: BOTAlex Date: Sun, 31 Mar 2024 07:32:28 +0200 Subject: [PATCH] Bounce back on mouse leave. Firefox is garbage --- .../zhen/Comps/TopAnimatedBackground.svelte | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/routes/zhen/Comps/TopAnimatedBackground.svelte b/src/routes/zhen/Comps/TopAnimatedBackground.svelte index e72bace..a83880d 100644 --- a/src/routes/zhen/Comps/TopAnimatedBackground.svelte +++ b/src/routes/zhen/Comps/TopAnimatedBackground.svelte @@ -52,10 +52,20 @@ windowRef.addEventListener("resize", updateDimensions); const RevertToOrigin = () => { + if(navigator.userAgent.search(/gecko/i)>0){ + StartPageAnimated.classList.add('FirefoxSmoothTranition'); + } updateAnimation(new Vector2(windowWidth/2, windowHeight/2)); }; document.documentElement.addEventListener('mouseleave', RevertToOrigin) + const RemoveFirefoxSmoothTranition = () => { + if(navigator.userAgent.search(/gecko/i)>0){ + StartPageAnimated.classList.remove('FirefoxSmoothTranition'); + } + }; + document.documentElement.addEventListener('mouseenter', RemoveFirefoxSmoothTranition) + return () => { windowRef.removeEventListener("resize", updateDimensions); }; @@ -113,6 +123,8 @@ +
+