Make the broken mirror easier: wider margins, extra moves from balanced companions, hover outline on hard
Some checks failed
Validate and deploy Sokko G / validate (push) Failing after 18m58s
Validate and deploy Sokko G / deploy (push) Has been skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-29 09:43:13 +01:00
parent bbfb08676f
commit 734a3b6a8b
13 changed files with 82 additions and 52 deletions

View file

@ -1,5 +1,5 @@
// Rôle : plateau du Miroir brisé : les morceaux de l'image mélangée envoyée par le serveur, la sélection, les cases permises
// (même rangée ou même colonne), le contour vert, le bon coup montré et l'animation des échanges.
// (même rangée ou même colonne), le contour vert (au survol en Difficile), le bon coup montré et l'animation des échanges.
import { useEffect, useLayoutEffect, useRef, useState } from "react";
import { fillTemplate } from "./dailyShare.js";
import { sameLine } from "./mirrorFormat.js";
@ -58,7 +58,7 @@ export function MirrorBoard({ game, src, modelSrc, tiles, peeking, disabled, con
const lit = (cell) => !game.freeSwap && selected === null && hovered !== null && (cell === hovered || sameLine(cols, hovered, cell));
return <div className="nebula-mirror-frame" data-format={rows === cols ? "square" : "portrait"} data-state={game.status} data-peek={peeking || undefined}>
<div ref={boardRef} className="nebula-mirror-board" style={{ "--mirror-cols": cols, "--mirror-rows": rows }} data-picking={selected !== null || undefined} data-aiming={aiming || undefined} role="group" aria-label={content.boardLabel}>
<div ref={boardRef} className="nebula-mirror-board" style={{ "--mirror-cols": cols, "--mirror-rows": rows }} data-picking={selected !== null || undefined} data-placed-hover={game.placedOnHover || undefined} data-aiming={aiming || undefined} role="group" aria-label={content.boardLabel}>
{tiles.map((piece, cell) => <button key={piece} ref={(element) => refs.current.set(piece, element)} type="button" className="nebula-mirror-piece"
style={{ gridRow: Math.floor(cell / cols) + 1, gridColumn: (cell % cols) + 1, backgroundImage: src ? `url(${src})` : undefined, backgroundSize: `${cols * 100}% ${rows * 100}%`, backgroundPosition: `${((piece % cols) / (cols - 1)) * 100}% ${(Math.floor(piece / cols) / (rows - 1)) * 100}%` }}
aria-label={fillTemplate(content.pieceLabel, { row: Math.floor(cell / cols) + 1, col: (cell % cols) + 1 })} aria-pressed={selected === cell}

View file

@ -232,7 +232,7 @@ export function MirrorPanel({ catalog, runMutation, busy, content, teamContent }
}
}
// Coup de main : l'Orientation attend d'abord le morceau visé ; l'Équilibré montre le modèle quelques secondes.
// Coup de main : l'Orientation attend d'abord le morceau visé.
async function help(cardId, helpId, cell = null) {
// Orientation : sur le morceau déjà choisi, sinon le prochain clic sur le plateau le désigne ; un second clic l'annule sans la dépenser.
if (helpId === "orientation" && cell === null) {
@ -242,12 +242,7 @@ export function MirrorPanel({ catalog, runMutation, busy, content, teamContent }
setAiming(null);
// La sélection reste pour le Mouvement libre (il suffit de cliquer la case voulue), pas pour les autres coups de main.
if (helpId !== "bravoure") setSelected(null);
const next = await act(() => applyMirrorHelp(mirror.day, activeMode, cardId, helpId, game.moves, cell));
const after = next?.games[activeMode];
if (helpId === "balanced" && after?.peekUntil) {
await peek(true);
window.setTimeout(() => setPeeking(false), Math.max(0, after.peekUntil - Date.now()));
}
await act(() => applyMirrorHelp(mirror.day, activeMode, cardId, helpId, game.moves, cell));
}
// Ouvre un miroir : sa partie si elle existe, sinon elle commence.