agrega toggle de modo claro/oscuro con persistencia en localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,7 +197,7 @@ function clearEmoji(id) {
|
||||
.emoji-picker { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
|
||||
.emoji-opt {
|
||||
background: var(--surface);
|
||||
border: 1px solid #333;
|
||||
border: 1px solid var(--border2);
|
||||
border-radius: 6px;
|
||||
font-size: 1.15rem;
|
||||
width: 34px; height: 34px;
|
||||
@@ -205,7 +205,7 @@ function clearEmoji(id) {
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
transition: background .12s, transform .1s;
|
||||
}
|
||||
.emoji-opt:hover { background: #333; transform: scale(1.15); }
|
||||
.emoji-opt:hover { background: var(--surface3); transform: scale(1.15); }
|
||||
|
||||
.emoji-thumb { font-size: 1.6rem; }
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
.result-info { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
|
||||
.result-name { font-size: .9rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
|
||||
.winner-badge { background: rgba(255,215,0,.15); color: gold; font-size: .75rem; padding: 1px 6px; border-radius: 10px; border: 1px solid rgba(255,215,0,.3); }
|
||||
.result-bar-wrap { height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
|
||||
.result-bar-wrap { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
|
||||
.result-bar { height: 100%; background: var(--green); border-radius: 3px; transition: width .4s; }
|
||||
.result-count { display: flex; flex-direction: column; align-items: flex-end; min-width: 50px; }
|
||||
.result-count strong { font-size: 1.1rem; }
|
||||
|
||||
+17
-1
@@ -1,9 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<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>
|
||||
@@ -13,6 +14,7 @@
|
||||
<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>
|
||||
@@ -23,6 +25,20 @@
|
||||
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 %}
|
||||
|
||||
@@ -456,7 +456,7 @@ setInterval(fetchVotingStatus, 5000);
|
||||
.vote-bar-wrap {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background: #333;
|
||||
background: var(--surface3);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
margin-top: 4px;
|
||||
@@ -498,7 +498,7 @@ setInterval(fetchVotingStatus, 5000);
|
||||
}
|
||||
.vote-btn:hover:not(:disabled) { background: var(--green-dark); }
|
||||
.vote-btn:disabled {
|
||||
background: #333;
|
||||
background: var(--surface3);
|
||||
color: var(--text-muted);
|
||||
cursor: not-allowed;
|
||||
opacity: .8;
|
||||
@@ -516,8 +516,8 @@ setInterval(fetchVotingStatus, 5000);
|
||||
padding: 1rem;
|
||||
}
|
||||
.modal-box {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
background: var(--modal-bg);
|
||||
border: 1px solid var(--border2);
|
||||
border-radius: 12px;
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
@@ -531,7 +531,7 @@ setInterval(fetchVotingStatus, 5000);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 1rem 1.2rem;
|
||||
border-bottom: 1px solid #2a2a2a;
|
||||
border-bottom: 1px solid var(--surface2);
|
||||
gap: .8rem;
|
||||
}
|
||||
.modal-title-wrap {
|
||||
@@ -574,7 +574,7 @@ setInterval(fetchVotingStatus, 5000);
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.modal-close:hover { color: #fff; background: #2a2a2a; }
|
||||
.modal-close:hover { color: var(--text); background: var(--surface2); }
|
||||
.modal-track-list {
|
||||
overflow-y: auto;
|
||||
padding: .4rem 0;
|
||||
@@ -587,7 +587,7 @@ setInterval(fetchVotingStatus, 5000);
|
||||
cursor: pointer;
|
||||
transition: background .12s;
|
||||
}
|
||||
.modal-track-row:hover { background: #2a2a2a; }
|
||||
.modal-track-row:hover { background: var(--surface2); }
|
||||
.modal-track-num {
|
||||
font-size: .8rem;
|
||||
color: var(--text-muted);
|
||||
|
||||
+40
-8
@@ -5,12 +5,30 @@
|
||||
--bg: #121212;
|
||||
--surface: #1e1e1e;
|
||||
--surface2: #2a2a2a;
|
||||
--surface3: #333333;
|
||||
--green: #1db954;
|
||||
--green-dark: #17a349;
|
||||
--text: #e0e0e0;
|
||||
--text-muted: #888;
|
||||
--red: #e74c3c;
|
||||
--radius: 10px;
|
||||
--nav-bg: #000000;
|
||||
--border: #444444;
|
||||
--border2: #333333;
|
||||
--modal-bg: #1a1a1a;
|
||||
}
|
||||
|
||||
[data-theme="light"] {
|
||||
--bg: #f4f4f4;
|
||||
--surface: #ffffff;
|
||||
--surface2: #f0f0f0;
|
||||
--surface3: #e4e4e4;
|
||||
--text: #111111;
|
||||
--text-muted: #666666;
|
||||
--nav-bg: #f8f8f8;
|
||||
--border: #d8d8d8;
|
||||
--border2: #cccccc;
|
||||
--modal-bg: #ffffff;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -28,12 +46,12 @@ a:hover { text-decoration: underline; }
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #000;
|
||||
background: var(--nav-bg);
|
||||
padding: 0.75rem 1.5rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
border-bottom: 1px solid #333;
|
||||
border-bottom: 1px solid var(--border2);
|
||||
}
|
||||
.brand { font-size: 1.1rem; font-weight: 700; color: var(--green); letter-spacing: 1px; }
|
||||
.nav-links { display: flex; gap: 1.5rem; }
|
||||
@@ -154,7 +172,7 @@ a:hover { text-decoration: underline; }
|
||||
flex: 1;
|
||||
background: var(--surface2);
|
||||
color: var(--text);
|
||||
border: 1px solid #444;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 0.45rem 0.6rem;
|
||||
font-size: 0.875rem;
|
||||
@@ -246,7 +264,7 @@ a:hover { text-decoration: underline; }
|
||||
.input {
|
||||
background: var(--surface2);
|
||||
color: var(--text);
|
||||
border: 1px solid #444;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 0.55rem 0.75rem;
|
||||
font-size: 0.9rem;
|
||||
@@ -265,9 +283,9 @@ a:hover { text-decoration: underline; }
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.4px;
|
||||
padding: 0.5rem 0.6rem;
|
||||
border-bottom: 1px solid #333;
|
||||
border-bottom: 1px solid var(--border2);
|
||||
}
|
||||
.table td { padding: 0.6rem; border-bottom: 1px solid #2a2a2a; vertical-align: middle; }
|
||||
.table td { padding: 0.6rem; border-bottom: 1px solid var(--surface2); vertical-align: middle; }
|
||||
.table tr:last-child td { border-bottom: none; }
|
||||
|
||||
.table-thumb {
|
||||
@@ -308,14 +326,14 @@ a:hover { text-decoration: underline; }
|
||||
.btn-sm {
|
||||
background: var(--surface2);
|
||||
color: var(--text);
|
||||
border: 1px solid #444;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 0.4rem 0.7rem;
|
||||
cursor: pointer;
|
||||
font-size: 0.82rem;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
.btn-sm:hover { background: #333; }
|
||||
.btn-sm:hover { background: var(--surface3); }
|
||||
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
|
||||
.btn-danger:hover { background: var(--red); color: #fff; }
|
||||
|
||||
@@ -346,3 +364,17 @@ a:hover { text-decoration: underline; }
|
||||
|
||||
/* Misc */
|
||||
.empty-msg { color: var(--text-muted); font-size: 0.9rem; }
|
||||
|
||||
/* ── Theme toggle ── */
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1.1rem;
|
||||
padding: 0.3rem 0.4rem;
|
||||
border-radius: 6px;
|
||||
line-height: 1;
|
||||
transition: background 0.15s;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.theme-toggle:hover { background: var(--surface2); }
|
||||
|
||||
Reference in New Issue
Block a user