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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Sport Selector with Booking</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
10 |
+
<style>
|
11 |
+
.sport-card {
|
12 |
+
transition: all 0.3s ease;
|
13 |
+
transform-style: preserve-3d;
|
14 |
+
}
|
15 |
+
.sport-card:hover {
|
16 |
+
transform: translateY(-10px) scale(1.03);
|
17 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
18 |
+
}
|
19 |
+
.sport-card.selected {
|
20 |
+
transform: translateY(-5px);
|
21 |
+
box-shadow: 0 0 0 3px #3B82F6;
|
22 |
+
}
|
23 |
+
.confetti {
|
24 |
+
position: fixed;
|
25 |
+
width: 10px;
|
26 |
+
height: 10px;
|
27 |
+
background-color: #f00;
|
28 |
+
border-radius: 50%;
|
29 |
+
pointer-events: none;
|
30 |
+
z-index: 1000;
|
31 |
+
}
|
32 |
+
@keyframes float {
|
33 |
+
0% { transform: translateY(0px) rotate(0deg); }
|
34 |
+
50% { transform: translateY(-20px) rotate(180deg); }
|
35 |
+
100% { transform: translateY(0px) rotate(360deg); }
|
36 |
+
}
|
37 |
+
.floating-icon {
|
38 |
+
animation: float 6s ease-in-out infinite;
|
39 |
+
}
|
40 |
+
.calendar-container {
|
41 |
+
max-height: 0;
|
42 |
+
overflow: hidden;
|
43 |
+
transition: max-height 0.5s ease-out;
|
44 |
+
}
|
45 |
+
.calendar-container.open {
|
46 |
+
max-height: 1000px;
|
47 |
+
}
|
48 |
+
.time-slot {
|
49 |
+
transition: all 0.2s ease;
|
50 |
+
}
|
51 |
+
.time-slot:hover {
|
52 |
+
transform: scale(1.05);
|
53 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
54 |
+
}
|
55 |
+
.time-slot.selected {
|
56 |
+
background-color: #3B82F6;
|
57 |
+
color: white;
|
58 |
+
}
|
59 |
+
.calendar-view {
|
60 |
+
display: none;
|
61 |
+
}
|
62 |
+
.calendar-view.active {
|
63 |
+
display: block;
|
64 |
+
}
|
65 |
+
.calendar-header {
|
66 |
+
background: linear-gradient(135deg, #3B82F6, #6366F1);
|
67 |
+
}
|
68 |
+
.fc-daygrid-day-number {
|
69 |
+
color: #1F2937;
|
70 |
+
}
|
71 |
+
.fc-daygrid-day.fc-day-today {
|
72 |
+
background-color: #EFF6FF;
|
73 |
+
}
|
74 |
+
.fc-event {
|
75 |
+
cursor: pointer;
|
76 |
+
border-radius: 4px;
|
77 |
+
font-size: 0.85rem;
|
78 |
+
padding: 2px 4px;
|
79 |
+
}
|
80 |
+
</style>
|
81 |
+
<link href='https://cdn.jsdelivr.net/npm/[email protected]/main.min.css' rel='stylesheet' />
|
82 |
+
</head>
|
83 |
+
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">
|
84 |
+
<div class="container mx-auto px-4 py-12">
|
85 |
+
<div class="text-center mb-12">
|
86 |
+
<h1 class="text-5xl font-bold text-gray-800 mb-4">Choose Your Sport</h1>
|
87 |
+
<p class="text-xl text-gray-600 max-w-2xl mx-auto">Select your favorite activity and book your training sessions!</p>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-6xl mx-auto">
|
91 |
+
<!-- Football Card -->
|
92 |
+
<div class="sport-card bg-white rounded-xl shadow-lg overflow-hidden">
|
93 |
+
<div class="relative h-48 bg-gradient-to-r from-green-600 to-green-400 flex items-center justify-center">
|
94 |
+
<i class="fas fa-futbol text-white text-8xl floating-icon"></i>
|
95 |
+
</div>
|
96 |
+
<div class="p-6">
|
97 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Football</h3>
|
98 |
+
<p class="text-gray-600">The beautiful game of teamwork, strategy, and skill. Perfect for those who love competition.</p>
|
99 |
+
<div class="mt-4 flex justify-between items-center">
|
100 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">Team Sport</span>
|
101 |
+
<button onclick="showCalendar('football')" class="text-blue-500 font-medium hover:text-blue-700 transition">View sessions</button>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<!-- Tennis Card -->
|
107 |
+
<div class="sport-card bg-white rounded-xl shadow-lg overflow-hidden">
|
108 |
+
<div class="relative h-48 bg-gradient-to-r from-blue-500 to-blue-300 flex items-center justify-center">
|
109 |
+
<i class="fas fa-table-tennis text-white text-8xl floating-icon"></i>
|
110 |
+
</div>
|
111 |
+
<div class="p-6">
|
112 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Tennis</h3>
|
113 |
+
<p class="text-gray-600">A fast-paced racket sport that improves agility, reflexes, and cardiovascular health.</p>
|
114 |
+
<div class="mt-4 flex justify-between items-center">
|
115 |
+
<span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">Individual</span>
|
116 |
+
<button onclick="showCalendar('tennis')" class="text-blue-500 font-medium hover:text-blue-700 transition">View sessions</button>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
|
121 |
+
<!-- Hockey Card -->
|
122 |
+
<div class="sport-card bg-white rounded-xl shadow-lg overflow-hidden">
|
123 |
+
<div class="relative h-48 bg-gradient-to-r from-red-600 to-red-400 flex items-center justify-center">
|
124 |
+
<i class="fas fa-hockey-puck text-white text-8xl floating-icon"></i>
|
125 |
+
</div>
|
126 |
+
<div class="p-6">
|
127 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Hockey</h3>
|
128 |
+
<p class="text-gray-600">Fast, physical and exciting. A great way to build endurance and teamwork skills.</p>
|
129 |
+
<div class="mt-4 flex justify-between items-center">
|
130 |
+
<span class="bg-red-100 text-red-800 text-xs px-2 py-1 rounded-full">Team Sport</span>
|
131 |
+
<button onclick="showCalendar('hockey')" class="text-blue-500 font-medium hover:text-blue-700 transition">View sessions</button>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<!-- Yoga Card -->
|
137 |
+
<div class="sport-card bg-white rounded-xl shadow-lg overflow-hidden">
|
138 |
+
<div class="relative h-48 bg-gradient-to-r from-purple-600 to-purple-400 flex items-center justify-center">
|
139 |
+
<i class="fas fa-spa text-white text-8xl floating-icon"></i>
|
140 |
+
</div>
|
141 |
+
<div class="p-6">
|
142 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Yoga</h3>
|
143 |
+
<p class="text-gray-600">Improve flexibility, strength and mental clarity through ancient practice of yoga.</p>
|
144 |
+
<div class="mt-4 flex justify-between items-center">
|
145 |
+
<span class="bg-purple-100 text-purple-800 text-xs px-2 py-1 rounded-full">Mind & Body</span>
|
146 |
+
<button onclick="showCalendar('yoga')" class="text-blue-500 font-medium hover:text-blue-700 transition">View sessions</button>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
<!-- Gymnastics Card -->
|
152 |
+
<div class="sport-card bg-white rounded-xl shadow-lg overflow-hidden">
|
153 |
+
<div class="relative h-48 bg-gradient-to-r from-yellow-600 to-yellow-400 flex items-center justify-center">
|
154 |
+
<i class="fas fa-medal text-white text-8xl floating-icon"></i>
|
155 |
+
</div>
|
156 |
+
<div class="p-6">
|
157 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Gymnastics</h3>
|
158 |
+
<p class="text-gray-600">Develop strength, flexibility, and coordination through artistic movement.</p>
|
159 |
+
<div class="mt-4 flex justify-between items-center">
|
160 |
+
<span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded-full">Individual</span>
|
161 |
+
<button onclick="showCalendar('gymnastics')" class="text-blue-500 font-medium hover:text-blue-700 transition">View sessions</button>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
<!-- Recommendation Card -->
|
167 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden border-2 border-dashed border-gray-300 flex items-center justify-center">
|
168 |
+
<div class="p-6 text-center">
|
169 |
+
<i class="fas fa-question-circle text-gray-400 text-6xl mb-4"></i>
|
170 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Need Help Choosing?</h3>
|
171 |
+
<p class="text-gray-600 mb-4">Click on any sport to view available sessions and book your training!</p>
|
172 |
+
<button onclick="showRandomCalendar()" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-6 rounded-full transition duration-300">
|
173 |
+
Show Random Sessions
|
174 |
+
</button>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<!-- Calendar View Section -->
|
180 |
+
<div id="calendarView" class="mt-12 bg-white rounded-xl shadow-lg p-6 max-w-6xl mx-auto hidden">
|
181 |
+
<div class="flex justify-between items-center mb-6">
|
182 |
+
<div class="flex items-center">
|
183 |
+
<i id="calendarSportIcon" class="fas text-4xl mr-4"></i>
|
184 |
+
<div>
|
185 |
+
<h2 class="text-2xl font-bold text-gray-800">Available Sessions for <span id="calendarSportName" class="text-blue-500"></span></h2>
|
186 |
+
<p id="calendarSportDescription" class="text-gray-600 mt-2"></p>
|
187 |
+
</div>
|
188 |
+
</div>
|
189 |
+
<button onclick="hideCalendar()" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-2 px-4 rounded-full transition duration-300">
|
190 |
+
<i class="fas fa-times mr-2"></i> Close
|
191 |
+
</button>
|
192 |
+
</div>
|
193 |
+
|
194 |
+
<div id="calendar" class="mb-6"></div>
|
195 |
+
|
196 |
+
<div id="calendarBookingForm" class="hidden">
|
197 |
+
<h3 class="text-xl font-semibold text-gray-800 mb-4">Book Your Session</h3>
|
198 |
+
<form id="sessionBookingForm" class="space-y-4">
|
199 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
200 |
+
<div>
|
201 |
+
<label for="fullName" class="block text-sm font-medium text-gray-700">Full Name</label>
|
202 |
+
<input type="text" id="fullName" required class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
|
203 |
+
</div>
|
204 |
+
<div>
|
205 |
+
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
|
206 |
+
<input type="email" id="email" required class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
|
207 |
+
</div>
|
208 |
+
<div>
|
209 |
+
<label for="phone" class="block text-sm font-medium text-gray-700">Phone Number</label>
|
210 |
+
<input type="tel" id="phone" required class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
|
211 |
+
</div>
|
212 |
+
<div>
|
213 |
+
<label for="participants" class="block text-sm font-medium text-gray-700">Participants</label>
|
214 |
+
<select id="participants" class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
|
215 |
+
<option value="1">1 person</option>
|
216 |
+
<option value="2">2 people</option>
|
217 |
+
<option value="3">3 people</option>
|
218 |
+
<option value="4">4 people</option>
|
219 |
+
<option value="5">5+ people</option>
|
220 |
+
</select>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
<div>
|
224 |
+
<label for="notes" class="block text-sm font-medium text-gray-700">Special Requests</label>
|
225 |
+
<textarea id="notes" rows="3" class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"></textarea>
|
226 |
+
</div>
|
227 |
+
<div class="flex justify-between items-center pt-4">
|
228 |
+
<div>
|
229 |
+
<p class="text-sm text-gray-600">Selected session:</p>
|
230 |
+
<p id="selectedCalendarSession" class="font-medium"></p>
|
231 |
+
</div>
|
232 |
+
<button type="submit" class="bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-6 rounded-full transition duration-300">
|
233 |
+
Confirm Booking <i class="fas fa-check ml-2"></i>
|
234 |
+
</button>
|
235 |
+
</div>
|
236 |
+
</form>
|
237 |
+
</div>
|
238 |
+
|
239 |
+
<div id="calendarConfirmation" class="hidden text-center py-8">
|
240 |
+
<i class="fas fa-check-circle text-green-500 text-6xl mb-4"></i>
|
241 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Booking Confirmed!</h3>
|
242 |
+
<p id="calendarConfirmationDetails" class="text-gray-600 mb-6"></p>
|
243 |
+
<div class="flex justify-center space-x-4">
|
244 |
+
<button onclick="resetCalendarBooking()" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-6 rounded-full transition duration-300">
|
245 |
+
Book Another Session
|
246 |
+
</button>
|
247 |
+
<button onclick="hideCalendar()" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-2 px-6 rounded-full transition duration-300">
|
248 |
+
Return to Sports
|
249 |
+
</button>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
</div>
|
254 |
+
|
255 |
+
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
256 |
+
<script src='https://cdn.jsdelivr.net/npm/[email protected]/main.min.js'></script>
|
257 |
+
<script>
|
258 |
+
// Sport data
|
259 |
+
const sportData = {
|
260 |
+
football: {
|
261 |
+
name: "Football",
|
262 |
+
icon: "fa-futbol",
|
263 |
+
color: "green",
|
264 |
+
description: "Football is the world's most popular sport, played by over 250 million players in over 200 countries. It's a great way to build teamwork, endurance, and coordination while having fun with friends."
|
265 |
+
},
|
266 |
+
tennis: {
|
267 |
+
name: "Tennis",
|
268 |
+
icon: "fa-table-tennis",
|
269 |
+
color: "blue",
|
270 |
+
description: "Tennis is a racket sport that can be played individually against a single opponent or between two teams of two players each. It improves hand-eye coordination, agility, and strategic thinking."
|
271 |
+
},
|
272 |
+
hockey: {
|
273 |
+
name: "Hockey",
|
274 |
+
icon: "fa-hockey-puck",
|
275 |
+
color: "red",
|
276 |
+
description: "Hockey is a fast-paced team sport played on ice (or field) that requires excellent skating skills, hand-eye coordination, and teamwork. It's great for building endurance and quick reflexes."
|
277 |
+
},
|
278 |
+
yoga: {
|
279 |
+
name: "Yoga",
|
280 |
+
icon: "fa-spa",
|
281 |
+
color: "purple",
|
282 |
+
description: "Yoga is a group of physical, mental, and spiritual practices originating in ancient India. It helps improve flexibility, strength, balance, and mental well-being through various postures and breathing techniques."
|
283 |
+
},
|
284 |
+
gymnastics: {
|
285 |
+
name: "Gymnastics",
|
286 |
+
icon: "fa-medal",
|
287 |
+
color: "yellow",
|
288 |
+
description: "Gymnastics is a sport that requires balance, strength, flexibility, agility, coordination, and endurance. It includes exercises on apparatus like the balance beam, uneven bars, and floor exercise."
|
289 |
+
}
|
290 |
+
};
|
291 |
+
// Generate random events for the calendar
|
292 |
+
function generateEvents(sport) {
|
293 |
+
const events = [];
|
294 |
+
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
295 |
+
const colors = {
|
296 |
+
football: '#10B981',
|
297 |
+
tennis: '#3B82F6',
|
298 |
+
hockey: '#EF4444',
|
299 |
+
yoga: '#8B5CF6',
|
300 |
+
gymnastics: '#F59E0B'
|
301 |
+
};
|
302 |
+
|
303 |
+
const sportColor = colors[sport] || '#3B82F6';
|
304 |
+
|
305 |
+
// Generate events for the next 30 days
|
306 |
+
for (let i = 0; i < 30; i++) {
|
307 |
+
const date = new Date();
|
308 |
+
date.setDate(date.getDate() + i);
|
309 |
+
|
310 |
+
// Skip some days randomly
|
311 |
+
if (Math.random() < 0.2) continue;
|
312 |
+
|
313 |
+
const dayOfWeek = date.getDay();
|
314 |
+
const dayName = days[dayOfWeek];
|
315 |
+
|
316 |
+
// Different schedules for weekdays vs weekends
|
317 |
+
let sessions = [];
|
318 |
+
if (dayOfWeek === 0 || dayOfWeek === 6) { // Weekend
|
319 |
+
sessions = [
|
320 |
+
{ time: '09:00', duration: 90, level: 'Beginner' },
|
321 |
+
{ time: '11:00', duration: 90, level: 'Intermediate' },
|
322 |
+
{ time: '14:00', duration: 90, level: 'Advanced' },
|
323 |
+
{ time: '16:00', duration: 90, level: 'All Levels' }
|
324 |
+
];
|
325 |
+
} else { // Weekday
|
326 |
+
sessions = [
|
327 |
+
{ time: '07:00', duration: 60, level: 'Morning Session' },
|
328 |
+
{ time: '12:00', duration: 60, level: 'Lunchtime Class' },
|
329 |
+
{ time: '17:30', duration: 90, level: 'After Work' },
|
330 |
+
{ time: '19:30', duration: 60, level: 'Evening Session' }
|
331 |
+
];
|
332 |
+
}
|
333 |
+
|
334 |
+
// Randomly select 2-4 sessions per day
|
335 |
+
const sessionCount = Math.floor(Math.random() * 3) + 2;
|
336 |
+
const selectedSessions = [];
|
337 |
+
const usedIndices = [];
|
338 |
+
|
339 |
+
for (let j = 0; j < sessionCount; j++) {
|
340 |
+
let randomIndex;
|
341 |
+
do {
|
342 |
+
randomIndex = Math.floor(Math.random() * sessions.length);
|
343 |
+
} while (usedIndices.includes(randomIndex));
|
344 |
+
|
345 |
+
usedIndices.push(randomIndex);
|
346 |
+
selectedSessions.push(sessions[randomIndex]);
|
347 |
+
}
|
348 |
+
|
349 |
+
// Create events for each selected session
|
350 |
+
selectedSessions.forEach(session => {
|
351 |
+
const startTime = new Date(date);
|
352 |
+
const [hours, minutes] = session.time.split(':').map(Number);
|
353 |
+
startTime.setHours(hours, minutes, 0, 0);
|
354 |
+
|
355 |
+
const endTime = new Date(startTime);
|
356 |
+
endTime.setMinutes(endTime.getMinutes() + session.duration);
|
357 |
+
|
358 |
+
events.push({
|
359 |
+
title: `${sportData[sport].name} (${session.level})`,
|
360 |
+
start: startTime,
|
361 |
+
end: endTime,
|
362 |
+
color: sportColor,
|
363 |
+
extendedProps: {
|
364 |
+
level: session.level,
|
365 |
+
coach: getRandomCoach(),
|
366 |
+
location: getRandomLocation(sport),
|
367 |
+
sport: sport
|
368 |
+
}
|
369 |
+
});
|
370 |
+
});
|
371 |
+
}
|
372 |
+
|
373 |
+
return events;
|
374 |
+
}
|
375 |
+
|
376 |
+
function getRandomCoach() {
|
377 |
+
const firstNames = ['Alex', 'Jamie', 'Taylor', 'Jordan', 'Casey', 'Morgan', 'Riley', 'Quinn'];
|
378 |
+
const lastNames = ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Miller', 'Davis', 'Wilson'];
|
379 |
+
return `${firstNames[Math.floor(Math.random() * firstNames.length)]} ${lastNames[Math.floor(Math.random() * lastNames.length)]}`;
|
380 |
+
}
|
381 |
+
|
382 |
+
function getRandomLocation(sport) {
|
383 |
+
const locations = {
|
384 |
+
football: ['Main Field', 'Practice Field 1', 'Practice Field 2', 'Stadium'],
|
385 |
+
tennis: ['Court 1', 'Court 2', 'Court 3', 'Indoor Court'],
|
386 |
+
hockey: ['Rink A', 'Rink B', 'Training Rink', 'Main Arena'],
|
387 |
+
yoga: ['Studio 1', 'Studio 2', 'Zen Room', 'Outdoor Deck'],
|
388 |
+
gymnastics: ['Gym A', 'Gym B', 'Training Hall', 'Main Gym']
|
389 |
+
};
|
390 |
+
return locations[sport][Math.floor(Math.random() * locations[sport].length)];
|
391 |
+
}
|
392 |
+
|
393 |
+
// Calendar functions
|
394 |
+
let calendar;
|
395 |
+
let selectedEvent = null;
|
396 |
+
|
397 |
+
function showCalendar(sport) {
|
398 |
+
// Set sport info
|
399 |
+
document.getElementById('calendarSportName').textContent = sportData[sport].name;
|
400 |
+
document.getElementById('calendarSportDescription').textContent = sportData[sport].description;
|
401 |
+
|
402 |
+
const icon = document.getElementById('calendarSportIcon');
|
403 |
+
icon.className = '';
|
404 |
+
icon.classList.add('fas', sportData[sport].icon, `text-${sportData[sport].color}-500`);
|
405 |
+
|
406 |
+
// Show calendar container
|
407 |
+
const calendarView = document.getElementById('calendarView');
|
408 |
+
calendarView.classList.remove('hidden');
|
409 |
+
calendarView.scrollIntoView({ behavior: 'smooth' });
|
410 |
+
|
411 |
+
// Hide booking form and confirmation if they're visible
|
412 |
+
document.getElementById('calendarBookingForm').classList.add('hidden');
|
413 |
+
document.getElementById('calendarConfirmation').classList.add('hidden');
|
414 |
+
|
415 |
+
// Initialize calendar if it doesn't exist
|
416 |
+
if (!calendar) {
|
417 |
+
const calendarEl = document.getElementById('calendar');
|
418 |
+
calendar = new FullCalendar.Calendar(calendarEl, {
|
419 |
+
initialView: 'dayGridMonth',
|
420 |
+
headerToolbar: {
|
421 |
+
left: 'prev,next today',
|
422 |
+
center: 'title',
|
423 |
+
right: 'dayGridMonth,timeGridWeek,timeGridDay'
|
424 |
+
},
|
425 |
+
events: generateEvents(sport),
|
426 |
+
eventClick: function(info) {
|
427 |
+
selectedEvent = info.event;
|
428 |
+
showCalendarBookingForm();
|
429 |
+
},
|
430 |
+
eventMouseEnter: function(info) {
|
431 |
+
info.el.style.cursor = 'pointer';
|
432 |
+
},
|
433 |
+
height: 'auto',
|
434 |
+
contentHeight: 'auto',
|
435 |
+
aspectRatio: 1.8
|
436 |
+
});
|
437 |
+
calendar.render();
|
438 |
+
} else {
|
439 |
+
// Update events for the selected sport
|
440 |
+
calendar.removeAllEvents();
|
441 |
+
calendar.addEventSource(generateEvents(sport));
|
442 |
+
}
|
443 |
+
}
|
444 |
+
|
445 |
+
function hideCalendar() {
|
446 |
+
document.getElementById('calendarView').classList.add('hidden');
|
447 |
+
selectedEvent = null;
|
448 |
+
}
|
449 |
+
|
450 |
+
function showCalendarBookingForm() {
|
451 |
+
if (!selectedEvent) return;
|
452 |
+
|
453 |
+
// Set session info
|
454 |
+
const start = selectedEvent.start;
|
455 |
+
const end = selectedEvent.end;
|
456 |
+
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' };
|
457 |
+
|
458 |
+
document.getElementById('selectedCalendarSession').textContent =
|
459 |
+
`${selectedEvent.title}\n${start.toLocaleDateString('en-US', options)} - ${end.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}`;
|
460 |
+
|
461 |
+
// Show booking form
|
462 |
+
document.getElementById('calendarBookingForm').classList.remove('hidden');
|
463 |
+
document.getElementById('calendarConfirmation').classList.add('hidden');
|
464 |
+
|
465 |
+
// Scroll to form
|
466 |
+
document.getElementById('calendarBookingForm').scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
467 |
+
}
|
468 |
+
|
469 |
+
function resetCalendarBooking() {
|
470 |
+
document.getElementById('calendarBookingForm').classList.add('hidden');
|
471 |
+
document.getElementById('calendarConfirmation').classList.add('hidden');
|
472 |
+
document.getElementById('sessionBookingForm').reset();
|
473 |
+
selectedEvent = null;
|
474 |
+
}
|
475 |
+
|
476 |
+
function showRandomCalendar() {
|
477 |
+
const sports = ['football', 'tennis', 'hockey', 'yoga', 'gymnastics'];
|
478 |
+
const randomSport = sports[Math.floor(Math.random() * sports.length)];
|
479 |
+
showCalendar(randomSport);
|
480 |
+
}
|
481 |
+
|
482 |
+
// Form submission
|
483 |
+
document.getElementById('sessionBookingForm').addEventListener('submit', function(e) {
|
484 |
+
e.preventDefault();
|
485 |
+
|
486 |
+
// In a real app, you would send this data to a server
|
487 |
+
const formData = {
|
488 |
+
name: document.getElementById('fullName').value,
|
489 |
+
email: document.getElementById('email').value,
|
490 |
+
phone: document.getElementById('phone').value,
|
491 |
+
participants: document.getElementById('participants').value,
|
492 |
+
notes: document.getElementById('notes').value,
|
493 |
+
session: {
|
494 |
+
title: selectedEvent.title,
|
495 |
+
date: selectedEvent.start.toLocaleDateString(),
|
496 |
+
time: `${selectedEvent.start.toLocaleTimeString()} - ${selectedEvent.end.toLocaleTimeString()}`,
|
497 |
+
coach: selectedEvent.extendedProps.coach,
|
498 |
+
location: selectedEvent.extendedProps.location
|
499 |
+
}
|
500 |
+
};
|
501 |
+
|
502 |
+
// Show confirmation
|
503 |
+
document.getElementById('calendarBookingForm').classList.add('hidden');
|
504 |
+
|
505 |
+
const confirmationDetails = document.getElementById('calendarConfirmationDetails');
|
506 |
+
confirmationDetails.innerHTML = `
|
507 |
+
<p class="mb-2"><strong>Session:</strong> ${formData.session.title}</p>
|
508 |
+
<p class="mb-2"><strong>Date & Time:</strong> ${formData.session.date} at ${formData.session.time}</p>
|
509 |
+
<p class="mb-2"><strong>Location:</strong> ${formData.session.location}</p>
|
510 |
+
<p class="mb-2"><strong>Coach:</strong> ${formData.session.coach}</p>
|
511 |
+
<p class="mb-2"><strong>Participants:</strong> ${formData.participants}</p>
|
512 |
+
<p class="mt-4">A confirmation has been sent to ${formData.email}</p>
|
513 |
+
`;
|
514 |
+
|
515 |
+
document.getElementById('calendarConfirmation').classList.remove('hidden');
|
516 |
+
document.getElementById('calendarConfirmation').scrollIntoView({ behavior: 'smooth' });
|
517 |
+
|
518 |
+
// Create confetti effect
|
519 |
+
createConfetti();
|
520 |
+
});
|
521 |
+
|
522 |
+
// Confetti effect
|
523 |
+
function createConfetti() {
|
524 |
+
const colors = ['#EF4444', '#F59E0B', '#10B981', '#3B82F6', '#8B5CF6'];
|
525 |
+
|
526 |
+
for (let i = 0; i < 100; i++) {
|
527 |
+
const confetti = document.createElement('div');
|
528 |
+
confetti.className = 'confetti';
|
529 |
+
confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
|
530 |
+
confetti.style.left = Math.random() * window.innerWidth + 'px';
|
531 |
+
confetti.style.top = -10 + 'px';
|
532 |
+
document.body.appendChild(confetti);
|
533 |
+
|
534 |
+
const animationDuration = Math.random() * 3 + 2;
|
535 |
+
|
536 |
+
confetti.style.transition = `top ${animationDuration}s linear, left ${animationDuration}s ease-out, opacity ${animationDuration}s linear`;
|
537 |
+
|
538 |
+
setTimeout(() => {
|
539 |
+
confetti.style.top = window.innerHeight + 'px';
|
540 |
+
confetti.style.left = (parseFloat(confetti.style.left) + (Math.random() - 0.5) * 200) + 'px';
|
541 |
+
confetti.style.opacity = '0';
|
542 |
+
}, 10);
|
543 |
+
|
544 |
+
setTimeout(() => {
|
545 |
+
confetti.remove();
|
546 |
+
}, animationDuration * 1000);
|
547 |
+
}
|
548 |
+
}
|
549 |
+
</script>
|
550 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=cameltoe22/crisis-busters" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
551 |
+
</html>
|