forked from CodeKageHQ/Ask-out-your-Valentine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (89 loc) · 3.81 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>Bitcoin Day</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
.gradient-background {
background: rgb(157, 241, 180);
background: linear-gradient(180deg, rgba(157,241,180, 1) 0%, rgba(185, 250, 203, 1) 36%, rgba(255, 255, 255, 1) 100%);
}
.bounce2 {
animation: bounce2 2s ease infinite;
}
@keyframes bounce2 {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-20px);
}
60% {
transform: translateY(-10px);
}
}
</style>
</head>
<body class="gradient-background">
<div class="flex items-center justify-center h-screen">
<div class="flex flex-col items-center p-4">
<img id="imageDisplay" src="./images/image1.gif" alt="Cute kitten with flowers" class="rounded-md h-[300px]" style="object-fit: cover;" />
<h2 id="valentineQuestion" class="text-4xl font-bold italic text-[#111111] my-4">Will you buy bitcoin with me?</h2>
<div class="flex gap-4 pt-[20px] items-center" id="responseButtons">
<button id="yesButton"
class="bounce2 inline-flex items-center justify-center whitespace-nowrap rounded-md text-[20px] font-medium disabled:pointer-events-none disabled:opacity-50 hover:bg-green-400 min-h-12 min-w-[75px] px-4 py-2 bg-green-500 text-white transition">
Yes
</button>
<button id="noButton"
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-[20px] font-medium transition disabled:pointer-events-none disabled:opacity-50 hover:bg-red-700 h-12 min-w-[75px] w-auto px-4 py-2 bg-red-500 text-white">
No
</button>
</div>
</div>
</div>
<script type="module">
import confetti from 'https://cdn.skypack.dev/canvas-confetti';
const yesButton = document.getElementById('yesButton');
const noButton = document.getElementById('noButton');
const imageDisplay = document.getElementById('imageDisplay');
const valentineQuestion = document.getElementById('valentineQuestion');
const responseButtons = document.getElementById('responseButtons');
let noClickCount = 0;
let buttonHeight = 48; // Starting height in pixels
let buttonWidth = 80;
let fontSize = 20; // Starting font size in pixels
const imagePaths = [
"./images/image1.gif",
"./images/image2.gif",
"./images/image3.gif",
"./images/image4.gif",
"./images/image5.gif",
"./images/image6.gif",
"./images/image7.gif"
];
noButton.addEventListener('click', function() {
if (noClickCount < 5) {
noClickCount++;
imageDisplay.src = imagePaths[noClickCount];
buttonHeight += 35; // Increase height by 5px on each click
buttonWidth += 35;
fontSize += 25; // Increase font size by 1px on each click
yesButton.style.height = `${buttonHeight}px`; // Update button height
yesButton.style.width = `${buttonWidth}px`;
yesButton.style.fontSize = `${fontSize}px`; // Update font size
if (noClickCount < 6) {
noButton.textContent = ["No", "Are you sure?", "Pookie please", "Don't do this to me :(", "You're breaking my heart", "I'm gonna cry..."][noClickCount];
}
}
});
yesButton.addEventListener('click', () => {
imageDisplay.src = './images/image7.gif'; // Change to image7.gif
valentineQuestion.textContent = "Yayyy!! :3"; // Change the question text
responseButtons.style.display = 'none'; // Hide both buttons
confetti(); // Trigger confetti animation
});
</script>
</body>
</html>