feat: upgrade bio panel design, clickable carousel cards, Escape navigation
- Widen layout (max-w-5xl), larger photo column - Fix place badge: clean pill instead of clipped diamond - Increase victory card text sizes for readability - Cards fill available width instead of fixed size - Move back button above photo - Add Escape key: closes lightbox or returns to gallery - Clicking inactive carousel photos scrolls to them Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ export function TeamCarousel({ members, activeIndex, onActiveChange }: TeamCarou
|
||||
const total = members.length;
|
||||
const [dragOffset, setDragOffset] = useState(0);
|
||||
const isDraggingRef = useRef(false);
|
||||
const wasDragRef = useRef(false);
|
||||
const pausedUntilRef = useRef(0);
|
||||
const dragStartRef = useRef<{ x: number; startIndex: number } | null>(null);
|
||||
|
||||
@@ -76,6 +77,7 @@ export function TeamCarousel({ members, activeIndex, onActiveChange }: TeamCarou
|
||||
(e: React.PointerEvent) => {
|
||||
(e.target as HTMLElement).setPointerCapture(e.pointerId);
|
||||
isDraggingRef.current = true;
|
||||
wasDragRef.current = false;
|
||||
dragStartRef.current = { x: e.clientX, startIndex: activeIndex };
|
||||
setDragOffset(0);
|
||||
},
|
||||
@@ -86,6 +88,7 @@ export function TeamCarousel({ members, activeIndex, onActiveChange }: TeamCarou
|
||||
(e: React.PointerEvent) => {
|
||||
if (!dragStartRef.current) return;
|
||||
const dx = e.clientX - dragStartRef.current.x;
|
||||
if (Math.abs(dx) > 10) wasDragRef.current = true;
|
||||
setDragOffset(dx);
|
||||
},
|
||||
[]
|
||||
@@ -194,7 +197,13 @@ export function TeamCarousel({ members, activeIndex, onActiveChange }: TeamCarou
|
||||
return (
|
||||
<div
|
||||
key={m.name}
|
||||
className={`absolute bottom-0 overflow-hidden rounded-2xl border pointer-events-none ${style.isCenter ? "team-card-glitter" : ""}`}
|
||||
onClick={() => {
|
||||
if (!style.isCenter && !wasDragRef.current) {
|
||||
onActiveChange(i);
|
||||
pausedUntilRef.current = Date.now() + PAUSE_MS;
|
||||
}
|
||||
}}
|
||||
className={`absolute bottom-0 overflow-hidden rounded-2xl border ${style.isCenter ? "team-card-glitter" : "cursor-pointer"} pointer-events-auto`}
|
||||
style={{
|
||||
width: style.width,
|
||||
height: style.height,
|
||||
|
||||
Reference in New Issue
Block a user