feat: handle window resize

This commit is contained in:
ktyl 2025-11-01 12:41:50 +00:00
parent 49b46798b8
commit 61a461bff8

View File

@ -239,6 +239,12 @@ function addTestPuzzle() {
//addPieceGrid();
addTestPuzzle();
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
// Animation loop
function animate() {
requestAnimationFrame(animate);