Spaces:
Running
Running
| <html lang="de"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>RadioFlow | Dein Deutsches Online Radio</title> | |
| <!-- Google Fonts Import --> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap" rel="stylesheet"> | |
| <!-- Material Icons Import --> | |
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet"> | |
| <style> | |
| :root { | |
| --primary: #6366f1; | |
| --secondary: #ec4899; | |
| --accent: #8b5cf6; | |
| --dark-bg: #0f172a; | |
| --card-bg: rgba(30, 41, 59, 0.7); | |
| --text-main: #f8fafc; | |
| --text-muted: #94a3b8; | |
| --glass-border: rgba(255, 255, 255, 0.1); | |
| --glass-shine: rgba(255, 255, 255, 0.05); | |
| --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Outfit', sans-serif; | |
| background-color: var(--dark-bg); | |
| background-image: | |
| radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%), | |
| radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%); | |
| color: var(--text-main); | |
| min-height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| overflow-x: hidden; | |
| } | |
| /* --- Header --- */ | |
| header { | |
| padding: 1.5rem 2rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| backdrop-filter: blur(10px); | |
| background: rgba(15, 23, 42, 0.6); | |
| border-bottom: 1px solid var(--glass-border); | |
| position: sticky; | |
| top: 0; | |
| z-index: 100; | |
| } | |
| .logo { | |
| font-size: 1.8rem; | |
| font-weight: 800; | |
| background: linear-gradient(135deg, var(--primary), var(--secondary)); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .logo span { | |
| font-size: 1.5rem; | |
| } | |
| .built-with { | |
| font-size: 0.9rem; | |
| color: var(--text-muted); | |
| text-decoration: none; | |
| padding: 0.5rem 1rem; | |
| border: 1px solid var(--glass-border); | |
| border-radius: 20px; | |
| transition: var(--transition); | |
| } | |
| .built-with:hover { | |
| border-color: var(--primary); | |
| color: var(--primary); | |
| background: var(--glass-shine); | |
| } | |
| /* --- Main Content --- */ | |
| main { | |
| flex: 1; | |
| padding: 2rem; | |
| max-width: 1400px; | |
| margin: 0 auto; | |
| width: 100%; | |
| padding-bottom: 160px; /* Space for player */ | |
| } | |
| .hero { | |
| text-align: center; | |
| margin-bottom: 3rem; | |
| animation: fadeIn 0.8s ease-out; | |
| } | |
| .hero h1 { | |
| font-size: 3rem; | |
| margin-bottom: 0.5rem; | |
| line-height: 1.2; | |
| } | |
| .hero p { | |
| color: var(--text-muted); | |
| font-size: 1.2rem; | |
| } | |
| /* --- Filter Tags --- */ | |
| .filters { | |
| display: flex; | |
| justify-content: center; | |
| gap: 1rem; | |
| margin-bottom: 2.5rem; | |
| flex-wrap: wrap; | |
| } | |
| .filter-btn { | |
| background: var(--card-bg); | |
| border: 1px solid var(--glass-border); | |
| color: var(--text-muted); | |
| padding: 0.6rem 1.5rem; | |
| border-radius: 30px; | |
| cursor: pointer; | |
| transition: var(--transition); | |
| font-weight: 500; | |
| backdrop-filter: blur(5px); | |
| } | |
| .filter-btn:hover, .filter-btn.active { | |
| background: var(--primary); | |
| color: white; | |
| border-color: var(--primary); | |
| box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); | |
| } | |
| /* --- Card Grid --- */ | |
| .station-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); | |
| gap: 2rem; | |
| } | |
| .card { | |
| background: var(--card-bg); | |
| border: 1px solid var(--glass-border); | |
| border-radius: 20px; | |
| overflow: hidden; | |
| transition: var(--transition); | |
| position: relative; | |
| cursor: pointer; | |
| backdrop-filter: blur(10px); | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .card:hover { | |
| transform: translateY(-8px); | |
| box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); | |
| border-color: rgba(255, 255, 255, 0.2); | |
| } | |
| .card.playing { | |
| border-color: var(--secondary); | |
| box-shadow: 0 0 20px rgba(236, 72, 153, 0.2); | |
| } | |
| .card-image-wrapper { | |
| position: relative; | |
| width: 100%; | |
| padding-top: 60%; /* Aspect Ratio */ | |
| overflow: hidden; | |
| } | |
| .card-image { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| transition: transform 0.5s ease; | |
| } | |
| .card:hover .card-image { | |
| transform: scale(1.1); | |
| } | |
| .card-overlay { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background: rgba(0, 0, 0, 0.3); | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| opacity: 0; | |
| transition: var(--transition); | |
| } | |
| .card:hover .card-overlay { | |
| opacity: 1; | |
| } | |
| .play-btn-overlay { | |
| background: white; | |
| color: var(--primary); | |
| width: 60px; | |
| height: 60px; | |
| border-radius: 50%; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| font-size: 2rem; | |
| box-shadow: 0 4px 20px rgba(0,0,0,0.3); | |
| transform: scale(0.8); | |
| transition: var(--transition); | |
| } | |
| .card:hover .play-btn-overlay { | |
| transform: scale(1); | |
| } | |
| .card-info { | |
| padding: 1.5rem; | |
| flex: 1; | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: space-between; | |
| } | |
| .station-genre { | |
| font-size: 0.75rem; | |
| text-transform: uppercase; | |
| letter-spacing: 1px; | |
| color: var(--secondary); | |
| font-weight: 700; | |
| margin-bottom: 0.5rem; | |
| } | |
| .station-name { | |
| font-size: 1.25rem; | |
| font-weight: 600; | |
| margin-bottom: 0.5rem; | |
| line-height: 1.3; | |
| } | |
| .station-meta { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| color: var(--text-muted); | |
| font-size: 0.85rem; | |
| } | |
| /* --- Player Bar --- */ | |
| .player-bar { | |
| position: fixed; | |
| bottom: 2rem; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| width: 90%; | |
| max-width: 800px; | |
| background: rgba(15, 23, 42, 0.85); | |
| backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| border-radius: 24px; | |
| padding: 1rem 2rem; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| box-shadow: 0 20px 50px rgba(0,0,0,0.5); | |
| z-index: 1000; | |
| transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); | |
| opacity: 0; | |
| pointer-events: none; | |
| } | |
| .player-bar.active { | |
| opacity: 1; | |
| transform: translateX(-50%) translateY(0); | |
| pointer-events: all; | |
| } | |
| .player-info { | |
| display: flex; | |
| align-items: center; | |
| gap: 1rem; | |
| width: 40%; | |
| } | |
| .player-art { | |
| width: 50px; | |
| height: 50px; | |
| border-radius: 12px; | |
| background: #333; | |
| object-fit: cover; | |
| box-shadow: 0 4px 10px rgba(0,0,0,0.2); | |
| } | |
| .player-text { | |
| display: flex; | |
| flex-direction: column; | |
| overflow: hidden; | |
| } | |
| .player-title { | |
| font-weight: 600; | |
| white-space: nowrap; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| } | |
| .player-status { | |
| font-size: 0.75rem; | |
| color: var(--accent); | |
| display: flex; | |
| align-items: center; | |
| gap: 5px; | |
| } | |
| /* Visualizer Bars */ | |
| .visualizer { | |
| display: flex; | |
| gap: 2px; | |
| height: 12px; | |
| align-items: flex-end; | |
| } | |
| .bar { | |
| width: 3px; | |
| background: var(--secondary); | |
| animation: bounce 0.5s infinite ease-in-out alternate; | |
| } | |
| .bar:nth-child(2) { animation-delay: 0.1s; height: 60%; } | |
| .bar:nth-child(3) { animation-delay: 0.2s; height: 80%; } | |
| .bar:nth-child(4) { animation-delay: 0.3s; height: 50%; } | |
| @keyframes bounce { | |
| 0% { height: 20%; opacity: 0.5; } | |
| 100% { height: 100%; opacity: 1; } | |
| } | |
| .paused .bar { | |
| animation-play-state: paused; | |
| height: 20%; | |
| opacity: 0.3; | |
| } | |
| .player-controls { | |
| display: flex; | |
| align-items: center; | |
| gap: 1.5rem; | |
| } | |
| .ctrl-btn { | |
| background: none; | |
| border: none; | |
| color: var(--text-main); | |
| cursor: pointer; | |
| transition: var(--transition); | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .ctrl-btn:hover { | |
| color: var(--primary); | |
| } | |
| .play-pause-btn { | |
| width: 50px; | |
| height: 50px; | |
| border-radius: 50%; | |
| background: var(--primary); | |
| color: white; | |
| box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); | |
| } | |
| .play-pause-btn:hover { | |
| background: var(--secondary); | |
| color: white; | |
| transform: scale(1.1); | |
| } | |
| .volume-container { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| width: 100px; | |
| } | |
| input[type="range"] { | |
| -webkit-appearance: none; | |
| width: 100%; | |
| height: 4px; | |
| border-radius: 2px; | |
| background: rgba(255,255,255,0.2); | |
| outline: none; | |
| } | |
| input[type="range"]::-webkit-slider-thumb { | |
| -webkit-appearance: none; | |
| width: 12px; | |
| height: 12px; | |
| border-radius: 50%; | |
| background: white; | |
| cursor: pointer; | |
| transition: var(--transition); | |
| } | |
| input[type="range"]::-webkit-slider-thumb:hover { | |
| transform: scale(1.2); | |
| } | |
| /* --- Animations --- */ | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(20px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| /* --- Responsive --- */ | |
| @media (max-width: 768px) { | |
| .hero h1 { font-size: 2rem; } | |
| .player-bar { | |
| flex-direction: column; | |
| gap: 1rem; | |
| bottom: 1rem; | |
| padding: 1rem; | |
| } | |
| .player-info { width: 100%; justify-content: center; text-align: center; } | |
| .player-controls { width: 100%; justify-content: space-between; } | |
| .volume-container { width: 80px; } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <div class="logo"> | |
| <span class="material-icons-round">radio</span> | |
| RadioFlow | |
| </div> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with"> | |
| Built with anycoder | |
| </a> | |
| </header> | |
| <main> | |
| <div class="hero"> | |
| <h1>Entdecke den Sound Deutschlands</h1> | |
| <p>Top Sender, beste Qualität. Echtzeit-Streaming.</p> | |
| </div> | |
| <div class="filters"> | |
| <button class="filter-btn active" onclick="filterStations('all')">Alle</button> | |
| <button class="filter-btn" onclick="filterStations('Pop')">Pop</button> | |
| <button class="filter-btn" onclick="filterStations('Rock')">Rock</button> | |
| <button class="filter-btn" onclick="filterStations('News')">News</button> | |
| <button class="filter-btn" onclick="filterStations('Techno')">Techno</button> | |
| </div> | |
| <div class="station-grid" id="stationGrid"> | |
| <!-- Cards will be injected here via JS --> | |
| </div> | |
| </main> | |
| <!-- Player Bar --> | |
| <div class="player-bar" id="playerBar"> | |
| <div class="player-info"> | |
| <img src="" alt="Logo" class="player-art" id="playerArt"> | |
| <div class="player-text"> | |
| <div class="player-title" id="playerTitle">Sender Name</div> | |
| <div class="player-status"> | |
| <div class="visualizer paused" id="visualizer"> | |
| <div class="bar"></div> | |
| <div class="bar"></div> | |
| <div class="bar"></div> | |
| <div class="bar"></div> | |
| </div> | |
| <span id="playerStateText">Live</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="player-controls"> | |
| <button class="ctrl-btn" onclick="stopRadio()" title="Stop"> | |
| <span class="material-icons-round">stop</span> | |
| </button> | |
| <button class="ctrl-btn play-pause-btn" onclick="togglePlay()" id="mainPlayBtn"> | |
| <span class="material-icons-round" id="mainPlayIcon">play_arrow</span> | |
| </button> | |
| <div class="volume-container"> | |
| <span class="material-icons-round" style="font-size: 18px; color: var(--text-muted);">volume_up</span> | |
| <input type="range" min="0" max="1" step="0.1" value="0.8" oninput="setVolume(this.value)"> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Radio Station Data | |
| const stations = [ | |
| { | |
| name: "Antenne Bayern", | |
| genre: "Pop", | |
| url: "https://stream.antenne.de/antenne", | |
| image: "https://picsum.photos/seed/antenne/300/180" | |
| }, | |
| { | |
| name: "Bayern 3", | |
| genre: "Pop", | |
| url: "https://br-br3-live.cast.addradio.de/br/br3/live/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/bayern3/300/180" | |
| }, | |
| { | |
| name: "1LIVE", | |
| genre: "Pop", | |
| url: "https://wdr-1live-live.icecast.wdr.de/wdr/1live/live/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/1live/300/180" | |
| }, | |
| { | |
| name: "Deutschlandfunk", | |
| genre: "News", | |
| url: "https://st01.dlf.de/dlf/01/mpeg128/dlf/", | |
| image: "https://picsum.photos/seed/dlf/300/180" | |
| }, | |
| { | |
| name: "NDR 2", | |
| genre: "Pop", | |
| url: "https://ndr-ndr2-niedersachsen.cast.addradio.de/ndr/ndr2/niedersachsen/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/ndr2/300/180" | |
| }, | |
| { | |
| name: "SWR3", | |
| genre: "Pop", | |
| url: "https://swr-swr3-live.cast.addradio.de/swr/swr3/live/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/swr3/300/180" | |
| }, | |
| { | |
| name: "Rock Antenne", | |
| genre: "Rock", | |
| url: "https://stream.rockantenne.de/rockantenne", | |
| image: "https://picsum.photos/seed/rockantenne/300/180" | |
| }, | |
| { | |
| name: "YOU FM", | |
| genre: "Techno", | |
| url: "https://hr-youfm-live.cast.addradio.de/hr/youfm/live/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/youfm/300/180" | |
| }, | |
| { | |
| name: "Radio Paloma", | |
| genre: "Pop", | |
| url: "https://stream.radio-paloma.de/rp128.mp3", | |
| image: "https://picsum.photos/seed/paloma/300/180" | |
| }, | |
| { | |
| name: "BLACK BEATS", | |
| genre: "Techno", | |
| url: "https://stream.blackbeatslive.de", | |
| image: "https://picsum.photos/seed/blackbeats/300/180" | |
| }, | |
| { | |
| name: "Klassik Radio", | |
| genre: "Rock", | |
| url: "https://stream.klassikradio.de/live/mp3-128", | |
| image: "https://picsum.photos/seed/klassik/300/180" | |
| }, | |
| { | |
| name: "B5 aktuell", | |
| genre: "News", | |
| url: "https://br-b5-aktuell-live.cast.addradio.de/br/b5/aktuell/live/mp3/128/stream.mp3", | |
| image: "https://picsum.photos/seed/b5aktuell/300/180" | |
| } | |
| ]; | |
| // State | |
| let currentStation = null; | |
| let isPlaying = false; | |
| let audio = new Audio(); | |
| audio.crossOrigin = "anonymous"; // Try to handle CORS for visuals if possible | |
| // DOM Elements | |
| const grid = document.getElementById('stationGrid'); | |
| const playerBar = document.getElementById('playerBar'); | |
| const playerTitle = document.getElementById('playerTitle'); | |
| const playerArt = document.getElementById('playerArt'); | |
| const mainPlayBtn = document.getElementById('mainPlayBtn'); | |
| const mainPlayIcon = document.getElementById('mainPlayIcon'); | |
| const visualizer = document.getElementById('visualizer'); | |
| const playerStateText = document.getElementById('playerStateText'); | |
| // Initialize | |
| function init() { | |
| renderStations(stations); | |
| // Audio Error Handling | |
| audio.onerror = () => { | |
| console.error("Stream error"); | |
| playerStateText.innerText = "Streamfehler"; | |
| playerStateText.style.color = "#ef4444"; | |
| isPlaying = false; | |
| updatePlayButton(); | |
| }; | |
| audio.onplaying = () => { | |
| playerStateText.innerText = "Live"; | |
| playerStateText.style.color = "var(--accent)"; | |
| }; | |
| } | |
| // Render Cards | |
| function renderStations(data) { | |
| grid.innerHTML = ''; | |
| data.forEach((station, index) => { | |
| const card = document.createElement('div'); | |
| card.className = 'card'; | |
| card.onclick = () => loadStation(station, index); | |
| // Check if this is the currently playing station | |
| if(currentStation && currentStation.name === station.name) { | |
| card.classList.add('playing'); | |
| } | |
| card.innerHTML = ` | |
| <div class="card-image-wrapper"> | |
| <img src="${station.image}" alt="${station.name}" class="card-image"> | |
| <div class="card-overlay"> | |
| <div class="play-btn-overlay"> | |
| <span class="material-icons-round">play_arrow</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-info"> | |
| <div> | |
| <div class="station-genre">${station.genre}</div> | |
| <div class="station-name">${station.name}</div> | |
| </div> | |
| <div class="station-meta"> | |
| <span class="material-icons-round" style="font-size:14px">headphones</span> 128 kbps | |
| </div> | |
| </div> | |
| `; | |
| grid.appendChild(card); | |
| }); | |
| } | |
| // Filter Logic | |
| function filterStations(category) { | |
| // Update buttons | |
| document.querySelectorAll('.filter-btn').forEach(btn => btn.classList.remove('active')); | |
| event.target.classList.add('active'); | |
| if (category === 'all') { | |
| renderStations(stations); | |
| } else { | |
| const filtered = stations.filter(s => s.genre === category); | |
| renderStations(filtered); | |
| } | |
| } | |
| // Load Station | |
| function loadStation(station, index) { | |
| // UI Update: Highlight active card | |
| document.querySelectorAll('.card').forEach(c => c.classList.remove('playing')); | |
| // Re-rendering grid is expensive, but for this scale it ensures the class is correct after filters | |
| // Alternatively, find the specific DOM element. Let's just re-render to keep state simple. | |
| renderStations( | |
| document.querySelector('.filter-btn.active').innerText === 'Alle' | |
| ? stations | |
| : stations.filter(s => s.genre === document.querySelector('.filter-btn.active').innerText) | |
| ); | |
| // Highlight the clicked one manually to avoid flicker | |
| const cards = document.querySelectorAll('.card'); | |
| if(cards[index]) cards[index].classList.add('playing'); | |
| // Audio Logic | |
| if (currentStation && currentStation.url === station.url) { | |
| togglePlay(); | |
| return; | |
| } | |
| currentStation = station; | |
| playerTitle.innerText = station.name; | |
| playerArt.src = station.image; | |
| audio.src = station.url; | |
| audio.load(); | |
| audio.play().then(() => { | |
| isPlaying = true; | |
| updatePlayButton(); | |
| playerBar.classList.add('active'); | |
| }).catch(e => { | |
| console.log("Auto-play prevented or error", e); | |
| isPlaying = false; | |
| updatePlayButton(); | |
| playerBar.classList.add('active'); // Show player even on error to indicate selection | |
| }); | |
| } | |
| // Toggle Play/Pause | |
| function togglePlay() { | |
| if (!currentStation) return; | |
| if (isPlaying) { | |
| audio.pause(); | |
| isPlaying = false; | |
| } else { | |
| audio.play(); | |
| isPlaying = true; | |
| } | |
| updatePlayButton(); | |
| } | |
| // Stop | |
| function stopRadio() { | |
| audio.pause(); | |
| audio.currentTime = 0; | |
| isPlaying = false; | |
| updatePlayButton(); | |
| playerBar.classList.remove('active'); | |
| document.querySelectorAll('.card').forEach(c => c.classList.remove('playing')); | |
| currentStation = null; | |
| } | |
| // Volume | |
| function setVolume(val) { | |
| audio.volume = val; | |
| } | |
| // Update Icons & Visualizer | |
| function updatePlayButton() { | |
| if (isPlaying) { | |
| mainPlayIcon.innerText = 'pause'; | |
| visualizer.classList.remove('paused'); | |
| } else { | |
| mainPlayIcon.innerText = 'play_arrow'; | |
| visualizer.classList.add('paused'); | |
| } | |
| } | |
| // Run Init | |
| init(); | |
| </script> | |
| </body> | |
| </html> |