-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
185 lines (162 loc) · 4.86 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<title>Will you be my Valentine?</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background-color: #f5f5f5;
font-family: 'Arial', sans-serif;
position: relative;
}
#animation-container {
position: relative;
text-align: center; /* Center text in container */
}
#animation {
width: 80%;
max-width: 400px;
height: auto;
display: block; /* Center the image */
margin: 0 auto; /* Center the image */
}
#buttons {
display: flex;
justify-content: center;
margin-top: 20px;
}
#yesBtn, #noBtn {
font-size: 1.2em;
padding: 15px 30px;
margin: 0 10px;
cursor: pointer;
transition: all 0.3s;
border: none;
border-radius: 10px;
color: white;
font-weight: bold;
}
#yesBtn {
background: linear-gradient(to right, #4CAF50, #45a049); /* Green gradient */
box-shadow: 0px 5px 10px rgba(76, 175, 76, 0.7); /* Green shadow */
}
#noBtn {
background: linear-gradient(to right, #d9534f, #c9302c); /* Red gradient */
box-shadow: 0px 5px 10px rgba(217, 83, 79, 0.7); /* Red shadow */
}
#valentine-text, #yay-text {
font-size: 2.5em;
font-weight: bold;
color: black;
margin-top: 20px;
}
#footer {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
text-align: center;
background-color: rgb(234, 241, 251);
color: rgb(32, 33, 36);
padding: 20px;
border-radius: 10px;
width: 80%;
max-width: 600px;
z-index: -1;
}
#header {
width: 100%;
background-color: #0b57d0;
color: #fff;
text-align: center;
font-size: 12px;
padding: 5px;
position: fixed;
top: 0;
font-weight: bold;
font-size: 1.2em;
}
#disclaimer {
font-size: 16px;
font-weight: bold;
}
@media (max-width: 600px) {
#animation {
width: 90%;
}
#yesBtn, #noBtn {
font-size: 1em;
padding: 12px 24px;
margin: 0 8px;
}
#valentine-text, #yay-text {
font-size: 2em;
}
}
</style>
<script>
function addContent() {
let additionalContent = document.createElement("div");
additionalContent.id = "animation-content";
additionalContent.innerHTML = '<img id="animation" src="https://media.tenor.com/Re3rcuBu4hIAAAAi/love-couple.gif" alt="Animated Image">';
let yayText = document.createElement("div");
yayText.id = "yay-text";
yayText.textContent = "Ok yay!!!";
additionalContent.appendChild(yayText);
document.body.appendChild(additionalContent);
}
function clearContent() {
// Remove specific elements while keeping the footer
let animationElement = document.getElementById("animation");
let valentineText = document.getElementById("valentine-text");
let animationButtons = document.getElementById("buttons");
if (animationElement && valentineText && animationButtons ) {
animationElement.remove();
animationButtons.remove();
valentineText.remove();
}
addContent();
}
function adjustButtonSize() {
let yesBtn = document.getElementById("yesBtn");
let noBtn = document.getElementById("noBtn");
let currentYesSize = parseFloat(getComputedStyle(yesBtn).fontSize);
let currentNoWidth = parseFloat(getComputedStyle(noBtn).width);
let currentNoHeight = parseFloat(getComputedStyle(noBtn).height);
let newYesSize = currentYesSize + 32;
let newNoWidth = currentNoWidth - 14;
let newNoHeight = currentNoHeight - 14;
let noButtonFontSize = (currentNoWidth / currentNoHeight) + 6
yesBtn.style.fontSize = newYesSize + "px";
noBtn.style.width = newNoWidth + "px";
noBtn.style.height = newNoHeight + "px";
noBtn.style.fontSize = noButtonFontSize + "px";
}
</script>
</head>
<body>
<div id="header">Creator: sgone01</div>
<div id="animation-container">
<img id="animation" src="https://media1.tenor.com/m/Vy46BTSo3hsAAAAC/bear-love.gif" alt="Animated Image">
</div>
<div id="valentine-text">Will you be my Valentine?</div>
<div id="buttons">
<button id="yesBtn" onclick="clearContent()">YES</button>
<button id="noBtn" onclick="adjustButtonSize()">NO</button>
</div>
<footer>
<div id="footer">
<p id="disclaimer">
DISCLAIMER: The images used on this website are sourced from the internet, and all credits go to the respective owners.
</p>
</div>
</footer>
</body>
</html>