-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (30 loc) · 1.19 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Website</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="contaner">
<h1>Do you wanna go out with me?</h1>
<div>
<img src="giphy.gif">
</div>
<div class="buttons">
<button class="btn" id="yesButton" onclick="nextPage()">Yes</button>
<button class="btn" id="noButton" onmouseover="moveButton()">No</button>
<script>
function nextPage(){
window. location.href="yes.html";
}
function moveButton() {
var x = Math.random() * (window.innerWidth - document.getElementById('noButton').offsetWidth);
var y = Math.random() * (window.innerHeight - document.getElementById('noButton').offsetHeight);
document.getElementById('noButton').style.left = `${x}px`;
document.getElementById('noButton').style.top = `${y}px`;
}
</script>
</div>
</div>
</body>
</html>