-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
399 lines (346 loc) · 16.1 KB
/
index.html
File metadata and controls
399 lines (346 loc) · 16.1 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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ChillVox — Webplayer</title>
<link rel="icon" type="image/jpeg" href="assets/images/logo/favicon.jpg?v=3">
<!-- Custom Styles -->
<link rel="stylesheet" href="style.css">
<!-- Tailwind -->
<script src="https://cdn.tailwindcss.com"></script>
<style>
.nav-shadow {
box-shadow:
0 8px 20px rgba(255, 0, 0, 0.676),
0 4px 10px rgba(87, 0, 0, 0.833),
inset 0 0 8px rgba(73, 0, 0, 0.02);
}
</style>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
"dark-primary": "#1A1A1A",
}
}
}
}
</script>
</head>
<body class="bg-black">
<!-- ================= NAVBAR ================= -->
<header class="w-full flex justify-center items-start pt-5">
<nav id="navbar"
class="w-[94%] max-w-6xl h-16 bg-dark-primary text-white
rounded-full nav-shadow flex items-center justify-between px-6">
<!-- Menu Button -->
<button id="menu-btn"
class="-ml-3 h-500 w-500 sm:h-11 sm:w-11 bg-white text-black rounded-full
flex items-center justify-center shadow-md hover:scale-105 transition">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<line x1="10" y1="13" x2="29" y2="13" />
<line x1="10" y1="19" x2="29" y2="19" />
<line x1="10" y1="25" x2="29" y2="25" />
</svg>
</button>
<!-- SIDE MENU + OVERLAY -->
<div id="menuOverlay" class="fixed inset-0 bg-black/40 hidden z-40"></div>
<div id="sideMenu"
class="fixed top-0 left-0 h-full w-64 bg-dark-primary text-white
shadow-2xl transform -translate-x-full transition-transform duration-300 z-50">
<div class="flex items-center justify-between p-4 border-b border-gray-700">
<h3 class="text-lg font-semibold">Menu</h3>
<!-- CLOSE BUTTON -->
<button id="close-menu" aria-label="Close menu" class="text-2xl leading-none px-2">×</button>
</div>
<nav class="flex flex-col p-4 gap-2 text-lg">
<a href="index.html" class="flex items-center gap-3 p-3 rounded-md hover:bg-gray-800 transition">
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-6 9 6v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>Home</span>
</a>
<a href="about.html" class="flex items-center gap-3 p-3 rounded-md hover:bg-gray-800 transition">
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
<span>About</span>
</a>
</nav>
</div>
<!-- Logo -->
<div class="text-2xl -mr-5 font-extrabold tracking-wide select-none">
ChillVox
</div>
<!-- Search Button -->
<button id="search-btn"
class="h-12 w-12 sm:h-14 sm:w-14 text-white rounded-full
flex items-center justify-center hover:text-gray-300 transition">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
</nav>
</header>
<!-- ================ ARTIST CAROUSEL ================= -->
<div class="artist-carousel-wrapper">
<div class="artist-carousel-container">
<div id="stepSlider" class="artist-slider"></div>
</div>
</div>
<!-- ================ TRENDING SONGS ================= -->
<div class="trending-wrapper">
<h2 class="trending-title">Trending Songs</h2>
<div class="songs-scroll">
<div id="songsContainer" class="songs-container"></div>
</div>
</div>
<!-- ================ FLOATING PLAYER ================= -->
<div id="floatingPlayer" class="floating-player hidden">
<img id="playerImg" src="" class="fp-img">
<div class="fp-text">
<span id="playerTitle" class="fp-title">Song Name</span>
<div class="fp-progress">
<div id="fpBar" class="fp-bar"></div>
</div>
<span id="playerDuration" class="fp-duration">0:00</span>
</div>
<button id="playerToggle" class="fp-toggle">
<svg id="playerIcon" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path d="M6 4l12 8-12 8V4z"></path>
</svg>
</button>
</div>
<!-- Artist Slider Script -->
<script>
// artist slider
document.addEventListener('DOMContentLoaded', () => {
const artists = [
{ img: "assets/images/artists/artist1.jpg", name: "Arijit Singh" },
{ img: "assets/images/artists/artist2.jpg", name: "Shreya Ghoshal" },
{ img: "assets/images/artists/artist3.jpg", name: "Atif Aslam" },
{ img: "assets/images/artists/artist4.jpg", name: "Neha Kakkar" },
{ img: "assets/images/artists/artist5.jpg", name: "Jubin Nautiyal" }
];
const slider = document.getElementById("stepSlider");
if (!slider) return;
const CARD_WIDTH = 620;
const CARD_GAP = 24;
const STEP = CARD_WIDTH + CARD_GAP;
const slides = [...artists, ...artists];
slides.forEach(item => {
const div = document.createElement("div");
div.className = "artist-card";
div.innerHTML = `
<img src="${item.img}" class="artist-image">
<div class="artist-gradient">
<a href="#" class="artist-name">${item.name}</a>
</div>
`;
slider.appendChild(div);
});
let idx = 0;
const total = artists.length;
function moveSlide() {
idx++;
slider.style.transform = `translateX(${-idx * STEP}px)`;
if (idx === total) {
setTimeout(() => {
slider.style.transition = "none";
slider.style.transform = "translateX(0)";
idx = 0;
setTimeout(() => slider.style.transition = "transform 0.7s ease-out", 50);
}, 700);
}
}
let interval = setInterval(moveSlide, 1700);
slider.parentElement.addEventListener("mouseenter", () => clearInterval(interval));
slider.parentElement.addEventListener("mouseleave", () => {
interval = setInterval(moveSlide, 1700);
});
});
</script>
<!-- Songs + Player Controls -->
<script>
document.addEventListener('DOMContentLoaded', () => {
const songs = [
{ img: "https://m.media-amazon.com/images/I/41IiGenNngL._UXNaN_FMjpg_QL85_.jpg", title: "Dhurandhar - Title Track", file: "assets/music/dhurandhar-title-track.mp3", duration: "2:33" },
{ img: "https://i.ytimg.com/vi/-YlmnPh-6rE/maxresdefault.jpg", title: "For a reason", file: "assets/music/for-a-reason.mp3", duration: "3:03" },
{ img: "https://i.scdn.co/image/ab67616d0000b273d154ebe17fafefb73e9e51af", title: "Preet Re | Dhadak 2", file: "assets/music/preet-re.mp3", duration: "3:13" },
{ img: "song4.jpg", title: "Coming Soon", file: "song4.mp3", duration: "3:20" },
{ img: "song5.jpg", title: "Coming Soon", file: "song5.mp3", duration: "5:00" }
];
const container = document.getElementById("songsContainer");
const floatingPlayer = document.getElementById("floatingPlayer");
const playerImg = document.getElementById("playerImg");
const playerTitle = document.getElementById("playerTitle");
const playerDuration = document.getElementById("playerDuration");
const playerToggle = document.getElementById("playerToggle");
const playerIcon = document.getElementById("playerIcon");
const fpBar = document.getElementById("fpBar");
if (!container) return;
let currentAudio = null;
let currentSong = null;
let activeBtn = null;
songs.forEach((song, i) => {
const card = document.createElement("div");
card.className = "song-card";
card.innerHTML = `
<img src="${song.img}" class="song-img">
<div class="song-info">
<span class="song-title">${song.title}</span>
<button class="song-playbtn" data-i="${i}">
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="22"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path d="M6 4l12 8-12 8V4z"></path>
</svg>
</button>
</div>
`;
container.appendChild(card);
const btn = card.querySelector(".song-playbtn");
btn.addEventListener("click", () => {
// toggle icon on the clicked button and sync old
if (currentAudio && currentAudio !== song.audio) {
currentAudio.pause();
if (activeBtn) activeBtn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="21" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4l12 8-12 8V4z"></path></svg>`;
activeBtn = null;
}
if (!song.audio) song.audio = new Audio(song.file);
if (song.audio.paused) {
song.audio.play().catch(()=>{}); // ignore autoplay block errors
currentAudio = song.audio;
currentSong = song;
showFloatingPlayer(song);
setPlayerIcon(true);
btn.innerHTML = `<svg width="18" height="18" fill="white"><rect x="4" y="4" width="4" height="12"/><rect x="10" y="4" width="4" height="12"/></svg>`;
activeBtn = btn;
} else {
song.audio.pause();
setPlayerIcon(false);
btn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="21" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4l12 8-12 8V4z"></path></svg>`;
activeBtn = null;
}
song.audio.onended = () => {
setPlayerIcon(false);
if (btn) btn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="21" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4l12 8-12 8V4z"></path></svg>`;
activeBtn = null;
};
});
});
function showFloatingPlayer(song) {
playerImg.src = song.img;
playerTitle.textContent = song.title;
playerDuration.textContent = song.duration;
floatingPlayer.classList.remove("hidden");
}
function setPlayerIcon(isPlaying) {
playerIcon.innerHTML = isPlaying
? '<path d="M6 4h4v16H6zM14 4h4v16h-4z"></path>'
: '<path d="M6 4l12 8-12 8V4z"></path>';
}
// big toggle on floating player
if (playerToggle) {
playerToggle.addEventListener('click', () => {
if (!currentAudio) return;
if (currentAudio.paused) {
currentAudio.play().catch(()=>{});
setPlayerIcon(true);
} else {
currentAudio.pause();
setPlayerIcon(false);
}
});
}
// progress bar + remaining timer
setInterval(() => {
if (currentAudio && currentAudio.duration) {
if (fpBar) {
const percent = (currentAudio.currentTime / currentAudio.duration) * 100;
fpBar.style.width = percent + "%";
}
const remaining = Math.max(0, currentAudio.duration - currentAudio.currentTime);
let m = Math.floor(remaining / 60);
let s = Math.floor(remaining % 60);
if (s < 10) s = "0" + s;
if (playerDuration) playerDuration.textContent = `${m}:${s}`;
}
}, 300);
});
</script>
<!-- SIDE MENU SCRIPT (only one) -->
<script>
document.addEventListener('DOMContentLoaded', () => {
const sideMenu = document.getElementById('sideMenu');
const menuBtn = document.getElementById('menu-btn');
const closeMenu = document.getElementById('close-menu');
const overlay = document.getElementById('menuOverlay');
if (!sideMenu || !menuBtn || !closeMenu || !overlay) {
console.warn('Menu elements missing - sideMenu wiring skipped.');
return;
}
function openMenu() {
sideMenu.classList.remove('-translate-x-full');
overlay.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
function closeMenuFn() {
sideMenu.classList.add('-translate-x-full');
overlay.classList.add('hidden');
document.body.style.overflow = '';
}
menuBtn.addEventListener('click', (e) => {
e.stopPropagation();
if (sideMenu.classList.contains('-translate-x-full')) openMenu();
else closeMenuFn();
});
closeMenu.addEventListener('click', closeMenuFn);
overlay.addEventListener('click', closeMenuFn);
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeMenuFn();
});
// close when clicking any nav link inside menu
sideMenu.querySelectorAll('a').forEach(a => a.addEventListener('click', closeMenuFn));
});
</script>
<!-- Footer -->
<footer class="text-gray-600 body-font">
<div class="container px-5 py-8 mx-auto flex items-center sm:flex-row flex-col">
<img src="assets/images/logo/nocbiologo4.png" width="20%">
<p class="text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l-2 sm:border-gray-200 sm:py-2 sm:mt-0 mt-4">© 2025 ChillVox —
<a href="https://instagram.com/nocbioindia" class="text-gray-600 ml-1" rel="noopener noreferrer" target="_blank">@nocbioindia</a>
</p>
<span class="inline-flex sm:ml-auto sm:mt-0 mt-4 justify-center sm:justify-start">
<a class="text-gray-500">
<svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<rect width="20" height="20" x="2" y="2" rx="5" ry="5"></rect>
<path d="M16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zm1.5-4.87h.01"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="0" class="w-5 h-5" viewBox="0 0 24 24">
<path stroke="none" d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"></path>
<circle cx="4" cy="4" r="2" stroke="none"></circle>
</svg>
</a>
</span>
</div>
</footer>
</body>
</html>