From c810271b21e1e33e190ac14ab85430b15e04b918 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 15 Feb 2026 17:34:11 +0000 Subject: [PATCH] Auto commit: 2026-02-15T17:34:11.111Z --- index.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index ae3099f..afd20ab 100644 --- a/index.php +++ b/index.php @@ -252,14 +252,34 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489"; .track-info { overflow: hidden; + flex: 1; } .track-title { - font-weight: 600; - font-size: 1.1rem; + font-weight: 700; + font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + transition: opacity 0.5s ease; + color: #fff; + text-shadow: 0 0 10px rgba(56, 189, 248, 0.3); + display: block; + } + + @keyframes marquee { + 0% { transform: translateX(0); } + 100% { transform: translateX(-50%); } + } + + .track-title.scrolling { + text-overflow: clip; + } + + .track-title.scrolling span { + display: inline-block; + animation: marquee 15s linear infinite; + padding-right: 2rem; } .track-status { @@ -905,16 +925,50 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489"; // RadioKing Public API for current track const response = await fetch('https://api.radioking.io/widget/radio/828046/track/current'); const data = await response.json(); + if (data && data.title) { - const title = data.artist ? `${data.artist} - ${data.title}` : data.title; - trackTitle.textContent = title; - document.title = `▶ ${title} | Lili Records Radio`; + const title = data.title; + const artist = data.artist || 'Lili Records'; + const fullDisplay = `${artist} - ${title}`; + + if (trackTitle.textContent !== fullDisplay) { + trackTitle.style.opacity = '0'; + trackTitle.classList.remove('scrolling'); + setTimeout(() => { + trackTitle.textContent = fullDisplay; + trackTitle.style.opacity = '1'; + + // Check if scrolling is needed + if (trackTitle.scrollWidth > trackTitle.clientWidth) { + trackTitle.classList.add('scrolling'); + // Double the text for seamless loop + trackTitle.innerHTML = `${fullDisplay}      ${fullDisplay}     `; + } + }, 500); + } + + document.title = `▶ ${fullDisplay} | Lili Records Radio`; + + // Media Session API for System Controls + if ('mediaSession' in navigator) { + navigator.mediaSession.metadata = new MediaMetadata({ + title: title, + artist: artist, + album: 'Lili Records Radio', + artwork: [ + { src: data.cover || './assets/pasted-20260215-163754-def41f49.png', sizes: '512x512', type: 'image/png' }, + { src: data.cover || './assets/pasted-20260215-163754-def41f49.png', sizes: '256x256', type: 'image/png' } + ] + }); + } } else { trackTitle.textContent = "Lili Records Radio - En Vivo"; } } catch (error) { console.error('Error fetching metadata:', error); - trackTitle.textContent = "Lili Records Radio - En Vivo"; + if (trackTitle.textContent === "Cargando stream...") { + trackTitle.textContent = "Lili Records Radio - En Vivo"; + } } }