Koperization commited on
Commit
4981cc8
·
verified ·
1 Parent(s): cb4bcf3

Page Title: Junior A Girls – Volleyball

Browse files

Design Style:
- Theme: Dark mode (#121212)
- Accent Color: #008080 (teal)
- Text Color: White (#FFFFFF)/Light Grey (#CCCCCC)
- Font: Montserrat
- Animations: Smooth transitions and carousel effects

Header:
- Existing NAGAS header

Layout:
1. Back Button (→ /volleyball)
2. Search Bar (filters players by name)
3. Player Grid:
- 3-column responsive grid (2-col tablet, 1-col mobile)
- Cards with hover animations (scale + glow)
- Staggered fade-in on load

4. Player Profile Modal:
- Slide-up animation
- Carousel gallery with:
* Main image display
* Thumbnail navigation
* Smooth transition between images
* Swipe support for mobile

CSS Additions:
/* Carousel Container */
.carousel-container {
position: relative;
max-width: 100%;
margin: 20px auto;
overflow: hidden;
border-radius: 6px;
}

/* Main Image */
.carousel-main {
width: 100%;
height: 300px;
background: #1E1E1E;
border-radius: 6px;
overflow: hidden;
position: relative;
}
.carousel-main img {
width: 100%;
height: 100%;
object-fit: cover;
transition: opacity 0.5s ease;
}

/* Thumbnails */
.carousel-thumbs {
display: flex;
gap: 8px;
margin-top: 10px;
justify-content: center;
}
.carousel-thumbs img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 4px;
cursor: pointer;
opacity: 0.7;
transition: all 0.3s;
}
.carousel-thumbs img.active {
opacity: 1;
border: 2px solid #008080;
}

/* Navigation Arrows */
.carousel-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0,0,0,0.5);
color: white;
border: none;
padding: 10px;
cursor: pointer;
font-size: 18px;
z-index: 10;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.carousel-arrow:hover {
background: #008080;
}
.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }

/* Animation for image transition */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

/* JavaScript for Carousel */
<script>
document.querySelectorAll('.player-card').forEach(card => {
card.addEventListener('click', () => {
const modal = document.getElementById('profile-modal');
const mainImg = modal.querySelector('.carousel-main img');
const thumbs = modal.querySelectorAll('.carousel-thumbs img');
let currentIndex = 0;

// Set up carousel
thumbs.forEach((thumb, index) => {
thumb.addEventListener('click', () => {
currentIndex = index;
updateCarousel();
});
});

// Navigation arrows
modal.querySelector('.carousel-arrow.prev').addEventListener('click', () => {
currentIndex = (currentIndex > 0) ? currentIndex - 1 : thumbs.length - 1;
updateCarousel();
});

modal.querySelector('.carousel-arrow.next').addEventListener('click', () => {
currentIndex = (currentIndex < thumbs.length - 1) ? currentIndex + 1 : 0;
updateCarousel();
});

// Swipe support for mobile
let touchStartX = 0;
mainImg.addEventListener('touchstart', (e) => {
touchStartX = e.changedTouches[0].screenX;
});

mainImg.addEventListener('touchend', (e) => {
const touchEndX = e.changedTouches[0].screenX;
if (touchStartX - touchEndX > 50) { // Swipe left
currentIndex = (currentIndex < thumbs.length - 1) ? currentIndex + 1 : 0;
} else if (touchEndX - touchStartX > 50) { // Swipe right
currentIndex = (currentIndex > 0) ? currentIndex - 1 : thumbs.length - 1;
}
updateCarousel();
});

function updateCarousel() {
// Fade out current image
mainImg.style.opacity = 0;

setTimeout(() => {
// Update main image
mainImg.src = thumbs[currentIndex].src;
mainImg.style.opacity = 1;

// Update active thumbnail
thumbs.forEach((thumb, index) => {
thumb.classList.toggle('active', index === currentIndex);
});
}, 300);
}

// Initialize
updateCarousel();
});
});
</script>

