Accueil, tutoriel, aide en questions, installation et mise à jour de l'application

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-09 15:17:49 +01:00
co-authored by Claude Opus 5.5
parent 3f5b00133d
commit 441bca1bd7
37 changed files with 3518 additions and 130 deletions
+601
View File
@@ -1521,3 +1521,604 @@ html.landscape .position-board {
width: 20px;
height: 20px;
}
/* ------------------------------------------- Accueil, tutoriel, aide */
/* Maquettes « Étape 0e.5 » et « Accueil » ; règles :
* docs/identite/charte/accueil-tutoriel-aide.md. */
.brand-link {
display: flex;
align-items: center;
min-height: 44px;
}
/* Le tutoriel et le premier lancement ont leur propre en-tête. */
html.bare .topbar {
display: none;
}
.home,
.tutorial {
max-width: var(--page-width);
margin: 0 auto;
padding-bottom: var(--space-6);
}
.overline {
margin: 0;
font-size: 13px;
line-height: 16px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--muted);
}
.muted {
color: var(--muted);
}
.caption {
margin: 0;
font-size: 13px;
line-height: 18px;
color: var(--muted);
}
.card {
display: block;
padding: var(--space-4);
color: var(--text);
text-decoration: none;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-raised);
}
/* Une étiquette d'action dans une carte-lien, en contour. */
.pill {
display: inline-flex;
flex: none;
align-items: center;
min-height: 44px;
padding: 0 16px;
font-weight: 700;
color: var(--text);
border: 2px solid var(--border-strong);
border-radius: var(--radius-pill);
}
/* Premier lancement. */
.welcome {
display: flex;
flex-direction: column;
gap: var(--space-6);
min-height: 100vh;
min-height: 100dvh;
padding: var(--space-6) 0 var(--space-6);
}
.welcome-logo {
margin: 0;
}
.welcome-logo img {
height: 34px;
width: auto;
}
.welcome-board {
margin-inline: calc(-1 * var(--space-2));
width: calc(100% + 2 * var(--space-2));
}
.welcome-text h2,
.home-intro h2 {
margin: 0 0 var(--space-2);
font-size: 32px;
line-height: 36px;
font-weight: 800;
letter-spacing: -0.01em;
}
.welcome-text p,
.home-intro p {
margin: 0;
}
.welcome-choices {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: auto;
}
.choice {
display: flex;
flex-direction: column;
justify-content: center;
min-height: 64px;
padding: 10px 20px;
color: var(--text);
text-decoration: none;
border: 2px solid var(--border-strong);
border-radius: 16px;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
}
.choice span {
font-size: 15px;
line-height: 20px;
color: var(--muted);
}
.choice.primary {
color: var(--on-accent);
background: var(--accent);
border-color: var(--accent);
}
.choice.primary span {
color: var(--on-accent);
}
.choice:active {
transform: translateY(1px);
filter: brightness(0.94);
}
.welcome-choices .caption {
margin-top: var(--space-1);
text-align: center;
}
/* Accueil. */
.home-main {
display: flex;
flex-direction: column;
gap: 20px;
padding-top: var(--space-2);
}
.home-game {
display: flex;
flex-direction: column;
gap: 14px;
}
.home-game-top {
display: flex;
gap: 14px;
align-items: center;
}
.home-mini {
flex: none;
width: 132px;
}
/* La miniature ne porte pas les numéros des flèches, illisibles à cette
* taille. */
.home-board .point-number {
display: none;
}
.home-facts {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.home-pips {
font-size: 15px;
line-height: 20px;
color: var(--muted);
font-variant-numeric: tabular-nums lining-nums;
}
.home-actions {
display: flex;
gap: var(--space-2);
}
.home-actions > * {
flex: 1 1 0;
min-width: 0;
padding: 0 12px;
}
.install-card {
display: flex;
gap: var(--space-3);
align-items: center;
margin-top: calc(-1 * var(--space-2));
padding: 10px 4px 10px 14px;
background: var(--surface-sunken);
border-radius: var(--radius-md);
}
.install-card .install-symbol {
flex: none;
width: 32px;
height: 32px;
}
.install-text {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
font-size: 15px;
line-height: 20px;
}
.install-card button.secondary {
flex: none;
min-height: 44px;
padding: 0 14px;
background: var(--surface);
}
.install-card .icon-button .icon {
width: 18px;
height: 18px;
color: var(--muted);
}
.home-rules {
display: flex;
gap: var(--space-3);
align-items: center;
}
.home-rules-text {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
}
.home-rules-text .muted {
font-size: 15px;
line-height: 20px;
}
.home-progress:empty {
display: none;
}
.home-footer {
display: flex;
gap: 10px;
align-items: center;
margin-top: var(--space-4);
font-size: 13px;
line-height: 18px;
color: var(--muted);
}
.home-footer img {
flex: none;
width: 28px;
height: 28px;
}
/* Feuille d'installation. */
.sheet-head .install-symbol {
width: 40px;
height: 40px;
margin-right: var(--space-3);
}
#install-sheet .sheet-title {
flex: 1;
}
.install-lead {
margin: var(--space-2) 0 var(--space-4);
color: var(--muted);
}
.install-steps {
display: flex;
flex-direction: column;
gap: var(--space-3);
margin: 0 0 var(--space-4);
padding: 0;
list-style: none;
}
.install-steps li {
display: flex;
gap: var(--space-3);
align-items: flex-start;
}
.step-number {
display: flex;
flex: none;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
font-weight: 800;
font-variant-numeric: tabular-nums lining-nums;
background: var(--accent-soft);
border-radius: 50%;
}
.install-done {
width: 100%;
}
/* Bandeau de mise à jour : en haut, discret, jamais sur la barre
* d'actions ni sur « Reprendre l'ancienne ». */
.update-banner {
top: var(--space-2);
bottom: auto;
}
/* Tutoriel. */
.tutorial-head {
display: flex;
gap: var(--space-3);
align-items: center;
min-height: 52px;
padding-top: var(--space-2);
}
.tutorial-progress {
display: grid;
flex: 1;
grid-template-columns: repeat(8, minmax(0, 1fr));
gap: var(--space-1);
}
/* Un segment : 4 px de trait, dans une zone de 44 px de haut quand c'est
* un lien vers une étape déjà vue. */
.tutorial-progress .segment {
position: relative;
display: block;
height: 44px;
}
.tutorial-progress .segment::before {
content: "";
position: absolute;
top: 20px;
left: 0;
right: 0;
height: 4px;
background: var(--border);
border-radius: var(--radius-pill);
}
.tutorial-progress .segment.done::before {
background: var(--accent);
}
.tutorial-progress .segment[aria-current]::before {
top: 19px;
height: 6px;
}
.tutorial-skip {
display: inline-flex;
align-items: center;
min-height: 44px;
font-size: 15px;
font-weight: 500;
color: var(--muted);
}
.tutorial-title {
margin: var(--space-1) 0 var(--space-3);
font-size: 24px;
line-height: 30px;
}
.tutorial-board-box {
position: relative;
}
@media (max-width: 40rem) {
.tutorial-board-box {
margin-inline: calc(var(--space-2) - var(--space-4));
}
}
#tutorial-replay {
position: absolute;
right: var(--space-1);
bottom: calc(-44px - var(--space-1));
color: var(--accent);
}
.tutorial-text {
margin-top: var(--space-3);
padding-right: 52px;
}
.tutorial-text p {
margin: 0 0 10px;
}
.tutorial-task {
margin: var(--space-3) 0 0;
padding: 10px 14px;
font-weight: 700;
background: var(--accent-soft);
border-radius: var(--radius-md);
}
.tutorial-feedback {
display: flex;
gap: var(--space-2);
align-items: flex-start;
min-height: 25px;
margin: var(--space-3) 0 0;
}
.tutorial-feedback:empty {
min-height: 0;
}
.tutorial-feedback[data-verdict="right"] {
font-weight: 700;
}
.tutorial-feedback[data-verdict="right"] .icon {
color: var(--verdict-good);
}
.tutorial-feedback[data-verdict="info"] {
color: var(--muted);
}
.tutorial-cube {
display: flex;
gap: var(--space-2);
margin-top: var(--space-3);
}
.tutorial-cube button {
flex: 1 1 0;
}
.tutorial-nav {
display: grid;
grid-template-columns: 1fr 1.4fr;
gap: var(--space-2);
margin-top: var(--space-6);
}
.tutorial-nav .button {
min-width: 0;
}
/* Le sens du jeu : pointillés text sur un liseré ivoire, jamais en brique
* (la brique veut dire « à faire »). Couleurs de marque, les mêmes dans les
* deux thèmes : le liseré reste lisible sur le bois. */
.tutorial-path path {
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
pointer-events: none;
}
.tutorial-path .path-edge {
stroke: var(--brand-ivoire);
}
.tutorial-path .path-dots,
.tutorial-path .path-head {
stroke: var(--brand-noyer);
}
/* En paysage, le plateau du tutoriel tient dans la hauteur de l'écran. */
html.landscape .tutorial-board,
html.landscape .welcome-board {
width: min(100%, calc(70vh * 640 / 520));
height: auto;
margin-inline: auto;
aspect-ratio: 640 / 520;
}
html.landscape .welcome {
min-height: 0;
}
/* Aide. */
.help-tutorial {
display: flex;
gap: var(--space-3);
align-items: center;
margin-top: var(--space-4);
}
.help-tutorial-text {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
}
.help-tutorial-text .muted {
font-size: 15px;
line-height: 20px;
}
.help-intro {
margin-top: var(--space-4);
}
.see-board {
display: inline-flex;
align-items: center;
min-height: 44px;
font-weight: 500;
}
.glossary-search {
display: flex;
flex-direction: column;
gap: var(--space-1);
margin-top: var(--space-3);
}
.search-label {
font-size: 15px;
line-height: 20px;
font-weight: 500;
}
.glossary-search input {
min-height: 48px;
padding: 0 var(--space-3);
font: inherit;
color: var(--text);
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: var(--radius-md);
user-select: text;
-webkit-user-select: text;
}
.term-card + .term-card {
border-top: 1px solid var(--border);
}
.glossary .english {
margin-left: var(--space-2);
font-size: 13px;
font-style: italic;
font-weight: 400;
color: var(--muted);
}
.glossary dd p {
margin: 0 0 var(--space-1);
}
.see-also {
font-size: 15px;
line-height: 20px;
color: var(--muted);
}
.glossary .term-card.current {
margin-inline: calc(-1 * var(--space-4));
padding-inline: var(--space-4);
background: var(--accent-soft);
}
.glossary .term-card.current dt,
.glossary .term-card.current dd {
margin-inline: 0;
padding-inline: 0;
background: none;
}
+34 -2
View File
@@ -26,8 +26,10 @@
<!-- Logo de la charte (docs/identite/logo/, copié dans icons/ par make
site), version sombre en thème sombre (choix par app.css). -->
<h1 class="brand">
<img class="logo-light" src="icons/logo-horizontal-couleur.svg" alt="Ustagammon">
<img class="logo-dark" src="icons/logo-horizontal-sombre.svg" alt="Ustagammon">
<a id="home-link" href="#/accueil" class="brand-link">
<img class="logo-light" src="icons/logo-horizontal-couleur.svg" alt="Ustagammon">
<img class="logo-dark" src="icons/logo-horizontal-sombre.svg" alt="Ustagammon">
</a>
</h1>
<!-- Ce qui mène à un autre écran est un lien vers son adresse (ADR 0013,
amendement) ; les actions sont des boutons. -->
@@ -82,6 +84,11 @@
<noscript><p>Ustagammon a besoin de JavaScript.</p></noscript>
</main>
<!-- L'accueil (#/accueil) et le tutoriel (#/tutoriel/...) : leur contenu
est construit par app/src/ui/home-view.ts et tutorial-view.ts. -->
<section id="home" class="home page" hidden></section>
<section id="tutorial" class="tutorial page" hidden></section>
<!-- L'aide : un onglet par adresse (#/aide, #/glossaire, #/a-propos). -->
<section id="help" class="help page" hidden>
<a id="help-back" href="#/" class="button secondary"></a>
@@ -117,12 +124,31 @@
</div>
<button id="menu-new-game" type="button" class="item"></button>
<a id="menu-games" href="#/parties" class="item"></a>
<a id="menu-home" href="#/accueil" class="item"></a>
<a id="menu-tutorial" href="#/tutoriel/1" class="item"></a>
<button id="menu-copy-link" type="button" class="item"></button>
<button id="menu-fullscreen" type="button" class="item"></button>
<a id="menu-help" href="#/aide" class="item"></a>
<button id="menu-install" type="button" class="item"></button>
<button id="menu-theme" type="button" class="item"><span class="item-label"></span><span class="item-value"></span></button>
<button id="menu-vibrations" type="button" class="item" role="switch"><span class="item-label"></span><span class="switch" aria-hidden="true"></span></button>
<button id="menu-screen-on" type="button" class="item" role="switch"><span class="item-label"></span><span class="switch" aria-hidden="true"></span></button>
<button id="menu-update" type="button" class="item"></button>
</div>
</div>
<!-- La marche à suivre pour installer (#/installer) : une feuille. -->
<div id="install-veil" class="veil sheet-veil" hidden>
<div id="install-sheet" class="sheet" role="dialog" aria-modal="true" aria-labelledby="install-title">
<div class="sheet-head">
<span class="grip" aria-hidden="true"></span>
<img class="install-symbol" src="icons/symbole-couleur.svg" alt="">
<h2 id="install-title" class="sheet-title"></h2>
<button id="install-close" type="button" class="icon-button"></button>
</div>
<p id="install-lead" class="install-lead"></p>
<ol id="install-steps" class="install-steps"></ol>
<button id="install-done" type="button" class="secondary install-done"></button>
</div>
</div>
@@ -158,6 +184,12 @@
<span class="banner-timer" aria-hidden="true"></span>
</div>
<!-- « Nouvelle version disponible » : jamais pendant un coup en cours. -->
<div id="update-banner" class="banner update-banner" role="status" hidden>
<span id="update-text"></span>
<button id="update-apply" type="button" class="secondary"></button>
</div>
</div>
</body>
</html>
+15 -4
View File
@@ -10,9 +10,14 @@
//
// Mise à jour : à chaque publication, VERSION change, donc ce fichier. Le
// navigateur installe alors la nouvelle version, qui télécharge tout dans un
// nouveau cache, prend la main tout de suite et efface l'ancien cache. La
// page déjà ouverte a chargé tous ses fichiers au démarrage : elle continue
// sans rien remarquer, et le prochain lancement utilise la nouvelle version.
// nouveau cache, puis attend : la version en place garde la main, et son
// cache, tant que le joueur n'a pas accepté la mise à jour. Une page ouverte
// continue donc de trouver tous ses fichiers. L'application affiche le
// bandeau « Nouvelle version disponible » (app/src/ui/updates.ts) ; « Mettre
// à jour » envoie le message « skip-waiting » : la nouvelle version prend
// la main, efface l'ancien cache, et la page se recharge. À la toute
// première installation, aucune version n'est en place : elle prend la main
// sans attendre.
/* global VERSION, FILES */
@@ -25,11 +30,17 @@ self.addEventListener("install", (event) => {
// no-cache : revalider auprès du serveur, jamais une copie
// périmée du cache HTTP du navigateur.
await cache.addAll(FILES.map((file) => new Request(file, { cache: "no-cache" })));
await self.skipWaiting();
})(),
);
});
// L'accord du joueur (même nom que SKIP_WAITING dans updates.ts).
self.addEventListener("message", (event) => {
if (event.data?.type === "skip-waiting") {
void self.skipWaiting();
}
});
self.addEventListener("activate", (event) => {
event.waitUntil(
(async () => {