APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
a72d161092
commit
33cf355785
4 files changed
+825
-266
No files matched your search
+164
-50
@@ -1,14 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<html lang="fr" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Tetris - AP Manageur Arcade</title>
|
||||
<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; }
|
||||
body {
|
||||
background: #071326;
|
||||
color: #eef4ff;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -17,25 +105,27 @@
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
padding: 10px;
|
||||
transition: background 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
.arcade-wrap {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
background: #0d1d36;
|
||||
border: 1px solid #223c68;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
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;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.canvas-container {
|
||||
position: relative;
|
||||
background: #050d1a;
|
||||
border: 2px solid #223c68;
|
||||
background: var(--board-bg);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 8px;
|
||||
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 {
|
||||
display: block;
|
||||
@@ -47,8 +137,8 @@
|
||||
width: 140px;
|
||||
}
|
||||
.panel-box {
|
||||
background: #132746;
|
||||
border: 1px solid #223c68;
|
||||
background: var(--panel-box);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
@@ -57,25 +147,25 @@
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: #9aa8c5;
|
||||
color: var(--muted);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.panel-box .value {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #5ca7ff;
|
||||
color: var(--blue);
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
.preview-canvas {
|
||||
background: #050d1a;
|
||||
background: var(--board-bg);
|
||||
border-radius: 6px;
|
||||
border: 1px solid #223c68;
|
||||
border: 1px solid var(--border);
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
.btn {
|
||||
background: #5ca7ff;
|
||||
color: #071326;
|
||||
background: var(--blue);
|
||||
color: var(--blue-btn-text);
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
padding: 8px 12px;
|
||||
@@ -86,31 +176,31 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.btn:hover { background: #7ab7ff; transform: translateY(-1px); }
|
||||
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
|
||||
.btn.secondary {
|
||||
background: #132746;
|
||||
color: #eef4ff;
|
||||
border: 1px solid #223c68;
|
||||
background: var(--panel-box);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.btn.secondary:hover { background: #1c3863; }
|
||||
.btn.secondary:hover { opacity: 0.85; }
|
||||
.controls-help {
|
||||
font-size: 11px;
|
||||
color: #9aa8c5;
|
||||
color: var(--muted);
|
||||
line-height: 1.5;
|
||||
background: rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.12);
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid rgba(255,255,255,0.05);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.controls-help kbd {
|
||||
background: #223c68;
|
||||
color: #fff;
|
||||
background: var(--panel-box);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
padding: 1px 4px;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
font-family: monospace;
|
||||
}
|
||||
/* Touch controls for mobile */
|
||||
.touch-controls {
|
||||
display: none;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
@@ -120,9 +210,9 @@
|
||||
max-width: 320px;
|
||||
}
|
||||
.touch-btn {
|
||||
background: #132746;
|
||||
border: 1px solid #223c68;
|
||||
color: #eef4ff;
|
||||
background: var(--panel-box);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
font-size: 18px;
|
||||
@@ -132,14 +222,13 @@
|
||||
cursor: pointer;
|
||||
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) {
|
||||
.arcade-wrap { flex-direction: column; align-items: center; padding: 10px; }
|
||||
.sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
|
||||
.sidebar .panel-box { flex: 1; min-width: 80px; }
|
||||
.touch-controls { display: grid; }
|
||||
}
|
||||
/* Overlay message */
|
||||
.overlay-msg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
@@ -167,7 +256,7 @@
|
||||
<canvas id="tetris" width="240" height="480"></canvas>
|
||||
<div id="gameOverlay" class="overlay-msg" style="display:none">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,7 +286,7 @@
|
||||
<div><kbd>⬆️</kbd> : Pivoter</div>
|
||||
<div><kbd>⬇️</kbd> : Chute rapide</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>
|
||||
@@ -207,11 +296,34 @@
|
||||
<div class="touch-btn" onclick="rotate()">🔄</div>
|
||||
<div class="touch-btn" onclick="moveRight()">▶</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>
|
||||
|
||||
<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;
|
||||
function playSound(type) {
|
||||
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) {
|
||||
const color = COLORS[colorId];
|
||||
if (!color) return;
|
||||
@@ -524,17 +640,15 @@
|
||||
c.fillStyle = color;
|
||||
c.fillRect(px, py, BLOCK, BLOCK);
|
||||
|
||||
// Light highlight bevel
|
||||
c.fillStyle = 'rgba(255, 255, 255, 0.28)';
|
||||
c.fillStyle = 'rgba(255, 255, 255, 0.3)';
|
||||
c.fillRect(px, py, BLOCK, 3);
|
||||
c.fillRect(px, py, 3, BLOCK);
|
||||
|
||||
// Dark shadow bevel
|
||||
c.fillStyle = 'rgba(0, 0, 0, 0.35)';
|
||||
c.fillStyle = 'rgba(0, 0, 0, 0.32)';
|
||||
c.fillRect(px + BLOCK - 3, py, 3, BLOCK);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -557,11 +671,13 @@
|
||||
}
|
||||
|
||||
function draw() {
|
||||
// Background grid
|
||||
ctx.fillStyle = '#050d1a';
|
||||
const boardBg = getThemeVar('--board-bg', '#050d1a');
|
||||
const gridLine = getThemeVar('--grid-line', '#0e203c');
|
||||
|
||||
ctx.fillStyle = boardBg;
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
ctx.strokeStyle = '#0e203c';
|
||||
ctx.strokeStyle = gridLine;
|
||||
ctx.lineWidth = 0.5;
|
||||
for (let x = 0; x <= COLS; x++) {
|
||||
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();
|
||||
}
|
||||
|
||||
// Board blocks
|
||||
board.forEach((row, y) => {
|
||||
row.forEach((value, x) => {
|
||||
if (value !== 0) drawBlock(ctx, x, y, value);
|
||||
});
|
||||
});
|
||||
|
||||
// Player piece + Ghost
|
||||
if (player.matrix) {
|
||||
drawGhost();
|
||||
player.matrix.forEach((row, y) => {
|
||||
@@ -589,7 +703,8 @@
|
||||
}
|
||||
|
||||
function drawNext() {
|
||||
nextCtx.fillStyle = '#050d1a';
|
||||
const boardBg = getThemeVar('--board-bg', '#050d1a');
|
||||
nextCtx.fillStyle = boardBg;
|
||||
nextCtx.fillRect(0, 0, nextCanvas.width, nextCanvas.height);
|
||||
if (!nextPiece) return;
|
||||
const bSize = 16;
|
||||
@@ -603,7 +718,7 @@
|
||||
const py = offY + y * bSize;
|
||||
nextCtx.fillStyle = COLORS[value];
|
||||
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);
|
||||
}
|
||||
});
|
||||
@@ -639,7 +754,6 @@
|
||||
lastTime = performance.now();
|
||||
}
|
||||
|
||||
// Keyboard controls
|
||||
window.addEventListener('keydown', e => {
|
||||
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(e.key)) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user