import { GameBox } from './core/GameBox.js'; const gameContainer = document.getElementById('gameContainer') || document.body; const gameBox = new GameBox({ aspectRatio: 16 / 9, backgroundColor: '#ffffff', borderColor: '#000000', element: gameContainer }); // 处理窗口关闭 window.addEventListener('beforeunload', () => { gameBox.destroy(); });