fix #1: Dot spacing depends on prism length instead of hardcoded values

This commit is contained in:
2026-02-23 07:34:02 +05:30
parent 174c57f463
commit 8f1215f9d4

View File

@@ -119,9 +119,11 @@ export function RevolvingPrism() {
// Face is considered "Active" if it is within ~42 degrees of perfectly parallel
const isActive = Math.abs(normalized) < 42;
// Calculate staircase offset for dots and routing line
const dotY = 20 + index * 30;
const dy = index * 30; // Distance between the dot and the text
// Evenly space dots along the prism height
const prismHeight = 220;
const dotStep = prismHeight / (faces.length + 1);
const dotY = Math.round(dotStep * (index + 1));
const dy = Math.round(dotStep * index); // Distance between the dot and the text
return (
<div key={face.id} className={`prism-face prism-face-${index} ${isActive ? 'active' : ''}`}>