Bounce back on mouse leave. Firefox is garbage

This commit is contained in:
BOTAlex 2024-03-31 07:32:28 +02:00
parent c3a0c735fa
commit 878c1f6b5f
1 changed files with 17 additions and 0 deletions

View File

@ -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 @@
</div>
</div>
<div id="DummyDiv" class="FirefoxSmoothTranition"/>
<style>
.StartPageContainer {
height: 40vh;
@ -145,6 +157,11 @@
display: flex;
}
.FirefoxSmoothTranition{
transition: none;
-moz-transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99) !important;
}
.SkillsText{
font-family: 'CozetteVector';