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

+297 -128
View File
@@ -1,15 +1,159 @@
<!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>T-Rex Dino Runner - AP Manageur</title>
<style>
* { 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 {
background: #071326;
color: #eef4ff;
font-family: "Courier New", Courier, monospace, -apple-system, sans-serif;
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
display: flex;
flex-direction: column;
align-items: center;
@@ -17,16 +161,18 @@
min-height: 100vh;
overflow: hidden;
padding: 10px;
transition: background 0.3s ease, color 0.3s ease;
}
.game-card {
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.5), 0 0 20px rgba(92, 167, 255, 0.12);
position: relative;
max-width: 700px;
width: 100%;
transition: all 0.3s ease;
}
.header-bar {
display: flex;
@@ -34,28 +180,29 @@
align-items: center;
margin-bottom: 12px;
font-size: 14px;
color: #9aa8c5;
color: var(--muted);
}
.scores {
font-size: 18px;
font-weight: 700;
letter-spacing: 2px;
color: #5ca7ff;
color: var(--blue);
font-family: monospace;
}
.scores .hi {
color: #9aa8c5;
color: var(--muted);
margin-right: 12px;
}
.canvas-wrap {
position: relative;
background: #f7f7f7;
border: 2px solid #223c68;
background: var(--canvas-day);
border: 2px solid var(--border);
border-radius: 8px;
overflow: hidden;
transition: background 0.6s ease;
transition: background 0.6s ease, border-color 0.3s ease;
}
body.night-mode .canvas-wrap {
background: #111827;
background: var(--canvas-night);
}
canvas {
display: block;
@@ -69,14 +216,14 @@
align-items: center;
margin-top: 12px;
font-size: 12px;
color: #9aa8c5;
color: var(--muted);
flex-wrap: wrap;
gap: 8px;
}
.controls-hint kbd {
background: #132746;
border: 1px solid #223c68;
color: #fff;
background: var(--panel-box);
border: 1px solid var(--border);
color: var(--text);
padding: 2px 6px;
border-radius: 4px;
font-size: 11px;
@@ -89,7 +236,7 @@
align-items: center;
justify-content: center;
background: rgba(7, 19, 38, 0.85);
backdrop-filter: blur(2px);
backdrop-filter: blur(3px);
z-index: 10;
gap: 12px;
}
@@ -99,8 +246,8 @@
letter-spacing: 3px;
}
.restart-btn {
background: #5ca7ff;
color: #071326;
background: var(--blue);
color: var(--blue-btn-text);
border: 0;
padding: 8px 20px;
border-radius: 6px;
@@ -110,8 +257,10 @@
display: inline-flex;
align-items: center;
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>
</head>
<body>
@@ -141,6 +290,31 @@
</div>
<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
let audioCtx = null;
function playTone(type) {
@@ -203,36 +377,30 @@
width: 44,
height: 44,
vy: 0,
gravity: 0.72,
jumpStrength: -11.5,
jumpForce: -11.5,
gravity: 0.65,
isGrounded: true,
isDucking: false,
legFrame: 0,
legTimer: 0
};
// 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 = [];
// 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++) {
for (let i = 0; i < 25; i++) {
stars.push({
x: Math.random() * canvas.width,
y: Math.random() * 120,
x: Math.random() * 640,
y: Math.random() * 120 + 10,
r: Math.random() * 1.5 + 0.5
});
}
// Ground bumps
let groundOffset = 0;
function jump() {
@@ -243,72 +411,75 @@
resetGame();
return;
}
if (dino.isGrounded) {
dino.vy = dino.jumpStrength;
if (dino.isGrounded && !dino.isDucking) {
dino.vy = dino.jumpForce;
dino.isGrounded = false;
playTone('jump');
}
}
function duck(down) {
function duck(isDucking) {
if (!gameStarted || gameOver) return;
dino.isDucking = down;
if (down && !dino.isGrounded) {
dino.vy += 4.5; // Fast drop
dino.isDucking = isDucking;
if (isDucking) {
dino.height = 28;
if (!dino.isGrounded) {
dino.vy += 4; // Fast fall
}
} else {
dino.height = 44;
}
}
function resetGame() {
gameOver = false;
gameStarted = true;
score = 0;
gameSpeed = 6;
nextObstacleTimer = 50;
obstacles = [];
dino.y = GROUND_Y - 44;
dino.vy = 0;
dino.isGrounded = true;
dino.isDucking = false;
gameOver = false;
gameStarted = true;
isNight = false;
document.body.classList.remove('night-mode');
dino.height = 44;
overlay.style.display = 'none';
document.body.classList.remove('night-mode');
isNight = false;
}
function spawnObstacle() {
const isPterodactyl = score > 250 && Math.random() < 0.35;
if (isPterodactyl) {
const flyHeights = [GROUND_Y - 26, GROUND_Y - 50, GROUND_Y - 72];
const flyY = flyHeights[Math.floor(Math.random() * flyHeights.length)];
obstacles.push({
type: 'ptero',
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)];
const type = (score > 250 && Math.random() < 0.3) ? 'ptero' : 'cactus';
if (type === 'cactus') {
const isBig = Math.random() < 0.4;
const count = isBig ? (Math.random() < 0.5 ? 2 : 1) : Math.floor(Math.random() * 3) + 1;
const w = (isBig ? 24 : 16) * count;
const h = isBig ? 46 : 34;
obstacles.push({
type: 'cactus',
x: canvas.width + 20,
y: GROUND_Y - kind.height,
width: kind.width,
height: kind.height
y: GROUND_Y - h,
width: w,
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) {
// Small margin of forgiveness (hitbox padding)
const p = 4;
const p = 6;
return (
r1.x + p < r2.x + r2.width &&
r1.x + r1.width - p > r2.x &&
@@ -318,7 +489,9 @@
}
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) {
// Ducking body
@@ -326,9 +499,9 @@
// Head low
ctx.fillRect(x + 40, y + 10, 18, 14);
// Eye
ctx.fillStyle = isNight ? '#111827' : '#f7f7f7';
ctx.fillStyle = eyeColor;
ctx.fillRect(x + 48, y + 12, 3, 3);
ctx.fillStyle = isNight ? '#e5e7eb' : '#535353';
ctx.fillStyle = dinoColor;
// Legs
if (legFrame === 0) {
ctx.fillRect(x + 10, y + 36, 4, 8);
@@ -345,13 +518,12 @@
ctx.fillRect(x + 22, y, 22, 16);
ctx.fillRect(x + 18, y + 6, 6, 10);
// Eye
ctx.fillStyle = isNight ? '#111827' : '#f7f7f7';
ctx.fillStyle = eyeColor;
ctx.fillRect(x + 26, y + 3, isDead ? 5 : 3, 3);
if (isDead) {
// X eye
ctx.fillRect(x + 28, y + 2, 2, 5);
}
ctx.fillStyle = isNight ? '#e5e7eb' : '#535353';
ctx.fillStyle = dinoColor;
// Snout / mouth
ctx.fillRect(x + 36, y + 8, 8, 6);
@@ -379,7 +551,7 @@
}
function drawCactus(x, y, w, h) {
ctx.fillStyle = isNight ? '#34d399' : '#10b981';
ctx.fillStyle = getThemeProp('--cactus-color', '#34d399');
// Main stem
ctx.fillRect(x + w * 0.35, y, w * 0.3, h);
// Branches
@@ -392,7 +564,7 @@
}
function drawPterodactyl(p) {
ctx.fillStyle = isNight ? '#f87171' : '#ef4444';
ctx.fillStyle = getThemeProp('--ptero-color', '#ff6b6b');
const x = p.x, y = p.y;
// Body
ctx.fillRect(x + 10, y + 8, 16, 8);
@@ -408,7 +580,7 @@
}
function drawCloud(c) {
ctx.fillStyle = isNight ? '#374151' : '#d1d5db';
ctx.fillStyle = getThemeProp('--cloud-color', '#223c68');
ctx.beginPath();
ctx.arc(c.x, c.y, 10, 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);
currentScoreEl.textContent = String(currentIntScore).padStart(5, '0');
// Milestone chime
if (currentIntScore > 0 && currentIntScore % 100 === 0 && Math.floor(score - 0.2) % 100 !== 0) {
// High score
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');
}
// 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.vy += dino.gravity;
dino.y += dino.vy;
const effectiveH = dino.isDucking ? 26 : 44;
if (dino.y >= GROUND_Y - effectiveH) {
dino.y = GROUND_Y - effectiveH;
dino.vy += dino.gravity;
if (dino.y >= GROUND_Y - dino.height) {
dino.y = GROUND_Y - dino.height;
dino.vy = 0;
dino.isGrounded = true;
}
// Leg animation
dino.legTimer += gameSpeed;
if (dino.legTimer > 40) {
// Dino animation legs
dino.legTimer++;
if (dino.legTimer > 5) {
dino.legFrame = (dino.legFrame === 0) ? 1 : 0;
dino.legTimer = 0;
dino.legFrame = dino.legFrame === 0 ? 1 : 0;
}
// Spawn obstacles
nextObstacleTimer -= 1;
// Obstacle timer
nextObstacleTimer -= gameSpeed;
if (nextObstacleTimer <= 0) {
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--) {
const obs = obstacles[i];
obs.x -= gameSpeed;
if (obs.type === 'ptero') {
obs.frameTimer += 1;
if (obs.frameTimer > 10) {
obs.frameTimer = (obs.frameTimer || 0) + 1;
if (obs.frameTimer > 12) {
obs.frame = (obs.frame === 0) ? 1 : 0;
obs.frameTimer = 0;
obs.frame = obs.frame === 0 ? 1 : 0;
}
}
// Collision check
const dinoBox = {
x: dino.x,
y: dino.y,
width: dino.isDucking ? 54 : dino.width,
height: dino.isDucking ? 26 : dino.height
};
if (checkCollision(dinoBox, obs)) {
// Collision detection
if (checkCollision(dino, obs)) {
gameOver = true;
playTone('hit');
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);
}
}
@@ -512,7 +681,7 @@
// Stars in night mode
if (isNight) {
ctx.fillStyle = '#f9fafb';
ctx.fillStyle = getThemeProp('--star-color', '#eef4ff');
stars.forEach(s => {
ctx.beginPath();
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
@@ -523,7 +692,7 @@
ctx.beginPath();
ctx.arc(560, 40, 16, 0, Math.PI * 2);
ctx.fill();
ctx.fillStyle = '#111827';
ctx.fillStyle = getThemeProp('--canvas-night', '#050d1a');
ctx.beginPath();
ctx.arc(553, 37, 13, 0, Math.PI * 2);
ctx.fill();
@@ -533,7 +702,7 @@
clouds.forEach(drawCloud);
// Ground Line
ctx.strokeStyle = isNight ? '#4b5563' : '#737373';
ctx.strokeStyle = getThemeProp('--ground-color', '#5ca7ff');
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(0, GROUND_Y);
@@ -541,7 +710,7 @@
ctx.stroke();
// Ground texture bumps
ctx.fillStyle = isNight ? '#4b5563' : '#737373';
ctx.fillStyle = getThemeProp('--ground-bump', '#38bdf8');
for (let x = -groundOffset; x < canvas.width; x += 30) {
ctx.fillRect(x + 5, GROUND_Y + 4, 8, 2);
ctx.fillRect(x + 18, GROUND_Y + 9, 4, 1.5);
+164 -50
View File
@@ -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();
+197 -44
View File
@@ -1,15 +1,145 @@
<!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>Zip (LinkedIn) - AP Manageur</title>
<style>
* { 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 {
background: #071326;
color: #eef4ff;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
@@ -17,19 +147,21 @@
min-height: 100vh;
overflow-x: hidden;
padding: 10px;
transition: background 0.3s ease, color 0.3s ease;
}
.game-container {
background: #0d1d36;
border: 1px solid #223c68;
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 14px;
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;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
transition: all 0.3s ease;
}
.top-bar {
width: 100%;
@@ -44,13 +176,13 @@
align-items: center;
gap: 6px;
font-weight: 700;
color: #5ca7ff;
color: var(--blue);
font-size: 16px;
}
.level-selector select {
background: #132746;
color: #eef4ff;
border: 1px solid #223c68;
background: var(--panel-box);
color: var(--text);
border: 1px solid var(--border);
padding: 5px 10px;
border-radius: 6px;
font-size: 12px;
@@ -61,39 +193,40 @@
display: flex;
justify-content: space-between;
align-items: center;
background: #132746;
background: var(--panel-box);
padding: 8px 14px;
border-radius: 8px;
border: 1px solid #223c68;
border: 1px solid var(--border);
margin-bottom: 14px;
font-size: 13px;
}
.stats-bar strong {
color: #5ca7ff;
color: var(--blue);
}
.progress-bar-wrap {
width: 100%;
height: 6px;
background: #050d1a;
background: var(--board-bg);
border-radius: 3px;
overflow: hidden;
margin-bottom: 14px;
border: 1px solid #223c68;
border: 1px solid var(--border);
}
.progress-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #5ca7ff, #32d583);
background: linear-gradient(90deg, var(--blue), #32d583);
transition: width 0.2s ease;
}
.board-container {
position: relative;
background: #050d1a;
border: 3px solid #223c68;
background: var(--board-bg);
border: 3px solid var(--border);
border-radius: 12px;
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;
transition: all 0.3s ease;
}
.grid {
display: grid;
@@ -103,8 +236,8 @@
.cell {
width: 58px;
height: 58px;
background: #0d1d36;
border: 1px solid #1a345e;
background: var(--cell-bg);
border: 1px solid var(--cell-border);
border-radius: 8px;
display: flex;
align-items: center;
@@ -113,32 +246,32 @@
font-weight: 800;
cursor: pointer;
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 {
background: #16315c;
background: var(--cell-hover);
}
.cell.visited {
background: rgba(92, 167, 255, 0.28);
border-color: #5ca7ff;
background: var(--cell-visited);
border-color: var(--path-stroke);
}
.cell.current {
background: #5ca7ff;
color: #071326;
box-shadow: 0 0 14px #5ca7ff;
background: var(--blue);
color: var(--blue-btn-text);
box-shadow: 0 0 14px var(--blue);
transform: scale(1.04);
}
.cell.number-node {
color: #ffffff;
color: var(--node-color);
font-family: monospace;
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 {
content: '';
position: absolute;
inset: 4px;
border: 2px dashed rgba(255, 255, 255, 0.3);
border: 2px dashed rgba(255, 255, 255, 0.35);
border-radius: 6px;
pointer-events: none;
}
@@ -146,8 +279,8 @@
color: #32d583;
text-shadow: 0 0 10px rgba(50, 213, 131, 0.8);
}
.cell.wall-right { border-right: 4px solid #ff6b6b !important; }
.cell.wall-bottom { border-bottom: 4px solid #ff6b6b !important; }
.cell.wall-right { border-right: 4px solid var(--wall-color) !important; }
.cell.wall-bottom { border-bottom: 4px solid var(--wall-color) !important; }
/* SVG overlay for path */
.path-svg {
@@ -158,11 +291,11 @@
}
.path-line {
fill: none;
stroke: #5ca7ff;
stroke: var(--path-stroke);
stroke-width: 6;
stroke-linecap: round;
stroke-linejoin: round;
filter: drop-shadow(0 0 6px #5ca7ff);
filter: drop-shadow(0 0 6px var(--path-stroke));
}
.bottom-actions {
@@ -178,23 +311,23 @@
font-weight: 600;
font-size: 13px;
cursor: pointer;
border: 1px solid #223c68;
background: #132746;
color: #eef4ff;
border: 1px solid var(--border);
background: var(--panel-box);
color: var(--text);
transition: all 0.15s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.btn:hover { background: #1c3863; border-color: #5ca7ff; }
.btn:hover { background: var(--cell-hover); border-color: var(--blue); }
.btn.primary {
background: #5ca7ff;
color: #071326;
border-color: #5ca7ff;
background: var(--blue);
color: var(--blue-btn-text);
border-color: var(--blue);
font-weight: 700;
}
.btn.primary:hover { background: #7ab7ff; }
.btn.primary:hover { opacity: 0.9; }
.instructions {
margin-top: 12px;
@@ -280,6 +413,26 @@
</div>
<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
let audioCtx = null;
function playBeep(type) {