Lili Records RadioV1.00
This commit is contained in:
parent
318336315d
commit
5e6f707eee
415
index.php
415
index.php
@ -1,150 +1,357 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
@ini_set('display_errors', '1');
|
@ini_set('display_errors', '0');
|
||||||
@error_reporting(E_ALL);
|
@error_reporting(E_ALL);
|
||||||
@date_default_timezone_set('UTC');
|
|
||||||
|
|
||||||
$phpVersion = PHP_VERSION;
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Lili Records Radio - La mejor música en vivo.';
|
||||||
$now = date('Y-m-d H:i:s');
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
|
$streamUrl = "https://play.radioking.io/lili-record-s-radio";
|
||||||
|
$whatsappNumber = "5359177041";
|
||||||
|
$whatsappLink = "https://wa.me/" . $whatsappNumber;
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="es">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>New Style</title>
|
<title>Lili Records Radio</title>
|
||||||
<?php
|
|
||||||
// Read project preview data from environment
|
<?php if ($projectDescription): ?>
|
||||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
||||||
?>
|
|
||||||
<?php if ($projectDescription): ?>
|
|
||||||
<!-- Meta description -->
|
|
||||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
|
||||||
<!-- Open Graph meta tags -->
|
|
||||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
<!-- Twitter meta tags -->
|
|
||||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($projectImageUrl): ?>
|
<?php if ($projectImageUrl): ?>
|
||||||
<!-- Open Graph image -->
|
|
||||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
<!-- Twitter image -->
|
|
||||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--bg-color-start: #6a11cb;
|
--primary-color: #ff2d55;
|
||||||
--bg-color-end: #2575fc;
|
--glass-bg: rgba(0, 0, 0, 0.6);
|
||||||
--text-color: #ffffff;
|
--glass-border: rgba(255, 255, 255, 0.1);
|
||||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
|
||||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: 'Inter', sans-serif;
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
background: #0a0a0a;
|
||||||
color: var(--text-color);
|
color: #fff;
|
||||||
display: flex;
|
height: 100vh;
|
||||||
justify-content: center;
|
margin: 0;
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
body::before {
|
|
||||||
content: '';
|
/* Background Image Placeholder or User Image */
|
||||||
|
.bg-image {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
background: url('https://images.unsplash.com/photo-1470225620780-dba8ba36b745?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
|
||||||
animation: bg-pan 20s linear infinite;
|
filter: brightness(0.4) blur(5px);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
transition: all 1s ease-in-out;
|
||||||
}
|
}
|
||||||
@keyframes bg-pan {
|
|
||||||
0% { background-position: 0% 0%; }
|
.player-container {
|
||||||
100% { background-position: 100% 100%; }
|
background: var(--glass-bg);
|
||||||
}
|
|
||||||
main {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-bg-color);
|
|
||||||
border: 1px solid var(--card-border-color);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 2rem;
|
|
||||||
backdrop-filter: blur(20px);
|
backdrop-filter: blur(20px);
|
||||||
-webkit-backdrop-filter: blur(20px);
|
-webkit-backdrop-filter: blur(20px);
|
||||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
border: 1px solid var(--glass-border);
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 2.5rem;
|
||||||
|
max-width: 450px;
|
||||||
|
width: 90%;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 50px rgba(0,0,0,0.5);
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.loader {
|
|
||||||
margin: 1.25rem auto 1.25rem;
|
.radio-logo {
|
||||||
width: 48px;
|
width: 120px;
|
||||||
height: 48px;
|
height: 120px;
|
||||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
||||||
border-top-color: #fff;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: spin 1s linear infinite;
|
background: linear-gradient(135deg, #ff2d55, #ff512f);
|
||||||
}
|
margin: 0 auto 1.5rem;
|
||||||
@keyframes spin {
|
display: flex;
|
||||||
from { transform: rotate(0deg); }
|
align-items: center;
|
||||||
to { transform: rotate(360deg); }
|
justify-content: center;
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px; height: 1px;
|
|
||||||
padding: 0; margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
white-space: nowrap; border: 0;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 3rem;
|
font-size: 3rem;
|
||||||
|
box-shadow: 0 0 30px rgba(255, 45, 85, 0.4);
|
||||||
|
animation: pulse 2s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes pulse {
|
||||||
|
0% { transform: scale(1); box-shadow: 0 0 30px rgba(255, 45, 85, 0.4); }
|
||||||
|
50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(255, 45, 85, 0.6); }
|
||||||
|
100% { transform: scale(1); box-shadow: 0 0 30px rgba(255, 45, 85, 0.4); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.song-info {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.song-title {
|
||||||
|
font-size: 1.5rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin: 0 0 1rem;
|
margin-bottom: 0.25rem;
|
||||||
letter-spacing: -1px;
|
display: block;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
.artist-name {
|
||||||
font-size: 1.1rem;
|
font-size: 1rem;
|
||||||
}
|
|
||||||
code {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.controls {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-play {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #fff;
|
||||||
|
color: #000;
|
||||||
|
border: none;
|
||||||
|
font-size: 2rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-play:hover {
|
||||||
|
transform: scale(1.1);
|
||||||
|
background: var(--primary-color);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-slider {
|
||||||
|
width: 100%;
|
||||||
|
height: 4px;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
background: rgba(255,255,255,0.2);
|
||||||
|
border-radius: 2px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-slider::-webkit-slider-thumb {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-section {
|
||||||
|
margin-top: 2rem;
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
border-top: 1px solid var(--glass-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-placeholder {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
background: rgba(255,255,255,0.05);
|
||||||
|
border: 2px dashed var(--glass-border);
|
||||||
|
border-radius: 12px;
|
||||||
|
margin: 1rem auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: rgba(255,255,255,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.whatsapp-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 30px;
|
||||||
|
right: 30px;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
background: #25d366;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 2rem;
|
||||||
|
box-shadow: 0 10px 20px rgba(0,0,0,0.3);
|
||||||
|
text-decoration: none;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.whatsapp-btn:hover {
|
||||||
|
transform: translateY(-5px) scale(1.1);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.live-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
left: 20px;
|
||||||
|
background: var(--primary-color);
|
||||||
|
padding: 4px 12px;
|
||||||
|
border-radius: 20px;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#visualizer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
opacity: 0.3;
|
||||||
|
z-index: -1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<div class="bg-image" id="bgImage"></div>
|
||||||
<div class="card">
|
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<main class="player-container">
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<div class="live-badge">En Vivo</div>
|
||||||
<span class="sr-only">Loading…</span>
|
|
||||||
</div>
|
<div class="radio-logo">
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
<i class="fas fa-music"></i>
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="song-info">
|
||||||
|
<span class="song-title" id="songTitle">Conectando...</span>
|
||||||
|
<span class="artist-name" id="artistName">Lili Records Radio</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls">
|
||||||
|
<button class="btn-play" id="playBtn">
|
||||||
|
<i class="fas fa-play" id="playIcon"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex align-items-center gap-2 px-4">
|
||||||
|
<i class="fas fa-volume-low opacity-50"></i>
|
||||||
|
<input type="range" class="volume-slider" id="volumeSlider" min="0" max="1" step="0.01" value="0.8">
|
||||||
|
<i class="fas fa-volume-high opacity-50"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="qr-section">
|
||||||
|
<p class="mb-2 small opacity-75">Apóyanos vía Transfermóvil</p>
|
||||||
|
<div class="qr-placeholder">
|
||||||
|
<i class="fas fa-qrcode fa-2x mb-2"></i>
|
||||||
|
<span>Espacio para QR</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<canvas id="visualizer"></canvas>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
<a href="track_click.php?type=whatsapp_open&redirect=<?= urlencode($whatsappLink) ?>" class="whatsapp-btn" title="Contáctanos">
|
||||||
</footer>
|
<i class="fab fa-whatsapp"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<audio id="audioPlayer" src="<?= $streamUrl ?>" crossorigin="anonymous"></audio>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script>
|
||||||
|
const audio = document.getElementById('audioPlayer');
|
||||||
|
const playBtn = document.getElementById('playBtn');
|
||||||
|
const playIcon = document.getElementById('playIcon');
|
||||||
|
const volumeSlider = document.getElementById('volumeSlider');
|
||||||
|
const songTitle = document.getElementById('songTitle');
|
||||||
|
const artistName = document.getElementById('artistName');
|
||||||
|
|
||||||
|
let isPlaying = false;
|
||||||
|
|
||||||
|
playBtn.addEventListener('click', () => {
|
||||||
|
if (isPlaying) {
|
||||||
|
audio.pause();
|
||||||
|
playIcon.classList.replace('fa-pause', 'fa-play');
|
||||||
|
} else {
|
||||||
|
audio.play().catch(e => console.error("Error playing audio:", e));
|
||||||
|
playIcon.classList.replace('fa-play', 'fa-pause');
|
||||||
|
}
|
||||||
|
isPlaying = !isPlaying;
|
||||||
|
});
|
||||||
|
|
||||||
|
volumeSlider.addEventListener('input', (e) => {
|
||||||
|
audio.volume = e.target.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fetch song metadata from RadioKing
|
||||||
|
async function fetchMetadata() {
|
||||||
|
try {
|
||||||
|
// RadioKing public widget API for current track
|
||||||
|
const response = await fetch('https://api.radioking.io/widget/radio/lili-record-s-radio/track/current');
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (data && data.title) {
|
||||||
|
songTitle.textContent = data.title;
|
||||||
|
artistName.textContent = data.artist || 'Lili Records Radio';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching metadata:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update metadata every 10 seconds
|
||||||
|
setInterval(fetchMetadata, 10000);
|
||||||
|
fetchMetadata();
|
||||||
|
|
||||||
|
// Simple visualizer effect
|
||||||
|
const canvas = document.getElementById('visualizer');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
canvas.width = canvas.offsetWidth;
|
||||||
|
canvas.height = canvas.offsetHeight;
|
||||||
|
|
||||||
|
function drawVisualizer() {
|
||||||
|
if (!isPlaying) {
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
requestAnimationFrame(drawVisualizer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
ctx.fillStyle = '#ff2d55';
|
||||||
|
|
||||||
|
const bars = 50;
|
||||||
|
const barWidth = canvas.width / bars;
|
||||||
|
|
||||||
|
for (let i = 0; i < bars; i++) {
|
||||||
|
const barHeight = Math.random() * canvas.height;
|
||||||
|
ctx.fillRect(i * barWidth, canvas.height - barHeight, barWidth - 2, barHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => requestAnimationFrame(drawVisualizer), 100);
|
||||||
|
}
|
||||||
|
drawVisualizer();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
18
track_click.php
Normal file
18
track_click.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db/config.php';
|
||||||
|
|
||||||
|
if (isset($_GET['type'])) {
|
||||||
|
$type = $_GET['type'];
|
||||||
|
try {
|
||||||
|
$db = db();
|
||||||
|
$stmt = $db->prepare("INSERT INTO click_logs (event_type) VALUES (:type)");
|
||||||
|
$stmt->execute(['type' => $type]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Click tracking error: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['redirect'])) {
|
||||||
|
header("Location: " . $_GET['redirect']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user