-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
36 lines (34 loc) · 1.35 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="./yesStyle.css">
</head>
<body>
<div class="container">
<div class="text" >
<h1 class = "header_text">Ты будешь моей валентинкой?</h1>
</div>
<div class="gif_container">
<img src="https://media.giphy.com/media/LnKonfpQ44fNvuGLkA/giphy.gif" alt="Cute animated illustration">
</div>
<div class = "buttons">
<button class="btn" id = "yesButton" onclick="nextPage()">Да</button>
<button class="btn" id="noButton" onmouseover="moveButton()">Нет</button>
<script>
function nextPage() {
window.location.href = "yes.html";
}
function moveButton() {
let x = Math.random() * (window.innerWidth - document.getElementById('noButton').offsetWidth);
let 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>