Switch up parallax direction
This commit is contained in:
parent
ffac62132f
commit
99d6e12dae
|
@ -125,7 +125,7 @@ let setImages = () => {
|
||||||
const root = document.documentElement;
|
const root = document.documentElement;
|
||||||
|
|
||||||
const onMove = (ev: MouseEvent) => {
|
const onMove = (ev: MouseEvent) => {
|
||||||
let rotateY = `${(ev.clientX - window.innerWidth / 2) * 0.005}deg`;
|
let rotateY = `${-(ev.clientX - window.innerWidth / 2) * 0.005}deg`;
|
||||||
let rotateX = `${(ev.clientY - window.innerHeight / 2) * 0.005}deg`;
|
let rotateX = `${(ev.clientY - window.innerHeight / 2) * 0.005}deg`;
|
||||||
root.style.setProperty("--rotate-x", rotateX);
|
root.style.setProperty("--rotate-x", rotateX);
|
||||||
root.style.setProperty("--rotate-y", rotateY);
|
root.style.setProperty("--rotate-y", rotateY);
|
||||||
|
|
Loading…
Reference in New Issue