+
+ fontSize: "12px", lineHeight: 1.4,
+ color: completed ? "#4a5568" : quest.url ? "#93c5fd" : "#e2e8f0",
+ textDecoration: completed ? "line-through" : quest.url ? "underline" : "none",
+ textDecorationColor: "rgba(147,197,253,0.4)",
+ cursor: quest.url ? "pointer" : "default",
+ wordBreak: "break-word",
+ }}
+ onClick={e => {
+ if (quest.url) { e.stopPropagation(); openUrl(quest.url); }
+ }}
+ >
{quest.name}
- {quest.url && (
- { e.stopPropagation(); openUrl(quest.url!); }}
- style={{
- fontSize: "10px", color: "#4a9eff", cursor: "pointer",
- opacity: 0.7, flexShrink: 0, lineHeight: 1,
- }}
- onMouseEnter={e => (e.currentTarget as HTMLElement).style.opacity = "1"}
- onMouseLeave={e => (e.currentTarget as HTMLElement).style.opacity = "0.7"}
- >
- 🔗
+ {quest.combat_indicators.map((ci, i) => (
+
+ {combatIcon(ci.combat_type)} x{ci.count}
- )}
+ ))}
- {quest.combat_indicators.length > 0 && (
-
- {quest.combat_indicators.map((ci, i) => (
-
- {ci.combat_type} {ci.count}
-
- ))}
-
- )}
{quest.note && (
-
+
→ {quest.note}
)}
@@ -236,13 +298,12 @@ function QuestRow({ quest, completed, onToggle, indent }: {
);
}
-function collectAllQuests(sections: import("../types").Section[] | undefined): string[] {
- if (!sections) return [];
+function collectAllQuests(sections: import("../types").Section[]): string[] {
const names: string[] = [];
for (const section of sections) {
for (const item of section.items) {
if (item.type === "Quest") names.push(item.name);
- else if (item.type === "Group") item.quests.forEach((q: import("../types").QuestItem) => names.push(q.name));
+ else if (item.type === "Group") item.quests.forEach((q: QuestItem) => names.push(q.name));
}
}
return names;
diff --git a/src/components/HomeView.tsx b/src/components/HomeView.tsx
index 985c9c6..beabde5 100644
--- a/src/components/HomeView.tsx
+++ b/src/components/HomeView.tsx
@@ -4,19 +4,17 @@ export default function HomeView() {
const { guides, openGuide, profiles, activeProfileId } = useStore();
const activeProfile = profiles.find(p => p.id === activeProfileId);
-
const totalQuests = guides.reduce((s, g) => s + g.total_quests, 0);
const totalCompleted = guides.reduce((s, g) => s + g.completed_quests, 0);
const globalPct = totalQuests > 0 ? Math.round((totalCompleted / totalQuests) * 100) : 0;
-
const completedGuides = guides.filter(g => g.total_quests > 0 && g.completed_quests === g.total_quests);
const inProgressGuides = guides.filter(g => g.completed_quests > 0 && g.completed_quests < g.total_quests);
return (
{/* Header */}
-
-
+
+
Tougli — Guide Dofus
{activeProfile && (
@@ -32,7 +30,7 @@ export default function HomeView() {
background: "#161b22", border: "1px solid #2d3748", borderRadius: "10px",
padding: "16px 20px", marginBottom: "24px",
}}>
-
+
Progression globale
{totalCompleted} / {totalQuests} quêtes ({globalPct}%)
@@ -45,7 +43,7 @@ export default function HomeView() {
borderRadius: "3px", transition: "width 0.4s ease",
}} />
-
+
@@ -53,12 +51,12 @@ export default function HomeView() {
)}
- {/* In progress first */}
+ {/* En cours */}
{inProgressGuides.length > 0 && (
)}
- {/* All guides grid */}
+ {/* Tous les guides */}
);
@@ -66,9 +64,9 @@ export default function HomeView() {
function Stat({ label, value, color }: { label: string; value: number; color: string }) {
return (
-
+
{value}
- {label}
+ {label}
);
}
@@ -80,13 +78,15 @@ function Section({ title, guides, onOpen }: {
}) {
return (
-
+
{title}
-
- {guides.map(guide =>
)}
+
+ {guides.map(g => )}
);
@@ -96,52 +96,63 @@ function GuideCard({ guide, onOpen }: {
guide: import("../types").GuideListItem;
onOpen: (gid: string) => void;
}) {
- const pct = guide.total_quests > 0
- ? Math.round((guide.completed_quests / guide.total_quests) * 100)
- : 0;
+ const pct = guide.total_quests > 0 ? Math.round((guide.completed_quests / guide.total_quests) * 100) : 0;
const isDone = pct === 100 && guide.total_quests > 0;
+ const inProgress = guide.completed_quests > 0 && !isDone;
+
+ const accentColor = isDone ? "#4ade80" : inProgress ? "#f0c040" : "#4a9eff";
return (