APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
f78e380236
commit
2b33e31589
4 files changed
+423
-119
No files matched your search
+132
-29
@@ -303,14 +303,14 @@
|
||||
}
|
||||
|
||||
.bottom-actions {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1.25fr;
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
.btn {
|
||||
flex: 1;
|
||||
padding: 9px 12px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
@@ -318,16 +318,36 @@
|
||||
border: 1px solid var(--border);
|
||||
background: var(--panel-box);
|
||||
color: var(--text);
|
||||
transition: all 0.15s ease;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
user-select: none;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
|
||||
}
|
||||
.btn:hover {
|
||||
background: var(--cell-hover);
|
||||
border-color: var(--blue);
|
||||
color: var(--blue);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
.btn.btn-action-accent {
|
||||
background: rgba(92, 167, 255, 0.12);
|
||||
border-color: var(--blue);
|
||||
color: var(--blue);
|
||||
font-weight: 700;
|
||||
box-shadow: 0 0 10px rgba(92, 167, 255, 0.2);
|
||||
}
|
||||
.btn.btn-action-accent:hover {
|
||||
background: var(--blue);
|
||||
color: var(--blue-btn-text, #ffffff);
|
||||
box-shadow: 0 0 14px rgba(92, 167, 255, 0.4);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
.btn:hover { background: var(--cell-hover); border-color: var(--blue); }
|
||||
.btn.primary {
|
||||
background: var(--blue);
|
||||
color: var(--blue-btn-text);
|
||||
color: var(--blue-btn-text, #ffffff);
|
||||
border-color: var(--blue);
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -335,10 +355,10 @@
|
||||
|
||||
.instructions {
|
||||
margin-top: 12px;
|
||||
font-size: 11px;
|
||||
color: #9aa8c5;
|
||||
font-size: 11.5px;
|
||||
color: var(--muted);
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
/* Win overlay */
|
||||
@@ -372,20 +392,20 @@
|
||||
|
||||
<div class="game-container">
|
||||
<div class="top-bar">
|
||||
<div class="title-badge">⚡ <span>Zip</span> <span style="font-size:11px;color:#9aa8c5;font-weight:normal">(LinkedIn)</span></div>
|
||||
<div class="title-badge">⚡ <span>Zip</span> <span style="font-size:11px;color:var(--muted);font-weight:normal">(LinkedIn)</span></div>
|
||||
<div class="level-selector">
|
||||
<select id="levelSelect" onchange="loadSelectedLevel()">
|
||||
<option value="1">Niveau 1 (5×5 Facile)</option>
|
||||
<option value="2">Niveau 2 (5×5 Intermédiaire)</option>
|
||||
<option value="3">Niveau 3 (6×6 Expert)</option>
|
||||
<option value="random">Générateur infini 🎲</option>
|
||||
<option id="optLevel1" value="1">Niveau 1 (5×5 Facile)</option>
|
||||
<option id="optLevel2" value="2">Niveau 2 (5×5 Intermédiaire)</option>
|
||||
<option id="optLevel3" value="3">Niveau 3 (6×6 Expert)</option>
|
||||
<option id="optLevelRandom" value="random">Générateur infini 🎲</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stats-bar">
|
||||
<div>Cases : <strong id="cellCount">1 / 25</strong></div>
|
||||
<div>Objectif : <strong id="nextTargetNum">Atteindre le 2</strong></div>
|
||||
<div><span id="labelCellCount">Cases :</span> <strong id="cellCount">1 / 25</strong></div>
|
||||
<div><span id="labelTarget">Objectif :</span> <strong id="nextTargetNum">Atteindre le 2</strong></div>
|
||||
<div>⏱️ <strong id="timerDisplay">00:00</strong></div>
|
||||
</div>
|
||||
|
||||
@@ -398,26 +418,26 @@
|
||||
<div id="gridEl" class="grid"></div>
|
||||
|
||||
<div id="winOverlay" class="win-overlay" style="display:none">
|
||||
<h2>🎉 FÉLICITATIONS !</h2>
|
||||
<p style="color:#eef4ff;font-size:14px">Grille entièrement résolue !</p>
|
||||
<p id="winTime" style="color:#5ca7ff;font-size:13px;font-weight:bold"></p>
|
||||
<button class="btn primary" onclick="nextLevelOrReplay()" style="margin-top:8px;padding:8px 24px">Niveau suivant ➡️</button>
|
||||
<h2 id="winTitle">🎉 FÉLICITATIONS !</h2>
|
||||
<p id="winSub" style="color:var(--text);font-size:14px">Grille entièrement résolue !</p>
|
||||
<p id="winTime" style="color:var(--blue);font-size:13px;font-weight:bold"></p>
|
||||
<button id="winNextBtn" class="btn primary" onclick="nextLevelOrReplay()" style="margin-top:8px;padding:8px 24px">Niveau suivant ➡️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-actions">
|
||||
<button class="btn" onclick="undoMove()">↩️ Annuler</button>
|
||||
<button class="btn" onclick="resetCurrentLevel()">🔄 Recommencer</button>
|
||||
<button class="btn primary" onclick="generateRandomLevel()">🎲 Nouveau défi</button>
|
||||
<button id="btnZipUndo" class="btn" onclick="undoMove()">↩️ Annuler</button>
|
||||
<button id="btnZipRestart" class="btn" onclick="resetCurrentLevel()">🔄 Recommencer</button>
|
||||
<button id="btnZipChallenge" class="btn btn-action-accent" onclick="generateRandomLevel()">🎲 Nouveau défi</button>
|
||||
</div>
|
||||
|
||||
<div class="instructions">
|
||||
<div id="zipInstructions" class="instructions">
|
||||
Reliez tous les chiffres dans l'ordre (1 ➔ 2 ➔ 3...) en passant par <strong>TOUTES les cases</strong> de la grille exactement une fois, sans croiser les murs rouges ! (Glissez ou cliquez)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Theme Management
|
||||
// Theme & i18n Management
|
||||
function setTheme(theme, macosMode) {
|
||||
if (!theme) theme = 'dark';
|
||||
document.documentElement.dataset.theme = theme;
|
||||
@@ -431,10 +451,91 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
|
||||
|
||||
const I18N_ZIP = {
|
||||
fr: {
|
||||
cell_count: "Cases :",
|
||||
target: "Objectif :",
|
||||
target_reach: "Atteindre le ",
|
||||
target_cover: "Couvrir les {n} case(s) restante(s)",
|
||||
target_done: "Terminé ! 🎉",
|
||||
level_1: "Niveau 1 (5×5 Facile)",
|
||||
level_2: "Niveau 2 (5×5 Intermédiaire)",
|
||||
level_3: "Niveau 3 (6×6 Expert)",
|
||||
level_random: "Générateur infini 🎲",
|
||||
btn_undo: "↩️ Annuler",
|
||||
btn_restart: "🔄 Recommencer",
|
||||
btn_challenge: "🎲 Nouveau défi",
|
||||
win_title: "🎉 FÉLICITATIONS !",
|
||||
win_sub: "Grille entièrement résolue !",
|
||||
win_time: "Temps : ",
|
||||
win_next: "Niveau suivant ➡️",
|
||||
instructions: "Reliez tous les chiffres dans l'ordre (1 ➔ 2 ➔ 3...) en passant par <strong>TOUTES les cases</strong> de la grille exactement une fois, sans croiser les murs rouges ! (Glissez ou cliquez)"
|
||||
},
|
||||
en: {
|
||||
cell_count: "Cells:",
|
||||
target: "Goal:",
|
||||
target_reach: "Reach ",
|
||||
target_cover: "Cover {n} remaining cell(s)",
|
||||
target_done: "Completed! 🎉",
|
||||
level_1: "Level 1 (5×5 Easy)",
|
||||
level_2: "Level 2 (5×5 Medium)",
|
||||
level_3: "Level 3 (6×6 Expert)",
|
||||
level_random: "Infinite Generator 🎲",
|
||||
btn_undo: "↩️ Undo",
|
||||
btn_restart: "🔄 Restart",
|
||||
btn_challenge: "🎲 New Challenge",
|
||||
win_title: "🎉 CONGRATULATIONS!",
|
||||
win_sub: "Grid completed successfully!",
|
||||
win_time: "Time: ",
|
||||
win_next: "Next Level ➡️",
|
||||
instructions: "Connect all numbers in order (1 ➔ 2 ➔ 3...) visiting <strong>EVERY grid cell</strong> exactly once, without crossing red walls! (Drag or click)"
|
||||
}
|
||||
};
|
||||
|
||||
let currentZipLang = 'fr';
|
||||
function applyZipLang(lang) {
|
||||
currentZipLang = (lang && (lang.startsWith('en') ? 'en' : 'fr')) || 'fr';
|
||||
const dict = I18N_ZIP[currentZipLang] || I18N_ZIP.fr;
|
||||
|
||||
const lc = document.getElementById('labelCellCount');
|
||||
const lt = document.getElementById('labelTarget');
|
||||
const o1 = document.getElementById('optLevel1');
|
||||
const o2 = document.getElementById('optLevel2');
|
||||
const o3 = document.getElementById('optLevel3');
|
||||
const or = document.getElementById('optLevelRandom');
|
||||
const bu = document.getElementById('btnZipUndo');
|
||||
const br = document.getElementById('btnZipRestart');
|
||||
const bc = document.getElementById('btnZipChallenge');
|
||||
const wt = document.getElementById('winTitle');
|
||||
const ws = document.getElementById('winSub');
|
||||
const wn = document.getElementById('winNextBtn');
|
||||
const zi = document.getElementById('zipInstructions');
|
||||
|
||||
if (lc) lc.textContent = dict.cell_count;
|
||||
if (lt) lt.textContent = dict.target;
|
||||
if (o1) o1.textContent = dict.level_1;
|
||||
if (o2) o2.textContent = dict.level_2;
|
||||
if (o3) o3.textContent = dict.level_3;
|
||||
if (or) or.textContent = dict.level_random;
|
||||
if (bu) bu.textContent = dict.btn_undo;
|
||||
if (br) br.textContent = dict.btn_restart;
|
||||
if (bc) bc.textContent = dict.btn_challenge;
|
||||
if (wt) wt.textContent = dict.win_title;
|
||||
if (ws) ws.textContent = dict.win_sub;
|
||||
if (wn) wn.textContent = dict.win_next;
|
||||
if (zi) zi.innerHTML = dict.instructions;
|
||||
|
||||
if (typeof updateProgressUI === 'function') updateProgressUI();
|
||||
}
|
||||
applyZipLang(urlParams.get('lang'));
|
||||
|
||||
window.addEventListener('message', e => {
|
||||
if (e.data && e.data.type === 'themeChange') {
|
||||
setTheme(e.data.theme, e.data.macosMode);
|
||||
}
|
||||
if (e.data && e.data.type === 'langChange') {
|
||||
applyZipLang(e.data.lang);
|
||||
}
|
||||
});
|
||||
|
||||
// Audio synthesizer
|
||||
@@ -606,12 +707,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
const dict = I18N_ZIP[currentZipLang] || I18N_ZIP.fr;
|
||||
if (nextExpected <= maxNumber) {
|
||||
document.getElementById('nextTargetNum').textContent = `Atteindre le ${nextExpected}`;
|
||||
document.getElementById('nextTargetNum').textContent = `${dict.target_reach}${nextExpected}`;
|
||||
} else if (count < total) {
|
||||
document.getElementById('nextTargetNum').textContent = `Couvrir les ${total - count} case(s) restante(s)`;
|
||||
document.getElementById('nextTargetNum').textContent = dict.target_cover.replace('{n}', total - count);
|
||||
} else {
|
||||
document.getElementById('nextTargetNum').textContent = `Terminé ! 🎉`;
|
||||
document.getElementById('nextTargetNum').textContent = dict.target_done;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +899,8 @@
|
||||
// VICTORY!
|
||||
if (timerInterval) clearInterval(timerInterval);
|
||||
playBeep('win');
|
||||
document.getElementById('winTime').textContent = `Temps : ${document.getElementById('timerDisplay').textContent}`;
|
||||
const dict = I18N_ZIP[currentZipLang] || I18N_ZIP.fr;
|
||||
document.getElementById('winTime').textContent = `${dict.win_time}${document.getElementById('timerDisplay').textContent}`;
|
||||
document.getElementById('winOverlay').style.display = 'flex';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user