Skip to content

Commit dc2f7cc

Browse files
author
Abhishek Choudhary
committed
PWA: installable app shell + share layer
Adds a web app manifest, an offline service worker, icons, an Open Graph card and the zshare state/share/install layer. The page body is unchanged; only the <head> gains a marked ZPWA block. Reason: pwa © 1993–2026 Abhishek Choudhary. All rights reserved.
1 parent e5262b7 commit dc2f7cc

9 files changed

Lines changed: 389 additions & 0 deletions

File tree

icon-192.png

1.06 KB
Loading

icon-512.png

3.12 KB
Loading

icon-maskable-512.png

2.69 KB
Loading

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@
1414
-->
1515
<html lang="en">
1616
<head>
17+
<!-- ZPWA:BEGIN -->
18+
<!-- Zistgah PWA + share layer. © 1993–2026 Abhishek Choudhary. All rights reserved. -->
19+
<link rel="manifest" href="manifest.webmanifest">
20+
<meta name="theme-color" content="#05070e">
21+
<link rel="apple-touch-icon" href="icon-192.png">
22+
<meta name="apple-mobile-web-app-capable" content="yes">
23+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
24+
<meta name="apple-mobile-web-app-title" content="CHAKRA">
25+
<meta name="mobile-web-app-capable" content="yes">
26+
<meta property="og:type" content="website">
27+
<meta property="og:site_name" content="Zistgah">
28+
<meta property="og:title" content="CHAKRA — Temporal Cycle Observatory">
29+
<meta property="og:description" content="One sky, many calendars. Drag the astrolabe to scrub time: ten calendar traditions, the live lagna, the Moon">
30+
<meta property="og:image" content="https://zistgah.org/chakra/og.png">
31+
<meta property="og:image:width" content="1200">
32+
<meta property="og:image:height" content="630">
33+
<meta property="og:url" content="https://zistgah.org/chakra/">
34+
<meta name="twitter:card" content="summary_large_image">
35+
<meta name="twitter:title" content="CHAKRA — Temporal Cycle Observatory">
36+
<meta name="twitter:description" content="One sky, many calendars. Drag the astrolabe to scrub time: ten calendar traditions, the live lagna, the Moon">
37+
<meta name="twitter:image" content="https://zistgah.org/chakra/og.png">
38+
<script src="zshare.js" defer></script>
39+
<script>window.addEventListener("DOMContentLoaded",function(){if(window.ZShare)window.ZShare.config("zshare.config.json");});</script>
40+
<!-- ZPWA:END -->
1741
<meta charset="utf-8">
1842
<meta name="viewport" content="width=device-width,initial-scale=1">
1943
<title>CHAKRA — Temporal Cycle Observatory</title>

manifest.webmanifest

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "CHAKRA — Temporal Cycle Observatory",
3+
"short_name": "CHAKRA",
4+
"description": "One sky, many calendars. Drag the astrolabe to scrub time: ten calendar traditions, the live lagna, the Moon",
5+
"id": "/chakra/",
6+
"start_url": "./index.html",
7+
"scope": "./",
8+
"display": "standalone",
9+
"orientation": "any",
10+
"background_color": "#05070e",
11+
"theme_color": "#05070e",
12+
"categories": [
13+
"education",
14+
"utilities"
15+
],
16+
"icons": [
17+
{
18+
"src": "icon-192.png",
19+
"sizes": "192x192",
20+
"type": "image/png",
21+
"purpose": "any"
22+
},
23+
{
24+
"src": "icon-512.png",
25+
"sizes": "512x512",
26+
"type": "image/png",
27+
"purpose": "any"
28+
},
29+
{
30+
"src": "icon-maskable-512.png",
31+
"sizes": "512x512",
32+
"type": "image/png",
33+
"purpose": "maskable"
34+
}
35+
]
36+
}

og.png

8.69 KB
Loading

sw.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* CHAKRA — Temporal Cycle Observatory service worker — © 1993–2026 Abhishek Choudhary · AyeAI
2+
Cache-first for the shell so the portal opens offline, installed outside any store. */
3+
/* PWA-MOD */ const START = './index.html';
4+
/* PWA-MOD */ const CACHE = 'chakra-v1';
5+
/* PWA-MOD */ const SHELL = [
6+
'./index.html',
7+
'./manifest.webmanifest',
8+
'./icon-192.png',
9+
'./icon-512.png',
10+
'./icon-maskable-512.png'
11+
];
12+
self.addEventListener('install', e => {
13+
self.skipWaiting();
14+
e.waitUntil(caches.open(CACHE).then(c => c.addAll(SHELL)).catch(()=>{}));
15+
});
16+
self.addEventListener('activate', e => {
17+
e.waitUntil(
18+
caches.keys().then(ks => Promise.all(ks.filter(k => k !== CACHE).map(k => caches.delete(k))))
19+
.then(() => self.clients.claim())
20+
);
21+
});
22+
self.addEventListener('fetch', e => {
23+
if (e.request.method !== 'GET') return;
24+
/* PWA-MOD: navigations are network-first so a fresh push is never masked by a stale shell */
25+
if (e.request.mode === 'navigate') {
26+
e.respondWith(fetch(e.request).then(res => {
27+
const copy = res.clone();
28+
caches.open(CACHE).then(c => c.put(e.request, copy)).catch(()=>{});
29+
return res;
30+
}).catch(() => caches.match(e.request).then(h => h || caches.match(START))));
31+
return;
32+
}
33+
e.respondWith(
34+
caches.match(e.request).then(hit => hit || fetch(e.request).then(res => {
35+
// runtime-cache same-origin GETs so the whole portal survives going offline
36+
if (res && res.status === 200 && new URL(e.request.url).origin === location.origin) {
37+
const copy = res.clone();
38+
caches.open(CACHE).then(c => c.put(e.request, copy)).catch(()=>{});
39+
}
40+
return res;
41+
}).catch(() => caches.match(START)))
42+
);
43+
});

zshare.config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"_copyright": "© 1993–2026 Abhishek Choudhary. All rights reserved.",
3+
"title": "CHAKRA — Temporal Cycle Observatory",
4+
"short": "CHAKRA",
5+
"text": "One sky, many calendars. Drag the astrolabe to scrub time: ten calendar traditions, the live lagna, the Moon",
6+
"bg": "#05070e",
7+
"fg": "#d8a94e",
8+
"hashKey": "s",
9+
"sw": "sw.js",
10+
"whatsapp": true,
11+
"card": true,
12+
"stamp": true,
13+
"installHint": true
14+
}

0 commit comments

Comments
 (0)