-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (46 loc) · 1.18 KB
/
index.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
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>👀</text></svg>">
<title>Tim Anton Willem Molendijk</title>
<style>
html {
background-color: white;
}
#emoji {
position: absolute;
padding: .3rem .6rem;
font-size: 2rem;
&.tl {
top: 0;
left: 0;
}
&.tr {
top: 0;
right: 0;
}
&.bl {
bottom: 0;
left: 0;
}
&.br {
bottom: 0;
right: 0;
}
}
</style>
</head>
<body>
<div id="emoji" class="tl">👀</div>
<script>
let positions = ['tl', 'tr', 'bl', 'br']
document.getElementById('emoji').addEventListener('mouseover', function () {
let currentPosition = this.className
let targetPositions = positions.filter(position => position !== currentPosition)
this.className = targetPositions[Math.floor(Math.random() * targetPositions.length)]
})
</script>
</body>
</html>