diff --git a/apps.js b/apps.js index 6da3b43..a3e1c8e 100644 --- a/apps.js +++ b/apps.js @@ -62,7 +62,7 @@ createSoundToggleButton(); // Load data from localStorage or use defaults function loadData() { - const savedData = localStorage.getItem('chessTimerData'); + const savedData = localStorage.getItem('gameTimerData'); if (savedData) { const parsedData = JSON.parse(savedData); players = parsedData.players; @@ -87,7 +87,7 @@ function saveData() { gameState, currentPlayerIndex }; - localStorage.setItem('chessTimerData', JSON.stringify(dataToSave)); + localStorage.setItem('gameTimerData', JSON.stringify(dataToSave)); } // Render players to carousel diff --git a/audio.js b/audio.js index 190ebe6..8c951e8 100644 --- a/audio.js +++ b/audio.js @@ -14,7 +14,7 @@ const audioManager = { this.audioContext = new (window.AudioContext || window.webkitAudioContext)(); // Check for saved mute preference - const savedMute = localStorage.getItem('chessTimerMuted'); + const savedMute = localStorage.getItem('gameTimerMuted'); this.muted = savedMute === 'true'; // Create all the sounds @@ -270,7 +270,7 @@ const audioManager = { // Toggle mute state toggleMute() { this.muted = !this.muted; - localStorage.setItem('chessTimerMuted', this.muted); + localStorage.setItem('gameTimerMuted', this.muted); return this.muted; }, diff --git a/android-chrome-192x192.png b/icons/android-chrome-192x192.png similarity index 100% rename from android-chrome-192x192.png rename to icons/android-chrome-192x192.png diff --git a/android-chrome-512x512.png b/icons/android-chrome-512x512.png similarity index 100% rename from android-chrome-512x512.png rename to icons/android-chrome-512x512.png diff --git a/apple-touch-icon.png b/icons/apple-touch-icon.png similarity index 100% rename from apple-touch-icon.png rename to icons/apple-touch-icon.png diff --git a/favicon-16x16.png b/icons/favicon-16x16.png similarity index 100% rename from favicon-16x16.png rename to icons/favicon-16x16.png diff --git a/favicon-32x32.png b/icons/favicon-32x32.png similarity index 100% rename from favicon-32x32.png rename to icons/favicon-32x32.png diff --git a/index.html b/index.html index dd3e1c5..f9bbce1 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Multi-Player Chess Timer + Game Timer @@ -85,5 +85,12 @@ + \ No newline at end of file diff --git a/manifest.json b/manifest.json index e32f42b..0d3d771 100644 --- a/manifest.json +++ b/manifest.json @@ -1,38 +1,49 @@ { - "name": "Chess Timer PWA", - "short_name": "Chess Timer", - "description": "Multi-player chess timer with carousel navigation", - "start_url": "/", + "name": "Game Timer PWA", + "short_name": "Game Timer", + "description": "Multi-player chess-like timer with carousel navigation", + "start_url": "/index.html", "display": "standalone", "background_color": "#f5f5f5", "theme_color": "#2c3e50", "icons": [ { - "src": "android-chrome-192x192.png", + "src": "/icons/android-chrome-192x192.png", "sizes": "192x192", - "type": "image/png", - "purpose": "any maskable" + "type": "image/png" }, { - "src": "android-chrome-512x512.png", + "src": "/icons/android-chrome-512x512.png", "sizes": "512x512", - "type": "image/png", - "purpose": "any maskable" + "type": "image/png" }, { - "src": "apple-touch-icon.png", + "src": "/icons/apple-touch-icon.png", "sizes": "180x180", "type": "image/png" }, { - "src": "favicon-32x32.png", + "src": "/icons/favicon-32x32.png", "sizes": "32x32", "type": "image/png" }, { - "src": "favicon-16x16.png", + "src": "/icons/favicon-16x16.png", "sizes": "16x16", "type": "image/png" } + ], + "screenshots": [ + { + "src": "/screenshots/screenshot1.png", + "sizes": "1302x1122", + "type": "image/png", + "form_factor": "wide" + }, + { + "src": "/screenshots/screenshot2.png", + "sizes": "1082x2402", + "type": "image/png" + } ] } \ No newline at end of file diff --git a/screenshots/screenshot1.png b/screenshots/screenshot1.png new file mode 100644 index 0000000..d140301 Binary files /dev/null and b/screenshots/screenshot1.png differ diff --git a/screenshots/screenshot2.png b/screenshots/screenshot2.png new file mode 100644 index 0000000..dbd3c9d Binary files /dev/null and b/screenshots/screenshot2.png differ diff --git a/site.webmanifest b/site.webmanifest index e2cf762..3d5fa34 100644 --- a/site.webmanifest +++ b/site.webmanifest @@ -3,12 +3,12 @@ "short_name": "Game Timer", "icons": [ { - "src": "/android-chrome-192x192.png", + "src": "/icons/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, { - "src": "/android-chrome-512x512.png", + "src": "/icons/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } diff --git a/sw.js b/sw.js index 92ef7a8..273a818 100644 --- a/sw.js +++ b/sw.js @@ -1,11 +1,19 @@ // Updated service worker code - sw.js -const CACHE_NAME = 'chess-timer-cache-v1'; +const CACHE_NAME = 'timer-cache-v1'; const urlsToCache = [ '/', '/index.html', '/styles.css', - '/script.js' - // Only include files that you're sure exist + '/apps.js', + '/audio.js', + '/icons/android-chrome-192x192.png', + '/icons/android-chrome-512x512.png', + '/icons/apple-touch-icon.png', + '/icons/favicon-32x32.png', + '/icons/favicon-16x16.png', + '/favicon.ico', + '/manifest.json', + '/site.webmanifest' ]; self.addEventListener('install', event => {