-
Notifications
You must be signed in to change notification settings - Fork 1
/
Games.html
36 lines (28 loc) · 1.06 KB
/
Games.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Welcome to Adentent Page | adentent.github.io</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<p>Here are my gaming projects:</p>
<p><a href="2048.html">2048</p>
<p><a href="index.html">← Back to the home page</a></p>
<script>
document.querySelector('body').addEventListener('mousemove',
(e) => {
e.currentTarget.style.setProperty('--x', `${e.clientX}px`);
e.currentTarget.style.setProperty('--y', `${e.clientY}px`);
});
function setLinksPositions() {
document.querySelectorAll('a').forEach((a) => {
const bounding = a.getBoundingClientRect();
a.style.setProperty('--positionX', `${bounding.x}px`);
a.style.setProperty('--positionY', `${bounding.y}px`);
});
}
window.addEventListener('load', setLinksPositions);
window.addEventListener('resize', setLinksPositions);
</script>
</body>