Auto commit: 2026-02-18T22:50:39.407Z
This commit is contained in:
parent
b2da37aaa1
commit
a3ff3a515e
94
index.php
94
index.php
@ -1813,6 +1813,16 @@ $twitter_link = "https://twitter.com/";
|
|||||||
<h3 style="font-size: 1.2rem; margin-bottom: 1rem; color: var(--accent-color);">
|
<h3 style="font-size: 1.2rem; margin-bottom: 1rem; color: var(--accent-color);">
|
||||||
<i class="bi bi-shield-lock"></i> Panel Admin Real-Time
|
<i class="bi bi-shield-lock"></i> Panel Admin Real-Time
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
<!-- On-Air Announcement Section -->
|
||||||
|
<div style="background: rgba(37, 211, 102, 0.1); border: 1px solid rgba(37, 211, 102, 0.3); padding: 1.5rem; border-radius: 20px; margin-bottom: 1.5rem; text-align: center;">
|
||||||
|
<h4 style="color: #25D366; font-size: 1rem; margin-top: 0;"><i class="bi bi-broadcast"></i> Anunciar "Al Aire"</h4>
|
||||||
|
<p style="font-size: 0.8rem; opacity: 0.8; margin-bottom: 1rem;">Envía un mensaje a tus contactos de WhatsApp para invitarlos a la emisora.</p>
|
||||||
|
<button onclick="announceOnAir()" style="background: #25D366; color: white; border: none; padding: 12px 24px; border-radius: 50px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 10px; margin: 0 auto; transition: all 0.3s;" onmouseover="this.style.transform='scale(1.05)'" onmouseout="this.style.transform='scale(1)'">
|
||||||
|
<i class="bi bi-whatsapp"></i> ANUNCIAR POR WHATSAPP
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<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>
|
<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>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -2352,16 +2362,44 @@ $twitter_link = "https://twitter.com/";
|
|||||||
}
|
}
|
||||||
|
|
||||||
function saveUserInfo() {
|
function saveUserInfo() {
|
||||||
const name = document.getElementById('user-name').value.trim();
|
const nameInput = document.getElementById('user-name');
|
||||||
const phone = document.getElementById('user-phone').value.trim();
|
const phoneInput = document.getElementById('user-phone');
|
||||||
|
const name = nameInput.value.trim();
|
||||||
|
const phone = phoneInput.value.trim();
|
||||||
|
|
||||||
if (!name && !phone) return;
|
if (!name && !phone) return;
|
||||||
|
|
||||||
|
const isNewUser = !localStorage.getItem('userName') && name.length >= 3;
|
||||||
|
|
||||||
|
localStorage.setItem('userName', name);
|
||||||
|
localStorage.setItem('userPhone', phone);
|
||||||
|
|
||||||
fetch('api/save_user_info.php', {
|
fetch('api/save_user_info.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ username: name, phone: phone })
|
body: JSON.stringify({ username: name, phone: phone })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isNewUser) {
|
||||||
|
// Special welcome for first-time identification
|
||||||
|
showWelcomeToast(name);
|
||||||
|
|
||||||
|
// Send a welcome message to the chat automatically
|
||||||
|
setTimeout(() => {
|
||||||
|
sendChatMessage(`¡Hola a todos! Acabo de conectarme a Lili Records Radio. 👋📻`, 'text');
|
||||||
|
|
||||||
|
// Radio Station welcome response
|
||||||
|
setTimeout(() => {
|
||||||
|
sendChatMessage(`¡Bienvenido ${name} a la familia de Lili Records! 🎉 Disfruta de la mejor programación.`, 'text', 'Lili Records Radio');
|
||||||
|
}, 1500);
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
confetti({
|
||||||
|
particleCount: 150,
|
||||||
|
spread: 100,
|
||||||
|
origin: { y: 0.7 }
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserColor(str) {
|
function getUserColor(str) {
|
||||||
@ -2648,27 +2686,27 @@ $twitter_link = "https://twitter.com/";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sendChatMessage(msgContent = null, type = 'text') {
|
async function sendChatMessage(msgContent = null, type = 'text', customUser = null) {
|
||||||
const userNameInput = document.getElementById('user-name');
|
const userNameInput = document.getElementById('user-name');
|
||||||
const userPhoneInput = document.getElementById('user-phone');
|
const userPhoneInput = document.getElementById('user-phone');
|
||||||
const user = userNameInput.value.trim();
|
const user = customUser || userNameInput.value.trim();
|
||||||
const phone = userPhoneInput.value.trim();
|
const phone = userPhoneInput.value.trim();
|
||||||
const message = msgContent || chatMsg.value.trim();
|
const message = msgContent || chatMsg.value.trim();
|
||||||
const phoneRegex = /^\+?[0-9]{7,15}$/;
|
const phoneRegex = /^\+?[0-9]{7,15}$/;
|
||||||
|
|
||||||
if (user.length < 3) {
|
if (!customUser && user.length < 3) {
|
||||||
alert('Por favor, ingresa un nombre válido arriba (mínimo 3 caracteres).');
|
alert('Por favor, ingresa un nombre válido arriba (mínimo 3 caracteres).');
|
||||||
userNameInput.style.borderColor = '#ff4444';
|
userNameInput.style.borderColor = '#ff4444';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!phone) {
|
if (!customUser && !phone) {
|
||||||
alert('Por favor, regístrate con tu móvil arriba para poder chatear.');
|
alert('Por favor, regístrate con tu móvil arriba para poder chatear.');
|
||||||
userPhoneInput.style.borderColor = '#ff4444';
|
userPhoneInput.style.borderColor = '#ff4444';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!phoneRegex.test(phone.replace(/\s/g, ''))) {
|
if (!customUser && !phoneRegex.test(phone.replace(/\s/g, ''))) {
|
||||||
alert('Por favor, ingresa un número de móvil válido arriba.');
|
alert('Por favor, ingresa un número de móvil válido arriba.');
|
||||||
userPhoneInput.style.borderColor = '#ff4444';
|
userPhoneInput.style.borderColor = '#ff4444';
|
||||||
return;
|
return;
|
||||||
@ -3528,8 +3566,50 @@ $twitter_link = "https://twitter.com/";
|
|||||||
themeBtn.classList.remove('bi-moon-fill');
|
themeBtn.classList.remove('bi-moon-fill');
|
||||||
themeBtn.classList.add('bi-sun-fill');
|
themeBtn.classList.add('bi-sun-fill');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Welcome logic for new users
|
||||||
|
setTimeout(() => {
|
||||||
|
const welcomeName = localStorage.getItem('userName');
|
||||||
|
if (welcomeName) {
|
||||||
|
showWelcomeToast(welcomeName);
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
function showWelcomeToast(name) {
|
||||||
|
const welcomeSound = document.getElementById('welcome-sound');
|
||||||
|
if (welcomeSound) {
|
||||||
|
welcomeSound.volume = 0.5;
|
||||||
|
welcomeSound.play().catch(e => console.log('Welcome sound blocked:', e));
|
||||||
|
}
|
||||||
|
|
||||||
|
const toast = document.createElement('div');
|
||||||
|
toast.className = 'copy-toast';
|
||||||
|
toast.style.background = 'linear-gradient(135deg, var(--primary-color), var(--accent-color))';
|
||||||
|
toast.style.bottom = 'auto';
|
||||||
|
toast.style.top = '30px';
|
||||||
|
toast.innerHTML = `<i class="bi bi-stars"></i> ¡Bienvenido de nuevo, ${name}! Disfruta de la mejor música.`;
|
||||||
|
document.body.appendChild(toast);
|
||||||
|
|
||||||
|
confetti({
|
||||||
|
particleCount: 100,
|
||||||
|
spread: 70,
|
||||||
|
origin: { y: 0.3 },
|
||||||
|
colors: ['#38bdf8', '#00c853', '#ffffff']
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => toast.remove(), 4000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function announceOnAir() {
|
||||||
|
const currentSong = document.getElementById('track-title').innerText.trim();
|
||||||
|
const shareUrl = window.location.origin + window.location.pathname;
|
||||||
|
const text = `🔴 *¡ESTAMOS AL AIRE!* 🎙️📻\n\nSintoniza ahora *Lili Records Radio* para escuchar la mejor música en vivo.\n\n🎵 *Sonando:* ${currentSong}\n\n👉 *Escúchanos aquí:* ${shareUrl}\n\n¡Te esperamos! 💃🕺`;
|
||||||
|
|
||||||
|
const url = `https://wa.me/?text=${encodeURIComponent(text)}`;
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
|
|
||||||
// Handle possible audio interruptions
|
// Handle possible audio interruptions
|
||||||
audio.addEventListener('error', function(e) {
|
audio.addEventListener('error', function(e) {
|
||||||
console.error('Audio error:', e);
|
console.error('Audio error:', e);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user