feat: refactor to SI Quiz with Space Invaders arcade interface
- Updated Dockerfile to Python 3.11, selective COPY for cleaner image - Expanded .gitignore with Python/OS patterns - Added config.json, questions.json, env_example, and static assets - Updated templates (host, player, scores) with Space Invaders UI - Rewrote README for SI Quiz branding and setup docs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+36
-6
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>NI Quiz · Host</title>
|
||||
<title>{{ app_name }} · Host</title>
|
||||
<!-- QR Code library -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
<style>
|
||||
@@ -155,15 +155,35 @@ html,body{width:100%;height:100vh;background:var(--bg);color:var(--text);font-fa
|
||||
}
|
||||
#auth-btn:hover{opacity:.85;}
|
||||
#auth-err{font-family:var(--pixel);font-size:.4rem;color:var(--red);min-height:1rem;}
|
||||
|
||||
/* ── THEME TOGGLE ── */
|
||||
.theme-toggle{
|
||||
position:fixed;top:1rem;right:1rem;z-index:10000;
|
||||
display:flex;gap:.3rem;
|
||||
background:var(--surface);border:1px solid var(--border);
|
||||
border-radius:6px;padding:.3rem .4rem;
|
||||
}
|
||||
.t-btn{
|
||||
padding:.28rem .55rem;border-radius:4px;font-size:.5rem;cursor:pointer;
|
||||
border:1px solid transparent;background:transparent;color:var(--muted);
|
||||
font-family:var(--pixel);transition:all .15s;
|
||||
}
|
||||
.t-btn:hover{color:var(--text);}
|
||||
.t-btn.active{background:var(--accent);color:#000;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="theme-toggle">
|
||||
<button class="t-btn" onclick="setTheme('dark')" id="t-dark">DARK</button>
|
||||
<button class="t-btn" onclick="setTheme('light')" id="t-light">LIGHT</button>
|
||||
<button class="t-btn" onclick="setTheme('hc')" id="t-hc">HC</button>
|
||||
</div>
|
||||
<div class="grid-bg"></div>
|
||||
|
||||
<!-- LOBBY -->
|
||||
<div class="screen active" id="lobby-screen">
|
||||
<div class="logo">🌐 NI QUIZ</div>
|
||||
<div class="tagline">Network Intelligence · LCPR — Host Panel</div>
|
||||
<div class="logo">🌐 {{ app_name }}</div>
|
||||
<div class="tagline">{{ org_name }}{% if org_name %} — {% endif %}Host Panel</div>
|
||||
<div class="lobby-main">
|
||||
<div class="qr-box">
|
||||
<div class="qr-label">SCAN TO PLAY</div>
|
||||
@@ -256,7 +276,8 @@ document.getElementById('join-url').textContent = baseUrl;
|
||||
new QRCode(document.getElementById('qrcode'), {
|
||||
text: baseUrl,
|
||||
width: 160, height: 160,
|
||||
colorDark: '#00c8ff', colorLight: '#0d1117',
|
||||
colorDark: getComputedStyle(document.documentElement).getPropertyValue('--qr-dark').trim() || '#00c8ff',
|
||||
colorLight: getComputedStyle(document.documentElement).getPropertyValue('--qr-light').trim() || '#0d1117',
|
||||
correctLevel: QRCode.CorrectLevel.M
|
||||
});
|
||||
|
||||
@@ -416,8 +437,17 @@ function confetti() {
|
||||
}
|
||||
}
|
||||
|
||||
// ── THEME ─────────────────────────────────────────────────────────────────────
|
||||
function setTheme(t) {
|
||||
document.documentElement.setAttribute('data-theme', t);
|
||||
localStorage.setItem('si-quiz-theme', t);
|
||||
document.querySelectorAll('.t-btn').forEach(b => b.classList.remove('active'));
|
||||
document.getElementById('t-' + t)?.classList.add('active');
|
||||
}
|
||||
(function(){ setTheme(localStorage.getItem('si-quiz-theme') || 'dark'); })();
|
||||
|
||||
// ── AUTH ─────────────────────────────────────────────────────────────────────
|
||||
const HOST_PASSWORD = 'ni2026'; // ← cambia esto
|
||||
const HOST_PASSWORD = '{{ host_password }}';
|
||||
|
||||
function checkAuth() {
|
||||
const saved = sessionStorage.getItem('host_auth');
|
||||
@@ -428,7 +458,7 @@ function checkAuth() {
|
||||
gate.id = 'auth-gate';
|
||||
gate.innerHTML = `
|
||||
<div id="auth-box">
|
||||
<div id="auth-logo">🌐 NI QUIZ</div>
|
||||
<div id="auth-logo">🌐 {{ app_name }}</div>
|
||||
<div id="auth-sub">Host Panel · Acceso restringido</div>
|
||||
<input id="auth-input" type="password" placeholder="contraseña" autocomplete="off" />
|
||||
<button id="auth-btn">ENTRAR →</button>
|
||||
|
||||
Reference in New Issue
Block a user