File size: 18,103 Bytes
ecedb20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25d6cc9
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="theme-color" content="#1a1a2e">
    <meta name="description" content="Premium Music Streaming - Ad-free high quality audio, offline downloads, lyrics, and personalized recommendations">
    <title>Harmony+ | Premium Music Streaming</title>
    <link rel="manifest" href="/manifest.json">
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <style>
        .player-container {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        }
        .playlist-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }
        .progress-bar {
            height: 4px;
            background: rgba(255, 255, 255, 0.2);
        }
        .progress {
            height: 100%;
            background: #f72585;
        }
        .blur-bg {
            backdrop-filter: blur(10px);
            background: rgba(0, 0, 0, 0.5);
        }
    </style>
</head>
<body class="bg-gray-900 text-white min-h-screen">
    <div id="vanta-bg" class="fixed inset-0 z-0"></div>
    
    <div class="relative z-10 max-w-6xl mx-auto px-4 py-8">
        <!-- Header -->
        <header class="flex justify-between items-center mb-10">
            <div class="flex items-center">
                <i data-feather="music" class="text-pink-500 mr-2"></i>
                <h1 class="text-2xl font-bold bg-gradient-to-r from-pink-500 to-purple-600 bg-clip-text text-transparent">Harmony+</h1>
            </div>
            <div class="flex space-x-4">
                <button class="bg-pink-600 hover:bg-pink-700 px-4 py-2 rounded-full flex items-center">
                    <i data-feather="user" class="mr-2"></i>
                    Login
                </button>
            </div>
        </header>

        <!-- Main Content -->
        <main class="grid grid-cols-1 lg:grid-cols-3 gap-8">
            <!-- Playlist Input Section -->
            <div class="lg:col-span-2">
                <div class="player-container rounded-xl p-6 shadow-xl mb-8" data-aos="fade-up">
                    <h2 class="text-xl font-semibold mb-4">Discover Premium Music</h2>
                    <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                        <div class="bg-gradient-to-br from-pink-600 to-purple-700 p-4 rounded-lg cursor-pointer hover:scale-105 transition-transform">
                            <i data-feather="trending-up" class="w-6 h-6 mb-2"></i>
                            <h3 class="font-medium">Trending Now</h3>
                        </div>
                        <div class="bg-gradient-to-br from-blue-600 to-indigo-700 p-4 rounded-lg cursor-pointer hover:scale-105 transition-transform">
                            <i data-feather="activity" class="w-6 h-6 mb-2"></i>
                            <h3 class="font-medium">Workout Mix</h3>
                        </div>
                        <div class="bg-gradient-to-br from-green-600 to-teal-700 p-4 rounded-lg cursor-pointer hover:scale-105 transition-transform">
                            <i data-feather="moon" class="w-6 h-6 mb-2"></i>
                            <h3 class="font-medium">Chill Vibes</h3>
                        </div>
                        <div class="bg-gradient-to-br from-yellow-600 to-orange-700 p-4 rounded-lg cursor-pointer hover:scale-105 transition-transform">
                            <i data-feather="book" class="w-6 h-6 mb-2"></i>
                            <h3 class="font-medium">Focus Flow</h3>
                        </div>
                    </div>
                </div>

                <!-- Now Playing -->
                <div class="player-container rounded-xl p-6 shadow-xl" data-aos="fade-up" data-aos-delay="100">
                    <div class="flex justify-between items-center mb-4">
                        <div class="flex space-x-2">
                            <span class="text-xs bg-pink-600 px-2 py-1 rounded-full">PREMIUM</span>
                            <span class="text-xs bg-gray-700 px-2 py-1 rounded-full">HQ Audio</span>
                        </div>
                        <button class="text-gray-400 hover:text-white">
                            <i data-feather="download" class="w-5 h-5"></i>
                        </button>
                    </div>
                    <div class="flex items-center mb-6">
                        <img src="http://static.photos/music/640x360/1" id="current-track-art" class="w-24 h-24 rounded-lg object-cover mr-4">
                        <div>
                            <h3 id="current-track-title" class="text-xl font-bold">No track selected</h3>
                            <p id="current-track-artist" class="text-gray-400">Select a playlist first</p>
                        </div>
                    </div>

                    <div class="progress-bar rounded-full mb-4">
                        <div class="progress rounded-full w-0"></div>
                    </div>

                    <div class="flex justify-between items-center">
                        <span id="current-time" class="text-sm text-gray-400">0:00</span>
                        <span id="duration" class="text-sm text-gray-400">0:00</span>
                    </div>

                    <div class="flex justify-center items-center mt-6 space-x-8">
                        <button class="text-gray-400 hover:text-white">
                            <i data-feather="repeat" class="w-5 h-5"></i>
                        </button>
                        <button class="text-gray-400 hover:text-white">
                            <i data-feather="skip-back" class="w-6 h-6"></i>
                        </button>
                        <button id="play-btn" class="bg-pink-600 hover:bg-pink-700 w-12 h-12 rounded-full flex items-center justify-center">
                            <i data-feather="play" class="w-6 h-6"></i>
                        </button>
                        <button class="text-gray-400 hover:text-white">
                            <i data-feather="skip-forward" class="w-6 h-6"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- Playlist & Lyrics Section -->
            <div class="lg:col-span-1 space-y-6">
                <div class="player-container rounded-xl p-6 shadow-xl" data-aos="fade-up" data-aos-delay="200">
                    <h2 class="text-xl font-semibold mb-4">Lyrics</h2>
                    <div class="text-center py-10 text-gray-500">
                        <i data-feather="mic" class="w-8 h-8 mx-auto mb-2"></i>
                        <p>Lyrics available for premium tracks</p>
                        <p class="text-sm">Play a song to view synchronized lyrics</p>
                    </div>
                </div>
                
                <div class="player-container rounded-xl p-6 shadow-xl" data-aos="fade-up" data-aos-delay="300">
                <div class="player-container rounded-xl p-6 shadow-xl h-full" data-aos="fade-up" data-aos-delay="200">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-semibold">Playlist</h2>
                        <button id="shuffle-btn" class="text-gray-400 hover:text-white flex items-center">
                            <i data-feather="shuffle" class="w-4 h-4 mr-1"></i> Shuffle
                        </button>
                    </div>
                    
                    <div id="playlist-container" class="overflow-y-auto max-h-96">
                        <div class="text-center py-10 text-gray-500">
                            <i data-feather="music" class="w-8 h-8 mx-auto mb-2"></i>
                            <p>No playlist loaded</p>
                            <p class="text-sm">Paste a YouTube Music playlist URL above</p>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <script>
        // Register service worker for PWA
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', () => {
                navigator.serviceWorker.register('/sw.js')
                    .then(registration => {
                        console.log('ServiceWorker registration successful');
                    })
                    .catch(err => {
                        console.log('ServiceWorker registration failed: ', err);
                    });
            });
        }

        // Show install prompt
        let deferredPrompt;
        window.addEventListener('beforeinstallprompt', (e) => {
            e.preventDefault();
            deferredPrompt = e;
            
            // Show install button
            const installBtn = document.createElement('button');
            installBtn.className = 'bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-full flex items-center ml-4';
            installBtn.innerHTML = '<i data-feather="download" class="mr-2"></i> Install App';
            installBtn.addEventListener('click', async () => {
                deferredPrompt.prompt();
                const { outcome } = await deferredPrompt.userChoice;
                if (outcome === 'accepted') {
                    installBtn.remove();
                }
                deferredPrompt = null;
            });
            document.querySelector('header div.flex.space-x-4').appendChild(installBtn);
            feather.replace();
        });

        // Initialize animations and icons
        document.addEventListener('DOMContentLoaded', function() {
            AOS.init();
            feather.replace();

            // Vanta.js background
            VANTA.GLOBE({
                el: "#vanta-bg",
                mouseControls: true,
                touchControls: true,
                gyroControls: false,
                minHeight: 200.00,
                minWidth: 200.00,
                scale: 1.00,
                scaleMobile: 1.00,
                color: 0xf72585,
                backgroundColor: 0x111827,
                size: 0.8
            });

            // Mock player functionality
            const playBtn = document.getElementById('play-btn');
            let isPlaying = false;

            playBtn.addEventListener('click', function() {
                isPlaying = !isPlaying;
                if (isPlaying) {
                    playBtn.innerHTML = '<i data-feather="pause" class="w-6 h-6"></i>';
                    feather.replace();
                    simulatePlayback();
                } else {
                    playBtn.innerHTML = '<i data-feather="play" class="w-6 h-6"></i>';
                    feather.replace();
                    clearInterval(playbackInterval);
                }
            });

            // Mock playlist loading
            const loadBtn = document.getElementById('load-playlist');
            loadBtn.addEventListener('click', function() {
                const url = document.getElementById('playlist-url').value;
                if (url) {
                    loadMockPlaylist();
                } else {
                    alert('Please enter a YouTube Music playlist URL');
                }
            });

            function loadMockPlaylist() {
                const playlistContainer = document.getElementById('playlist-container');
                playlistContainer.innerHTML = '';

                // Mock playlist data
                const mockPlaylist = [
                    { title: "Blinding Lights", artist: "The Weeknd", duration: "3:20", art: "http://static.photos/music/200x200/1" },
                    { title: "Save Your Tears", artist: "The Weeknd", duration: "3:35", art: "http://static.photos/music/200x200/2" },
                    { title: "Stay", artist: "The Kid LAROI, Justin Bieber", duration: "2:21", art: "http://static.photos/music/200x200/3" },
                    { title: "good 4 u", artist: "Olivia Rodrigo", duration: "2:58", art: "http://static.photos/music/200x200/4" },
                    { title: "Levitating", artist: "Dua Lipa", duration: "3:23", art: "http://static.photos/music/200x200/5" },
                    { title: "Montero", artist: "Lil Nas X", duration: "2:17", art: "http://static.photos/music/200x200/6" },
                    { title: "Peaches", artist: "Justin Bieber", duration: "3:18", art: "http://static.photos/music/200x200/7" },
                    { title: "Kiss Me More", artist: "Doja Cat ft. SZA", duration: "3:28", art: "http://static.photos/music/200x200/8" },
                ];

                mockPlaylist.forEach((track, index) => {
                    const trackElement = document.createElement('div');
                    trackElement.className = 'playlist-item flex items-center p-3 rounded-lg cursor-pointer mb-2';
                    trackElement.innerHTML = `
                        <img src="${track.art}" class="w-10 h-10 rounded mr-3">
                        <div class="flex-grow">
                            <div class="font-medium">${track.title}</div>
                            <div class="text-sm text-gray-400">${track.artist}</div>
                        </div>
                        <div class="text-gray-400 text-sm">${track.duration}</div>
                    `;
                    trackElement.addEventListener('click', function() {
                        playTrack(track, index);
                    });
                    playlistContainer.appendChild(trackElement);
                });

                // Play the first track
                if (mockPlaylist.length > 0) {
                    playTrack(mockPlaylist[0], 0);
                }
            }

            let currentTrackIndex = 0;
            let playbackInterval;

            function playTrack(track, index) {
                currentTrackIndex = index;
                document.getElementById('current-track-title').textContent = track.title;
                document.getElementById('current-track-artist').textContent = track.artist;
                document.getElementById('current-track-art').src = track.art;
                
                // Reset playback
                document.querySelector('.progress').style.width = '0%';
                document.getElementById('current-time').textContent = '0:00';
                
                // Parse duration (mock)
                const durationParts = track.duration.split(':');
                const durationSeconds = parseInt(durationParts[0]) * 60 + parseInt(durationParts[1]);
                document.getElementById('duration').textContent = track.duration;
                
                // Update play button
                isPlaying = false;
                playBtn.innerHTML = '<i data-feather="play" class="w-6 h-6"></i>';
                feather.replace();
                
                // Highlight current track in playlist
                const playlistItems = document.querySelectorAll('.playlist-item');
                playlistItems.forEach(item => item.classList.remove('bg-gray-800'));
                playlistItems[index].classList.add('bg-gray-800');
            }

            function simulatePlayback() {
                const progressBar = document.querySelector('.progress');
                const currentTime = document.getElementById('current-time');
                const duration = document.getElementById('duration').textContent;
                
                // Parse duration (mock)
                const durationParts = duration.split(':');
                const durationSeconds = parseInt(durationParts[0]) * 60 + parseInt(durationParts[1]);
                
                let currentSeconds = 0;
                progressBar.style.width = '0%';
                
                playbackInterval = setInterval(() => {
                    currentSeconds++;
                    const progressPercent = (currentSeconds / durationSeconds) * 100;
                    progressBar.style.width = `${progressPercent}%`;
                    
                    // Format current time
                    const minutes = Math.floor(currentSeconds / 60);
                    const seconds = currentSeconds % 60;
                    currentTime.textContent = `${minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
                    
                    if (currentSeconds >= durationSeconds) {
                        clearInterval(playbackInterval);
                        // Play next track
                        const playlistItems = document.querySelectorAll('.playlist-item');
                        if (currentTrackIndex < playlistItems.length - 1) {
                            playlistItems[currentTrackIndex + 1].click();
                            playBtn.click(); // Auto play next track
                        } else {
                            playBtn.innerHTML = '<i data-feather="play" class="w-6 h-6"></i>';
                            feather.replace();
                        }
                    }
                }, 1000);
            }

            // Shuffle functionality
            document.getElementById('shuffle-btn').addEventListener('click', function() {
                const playlistContainer = document.getElementById('playlist-container');
                const items = Array.from(playlistContainer.children);
                
                // Fisher-Yates shuffle algorithm
                for (let i = items.length - 1; i > 0; i--) {
                    const j = Math.floor(Math.random() * (i + 1));
                    playlistContainer.insertBefore(items[j], items[i]);
                }
            });
        });
    </script>
</body>
</html>