forked from artemisriga/fun-html-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (55 loc) · 1.4 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
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>No Rejections</title>
<style>
p {
text-align: center;
font-size: 32px;
font-family: Candara, Oswald;
}
img {
display: block;
margin: 0 auto;
width: 25%;
}
#botao1 {
position: fixed;
top: 70%;
left: 55%;
transform: translate(-50%, -50%);
}
#botao2 {
position: absolute;
left: 30%;
top: 68%;
}
</style>
</head>
<body>
<p>Do you agree that I'm the best friend you have and you are very lucky to have me?</p>
<img src="https://media.tenor.com/zGm5acSjHCIAAAAM/cat-begging.gif" />
<button id="botao1">YES OFC!</button>
<button id="botao2">NO</button>
<script>
const button2 = document.getElementById("botao2");
let left = 20;
button2.addEventListener("mouseover", function () {
if (left == 20) {
left = 34;
} else {
left = 20;
}
this.style.left = left + "%";
});
</script>
<script>
document.getElementById("botao1").addEventListener("click", function () {
alert("Good choice, call me now!");
});
</script>
</body>
</html>