-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (46 loc) · 1.2 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
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
display: grid;
grid: auto-flow / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
margin: 0;
background-color: deepskyblue;
}
img {
width: 10vw;
}
h1 {
grid-column: auto / span 10;
text-align: center;
font-weight: bold;
font-size: 10em;
margin: 0;
}
</style>
</head>
<body>
<h1>
I Love You
</h1>
<script>
let mobileBug = 0;
function addHeart() {
const body = document.getElementsByTagName("body")[0];
const heart = document.createElement("img");
heart.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Heart_coraz%C3%B3n.svg/640px-Heart_coraz%C3%B3n.svg.png";
heart.alt = "I love you";
if (body.scrollHeight <= body.parentElement.scrollTop + window.innerHeight + mobileBug++) {
body.append(heart);
}
requestAnimationFrame(addHeart);
}
window.onload = function() {
requestAnimationFrame(addHeart);
}
</script>
</body>
</html>