commit 7e0dd8b686290c8e2262b858fd8489cad086934a Author: posimai Date: Sat Mar 21 13:37:40 2026 +0900 feat: initial Brief PWA — 音声ブリーフィング diff --git a/index.html b/index.html new file mode 100644 index 0000000..df20cb0 --- /dev/null +++ b/index.html @@ -0,0 +1,773 @@ + + + + + + + + + + + + + + + + + + + Posimai Brief + + + + + + + + + + + + + + +
+ + +
+ + · + 読み込み中... +
+ + + ブラウザ音声 + + + +
+
+ + +
+ + +
記事を読み込んでいます
+
+ +
+ +
+ + + +
+ +
+ + +
+ + +
+ + + + +
+ + +
+ +
+ +
+ + + + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..4d0301f --- /dev/null +++ b/manifest.json @@ -0,0 +1,14 @@ +{ + "name": "Posimai Brief", + "short_name": "Brief", + "description": "音声ニュースブリーフィング", + "start_url": "/", + "display": "standalone", + "orientation": "portrait", + "background_color": "#0D0D0D", + "theme_color": "#0D0D0D", + "icons": [ + { "src": "/logo.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable" }, + { "src": "/logo.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" } + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..cc06b78 --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "posimai-brief", + "version": "1.0.0", + "scripts": { + "deploy": "git push gitea main && git push github main" + } +} diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..5628c9f --- /dev/null +++ b/sw.js @@ -0,0 +1,25 @@ +const CACHE = 'posimai-brief-v1'; +const ASSETS = ['/', '/index.html', '/manifest.json']; +const ORIGIN = self.location.origin; + +self.addEventListener('install', e => { + e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS))); + self.skipWaiting(); +}); + +self.addEventListener('activate', e => { + e.waitUntil( + caches.keys().then(keys => + Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k))) + ) + ); + self.clients.claim(); +}); + +self.addEventListener('fetch', e => { + // クロスオリジン(Feed API・server.js・open-meteo 等)はキャッシュしない + if (!e.request.url.startsWith(ORIGIN)) return; + e.respondWith( + caches.match(e.request).then(cached => cached || fetch(e.request)) + ); +});