feat: UI evolution — HudBar Tailwind + arcs collapsés intelligents

- HudBar: migration inline styles → Tailwind, breakpoint 480px ultra-compact mobile
- QuestPage: arcs fermés par défaut sauf quête active/à réclamer, barre progression par arc
- QuestPage: migration inline styles → Tailwind (QuestCard, ArcSection, ArcQuestRow)
This commit is contained in:
2026-04-28 17:39:01 +02:00
parent 4d82346af4
commit fd5e2f6425
3 changed files with 148 additions and 144 deletions

View File

@@ -15,7 +15,6 @@ function RegenTimer({ endurance, enduranceMax, lastEnduranceTs }: { endurance: n
if (endurance >= enduranceMax) return null;
// Regen = 1pt every 3min = 180s
const elapsedMs = now - new Date(lastEnduranceTs).getTime();
const elapsedInCycle = elapsedMs % (3 * 60 * 1000);
const remainingMs = 3 * 60 * 1000 - elapsedInCycle;
@@ -24,8 +23,8 @@ function RegenTimer({ endurance, enduranceMax, lastEnduranceTs }: { endurance: n
const sec = remainingSec % 60;
return (
<span style={{ fontSize: 9, color: '#5ba4f5' }}>
<Clock size={8} style={{ display: 'inline', marginRight: 2 }} />
<span className="hud-regen text-[9px] text-rpg-blue inline-flex items-center gap-0.5">
<Clock size={8} className="inline" />
+1 dans {min}:{sec.toString().padStart(2, '0')}
</span>
);
@@ -35,7 +34,7 @@ export function HudBar() {
const { data: char } = useQuery({
queryKey: ['character'],
queryFn: characterApi.me,
refetchInterval: 30_000, // refresh every 30s for endurance updates
refetchInterval: 30_000,
});
useEffect(() => {
@@ -56,41 +55,31 @@ export function HudBar() {
const questReady = activeQuests?.filter((pq: any) => pq.status === 'completed').length ?? 0;
return (
<div className="hud-bar" style={{
background: '#111620',
borderBottom: '1px solid #1e2535',
padding: '4px 1rem',
display: 'flex',
alignItems: 'center',
gap: 16,
fontSize: 11,
color: '#6b7a99',
flexWrap: 'wrap',
}}>
<div className="hud-bar bg-[#111620] border-b border-[#1e2535] px-4 py-1 flex items-center gap-4 text-[11px] text-rpg-muted flex-wrap">
{/* Name + Level */}
<Link to="/dashboard" style={{ textDecoration: 'none', display: 'flex', alignItems: 'center', gap: 6 }}>
<span style={{ fontSize: 14 }}>🐸</span>
<span style={{ fontWeight: 700, color: '#dce4f0', fontSize: 12 }}>{char.name}</span>
<span style={{ color: '#6b7a99' }}>Niv.{char.level}</span>
<Link to="/dashboard" className="no-underline flex items-center gap-1.5">
<span className="text-sm">🐸</span>
<span className="font-bold text-rpg-text text-xs">{char.name}</span>
<span className="hud-label text-rpg-muted">Niv.{char.level}</span>
</Link>
<span style={{ color: '#2a3448' }}>|</span>
<span className="hud-sep text-[#2a3448]">|</span>
{/* HP */}
<Link to="/dashboard" style={{ textDecoration: 'none', display: 'flex', alignItems: 'center', gap: 4 }}>
<Heart size={10} color="#e84040" />
<span style={{ color: char.hpCurrent < char.hpMax ? '#e84040' : '#6b7a99' }}>
{char.hpCurrent}/{char.hpMax}
<Link to="/dashboard" className="no-underline flex items-center gap-1">
<Heart size={10} className="text-rpg-red" />
<span className={char.hpCurrent < char.hpMax ? 'text-rpg-red' : 'text-rpg-muted'}>
{char.hpCurrent}<span className="hud-label">/{char.hpMax}</span>
</span>
</Link>
<span style={{ color: '#2a3448' }}>|</span>
<span className="hud-sep text-[#2a3448]">|</span>
{/* Endurance + timer */}
<Link to="/dashboard" style={{ textDecoration: 'none', display: 'flex', alignItems: 'center', gap: 4 }}>
<Zap size={10} color="#5ba4f5" />
<span style={{ color: endurance < 5 ? '#e84040' : '#6b7a99' }}>
{endurance}/{char.enduranceMax}
<Link to="/dashboard" className="no-underline flex items-center gap-1">
<Zap size={10} className="text-rpg-blue" />
<span className={endurance < 5 ? 'text-rpg-red' : 'text-rpg-muted'}>
{endurance}<span className="hud-label">/{char.enduranceMax}</span>
</span>
{char.lastEnduranceTs && (
<RegenTimer
@@ -101,30 +90,30 @@ export function HudBar() {
)}
</Link>
<span style={{ color: '#2a3448' }}>|</span>
<span className="hud-sep text-[#2a3448]">|</span>
{/* XP */}
<Link to="/dashboard" style={{ textDecoration: 'none', display: 'flex', alignItems: 'center', gap: 4 }}>
<Star size={10} color="#a78bfa" />
<span>{char.xp}/{xpNext}</span>
<Link to="/dashboard" className="no-underline flex items-center gap-1">
<Star size={10} className="text-rpg-purple" />
<span>{char.xp}<span className="hud-label">/{xpNext}</span></span>
</Link>
<span style={{ color: '#2a3448' }}>|</span>
<span className="hud-sep text-[#2a3448]">|</span>
{/* Gold */}
<span style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<Coins size={10} color="#f4c94e" />
<span className="flex items-center gap-1">
<Coins size={10} className="text-rpg-gold" />
<span>{char.gold}</span>
</span>
<span style={{ color: '#2a3448' }}>|</span>
<span className="hud-sep text-[#2a3448]">|</span>
{/* Quests */}
<Link to="/quests" style={{ textDecoration: 'none', display: 'flex', alignItems: 'center', gap: 4 }}>
<Scroll size={10} color={questReady > 0 ? '#f4c94e' : '#6b7a99'} />
<span>{questCount} quête{questCount !== 1 ? 's' : ''}</span>
<Link to="/quests" className="no-underline flex items-center gap-1">
<Scroll size={10} className={questReady > 0 ? 'text-rpg-gold' : 'text-rpg-muted'} />
<span className="hud-label">{questCount} quête{questCount !== 1 ? 's' : ''}</span>
{questReady > 0 && (
<span style={{ color: '#f4c94e', fontWeight: 700 }}>({questReady} prête{questReady > 1 ? 's' : ''} !)</span>
<span className="text-rpg-gold font-bold">({questReady} prête{questReady > 1 ? 's' : ''} !)</span>
)}
</Link>
</div>

View File

@@ -137,6 +137,7 @@ body {
/* HudBar compact */
.hud-bar { font-size: 10px; gap: 6px; padding: 4px 8px; flex-wrap: wrap; }
.hud-regen { display: none; }
/* Guide drawer full width mobile */
.guide-drawer { width: 100% !important; }
@@ -147,3 +148,10 @@ body {
/* Header compact */
.header-username { display: none; }
}
/* ── Ultra-compact mobile (petit écran) ── */
@media (max-width: 480px) {
.hud-bar { gap: 4px; padding: 3px 6px; font-size: 9px; }
.hud-sep { display: none; }
.hud-label { display: none; }
}

View File

@@ -1,7 +1,7 @@
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { questApi } from '../api/endpoints';
import { Scroll, CheckCircle, Circle, Trophy, ChevronDown, ChevronRight, Star, Coins, Swords, Lock } from 'lucide-react';
import { useState } from 'react';
import { useState, useMemo } from 'react';
const OBJ_LABELS: Record<string, string> = {
kill_monster: 'Tuer',
@@ -11,14 +11,9 @@ const OBJ_LABELS: Record<string, string> = {
forge_item: 'Forger',
};
function QuestCard({ pq, mode }: { pq: any; mode: 'active' | 'available' | 'completed' }) {
function useInvalidateQuests() {
const qc = useQueryClient();
const quest = mode === 'active' ? pq.quest : pq;
const progress = mode === 'active' ? pq.progress : 0;
const status = mode === 'active' ? pq.status : 'available';
const pct = Math.min(100, Math.floor((progress / quest.objectiveCount) * 100));
const invalidateAll = () => {
return () => {
qc.invalidateQueries({ queryKey: ['quests'] });
qc.invalidateQueries({ queryKey: ['questsActive'] });
qc.invalidateQueries({ queryKey: ['questsAvailable'] });
@@ -26,6 +21,14 @@ function QuestCard({ pq, mode }: { pq: any; mode: 'active' | 'available' | 'comp
qc.invalidateQueries({ queryKey: ['questArcs'] });
qc.invalidateQueries({ queryKey: ['character'] });
};
}
function QuestCard({ pq, mode }: { pq: any; mode: 'active' | 'available' | 'completed' }) {
const invalidateAll = useInvalidateQuests();
const quest = mode === 'active' ? pq.quest : pq;
const progress = mode === 'active' ? pq.progress : 0;
const status = mode === 'active' ? pq.status : 'available';
const pct = Math.min(100, Math.floor((progress / quest.objectiveCount) * 100));
const acceptMut = useMutation({
mutationFn: () => questApi.accept(quest.id),
@@ -46,72 +49,57 @@ function QuestCard({ pq, mode }: { pq: any; mode: 'active' | 'available' | 'comp
const isClaimed = status === 'claimed';
return (
<div className={`card ${isCompleted ? 'card-gold' : ''}`} style={{ padding: '0.75rem 1rem' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 4 }}>
<div style={{ flex: 1 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
{isClaimed ? <CheckCircle size={14} color="#3ddc84" /> : isCompleted ? <Trophy size={14} color="#f4c94e" /> : <Circle size={13} color="#6b7a99" />}
<span style={{ fontWeight: 700, fontSize: 13, color: isCompleted ? '#f4c94e' : '#dce4f0' }}>{quest.name}</span>
{quest.repeatable && <span style={{ fontSize: 9, color: '#5ba4f5', background: '#1a2540', padding: '1px 5px', borderRadius: 4 }}>répétable</span>}
<div className={`card ${isCompleted ? 'card-gold' : ''} py-3 px-4`}>
<div className="flex justify-between items-start mb-1">
<div className="flex-1">
<div className="flex items-center gap-1.5">
{isClaimed ? <CheckCircle size={14} className="text-rpg-green" /> : isCompleted ? <Trophy size={14} className="text-rpg-gold" /> : <Circle size={13} className="text-rpg-muted" />}
<span className={`font-bold text-[13px] ${isCompleted ? 'text-rpg-gold' : 'text-rpg-text'}`}>{quest.name}</span>
{quest.repeatable && <span className="text-[9px] text-rpg-blue bg-[#1a2540] px-1.5 py-px rounded">répétable</span>}
</div>
<p style={{ margin: '4px 0 0', fontSize: 11, color: '#6b7a99' }}>{quest.description}</p>
<p className="mt-1 mb-0 text-[11px] text-rpg-muted">{quest.description}</p>
</div>
</div>
{/* Objectif */}
<div style={{ fontSize: 11, color: '#9ca3af', margin: '6px 0 4px' }}>
<div className="text-[11px] text-[#9ca3af] mt-1.5 mb-1">
{OBJ_LABELS[quest.objectiveType] ?? quest.objectiveType} {mode === 'active' ? `${progress}/${quest.objectiveCount}` : `×${quest.objectiveCount}`}
</div>
{/* Progress bar (active quests only) */}
{mode === 'active' && (
<div style={{ background: '#1e2535', borderRadius: 4, height: 6, marginBottom: 6, overflow: 'hidden' }}>
<div style={{ width: `${pct}%`, height: '100%', background: isCompleted ? '#f4c94e' : '#5ba4f5', borderRadius: 4, transition: 'width 0.3s' }} />
<div className="bar-track mb-1.5" style={{ height: 6 }}>
<div className={isCompleted ? 'bar-fill-xp' : 'bar-fill-end'} style={{ width: `${pct}%` }} />
</div>
)}
{/* Rewards */}
<div style={{ display: 'flex', gap: 12, fontSize: 11, color: '#6b7a99', marginBottom: 6 }}>
<span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Star size={10} color="#a78bfa" /> {quest.rewardXp} XP</span>
<span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Coins size={10} color="#f4c94e" /> {quest.rewardGold} or</span>
{quest.rewardTitle && <span style={{ color: '#f4c94e' }}>🏅 {quest.rewardTitle}</span>}
<div className="flex gap-3 text-[11px] text-rpg-muted mb-1.5">
<span className="flex items-center gap-1"><Star size={10} className="text-rpg-purple" /> {quest.rewardXp} XP</span>
<span className="flex items-center gap-1"><Coins size={10} className="text-rpg-gold" /> {quest.rewardGold} or</span>
{quest.rewardTitle && <span className="text-rpg-gold">🏅 {quest.rewardTitle}</span>}
{quest.minLevel > 1 && <span>Niv. {quest.minLevel}+</span>}
</div>
{/* Actions */}
{mode === 'available' && (
<button
className="btn btn-ghost"
style={{ fontSize: 11, padding: '0.25rem 0.75rem' }}
disabled={acceptMut.isPending}
onClick={() => acceptMut.mutate()}
>
<button className="btn btn-ghost text-[11px] py-1 px-3" disabled={acceptMut.isPending} onClick={() => acceptMut.mutate()}>
{acceptMut.isPending ? 'Acceptation…' : '+ Accepter'}
</button>
)}
{mode === 'active' && isCompleted && (
<button
className="btn btn-gold"
style={{ fontSize: 11, padding: '0.25rem 0.75rem' }}
disabled={claimMut.isPending}
onClick={() => claimMut.mutate()}
>
<button className="btn btn-gold text-[11px] py-1 px-3" disabled={claimMut.isPending} onClick={() => claimMut.mutate()}>
{claimMut.isPending ? 'Réclamation…' : '🎁 Réclamer la récompense'}
</button>
)}
{mode === 'active' && !isCompleted && (
<button
className="btn btn-ghost"
style={{ fontSize: 10, padding: '0.2rem 0.5rem', color: '#6b7a99' }}
disabled={abandonMut.isPending}
onClick={() => abandonMut.mutate()}
>
<button className="btn btn-ghost text-[10px] py-0.5 px-2 text-rpg-muted" disabled={abandonMut.isPending} onClick={() => abandonMut.mutate()}>
{abandonMut.isPending ? '…' : '✕ Abandonner'}
</button>
)}
{acceptMut.isError && <p style={{ color: '#e84040', fontSize: 11, marginTop: 4 }}>{(acceptMut.error as Error).message}</p>}
{claimMut.isError && <p style={{ color: '#e84040', fontSize: 11, marginTop: 4 }}>{(claimMut.error as Error).message}</p>}
{abandonMut.isError && <p style={{ color: '#e84040', fontSize: 11, marginTop: 4 }}>{(abandonMut.error as Error).message}</p>}
{acceptMut.isError && <p className="text-rpg-red text-[11px] mt-1">{(acceptMut.error as Error).message}</p>}
{claimMut.isError && <p className="text-rpg-red text-[11px] mt-1">{(claimMut.error as Error).message}</p>}
{abandonMut.isError && <p className="text-rpg-red text-[11px] mt-1">{(abandonMut.error as Error).message}</p>}
</div>
);
}
@@ -137,68 +125,83 @@ function ArcQuestRow({ q }: { q: any }) {
});
return (
<div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 12, padding: '4px 0', borderBottom: '1px solid #1a2030' }}>
<div className="flex items-center gap-2 text-xs py-1 border-b border-[#1a2030]">
{q.playerStatus === 'claimed'
? <CheckCircle size={12} color="#3ddc84" />
? <CheckCircle size={12} className="text-rpg-green shrink-0" />
: q.playerStatus === 'completed'
? <Trophy size={12} color="#f4c94e" />
? <Trophy size={12} className="text-rpg-gold shrink-0" />
: q.playerStatus === 'active'
? <Swords size={12} color="#5ba4f5" />
: <Circle size={11} color="#3a4560" />
? <Swords size={12} className="text-rpg-blue shrink-0" />
: <Circle size={11} className="text-[#3a4560] shrink-0" />
}
<div style={{ flex: 1 }}>
<span style={{
color: q.playerStatus === 'claimed' ? '#3ddc84' : q.playerStatus === 'active' ? '#dce4f0' : '#6b7a99',
}}>{q.name}</span>
<div className="flex-1 min-w-0">
<span className={
q.playerStatus === 'claimed' ? 'text-rpg-green' : q.playerStatus === 'active' ? 'text-rpg-text' : 'text-rpg-muted'
}>{q.name}</span>
{q.playerStatus === 'active' && (
<span style={{ fontSize: 10, color: '#5ba4f5', marginLeft: 6 }}>{q.progress}/{q.objectiveCount}</span>
<span className="text-[10px] text-rpg-blue ml-1.5">{q.progress}/{q.objectiveCount}</span>
)}
</div>
<span style={{ fontSize: 10, color: '#6b7a99' }}>{q.rewardXp} XP</span>
{q.minLevel > 1 && !q.levelOk && <span style={{ fontSize: 9, color: '#e84040' }}>Niv.{q.minLevel}</span>}
<span className="text-[10px] text-rpg-muted">{q.rewardXp} XP</span>
{q.minLevel > 1 && !q.levelOk && <span className="text-[9px] text-rpg-red">Niv.{q.minLevel}</span>}
{/* Actions */}
{q.canAccept && (
<button className="btn btn-ghost" style={{ fontSize: 10, padding: '0.1rem 0.4rem' }}
disabled={acceptMut.isPending} onClick={() => acceptMut.mutate()}>
<button className="btn btn-ghost text-[10px] py-px px-1.5" disabled={acceptMut.isPending} onClick={() => acceptMut.mutate()}>
{acceptMut.isPending ? '...' : '+ Accepter'}
</button>
)}
{q.playerStatus === 'completed' && (
<button className="btn btn-gold" style={{ fontSize: 10, padding: '0.1rem 0.4rem' }}
disabled={claimMut.isPending} onClick={() => claimMut.mutate()}>
<button className="btn btn-gold text-[10px] py-px px-1.5" disabled={claimMut.isPending} onClick={() => claimMut.mutate()}>
{claimMut.isPending ? '...' : '🎁 Réclamer'}
</button>
)}
{acceptMut.isError && <span style={{ color: '#e84040', fontSize: 9 }}>{(acceptMut.error as Error).message}</span>}
{acceptMut.isError && <span className="text-rpg-red text-[9px]">{(acceptMut.error as Error).message}</span>}
</div>
);
}
function ArcSection({ arc }: { arc: any }) {
const [open, setOpen] = useState(true);
/** Détermine si un arc doit être ouvert par défaut */
function shouldArcBeOpen(arc: any): boolean {
if (!arc.zoneUnlocked) return false;
if (arc.completed) return false;
// Ouvert si au moins une quête est active ou prête à réclamer
return arc.quests.some((q: any) => q.playerStatus === 'active' || q.playerStatus === 'completed');
}
function ArcSection({ arc, defaultOpen }: { arc: any; defaultOpen: boolean }) {
const [open, setOpen] = useState(defaultOpen);
const { completed, total } = arc.progress;
const locked = !arc.zoneUnlocked;
const pct = total > 0 ? Math.floor((completed / total) * 100) : 0;
return (
<div className={`card ${locked ? '' : arc.completed ? '' : 'card-gold'}`} style={{ padding: '0.75rem 1rem', marginBottom: '0.5rem', opacity: locked ? 0.4 : 1 }}>
<div className={`card ${locked ? '' : arc.completed ? '' : 'card-gold'} py-3 px-4 mb-2 ${locked ? 'opacity-40' : ''}`}>
<div
style={{ display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer', marginBottom: open && !locked ? 8 : 0 }}
className={`flex items-center gap-2 cursor-pointer ${open && !locked ? 'mb-2' : ''}`}
onClick={() => setOpen(!open)}
>
{locked ? <Lock size={14} color="#6b7a99" /> : open ? <ChevronDown size={14} color="#6b7a99" /> : <ChevronRight size={14} color="#6b7a99" />}
<Scroll size={14} color={arc.completed ? '#3ddc84' : locked ? '#6b7a99' : '#f4c94e'} />
<span style={{ fontWeight: 700, fontSize: 14, color: arc.completed ? '#3ddc84' : locked ? '#6b7a99' : '#f4c94e', flex: 1 }}>
{locked ? <Lock size={14} className="text-rpg-muted shrink-0" /> : open ? <ChevronDown size={14} className="text-rpg-muted shrink-0" /> : <ChevronRight size={14} className="text-rpg-muted shrink-0" />}
<Scroll size={14} className={`shrink-0 ${arc.completed ? 'text-rpg-green' : locked ? 'text-rpg-muted' : 'text-rpg-gold'}`} />
<span className={`font-bold text-sm flex-1 ${arc.completed ? 'text-rpg-green' : locked ? 'text-rpg-muted' : 'text-rpg-gold'}`}>
{arc.name}
</span>
<span style={{ fontSize: 11, color: '#6b7a99' }}>{completed}/{total}</span>
{arc.completed && <CheckCircle size={14} color="#3ddc84" />}
{locked && <span style={{ fontSize: 10, color: '#6b7a99' }}>🔒 Complétez l'arc précédent</span>}
<span className="text-[11px] text-rpg-muted">{completed}/{total}</span>
{arc.completed && <CheckCircle size={14} className="text-rpg-green shrink-0" />}
{locked && <span className="text-[10px] text-rpg-muted">🔒 Complétez l'arc précédent</span>}
</div>
{/* Progress bar */}
{!locked && (
<div className="bar-track mb-2" style={{ height: 4 }}>
<div className={arc.completed ? 'bar-fill-hp' : 'bar-fill-xp'} style={{ width: `${pct}%`, background: arc.completed ? '#3ddc84' : undefined }} />
</div>
)}
{open && !locked && (
<>
<p style={{ fontSize: 11, color: '#6b7a99', margin: '0 0 8px', paddingLeft: 28 }}>{arc.description}</p>
<div style={{ display: 'flex', flexDirection: 'column', paddingLeft: 12 }}>
<p className="text-[11px] text-rpg-muted mb-2 pl-7">{arc.description}</p>
<div className="flex flex-col pl-3">
{arc.quests.map((q: any) => <ArcQuestRow key={q.id} q={q} />)}
</div>
</>
@@ -213,12 +216,21 @@ export function QuestPage() {
const { data: arcs } = useQuery({ queryKey: ['questArcs'], queryFn: questApi.arcs });
const [showAllCombat, setShowAllCombat] = useState(false);
if (loadActive || loadAvail) return <div style={{ padding: '2rem', color: '#6b7a99' }}>Chargement…</div>;
// Pré-calculer quels arcs sont ouverts par défaut (stable entre renders)
const arcDefaultOpen = useMemo(() => {
if (!arcs) return {};
const map: Record<string, boolean> = {};
for (const arc of arcs) {
map[arc.id] = shouldArcBeOpen(arc);
}
return map;
}, [arcs]);
if (loadActive || loadAvail) return <div className="p-8 text-rpg-muted">Chargement…</div>;
const isCraftQuest = (q: any) => ['forge_item', 'craft_item'].includes(q.objectiveType ?? q.quest?.objectiveType);
const isCombatQuest = (q: any) => !isCraftQuest(q);
// Split by category
const activeAll = active ?? [];
const activeCombat = activeAll.filter((pq: any) => !pq.quest.repeatable && isCombatQuest(pq));
const activeCraft = activeAll.filter((pq: any) => !pq.quest.repeatable && isCraftQuest(pq));
@@ -233,37 +245,36 @@ export function QuestPage() {
return (
<div>
<h2 style={{ margin: '0 0 1rem', color: '#f4c94e', fontSize: 20 }}>📜 Quêtes</h2>
<h2 className="mb-4 text-rpg-gold text-xl font-bold">📜 Quêtes</h2>
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
<div className="grid-2">
{/* Active combat quests */}
<div>
<p style={{ margin: '0 0 0.5rem', fontSize: 12, fontWeight: 700, color: '#6b7a99', textTransform: 'uppercase' }}>
<p className="mb-2 text-xs font-bold text-rpg-muted uppercase">
Quêtes actives ({activeCombat.length}/3)
</p>
{activeCombat.length > 0 ? (
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<div className="flex flex-col gap-1.5">
{activeCombat.map((pq: any) => <QuestCard key={pq.id} pq={pq} mode="active" />)}
</div>
) : (
<div className="card" style={{ padding: '1.5rem', textAlign: 'center', color: '#6b7a99', fontSize: 13 }}>
<div className="card py-6 text-center text-rpg-muted text-[13px]">
Aucune quête active — acceptez-en à droite
</div>
)}
</div>
{/* Available combat quests (staggered) */}
{/* Available combat quests */}
<div>
<p style={{ margin: '0 0 0.5rem', fontSize: 12, fontWeight: 700, color: '#6b7a99', textTransform: 'uppercase' }}>
<p className="mb-2 text-xs font-bold text-rpg-muted uppercase">
Quêtes de combat
</p>
{shownCombat.length > 0 ? (
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<div className="flex flex-col gap-1.5">
{shownCombat.map((q: any) => <QuestCard key={q.id} pq={q} mode="available" />)}
{hiddenCount > 0 && (
<button
className="btn btn-ghost"
style={{ width: '100%', fontSize: 11, padding: '0.3rem', marginTop: 2 }}
className="btn btn-ghost w-full text-[11px] py-1 mt-0.5"
onClick={() => setShowAllCombat(!showAllCombat)}
>
{showAllCombat ? 'Réduire' : `Voir tout (+${hiddenCount} quête${hiddenCount > 1 ? 's' : ''})`}
@@ -271,32 +282,28 @@ export function QuestPage() {
)}
</div>
) : (
<div className="card" style={{ padding: '1.5rem', textAlign: 'center', color: '#6b7a99', fontSize: 13 }}>
<div className="card py-6 text-center text-rpg-muted text-[13px]">
Toutes les quêtes de combat sont complétées
</div>
)}
</div>
</div>
{/* Métiers (craft/forge — hors pool, comme les dailies) */}
{/* Métiers */}
{(activeCraft.length > 0 || availableCraft.length > 0) && (
<div style={{ marginTop: '1.5rem' }}>
<p style={{ margin: '0 0 0.5rem', fontSize: 12, fontWeight: 700, color: '#6b7a99', textTransform: 'uppercase' }}>
🔨 Métiers
</p>
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 6 }}>
<div className="mt-6">
<p className="mb-2 text-xs font-bold text-rpg-muted uppercase">🔨 Métiers</p>
<div className="grid-2-cards">
{activeCraft.map((pq: any) => <QuestCard key={pq.id} pq={pq} mode="active" />)}
{availableCraft.map((q: any) => <QuestCard key={q.id} pq={q} mode="available" />)}
</div>
</div>
)}
{/* Tâches quotidiennes (répétables — toujours en fond) */}
<div style={{ marginTop: '1.5rem' }}>
<p style={{ margin: '0 0 0.5rem', fontSize: 12, fontWeight: 700, color: '#6b7a99', textTransform: 'uppercase' }}>
🔄 Tâches quotidiennes
</p>
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 6 }}>
{/* Tâches quotidiennes */}
<div className="mt-6">
<p className="mb-2 text-xs font-bold text-rpg-muted uppercase">🔄 Tâches quotidiennes</p>
<div className="grid-2-cards">
{activeDaily.map((pq: any) => <QuestCard key={pq.id} pq={pq} mode="active" />)}
{availableDaily.map((q: any) => <QuestCard key={q.id} pq={q} mode="available" />)}
</div>
@@ -304,11 +311,11 @@ export function QuestPage() {
{/* Arcs narratifs */}
{arcs && arcs.length > 0 && (
<div style={{ marginTop: '1.5rem' }}>
<p style={{ margin: '0 0 0.5rem', fontSize: 12, fontWeight: 700, color: '#6b7a99', textTransform: 'uppercase' }}>
📖 Arcs narratifs
</p>
{arcs.map((arc: any) => <ArcSection key={arc.id} arc={arc} />)}
<div className="mt-6">
<p className="mb-2 text-xs font-bold text-rpg-muted uppercase">📖 Arcs narratifs</p>
{arcs.map((arc: any) => (
<ArcSection key={arc.id} arc={arc} defaultOpen={arcDefaultOpen[arc.id] ?? false} />
))}
</div>
)}
</div>