Skip to content

Commit 702b60a

Browse files
committed
Update pinhole & panorama image for consistency with the framework
1 parent 739afe2 commit 702b60a

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

-1.45 MB
Binary file not shown.

public/spherical-image/pinhole.bin

0 Bytes
Binary file not shown.

src/assets/panorama.jpg

96.7 KB
Loading

src/assets/pinhole.png

0 Bytes
Loading

src/components/InteractiveFramework.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ interface Section {
2929
extra?: ReactNode;
3030
layout?: "horizontal" | "vertical";
3131
rightColumnWidth?: string;
32+
/** Zero-based index of the card shown on top by default. */
33+
defaultCard?: number;
3234
}
3335

3436
const iframeClass = "block h-full w-full rounded-xl border-0";
@@ -54,6 +56,7 @@ const sections: Section[] = [
5456
id: "planar-image",
5557
label: "Planar Image",
5658
region: { left: 0, width: 17 },
59+
defaultCard: 2,
5760
description: (
5861
<>
5962
Input images from <strong>any calibrated camera</strong> (pinhole,
@@ -114,6 +117,7 @@ const sections: Section[] = [
114117
id: "projection",
115118
label: "Projection",
116119
region: { left: 17, width: 15 },
120+
defaultCard: 2,
117121
description: (
118122
<>
119123
Projecting all pixels onto the unit sphere yields a{" "}
@@ -487,20 +491,22 @@ function CardDeck({
487491
sectionId,
488492
deckRef,
489493
fullWidth,
494+
defaultCard = 0,
490495
}: {
491496
cards: Card[];
492497
sectionId: string;
493498
deckRef?: RefObject<HTMLDivElement | null>;
494499
fullWidth?: boolean;
500+
defaultCard?: number;
495501
}) {
496-
const [frontIndex, setFrontIndex] = useState(0);
502+
const [frontIndex, setFrontIndex] = useState(defaultCard);
497503
const [anim, setAnim] = useState<"none" | "swipe-out" | "fly-in">("none");
498504
const animatingRef = useRef(false);
499505

500506
useEffect(() => {
501-
setFrontIndex(0); // eslint-disable-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect -- reset on section change
507+
setFrontIndex(defaultCard); // eslint-disable-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect -- reset on section change
502508
setAnim("none"); // eslint-disable-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
503-
}, [sectionId]);
509+
}, [sectionId, defaultCard]);
504510

505511
if (cards.length === 0) return null;
506512

@@ -1082,6 +1088,7 @@ export function InteractiveFramework() {
10821088
sectionId={displayedSection.id}
10831089
deckRef={deckElRef}
10841090
fullWidth
1091+
defaultCard={displayedSection.defaultCard}
10851092
/>
10861093
)}
10871094
</div>
@@ -1115,6 +1122,7 @@ export function InteractiveFramework() {
11151122
cards={displayedSection.cards}
11161123
sectionId={displayedSection.id}
11171124
deckRef={deckElRef}
1125+
defaultCard={displayedSection.defaultCard}
11181126
/>
11191127
</div>
11201128
) : (

0 commit comments

Comments
 (0)