Spaces:
Running
Running
File size: 5,827 Bytes
8800c81 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | import React from 'react';
import type { MapNode, MapTheme } from '../../types/mapTypes';
import { Trophy, CheckCircle2, RotateCcw, X, Sparkles } from 'lucide-react';
interface ExpeditionLogModalProps {
isOpen: boolean;
onClose: () => void;
nodes: MapNode[];
theme: MapTheme;
onReset: () => void;
}
export const ExpeditionLogModal: React.FC<ExpeditionLogModalProps> = ({
isOpen,
onClose,
nodes,
theme,
onReset,
}) => {
if (!isOpen) return null;
const isDark = theme.id !== 'parchment';
const totalCount = nodes.length;
return (
<div className="fixed inset-0 z-[120] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in select-none">
<div
id="expedition-complete-modal"
className={`relative w-full max-w-lg p-6 rounded-2xl border-2 shadow-2xl transition-all ${
isDark
? 'bg-[#1c1813] border-[#594634] text-[#f2e6d5]'
: 'bg-[#f7efe0] border-[#c8b28f] text-[#332415]'
}`}
>
{/* Close Button */}
<button
onClick={onClose}
className="absolute top-4 right-4 p-1.5 rounded-lg opacity-60 hover:opacity-100 hover:bg-black/10 cursor-pointer"
>
<X className="w-5 h-5" />
</button>
{/* Header with Trophy */}
<div className="text-center mb-6">
<div className="inline-flex p-3 rounded-2xl bg-amber-500/20 border border-amber-500/40 text-amber-500 mb-3 shadow-lg shadow-amber-500/20">
<Trophy className="w-10 h-10 animate-bounce" />
</div>
<h2 className="font-cinzel-dec font-bold text-2xl md:text-3xl text-amber-600 dark:text-amber-400">
Expedition Completed!
</h2>
<p className="font-garamond italic text-sm md:text-base opacity-80 mt-1">
All {totalCount} Waypoints and the entire ancient trail are now fully illuminated.
</p>
</div>
{/* Expedition Statistics Grid */}
<div className="grid grid-cols-3 gap-3 mb-6">
<div className="p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center">
<span className="block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300">{totalCount}</span>
<span className="font-garamond text-xs opacity-75">Nodes Solved</span>
</div>
<div className="p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center">
<span className="block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300">7</span>
<span className="font-garamond text-xs opacity-75">Biomes Crossed</span>
</div>
<div className="p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center">
<span className="block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300">1,620m</span>
<span className="font-garamond text-xs opacity-75">Peak Citadel</span>
</div>
</div>
{/* Trail Highlights */}
<div className="space-y-2 mb-6 max-h-48 overflow-y-auto custom-scrollbar pr-1">
{nodes.length > 0 && (
<div className="flex items-center gap-2 text-xs font-garamond">
<CheckCircle2 className="w-4 h-4 text-emerald-500 flex-shrink-0" />
<span className="font-bold">Waypoint 1:</span>
<span>{nodes[0].name}</span>
</div>
)}
{nodes.length > 25 && (
<div className="flex items-center gap-2 text-xs font-garamond">
<CheckCircle2 className="w-4 h-4 text-emerald-500 flex-shrink-0" />
<span className="font-bold">Waypoint 25:</span>
<span>{nodes[24].name}</span>
</div>
)}
{nodes.length > 50 && (
<div className="flex items-center gap-2 text-xs font-garamond">
<CheckCircle2 className="w-4 h-4 text-emerald-500 flex-shrink-0" />
<span className="font-bold">Waypoint 50:</span>
<span>{nodes[49].name}</span>
</div>
)}
{nodes.length > 75 && (
<div className="flex items-center gap-2 text-xs font-garamond">
<CheckCircle2 className="w-4 h-4 text-emerald-500 flex-shrink-0" />
<span className="font-bold">Waypoint 75:</span>
<span>{nodes[74].name}</span>
</div>
)}
{nodes.length > 0 && (
<div className="flex items-center gap-2 text-xs font-garamond">
<CheckCircle2 className="w-4 h-4 text-emerald-500 flex-shrink-0" />
<span className="font-bold">Final Milestone:</span>
<span className="text-amber-600 dark:text-amber-300 font-bold">{nodes[nodes.length - 1].name}</span>
</div>
)}
</div>
{/* Action Buttons */}
<div className="flex items-center justify-between gap-3">
<button
onClick={() => {
onReset();
onClose();
}}
className="flex-1 flex items-center justify-center gap-1.5 py-2.5 px-4 rounded-xl border border-stone-400 dark:border-stone-700 font-cinzel font-semibold text-xs transition-all hover:bg-stone-500/10 cursor-pointer"
>
<RotateCcw className="w-4 h-4" />
<span>Retrace From Start</span>
</button>
<button
onClick={onClose}
className="flex-1 flex items-center justify-center gap-1.5 py-2.5 px-4 rounded-xl bg-amber-600 hover:bg-amber-500 text-white font-cinzel font-bold text-xs shadow-lg transition-all cursor-pointer"
>
<Sparkles className="w-4 h-4" />
<span>Admire Map</span>
</button>
</div>
</div>
</div>
);
};
|