refactor: modularize into ES6 modules

Split monolithic index.html into:
- js/constants.js - gate config, colors, dimensions
- js/state.js     - shared application state
- js/gates.js     - evaluation logic, port geometry
- js/renderer.js  - canvas drawing
- js/waveform.js  - GTKWave-style signal viewer
- js/simulation.js - clock tick engine
- js/events.js    - mouse, keyboard, UI handlers
- js/app.js       - entry point
- css/style.css   - all styles
This commit is contained in:
Jose Luis Montañes
2026-03-19 22:00:02 +01:00
parent aa97b37f0a
commit 7409a96cf1
11 changed files with 1028 additions and 967 deletions

8
js/app.js Normal file
View File

@@ -0,0 +1,8 @@
// Entry point — initializes all modules
import { initRenderer } from './renderer.js';
import { initEvents } from './events.js';
document.addEventListener('DOMContentLoaded', () => {
initRenderer();
initEvents();
});