:root { color-scheme: dark; } body { font-family: 'Outfit', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }
/* Fundo azul marinho com brilho e movimento suave */ .navy-hero { background: radial-gradient(1200px 700px at 10% 5%, rgba(56,189,248,.18), transparent 55%), radial-gradient(900px 600px at 90% 10%, rgba(99,102,241,.18), transparent 55%), radial-gradient(1200px 800px at 20% 90%, rgba(59,130,246,.14), transparent 55%), linear-gradient(140deg, #081225 0%, #0A1C38 55%, #081225 100%); background-size: 220% 220%; animation: bg-move 26s ease-in-out infinite; } @keyframes bg-move { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* Cartão de vidro */ .glass { backdrop-filter: blur(10px); background: linear-gradient(to bottom right, rgba(255,255,255,.08), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.14); }
/* Brilho do botão primário */ .btn-glow { box-shadow: 0 10px 30px rgba(59,130,246,.35), inset 0 0 0 1px rgba(255,255,255,.08); } .btn-glow:hover { box-shadow: 0 12px 36px rgba(59,130,246,.45), inset 0 0 0 1px rgba(255,255,255,.12); }
/* Destaques “Top Hits” pulsando de leve */ .soft-pulse { animation: softpulse 2.4s ease-in-out infinite; } @keyframes softpulse { 0%,100% { opacity: .85; filter: saturate(1); } 50% { opacity: 1; filter: saturate(1.2); } }
/* Ícone herda a cor */ .icon path { fill: currentColor; }
/* Equalizer decorativo */ .bar { transform-origin: bottom; animation: bounce 1.4s ease-in-out infinite; } .bar:nth-child(2) { animation-delay: .1s; } .bar:nth-child(3) { animation-delay: .2s; } .bar:nth-child(4) { animation-delay: .3s; } .bar:nth-child(5) { animation-delay: .4s; } @keyframes bounce { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
Radio 98.3 FM
Radio 98.3 FM • Ao Vivo
No ar: Radio 98.3 FM
Peça sua música agora em 1 clique
Mensagem pronta, abre direto no WhatsApp. Rápido, bonito e com cara de rádio Top Hits.
// Elementos const form = document.getElementById('hitForm'); const songInput = document.getElementById('songInput'); const trends = Array.from(document.querySelectorAll('.trend')); const addBtns = Array.from(document.querySelectorAll('.add'));
// Número WhatsApp const toggleNum = document.getElementById('toggleNum'); const numWrap = document.getElementById('numWrap'); const phone = document.getElementById('phone'); const saveNum = document.getElementById('saveNum'); const hint = document.getElementById('hint'); const testNumBtn = document.getElementById('testNum');
// Logo const toggleLogo = document.getElementById('toggleLogo'); const logoWrap = document.getElementById('logoWrap'); const logoFile = document.getElementById('logoFile'); const logoUrl = document.getElementById('logoUrl'); const saveLogo = document.getElementById('saveLogo'); const removeLogo = document.getElementById('removeLogo'); const logoImg = document.getElementById('headerLogo'); const logoFallback = document.getElementById('logoFallback');
// Fundo const toggleBg = document.getElementById('toggleBg'); const bgWrap = document.getElementById('bgWrap'); const bgFile = document.getElementById('bgFile'); const bgUrl = document.getElementById('bgUrl'); const saveBg = document.getElementById('saveBg'); const removeBg = document.getElementById('removeBg'); const bgImage = document.getElementById('bgImage');
const KEY = 'top_hits_radio_whats'; const KEY_LOGO = 'top_hits_radio_logo'; const KEY_BG = 'top_hits_radio_bg'; const DEFAULT_NUM = '554733489744';
// Carrega número salvo (usa o padrão se não houver) const saved = localStorage.getItem(KEY) || DEFAULT_NUM; if (saved) { phone.value = saved; localStorage.setItem(KEY, saved); }
// Carrega logo salva const savedLogo = localStorage.getItem(KEY_LOGO); if (savedLogo) { showLogo(savedLogo); if (/^data:image//.test(savedLogo)) { logoUrl.value = ''; } else { logoUrl.value = savedLogo; } }
// Carrega fundo salvo const savedBg = localStorage.getItem(KEY_BG); if (savedBg) { setBg(savedBg); if (!/^data:image//.test(savedBg)) bgUrl.value = savedBg; document.getElementById('bgStatus')?.classList.remove('hidden'); }
// Tendências preenchem o campo trends.forEach(btn => { btn.addEventListener('click', () => { songInput.value = btn.textContent.trim(); songInput.focus(); }); });
// "Pedir" do Top Hits preenche e envia addBtns.forEach(btn => { btn.addEventListener('click', () => { const container = btn.closest('li'); const title = container.querySelector('p.font-medium')?.textContent || ''; const artist = container.querySelector('p.text-xs')?.textContent || ''; songInput.value = artist ? `${title} — ${artist}` : title; form.requestSubmit(); // envia direto }); });
// Exibe/oculta configuração de número toggleNum.addEventListener('click', () => { numWrap.classList.toggle('hidden'); hint.classList.add('hidden'); });
// Exibe/oculta configuração de logo toggleLogo.addEventListener('click', () => { logoWrap.classList.toggle('hidden'); document.getElementById('logoHint').classList.add('hidden'); });
// Exibe/oculta configuração de fundo toggleBg.addEventListener('click', () => { bgWrap.classList.toggle('hidden'); document.getElementById('bgHint').classList.add('hidden'); });
// Upload de arquivo de logo (converte em base64 para salvar localmente) logoFile?.addEventListener('change', async (e) => { const file = e.target.files?.[0]; if (!file) return; const dataUrl = await fileToDataURL(file); localStorage.setItem(KEY_LOGO, dataUrl); showLogo(dataUrl); showLogoHint('Logo salva!'); });
// Fundo por arquivo bgFile?.addEventListener('change', async (e) => { const file = e.target.files?.[0]; if (!file) return; const dataUrl = await fileToDataURL(file); localStorage.setItem(KEY_BG, dataUrl); setBg(dataUrl); showBgHint('Fundo salvo!'); });
// Salvar logo por URL saveLogo?.addEventListener('click', () => { const url = (logoUrl.value || '').trim(); if (!url) return showLogoHint('Cole a URL da imagem.'); showLogo(url); localStorage.setItem(KEY_LOGO, url); showLogoHint('Logo salva!'); });
// Salvar fundo por URL saveBg?.addEventListener('click', () => { const url = (bgUrl.value || '').trim(); if (!url) return showBgHint('Cole a URL da imagem.'); setBg(url); localStorage.setItem(KEY_BG, url); showBgHint('Fundo salvo!'); document.getElementById('bgStatus')?.classList.remove('hidden'); });
// Remover logo removeLogo?.addEventListener('click', () => { localStorage.removeItem(KEY_LOGO); logoImg.classList.add('hidden'); logoFallback.classList.remove('hidden'); showLogoHint('Logo removida.'); });
// Remover fundo removeBg?.addEventListener('click', () => { localStorage.removeItem(KEY_BG); bgImage.style.backgroundImage = ''; showBgHint('Fundo removido.'); document.getElementById('bgStatus')?.classList.add('hidden'); });
// Salva número saveNum.addEventListener('click', () => { const clean = (phone.value || '').replace(/D+/g, ''); if (!clean) { localStorage.removeItem(KEY); hint.textContent = 'Número removido.'; hint.classList.remove('hidden'); hint.style.color = '#93c5fd'; // azul claro return; } if (clean.length < 10 || clean.length > 15) { hint.textContent = 'Verifique o formato. Ex.: 5599999999999'; hint.classList.remove('hidden'); hint.style.color = '#fda4af'; // aviso return; } localStorage.setItem(KEY, clean); hint.textContent = 'Número salvo!'; hint.classList.remove('hidden'); hint.style.color = '#7dd3fc'; });
// Testar número agora testNumBtn?.addEventListener('click', () => { const clean = (phone.value || '').replace(/D+/g, ''); if (!clean) { hint.textContent = 'Informe um número para testar.'; hint.classList.remove('hidden'); hint.style.color = '#fda4af'; return; } const text = encodeURIComponent('Teste rápido do WhatsApp — Radio 98.3 FM'); // Tenta WhatsApp Web primeiro const webUrl = `https://web.whatsapp.com/send?phone=${clean}&text=${text}`; try { window.location.href = webUrl; return; } catch (_) {} // Se não abrir, tenta wa.me const waUrl = `https://wa.me/${clean}?text=${text}`; try { window.open(waUrl, '_blank', 'noopener'); } catch (_) {} });
// Envia WhatsApp com múltiplas rotas e plano B form.addEventListener('submit', async (e) => { e.preventDefault(); const s = songInput.value.trim(); const lines = [ '🎧 Pedido de música — Top Hits', s ? `• Música: ${s}` : '• Quero pedir uma música', '', 'Enviado pelo site da rádio 💙' ]; const textPlain = lines.join('n'); const text = encodeURIComponent(textPlain); const num = localStorage.getItem(KEY) || '';
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
// 1) Mobile: tenta abrir o app direto if (isMobile && num) { try { window.location.href = `whatsapp://send?phone=${num}&text=${encodeURIComponent(textPlain)}`; // Fallback para navegadores que não suportam o esquema setTimeout(() => { const waUrl = num ? `https://wa.me/${num}?text=${text}` : `https://wa.me/?text=${text}`; window.location.href = waUrl; }, 800); return; } catch (_) {} }
// 2) Desktop/geral: tenta WhatsApp Web primeiro (mesma guia) const webUrl = num ? `https://web.whatsapp.com/send?phone=${num}&text=${text}` : `https://web.whatsapp.com/send?text=${text}`; try { window.location.href = webUrl; return; } catch (_) {}
// 3) Se não abrir, tenta wa.me em nova aba (alguns bloqueiam api.whatsapp.com, mas não web.whatsapp.com) const waUrl = num ? `https://wa.me/${num}?text=${text}` : `https://wa.me/?text=${text}`; let win = null; try { win = window.open(waUrl, '_blank', 'noopener'); } catch (_) {}
// 4) Último recurso: copia a mensagem e avisa try { await navigator.clipboard.writeText(textPlain); alert('Não foi possível abrir o WhatsApp automaticamente. A mensagem foi copiada. Abra seu WhatsApp e cole para enviar.'); } catch (_) { alert('Não foi possível abrir o WhatsApp automaticamente. Copie e envie esta mensagem:nn' + textPlain); } });
// Helpers function showLogo(src) { logoImg.src = src; logoImg.onload = () => { logoImg.classList.remove('hidden'); logoFallback.classList.add('hidden'); }; logoImg.onerror = () => { logoImg.classList.add('hidden'); logoFallback.classList.remove('hidden'); showLogoHint('Não foi possível carregar a imagem.'); }; }
function fileToDataURL(file) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => resolve(reader.result); reader.onerror = reject; reader.readAsDataURL(file); }); }
function showLogoHint(message) { const el = document.getElementById('logoHint'); el.textContent = message; el.classList.remove('hidden'); }
function setBg(src) { bgImage.style.backgroundImage = `url('${src}')`; bgImage.style.backgroundSize = 'cover'; bgImage.style.backgroundPosition = 'center'; }
function showBgHint(message) { const el = document.getElementById('bgHint'); el.textContent = message; el.classList.remove('hidden'); } (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'97063a918309f25a',t:'MTc1NTQwMjg1Mi4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();