Rework the daily team screens, share its team block and give the race its admin tab
The daily team page now opens on a welcome screen with the three steps, and the recruitment keeps the same look: golden steps, the choice in a golden panel with the hidden stars, a team summary of colored mini cards and its strengths, and a reroll badge. One "Your team" block is shared by the Guild, the recruitment and the ready team. The header shows the extra golden stars and the balms; the tips button is gone. On the Guild, team quests carry a "En groupe" sign until the team is ready and the streak badge stays readable. The race gets its own admin tab: its own opening, the day's circuit and results, rewards by place and the watchers' skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
327337075b
commit
52b35880f2
23 changed files with 570 additions and 253 deletions
|
|
@ -2,25 +2,28 @@
|
|||
// missions (les Expéditions, mises en avant), l'équipe du joueur, puis le tableau des quêtes du jour. Chaque quête a sa tuile, avec son état.
|
||||
import { useEffect, useState } from "react";
|
||||
import { dailyQuestStatus, fillTemplate, formatStreak } from "./dailyShare.js";
|
||||
import { expeditionQuestStatus, ITEM_ART } from "./expeditionFormat.js";
|
||||
import { expeditionQuestStatus } from "./expeditionFormat.js";
|
||||
import { guildGreeting, guildQuests, questDone } from "./guildQuests.js";
|
||||
import { TeamCompanion } from "./TeamCompanion.jsx";
|
||||
import { TeamTable } from "./TeamTable.jsx";
|
||||
|
||||
const ART = {
|
||||
hall: "/static/img/cards/guild/hall.webp",
|
||||
table: "/static/img/cards/guild/tavern.webp",
|
||||
clerk: "/static/img/cards/guild-veilleurs.webp",
|
||||
daily: "/static/img/cards/guild/quest-daily.webp",
|
||||
race: "/static/img/cards/guild/quest-race.webp",
|
||||
expeditions: "/static/img/cards/guild/quest-expeditions.webp"
|
||||
};
|
||||
|
||||
// Tuile d'une quête : son illustration, son type, son état et le bouton qui y mène. `badge` se pose sur l'illustration.
|
||||
function QuestTile({ id, art, kind, title, description, status, action, href, primary, badge = null, locked = false, done = false }) {
|
||||
// Tuile d'une quête : son illustration, son type, son état et le bouton qui y mène. `badge` se pose sur l'illustration ; `sign`, une
|
||||
// pancarte de bois penchée, signale une quête qui demande une équipe tant que le joueur n'en a pas.
|
||||
function QuestTile({ id, art, kind, title, description, status, action, href, primary, badge = null, sign = "", locked = false, done = false }) {
|
||||
return <article className="nds-card nebula-quest" data-quest={id} data-done={done || undefined} data-locked={locked || undefined} aria-labelledby={`nebula-quest-${id}-title`}>
|
||||
<div className="nebula-quest-media">
|
||||
{/* L'illustration mène aussi à la quête, comme les couvertures des Toolboxes ; le bouton reste le lien annoncé. */}
|
||||
<a className="nds-card-cover nebula-quest-cover" href={href} tabIndex={-1} aria-hidden="true"><img src={art} alt="" loading="lazy" /></a>
|
||||
{/* L'illustration mène aussi à la quête, comme les couvertures des Toolboxes ; le bouton reste le lien annoncé. Celle qui porte
|
||||
la pancarte (quête en équipe, sans équipe prête) ne l'est pas. */}
|
||||
{sign ? <div className="nds-card-cover nebula-quest-cover" aria-hidden="true"><img src={art} alt="" loading="lazy" /></div>
|
||||
: <a className="nds-card-cover nebula-quest-cover" href={href} tabIndex={-1} aria-hidden="true"><img src={art} alt="" loading="lazy" /></a>}
|
||||
{sign && <span className="nebula-quest-sign">{sign}</span>}
|
||||
{badge}
|
||||
</div>
|
||||
<div className="nds-card-body nebula-quest-body">
|
||||
|
|
@ -46,7 +49,7 @@ function RaceQuest({ summary: team, pending, content }) {
|
|||
const status = locked ? content.raceLocked : { running: content.raceRunning, finished: content.raceFinished }[team.race] || content.raceToRun;
|
||||
return <QuestTile id="race" art={ART.race} kind={content.raceKind} title={content.raceTitle} description={content.raceDescription} status={status}
|
||||
action={locked ? content.raceToTeam : team.race === "finished" ? content.raceResult : content.raceAction} href={locked ? "#/cards/team" : "#/cards/race"}
|
||||
primary={pending && !locked} locked={locked} done={team.race === "finished"} />;
|
||||
primary={pending && !locked} locked={locked} done={team.race === "finished"} sign={locked ? content.groupSign : ""} />;
|
||||
}
|
||||
|
||||
function ExpeditionsQuest({ summary, pending, content, now }) {
|
||||
|
|
@ -80,30 +83,15 @@ function GuildCounter({ state, quests, content, now }) {
|
|||
</header>;
|
||||
}
|
||||
|
||||
// Votre équipe : les cinq compagnons (ou leurs places à pourvoir), et à côté ce qui sert à la former ou la soigner.
|
||||
function GuildTeam({ catalog, state, team, content, teamContent, statLabels }) {
|
||||
// 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 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;
|
||||
const slots = Array.from({ length: 5 }, (_, index) => team.companions[index] || null);
|
||||
return <section className="nds-panel nebula-guild-team" aria-labelledby="nebula-guild-team-title">
|
||||
<img className="nebula-guild-team-bg" src={ART.table} alt="" />
|
||||
<div className="nebula-guild-team-head">
|
||||
<h3 id="nebula-guild-team-title">{content.teamTitle}</h3>
|
||||
<p>{text}{ready && <span className="nebula-guild-days" aria-hidden="true">{Array.from({ length: team.maxDays }, (_, index) => <i key={index} data-on={index < team.teamDay || undefined} />)}</span>}</p>
|
||||
</div>
|
||||
<ol className="nebula-guild-team-list">{slots.map((companion, index) => <li key={companion?.cardId ?? `slot-${index}`}>
|
||||
{companion ? <TeamCompanion catalog={catalog} companion={companion} content={teamContent} statLabels={statLabels} size="sm" /> : <span className="nebula-guild-team-slot">{content.teamSeat}</span>}
|
||||
</li>)}</ol>
|
||||
<aside className="nebula-guild-team-side">
|
||||
<dl>
|
||||
<div><dt>{content.goldStars}</dt><dd className="nebula-guild-stars" aria-label={fillTemplate(content.goldStarsLabel, { count: team.goldStars, max: team.maxGoldStars })}>{"★".repeat(team.goldStars)}<i>{"★".repeat(team.maxGoldStars - team.goldStars)}</i></dd></div>
|
||||
<div><dt><img src={ITEM_ART.balm} alt="" />{content.balms}</dt><dd>{state.items?.balm ?? 0}</dd></div>
|
||||
</dl>
|
||||
{!ready && team.goldStars > 0 && <p>{fillTemplate(team.goldStars > 1 ? content.teamStars : content.teamStar, { count: team.goldStars })}</p>}
|
||||
<a className="nds-button" data-size="sm" data-variant={ready ? "secondary" : "primary"} href="#/cards/team">{ready ? content.teamOpen : recruiting ? content.teamResume : content.teamRecruit}</a>
|
||||
</aside>
|
||||
</section>;
|
||||
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>} />;
|
||||
}
|
||||
|
||||
export function GuildPanel({ catalog, state, content, teamContent, statLabels }) {
|
||||
|
|
@ -119,7 +107,7 @@ export function GuildPanel({ catalog, state, content, teamContent, statLabels })
|
|||
const listed = guildQuests(state, now);
|
||||
const team = state.team;
|
||||
// La Course figure au tableau dès que l'Équipe du jour est ouverte, verrouillée tant qu'il n'y a pas d'équipe.
|
||||
const quests = team?.enabled && !listed.some((quest) => quest.id === "race") ? [...listed, { id: "race", pending: false, summary: team }] : listed;
|
||||
const quests = team?.raceEnabled && !listed.some((quest) => quest.id === "race") ? [...listed, { id: "race", pending: false, summary: team }] : listed;
|
||||
const tile = ({ id, summary, pending }) => {
|
||||
const Tile = QUEST_TILES[id];
|
||||
return Tile ? <Tile key={id} catalog={catalog} summary={summary} pending={pending} content={content} now={now} /> : null;
|
||||
|
|
@ -132,7 +120,7 @@ export function GuildPanel({ catalog, state, content, teamContent, statLabels })
|
|||
<h3 id="nebula-guild-missions-title">{content.missionsTitle}</h3>
|
||||
{missions.map(tile)}
|
||||
</section>}
|
||||
{team && (team.enabled || team.status === "recruiting") && <GuildTeam catalog={catalog} state={state} team={team} content={content} teamContent={teamContent} statLabels={statLabels} />}
|
||||
{team && (team.enabled || team.status === "recruiting") && <GuildTeam catalog={catalog} team={team} content={content} teamContent={teamContent} statLabels={statLabels} />}
|
||||
{board.length > 0 && <section className="nebula-guild-board" aria-labelledby="nebula-guild-board-title">
|
||||
<h3 id="nebula-guild-board-title">{content.boardTitle}</h3>
|
||||
<div className="nebula-guild-notices">{board.map(tile)}</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue