-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (82 loc) · 2.07 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Will You Be My Valentine?</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #ffebf0;
text-align: center;
padding: 50px;
}
.container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
max-width: 500px;
margin: auto;
}
h1 {
color: #ff4081;
}
p {
font-size: 18px;
color: #555;
}
.buttons {
margin-top: 20px;
}
button {
font-size: 18px;
padding: 10px 20px;
margin: 10px;
border: none;
cursor: pointer;
border-radius: 5px;
}
#yes {
background-color: #ff4081;
color: white;
}
#no {
background-color: #ccc;
color: black;
}
.hidden {
display: none;
}
#response {
margin-top: 20px;
font-size: 20px;
font-weight: bold;
color: #ff4081;
}
</style>
</head>
<body>
<div class="container">
<h1>Will You Be My Valentine? 💖</h1>
<p>You're the most amazing person ever, and I'd love to spend this Valentine's Day with you!</p>
<div class="buttons">
<button id="yes">Yes! 💘</button>
<button id="no">No 😢</button>
</div>
<p id="response" class="hidden"></p>
</div>
<script>
document.getElementById("yes").addEventListener("click", function() {
document.getElementById("response").textContent = "Yay! I can't wait! 🥰";
document.getElementById("response").classList.remove("hidden");
});
document.getElementById("no").addEventListener("click", function() {
let noButton = document.getElementById("no");
noButton.style.position = "absolute";
noButton.style.left = `${Math.random() * window.innerWidth}px`;
noButton.style.top = `${Math.random() * window.innerHeight}px`;
});
</script>
</body>
</html>