init geek calc
Some checks failed
Deploy to GitHub Pages / build-and-deploy (push) Has been cancelled

This commit is contained in:
2025-10-04 10:53:41 +08:00
commit 54f427ea21
45 changed files with 4878 additions and 0 deletions

26
app.js Normal file
View File

@@ -0,0 +1,26 @@
// Main application file for Geek Calculator
// Initialize the application when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
// Create instances of our calculator components
const calculator = new Calculator.Calculator();
const rpnCalculator = new RPNCalculator.RPNCalculator();
const stateManager = new StateManager.StateManager();
const uiController = new UIController.UIController(calculator, rpnCalculator, stateManager);
// Initialize the UI
uiController.init();
// Register service worker for offline capability if supported
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./service-worker.js')
.then(registration => {
console.log('ServiceWorker registration successful');
})
.catch(err => {
console.log('ServiceWorker registration failed', err);
});
});
}
});