38428-vm/index.php
2026-02-14 20:30:18 +00:00

531 lines
17 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/tracker.php';
track_visitor();
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Lili Records Radio - La mejor música en vivo.';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? 'assets/images/featured.jpg';
// WhatsApp info
$whatsapp_link = "https://chat.whatsapp.com/DkG96pTzAFO3hvLqmzwmTY";
?>
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Lili Records Radio</title>
<!-- Meta tags SEO -->
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>" />
<meta property="og:title" content="Lili Records Radio" />
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<meta property="twitter:card" content="summary_large_image" />
<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=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<style>
:root {
--accent-color: #00e676; /* WhatsApp Green */
--primary-color: #38bdf8; /* Sky Blue */
--bg-overlay: rgba(15, 23, 42, 0.5); /* More transparent overlay */
--glass-bg: rgba(15, 23, 42, 0.3); /* Transparent card background */
--glass-border: rgba(255, 255, 255, 0.2);
}
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: 'Inter', sans-serif;
color: #ffffff;
background-color: #000;
overflow: hidden;
}
.background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url('assets/images/background.jpg') center/cover no-repeat;
z-index: -1;
}
.background::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--bg-overlay);
}
.app-container {
display: flex;
width: 100%;
height: 100vh;
align-items: center;
padding: 2rem;
box-sizing: border-box;
}
/* Left Side: Player */
.player-section {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 500px;
z-index: 10;
}
.glass-card {
background: var(--glass-bg);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border: 1px solid var(--glass-border);
border-radius: 24px;
padding: 2.5rem;
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
.brand h1 {
font-size: 2.5rem;
font-weight: 700;
margin: 0 0 0.5rem;
background: linear-gradient(to right, #fff, var(--primary-color));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.brand p {
font-size: 1rem;
opacity: 0.8;
margin-bottom: 2rem;
}
/* Radio Player UI */
.radio-player {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.now-playing {
display: flex;
align-items: center;
gap: 1rem;
background: rgba(0, 0, 0, 0.3);
padding: 1rem;
border-radius: 12px;
}
.now-playing i {
font-size: 1.5rem;
color: var(--primary-color);
animation: pulse 2s infinite;
}
.track-info {
overflow: hidden;
}
.track-title {
font-weight: 600;
font-size: 1.1rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.track-status {
font-size: 0.85rem;
opacity: 0.6;
}
.controls {
display: flex;
align-items: center;
gap: 1rem;
}
.play-btn {
width: 64px;
height: 64px;
border-radius: 50%;
background: var(--primary-color);
border: none;
color: #fff;
font-size: 1.5rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s, background 0.2s;
box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}
.play-btn:hover {
transform: scale(1.05);
background: #0ea5e9;
}
.volume-slider {
flex: 1;
height: 6px;
-webkit-appearance: none;
background: rgba(255, 255, 255, 0.2);
border-radius: 3px;
outline: none;
}
.volume-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
background: #fff;
border-radius: 50%;
cursor: pointer;
}
/* Interaction Form */
.interaction-form {
margin-top: 2rem;
display: flex;
flex-direction: column;
gap: 1rem;
text-align: left;
}
.interaction-form label {
font-size: 0.85rem;
font-weight: 600;
margin-bottom: -0.5rem;
opacity: 0.9;
}
.interaction-form input,
.interaction-form textarea {
width: 100%;
padding: 0.8rem;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.2);
background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
color: #0f172a;
font-family: inherit;
font-size: 0.95rem;
box-sizing: border-box;
outline: none;
transition: all 0.2s;
}
.interaction-form textarea {
resize: none;
height: 80px;
}
.interaction-form input::placeholder,
.interaction-form textarea::placeholder {
color: #64748b;
}
.send-whatsapp-btn {
background-color: var(--accent-color);
color: #fff;
border: none;
padding: 0.8rem;
border-radius: 12px;
font-weight: 700;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
transition: transform 0.2s, background 0.2s;
}
.send-whatsapp-btn:hover {
transform: translateY(-2px);
background-color: #00c853;
}
/* Right Side: Featured Image */
.image-section {
flex: 1.2;
display: flex;
justify-content: center;
align-items: center;
padding-left: 2rem;
}
.featured-img-container {
width: 100%;
max-width: 600px;
position: relative;
border-radius: 24px;
overflow: hidden;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
aspect-ratio: 16 / 9;
}
.featured-img-container img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s;
}
.featured-img-container:hover img {
transform: scale(1.05);
}
/* Transfermovil QR Section */
.payment-section {
margin-top: 2rem;
text-align: center;
}
.qr-container {
margin: 1rem auto;
display: flex;
justify-content: center;
}
.qr-container img {
max-width: 200px;
transition: transform 0.3s;
}
.qr-container img:hover {
transform: scale(1.1);
}
/* Floating WhatsApp Button */
.whatsapp-float {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 60px;
height: 60px;
background-color: var(--accent-color);
color: #FFF;
border-radius: 50%;
text-align: center;
font-size: 30px;
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
transition: transform 0.3s;
}
.whatsapp-float:hover {
transform: scale(1.1);
color: #fff;
}
@keyframes pulse {
0% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.1); opacity: 0.7; }
100% { transform: scale(1); opacity: 1; }
}
/* Responsive */
@media (max-width: 992px) {
.app-container {
flex-direction: column;
height: auto;
overflow-y: auto;
padding-top: 4rem;
}
.player-section {
max-width: 100%;
margin-bottom: 2rem;
}
.image-section {
padding-left: 0;
width: 100%;
}
.featured-img-container {
aspect-ratio: 1 / 1;
}
}
</style>
</head>
<body>
<div class="background"></div>
<div class="app-container">
<!-- Left Section: Player -->
<section class="player-section">
<div class="glass-card">
<header class="brand">
<h1>Lili Records</h1>
<p>Siente la música, vive el ritmo.</p>
</header>
<div class="radio-player">
<div class="now-playing">
<i class="bi bi-broadcast"></i>
<div class="track-info">
<div class="track-status">EN VIVO</div>
<div id="track-title" class="track-title">Cargando stream...</div>
</div>
<a href="<?= $whatsapp_link ?>" target="_blank" title="WhatsApp directo" style="color: var(--accent-color); font-size: 1.8rem; margin-left: auto; display: flex; align-items: center;">
<i class="bi bi-whatsapp"></i>
</a>
</div>
<div class="controls">
<button id="play-pause" class="play-btn" onclick="togglePlay()">
<i id="play-icon" class="bi bi-play-fill"></i>
</button>
<i class="bi bi-volume-up"></i>
<input type="range" class="volume-slider" min="0" max="1" step="0.01" value="1" oninput="changeVolume(this.value)">
</div>
<div class="interaction-form">
<label for="user-name">TU NOMBRE</label>
<input type="text" id="user-name" placeholder="Ej: Juan Pérez">
<label for="user-message">TU MENSAJE / PEDIDO</label>
<textarea id="user-message" placeholder="Escribe aquí tu saludo o canción favorita..."></textarea>
<button class="send-whatsapp-btn" onclick="sendToWhatsApp()">
<i class="bi bi-whatsapp"></i> ENVIAR AL WHATSAPP
</button>
</div>
<!-- Transfermovil QR Section -->
<div class="payment-section">
<p style="font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; opacity: 0.9;">APOYA LA RADIO (TRANSFERMÓVIL)</p>
<div class="qr-container">
<div style="width: 180px; height: 180px; background: rgba(255,255,255,0.1); border: 2px dashed rgba(255,255,255,0.3); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.5rem;">
<i class="bi bi-qr-code" style="font-size: 3rem; opacity: 0.5;"></i>
<span style="font-size: 0.7rem; opacity: 0.5;">ESPACIO PARA QR</span>
</div>
</div>
</div>
</div>
</div>
<?php if (isset($_GET['admin']) && $_GET['admin'] === '1'): ?>
<!-- Admin Real-Time Stats (Only visible with ?admin=1) -->
<div class="glass-card mt-4" style="margin-top: 2rem;">
<h3 style="font-size: 1.2rem; margin-bottom: 1rem; color: var(--accent-color);">
<i class="bi bi-shield-lock"></i> Panel Admin Real-Time
</h3>
<iframe src="admin.php?token=lili_admin_2026" style="width: 100%; height: 400px; border: none; border-radius: 12px; background: rgba(0,0,0,0.2);"></iframe>
</div>
<?php endif; ?>
</section>
<!-- Right Section: Featured Image -->
<section class="image-section">
<div class="featured-img-container">
<img src="assets/pasted-20260214-202809-06aae656.png" alt="Lili Records Featured">
</div>
</section>
</div>
<!-- WhatsApp Button -->
<a href="<?= $whatsapp_link ?>" class="whatsapp-float" target="_blank">
<i class="bi bi-whatsapp"></i>
</a>
<audio id="radio-audio" src="https://listen.radioking.com/radio/828046/stream/897251" preload="none"></audio>
<script>
const audio = document.getElementById('radio-audio');
const playBtn = document.getElementById('play-pause');
const playIcon = document.getElementById('play-icon');
const trackTitle = document.getElementById('track-title');
function togglePlay() {
if (audio.paused) {
audio.play();
playIcon.classList.remove('bi-play-fill');
playIcon.classList.add('bi-pause-fill');
} else {
audio.pause();
playIcon.classList.remove('bi-pause-fill');
playIcon.classList.add('bi-play-fill');
}
}
function changeVolume(val) {
audio.volume = val;
}
function sendToWhatsApp() {
const name = document.getElementById('user-name').value;
const message = document.getElementById('user-message').value;
const phoneNumber = '5359177041';
if (!message.trim()) {
alert('Por favor, escribe un mensaje.');
return;
}
let finalMessage = `Hola Lili Records! `;
if (name.trim()) {
finalMessage += `Soy ${name}. `;
}
finalMessage += message;
const url = `https://wa.me/${phoneNumber}?text=${encodeURIComponent(finalMessage)}`;
window.open(url, '_blank');
}
// Fetch Now Playing Metadata from RadioKing
async function updateMetadata() {
try {
// RadioKing Public API for current track
const response = await fetch('https://www.radioking.com/widgets/currenttrack.php?radio=828046&format=json');
const data = await response.json();
if (data && data.title) {
let fullTitle = data.title;
// If artist is present and not already at the start of the title, prepend it
if (data.artist && !fullTitle.toLowerCase().includes(data.artist.toLowerCase())) {
fullTitle = `${data.artist} - ${fullTitle}`;
}
trackTitle.textContent = fullTitle;
document.title = `▶ ${fullTitle} | Lili Records Radio`;
} else {
trackTitle.textContent = "Lili Records Radio - En Vivo";
}
} catch (error) {
console.error('Error fetching metadata:', error);
trackTitle.textContent = "Lili Records Radio - En Vivo";
}
}
// Update every 30 seconds
updateMetadata();
setInterval(updateMetadata, 30000);
// Handle possible audio interruptions
audio.addEventListener('error', function(e) {
console.error('Audio error:', e);
trackTitle.textContent = "Error de conexión. Reintentando...";
setTimeout(() => {
audio.load();
if (!audio.paused) audio.play();
}, 5000);
});
</script>
</body>
</html>