-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindx.html
More file actions
506 lines (428 loc) · 24.8 KB
/
indx.html
File metadata and controls
506 lines (428 loc) · 24.8 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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>S-CLOUD</title>
<link rel="icon" type="image/webp" href="logo.webp">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/color-thief/2.3.2/color-thief.umd.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: { sans: ['Inter', 'sans-serif'] },
animation: { 'fade-in': 'fadeIn 0.5s ease-out' },
keyframes: { fadeIn: { '0%': { opacity: '0', transform: 'translateY(10px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } } }
},
},
}
</script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
background-color: #050505;
color: white;
-webkit-tap-highlight-color: transparent;
}
/* Hide Scrollbar but keep functionality */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
/* Dynamic Background */
.ambient-bg {
position: fixed;
inset: 0;
background: radial-gradient(circle at 50% -20%, #1e1e2e, #000000);
z-index: -2;
transition: background 1s ease;
}
/* Glass Components */
.glass-panel {
background: rgba(20, 20, 20, 0.65);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-search {
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Expanded Player Slide Animation */
#expanded-player {
transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
/* Range Slider Styling */
input[type=range] {
-webkit-appearance: none;
background: transparent;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 12px; width: 12px;
border-radius: 50%;
background: #fff;
margin-top: -5px;
box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%; height: 2px;
background: rgba(255,255,255,0.2);
border-radius: 2px;
}
/* Loading Spinner */
.loader {
border: 3px solid rgba(255,255,255,0.1);
border-left-color: #3b82f6;
border-radius: 50%;
width: 24px; height: 24px;
animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>
</head>
<body class="h-screen overflow-hidden flex flex-col">
<div class="ambient-bg" id="dynamic-bg"></div>
<header class="fixed top-0 left-0 right-0 z-30 pt-4 px-4 pb-2 bg-gradient-to-b from-black/80 to-transparent">
<div class="max-w-3xl mx-auto w-full">
<form id="search-form" class="relative group">
<input type="text" id="saavn-search-box" placeholder="Search for songs, artists..."
class="glass-search w-full text-white rounded-full py-3.5 pl-12 pr-4 focus:outline-none focus:bg-white/10 focus:border-white/20 transition-all placeholder-gray-400 text-sm font-medium shadow-lg">
<div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
<svg class="h-5 w-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
</form>
<div class="flex gap-2 overflow-x-auto hide-scrollbar mt-3 pb-2 mask-linear">
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">Hindi</button>
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">English</button>
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">Punjabi</button>
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">Trending</button>
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">Lo-Fi</button>
<button class="tag-btn whitespace-nowrap px-4 py-1.5 rounded-full text-xs font-medium bg-white/5 border border-white/5 hover:bg-white/15 transition-all text-gray-300">90s</button>
</div>
</div>
</header>
<main class="flex-1 overflow-y-auto hide-scrollbar pt-32 pb-32 px-4" id="main-scroll">
<div class="max-w-7xl mx-auto">
<div id="saavn-results" class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 md:gap-6">
</div>
<div id="load-more-container" class="hidden justify-center mt-10 mb-10">
<button id="loadmore" class="px-6 py-2 rounded-full border border-white/10 text-sm hover:bg-white/10 transition-colors">Load More</button>
</div>
</div>
</main>
<div id="mini-player" class="fixed bottom-4 left-4 right-4 z-40 transform translate-y-[150%] transition-transform duration-500">
<div class="glass-panel max-w-2xl mx-auto rounded-2xl p-2 shadow-2xl flex items-center justify-between cursor-pointer" onclick="openExpandedPlayer()">
<div class="flex items-center flex-1 min-w-0">
<img id="mini-img" src="" class="w-10 h-10 rounded-lg object-cover bg-gray-800 shadow-md">
<div class="ml-3 flex-col flex overflow-hidden">
<p id="mini-name" class="font-medium text-white text-sm truncate">Song Name</p>
<p id="mini-artist" class="text-xs text-gray-400 truncate">Artist</p>
</div>
</div>
<div class="flex items-center gap-3 pr-2" onclick="event.stopPropagation()">
<button id="mini-play-pause" class="w-8 h-8 flex items-center justify-center bg-white text-black rounded-full hover:scale-105 transition-transform">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20"><path d="M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z" /></svg>
</button>
</div>
<div class="absolute bottom-0 left-2 right-2 h-[2px] bg-white/10 rounded-full overflow-hidden">
<div id="mini-progress" class="h-full bg-white/80 w-0 transition-all duration-100"></div>
</div>
</div>
</div>
<div id="expanded-player" class="fixed inset-0 z-50 bg-black/95 backdrop-blur-3xl transform translate-y-full flex flex-col">
<div class="flex items-center justify-between p-6 mt-2">
<button onclick="closeExpandedPlayer()" class="text-white/70 hover:text-white p-2">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
</button>
<span class="text-xs font-bold tracking-widest text-white/50 uppercase">Now Playing</span>
<button class="text-white/70 hover:text-white p-2">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"></path></svg>
</button>
</div>
<div class="flex-1 flex flex-col items-center justify-center px-8 pb-10">
<div class="w-full max-w-sm aspect-square relative mb-8 group">
<img id="expanded-img" src="" class="w-full h-full object-cover rounded-[2rem] shadow-[0_20px_50px_rgba(0,0,0,0.5)] transform transition-transform duration-500 scale-100" crossorigin="anonymous">
</div>
<div class="w-full max-w-sm mb-6 text-left">
<h2 id="expanded-name" class="text-2xl font-bold text-white mb-1 line-clamp-1">Song Name</h2>
<p id="expanded-artist" class="text-lg text-white/60 line-clamp-1">Artist Name</p>
</div>
<div class="w-full max-w-sm mb-6 group">
<input type="range" id="seek-slider" min="0" max="100" value="0" class="w-full h-1 bg-white/20 rounded-lg cursor-pointer appearance-none">
<div class="flex justify-between text-xs text-white/40 font-mono mt-2">
<span id="expanded-current-time">0:00</span>
<span id="expanded-duration">0:00</span>
</div>
</div>
<div class="w-full max-w-sm flex items-center justify-between mb-8">
<button class="text-white/40 hover:text-white transition"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"></path></svg></button>
<button id="prev-btn" class="text-white hover:text-white/80 transition"><svg class="w-8 h-8" fill="currentColor" viewBox="0 0 24 24"><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/></svg></button>
<button id="expanded-play-pause" class="w-16 h-16 bg-white text-black rounded-full flex items-center justify-center hover:scale-105 transition shadow-lg shadow-white/10">
<svg class="w-8 h-8 ml-1" fill="currentColor" viewBox="0 0 20 20"><path d="M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z" /></svg>
</button>
<button id="next-btn" class="text-white hover:text-white/80 transition"><svg class="w-8 h-8" fill="currentColor" viewBox="0 0 24 24"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg></button>
<button class="text-white/40 hover:text-white transition"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg></button>
</div>
<div class="flex items-center gap-3 cursor-pointer p-2 rounded-xl bg-white/5 hover:bg-white/10 transition" onclick="toggleSlowedReverb()">
<div class="lofi-toggle w-8 h-4 bg-white/20 rounded-full relative transition-colors">
<div class="lofi-knob w-4 h-4 bg-white rounded-full shadow-sm absolute top-0 left-0 transition-transform"></div>
</div>
<span class="text-xs font-semibold text-white/60 uppercase tracking-wide">Slowed & Reverb</span>
</div>
</div>
</div>
<audio id="player" crossorigin="anonymous"></audio>
<script>
// --- Variables ---
const audio = document.getElementById('player');
const searchInput = document.getElementById('saavn-search-box');
const resultsContainer = document.getElementById('saavn-results');
const colorThief = new ColorThief();
// State
let currentQueue = [];
let currentSongIndex = -1;
let lastSearch = 'trending';
let pageIndex = 1;
let isLofi = false;
let audioContext, sourceNode, reverbNode;
// --- Logic ---
// Initialize
window.addEventListener('load', () => {
if (window.location.hash) doSearch(window.location.hash.substring(1));
else doSearch('trending');
});
// Search Handlers
document.getElementById('search-form').addEventListener('submit', (e) => {
e.preventDefault();
const q = searchInput.value.trim();
if(q) doSearch(q);
});
document.querySelectorAll('.tag-btn').forEach(btn => {
btn.addEventListener('click', () => {
searchInput.value = btn.innerText;
doSearch(btn.innerText);
});
});
document.getElementById('loadmore').addEventListener('click', () => {
doSearch(lastSearch, true);
});
// Search Function
async function doSearch(query, isNextPage = false) {
if(!isNextPage) {
window.location.hash = query;
lastSearch = query;
pageIndex = 1;
resultsContainer.innerHTML = '<div class="col-span-full flex justify-center py-20"><div class="loader"></div></div>';
document.getElementById('load-more-container').classList.add('hidden');
} else {
pageIndex++;
}
try {
// Fetching forced 320kbps via API logic usually handled by setting bitrate=4 in requests or filtering download links
const res = await fetch(`https://jiosaavn-api-privatecvc2.vercel.app/search/songs?query=${encodeURIComponent(query)}&page=${pageIndex}&limit=30`);
const data = await res.json();
if(!isNextPage) resultsContainer.innerHTML = '';
if(data.data.results.length > 0) {
currentQueue = isNextPage ? [...currentQueue, ...data.data.results] : data.data.results;
renderResults(data.data.results, isNextPage);
document.getElementById('load-more-container').classList.remove('hidden');
} else {
if(!isNextPage) resultsContainer.innerHTML = '<div class="col-span-full text-center text-white/50 py-10">No results found.</div>';
}
} catch (e) {
console.error(e);
}
}
function renderResults(songs, append) {
let html = '';
// Calculate starting index for the new batch
let startIndex = append ? currentQueue.length - songs.length : 0;
songs.forEach((song, idx) => {
// Get 320kbps link if available, else highest
let downloadUrl = song.downloadUrl.find(u => u.quality === "320kbps")?.link || song.downloadUrl[song.downloadUrl.length-1].link;
let img = song.image[2].link; // 500x500
html += `
<div class="group relative cursor-pointer animate-fade-in" onclick="playFromQueue(${startIndex + idx})">
<div class="aspect-square rounded-2xl overflow-hidden bg-white/5 relative mb-3">
<img src="${img}" class="w-full h-full object-cover transition duration-500 group-hover:scale-110 group-hover:opacity-60" loading="lazy">
<div class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition duration-300">
<div class="w-12 h-12 bg-white/20 backdrop-blur-md rounded-full flex items-center justify-center">
<svg class="w-5 h-5 text-white ml-1" fill="currentColor" viewBox="0 0 20 20"><path d="M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z" /></svg>
</div>
</div>
</div>
<h3 class="font-medium text-white text-sm truncate pr-2">${song.name}</h3>
<p class="text-xs text-gray-400 truncate">${song.primaryArtists}</p>
</div>`;
});
resultsContainer.innerHTML += html;
}
// --- Player Logic ---
function playFromQueue(index) {
currentSongIndex = index;
loadTrack(currentQueue[index]);
}
function loadTrack(track) {
// Get URL (Prefer 320kbps)
let url = track.downloadUrl.find(u => u.quality === "320kbps")?.link || track.downloadUrl[track.downloadUrl.length-1].link;
let img = track.image[2].link;
audio.src = url;
audio.play();
// Update UI
document.getElementById('mini-player').classList.remove('translate-y-[150%]');
// Mini Player Data
document.getElementById('mini-img').src = img;
document.getElementById('mini-name').innerText = track.name;
document.getElementById('mini-artist').innerText = track.primaryArtists;
// Expanded Player Data
document.getElementById('expanded-img').src = img;
document.getElementById('expanded-name').innerText = track.name;
document.getElementById('expanded-artist').innerText = track.primaryArtists;
// Extract Colors
extractColor(img);
updatePlayBtn(true);
// Re-apply lofi if active
if(isLofi) applyLofi();
}
function extractColor(imgUrl) {
const img = new Image();
img.crossOrigin = "Anonymous";
img.src = imgUrl;
img.onload = function() {
try {
const color = colorThief.getColor(img);
const rgb = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
// Apply to expanded player gradient
document.getElementById('expanded-player').style.background = `linear-gradient(to bottom, ${rgb}, #000)`;
// Apply subtle glow to body
document.getElementById('dynamic-bg').style.background = `radial-gradient(circle at 50% -20%, ${rgb}, #050505)`;
} catch (e) {
console.log("CORS blocked color extraction, using default.");
document.getElementById('expanded-player').style.background = "#050505";
}
}
}
// Controls
document.getElementById('mini-play-pause').addEventListener('click', togglePlay);
document.getElementById('expanded-play-pause').addEventListener('click', togglePlay);
document.getElementById('next-btn').addEventListener('click', () => {
if(currentSongIndex < currentQueue.length - 1) playFromQueue(currentSongIndex + 1);
});
document.getElementById('prev-btn').addEventListener('click', () => {
if(currentSongIndex > 0) playFromQueue(currentSongIndex - 1);
});
function togglePlay() {
if (audio.paused) {
audio.play();
updatePlayBtn(true);
} else {
audio.pause();
updatePlayBtn(false);
}
}
function updatePlayBtn(isPlaying) {
const pathPlay = '<path d="M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z" />';
const pathPause = '<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />';
const svg = `<svg class="w-full h-full p-2" fill="currentColor" viewBox="0 0 20 20">${isPlaying ? pathPause : pathPlay}</svg>`;
const svgBig = `<svg class="w-8 h-8 ml-${isPlaying ? '0' : '1'}" fill="currentColor" viewBox="0 0 20 20">${isPlaying ? pathPause : pathPlay}</svg>`;
document.getElementById('mini-play-pause').innerHTML = svg;
document.getElementById('expanded-play-pause').innerHTML = svgBig;
// Image Pulse
const expImg = document.getElementById('expanded-img');
if(isPlaying) expImg.classList.add('scale-105');
else expImg.classList.remove('scale-105');
}
// Progress & Seeking
audio.addEventListener('timeupdate', () => {
const per = (audio.currentTime / audio.duration) * 100;
// Mini Progress
document.getElementById('mini-progress').style.width = `${per}%`;
// Expanded Slider
const slider = document.getElementById('seek-slider');
if(document.activeElement !== slider) slider.value = per || 0;
// Time Text
document.getElementById('expanded-current-time').innerText = formatTime(audio.currentTime);
document.getElementById('expanded-duration').innerText = formatTime(audio.duration || 0);
});
document.getElementById('seek-slider').addEventListener('input', (e) => {
const time = (e.target.value / 100) * audio.duration;
audio.currentTime = time;
});
audio.addEventListener('ended', () => {
if(currentSongIndex < currentQueue.length - 1) playFromQueue(currentSongIndex + 1);
});
// Expanded Player UI
function openExpandedPlayer() {
document.getElementById('expanded-player').classList.remove('translate-y-full');
document.body.style.overflow = 'hidden'; // prevent bg scrolling
}
function closeExpandedPlayer() {
document.getElementById('expanded-player').classList.add('translate-y-full');
document.body.style.overflow = 'auto';
}
// Utils
function formatTime(s) {
const min = Math.floor(s / 60);
const sec = Math.floor(s % 60);
return `${min}:${sec < 10 ? '0' : ''}${sec}`;
}
// Lofi Logic (Web Audio API)
function toggleSlowedReverb() {
isLofi = !isLofi;
const toggle = document.querySelector('.lofi-toggle');
const knob = document.querySelector('.lofi-knob');
if(isLofi) {
toggle.classList.replace('bg-white/20', 'bg-blue-500');
knob.classList.add('translate-x-4');
applyLofi();
} else {
toggle.classList.replace('bg-blue-500', 'bg-white/20');
knob.classList.remove('translate-x-4');
removeLofi();
}
}
function applyLofi() {
if (!audioContext) {
const AudioContext = window.AudioContext || window.webkitAudioContext;
audioContext = new AudioContext();
sourceNode = audioContext.createMediaElementSource(audio);
sourceNode.connect(audioContext.destination);
}
// Reverb Logic setup (simplified impulse)
if(!reverbNode) {
reverbNode = audioContext.createConvolver();
// Create dummy impulse response
const rate = audioContext.sampleRate;
const length = rate * 2;
const impulse = audioContext.createBuffer(2, length, rate);
for (let i = 0; i < length; i++) {
impulse.getChannelData(0)[i] = (Math.random() * 2 - 1) * Math.pow(1 - i / length, 2);
impulse.getChannelData(1)[i] = (Math.random() * 2 - 1) * Math.pow(1 - i / length, 2);
}
reverbNode.buffer = impulse;
}
// Routing
sourceNode.disconnect();
const gainNode = audioContext.createGain();
gainNode.gain.value = 0.4; // Wet mix
sourceNode.connect(audioContext.destination); // Dry
sourceNode.connect(reverbNode);
reverbNode.connect(gainNode);
gainNode.connect(audioContext.destination);
audio.playbackRate = 0.85;
audio.preservesPitch = false;
}
function removeLofi() {
if(audioContext) {
audio.playbackRate = 1.0;
audio.preservesPitch = true;
// Disconnect reverb path if strictly needed, or just let playback rate handle it for basic toggle
}
}
</script>
</body>
</html>