Let players use Sokko TCG from a phone through a mobile fallback mode
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 24m57s
Validate and deploy Sokko G / deploy (push) Successful in 17s

#/mobile/cards shows the game without the site shell: a title, a footer
with the account and a discreet "Version complète" link, and a tab bar
fixed at the bottom. Phones opening #/cards are sent to the same section
in mobile mode unless the player chose the full version. Account,
History and Administration point to the computer.

The panels are the computer ones, adapted under .nebula-mobile (and
body.nebula-mobile-body for dialogs) for a 393×852 reference phone:
small cards with names under them when opening packs, a revealed card
shown large on tap, tap-to-pick team recruitment with a single Recruit
button and large stars, row lists for explorers and commons in the
expedition pickers, a race track and circuit that read at phone size,
and full-width actions throughout. Firefox no longer shows a mirrored
back on a flipped card.

Phone Playwright journeys check that every section fits the screen with
no button wrapping, then open a pack, run an expedition and recruit a
team by touch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-12-03 23:55:35 +01:00
parent 0262f596c9
commit c3e494b8a6
53 changed files with 1830 additions and 123 deletions

View file

@ -13,6 +13,7 @@ import { fillTemplate, formatStreak } from "./textFormat.js";
import { expeditionQuestStatus } from "./expeditions/expeditionFormat.js";
import { guildGreeting, guildQuests, mirrorDone, questDone } from "./guildQuests.js";
import { TeamTable } from "./team/TeamTable.jsx";
import { useCardsHref } from "./useCardsHref.js";
const ART = {
hall: "/static/img/cards/guild/hall.webp",
@ -50,32 +51,36 @@ function QuestTile({ id, art, kind, title, description, status = null, action, h
}
function DailyQuest({ summary: daily, pending, content }) {
const cardsHref = useCardsHref();
const finished = daily.status !== "playing" && !daily.rewardPending;
return <QuestTile id="daily" art={ART.daily} kind={content.dailyKind} title={content.dailyTitle} description={content.dailyDescription} doneSign={content.doneSign}
action={finished ? content.dailyResult : daily.rewardPending ? content.dailyChoose : content.dailyAction} href="#/cards/daily" primary={pending} done={finished}
action={finished ? content.dailyResult : daily.rewardPending ? content.dailyChoose : content.dailyAction} href={cardsHref("daily")} primary={pending} done={finished}
badge={daily.streak > 0 && <span className="nds-badge" data-variant="gold">{fillTemplate(content.dailyStreak, { streak: formatStreak(daily.streak) })}</span>} />;
}
/** La Course attend une équipe : sans elle, sa tuile renvoie au recrutement. */
function RaceQuest({ summary: team, pending, content }) {
const cardsHref = useCardsHref();
const locked = team.status !== "ready" && team.race === "none";
return <QuestTile id="race" art={ART.race} kind={content.raceKind} title={content.raceTitle} description={content.raceDescription} doneSign={content.doneSign}
action={locked ? content.raceToTeam : team.race === "finished" ? content.raceResult : content.raceAction} href={locked ? "#/cards/team" : "#/cards/race"}
action={locked ? content.raceToTeam : team.race === "finished" ? content.raceResult : content.raceAction} href={cardsHref(locked ? "team" : "race")}
primary={pending && !locked} locked={locked} done={team.race === "finished"} sign={locked ? content.groupSign : ""} />;
}
/** Miroir brisé : le Normal, puis le Difficile du jour, le même pour tous. */
function MirrorQuest({ summary: mirror, pending, content }) {
const cardsHref = useCardsHref();
const done = mirrorDone(mirror);
const playing = ["easy", "normal", "hard"].some((mode) => mirror[mode] === "playing");
return <QuestTile id="mirror" art={ART.mirror} kind={content.mirrorKind} title={content.mirrorTitle} description={content.mirrorDescription} doneSign={content.doneSign}
action={done ? content.mirrorResult : playing ? content.mirrorResume : content.mirrorAction} href="#/cards/mirror" primary={pending} done={done} />;
action={done ? content.mirrorResult : playing ? content.mirrorResume : content.mirrorAction} href={cardsHref("mirror")} primary={pending} done={done} />;
}
function ExpeditionsQuest({ summary, pending, content, now }) {
const cardsHref = useCardsHref();
const returned = summary.returned > 0 || (summary.nextReturnAt != null && summary.nextReturnAt <= now);
return <QuestTile id="expeditions" art={ART.expeditions} kind={content.expeditionsKind} title={content.expeditionsTitle} description={content.expeditionsDescription}
status={expeditionQuestStatus(summary, content, now)} href="#/cards/expeditions" primary={pending}
status={expeditionQuestStatus(summary, content, now)} href={cardsHref("expeditions")} primary={pending}
action={returned ? content.expeditionsClaim : summary.running ? content.expeditionsInProgress : summary.enabled ? content.expeditionsAction : content.expeditionsOpen} />;
}
@ -106,13 +111,14 @@ function GuildCounter({ state, quests, content, now }) {
/** Votre équipe : le même bloc que sur la page Équipe du jour, avec le bouton qui y mène. */
function GuildTeam({ catalog, team, content, teamContent, statLabels }) {
const cardsHref = useCardsHref();
const ready = team.status === "ready";
const recruiting = team.status === "recruiting";
const text = ready ? fillTemplate(content.teamReady, { day: team.teamDay, max: team.maxDays }) : recruiting ? content.teamRecruiting : content.teamEmpty;
return <TeamTable catalog={catalog} companions={team.companions} content={teamContent} statLabels={statLabels} showBest={ready} seatLabel={teamContent.seat}
title={content.teamTitle} titleId="nebula-guild-team-title"
status={<>{text}{ready && <span className="nebula-team-days" aria-hidden="true">{Array.from({ length: team.maxDays }, (_, index) => <i key={index} data-on={index < team.teamDay || undefined} />)}</span>}</>}
action={<a className="nds-button" data-size="sm" data-variant={ready ? "secondary" : "primary"} href="#/cards/team">{ready ? content.teamOpen : recruiting ? content.teamResume : content.teamRecruit}</a>} />;
action={<a className="nds-button" data-size="sm" data-variant={ready ? "secondary" : "primary"} href={cardsHref("team")}>{ready ? content.teamOpen : recruiting ? content.teamResume : content.teamRecruit}</a>} />;
}
export function GuildPanel({ catalog, state, content, teamContent, statLabels }) {