CamielCrisisBuster commited on
Commit
5b566df
·
verified ·
1 Parent(s): ab39600

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +551 -23
index.html CHANGED
@@ -1,24 +1,552 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>
13
- You can modify this app directly by editing <i>index.html</i> in the
14
- Files and versions tab.
15
- </p>
16
- <p>
17
- Also don't forget to check the
18
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank"
19
- >Spaces documentation</a
20
- >.
21
- </p>
22
- </div>
23
- </body>
24
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
292
+ // Generate random events for the calendar
293
+ function generateEvents(sport) {
294
+ const events = [];
295
+ const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
296
+ const colors = {
297
+ football: '#10B981',
298
+ tennis: '#3B82F6',
299
+ hockey: '#EF4444',
300
+ yoga: '#8B5CF6',
301
+ gymnastics: '#F59E0B'
302
+ };
303
+
304
+ const sportColor = colors[sport] || '#3B82F6';
305
+
306
+ // Generate events for the next 30 days
307
+ for (let i = 0; i < 30; i++) {
308
+ const date = new Date();
309
+ date.setDate(date.getDate() + i);
310
+
311
+ // Skip some days randomly
312
+ if (Math.random() < 0.2) continue;
313
+
314
+ const dayOfWeek = date.getDay();
315
+ const dayName = days[dayOfWeek];
316
+
317
+ // Different schedules for weekdays vs weekends
318
+ let sessions = [];
319
+ if (dayOfWeek === 0 || dayOfWeek === 6) { // Weekend
320
+ sessions = [
321
+ { time: '09:00', duration: 90, level: 'Beginner' },
322
+ { time: '11:00', duration: 90, level: 'Intermediate' },
323
+ { time: '14:00', duration: 90, level: 'Advanced' },
324
+ { time: '16:00', duration: 90, level: 'All Levels' }
325
+ ];
326
+ } else { // Weekday
327
+ sessions = [
328
+ { time: '07:00', duration: 60, level: 'Morning Session' },
329
+ { time: '12:00', duration: 60, level: 'Lunchtime Class' },
330
+ { time: '17:30', duration: 90, level: 'After Work' },
331
+ { time: '19:30', duration: 60, level: 'Evening Session' }
332
+ ];
333
+ }
334
+
335
+ // Randomly select 2-4 sessions per day
336
+ const sessionCount = Math.floor(Math.random() * 3) + 2;
337
+ const selectedSessions = [];
338
+ const usedIndices = [];
339
+
340
+ for (let j = 0; j < sessionCount; j++) {
341
+ let randomIndex;
342
+ do {
343
+ randomIndex = Math.floor(Math.random() * sessions.length);
344
+ } while (usedIndices.includes(randomIndex));
345
+
346
+ usedIndices.push(randomIndex);
347
+ selectedSessions.push(sessions[randomIndex]);
348
+ }
349
+
350
+ // Create events for each selected session
351
+ selectedSessions.forEach(session => {
352
+ const startTime = new Date(date);
353
+ const [hours, minutes] = session.time.split(':').map(Number);
354
+ startTime.setHours(hours, minutes, 0, 0);
355
+
356
+ const endTime = new Date(startTime);
357
+ endTime.setMinutes(endTime.getMinutes() + session.duration);
358
+
359
+ events.push({
360
+ title: `${sportData[sport].name} (${session.level})`,
361
+ start: startTime,
362
+ end: endTime,
363
+ color: sportColor,
364
+ extendedProps: {
365
+ level: session.level,
366
+ coach: getRandomCoach(),
367
+ location: getRandomLocation(sport),
368
+ sport: sport
369
+ }
370
+ });
371
+ });
372
+ }
373
+
374
+ return events;
375
+ }
376
+
377
+ function getRandomCoach() {
378
+ const firstNames = ['Alex', 'Jamie', 'Taylor', 'Jordan', 'Casey', 'Morgan', 'Riley', 'Quinn'];
379
+ const lastNames = ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Miller', 'Davis', 'Wilson'];
380
+ return `${firstNames[Math.floor(Math.random() * firstNames.length)]} ${lastNames[Math.floor(Math.random() * lastNames.length)]}`;
381
+ }
382
+
383
+ function getRandomLocation(sport) {
384
+ const locations = {
385
+ football: ['Main Field', 'Practice Field 1', 'Practice Field 2', 'Stadium'],
386
+ tennis: ['Court 1', 'Court 2', 'Court 3', 'Indoor Court'],
387
+ hockey: ['Rink A', 'Rink B', 'Training Rink', 'Main Arena'],
388
+ yoga: ['Studio 1', 'Studio 2', 'Zen Room', 'Outdoor Deck'],
389
+ gymnastics: ['Gym A', 'Gym B', 'Training Hall', 'Main Gym']
390
+ };
391
+ return locations[sport][Math.floor(Math.random() * locations[sport].length)];
392
+ }
393
+
394
+ // Calendar functions
395
+ let calendar;
396
+ let selectedEvent = null;
397
+
398
+ function showCalendar(sport) {
399
+ // Set sport info
400
+ document.getElementById('calendarSportName').textContent = sportData[sport].name;
401
+ document.getElementById('calendarSportDescription').textContent = sportData[sport].description;
402
+
403
+ const icon = document.getElementById('calendarSportIcon');
404
+ icon.className = '';
405
+ icon.classList.add('fas', sportData[sport].icon, `text-${sportData[sport].color}-500`);
406
+
407
+ // Show calendar container
408
+ const calendarView = document.getElementById('calendarView');
409
+ calendarView.classList.remove('hidden');
410
+ calendarView.scrollIntoView({ behavior: 'smooth' });
411
+
412
+ // Hide booking form and confirmation if they're visible
413
+ document.getElementById('calendarBookingForm').classList.add('hidden');
414
+ document.getElementById('calendarConfirmation').classList.add('hidden');
415
+
416
+ // Initialize calendar if it doesn't exist
417
+ if (!calendar) {
418
+ const calendarEl = document.getElementById('calendar');
419
+ calendar = new FullCalendar.Calendar(calendarEl, {
420
+ initialView: 'dayGridMonth',
421
+ headerToolbar: {
422
+ left: 'prev,next today',
423
+ center: 'title',
424
+ right: 'dayGridMonth,timeGridWeek,timeGridDay'
425
+ },
426
+ events: generateEvents(sport),
427
+ eventClick: function(info) {
428
+ selectedEvent = info.event;
429
+ showCalendarBookingForm();
430
+ },
431
+ eventMouseEnter: function(info) {
432
+ info.el.style.cursor = 'pointer';
433
+ },
434
+ height: 'auto',
435
+ contentHeight: 'auto',
436
+ aspectRatio: 1.8
437
+ });
438
+ calendar.render();
439
+ } else {
440
+ // Update events for the selected sport
441
+ calendar.removeAllEvents();
442
+ calendar.addEventSource(generateEvents(sport));
443
+ }
444
+ }
445
+
446
+ function hideCalendar() {
447
+ document.getElementById('calendarView').classList.add('hidden');
448
+ selectedEvent = null;
449
+ }
450
+
451
+ function showCalendarBookingForm() {
452
+ if (!selectedEvent) return;
453
+
454
+ // Set session info
455
+ const start = selectedEvent.start;
456
+ const end = selectedEvent.end;
457
+ const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' };
458
+
459
+ document.getElementById('selectedCalendarSession').textContent =
460
+ `${selectedEvent.title}\n${start.toLocaleDateString('en-US', options)} - ${end.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}`;
461
+
462
+ // Show booking form
463
+ document.getElementById('calendarBookingForm').classList.remove('hidden');
464
+ document.getElementById('calendarConfirmation').classList.add('hidden');
465
+
466
+ // Scroll to form
467
+ document.getElementById('calendarBookingForm').scrollIntoView({ behavior: 'smooth', block: 'nearest' });
468
+ }
469
+
470
+ function resetCalendarBooking() {
471
+ document.getElementById('calendarBookingForm').classList.add('hidden');
472
+ document.getElementById('calendarConfirmation').classList.add('hidden');
473
+ document.getElementById('sessionBookingForm').reset();
474
+ selectedEvent = null;
475
+ }
476
+
477
+ function showRandomCalendar() {
478
+ const sports = ['football', 'tennis', 'hockey', 'yoga', 'gymnastics'];
479
+ const randomSport = sports[Math.floor(Math.random() * sports.length)];
480
+ showCalendar(randomSport);
481
+ }
482
+
483
+ // Form submission
484
+ document.getElementById('sessionBookingForm').addEventListener('submit', function(e) {
485
+ e.preventDefault();
486
+
487
+ // In a real app, you would send this data to a server
488
+ const formData = {
489
+ name: document.getElementById('fullName').value,
490
+ email: document.getElementById('email').value,
491
+ phone: document.getElementById('phone').value,
492
+ participants: document.getElementById('participants').value,
493
+ notes: document.getElementById('notes').value,
494
+ session: {
495
+ title: selectedEvent.title,
496
+ date: selectedEvent.start.toLocaleDateString(),
497
+ time: `${selectedEvent.start.toLocaleTimeString()} - ${selectedEvent.end.toLocaleTimeString()}`,
498
+ coach: selectedEvent.extendedProps.coach,
499
+ location: selectedEvent.extendedProps.location
500
+ }
501
+ };
502
+
503
+ // Show confirmation
504
+ document.getElementById('calendarBookingForm').classList.add('hidden');
505
+
506
+ const confirmationDetails = document.getElementById('calendarConfirmationDetails');
507
+ confirmationDetails.innerHTML = `
508
+ <p class="mb-2"><strong>Session:</strong> ${formData.session.title}</p>
509
+ <p class="mb-2"><strong>Date & Time:</strong> ${formData.session.date} at ${formData.session.time}</p>
510
+ <p class="mb-2"><strong>Location:</strong> ${formData.session.location}</p>
511
+ <p class="mb-2"><strong>Coach:</strong> ${formData.session.coach}</p>
512
+ <p class="mb-2"><strong>Participants:</strong> ${formData.participants}</p>
513
+ <p class="mt-4">A confirmation has been sent to ${formData.email}</p>
514
+ `;
515
+
516
+ document.getElementById('calendarConfirmation').classList.remove('hidden');
517
+ document.getElementById('calendarConfirmation').scrollIntoView({ behavior: 'smooth' });
518
+
519
+ // Create confetti effect
520
+ createConfetti();
521
+ });
522
+
523
+ // Confetti effect
524
+ function createConfetti() {
525
+ const colors = ['#EF4444', '#F59E0B', '#10B981', '#3B82F6', '#8B5CF6'];
526
+
527
+ for (let i = 0; i < 100; i++) {
528
+ const confetti = document.createElement('div');
529
+ confetti.className = 'confetti';
530
+ confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
531
+ confetti.style.left = Math.random() * window.innerWidth + 'px';
532
+ confetti.style.top = -10 + 'px';
533
+ document.body.appendChild(confetti);
534
+
535
+ const animationDuration = Math.random() * 3 + 2;
536
+
537
+ confetti.style.transition = `top ${animationDuration}s linear, left ${animationDuration}s ease-out, opacity ${animationDuration}s linear`;
538
+
539
+ setTimeout(() => {
540
+ confetti.style.top = window.innerHeight + 'px';
541
+ confetti.style.left = (parseFloat(confetti.style.left) + (Math.random() - 0.5) * 200) + 'px';
542
+ confetti.style.opacity = '0';
543
+ }, 10);
544
+
545
+ setTimeout(() => {
546
+ confetti.remove();
547
+ }, animationDuration * 1000);
548
+ }
549
+ }
550
+ </script>
551
+ <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>
552
+ </html>