Spaces:
Running
Running
Add 3 files
Browse files- README.md +5 -3
- index.html +598 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: podwave-pro
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,598 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Music Player Dashboard</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 |
+
<style>
|
| 10 |
+
/* Custom scrollbar */
|
| 11 |
+
.custom-scrollbar::-webkit-scrollbar {
|
| 12 |
+
width: 6px;
|
| 13 |
+
}
|
| 14 |
+
.custom-scrollbar::-webkit-scrollbar-track {
|
| 15 |
+
background: #f1f1f1;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
}
|
| 18 |
+
.custom-scrollbar::-webkit-scrollbar-thumb {
|
| 19 |
+
background: #888;
|
| 20 |
+
border-radius: 10px;
|
| 21 |
+
}
|
| 22 |
+
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
| 23 |
+
background: #555;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/* Waveform animation */
|
| 27 |
+
@keyframes wave {
|
| 28 |
+
0% { height: 5px; }
|
| 29 |
+
50% { height: 20px; }
|
| 30 |
+
100% { height: 5px; }
|
| 31 |
+
}
|
| 32 |
+
.wave-bar {
|
| 33 |
+
animation: wave 1.5s ease infinite;
|
| 34 |
+
}
|
| 35 |
+
.wave-bar:nth-child(2) { animation-delay: 0.2s; }
|
| 36 |
+
.wave-bar:nth-child(3) { animation-delay: 0.4s; }
|
| 37 |
+
.wave-bar:nth-child(4) { animation-delay: 0.6s; }
|
| 38 |
+
.wave-bar:nth-child(5) { animation-delay: 0.8s; }
|
| 39 |
+
|
| 40 |
+
/* Card container */
|
| 41 |
+
.card-container {
|
| 42 |
+
scroll-snap-type: y mandatory;
|
| 43 |
+
height: 100vh;
|
| 44 |
+
overflow-y: scroll;
|
| 45 |
+
}
|
| 46 |
+
.player-card {
|
| 47 |
+
scroll-snap-align: start;
|
| 48 |
+
margin-bottom: 1rem;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/* Playlist item hover effect */
|
| 52 |
+
.playlist-item:hover {
|
| 53 |
+
background-color: rgba(124, 58, 237, 0.1);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
/* Loading spinner */
|
| 57 |
+
.spinner {
|
| 58 |
+
animation: spin 1s linear infinite;
|
| 59 |
+
}
|
| 60 |
+
@keyframes spin {
|
| 61 |
+
0% { transform: rotate(0deg); }
|
| 62 |
+
100% { transform: rotate(360deg); }
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/* Transition effects */
|
| 66 |
+
.fade-in {
|
| 67 |
+
animation: fadeIn 0.3s ease-in;
|
| 68 |
+
}
|
| 69 |
+
@keyframes fadeIn {
|
| 70 |
+
from { opacity: 0; }
|
| 71 |
+
to { opacity: 1; }
|
| 72 |
+
}
|
| 73 |
+
</style>
|
| 74 |
+
</head>
|
| 75 |
+
<body class="bg-gray-100">
|
| 76 |
+
<div class="card-container">
|
| 77 |
+
<!-- Card 1 -->
|
| 78 |
+
<div class="player-card w-full max-w-md mx-auto bg-white rounded-3xl shadow-2xl overflow-hidden my-4">
|
| 79 |
+
<!-- Header -->
|
| 80 |
+
<div class="bg-gradient-to-r from-purple-600 to-blue-500 p-6 text-white">
|
| 81 |
+
<div class="flex justify-between items-center">
|
| 82 |
+
<h1 class="text-2xl font-bold">PodWave Pro</h1>
|
| 83 |
+
<button class="text-white hover:text-gray-200">
|
| 84 |
+
<i class="fas fa-cog"></i>
|
| 85 |
+
</button>
|
| 86 |
+
</div>
|
| 87 |
+
<p class="text-sm opacity-90 mt-1">Your premium audio experience</p>
|
| 88 |
+
</div>
|
| 89 |
+
|
| 90 |
+
<!-- RSS Input -->
|
| 91 |
+
<div class="p-4 border-b">
|
| 92 |
+
<div class="flex items-center">
|
| 93 |
+
<input
|
| 94 |
+
type="text"
|
| 95 |
+
id="rssInput1"
|
| 96 |
+
placeholder="Enter RSS feed URL..."
|
| 97 |
+
class="flex-1 px-4 py-2 rounded-l-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500"
|
| 98 |
+
>
|
| 99 |
+
<button
|
| 100 |
+
id="fetchBtn1"
|
| 101 |
+
class="bg-purple-600 text-white px-4 py-2 rounded-r-full hover:bg-purple-700 transition flex items-center justify-center"
|
| 102 |
+
>
|
| 103 |
+
<i class="fas fa-rss"></i>
|
| 104 |
+
</button>
|
| 105 |
+
</div>
|
| 106 |
+
<p class="text-xs text-gray-500 mt-1">Example: https://example.com/podcast.rss</p>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<!-- Player Section -->
|
| 110 |
+
<div class="p-6">
|
| 111 |
+
<!-- Now Playing -->
|
| 112 |
+
<div class="flex items-center mb-6">
|
| 113 |
+
<div class="w-16 h-16 bg-gradient-to-br from-purple-400 to-blue-400 rounded-lg flex items-center justify-center text-white">
|
| 114 |
+
<i class="fas fa-music text-2xl"></i>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="ml-4 flex-1">
|
| 117 |
+
<h3 id="nowPlayingTitle1" class="font-semibold text-lg">No track selected</h3>
|
| 118 |
+
<p id="nowPlayingAuthor1" class="text-sm text-gray-500">Select from playlist</p>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<!-- Progress Bar -->
|
| 123 |
+
<div class="mb-4">
|
| 124 |
+
<div class="flex justify-between text-xs text-gray-500 mb-1">
|
| 125 |
+
<span id="currentTime1">0:00</span>
|
| 126 |
+
<span id="duration1">0:00</span>
|
| 127 |
+
</div>
|
| 128 |
+
<div class="h-2 bg-gray-200 rounded-full overflow-hidden">
|
| 129 |
+
<div id="progressBar1" class="h-full bg-purple-600 rounded-full" style="width: 0%"></div>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
|
| 133 |
+
<!-- Controls -->
|
| 134 |
+
<div class="flex justify-center items-center space-x-8 mb-6">
|
| 135 |
+
<button class="text-gray-600 hover:text-purple-600">
|
| 136 |
+
<i class="fas fa-step-backward text-2xl"></i>
|
| 137 |
+
</button>
|
| 138 |
+
<button id="playBtn1" class="bg-purple-600 text-white rounded-full w-12 h-12 flex items-center justify-center hover:bg-purple-700">
|
| 139 |
+
<i class="fas fa-play text-xl"></i>
|
| 140 |
+
</button>
|
| 141 |
+
<button class="text-gray-600 hover:text-purple-600">
|
| 142 |
+
<i class="fas fa-step-forward text-2xl"></i>
|
| 143 |
+
</button>
|
| 144 |
+
</div>
|
| 145 |
+
|
| 146 |
+
<!-- Visualizer (shows when playing) -->
|
| 147 |
+
<div id="visualizer1" class="hidden flex justify-center space-x-1 h-8 items-end mb-6">
|
| 148 |
+
<div class="wave-bar w-2 bg-purple-400 rounded-t-sm" style="height: 5px;"></div>
|
| 149 |
+
<div class="wave-bar w-2 bg-purple-500 rounded-t-sm" style="height: 10px;"></div>
|
| 150 |
+
<div class="wave-bar w-2 bg-purple-600 rounded-t-sm" style="height: 15px;"></div>
|
| 151 |
+
<div class="wave-bar w-2 bg-purple-500 rounded-t-sm" style="height: 10px;"></div>
|
| 152 |
+
<div class="wave-bar w-2 bg-purple-400 rounded-t-sm" style="height: 5px;"></div>
|
| 153 |
+
</div>
|
| 154 |
+
|
| 155 |
+
<!-- Volume -->
|
| 156 |
+
<div class="flex items-center">
|
| 157 |
+
<i class="fas fa-volume-down text-gray-500 mr-2"></i>
|
| 158 |
+
<input
|
| 159 |
+
type="range"
|
| 160 |
+
id="volumeControl1"
|
| 161 |
+
min="0"
|
| 162 |
+
max="1"
|
| 163 |
+
step="0.01"
|
| 164 |
+
value="0.7"
|
| 165 |
+
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
| 166 |
+
>
|
| 167 |
+
<i class="fas fa-volume-up text-gray-500 ml-2"></i>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
|
| 171 |
+
<!-- Playlist Section -->
|
| 172 |
+
<div class="border-t">
|
| 173 |
+
<div class="flex justify-between items-center p-4">
|
| 174 |
+
<h2 class="font-semibold text-lg">Your Playlist</h2>
|
| 175 |
+
<button id="clearBtn1" class="text-sm text-purple-600 hover:text-purple-800">Clear All</button>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<div id="playlistContainer1" class="max-h-64 overflow-y-auto custom-scrollbar">
|
| 179 |
+
<div class="text-center py-8 text-gray-500">
|
| 180 |
+
<i class="fas fa-music text-4xl mb-2 opacity-30"></i>
|
| 181 |
+
<p>Your saved tracks will appear here</p>
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
|
| 185 |
+
<!-- RSS Feed Playlist Section -->
|
| 186 |
+
<div id="rssFeedSection" class="hidden border-t">
|
| 187 |
+
<div class="flex justify-between items-center p-4">
|
| 188 |
+
<h2 class="font-semibold text-lg">RSS Feed Content</h2>
|
| 189 |
+
<button id="closeRssBtn" class="text-sm text-purple-600 hover:text-purple-800">Close</button>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<div id="rssFeedContainer" class="max-h-64 overflow-y-auto custom-scrollbar">
|
| 193 |
+
<!-- RSS feed content will be loaded here -->
|
| 194 |
+
</div>
|
| 195 |
+
|
| 196 |
+
<div class="p-4 border-t">
|
| 197 |
+
<button
|
| 198 |
+
id="addAllBtn"
|
| 199 |
+
class="w-full bg-gradient-to-r from-purple-600 to-blue-500 text-white py-3 rounded-full font-medium hover:opacity-90 transition"
|
| 200 |
+
>
|
| 201 |
+
Add All to Playlist
|
| 202 |
+
</button>
|
| 203 |
+
</div>
|
| 204 |
+
</div>
|
| 205 |
+
|
| 206 |
+
<!-- Save Playlist -->
|
| 207 |
+
<div class="p-4 border-t">
|
| 208 |
+
<button
|
| 209 |
+
id="saveBtn1"
|
| 210 |
+
class="w-full bg-gradient-to-r from-purple-600 to-blue-500 text-white py-3 rounded-full font-medium hover:opacity-90 transition disabled:opacity-50"
|
| 211 |
+
disabled
|
| 212 |
+
>
|
| 213 |
+
Save Playlist
|
| 214 |
+
</button>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<script>
|
| 221 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 222 |
+
// Audio elements
|
| 223 |
+
const audio1 = new Audio();
|
| 224 |
+
let currentAudio = audio1;
|
| 225 |
+
|
| 226 |
+
// Player 1 elements
|
| 227 |
+
const playBtn1 = document.getElementById('playBtn1');
|
| 228 |
+
const progressBar1 = document.getElementById('progressBar1');
|
| 229 |
+
const currentTime1 = document.getElementById('currentTime1');
|
| 230 |
+
const duration1 = document.getElementById('duration1');
|
| 231 |
+
const volumeControl1 = document.getElementById('volumeControl1');
|
| 232 |
+
const visualizer1 = document.getElementById('visualizer1');
|
| 233 |
+
const playlistContainer1 = document.getElementById('playlistContainer1');
|
| 234 |
+
const nowPlayingTitle1 = document.getElementById('nowPlayingTitle1');
|
| 235 |
+
const nowPlayingAuthor1 = document.getElementById('nowPlayingAuthor1');
|
| 236 |
+
const fetchBtn1 = document.getElementById('fetchBtn1');
|
| 237 |
+
const rssInput1 = document.getElementById('rssInput1');
|
| 238 |
+
const clearBtn1 = document.getElementById('clearBtn1');
|
| 239 |
+
const saveBtn1 = document.getElementById('saveBtn1');
|
| 240 |
+
const rssFeedSection = document.getElementById('rssFeedSection');
|
| 241 |
+
const rssFeedContainer = document.getElementById('rssFeedContainer');
|
| 242 |
+
const closeRssBtn = document.getElementById('closeRssBtn');
|
| 243 |
+
const addAllBtn = document.getElementById('addAllBtn');
|
| 244 |
+
|
| 245 |
+
// Player state
|
| 246 |
+
let isPlaying1 = false;
|
| 247 |
+
let currentTrackIndex1 = -1;
|
| 248 |
+
let userPlaylist1 = [];
|
| 249 |
+
let rssPlaylist = [];
|
| 250 |
+
|
| 251 |
+
// Format time (seconds to MM:SS)
|
| 252 |
+
function formatTime(seconds) {
|
| 253 |
+
const mins = Math.floor(seconds / 60);
|
| 254 |
+
const secs = Math.floor(seconds % 60);
|
| 255 |
+
return `${mins}:${secs < 10 ? '0' : ''}${secs}`;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
// Update progress bar
|
| 259 |
+
function updateProgressBar() {
|
| 260 |
+
if (currentAudio.duration) {
|
| 261 |
+
const progress = (currentAudio.currentTime / currentAudio.duration) * 100;
|
| 262 |
+
progressBar1.style.width = `${progress}%`;
|
| 263 |
+
currentTime1.textContent = formatTime(currentAudio.currentTime);
|
| 264 |
+
duration1.textContent = formatTime(currentAudio.duration);
|
| 265 |
+
}
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
// Play/pause toggle
|
| 269 |
+
function togglePlayPause() {
|
| 270 |
+
if (isPlaying1) {
|
| 271 |
+
currentAudio.pause();
|
| 272 |
+
playBtn1.innerHTML = '<i class="fas fa-play text-xl"></i>';
|
| 273 |
+
visualizer1.classList.add('hidden');
|
| 274 |
+
} else {
|
| 275 |
+
currentAudio.play()
|
| 276 |
+
.then(() => {
|
| 277 |
+
playBtn1.innerHTML = '<i class="fas fa-pause text-xl"></i>';
|
| 278 |
+
visualizer1.classList.remove('hidden');
|
| 279 |
+
})
|
| 280 |
+
.catch(error => {
|
| 281 |
+
console.error('Playback failed:', error);
|
| 282 |
+
});
|
| 283 |
+
}
|
| 284 |
+
isPlaying1 = !isPlaying1;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
// Update player info
|
| 288 |
+
function updatePlayerInfo(track) {
|
| 289 |
+
nowPlayingTitle1.textContent = track.title || 'Unknown Track';
|
| 290 |
+
nowPlayingAuthor1.textContent = track.author || 'Unknown Author';
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
// Play track
|
| 294 |
+
function playTrack(track, index) {
|
| 295 |
+
currentTrackIndex1 = index;
|
| 296 |
+
currentAudio.src = track.enclosure.url;
|
| 297 |
+
currentAudio.load();
|
| 298 |
+
updatePlayerInfo(track);
|
| 299 |
+
|
| 300 |
+
currentAudio.onloadedmetadata = function() {
|
| 301 |
+
currentAudio.play()
|
| 302 |
+
.then(() => {
|
| 303 |
+
isPlaying1 = true;
|
| 304 |
+
playBtn1.innerHTML = '<i class="fas fa-pause text-xl"></i>';
|
| 305 |
+
visualizer1.classList.remove('hidden');
|
| 306 |
+
})
|
| 307 |
+
.catch(error => {
|
| 308 |
+
console.error('Playback failed:', error);
|
| 309 |
+
});
|
| 310 |
+
};
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
// Create playlist item
|
| 314 |
+
function createPlaylistItem(track, index, container, isRssItem = false) {
|
| 315 |
+
const item = document.createElement('div');
|
| 316 |
+
item.className = `playlist-item flex items-center p-3 border-b cursor-pointer transition ${isRssItem ? 'bg-gray-50' : ''}`;
|
| 317 |
+
item.dataset.index = index;
|
| 318 |
+
|
| 319 |
+
const icon = document.createElement('div');
|
| 320 |
+
icon.className = 'w-10 h-10 bg-gradient-to-br from-purple-100 to-blue-100 rounded-lg flex items-center justify-center text-purple-600 mr-3';
|
| 321 |
+
icon.innerHTML = '<i class="fas fa-music"></i>';
|
| 322 |
+
|
| 323 |
+
const info = document.createElement('div');
|
| 324 |
+
info.className = 'flex-1 min-w-0';
|
| 325 |
+
|
| 326 |
+
const title = document.createElement('h4');
|
| 327 |
+
title.className = 'font-medium truncate';
|
| 328 |
+
title.textContent = track.title || 'Unknown Track';
|
| 329 |
+
|
| 330 |
+
const author = document.createElement('p');
|
| 331 |
+
author.className = 'text-xs text-gray-500 truncate';
|
| 332 |
+
author.textContent = track.author || 'Unknown Author';
|
| 333 |
+
|
| 334 |
+
info.appendChild(title);
|
| 335 |
+
info.appendChild(author);
|
| 336 |
+
|
| 337 |
+
const duration = document.createElement('span');
|
| 338 |
+
duration.className = 'text-xs text-gray-500 ml-2';
|
| 339 |
+
duration.textContent = track.duration ? formatTime(track.duration) : '--:--';
|
| 340 |
+
|
| 341 |
+
const addBtn = document.createElement('button');
|
| 342 |
+
addBtn.className = 'ml-2 text-purple-600 hover:text-purple-800';
|
| 343 |
+
addBtn.innerHTML = isRssItem ? '<i class="fas fa-plus"></i>' : '<i class="fas fa-trash-alt"></i>';
|
| 344 |
+
addBtn.onclick = function(e) {
|
| 345 |
+
e.stopPropagation();
|
| 346 |
+
if (isRssItem) {
|
| 347 |
+
addToPlaylist(track);
|
| 348 |
+
} else {
|
| 349 |
+
removeFromPlaylist(index);
|
| 350 |
+
}
|
| 351 |
+
};
|
| 352 |
+
|
| 353 |
+
item.appendChild(icon);
|
| 354 |
+
item.appendChild(info);
|
| 355 |
+
item.appendChild(duration);
|
| 356 |
+
item.appendChild(addBtn);
|
| 357 |
+
|
| 358 |
+
item.onclick = function() {
|
| 359 |
+
if (isRssItem) {
|
| 360 |
+
playTrack(track, index);
|
| 361 |
+
} else {
|
| 362 |
+
playTrack(track, index);
|
| 363 |
+
}
|
| 364 |
+
};
|
| 365 |
+
|
| 366 |
+
container.appendChild(item);
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
// Add to playlist
|
| 370 |
+
function addToPlaylist(track) {
|
| 371 |
+
userPlaylist1.push(track);
|
| 372 |
+
renderUserPlaylist();
|
| 373 |
+
saveBtn1.disabled = false;
|
| 374 |
+
|
| 375 |
+
// Show success feedback
|
| 376 |
+
const feedback = document.createElement('div');
|
| 377 |
+
feedback.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg fade-in';
|
| 378 |
+
feedback.textContent = 'Added to playlist!';
|
| 379 |
+
document.body.appendChild(feedback);
|
| 380 |
+
|
| 381 |
+
setTimeout(() => {
|
| 382 |
+
feedback.classList.add('opacity-0');
|
| 383 |
+
setTimeout(() => feedback.remove(), 300);
|
| 384 |
+
}, 2000);
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
// Remove from playlist
|
| 388 |
+
function removeFromPlaylist(index) {
|
| 389 |
+
userPlaylist1.splice(index, 1);
|
| 390 |
+
renderUserPlaylist();
|
| 391 |
+
if (userPlaylist1.length === 0) {
|
| 392 |
+
saveBtn1.disabled = true;
|
| 393 |
+
}
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
// Render user playlist
|
| 397 |
+
function renderUserPlaylist() {
|
| 398 |
+
playlistContainer1.innerHTML = '';
|
| 399 |
+
|
| 400 |
+
if (userPlaylist1.length === 0) {
|
| 401 |
+
const emptyState = document.createElement('div');
|
| 402 |
+
emptyState.className = 'text-center py-8 text-gray-500';
|
| 403 |
+
emptyState.innerHTML = `
|
| 404 |
+
<i class="fas fa-music text-4xl mb-2 opacity-30"></i>
|
| 405 |
+
<p>Your saved tracks will appear here</p>
|
| 406 |
+
`;
|
| 407 |
+
playlistContainer1.appendChild(emptyState);
|
| 408 |
+
} else {
|
| 409 |
+
userPlaylist1.forEach((track, index) => {
|
| 410 |
+
createPlaylistItem(track, index, playlistContainer1);
|
| 411 |
+
});
|
| 412 |
+
}
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
// Render RSS feed playlist
|
| 416 |
+
function renderRssPlaylist() {
|
| 417 |
+
rssFeedContainer.innerHTML = '';
|
| 418 |
+
|
| 419 |
+
if (rssPlaylist.length === 0) {
|
| 420 |
+
const emptyState = document.createElement('div');
|
| 421 |
+
emptyState.className = 'text-center py-8 text-gray-500';
|
| 422 |
+
emptyState.innerHTML = `
|
| 423 |
+
<i class="fas fa-rss text-4xl mb-2 opacity-30"></i>
|
| 424 |
+
<p>No episodes found in this feed</p>
|
| 425 |
+
`;
|
| 426 |
+
rssFeedContainer.appendChild(emptyState);
|
| 427 |
+
} else {
|
| 428 |
+
rssPlaylist.forEach((track, index) => {
|
| 429 |
+
createPlaylistItem(track, index, rssFeedContainer, true);
|
| 430 |
+
});
|
| 431 |
+
}
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
// Fetch RSS feed
|
| 435 |
+
async function fetchRssFeed(url) {
|
| 436 |
+
try {
|
| 437 |
+
// Show loading state
|
| 438 |
+
fetchBtn1.innerHTML = '<i class="fas fa-spinner spinner"></i>';
|
| 439 |
+
fetchBtn1.disabled = true;
|
| 440 |
+
|
| 441 |
+
// Use a CORS proxy to avoid issues
|
| 442 |
+
const proxyUrl = 'https://api.allorigins.win/get?url=';
|
| 443 |
+
const response = await fetch(proxyUrl + encodeURIComponent(url));
|
| 444 |
+
const data = await response.json();
|
| 445 |
+
|
| 446 |
+
if (data.contents) {
|
| 447 |
+
const parser = new DOMParser();
|
| 448 |
+
const xmlDoc = parser.parseFromString(data.contents, "text/xml");
|
| 449 |
+
|
| 450 |
+
// Parse RSS feed
|
| 451 |
+
const items = xmlDoc.querySelectorAll('item');
|
| 452 |
+
rssPlaylist = [];
|
| 453 |
+
|
| 454 |
+
items.forEach(item => {
|
| 455 |
+
const title = item.querySelector('title')?.textContent || 'Untitled Episode';
|
| 456 |
+
const author = item.querySelector('author')?.textContent ||
|
| 457 |
+
item.querySelector('itunes\\:author, author')?.textContent ||
|
| 458 |
+
'Unknown Author';
|
| 459 |
+
const enclosure = item.querySelector('enclosure');
|
| 460 |
+
const durationText = item.querySelector('itunes\\:duration')?.textContent || '';
|
| 461 |
+
|
| 462 |
+
// Parse duration (HH:MM:SS or MM:SS or SS)
|
| 463 |
+
let duration = 0;
|
| 464 |
+
if (durationText) {
|
| 465 |
+
const parts = durationText.split(':').reverse();
|
| 466 |
+
if (parts.length >= 1) duration += parseInt(parts[0]) || 0; // seconds
|
| 467 |
+
if (parts.length >= 2) duration += (parseInt(parts[1]) || 0) * 60; // minutes
|
| 468 |
+
if (parts.length >= 3) duration += (parseInt(parts[2]) || 0) * 3600; // hours
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
if (enclosure) {
|
| 472 |
+
rssPlaylist.push({
|
| 473 |
+
title,
|
| 474 |
+
author,
|
| 475 |
+
enclosure: {
|
| 476 |
+
url: enclosure.getAttribute('url'),
|
| 477 |
+
type: enclosure.getAttribute('type')
|
| 478 |
+
},
|
| 479 |
+
duration
|
| 480 |
+
});
|
| 481 |
+
}
|
| 482 |
+
});
|
| 483 |
+
|
| 484 |
+
// Show RSS feed section
|
| 485 |
+
rssFeedSection.classList.remove('hidden');
|
| 486 |
+
renderRssPlaylist();
|
| 487 |
+
|
| 488 |
+
// Scroll to RSS section
|
| 489 |
+
setTimeout(() => {
|
| 490 |
+
rssFeedSection.scrollIntoView({ behavior: 'smooth' });
|
| 491 |
+
}, 100);
|
| 492 |
+
} else {
|
| 493 |
+
throw new Error('Invalid RSS feed');
|
| 494 |
+
}
|
| 495 |
+
} catch (error) {
|
| 496 |
+
console.error('Error fetching RSS feed:', error);
|
| 497 |
+
|
| 498 |
+
// Show error feedback
|
| 499 |
+
const feedback = document.createElement('div');
|
| 500 |
+
feedback.className = 'fixed bottom-4 right-4 bg-red-500 text-white px-4 py-2 rounded-lg shadow-lg fade-in';
|
| 501 |
+
feedback.textContent = 'Failed to load RSS feed';
|
| 502 |
+
document.body.appendChild(feedback);
|
| 503 |
+
|
| 504 |
+
setTimeout(() => {
|
| 505 |
+
feedback.classList.add('opacity-0');
|
| 506 |
+
setTimeout(() => feedback.remove(), 300);
|
| 507 |
+
}, 2000);
|
| 508 |
+
} finally {
|
| 509 |
+
// Reset button state
|
| 510 |
+
fetchBtn1.innerHTML = '<i class="fas fa-rss"></i>';
|
| 511 |
+
fetchBtn1.disabled = false;
|
| 512 |
+
}
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
// Event listeners
|
| 516 |
+
playBtn1.addEventListener('click', togglePlayPause);
|
| 517 |
+
|
| 518 |
+
volumeControl1.addEventListener('input', function() {
|
| 519 |
+
currentAudio.volume = this.value;
|
| 520 |
+
});
|
| 521 |
+
|
| 522 |
+
currentAudio.addEventListener('timeupdate', updateProgressBar);
|
| 523 |
+
|
| 524 |
+
currentAudio.addEventListener('ended', function() {
|
| 525 |
+
isPlaying1 = false;
|
| 526 |
+
playBtn1.innerHTML = '<i class="fas fa-play text-xl"></i>';
|
| 527 |
+
visualizer1.classList.add('hidden');
|
| 528 |
+
});
|
| 529 |
+
|
| 530 |
+
progressBar1.parentElement.addEventListener('click', function(e) {
|
| 531 |
+
const rect = this.getBoundingClientRect();
|
| 532 |
+
const pos = (e.clientX - rect.left) / rect.width;
|
| 533 |
+
currentAudio.currentTime = pos * currentAudio.duration;
|
| 534 |
+
});
|
| 535 |
+
|
| 536 |
+
fetchBtn1.addEventListener('click', function() {
|
| 537 |
+
const url = rssInput1.value.trim();
|
| 538 |
+
if (url) {
|
| 539 |
+
fetchRssFeed(url);
|
| 540 |
+
}
|
| 541 |
+
});
|
| 542 |
+
|
| 543 |
+
rssInput1.addEventListener('keypress', function(e) {
|
| 544 |
+
if (e.key === 'Enter') {
|
| 545 |
+
fetchBtn1.click();
|
| 546 |
+
}
|
| 547 |
+
});
|
| 548 |
+
|
| 549 |
+
clearBtn1.addEventListener('click', function() {
|
| 550 |
+
userPlaylist1 = [];
|
| 551 |
+
renderUserPlaylist();
|
| 552 |
+
saveBtn1.disabled = true;
|
| 553 |
+
});
|
| 554 |
+
|
| 555 |
+
closeRssBtn.addEventListener('click', function() {
|
| 556 |
+
rssFeedSection.classList.add('hidden');
|
| 557 |
+
});
|
| 558 |
+
|
| 559 |
+
addAllBtn.addEventListener('click', function() {
|
| 560 |
+
rssPlaylist.forEach(track => {
|
| 561 |
+
userPlaylist1.push(track);
|
| 562 |
+
});
|
| 563 |
+
renderUserPlaylist();
|
| 564 |
+
saveBtn1.disabled = false;
|
| 565 |
+
|
| 566 |
+
// Show success feedback
|
| 567 |
+
const feedback = document.createElement('div');
|
| 568 |
+
feedback.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg fade-in';
|
| 569 |
+
feedback.textContent = `Added ${rssPlaylist.length} tracks to playlist!`;
|
| 570 |
+
document.body.appendChild(feedback);
|
| 571 |
+
|
| 572 |
+
setTimeout(() => {
|
| 573 |
+
feedback.classList.add('opacity-0');
|
| 574 |
+
setTimeout(() => feedback.remove(), 300);
|
| 575 |
+
}, 2000);
|
| 576 |
+
});
|
| 577 |
+
|
| 578 |
+
saveBtn1.addEventListener('click', function() {
|
| 579 |
+
// In a real app, you would save to a database or localStorage
|
| 580 |
+
// For now, we'll just show a success message
|
| 581 |
+
|
| 582 |
+
const feedback = document.createElement('div');
|
| 583 |
+
feedback.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg fade-in';
|
| 584 |
+
feedback.textContent = 'Playlist saved successfully!';
|
| 585 |
+
document.body.appendChild(feedback);
|
| 586 |
+
|
| 587 |
+
setTimeout(() => {
|
| 588 |
+
feedback.classList.add('opacity-0');
|
| 589 |
+
setTimeout(() => feedback.remove(), 300);
|
| 590 |
+
}, 2000);
|
| 591 |
+
});
|
| 592 |
+
|
| 593 |
+
// Initialize
|
| 594 |
+
renderUserPlaylist();
|
| 595 |
+
});
|
| 596 |
+
</script>
|
| 597 |
+
<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=MarcRyan/podwave-pro" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 598 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
make sure the player is loading the rss feed playlist into its own viewport below the user playlist
|