-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (36 loc) · 1.47 KB
/
index.html
File metadata and controls
43 lines (36 loc) · 1.47 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<div class="container">
<div>
<h1 class="header_text">Suka Aku?</h1>
</div>
<div class="gif_container">
<img src="https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExcDdtZ2JiZDR0a3lvMWF4OG8yc3p6Ymdvd3g2d245amdveDhyYmx6eCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9cw/cLS1cfxvGOPVpf9g3y/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() {
const button = document.getElementById('noButton');
const buttonWidth = button.offsetWidth;
const buttonHeight = button.offsetHeight;
const x = Math.random() * (window.innerWidth - buttonWidth);
const y = Math.random() * (window.innerHeight - buttonHeight);
button.style.position = 'absolute';
button.style.left = `${x}px`;
button.style.top = `${y}px`;
}
</script>
</div>
</div>
</body>
</html>