-
Notifications
You must be signed in to change notification settings - Fork 11
/
script.js
160 lines (146 loc) · 5.91 KB
/
script.js
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
const qs = (selector) => document.querySelector(selector);
const question = qs(".question");
const gif = qs(".gif");
const [yesBtn, noBtn] = [".yes-btn", ".no-btn"].map(qs);
const handleYesClick = () => {
question.innerHTML = "Yeahhhhhhhhhhh! See you tomorrow!!";
gif.src = "https://media.giphy.com/media/UMon0fuimoAN9ueUNP/giphy.gif";
// Remove the 'mouseover' event listener from noBtn
noBtn.removeEventListener("mouseover", handleNoMouseOver);
// Remove the noBtn from the DOM
noBtn.remove();
// Define predefined romantic date ideas
const dateIdeas = [
"Cook a romantic dinner together",
"Go for a moonlit walk on the beach",
"Have a picnic in the park",
"Take a dance class together",
"Stargaze in the backyard",
"Take a hot air balloon ride",
"Explore a botanical garden",
"Attend a live outdoor concert",
"Visit an art gallery",
"Go on a weekend getaway to a cozy cabin",
"Attend a cooking class together",
"Plan a movie marathon night at home",
"Take a scenic train ride",
"Go horseback riding",
"Visit a local winery for a wine tasting",
"Go kayaking or canoeing",
"Attend a comedy show",
"Take a scenic hike and have a picnic",
"Go on a sunrise or sunset photo shoot",
"Attend a local farmers' market",
"Explore a historic neighborhood",
"Take a dance lesson together",
"Have a DIY spa night at home",
"Go on a bike ride together",
"Plan a themed dinner night at home",
"Attend a live theater performance",
"Go on a scenic drive",
"Visit a local chocolate or dessert shop",
"Take a pottery or ceramics class",
"Attend a local sports game",
"Plan a day trip to a nearby city",
"Have a karaoke night at home or at a local venue",
"Attend a local festival or fair",
"Go on a scenic boat tour",
"Visit a local bookstore and pick out books for each other",
"Have a picnic in a local park",
"Take a photography workshop together",
"Explore a new hiking trail",
"Attend a wine and paint night",
"Visit a nearby beach or lake",
"Plan a game night with board games or card games",
"Take a pottery or ceramics class",
"Attend a trivia night at a local bar",
"Go on a hot air balloon ride",
"Take a scenic train ride",
"Plan a movie night with your favorite films",
"Go on a helicopter tour",
"Attend a live outdoor concert",
"Visit a local art gallery",
"Go on a brewery tour",
"Take a scenic drive through the countryside",
"Attend a live comedy show",
"Visit a local botanical garden",
"Have a picnic in a vineyard",
"Take a cooking class together",
"Go on a river cruise",
"Plan a weekend getaway to a cozy cabin",
"Attend a dance class together",
"Take a day trip to a nearby national park",
"Go on a bike ride along a scenic trail",
"Visit a local museum",
"Have a DIY spa day at home",
"Attend a live theater performance",
"Go on a scenic hike and have a picnic",
"Take a painting class together",
"Attend a local farmers' market",
"Explore a historic neighborhood",
"Go horseback riding",
"Have a themed dinner night at home",
"Attend a local sports game",
"Plan a day trip to a nearby city",
"Have a karaoke night at home or at a local venue",
"Attend a wine and cheese tasting",
"Visit a local chocolate or dessert shop",
"Take a pottery or ceramics class",
"Attend a live music performance",
"Go on a boat tour",
"Visit a local bookstore and pick out books for each other",
"Take a photography workshop together",
"Explore a new hiking trail",
"Attend a wine and paint night",
"Visit a nearby beach or lake",
"Plan a game night with board games or card games",
"Take a pottery or ceramics class",
"Attend a trivia night at a local bar",
"Go on a hot air balloon ride",
"Take a scenic train ride",
"Plan a movie night with your favorite films",
"Go on a helicopter tour",
"Attend a live outdoor concert",
"Visit a local art gallery",
"Go on a brewery tour",
"Take a scenic drive through the countryside",
"Attend a live comedy show",
"Visit a local botanical garden",
"Have a picnic in a vineyard",
"Take a cooking class together",
"Go on a river cruise",
"Plan a weekend getaway to a cozy cabin",
"Attend a dance class together",
// Add more date ideas as needed
];
// Create and style a new button for Let's Go!
const letsGoBtn = document.createElement("button");
letsGoBtn.textContent = "Let's Go!";
letsGoBtn.classList.add("letsgo-btn"); // You can add a class for styling if needed
letsGoBtn.style.position = "absolute";
// Adjust the left position based on screen width
if (window.innerWidth <= 800) {
letsGoBtn.style.left = "95%";
} else {
letsGoBtn.style.left = "63%";
}
letsGoBtn.style.transform = "translate(-50%, -50%)";
letsGoBtn.style.width = "200px"; // Adjust the width as needed
// Add a click event listener to prompt the user with random romantic date ideas
letsGoBtn.addEventListener("click", () => {
const randomIndex = Math.floor(Math.random() * dateIdeas.length);
const selectedDateIdea = dateIdeas[randomIndex];
alert(`How about this romantic date idea: ${selectedDateIdea}`);
});
// Replace yesBtn with the new letsGoBtn
yesBtn.replaceWith(letsGoBtn);
};
const handleNoMouseOver = () => {
const { width, height } = noBtn.getBoundingClientRect();
const maxX = window.innerWidth - width;
const maxY = window.innerHeight - height;
noBtn.style.left = `${Math.floor(Math.random() * maxX)}px`;
noBtn.style.top = `${Math.floor(Math.random() * maxY)}px`;
};
yesBtn.addEventListener("click", handleYesClick);
noBtn.addEventListener("mouseover", handleNoMouseOver);