code-server/packages/app/src/index.ts

13 lines
427 B
TypeScript
Raw Normal View History

2019-01-11 18:58:25 +00:00
import "./index.scss";
2019-01-11 17:50:54 +00:00
const overlay = document.getElementById("overlay");
const logo = document.getElementById("logo");
if (overlay && logo) {
overlay.addEventListener("mousemove", (event) => {
const xPos = ((event.clientX - logo.offsetLeft) / 24).toFixed(2);
const yPos = ((logo.offsetTop - event.clientY) / 24).toFixed(2);
logo.style.transform = `perspective(200px) rotateX(${yPos}deg) rotateY(${xPos}deg)`;
});
}