init geek calc
Some checks failed
Deploy to GitHub Pages / build-and-deploy (push) Has been cancelled
Some checks failed
Deploy to GitHub Pages / build-and-deploy (push) Has been cancelled
This commit is contained in:
26
app.js
Normal file
26
app.js
Normal 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);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user