Auto commit: 2026-02-15T17:34:11.111Z
This commit is contained in:
parent
ae58125458
commit
c810271b21
66
index.php
66
index.php
@ -252,14 +252,34 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
|
|||||||
|
|
||||||
.track-info {
|
.track-info {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.track-title {
|
.track-title {
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
font-size: 1.1rem;
|
font-size: 1.25rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
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 {
|
.track-status {
|
||||||
@ -905,16 +925,50 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
|
|||||||
// RadioKing Public API for current track
|
// RadioKing Public API for current track
|
||||||
const response = await fetch('https://api.radioking.io/widget/radio/828046/track/current');
|
const response = await fetch('https://api.radioking.io/widget/radio/828046/track/current');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (data && data.title) {
|
if (data && data.title) {
|
||||||
const title = data.artist ? `${data.artist} - ${data.title}` : data.title;
|
const title = data.title;
|
||||||
trackTitle.textContent = title;
|
const artist = data.artist || 'Lili Records';
|
||||||
document.title = `▶ ${title} | Lili Records Radio`;
|
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 = `<span>${fullDisplay} ${fullDisplay} </span>`;
|
||||||
|
}
|
||||||
|
}, 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 {
|
} else {
|
||||||
trackTitle.textContent = "Lili Records Radio - En Vivo";
|
trackTitle.textContent = "Lili Records Radio - En Vivo";
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching metadata:', 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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user