HTML Structure for Carousel:
<div class="carousel-container">
<div class="carousel-main">
<img src="player-main.jpg" alt="Main photo">
<button class="carousel-arrow prev">‹</button>
<button class="carousel-arrow next">›</button>
</div>
<div class="carousel-thumbs">
<img src="player-1.jpg" class="active" alt="Thumbnail 1">
<img src="player-2.jpg" alt="Thumbnail 2">
<img src="player-3.jpg" alt="Thumbnail 3">
</div>
</div>

Files changed (1) hide show
  1. volleyball-junior-a-girls.html +512 -0
volleyball-junior-a-girls.html ADDED
@@ -0,0 +1,512 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Junior A Girls – Volleyball - NAGAS</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap" rel="stylesheet">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script>
11
+ tailwind.config = {
12
+ theme: {
13
+ extend: {
14
+ colors: {
15
+ primary: '#008080',
16
+ dark: '#121212',
17
+ darker: '#0a0a0a'
18
+ }
19
+ }
20
+ }
21
+ }
22
+ </script>
23
+ <style>
24
+ body {
25
+ font-family: 'Montserrat', sans-serif;
26
+ background-color: #121212;
27
+ color: #ffffff;
28
+ }
29
+ .player-card {
30
+ transition: all 0.3s ease;
31
+ background-color: #1e1e1e;
32
+ }
33
+ .player-card:hover {
34
+ transform: scale(1.03);
35
+ box-shadow: 0 0 15px rgba(0, 128, 128, 0.5);
36
+ }
37
+ .search-bar {
38
+ background-color: #1e1e1e;
39
+ border: 1px solid #008080;
40
+ }
41
+ .search-bar:focus {
42
+ outline: none;
43
+ border-color: #00cccc;
44
+ }
45
+ .back-button {
46
+ transition: all 0.3s ease;
47
+ }
48
+ .back-button:hover {
49
+ color: #008080;
50
+ }
51
+
52
+ /* Carousel Container */
53
+ .carousel-container {
54
+ position: relative;
55
+ max-width: 100%;
56
+ margin: 20px auto;
57
+ overflow: hidden;
58
+ border-radius: 6px;
59
+ }
60
+
61
+ /* Main Image */
62
+ .carousel-main {
63
+ width: 100%;
64
+ height: 300px;
65
+ background: #1E1E1E;
66
+ border-radius: 6px;
67
+ overflow: hidden;
68
+ position: relative;
69
+ }
70
+ .carousel-main img {
71
+ width: 100%;
72
+ height: 100%;
73
+ object-fit: cover;
74
+ transition: opacity 0.5s ease;
75
+ }
76
+
77
+ /* Thumbnails */
78
+ .carousel-thumbs {
79
+ display: flex;
80
+ gap: 8px;
81
+ margin-top: 10px;
82
+ justify-content: center;
83
+ }
84
+ .carousel-thumbs img {
85
+ width: 60px;
86
+ height: 60px;
87
+ object-fit: cover;
88
+ border-radius: 4px;
89
+ cursor: pointer;
90
+ opacity: 0.7;
91
+ transition: all 0.3s;
92
+ }
93
+ .carousel-thumbs img.active {
94
+ opacity: 1;
95
+ border: 2px solid #008080;
96
+ }
97
+
98
+ /* Navigation Arrows */
99
+ .carousel-arrow {
100
+ position: absolute;
101
+ top: 50%;
102
+ transform: translateY(-50%);
103
+ background: rgba(0,0,0,0.5);
104
+ color: white;
105
+ border: none;
106
+ padding: 10px;
107
+ cursor: pointer;
108
+ font-size: 18px;
109
+ z-index: 10;
110
+ border-radius: 50%;
111
+ width: 40px;
112
+ height: 40px;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+ }
117
+ .carousel-arrow:hover {
118
+ background: #008080;
119
+ }
120
+ .carousel-arrow.prev { left: 10px; }
121
+ .carousel-arrow.next { right: 10px; }
122
+
123
+ /* Animation for image transition */
124
+ @keyframes fadeIn {
125
+ from { opacity: 0; }
126
+ to { opacity: 1; }
127
+ }
128
+
129
+ /* Modal */
130
+ .modal {
131
+ display: none;
132
+ position: fixed;
133
+ top: 0;
134
+ left: 0;
135
+ width: 100%;
136
+ height: 100%;
137
+ background: rgba(0, 0, 0, 0.8);
138
+ z-index: 1000;
139
+ justify-content: center;
140
+ align-items: center;
141
+ }
142
+ .modal-content {
143
+ background: #1e1e1e;
144
+ border-radius: 8px;
145
+ width: 90%;
146
+ max-width: 600px;
147
+ padding: 20px;
148
+ position: relative;
149
+ animation: slideUp 0.4s ease;
150
+ }
151
+ @keyframes slideUp {
152
+ from { transform: translateY(50px); opacity: 0; }
153
+ to { transform: translateY(0); opacity: 1; }
154
+ }
155
+ .close-modal {
156
+ position: absolute;
157
+ top: 15px;
158
+ right: 15px;
159
+ font-size: 24px;
160
+ cursor: pointer;
161
+ color: #ccc;
162
+ }
163
+ .close-modal:hover {
164
+ color: #008080;
165
+ }
166
+ </style>
167
+ </head>
168
+ <body class="bg-dark text-white">
169
+ <!-- Navigation -->
170
+ <header class="fixed w-full z-50 bg-dark border-b border-primary">
171
+ <div class="container mx-auto px-4 py-3 flex justify-between items-center">
172
+ <div class="flex items-center">
173
+ <div class="w-10 h-10 bg-primary rounded-full mr-3"></div>
174
+ <a href="index.html" class="text-xl font-extrabold"><span class="text-[#008080]">NAGAS</span><span class="text-white">ATHLETICS</span></a>
175
+ </div>
176
+ <nav class="hidden md:flex space-x-6">
177
+ <a href="index.html" class="hover:text-primary">Home</a>
178
+ <a href="about.html" class="hover:text-primary">About</a>
179
+ <a href="teams.html" class="hover:text-primary">Teams</a>
180
+ <a href="schedule.html" class="hover:text-primary">Schedule</a>
181
+ <a href="council.html" class="hover:text-primary">Council</a>
182
+ <a href="news.html" class="hover:text-primary">News</a>
183
+ <a href="get-involved.html" class="hover:text-primary">Get Involved</a>
184
+ </nav>
185
+ <button id="menu-toggle" class="md:hidden text-white">
186
+ <i data-feather="menu"></i>
187
+ </button>
188
+ </div>
189
+ </header>
190
+
191
+ <!-- Mobile Menu -->
192
+ <div id="mobile-menu" class="fixed inset-0 bg-dark z-50 hidden">
193
+ <div class="flex justify-between items-center p-4 border-b border-primary">
194
+ <div class="flex items-center">
195
+ <div class="w-10 h-10 bg-primary rounded-full mr-3"></div>
196
+ <span class="text-xl font-extrabold"><span class="text-[#008080]">NAGAS</span><span class="text-white">ATHLETICS</span></span>
197
+ </div>
198
+ <button id="menu-close" class="text-white">
199
+ <i data-feather="x"></i>
200
+ </button>
201
+ </div>
202
+ <nav class="p-4">
203
+ <a href="index.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">Home</a>
204
+ <a href="about.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">About</a>
205
+ <a href="teams.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">Teams</a>
206
+ <a href="schedule.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">Schedule</a>
207
+ <a href="council.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">Council</a>
208
+ <a href="news.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">News</a>
209
+ <a href="get-involved.html" class="block py-3 hover:text-primary border-b border-[#2e2e2e]">Get Involved</a>
210
+ </nav>
211
+ </div>
212
+
213
+ <!-- Main Content -->
214
+ <div class="pt-20 pb-16">
215
+ <div class="container mx-auto px-4">
216
+ <!-- Back Button -->
217
+ <a href="teams.html" class="back-button inline-flex items-center text-primary mb-6">
218
+ <i data-feather="arrow-left" class="mr-2"></i> Back to Teams
219
+ </a>
220
+
221
+ <!-- Page Title -->
222
+ <h1 class="text-3xl md:text-4xl font-bold mb-6">Junior A Girls – Volleyball</h1>
223
+
224
+ <!-- Search Bar -->
225
+ <div class="mb-8">
226
+ <input
227
+ type="text"
228
+ id="playerSearch"
229
+ placeholder="Search players by name..."
230
+ class="search-bar w-full p-3 rounded-lg text-white"
231
+ >
232
+ </div>
233
+
234
+ <!-- Player Grid -->
235
+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6" id="playerGrid">
236
+ <!-- Player Card 1 -->
237
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Sopharoth Chea">
238
+ <img src="http://static.photos/people/320x240/5" alt="Sopharoth Chea" class="w-full h-64 object-cover">
239
+ <div class="p-4">
240
+ <h3 class="text-xl font-bold">Sopharoth Chea</h3>
241
+ <p class="text-primary">Setter</p>
242
+ </div>
243
+ </div>
244
+
245
+ <!-- Player Card 2 -->
246
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Visal Sreytouch">
247
+ <img src="http://static.photos/people/320x240/7" alt="Visal Sreytouch" class="w-full h-64 object-cover">
248
+ <div class="p-4">
249
+ <h3 class="text-xl font-bold">Visal Sreytouch</h3>
250
+ <p class="text-primary">Outside Hitter</p>
251
+ </div>
252
+ </div>
253
+
254
+ <!-- Player Card 3 -->
255
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Kosal Khemarak">
256
+ <img src="http://static.photos/people/320x240/8" alt="Kosal Khemarak" class="w-full h-64 object-cover">
257
+ <div class="p-4">
258
+ <h3 class="text-xl font-bold">Kosal Khemarak</h3>
259
+ <p class="text-primary">Libero</p>
260
+ </div>
261
+ </div>
262
+
263
+ <!-- Player Card 4 -->
264
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Sethean Thay">
265
+ <img src="http://static.photos/people/320x240/6" alt="Sethean Thay" class="w-full h-64 object-cover">
266
+ <div class="p-4">
267
+ <h3 class="text-xl font-bold">Sethean Thay</h3>
268
+ <p class="text-primary">Middle Blocker</p>
269
+ </div>
270
+ </div>
271
+
272
+ <!-- Player Card 5 -->
273
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Mey Mok">
274
+ <img src="http://static.photos/people/320x240/25" alt="Mey Mok" class="w-full h-64 object-cover">
275
+ <div class="p-4">
276
+ <h3 class="text-xl font-bold">Mey Mok</h3>
277
+ <p class="text-primary">Outside Hitter</p>
278
+ </div>
279
+ </div>
280
+
281
+ <!-- Player Card 6 -->
282
+ <div class="player-card rounded-lg overflow-hidden cursor-pointer" data-player-name="Srey Pich">
283
+ <img src="http://static.photos/people/320x240/26" alt="Srey Pich" class="w-full h-64 object-cover">
284
+ <div class="p-4">
285
+ <h3 class="text-xl font-bold">Srey Pich</h3>
286
+ <p class="text-primary">Opposite Hitter</p>
287
+ </div>
288
+ </div>
289
+ </div>
290
+ </div>
291
+ </div>
292
+
293
+ <!-- Player Profile Modal -->
294
+ <div id="profile-modal" class="modal">
295
+ <div class="modal-content">
296
+ <span class="close-modal">&times;</span>
297
+ <h2 class="text-2xl font-bold mb-4" id="modal-player-name">Player Name</h2>
298
+ <p class="text-primary mb-4" id="modal-player-position">Position</p>
299
+
300
+ <!-- Carousel -->
301
+ <div class="carousel-container">
302
+ <div class="carousel-main">
303
+ <img src="" alt="Main photo" id="carousel-main-image">
304
+ <button class="carousel-arrow prev">‹</button>
305
+ <button class="carousel-arrow next">›</button>
306
+ </div>
307
+ <div class="carousel-thumbs" id="carousel-thumbnails">
308
+ <!-- Thumbnails will be added here by JavaScript -->
309
+ </div>
310
+ </div>
311
+
312
+ <div class="mt-6">
313
+ <h3 class="text-xl font-bold mb-2">Player Stats</h3>
314
+ <ul class="grid grid-cols-2 gap-2">
315
+ <li class="flex justify-between border-b border-[#2e2e2e] pb-2">
316
+ <span>Matches Played:</span>
317
+ <span id="matches-played">12</span>
318
+ </li>
319
+ <li class="flex justify-between border-b border-[#2e2e2e] pb-2">
320
+ <span>Points:</span>
321
+ <span id="points">85</span>
322
+ </li>
323
+ <li class="flex justify-between border-b border-[#2e2e2e] pb-2">
324
+ <span>Kills:</span>
325
+ <span id="kills">42</span>
326
+ </li>
327
+ <li class="flex justify-between border-b border-[#2e2e2e] pb-2">
328
+ <span>Blocks:</span>
329
+ <span id="blocks">18</span>
330
+ </li>
331
+ </ul>
332
+ </div>
333
+ </div>
334
+ </div>
335
+
336
+ <!-- Footer -->
337
+ <footer class="bg-darker py-12 border-t border-[#2e2e2e]">
338
+ <div class="container mx-auto px-4">
339
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
340
+ <div>
341
+ <h3 class="text-xl font-bold mb-4">Contact Info</h3>
342
+ <p>Northbridge International School Cambodia</p>
343
+ <p>#98C, Street 169, Phnom Penh</p>
344
+ <p>Email: info@nagas.edu.kh</p>
345
+ <p>Phone: +855 12 345 678</p>
346
+ </div>
347
+ <div>
348
+ <h3 class="text-xl font-bold mb-4">Follow Us</h3>
349
+ <div class="flex space-x-4">
350
+ <a href="#" class="text-primary hover:text-secondary">
351
+ <i data-feather="facebook"></i>
352
+ </a>
353
+ <a href="#" class="text-primary hover:text-secondary">
354
+ <i data-feather="instagram"></i>
355
+ </a>
356
+ <a href="#" class="text-primary hover:text-secondary">
357
+ <i data-feather="twitter"></i>
358
+ </a>
359
+ </div>
360
+ <p class="mt-2">@NAGAS_NISC</p>
361
+ </div>
362
+ <div>
363
+ <h3 class="text-xl font-bold mb-4">Quick Links</h3>
364
+ <ul class="space-y-2">
365
+ <li><a href="teams.html" class="hover:text-primary">Teams</a></li>
366
+ <li><a href="schedule.html" class="hover:text-primary">Schedule</a></li>
367
+ <li><a href="news.html" class="hover:text-primary">News</a></li>
368
+ <li><a href="#" class="hover:text-primary">Athlete Portal</a></li>
369
+ </ul>
370
+ </div>
371
+ </div>
372
+ <div class="border-t border-[#2e2e2e] mt-8 pt-8 text-center">
373
+ <p>&copy; 2023 NAGAS - Northbridge Athletic Groups and Sports. All rights reserved.</p>
374
+ </div>
375
+ </div>
376
+ </footer>
377
+
378
+ <script>
379
+ feather.replace();
380
+
381
+ // Mobile menu toggle
382
+ document.getElementById('menu-toggle').addEventListener('click', function() {
383
+ document.getElementById('mobile-menu').classList.remove('hidden');
384
+ });
385
+
386
+ document.getElementById('menu-close').addEventListener('click', function() {
387
+ document.getElementById('mobile-menu').classList.add('hidden');
388
+ });
389
+
390
+ // Player search functionality
391
+ document.getElementById('playerSearch').addEventListener('input', function() {
392
+ const searchTerm = this.value.toLowerCase();
393
+ const playerCards = document.querySelectorAll('.player-card');
394
+
395
+ playerCards.forEach(card => {
396
+ const playerName = card.dataset.playerName.toLowerCase();
397
+ if (playerName.includes(searchTerm)) {
398
+ card.style.display = 'block';
399
+ } else {
400
+ card.style.display = 'none';
401
+ }
402
+ });
403
+ });
404
+
405
+ // Player card click to open modal
406
+ document.querySelectorAll('.player-card').forEach(card => {
407
+ card.addEventListener('click', function() {
408
+ const playerName = this.querySelector('h3').textContent;
409
+ const playerPosition = this.querySelector('p').textContent;
410
+ const playerImage = this.querySelector('img').src;
411
+
412
+ // Set modal content
413
+ document.getElementById('modal-player-name').textContent = playerName;
414
+ document.getElementById('modal-player-position').textContent = playerPosition;
415
+ document.getElementById('carousel-main-image').src = playerImage;
416
+
417
+ // Generate thumbnails (using same image for demo)
418
+ const thumbnailsContainer = document.getElementById('carousel-thumbnails');
419
+ thumbnailsContainer.innerHTML = '';
420
+ for (let i = 0; i < 3; i++) {
421
+ const thumb = document.createElement('img');
422
+ thumb.src = playerImage;
423
+ thumb.alt = `Thumbnail ${i+1}`;
424
+ if (i === 0) thumb.classList.add('active');
425
+ thumbnailsContainer.appendChild(thumb);
426
+ }
427
+
428
+ // Show modal
429
+ document.getElementById('profile-modal').style.display = 'flex';
430
+
431
+ // Initialize carousel
432
+ initCarousel();
433
+ });
434
+ });
435
+
436
+ // Close modal
437
+ document.querySelector('.close-modal').addEventListener('click', function() {
438
+ document.getElementById('profile-modal').style.display = 'none';
439
+ });
440
+
441
+ // Close modal when clicking outside content
442
+ window.addEventListener('click', function(event) {
443
+ const modal = document.getElementById('profile-modal');
444
+ if (event.target === modal) {
445
+ modal.style.display = 'none';
446
+ }
447
+ });
448
+
449
+ // Carousel functionality
450
+ function initCarousel() {
451
+ const modal = document.getElementById('profile-modal');
452
+ const mainImg = modal.querySelector('#carousel-main-image');
453
+ const thumbs = modal.querySelectorAll('.carousel-thumbs img');
454
+ let currentIndex = 0;
455
+
456
+ // Set up carousel
457
+ thumbs.forEach((thumb, index) => {
458
+ thumb.addEventListener('click', () => {
459
+ currentIndex = index;
460
+ updateCarousel();
461
+ });
462
+ });
463
+
464
+ // Navigation arrows
465
+ modal.querySelector('.carousel-arrow.prev').addEventListener('click', () => {
466
+ currentIndex = (currentIndex > 0) ? currentIndex - 1 : thumbs.length - 1;
467
+ updateCarousel();
468
+ });
469
+
470
+ modal.querySelector('.carousel-arrow.next').addEventListener('click', () => {
471
+ currentIndex = (currentIndex < thumbs.length - 1) ? currentIndex + 1 : 0;
472
+ updateCarousel();
473
+ });
474
+
475
+ // Swipe support for mobile
476
+ let touchStartX = 0;
477
+ mainImg.addEventListener('touchstart', (e) => {
478
+ touchStartX = e.changedTouches[0].screenX;
479
+ });
480
+
481
+ mainImg.addEventListener('touchend', (e) => {
482
+ const touchEndX = e.changedTouches[0].screenX;
483
+ if (touchStartX - touchEndX > 50) { // Swipe left
484
+ currentIndex = (currentIndex < thumbs.length - 1) ? currentIndex + 1 : 0;
485
+ } else if (touchEndX - touchStartX > 50) { // Swipe right
486
+ currentIndex = (currentIndex > 0) ? currentIndex - 1 : thumbs.length - 1;
487
+ }
488
+ updateCarousel();
489
+ });
490
+
491
+ function updateCarousel() {
492
+ // Fade out current image
493
+ mainImg.style.opacity = 0;
494
+
495
+ setTimeout(() => {
496
+ // Update main image
497
+ mainImg.src = thumbs[currentIndex].src;
498
+ mainImg.style.opacity = 1;
499
+
500
+ // Update active thumbnail
501
+ thumbs.forEach((thumb, index) => {
502
+ thumb.classList.toggle('active', index === currentIndex);
503
+ });
504
+ }, 300);
505
+ }
506
+
507
+ // Initialize
508
+ updateCarousel();
509
+ }
510
+ </script>
511
+ </body>
512
+ </html>