Bounce back to center if mouse leave
This commit is contained in:
parent
b444948903
commit
c3a0c735fa
|
@ -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[] = [
|
||||
|
|
Loading…
Reference in New Issue