#/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>
54 lines
2.6 KiB
JavaScript
54 lines
2.6 KiB
JavaScript
/**
|
|
* @file Application du mode mobile de Sokko TCG (`#/mobile/cards/...`) : charge les textes du site et la
|
|
* configuration du jeu, puis affiche CardsPage en mode mobile, sans le shell du site.
|
|
*
|
|
* Utilisé par : main.jsx, chargé à la demande quand la route commence par `/mobile/cards`.
|
|
* Attention :
|
|
* - Pas de shell : ni barre latérale, ni toolboxes, ni tiroir, ni sauvegarde. Ce mode ne sert qu'à jouer depuis
|
|
* un téléphone ; une page qui aurait besoin du reste du site n'y a pas sa place.
|
|
* - Les fenêtres (Modal) sont rendues dans `body`, hors de `.nebula-mobile` : tant que ce mode est affiché, `body`
|
|
* porte la classe `nebula-mobile-body`, qui leur donne leurs styles de téléphone.
|
|
* - Importe CardsPage avant sa feuille de style : cards-mobile-route.scss passe après celle du jeu et l'emporte à
|
|
* spécificité égale.
|
|
* @see DESIGN_SYSTEM.md (section 24, « Mode mobile de dépannage »)
|
|
*/
|
|
|
|
import { useEffect } from "react";
|
|
import { CardsPage } from "../CardsPage.jsx";
|
|
import "../../../styles/cards-mobile-route.scss";
|
|
import { AppErrorBoundary } from "../../../components/AppErrorBoundary.jsx";
|
|
import { Icon } from "../../../components/Icon.jsx";
|
|
import { useAppData } from "../../../hooks/useAppData.js";
|
|
import { parseMobileCardsRoute } from "../cardsRoutes.js";
|
|
import { useCardsConfig } from "../useCardsConfig.js";
|
|
|
|
/** Page complète du mode mobile pour `route` (`/mobile/cards/<section>/<complément>`). */
|
|
export function MobileCardsApp({ route }) {
|
|
const cardsConfig = useCardsConfig();
|
|
const { siteContent, siteContentError, siteContentLoading, retrySiteContent } = useAppData(route);
|
|
const { section, subsection } = parseMobileCardsRoute(route);
|
|
useEffect(() => {
|
|
document.body.classList.add("nebula-mobile-body");
|
|
return () => document.body.classList.remove("nebula-mobile-body");
|
|
}, []);
|
|
|
|
if (!siteContent) {
|
|
return <main className="startup-error">
|
|
<section className="empty nds-empty-state" aria-busy={siteContentLoading}>
|
|
<h1>Contenu indisponible</h1>
|
|
<p>{siteContentError || "Chargement du contenu..."}</p>
|
|
{siteContentError && <button className="nds-button" data-size="sm" data-variant="primary" type="button" onClick={retrySiteContent}>
|
|
<Icon name="refresh" />Réessayer
|
|
</button>}
|
|
</section>
|
|
</main>;
|
|
}
|
|
|
|
return <div className="nebula-mobile">
|
|
<main>
|
|
<AppErrorBoundary route={route}>
|
|
<CardsPage siteContent={siteContent} cardsConfig={cardsConfig} playerSection={section} playerSubsection={subsection} mobile />
|
|
</AppErrorBoundary>
|
|
</main>
|
|
</div>;
|
|
}
|