-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
293 lines (245 loc) · 9.08 KB
/
script.js
File metadata and controls
293 lines (245 loc) · 9.08 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
// Menu toggle
const sideMenu = document.getElementById('sideMenu');
const overlay = document.getElementById('overlay');
const menuToggle = document.getElementById('menuToggle');
const menuClose = document.getElementById('menuClose');
function openMenu() {
sideMenu.classList.add('open');
overlay.classList.add('show');
}
function closeMenu() {
sideMenu.classList.remove('open');
overlay.classList.remove('show');
}
function toggleMenu() {
document.getElementById("sideMenu").classList.toggle("open");
}
menuToggle.addEventListener('click', () => {
sideMenu.classList.contains('open') ? closeMenu() : openMenu();
});
menuClose.addEventListener('click', closeMenu);
overlay.addEventListener('click', closeMenu);
//Slideshow
let slideIndex = 0;
showSlide(slideIndex);
function showSlide(n) {
const slides = document.querySelectorAll(".slides img");
if (!slides.length) return;
// Wrap around
if (n >= slides.length) slideIndex = 0;
if (n < 0) slideIndex = slides.length - 1;
slides.forEach((s, i) => {
s.classList.remove("active", "side");
if (i === slideIndex) {
s.classList.add("active"); // current image
} else if (i === (slideIndex - 1 + slides.length) % slides.length ||
i === (slideIndex + 1) % slides.length) {
s.classList.add("side"); // previous & next
} else {
s.style.display = "none"; // hide others
}
s.style.display = "block"; // ensure visible for active/side
});
}
function changeSlide(n) {
slideIndex += n;
showSlide(slideIndex);
}
// Auto-play every 4 seconds
setInterval(() => {
slideIndex++;
showSlide(slideIndex);
}, 4000);
//Review Generator
// Expanded phrase banks for 10,000 combinations
const openings = [
"We celebrated at Kalash Marriage Lawn and",
"Our wedding at Kalash Marriage Lawn was unforgettable because",
"Attending an event here was delightful since",
"Kalash Marriage Lawn impressed us as",
"The venue made our occasion special as",
"Hosting our ceremony here was a joy because",
"Kalash Marriage Lawn stood out during our event since",
"Our guests loved the atmosphere because",
"The celebration felt grand as",
"Choosing this venue was perfect since",
"We enjoyed every moment here because",
"The arrangements were smooth as",
"Kalash Marriage Lawn truly delivered since",
"Our family gathering was memorable because",
"The venue exceeded expectations as",
"We felt comfortable here since",
"The hospitality was remarkable because",
"Our function was seamless as",
"The ambiance was charming since",
"Kalash Marriage Lawn made our day special because"
];
const features = [
"the open air lawn created a grand vibe",
"the cozy indoor space felt welcoming",
"the dedicated kitchen made catering smooth",
"indoor parking was convenient for guests",
"power backup kept everything seamless",
"AC and non-AC rooms gave flexibility",
"CCTV ensured safety throughout",
"the spacious lawn accommodated everyone comfortably",
"the indoor hall was beautifully decorated",
"lighting arrangements enhanced the atmosphere",
"the staff was attentive and professional",
"cleanliness was maintained throughout the venue",
"the sound system worked perfectly",
"the stage setup was elegant",
"the entryway was decorated beautifully",
"the seating was comfortable and well arranged",
"the catering team worked efficiently",
"the lawn greenery added freshness",
"the indoor area was cozy and stylish",
"parking attendants were helpful",
"backup facilities ensured no interruptions",
"rooms were spacious and well maintained",
"security was reliable with CCTV",
"the ambience was festive and vibrant",
"the arrangements reflected great planning"
];
const closings = [
"— highly recommended!",
"— exceeded expectations.",
"— would book again.",
"— perfect blend of elegance.",
"— made our day memorable.",
"— truly worth every penny.",
"— a venue that stands out.",
"— unforgettable experience.",
"— ideal for family functions.",
"— flawless from start to finish.",
"— a place we’ll always cherish.",
"— everything was handled smoothly.",
"— guests were impressed.",
"— we’ll return for future events.",
"— a gem in Lucknow.",
"— remarkable service and ambience.",
"— left us delighted.",
"— a venue that delivers quality.",
"— simply outstanding.",
"— our celebration was elevated."
];
// Generate review
function generateReview() {
const opening = openings[Math.floor(Math.random() * openings.length)];
const feature = features[Math.floor(Math.random() * features.length)];
const closing = closings[Math.floor(Math.random() * closings.length)];
return `${opening} ${feature}, ${closing}`;
}
// Display initial review
const reviewText = document.getElementById("reviewText");
reviewText.textContent = generateReview();
// New review
document.getElementById("newReviewBtn").addEventListener("click", () => {
reviewText.textContent = generateReview();
});
// Copy review
document.getElementById("copyBtn").addEventListener("click", () => {
navigator.clipboard.writeText(reviewText.textContent).then(() => {
const msg = document.getElementById("copyMsg");
msg.textContent = "✅ Copied!";
setTimeout(() => msg.textContent = "", 2000);
});
});
// Universal Google review link
document.getElementById("mapsBtn").addEventListener("click", function(e) {
e.preventDefault();
const review = document.getElementById("reviewText").innerText;
const mapsUrl = "https://search.google.com/local/writereview?placeid=ChIJMRToX2fimzkRUan3u1DooSM";
window.open(mapsUrl, "_blank");
});
const placeId = "ChIJMRToX2fimzkRUan3u1DooSM";
const mapsBtn = document.getElementById("mapsBtn");
//Enquiry Form
document.addEventListener("DOMContentLoaded", function () {
const form = document.getElementById("whatsappForm");
form.addEventListener("submit", function (e) {
e.preventDefault();
const name = document.getElementById("name").value.trim();
const email = document.getElementById("email").value.trim();
const message = document.getElementById("message").value.trim();
const fullMessage = `Hello, I am ${name}. My email is ${email}. I would like to enquire for the date: ${message}`;
const encodedMessage = encodeURIComponent(fullMessage);
const whatsappNumber = "916388028416"; // Replace with your WhatsApp number
const whatsappURL = `https://wa.me/${whatsappNumber}?text=${encodedMessage}`;
window.open(whatsappURL, "_blank");
});
});
// WhatsApp Enquiry Form
const enquiryForm = document.getElementById("enquiryForm");
if (enquiryForm) {
enquiryForm.addEventListener("submit", function(e) {
e.preventDefault();
const name = document.getElementById("name").value.trim();
const email = document.getElementById("email").value.trim();
const message = document.getElementById("message").value.trim();
const phoneNumber = "916388028416"; // ← Update this number only
const rawMessage = `New Enquiry:\nName: ${name}\nEmail: ${email}\nMessage: ${message}`;
const encodedMessage = encodeURIComponent(rawMessage);
const whatsappURL = `https://wa.me/${phoneNumber}?text=${encodedMessage}`;
window.open(whatsappURL, "_blank");
});
}
// Robust, conflict-free slideshow for photos.html
(function () {
const slideshow = document.getElementById('photosSlideshow');
if (!slideshow) return; // only run on photos.html
const container = slideshow.querySelector('.slide-container');
const slides = Array.from(container.querySelectorAll('img'));
const prevBtn = slideshow.querySelector('.prev1');
const nextBtn = slideshow.querySelector('.next1');
// Guard: no slides found
if (slides.length === 0) return;
let current = 0;
let timerId = null;
const INTERVAL_MS = 20000; // 20 seconds
function render(index) {
// Wrap around
if (index >= slides.length) index = 0;
if (index < 0) index = slides.length - 1;
// Hide all, show one
for (let i = 0; i < slides.length; i++) {
slides[i].style.display = 'none';
}
slides[index].style.display = 'block';
current = index;
}
function next() {
render(current + 1);
resetTimer();
}
function prev() {
render(current - 1);
resetTimer();
}
function startTimer() {
stopTimer();
timerId = setInterval(() => {
render(current + 1);
}, INTERVAL_MS);
}
function stopTimer() {
if (timerId) {
clearInterval(timerId);
timerId = null;
}
}
function resetTimer() {
startTimer();
}
// Wire buttons via JS (no inline onclick)
prevBtn.addEventListener('click', prev);
nextBtn.addEventListener('click', next);
// Optional: keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') prev();
if (e.key === 'ArrowRight') next();
});
// Initialize
render(0);
startTimer();
})();