APmanageur Wi-Fi V1.0

This commit is contained in:
yoannmultigaming committed 2026-11-20 00:29:15 +01:00
1 parent a72d161092
commit 33cf355785
4 files changed
+825 -266

No files matched your search

+167 -44
View File
@@ -443,74 +443,162 @@
} }
/* Boutons de sélection du fournisseur de stockage distant */ /* Boutons de sélection du fournisseur de stockage distant */
.backup-prov-btn { .backup-prov-btn,
button.backup-prov-btn {
background: var(--panel2) !important; background: var(--panel2) !important;
border: 1px solid var(--line) !important; border: 1px solid var(--line) !important;
color: var(--text) !important; color: #ffffff !important;
transition: all .15s ease; transition: all .15s ease;
user-select: none; user-select: none;
} }
.backup-prov-btn span { .backup-prov-btn span,
color: inherit !important; button.backup-prov-btn span {
color: #ffffff !important;
} }
.backup-prov-btn:hover:not(.active) { .backup-prov-btn:hover:not(.active),
button.backup-prov-btn:hover:not(.active) {
background: var(--panel) !important; background: var(--panel) !important;
border-color: var(--blue) !important; border-color: var(--blue) !important;
color: var(--text) !important; color: #ffffff !important;
} }
.backup-prov-btn.active { .backup-prov-btn.active,
button.backup-prov-btn.active {
border: 2px solid var(--blue) !important; border: 2px solid var(--blue) !important;
box-shadow: 0 0 0 1px var(--blue) !important; box-shadow: 0 0 0 1px var(--blue) !important;
font-weight: 700 !important; font-weight: 700 !important;
background: rgba(92, 167, 255, 0.22) !important; background: rgba(92, 167, 255, 0.28) !important;
color: #ffffff !important; color: #ffffff !important;
} }
.backup-prov-btn.active span { .backup-prov-btn.active span,
color: inherit !important; button.backup-prov-btn.active span {
color: #ffffff !important;
} }
/* Adaptation pour les thèmes clairs (Light, Windows XP, macOS Clair) */ /* Thème Clair */
html[data-theme="light"] .backup-prov-btn, html[data-theme="light"] .backup-prov-btn,
html[data-theme="winxp"] .backup-prov-btn, html[data-theme="light"] button.backup-prov-btn {
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn, background: #f0f2f5 !important;
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn { border-color: #d1d5db !important;
background: var(--panel2) !important; color: #111827 !important;
border-color: var(--line) !important;
color: var(--text) !important;
} }
html[data-theme="light"] .backup-prov-btn span, html[data-theme="light"] .backup-prov-btn span,
html[data-theme="winxp"] .backup-prov-btn span, html[data-theme="light"] button.backup-prov-btn span {
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn span, color: #111827 !important;
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn span {
color: var(--text) !important;
} }
html[data-theme="light"] .backup-prov-btn.active, html[data-theme="light"] .backup-prov-btn.active,
html[data-theme="winxp"] .backup-prov-btn.active, html[data-theme="light"] button.backup-prov-btn.active {
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn.active, background: var(--blue) !important;
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn.active {
background: rgba(30, 110, 240, 0.12) !important;
border-color: var(--blue) !important; border-color: var(--blue) !important;
color: var(--blue) !important; color: #ffffff !important;
} }
html[data-theme="light"] .backup-prov-btn.active span, html[data-theme="light"] .backup-prov-btn.active span,
html[data-theme="light"] button.backup-prov-btn.active span {
color: #ffffff !important;
}
/* Thème Windows XP */
html[data-theme="winxp"] .backup-prov-btn,
html[data-theme="winxp"] button.backup-prov-btn {
background: #ece9d8 !important;
border-color: #7f9db9 !important;
color: #000000 !important;
}
html[data-theme="winxp"] .backup-prov-btn span,
html[data-theme="winxp"] button.backup-prov-btn span {
color: #000000 !important;
}
html[data-theme="winxp"] .backup-prov-btn.active,
html[data-theme="winxp"] button.backup-prov-btn.active {
background: #0a246a !important;
border-color: #0a246a !important;
color: #ffffff !important;
}
html[data-theme="winxp"] .backup-prov-btn.active span, html[data-theme="winxp"] .backup-prov-btn.active span,
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn.active span, html[data-theme="winxp"] button.backup-prov-btn.active span {
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn.active span { color: #ffffff !important;
color: var(--blue) !important; }
/* Thème macOS (Clair & Sombre) */
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn,
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn,
html[data-theme="macos"][data-macos-mode="light"] button.backup-prov-btn,
html[data-theme="macos"]:not([data-macos-mode="dark"]) button.backup-prov-btn {
background: #f2f2f7 !important;
border-color: rgba(0, 0, 0, 0.12) !important;
color: #1d1d1f !important;
}
html[data-theme="macos"][data-macos-mode="light"] .backup-prov-btn span,
html[data-theme="macos"]:not([data-macos-mode="dark"]) .backup-prov-btn span,
html[data-theme="macos"][data-macos-mode="light"] button.backup-prov-btn span,
html[data-theme="macos"]:not([data-macos-mode="dark"]) button.backup-prov-btn span {
color: #1d1d1f !important;
}
html[data-theme="macos"][data-macos-mode="dark"] .backup-prov-btn,
html[data-theme="macos"][data-macos-mode="dark"] button.backup-prov-btn {
background: rgba(255, 255, 255, 0.08) !important;
border-color: rgba(255, 255, 255, 0.15) !important;
color: #ffffff !important;
}
html[data-theme="macos"][data-macos-mode="dark"] .backup-prov-btn span,
html[data-theme="macos"][data-macos-mode="dark"] button.backup-prov-btn span {
color: #ffffff !important;
}
html[data-theme="macos"] .backup-prov-btn.active,
html[data-theme="macos"] button.backup-prov-btn.active {
background: #0071e3 !important;
border-color: #0071e3 !important;
color: #ffffff !important;
}
html[data-theme="macos"] .backup-prov-btn.active span,
html[data-theme="macos"] button.backup-prov-btn.active span {
color: #ffffff !important;
} }
/* Thème Hacker */ /* Thème Hacker */
html[data-theme="hacker"] .backup-prov-btn.active { html[data-theme="hacker"] .backup-prov-btn,
background: rgba(0, 255, 65, 0.25) !important; html[data-theme="hacker"] button.backup-prov-btn {
border-color: #00ff41 !important; background: #020a04 !important;
border-color: rgba(0, 255, 65, 0.3) !important;
color: #00ff41 !important; color: #00ff41 !important;
} }
html[data-theme="hacker"] .backup-prov-btn span,
html[data-theme="hacker"] button.backup-prov-btn span {
color: #00ff41 !important;
}
html[data-theme="hacker"] .backup-prov-btn.active,
html[data-theme="hacker"] button.backup-prov-btn.active {
background: rgba(0, 255, 65, 0.25) !important;
border-color: #00ff41 !important;
box-shadow: 0 0 10px rgba(0, 255, 65, 0.4) !important;
color: #ffffff !important;
}
html[data-theme="hacker"] .backup-prov-btn.active span,
html[data-theme="hacker"] button.backup-prov-btn.active span {
color: #ffffff !important;
}
/* Thème Futuriste */ /* Thème Futuriste */
html[data-theme="futuristic"] .backup-prov-btn.active { html[data-theme="futuristic"] .backup-prov-btn,
background: rgba(0, 240, 255, 0.22) !important; html[data-theme="futuristic"] button.backup-prov-btn {
border-color: #00f0ff !important; background: rgba(8, 20, 44, 0.8) !important;
border-color: rgba(0, 240, 255, 0.3) !important;
color: #e6f6ff !important; color: #e6f6ff !important;
} }
html[data-theme="futuristic"] .backup-prov-btn span,
html[data-theme="futuristic"] button.backup-prov-btn span {
color: #e6f6ff !important;
}
html[data-theme="futuristic"] .backup-prov-btn.active,
html[data-theme="futuristic"] button.backup-prov-btn.active {
background: rgba(0, 240, 255, 0.28) !important;
border-color: #00f0ff !important;
box-shadow: 0 0 10px rgba(0, 240, 255, 0.35) !important;
color: #ffffff !important;
}
html[data-theme="futuristic"] .backup-prov-btn.active span,
html[data-theme="futuristic"] button.backup-prov-btn.active span {
color: #ffffff !important;
}
/* Boutons de sélection de jeu Easter Egg */ /* Boutons de sélection de jeu Easter Egg */
.game-switch-btn.active { .game-switch-btn.active {
@@ -5195,27 +5283,27 @@
<!-- Grille de sélection rapide du fournisseur avec les vrais logos officiels --> <!-- Grille de sélection rapide du fournisseur avec les vrais logos officiels -->
<div id="backupProviderSelector" style="display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px"> <div id="backupProviderSelector" style="display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px">
<button type="button" class="backup-prov-btn secondary" data-provider="ftp" onclick="selectBackupRemoteProvider('ftp')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="ftp" onclick="selectBackupRemoteProvider('ftp')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
📡 <span>FTP / FTPS</span> 📡 <span>FTP / FTPS</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="sftp" onclick="selectBackupRemoteProvider('sftp')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="sftp" onclick="selectBackupRemoteProvider('sftp')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
🔐 <span>SFTP (SSH)</span> 🔐 <span>SFTP (SSH)</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="gdrive" onclick="selectBackupRemoteProvider('gdrive')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="gdrive" onclick="selectBackupRemoteProvider('gdrive')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
<img src="/images/gdrive.svg" width="16" height="15" alt="Google Drive" style="object-fit:contain;vertical-align:middle"> <img src="/images/gdrive.svg" width="16" height="15" alt="Google Drive" style="object-fit:contain;vertical-align:middle">
<span>Google Drive</span> <span>Google Drive</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="dropbox" onclick="selectBackupRemoteProvider('dropbox')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="dropbox" onclick="selectBackupRemoteProvider('dropbox')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
<img src="/images/dropbox.svg" width="16" height="16" alt="Dropbox" style="object-fit:contain;vertical-align:middle"> <img src="/images/dropbox.svg" width="16" height="16" alt="Dropbox" style="object-fit:contain;vertical-align:middle">
<span>Dropbox</span> <span>Dropbox</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="webdav" onclick="selectBackupRemoteProvider('webdav')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="webdav" onclick="selectBackupRemoteProvider('webdav')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
🌐 <span>WebDAV</span> 🌐 <span>WebDAV</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="s3" onclick="selectBackupRemoteProvider('s3')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="s3" onclick="selectBackupRemoteProvider('s3')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
🪣 <span>S3 / MinIO</span> 🪣 <span>S3 / MinIO</span>
</button> </button>
<button type="button" class="backup-prov-btn secondary" data-provider="webhook" onclick="selectBackupRemoteProvider('webhook')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer"> <button type="button" class="backup-prov-btn" data-provider="webhook" onclick="selectBackupRemoteProvider('webhook')" style="padding:6px 12px;font-size:12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;cursor:pointer">
🔗 <span>Webhook</span> 🔗 <span>Webhook</span>
</button> </button>
</div> </div>
@@ -8214,7 +8302,8 @@ ${vpnBadgeTopo}
// $ est défini globalement en haut du script // $ est défini globalement en haut du script
let themePref = localStorage.getItem('apTheme') || 'dark'; const themeMedia = window.matchMedia('(prefers-color-scheme: light)'); let themePref = localStorage.getItem('apTheme') || 'dark'; const themeMedia = window.matchMedia('(prefers-color-scheme: light)');
function applyTheme() { function applyTheme() {
document.documentElement.dataset.theme = themePref === 'auto' ? (themeMedia.matches ? 'light' : 'dark') : themePref; const activeTheme = themePref === 'auto' ? (themeMedia.matches ? 'light' : 'dark') : themePref;
document.documentElement.dataset.theme = activeTheme;
if (themePref === 'macos') { if (themePref === 'macos') {
document.documentElement.dataset.macosMode = themeMedia.matches ? 'light' : 'dark'; document.documentElement.dataset.macosMode = themeMedia.matches ? 'light' : 'dark';
} else { } else {
@@ -8222,6 +8311,17 @@ ${vpnBadgeTopo}
} }
const s = document.getElementById('themeSelect'); if (s) s.value = themePref; const s = document.getElementById('themeSelect'); if (s) s.value = themePref;
if (typeof renderStatsChart === 'function' && statsDataCache) renderStatsChart(currentStatsRange, true); if (typeof renderStatsChart === 'function' && statsDataCache) renderStatsChart(currentStatsRange, true);
// Synchroniser le thème avec le jeu d'arcade Easter Egg (si ouvert)
try {
const iframe = document.getElementById('easterEggGameIframe');
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage({
type: 'themeChange',
theme: activeTheme,
macosMode: document.documentElement.dataset.macosMode || ''
}, '*');
}
} catch (_) { }
} }
themeMedia.addEventListener('change', () => { if (themePref === 'auto' || themePref === 'macos') applyTheme() }); applyTheme(); themeMedia.addEventListener('change', () => { if (themePref === 'auto' || themePref === 'macos') applyTheme() }); applyTheme();
@@ -14367,7 +14467,10 @@ ${vpnBadgeTopo}
const iframe = $('easterEggGameIframe'); const iframe = $('easterEggGameIframe');
if (iframe) { if (iframe) {
iframe.src = '/jeux/' + gameName + '.html'; const activeTheme = document.documentElement.dataset.theme || 'dark';
const activeMacosMode = document.documentElement.dataset.macosMode || '';
const themeQuery = '?theme=' + encodeURIComponent(activeTheme) + (activeMacosMode ? '&macosMode=' + encodeURIComponent(activeMacosMode) : '');
iframe.src = '/jeux/' + gameName + '.html' + themeQuery;
setTimeout(() => { setTimeout(() => {
try { iframe.focus(); if (iframe.contentWindow) iframe.contentWindow.focus(); } catch (e) { } try { iframe.focus(); if (iframe.contentWindow) iframe.contentWindow.focus(); } catch (e) { }
}, 150); }, 150);
@@ -14394,6 +14497,26 @@ ${vpnBadgeTopo}
if (game) { if (game) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
// 1. Effacer immédiatement la saisie de texte
inputEl.value = '';
// 2. Réinitialiser les filtres associés pour ne pas fausser l'affichage du tableau
if (inputEl.id === 'packetFilterInput') {
captureFilter = '';
capturePage = 1;
document.querySelectorAll('.filter-chip').forEach(c => c.classList.remove('active'));
const allChip = document.querySelector('.filter-chip[data-filter=""]');
if (allChip) allChip.classList.add('active');
if (typeof renderCaptureTable === 'function') renderCaptureTable();
} else if (inputEl.id === 'devicesSearchInput') {
deviceFilter = '';
if (typeof renderDevicesTable === 'function') renderDevicesTable();
} else if (inputEl.id === 'vpnClientsSearchInput') {
if (typeof renderVpnClientsTable === 'function') renderVpnClientsTable();
}
// 3. Ouvrir l'arcade Easter Egg
openEasterEggModal(game); openEasterEggModal(game);
} }
} }
+297 -128
View File
@@ -1,15 +1,159 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr" data-theme="dark">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>T-Rex Dino Runner - AP Manageur</title> <title>T-Rex Dino Runner - AP Manageur</title>
<style> <style>
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; } * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
:root, html[data-theme="dark"] {
--bg: #071326;
--card-bg: #0d1d36;
--panel-box: #132746;
--border: #223c68;
--text: #eef4ff;
--muted: #9aa8c5;
--blue: #5ca7ff;
--blue-btn-text: #071326;
--canvas-day: #0f2444;
--canvas-night: #050d1a;
--dino-color: #eef4ff;
--dino-eye: #0f2444;
--cactus-color: #34d399;
--ptero-color: #ff6b6b;
--ground-color: #5ca7ff;
--ground-bump: #38bdf8;
--cloud-color: #223c68;
--star-color: #eef4ff;
}
html[data-theme="light"] {
--bg: #f2f5fa;
--card-bg: #ffffff;
--panel-box: #e9eef7;
--border: #d2dcec;
--text: #15203a;
--muted: #5b6b8c;
--blue: #1e6ef0;
--blue-btn-text: #ffffff;
--canvas-day: #f8fafc;
--canvas-night: #1e293b;
--dino-color: #334155;
--dino-eye: #f8fafc;
--cactus-color: #16a34a;
--ptero-color: #ef4444;
--ground-color: #64748b;
--ground-bump: #94a3b8;
--cloud-color: #cbd5e1;
--star-color: #f1f5f9;
}
html[data-theme="winxp"] {
--bg: #ece9d8;
--card-bg: #ece9d8;
--panel-box: #ffffff;
--border: #7f9db9;
--text: #000000;
--muted: #444444;
--blue: #0055ea;
--blue-btn-text: #ffffff;
--canvas-day: #ffffff;
--canvas-night: #0a246a;
--dino-color: #111111;
--dino-eye: #ffffff;
--cactus-color: #198754;
--ptero-color: #cc0000;
--ground-color: #7f9db9;
--ground-bump: #555555;
--cloud-color: #dcdcdc;
--star-color: #ffffdd;
font-family: 'Tahoma', sans-serif !important;
}
html[data-theme="macos"][data-macos-mode="light"],
html[data-theme="macos"]:not([data-macos-mode="dark"]) {
--bg: #f5f5f7;
--card-bg: #ffffff;
--panel-box: #f2f2f7;
--border: rgba(0, 0, 0, 0.12);
--text: #1d1d1f;
--muted: #86868b;
--blue: #0071e3;
--blue-btn-text: #ffffff;
--canvas-day: #ffffff;
--canvas-night: #2c2c2e;
--dino-color: #1d1d1f;
--dino-eye: #ffffff;
--cactus-color: #34c759;
--ptero-color: #ff3b30;
--ground-color: #8e8e93;
--ground-bump: #636366;
--cloud-color: #e5e5ea;
--star-color: #ffffff;
}
html[data-theme="macos"][data-macos-mode="dark"] {
--bg: #1e1e1e;
--card-bg: #2d2d2d;
--panel-box: #3a3a3c;
--border: rgba(255, 255, 255, 0.15);
--text: #f5f5f7;
--muted: #98989d;
--blue: #0a84ff;
--blue-btn-text: #ffffff;
--canvas-day: #252527;
--canvas-night: #141416;
--dino-color: #f5f5f7;
--dino-eye: #252527;
--cactus-color: #30d158;
--ptero-color: #ff453a;
--ground-color: #636366;
--ground-bump: #8e8e93;
--cloud-color: #3a3a3c;
--star-color: #ffffff;
}
html[data-theme="futuristic"] {
--bg: #050811;
--card-bg: #091124;
--panel-box: #0f1c3a;
--border: #00f0ff;
--text: #e6f6ff;
--muted: #64b5f6;
--blue: #00f0ff;
--blue-btn-text: #050811;
--canvas-day: #030818;
--canvas-night: #01040a;
--dino-color: #00f0ff;
--dino-eye: #030818;
--cactus-color: #c084fc;
--ptero-color: #f43f5e;
--ground-color: #00f0ff;
--ground-bump: #38bdf8;
--cloud-color: #1e293b;
--star-color: #00f0ff;
}
html[data-theme="hacker"] {
--bg: #000000;
--card-bg: #051206;
--panel-box: #0a1f0c;
--border: #00ff41;
--text: #00ff41;
--muted: #008f11;
--blue: #00ff41;
--blue-btn-text: #000000;
--canvas-day: #020d04;
--canvas-night: #000000;
--dino-color: #00ff41;
--dino-eye: #020d04;
--cactus-color: #00bb30;
--ptero-color: #ff0055;
--ground-color: #00ff41;
--ground-bump: #00ff41;
--cloud-color: #00330d;
--star-color: #00ff41;
}
body { body {
background: #071326; background: var(--bg);
color: #eef4ff; color: var(--text);
font-family: "Courier New", Courier, monospace, -apple-system, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -17,16 +161,18 @@
min-height: 100vh; min-height: 100vh;
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
transition: background 0.3s ease, color 0.3s ease;
} }
.game-card { .game-card {
background: #0d1d36; background: var(--card-bg);
border: 1px solid #223c68; border: 1px solid var(--border);
border-radius: 14px; border-radius: 14px;
padding: 16px; padding: 16px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 167, 255, 0.15); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 167, 255, 0.12);
position: relative; position: relative;
max-width: 700px; max-width: 700px;
width: 100%; width: 100%;
transition: all 0.3s ease;
} }
.header-bar { .header-bar {
display: flex; display: flex;
@@ -34,28 +180,29 @@
align-items: center; align-items: center;
margin-bottom: 12px; margin-bottom: 12px;
font-size: 14px; font-size: 14px;
color: #9aa8c5; color: var(--muted);
} }
.scores { .scores {
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
letter-spacing: 2px; letter-spacing: 2px;
color: #5ca7ff; color: var(--blue);
font-family: monospace;
} }
.scores .hi { .scores .hi {
color: #9aa8c5; color: var(--muted);
margin-right: 12px; margin-right: 12px;
} }
.canvas-wrap { .canvas-wrap {
position: relative; position: relative;
background: #f7f7f7; background: var(--canvas-day);
border: 2px solid #223c68; border: 2px solid var(--border);
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
transition: background 0.6s ease; transition: background 0.6s ease, border-color 0.3s ease;
} }
body.night-mode .canvas-wrap { body.night-mode .canvas-wrap {
background: #111827; background: var(--canvas-night);
} }
canvas { canvas {
display: block; display: block;
@@ -69,14 +216,14 @@
align-items: center; align-items: center;
margin-top: 12px; margin-top: 12px;
font-size: 12px; font-size: 12px;
color: #9aa8c5; color: var(--muted);
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 8px;
} }
.controls-hint kbd { .controls-hint kbd {
background: #132746; background: var(--panel-box);
border: 1px solid #223c68; border: 1px solid var(--border);
color: #fff; color: var(--text);
padding: 2px 6px; padding: 2px 6px;
border-radius: 4px; border-radius: 4px;
font-size: 11px; font-size: 11px;
@@ -89,7 +236,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: rgba(7, 19, 38, 0.85); background: rgba(7, 19, 38, 0.85);
backdrop-filter: blur(2px); backdrop-filter: blur(3px);
z-index: 10; z-index: 10;
gap: 12px; gap: 12px;
} }
@@ -99,8 +246,8 @@
letter-spacing: 3px; letter-spacing: 3px;
} }
.restart-btn { .restart-btn {
background: #5ca7ff; background: var(--blue);
color: #071326; color: var(--blue-btn-text);
border: 0; border: 0;
padding: 8px 20px; padding: 8px 20px;
border-radius: 6px; border-radius: 6px;
@@ -110,8 +257,10 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
transition: opacity 0.15s ease;
} }
.restart-btn:hover { background: #7ab7ff; } .restart-btn:hover { opacity: 0.9; }
</style> </style>
</head> </head>
<body> <body>
@@ -141,6 +290,31 @@
</div> </div>
<script> <script>
// Theme Management
function setTheme(theme, macosMode) {
if (!theme) theme = 'dark';
document.documentElement.dataset.theme = theme;
if (theme === 'macos' && macosMode) {
document.documentElement.dataset.macosMode = macosMode;
} else {
delete document.documentElement.dataset.macosMode;
}
}
const urlParams = new URLSearchParams(window.location.search);
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
window.addEventListener('message', e => {
if (e.data && e.data.type === 'themeChange') {
setTheme(e.data.theme, e.data.macosMode);
}
});
function getThemeProp(name, fallback) {
const val = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
return val || fallback;
}
// Audio synthesizer // Audio synthesizer
let audioCtx = null; let audioCtx = null;
function playTone(type) { function playTone(type) {
@@ -203,36 +377,30 @@
width: 44, width: 44,
height: 44, height: 44,
vy: 0, vy: 0,
gravity: 0.72, jumpForce: -11.5,
jumpStrength: -11.5, gravity: 0.65,
isGrounded: true, isGrounded: true,
isDucking: false, isDucking: false,
legFrame: 0, legFrame: 0,
legTimer: 0 legTimer: 0
}; };
// Obstacles
let obstacles = []; let obstacles = [];
let clouds = []; let clouds = [
{ x: 120, y: 50, speed: 0.8 },
{ x: 380, y: 70, speed: 0.6 },
{ x: 550, y: 40, speed: 0.7 }
];
let stars = []; let stars = [];
for (let i = 0; i < 25; i++) {
// Init clouds
for (let i = 0; i < 4; i++) {
clouds.push({
x: Math.random() * canvas.width,
y: 20 + Math.random() * 60,
speed: 0.5 + Math.random() * 0.8
});
}
// Init stars for night mode
for (let i = 0; i < 20; i++) {
stars.push({ stars.push({
x: Math.random() * canvas.width, x: Math.random() * 640,
y: Math.random() * 120, y: Math.random() * 120 + 10,
r: Math.random() * 1.5 + 0.5 r: Math.random() * 1.5 + 0.5
}); });
} }
// Ground bumps
let groundOffset = 0; let groundOffset = 0;
function jump() { function jump() {
@@ -243,72 +411,75 @@
resetGame(); resetGame();
return; return;
} }
if (dino.isGrounded) { if (dino.isGrounded && !dino.isDucking) {
dino.vy = dino.jumpStrength; dino.vy = dino.jumpForce;
dino.isGrounded = false; dino.isGrounded = false;
playTone('jump'); playTone('jump');
} }
} }
function duck(down) { function duck(isDucking) {
if (!gameStarted || gameOver) return; if (!gameStarted || gameOver) return;
dino.isDucking = down; dino.isDucking = isDucking;
if (down && !dino.isGrounded) { if (isDucking) {
dino.vy += 4.5; // Fast drop dino.height = 28;
if (!dino.isGrounded) {
dino.vy += 4; // Fast fall
}
} else {
dino.height = 44;
} }
} }
function resetGame() { function resetGame() {
gameOver = false;
gameStarted = true;
score = 0; score = 0;
gameSpeed = 6; gameSpeed = 6;
nextObstacleTimer = 50;
obstacles = []; obstacles = [];
dino.y = GROUND_Y - 44; dino.y = GROUND_Y - 44;
dino.vy = 0; dino.vy = 0;
dino.isGrounded = true; dino.isGrounded = true;
dino.isDucking = false; dino.isDucking = false;
gameOver = false; dino.height = 44;
gameStarted = true;
isNight = false;
document.body.classList.remove('night-mode');
overlay.style.display = 'none'; overlay.style.display = 'none';
document.body.classList.remove('night-mode');
isNight = false;
} }
function spawnObstacle() { function spawnObstacle() {
const isPterodactyl = score > 250 && Math.random() < 0.35; const type = (score > 250 && Math.random() < 0.3) ? 'ptero' : 'cactus';
if (isPterodactyl) { if (type === 'cactus') {
const flyHeights = [GROUND_Y - 26, GROUND_Y - 50, GROUND_Y - 72]; const isBig = Math.random() < 0.4;
const flyY = flyHeights[Math.floor(Math.random() * flyHeights.length)]; const count = isBig ? (Math.random() < 0.5 ? 2 : 1) : Math.floor(Math.random() * 3) + 1;
obstacles.push({ const w = (isBig ? 24 : 16) * count;
type: 'ptero', const h = isBig ? 46 : 34;
x: canvas.width + 20,
y: flyY,
width: 36,
height: 26,
frame: 0,
frameTimer: 0
});
} else {
const kinds = [
{ width: 16, height: 35 },
{ width: 32, height: 35 },
{ width: 48, height: 35 },
{ width: 22, height: 46 } // Tall
];
const kind = kinds[Math.floor(Math.random() * kinds.length)];
obstacles.push({ obstacles.push({
type: 'cactus', type: 'cactus',
x: canvas.width + 20, x: canvas.width + 20,
y: GROUND_Y - kind.height, y: GROUND_Y - h,
width: kind.width, width: w,
height: kind.height height: h,
isBig: isBig
});
} else {
// Pterodactyl fly height (low, mid, high)
const heights = [GROUND_Y - 32, GROUND_Y - 55, GROUND_Y - 80];
const h = heights[Math.floor(Math.random() * heights.length)];
obstacles.push({
type: 'ptero',
x: canvas.width + 20,
y: h,
width: 40,
height: 28,
frame: 0,
frameTimer: 0
}); });
} }
} }
function checkCollision(r1, r2) { function checkCollision(r1, r2) {
// Small margin of forgiveness (hitbox padding) const p = 6;
const p = 4;
return ( return (
r1.x + p < r2.x + r2.width && r1.x + p < r2.x + r2.width &&
r1.x + r1.width - p > r2.x && r1.x + r1.width - p > r2.x &&
@@ -318,7 +489,9 @@
} }
function drawPixelDino(x, y, w, h, isDucking, legFrame, isDead) { function drawPixelDino(x, y, w, h, isDucking, legFrame, isDead) {
ctx.fillStyle = isNight ? '#e5e7eb' : '#535353'; const dinoColor = getThemeProp('--dino-color', '#eef4ff');
const eyeColor = isNight ? getThemeProp('--canvas-night', '#050d1a') : getThemeProp('--canvas-day', '#0f2444');
ctx.fillStyle = dinoColor;
if (isDucking && dino.isGrounded) { if (isDucking && dino.isGrounded) {
// Ducking body // Ducking body
@@ -326,9 +499,9 @@
// Head low // Head low
ctx.fillRect(x + 40, y + 10, 18, 14); ctx.fillRect(x + 40, y + 10, 18, 14);
// Eye // Eye
ctx.fillStyle = isNight ? '#111827' : '#f7f7f7'; ctx.fillStyle = eyeColor;
ctx.fillRect(x + 48, y + 12, 3, 3); ctx.fillRect(x + 48, y + 12, 3, 3);
ctx.fillStyle = isNight ? '#e5e7eb' : '#535353'; ctx.fillStyle = dinoColor;
// Legs // Legs
if (legFrame === 0) { if (legFrame === 0) {
ctx.fillRect(x + 10, y + 36, 4, 8); ctx.fillRect(x + 10, y + 36, 4, 8);
@@ -345,13 +518,12 @@
ctx.fillRect(x + 22, y, 22, 16); ctx.fillRect(x + 22, y, 22, 16);
ctx.fillRect(x + 18, y + 6, 6, 10); ctx.fillRect(x + 18, y + 6, 6, 10);
// Eye // Eye
ctx.fillStyle = isNight ? '#111827' : '#f7f7f7'; ctx.fillStyle = eyeColor;
ctx.fillRect(x + 26, y + 3, isDead ? 5 : 3, 3); ctx.fillRect(x + 26, y + 3, isDead ? 5 : 3, 3);
if (isDead) { if (isDead) {
// X eye
ctx.fillRect(x + 28, y + 2, 2, 5); ctx.fillRect(x + 28, y + 2, 2, 5);
} }
ctx.fillStyle = isNight ? '#e5e7eb' : '#535353'; ctx.fillStyle = dinoColor;
// Snout / mouth // Snout / mouth
ctx.fillRect(x + 36, y + 8, 8, 6); ctx.fillRect(x + 36, y + 8, 8, 6);
@@ -379,7 +551,7 @@
} }
function drawCactus(x, y, w, h) { function drawCactus(x, y, w, h) {
ctx.fillStyle = isNight ? '#34d399' : '#10b981'; ctx.fillStyle = getThemeProp('--cactus-color', '#34d399');
// Main stem // Main stem
ctx.fillRect(x + w * 0.35, y, w * 0.3, h); ctx.fillRect(x + w * 0.35, y, w * 0.3, h);
// Branches // Branches
@@ -392,7 +564,7 @@
} }
function drawPterodactyl(p) { function drawPterodactyl(p) {
ctx.fillStyle = isNight ? '#f87171' : '#ef4444'; ctx.fillStyle = getThemeProp('--ptero-color', '#ff6b6b');
const x = p.x, y = p.y; const x = p.x, y = p.y;
// Body // Body
ctx.fillRect(x + 10, y + 8, 16, 8); ctx.fillRect(x + 10, y + 8, 16, 8);
@@ -408,7 +580,7 @@
} }
function drawCloud(c) { function drawCloud(c) {
ctx.fillStyle = isNight ? '#374151' : '#d1d5db'; ctx.fillStyle = getThemeProp('--cloud-color', '#223c68');
ctx.beginPath(); ctx.beginPath();
ctx.arc(c.x, c.y, 10, 0, Math.PI * 2); ctx.arc(c.x, c.y, 10, 0, Math.PI * 2);
ctx.arc(c.x + 10, c.y - 6, 12, 0, Math.PI * 2); ctx.arc(c.x + 10, c.y - 6, 12, 0, Math.PI * 2);
@@ -424,75 +596,72 @@
const currentIntScore = Math.floor(score); const currentIntScore = Math.floor(score);
currentScoreEl.textContent = String(currentIntScore).padStart(5, '0'); currentScoreEl.textContent = String(currentIntScore).padStart(5, '0');
// Milestone chime // High score
if (currentIntScore > 0 && currentIntScore % 100 === 0 && Math.floor(score - 0.2) % 100 !== 0) { if (currentIntScore > highScore) {
highScore = currentIntScore;
hiScoreEl.textContent = String(highScore).padStart(5, '0');
localStorage.setItem('ap_dino_hi', highScore);
}
// Night mode toggle every 700 points
const nightCycle = Math.floor(score / 700) % 2 === 1;
if (nightCycle !== isNight) {
isNight = nightCycle;
document.body.classList.toggle('night-mode', isNight);
}
// Score milestone beep
if (currentIntScore > 0 && currentIntScore % 100 === 0 && Math.floor((score - 0.2)) % 100 !== 0) {
playTone('score'); playTone('score');
} }
// Day/night shift
const nightPeriod = Math.floor(currentIntScore / 500) % 2 === 1;
if (nightPeriod !== isNight) {
isNight = nightPeriod;
if (isNight) document.body.classList.add('night-mode');
else document.body.classList.remove('night-mode');
}
// Dino physics // Dino physics
dino.vy += dino.gravity;
dino.y += dino.vy; dino.y += dino.vy;
const effectiveH = dino.isDucking ? 26 : 44; dino.vy += dino.gravity;
if (dino.y >= GROUND_Y - effectiveH) {
dino.y = GROUND_Y - effectiveH; if (dino.y >= GROUND_Y - dino.height) {
dino.y = GROUND_Y - dino.height;
dino.vy = 0; dino.vy = 0;
dino.isGrounded = true; dino.isGrounded = true;
} }
// Leg animation // Dino animation legs
dino.legTimer += gameSpeed; dino.legTimer++;
if (dino.legTimer > 40) { if (dino.legTimer > 5) {
dino.legFrame = (dino.legFrame === 0) ? 1 : 0;
dino.legTimer = 0; dino.legTimer = 0;
dino.legFrame = dino.legFrame === 0 ? 1 : 0;
} }
// Spawn obstacles // Obstacle timer
nextObstacleTimer -= 1; nextObstacleTimer -= gameSpeed;
if (nextObstacleTimer <= 0) { if (nextObstacleTimer <= 0) {
spawnObstacle(); spawnObstacle();
nextObstacleTimer = Math.max(45, Math.floor(65 + Math.random() * 85 - (gameSpeed * 2))); // Random interval based on speed
nextObstacleTimer = Math.floor(Math.random() * 60) + (100 - Math.min(gameSpeed * 5, 50));
} }
// Update obstacles // Move obstacles
for (let i = obstacles.length - 1; i >= 0; i--) { for (let i = obstacles.length - 1; i >= 0; i--) {
const obs = obstacles[i]; const obs = obstacles[i];
obs.x -= gameSpeed; obs.x -= gameSpeed;
if (obs.type === 'ptero') { if (obs.type === 'ptero') {
obs.frameTimer += 1; obs.frameTimer = (obs.frameTimer || 0) + 1;
if (obs.frameTimer > 10) { if (obs.frameTimer > 12) {
obs.frame = (obs.frame === 0) ? 1 : 0;
obs.frameTimer = 0; obs.frameTimer = 0;
obs.frame = obs.frame === 0 ? 1 : 0;
} }
} }
// Collision check // Collision detection
const dinoBox = { if (checkCollision(dino, obs)) {
x: dino.x,
y: dino.y,
width: dino.isDucking ? 54 : dino.width,
height: dino.isDucking ? 26 : dino.height
};
if (checkCollision(dinoBox, obs)) {
gameOver = true; gameOver = true;
playTone('hit'); playTone('hit');
overlay.style.display = 'flex'; overlay.style.display = 'flex';
if (currentIntScore > highScore) {
highScore = currentIntScore;
localStorage.setItem('ap_dino_hi', highScore);
hiScoreEl.textContent = String(highScore).padStart(5, '0');
}
} }
if (obs.x + obs.width < -30) { // Offscreen removal
if (obs.x + obs.width < -10) {
obstacles.splice(i, 1); obstacles.splice(i, 1);
} }
} }
@@ -512,7 +681,7 @@
// Stars in night mode // Stars in night mode
if (isNight) { if (isNight) {
ctx.fillStyle = '#f9fafb'; ctx.fillStyle = getThemeProp('--star-color', '#eef4ff');
stars.forEach(s => { stars.forEach(s => {
ctx.beginPath(); ctx.beginPath();
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2); ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
@@ -523,7 +692,7 @@
ctx.beginPath(); ctx.beginPath();
ctx.arc(560, 40, 16, 0, Math.PI * 2); ctx.arc(560, 40, 16, 0, Math.PI * 2);
ctx.fill(); ctx.fill();
ctx.fillStyle = '#111827'; ctx.fillStyle = getThemeProp('--canvas-night', '#050d1a');
ctx.beginPath(); ctx.beginPath();
ctx.arc(553, 37, 13, 0, Math.PI * 2); ctx.arc(553, 37, 13, 0, Math.PI * 2);
ctx.fill(); ctx.fill();
@@ -533,7 +702,7 @@
clouds.forEach(drawCloud); clouds.forEach(drawCloud);
// Ground Line // Ground Line
ctx.strokeStyle = isNight ? '#4b5563' : '#737373'; ctx.strokeStyle = getThemeProp('--ground-color', '#5ca7ff');
ctx.lineWidth = 2; ctx.lineWidth = 2;
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(0, GROUND_Y); ctx.moveTo(0, GROUND_Y);
@@ -541,7 +710,7 @@
ctx.stroke(); ctx.stroke();
// Ground texture bumps // Ground texture bumps
ctx.fillStyle = isNight ? '#4b5563' : '#737373'; ctx.fillStyle = getThemeProp('--ground-bump', '#38bdf8');
for (let x = -groundOffset; x < canvas.width; x += 30) { for (let x = -groundOffset; x < canvas.width; x += 30) {
ctx.fillRect(x + 5, GROUND_Y + 4, 8, 2); ctx.fillRect(x + 5, GROUND_Y + 4, 8, 2);
ctx.fillRect(x + 18, GROUND_Y + 9, 4, 1.5); ctx.fillRect(x + 18, GROUND_Y + 9, 4, 1.5);
+164 -50
View File
@@ -1,14 +1,102 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr" data-theme="dark">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Tetris - AP Manageur Arcade</title> <title>Tetris - AP Manageur Arcade</title>
<style> <style>
:root, html[data-theme="dark"] {
--bg: #071326;
--card-bg: #0d1d36;
--panel-box: #132746;
--border: #223c68;
--text: #eef4ff;
--muted: #9aa8c5;
--blue: #5ca7ff;
--blue-btn-text: #071326;
--board-bg: #050d1a;
--grid-line: #0e203c;
}
html[data-theme="light"] {
--bg: #f2f5fa;
--card-bg: #ffffff;
--panel-box: #e9eef7;
--border: #d2dcec;
--text: #15203a;
--muted: #5b6b8c;
--blue: #1e6ef0;
--blue-btn-text: #ffffff;
--board-bg: #f8fafc;
--grid-line: #e2e8f0;
}
html[data-theme="winxp"] {
--bg: #ece9d8;
--card-bg: #ece9d8;
--panel-box: #ffffff;
--border: #7f9db9;
--text: #000000;
--muted: #444444;
--blue: #0055ea;
--blue-btn-text: #ffffff;
--board-bg: #ffffff;
--grid-line: #dcdcdc;
font-family: 'Tahoma', sans-serif !important;
}
html[data-theme="macos"][data-macos-mode="light"],
html[data-theme="macos"]:not([data-macos-mode="dark"]) {
--bg: #f5f5f7;
--card-bg: #ffffff;
--panel-box: #f2f2f7;
--border: rgba(0, 0, 0, 0.12);
--text: #1d1d1f;
--muted: #86868b;
--blue: #0071e3;
--blue-btn-text: #ffffff;
--board-bg: #ffffff;
--grid-line: #f0f0f2;
}
html[data-theme="macos"][data-macos-mode="dark"] {
--bg: #1e1e1e;
--card-bg: #2d2d2d;
--panel-box: #3a3a3c;
--border: rgba(255, 255, 255, 0.15);
--text: #f5f5f7;
--muted: #98989d;
--blue: #0a84ff;
--blue-btn-text: #ffffff;
--board-bg: #1c1c1e;
--grid-line: #2c2c2e;
}
html[data-theme="futuristic"] {
--bg: #050811;
--card-bg: #091124;
--panel-box: #0f1c3a;
--border: #00f0ff;
--text: #e6f6ff;
--muted: #64b5f6;
--blue: #00f0ff;
--blue-btn-text: #050811;
--board-bg: #030712;
--grid-line: #0d2948;
}
html[data-theme="hacker"] {
--bg: #000000;
--card-bg: #051206;
--panel-box: #0a1f0c;
--border: #00ff41;
--text: #00ff41;
--muted: #008f11;
--blue: #00ff41;
--blue-btn-text: #000000;
--board-bg: #000000;
--grid-line: #00330d;
font-family: 'Courier New', monospace !important;
}
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; } * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body { body {
background: #071326; background: var(--bg);
color: #eef4ff; color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -17,25 +105,27 @@
min-height: 100vh; min-height: 100vh;
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
transition: background 0.3s ease, color 0.3s ease;
} }
.arcade-wrap { .arcade-wrap {
display: flex; display: flex;
gap: 16px; gap: 16px;
align-items: flex-start; align-items: flex-start;
background: #0d1d36; background: var(--card-bg);
border: 1px solid #223c68; border: 1px solid var(--border);
border-radius: 14px; border-radius: 14px;
padding: 16px; padding: 16px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 167, 255, 0.15); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(92, 167, 255, 0.1);
position: relative; position: relative;
transition: all 0.3s ease;
} }
.canvas-container { .canvas-container {
position: relative; position: relative;
background: #050d1a; background: var(--board-bg);
border: 2px solid #223c68; border: 2px solid var(--border);
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8); box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
} }
canvas { canvas {
display: block; display: block;
@@ -47,8 +137,8 @@
width: 140px; width: 140px;
} }
.panel-box { .panel-box {
background: #132746; background: var(--panel-box);
border: 1px solid #223c68; border: 1px solid var(--border);
border-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
text-align: center; text-align: center;
@@ -57,25 +147,25 @@
font-size: 11px; font-size: 11px;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
color: #9aa8c5; color: var(--muted);
margin-bottom: 6px; margin-bottom: 6px;
} }
.panel-box .value { .panel-box .value {
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
color: #5ca7ff; color: var(--blue);
font-family: "Courier New", Courier, monospace; font-family: "Courier New", Courier, monospace;
} }
.preview-canvas { .preview-canvas {
background: #050d1a; background: var(--board-bg);
border-radius: 6px; border-radius: 6px;
border: 1px solid #223c68; border: 1px solid var(--border);
margin: 0 auto; margin: 0 auto;
display: block; display: block;
} }
.btn { .btn {
background: #5ca7ff; background: var(--blue);
color: #071326; color: var(--blue-btn-text);
border: 0; border: 0;
border-radius: 6px; border-radius: 6px;
padding: 8px 12px; padding: 8px 12px;
@@ -86,31 +176,31 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.btn:hover { background: #7ab7ff; transform: translateY(-1px); } .btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn.secondary { .btn.secondary {
background: #132746; background: var(--panel-box);
color: #eef4ff; color: var(--text);
border: 1px solid #223c68; border: 1px solid var(--border);
} }
.btn.secondary:hover { background: #1c3863; } .btn.secondary:hover { opacity: 0.85; }
.controls-help { .controls-help {
font-size: 11px; font-size: 11px;
color: #9aa8c5; color: var(--muted);
line-height: 1.5; line-height: 1.5;
background: rgba(0,0,0,0.2); background: rgba(0,0,0,0.12);
border-radius: 6px; border-radius: 6px;
padding: 8px; padding: 8px;
border: 1px solid rgba(255,255,255,0.05); border: 1px solid var(--border);
} }
.controls-help kbd { .controls-help kbd {
background: #223c68; background: var(--panel-box);
color: #fff; color: var(--text);
border: 1px solid var(--border);
padding: 1px 4px; padding: 1px 4px;
border-radius: 3px; border-radius: 3px;
font-size: 10px; font-size: 10px;
font-family: monospace; font-family: monospace;
} }
/* Touch controls for mobile */
.touch-controls { .touch-controls {
display: none; display: none;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
@@ -120,9 +210,9 @@
max-width: 320px; max-width: 320px;
} }
.touch-btn { .touch-btn {
background: #132746; background: var(--panel-box);
border: 1px solid #223c68; border: 1px solid var(--border);
color: #eef4ff; color: var(--text);
padding: 12px; padding: 12px;
border-radius: 8px; border-radius: 8px;
font-size: 18px; font-size: 18px;
@@ -132,14 +222,13 @@
cursor: pointer; cursor: pointer;
touch-action: manipulation; touch-action: manipulation;
} }
.touch-btn:active { background: #5ca7ff; color: #071326; } .touch-btn:active { background: var(--blue); color: var(--blue-btn-text); }
@media (max-width: 600px) { @media (max-width: 600px) {
.arcade-wrap { flex-direction: column; align-items: center; padding: 10px; } .arcade-wrap { flex-direction: column; align-items: center; padding: 10px; }
.sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; } .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
.sidebar .panel-box { flex: 1; min-width: 80px; } .sidebar .panel-box { flex: 1; min-width: 80px; }
.touch-controls { display: grid; } .touch-controls { display: grid; }
} }
/* Overlay message */
.overlay-msg { .overlay-msg {
position: absolute; position: absolute;
inset: 0; inset: 0;
@@ -167,7 +256,7 @@
<canvas id="tetris" width="240" height="480"></canvas> <canvas id="tetris" width="240" height="480"></canvas>
<div id="gameOverlay" class="overlay-msg" style="display:none"> <div id="gameOverlay" class="overlay-msg" style="display:none">
<h2 id="overlayTitle">GAME OVER</h2> <h2 id="overlayTitle">GAME OVER</h2>
<div id="overlayScore" style="color:#5ca7ff;font-size:16px;font-weight:700">Score: 0</div> <div id="overlayScore" style="color:var(--blue);font-size:16px;font-weight:700">Score: 0</div>
<button class="btn" style="width:auto;padding:8px 24px" onclick="startGame()">REJOUER</button> <button class="btn" style="width:auto;padding:8px 24px" onclick="startGame()">REJOUER</button>
</div> </div>
</div> </div>
@@ -197,7 +286,7 @@
<div><kbd>⬆️</kbd> : Pivoter</div> <div><kbd>⬆️</kbd> : Pivoter</div>
<div><kbd>⬇️</kbd> : Chute rapide</div> <div><kbd>⬇️</kbd> : Chute rapide</div>
<div><kbd>Espace</kbd> : Drop direct</div> <div><kbd>Espace</kbd> : Drop direct</div>
<div><kbd>C</kbd> : Garder en réserve</div> <div><kbd>P</kbd> : Mettre en pause</div>
</div> </div>
</div> </div>
</div> </div>
@@ -207,11 +296,34 @@
<div class="touch-btn" onclick="rotate()">🔄</div> <div class="touch-btn" onclick="rotate()">🔄</div>
<div class="touch-btn" onclick="moveRight()">▶</div> <div class="touch-btn" onclick="moveRight()">▶</div>
<div class="touch-btn" onclick="softDrop()">🔽</div> <div class="touch-btn" onclick="softDrop()">🔽</div>
<div class="touch-btn" onclick="hardDrop()" style="grid-column:span 2;background:#5ca7ff;color:#071326;font-weight:700">⬇️ DROP</div> <div class="touch-btn" onclick="hardDrop()" style="grid-column:span 2;background:var(--blue);color:var(--blue-btn-text);font-weight:700">⬇️ DROP</div>
</div> </div>
<script> <script>
// Audio synthesizer with Web Audio API // Theme Management
function setTheme(theme, macosMode) {
if (!theme) theme = 'dark';
document.documentElement.dataset.theme = theme;
if (theme === 'macos' && macosMode) {
document.documentElement.dataset.macosMode = macosMode;
} else {
delete document.documentElement.dataset.macosMode;
}
draw();
drawNext();
}
// Initialize theme from URL query param
const urlParams = new URLSearchParams(window.location.search);
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
window.addEventListener('message', e => {
if (e.data && e.data.type === 'themeChange') {
setTheme(e.data.theme, e.data.macosMode);
}
});
// Audio synthesizer
let audioCtx = null; let audioCtx = null;
function playSound(type) { function playSound(type) {
try { try {
@@ -506,6 +618,10 @@
} }
} }
function getThemeVar(name, fallback) {
return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
}
function drawBlock(c, x, y, colorId, isGhost = false) { function drawBlock(c, x, y, colorId, isGhost = false) {
const color = COLORS[colorId]; const color = COLORS[colorId];
if (!color) return; if (!color) return;
@@ -524,17 +640,15 @@
c.fillStyle = color; c.fillStyle = color;
c.fillRect(px, py, BLOCK, BLOCK); c.fillRect(px, py, BLOCK, BLOCK);
// Light highlight bevel c.fillStyle = 'rgba(255, 255, 255, 0.3)';
c.fillStyle = 'rgba(255, 255, 255, 0.28)';
c.fillRect(px, py, BLOCK, 3); c.fillRect(px, py, BLOCK, 3);
c.fillRect(px, py, 3, BLOCK); c.fillRect(px, py, 3, BLOCK);
// Dark shadow bevel c.fillStyle = 'rgba(0, 0, 0, 0.32)';
c.fillStyle = 'rgba(0, 0, 0, 0.35)';
c.fillRect(px + BLOCK - 3, py, 3, BLOCK); c.fillRect(px + BLOCK - 3, py, 3, BLOCK);
c.fillRect(px, py + BLOCK - 3, BLOCK, 3); c.fillRect(px, py + BLOCK - 3, BLOCK, 3);
c.strokeStyle = 'rgba(0,0,0,0.4)'; c.strokeStyle = 'rgba(0,0,0,0.35)';
c.strokeRect(px, py, BLOCK, BLOCK); c.strokeRect(px, py, BLOCK, BLOCK);
} }
@@ -557,11 +671,13 @@
} }
function draw() { function draw() {
// Background grid const boardBg = getThemeVar('--board-bg', '#050d1a');
ctx.fillStyle = '#050d1a'; const gridLine = getThemeVar('--grid-line', '#0e203c');
ctx.fillStyle = boardBg;
ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#0e203c'; ctx.strokeStyle = gridLine;
ctx.lineWidth = 0.5; ctx.lineWidth = 0.5;
for (let x = 0; x <= COLS; x++) { for (let x = 0; x <= COLS; x++) {
ctx.beginPath(); ctx.moveTo(x * BLOCK, 0); ctx.lineTo(x * BLOCK, ROWS * BLOCK); ctx.stroke(); ctx.beginPath(); ctx.moveTo(x * BLOCK, 0); ctx.lineTo(x * BLOCK, ROWS * BLOCK); ctx.stroke();
@@ -570,14 +686,12 @@
ctx.beginPath(); ctx.moveTo(0, y * BLOCK); ctx.lineTo(COLS * BLOCK, y * BLOCK); ctx.stroke(); ctx.beginPath(); ctx.moveTo(0, y * BLOCK); ctx.lineTo(COLS * BLOCK, y * BLOCK); ctx.stroke();
} }
// Board blocks
board.forEach((row, y) => { board.forEach((row, y) => {
row.forEach((value, x) => { row.forEach((value, x) => {
if (value !== 0) drawBlock(ctx, x, y, value); if (value !== 0) drawBlock(ctx, x, y, value);
}); });
}); });
// Player piece + Ghost
if (player.matrix) { if (player.matrix) {
drawGhost(); drawGhost();
player.matrix.forEach((row, y) => { player.matrix.forEach((row, y) => {
@@ -589,7 +703,8 @@
} }
function drawNext() { function drawNext() {
nextCtx.fillStyle = '#050d1a'; const boardBg = getThemeVar('--board-bg', '#050d1a');
nextCtx.fillStyle = boardBg;
nextCtx.fillRect(0, 0, nextCanvas.width, nextCanvas.height); nextCtx.fillRect(0, 0, nextCanvas.width, nextCanvas.height);
if (!nextPiece) return; if (!nextPiece) return;
const bSize = 16; const bSize = 16;
@@ -603,7 +718,7 @@
const py = offY + y * bSize; const py = offY + y * bSize;
nextCtx.fillStyle = COLORS[value]; nextCtx.fillStyle = COLORS[value];
nextCtx.fillRect(px, py, bSize, bSize); nextCtx.fillRect(px, py, bSize, bSize);
nextCtx.strokeStyle = 'rgba(0,0,0,0.4)'; nextCtx.strokeStyle = 'rgba(0,0,0,0.35)';
nextCtx.strokeRect(px, py, bSize, bSize); nextCtx.strokeRect(px, py, bSize, bSize);
} }
}); });
@@ -639,7 +754,6 @@
lastTime = performance.now(); lastTime = performance.now();
} }
// Keyboard controls
window.addEventListener('keydown', e => { window.addEventListener('keydown', e => {
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(e.key)) { if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(e.key)) {
e.preventDefault(); e.preventDefault();
+197 -44
View File
@@ -1,15 +1,145 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr" data-theme="dark">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Zip (LinkedIn) - AP Manageur</title> <title>Zip (LinkedIn) - AP Manageur</title>
<style> <style>
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; } * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
:root, html[data-theme="dark"] {
--bg: #071326;
--card-bg: #0d1d36;
--panel-box: #132746;
--border: #223c68;
--text: #eef4ff;
--muted: #9aa8c5;
--blue: #5ca7ff;
--blue-btn-text: #071326;
--board-bg: #050d1a;
--cell-bg: #0d1d36;
--cell-border: #1a345e;
--cell-hover: #16315c;
--cell-visited: rgba(92, 167, 255, 0.28);
--path-stroke: #5ca7ff;
--wall-color: #ff6b6b;
--node-color: #ffffff;
}
html[data-theme="light"] {
--bg: #f2f5fa;
--card-bg: #ffffff;
--panel-box: #e9eef7;
--border: #d2dcec;
--text: #15203a;
--muted: #5b6b8c;
--blue: #1e6ef0;
--blue-btn-text: #ffffff;
--board-bg: #f8fafc;
--cell-bg: #ffffff;
--cell-border: #d2dcec;
--cell-hover: #e9eef7;
--cell-visited: rgba(30, 110, 240, 0.15);
--path-stroke: #1e6ef0;
--wall-color: #ef4444;
--node-color: #0f172a;
}
html[data-theme="winxp"] {
--bg: #ece9d8;
--card-bg: #ece9d8;
--panel-box: #ffffff;
--border: #7f9db9;
--text: #000000;
--muted: #444444;
--blue: #0055ea;
--blue-btn-text: #ffffff;
--board-bg: #ffffff;
--cell-bg: #f5f5f5;
--cell-border: #7f9db9;
--cell-hover: #e0e8f5;
--cell-visited: rgba(0, 85, 234, 0.18);
--path-stroke: #0055ea;
--wall-color: #cc0000;
--node-color: #000000;
font-family: 'Tahoma', sans-serif !important;
}
html[data-theme="macos"][data-macos-mode="light"],
html[data-theme="macos"]:not([data-macos-mode="dark"]) {
--bg: #f5f5f7;
--card-bg: #ffffff;
--panel-box: #f2f2f7;
--border: rgba(0, 0, 0, 0.12);
--text: #1d1d1f;
--muted: #86868b;
--blue: #0071e3;
--blue-btn-text: #ffffff;
--board-bg: #f2f2f7;
--cell-bg: #ffffff;
--cell-border: rgba(0, 0, 0, 0.08);
--cell-hover: #e5e5ea;
--cell-visited: rgba(0, 113, 227, 0.15);
--path-stroke: #0071e3;
--wall-color: #ff3b30;
--node-color: #1d1d1f;
}
html[data-theme="macos"][data-macos-mode="dark"] {
--bg: #1e1e1e;
--card-bg: #2d2d2d;
--panel-box: #3a3a3c;
--border: rgba(255, 255, 255, 0.15);
--text: #f5f5f7;
--muted: #98989d;
--blue: #0a84ff;
--blue-btn-text: #ffffff;
--board-bg: #1c1c1e;
--cell-bg: #2c2c2e;
--cell-border: rgba(255, 255, 255, 0.1);
--cell-hover: #3a3a3c;
--cell-visited: rgba(10, 132, 255, 0.25);
--path-stroke: #0a84ff;
--wall-color: #ff453a;
--node-color: #f5f5f7;
}
html[data-theme="futuristic"] {
--bg: #050811;
--card-bg: #091124;
--panel-box: #0f1c3a;
--border: #00f0ff;
--text: #e6f6ff;
--muted: #64b5f6;
--blue: #00f0ff;
--blue-btn-text: #050811;
--board-bg: #030712;
--cell-bg: #0b1730;
--cell-border: rgba(0, 240, 255, 0.25);
--cell-hover: #13254e;
--cell-visited: rgba(0, 240, 255, 0.25);
--path-stroke: #00f0ff;
--wall-color: #ff3366;
--node-color: #e6f6ff;
}
html[data-theme="hacker"] {
--bg: #000000;
--card-bg: #051206;
--panel-box: #0a1f0c;
--border: #00ff41;
--text: #00ff41;
--muted: #008f11;
--blue: #00ff41;
--blue-btn-text: #000000;
--board-bg: #000000;
--cell-bg: #020a04;
--cell-border: rgba(0, 255, 65, 0.25);
--cell-hover: #07240c;
--cell-visited: rgba(0, 255, 65, 0.25);
--path-stroke: #00ff41;
--wall-color: #ff3333;
--node-color: #00ff41;
}
body { body {
background: #071326; background: var(--bg);
color: #eef4ff; color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -17,19 +147,21 @@
min-height: 100vh; min-height: 100vh;
overflow-x: hidden; overflow-x: hidden;
padding: 10px; padding: 10px;
transition: background 0.3s ease, color 0.3s ease;
} }
.game-container { .game-container {
background: #0d1d36; background: var(--card-bg);
border: 1px solid #223c68; border: 1px solid var(--border);
border-radius: 14px; border-radius: 14px;
padding: 16px 20px; padding: 16px 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(92,167,255,0.15); box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(92,167,255,0.12);
max-width: 540px; max-width: 540px;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
transition: all 0.3s ease;
} }
.top-bar { .top-bar {
width: 100%; width: 100%;
@@ -44,13 +176,13 @@
align-items: center; align-items: center;
gap: 6px; gap: 6px;
font-weight: 700; font-weight: 700;
color: #5ca7ff; color: var(--blue);
font-size: 16px; font-size: 16px;
} }
.level-selector select { .level-selector select {
background: #132746; background: var(--panel-box);
color: #eef4ff; color: var(--text);
border: 1px solid #223c68; border: 1px solid var(--border);
padding: 5px 10px; padding: 5px 10px;
border-radius: 6px; border-radius: 6px;
font-size: 12px; font-size: 12px;
@@ -61,39 +193,40 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
background: #132746; background: var(--panel-box);
padding: 8px 14px; padding: 8px 14px;
border-radius: 8px; border-radius: 8px;
border: 1px solid #223c68; border: 1px solid var(--border);
margin-bottom: 14px; margin-bottom: 14px;
font-size: 13px; font-size: 13px;
} }
.stats-bar strong { .stats-bar strong {
color: #5ca7ff; color: var(--blue);
} }
.progress-bar-wrap { .progress-bar-wrap {
width: 100%; width: 100%;
height: 6px; height: 6px;
background: #050d1a; background: var(--board-bg);
border-radius: 3px; border-radius: 3px;
overflow: hidden; overflow: hidden;
margin-bottom: 14px; margin-bottom: 14px;
border: 1px solid #223c68; border: 1px solid var(--border);
} }
.progress-bar-fill { .progress-bar-fill {
height: 100%; height: 100%;
width: 0%; width: 0%;
background: linear-gradient(90deg, #5ca7ff, #32d583); background: linear-gradient(90deg, var(--blue), #32d583);
transition: width 0.2s ease; transition: width 0.2s ease;
} }
.board-container { .board-container {
position: relative; position: relative;
background: #050d1a; background: var(--board-bg);
border: 3px solid #223c68; border: 3px solid var(--border);
border-radius: 12px; border-radius: 12px;
padding: 8px; padding: 8px;
box-shadow: inset 0 0 20px rgba(0,0,0,0.6); box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
touch-action: none; touch-action: none;
transition: all 0.3s ease;
} }
.grid { .grid {
display: grid; display: grid;
@@ -103,8 +236,8 @@
.cell { .cell {
width: 58px; width: 58px;
height: 58px; height: 58px;
background: #0d1d36; background: var(--cell-bg);
border: 1px solid #1a345e; border: 1px solid var(--cell-border);
border-radius: 8px; border-radius: 8px;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -113,32 +246,32 @@
font-weight: 800; font-weight: 800;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
transition: background 0.15s ease, transform 0.1s ease; transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
} }
.cell:hover { .cell:hover {
background: #16315c; background: var(--cell-hover);
} }
.cell.visited { .cell.visited {
background: rgba(92, 167, 255, 0.28); background: var(--cell-visited);
border-color: #5ca7ff; border-color: var(--path-stroke);
} }
.cell.current { .cell.current {
background: #5ca7ff; background: var(--blue);
color: #071326; color: var(--blue-btn-text);
box-shadow: 0 0 14px #5ca7ff; box-shadow: 0 0 14px var(--blue);
transform: scale(1.04); transform: scale(1.04);
} }
.cell.number-node { .cell.number-node {
color: #ffffff; color: var(--node-color);
font-family: monospace; font-family: monospace;
font-size: 22px; font-size: 22px;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
} }
.cell.number-node::after { .cell.number-node::after {
content: ''; content: '';
position: absolute; position: absolute;
inset: 4px; inset: 4px;
border: 2px dashed rgba(255, 255, 255, 0.3); border: 2px dashed rgba(255, 255, 255, 0.35);
border-radius: 6px; border-radius: 6px;
pointer-events: none; pointer-events: none;
} }
@@ -146,8 +279,8 @@
color: #32d583; color: #32d583;
text-shadow: 0 0 10px rgba(50, 213, 131, 0.8); text-shadow: 0 0 10px rgba(50, 213, 131, 0.8);
} }
.cell.wall-right { border-right: 4px solid #ff6b6b !important; } .cell.wall-right { border-right: 4px solid var(--wall-color) !important; }
.cell.wall-bottom { border-bottom: 4px solid #ff6b6b !important; } .cell.wall-bottom { border-bottom: 4px solid var(--wall-color) !important; }
/* SVG overlay for path */ /* SVG overlay for path */
.path-svg { .path-svg {
@@ -158,11 +291,11 @@
} }
.path-line { .path-line {
fill: none; fill: none;
stroke: #5ca7ff; stroke: var(--path-stroke);
stroke-width: 6; stroke-width: 6;
stroke-linecap: round; stroke-linecap: round;
stroke-linejoin: round; stroke-linejoin: round;
filter: drop-shadow(0 0 6px #5ca7ff); filter: drop-shadow(0 0 6px var(--path-stroke));
} }
.bottom-actions { .bottom-actions {
@@ -178,23 +311,23 @@
font-weight: 600; font-weight: 600;
font-size: 13px; font-size: 13px;
cursor: pointer; cursor: pointer;
border: 1px solid #223c68; border: 1px solid var(--border);
background: #132746; background: var(--panel-box);
color: #eef4ff; color: var(--text);
transition: all 0.15s ease; transition: all 0.15s ease;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 6px; gap: 6px;
} }
.btn:hover { background: #1c3863; border-color: #5ca7ff; } .btn:hover { background: var(--cell-hover); border-color: var(--blue); }
.btn.primary { .btn.primary {
background: #5ca7ff; background: var(--blue);
color: #071326; color: var(--blue-btn-text);
border-color: #5ca7ff; border-color: var(--blue);
font-weight: 700; font-weight: 700;
} }
.btn.primary:hover { background: #7ab7ff; } .btn.primary:hover { opacity: 0.9; }
.instructions { .instructions {
margin-top: 12px; margin-top: 12px;
@@ -280,6 +413,26 @@
</div> </div>
<script> <script>
// Theme Management
function setTheme(theme, macosMode) {
if (!theme) theme = 'dark';
document.documentElement.dataset.theme = theme;
if (theme === 'macos' && macosMode) {
document.documentElement.dataset.macosMode = macosMode;
} else {
delete document.documentElement.dataset.macosMode;
}
}
const urlParams = new URLSearchParams(window.location.search);
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
window.addEventListener('message', e => {
if (e.data && e.data.type === 'themeChange') {
setTheme(e.data.theme, e.data.macosMode);
}
});
// Audio synthesizer // Audio synthesizer
let audioCtx = null; let audioCtx = null;
function playBeep(type) { function playBeep(type) {