Bounce back on mouse leave. Firefox is garbage
This commit is contained in:
parent
c3a0c735fa
commit
878c1f6b5f
|
@ -52,10 +52,20 @@
|
||||||
windowRef.addEventListener("resize", updateDimensions);
|
windowRef.addEventListener("resize", updateDimensions);
|
||||||
|
|
||||||
const RevertToOrigin = () => {
|
const RevertToOrigin = () => {
|
||||||
|
if(navigator.userAgent.search(/gecko/i)>0){
|
||||||
|
StartPageAnimated.classList.add('FirefoxSmoothTranition');
|
||||||
|
}
|
||||||
updateAnimation(new Vector2(windowWidth/2, windowHeight/2));
|
updateAnimation(new Vector2(windowWidth/2, windowHeight/2));
|
||||||
};
|
};
|
||||||
document.documentElement.addEventListener('mouseleave', RevertToOrigin)
|
document.documentElement.addEventListener('mouseleave', RevertToOrigin)
|
||||||
|
|
||||||
|
const RemoveFirefoxSmoothTranition = () => {
|
||||||
|
if(navigator.userAgent.search(/gecko/i)>0){
|
||||||
|
StartPageAnimated.classList.remove('FirefoxSmoothTranition');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.documentElement.addEventListener('mouseenter', RemoveFirefoxSmoothTranition)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
windowRef.removeEventListener("resize", updateDimensions);
|
windowRef.removeEventListener("resize", updateDimensions);
|
||||||
};
|
};
|
||||||
|
@ -113,6 +123,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="DummyDiv" class="FirefoxSmoothTranition"/>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.StartPageContainer {
|
.StartPageContainer {
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
|
@ -145,6 +157,11 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.FirefoxSmoothTranition{
|
||||||
|
transition: none;
|
||||||
|
-moz-transition: transform 1000ms cubic-bezier(0.16, 1.63, 0.01, 0.99) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.SkillsText{
|
.SkillsText{
|
||||||
font-family: 'CozetteVector';
|
font-family: 'CozetteVector';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue