Auto-saves every 3 seconds and on page unload. Restores the full state (circuit, camera, custom components) on page load. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
677 B
JavaScript
23 lines
677 B
JavaScript
// Entry point — initializes all modules
|
|
import { initRenderer } from './renderer.js';
|
|
import { initEvents } from './events.js';
|
|
import { initPuzzleUI } from './puzzleUI.js';
|
|
import { loadFromStorage, startAutoSave } from './saveLoad.js';
|
|
import { updateComponentButtons } from './components.js';
|
|
import { evaluateAll } from './gates.js';
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
initRenderer();
|
|
initEvents();
|
|
initPuzzleUI();
|
|
|
|
// Restore previous session from localStorage
|
|
if (loadFromStorage()) {
|
|
updateComponentButtons();
|
|
evaluateAll();
|
|
}
|
|
|
|
// Auto-save every 3 seconds + on page unload
|
|
startAutoSave(3000);
|
|
});
|