fix: auto-center viewport when puzzle level loads
Call handleCenterView after level load with a short delay to let the DOM settle, so modules are centered on screen on both mobile and desktop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,10 @@ export default function PuzzleView({ level, levelIndex, worldLevels, onBack, onN
|
||||
|
||||
useEffect(() => {
|
||||
loadLevel();
|
||||
// Center view on modules after level loads and DOM settles
|
||||
const timer = setTimeout(() => handleCenterView(), 100);
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
stopAudio();
|
||||
stopTarget();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user