ca021cc3f7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.9 KiB
HTML
48 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es" data-theme="dark">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}Spotify Cantina{% endblock %}</title>
|
|
<script>(function(){var t=localStorage.getItem('theme')||'dark';document.documentElement.setAttribute('data-theme',t);})()</script>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
<nav class="navbar">
|
|
<div class="brand">🎵 Cantina</div>
|
|
<div class="nav-links">
|
|
<a href="/">Reproductor</a>
|
|
<a href="/stats/">Estadísticas</a>
|
|
<a id="admin-nav-btn" href="/admin/login" class="btn-sm">Admin</a>
|
|
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" title="Cambiar tema">☀️</button>
|
|
</div>
|
|
</nav>
|
|
<script>
|
|
fetch('/admin/status').then(r => r.json()).then(data => {
|
|
const btn = document.getElementById('admin-nav-btn');
|
|
if (data.logged_in) {
|
|
btn.textContent = '⚙ Admin';
|
|
btn.href = '/admin/playlists';
|
|
}
|
|
}).catch(() => {});
|
|
|
|
function toggleTheme() {
|
|
const current = document.documentElement.getAttribute('data-theme') || 'dark';
|
|
const next = current === 'dark' ? 'light' : 'dark';
|
|
document.documentElement.setAttribute('data-theme', next);
|
|
localStorage.setItem('theme', next);
|
|
document.getElementById('theme-toggle').textContent = next === 'dark' ? '☀️' : '🌙';
|
|
}
|
|
|
|
(function syncToggleIcon() {
|
|
const t = document.documentElement.getAttribute('data-theme') || 'dark';
|
|
const btn = document.getElementById('theme-toggle');
|
|
if (btn) btn.textContent = t === 'dark' ? '☀️' : '🌙';
|
|
})();
|
|
</script>
|
|
<main>
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
</body>
|
|
</html>
|