-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (32 loc) · 1.46 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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<div class="container">
<div >
<h1 class = "header_text">Hi my sleeping beauty </h1>
<h2 class = "header_text">will you give me more money?</h2>
</div>
<div class="gif_container">
<img src="https://media.giphy.com/media/W6o3MfP1ldc0K8sb38/giphy.gif" alt="Cute animated illustration">
</div>
<div class = "buttons">
<button class="btn" id = "yesButton" onclick="nextPage()">Yes</button>
<button class="btn" id="noButton" onmouseover="moveButton()" onclick="moveButton()">No</button>
<script>
function nextPage() {
window.location.href = "yes.html";
}
function moveButton() {
var x = Math.random() * (window.innerWidth - document.getElementById('noButton').offsetWidth) - 85;
var y = Math.random() * (window.innerHeight - document.getElementById('noButton').offsetHeight) - 48;
document.getElementById('noButton').style.left = `${x}px`;
document.getElementById('noButton').style.top = `${y}px`;
}
</script>
</div>
</div>
</body>
</html>