fix(levels): reduce scale factor variation to minimize margin differences

Changed scale factor formula to use a constrained range (1.5 to 3.0)
instead of the previous unbounded formula that allowed much wider variation.

Previous formula: Math.min(2.5, 20 / digits)
- 2 columns (10 Kyu): 2.5
- 30 columns (Dan): 0.67
- Ratio: ~3.7x difference

New formula: Math.max(1.5, Math.min(3.0, 20 / digits))
- 2 columns (10 Kyu): 3.0
- 30 columns (Dan): 1.5
- Ratio: 2.0x difference

This reduces the excessive margin around Dan level abacuses while still
providing appropriate scaling for different column counts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-20 09:06:38 -05:00
parent d6c28f7ede
commit abb647ce40

View File

@@ -126,8 +126,9 @@ export default function LevelsPage() {
const currentLevel = allLevels[currentIndex]
// Calculate scale factor based on number of columns to fit the page
// Smaller scale for more columns (Dan levels with 30 columns)
const scaleFactor = Math.min(2.5, 20 / currentLevel.digits)
// Use constrained range to prevent huge size differences between levels
// Min 1.5 (for 30-column Dan levels) to Max 3.0 (for 2-column Kyu levels)
const scaleFactor = Math.max(1.5, Math.min(3.0, 20 / currentLevel.digits))
// Animate scale factor with React Spring for smooth transitions
const animatedProps = useSpring({