From 7e0dd8b686290c8e2262b858fd8489cad086934a Mon Sep 17 00:00:00 2001 From: posimai Date: Sat, 21 Mar 2026 13:37:40 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20initial=20Brief=20PWA=20=E2=80=94=20?= =?UTF-8?q?=E9=9F=B3=E5=A3=B0=E3=83=96=E3=83=AA=E3=83=BC=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 773 ++++++++++++++++++++++++++++++++++++++++++++++++++ manifest.json | 14 + package.json | 7 + sw.js | 25 ++ 4 files changed, 819 insertions(+) create mode 100644 index.html create mode 100644 manifest.json create mode 100644 package.json create mode 100644 sw.js 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)) + ); +});