Rework the Broken Mirror screens and the Guild quest board
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m32s
Validate and deploy Sokko G / deploy (push) Successful in 16s

The mirror page opens on two illustrated cards, Normal and Hard, painted
with Codex, with three small rule reminders; a card opens or starts its
game. The five companions of the daily team show as tiles: one click uses
a help, two per game, with no selection step. Helps are renamed after
what they do (swap anywhere, show a piece's place, double the rewards,
undo the last move, see the model again), use the shared tooltip and
keep the same height. Selecting a piece no longer waits for the server,
and showing a place aims at the selected piece. Under 960 px of
dashboard, like the section menu, the board goes on top and the moves
panel keeps only the count. Stardust is always written in full.

The Guild board shows four tiles per row on full screen, aligned with
subgrids, solo quests first. Status lines give way to a wooden "Fait"
sign on finished quests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-28 16:25:35 +01:00
parent ddb3b81278
commit 8c0771f06f
20 changed files with 337 additions and 236 deletions

View file

@ -421,12 +421,6 @@ export function createCardsApiHandler({
json(res, 200, service.mirror.swap(session.player.id, { day: body.day, mode: body.mode, from: body.from, to: body.to, moves: body.moves }));
return true;
}
if (req.method === "POST" && url.pathname === "/api/cards/mirror/helpers") {
rateLimit(req, "mirror-helpers", 60);
const body = await readBody(req);
json(res, 200, service.mirror.chooseHelpers(session.player.id, { day: body.day, mode: body.mode, cardIds: body.cardIds }));
return true;
}
if (req.method === "POST" && url.pathname === "/api/cards/mirror/help") {
rateLimit(req, "mirror-help", 60);
const body = await readBody(req);

View file

@ -136,7 +136,8 @@ export class MirrorService {
// Contour vert du Normal : les cases dont le morceau est à sa place. Le Difficile n'en montre aucune avant la fin.
placed: placedShown || finished ? placedCells(state.pos) : [],
placedCount: finished ? placedCount(state.pos) : null,
helpers: state.helpers, used: state.used, helpersLocked: state.swaps > 0 || Object.keys(state.used).length > 0, freeSwap: state.free, treasure: Boolean(state.treasure), hint: state.hint,
// Coups de main donnés (compagnon → coup de main) et ceux qui restent, chez les compagnons de son choix.
used: state.used, helpsLeft: Math.max(0, HELPERS_PER_GAME - Object.keys(state.used).length), freeSwap: state.free, treasure: Boolean(state.treasure), hint: state.hint,
// Modèle visible : jusqu'au premier mouvement, pendant un « Voir le modèle » (instant de fin donné), puis à la fin.
modelOpen: finished || state.moves === 0, peekUntil: state.peekUntil ?? 0,
lastMove: state.lastMove,
@ -210,7 +211,7 @@ export class MirrorService {
par = solve(start, MIRROR_MODES.normal.cols).length;
}
const settings = this.settings;
const state = { start, pos: start, swaps: 0, moves: 0, history: [], par, limit: swapLimit(par, settings.margins[mode]), rewards: settings.rewards[mode], helpers: [], used: {}, extra: 0, free: false, double: false, hint: null, lastMove: null };
const state = { start, pos: start, swaps: 0, moves: 0, history: [], par, limit: swapLimit(par, settings.margins[mode]), rewards: settings.rewards[mode], used: {}, extra: 0, free: false, double: false, hint: null, lastMove: null };
this.db.prepare("INSERT INTO mirror_games(player_id, day, mode, card_id, status, state_json, reward, started_at, finished_at) VALUES (?, ?, ?, ?, 'playing', ?, 0, ?, NULL)")
.run(playerId, today, mode, cardId, JSON.stringify(state), this.cards.now());
});
@ -263,26 +264,16 @@ export class MirrorService {
});
}
// Compagnons choisis pour la partie, jusqu'au premier échange ou au premier coup de main.
chooseHelpers(playerId, { day, mode, cardIds } = {}) {
if (!Array.isArray(cardIds) || cardIds.length > HELPERS_PER_GAME || new Set(cardIds).size !== cardIds.length) fail(400, "MIRROR_INVALID", "Demande invalide.");
return this.change(playerId, { day, mode }, (state) => {
if (state.swaps > 0 || Object.keys(state.used).length) fail(409, "MIRROR_HELPERS_LOCKED", "Les compagnons se choisissent avant le premier mouvement.");
const team = new Map(this.teamHelpers(playerId).map((helper) => [helper.cardId, helper]));
if (cardIds.some((cardId) => !team.has(cardId))) fail(409, "MIRROR_HELPER_INVALID", "Ce compagnon n’est pas dans votre équipe.");
state.helpers = cardIds.map((cardId) => team.get(cardId));
});
}
// Coup de main d'un compagnon choisi, une fois par partie. Une double spécialité dit lequel de ses deux coups de main ;
// l'Orientation dit aussi sur quel morceau (`cell`, la case où il se trouve).
// Coup de main d'un compagnon de l'Équipe du jour, au choix du joueur et quand il veut : HELPERS_PER_GAME par partie, un par
// compagnon. Une double spécialité dit lequel de ses deux coups de main ; l'Orientation dit aussi sur quel morceau (`cell`).
useHelp(playerId, { day, mode, cardId, help, moves, cell } = {}) {
if (typeof cardId !== "string" || typeof help !== "string" || !Number.isInteger(moves)) fail(400, "MIRROR_INVALID", "Demande invalide.");
if (help === "orientation" && !(Number.isInteger(cell) && cell >= 0 && cell < (validMode(mode) ? cellCount(mode) : 0))) fail(400, "MIRROR_INVALID", "Demande invalide.");
return this.change(playerId, { day, mode, moves }, (state) => {
const helper = state.helpers.find((item) => item.cardId === cardId);
const helper = this.teamHelpers(playerId).find((item) => item.cardId === cardId);
if (!helper || !helper.helps.includes(help)) fail(409, "MIRROR_HELPER_INVALID", "Ce coup de main n’est pas disponible.");
if (state.used[cardId]) fail(409, "MIRROR_HELP_USED", "Ce compagnon a déjà donné son coup de main.");
if (Object.keys(state.used).length >= HELPERS_PER_GAME) fail(409, "MIRROR_HELPS_EXHAUSTED", "Vous avez déjà reçu vos deux coups de main.");
state.lastMove = null;
if (help === "bravoure") state.free = true;
// Où va ce morceau ? La case choisie et la vraie case du morceau qui s'y trouve.