sri-yantra 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/manifest.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "Sri Yantra",
3
+ "short_name": "Sri Yantra",
4
+ "description": "Sri Yantra generator: the nine interlocking triangles with their lotus petals, circles and gates, drawn to scale, colorable, and exportable as SVG or PNG.",
5
+ "start_url": "./",
6
+ "scope": "./",
7
+ "display": "standalone",
8
+ "background_color": "#1a212d",
9
+ "theme_color": "#1a212d",
10
+ "icons": [
11
+ {
12
+ "src": "icon-192.png",
13
+ "sizes": "192x192",
14
+ "type": "image/png",
15
+ "purpose": "any"
16
+ },
17
+ {
18
+ "src": "icon-512.png",
19
+ "sizes": "512x512",
20
+ "type": "image/png",
21
+ "purpose": "any maskable"
22
+ }
23
+ ]
24
+ }
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "sri-yantra",
3
+ "version": "1.0.0",
4
+ "description": "Sri Yantra generator: the nine interlocking triangles with their lotus petals, circles and gates, drawn to scale, colorable, and exportable as SVG or PNG.",
5
+ "repository": "github:evoluteur/sri-yantra",
6
+ "homepage": "https://evoluteur.github.io/sri-yantra/",
7
+ "copyright": "(c) 2026 Olivier Giulieri",
8
+ "author": "Olivier Giulieri (https://evoluteur.github.io/)",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "sri-yantra",
12
+ "shri-yantra",
13
+ "sri-chakra",
14
+ "yantra",
15
+ "sacred-geometry",
16
+ "triangles",
17
+ "lotus",
18
+ "tantra",
19
+ "meditation",
20
+ "generator",
21
+ "svg",
22
+ "esoterica",
23
+ "pwa",
24
+ "javascript"
25
+ ]
26
+ }
package/sri-yantra.png ADDED
Binary file
package/sw.js ADDED
@@ -0,0 +1,71 @@
1
+ const CACHE = "sri-yantra-v3";
2
+ const ASSETS = [
3
+ "./",
4
+ "index.html",
5
+ "about.html",
6
+ "css/about.css",
7
+ "css/common.css",
8
+ "css/core.css",
9
+ "css/densities.css",
10
+ "css/themes/dark/bg0.png",
11
+ "css/themes/dark/dark.css",
12
+ "css/themes/evol-blue/evol-blue.css",
13
+ "css/themes/evol-blue/spirals.png",
14
+ "css/themes/light/bg0.png",
15
+ "css/themes/light/light.css",
16
+ "css/yantra.css",
17
+ "favicon.png",
18
+ "icon-192.png",
19
+ "icon-512.png",
20
+ "js/omg.js",
21
+ "js/yantra-data.js",
22
+ "js/yantra.js",
23
+ "manifest.json",
24
+ ];
25
+
26
+ self.addEventListener("install", (e) => {
27
+ // "reload" bypasses the HTTP cache, so an update never caches stale files
28
+ e.waitUntil(
29
+ caches
30
+ .open(CACHE)
31
+ .then((c) => c.addAll(ASSETS.map((u) => new Request(u, { cache: "reload" })))),
32
+ );
33
+ self.skipWaiting();
34
+ });
35
+
36
+ self.addEventListener("activate", (e) => {
37
+ e.waitUntil(
38
+ caches
39
+ .keys()
40
+ .then((keys) =>
41
+ Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))),
42
+ ),
43
+ );
44
+ self.clients.claim();
45
+ });
46
+
47
+ self.addEventListener("fetch", (e) => {
48
+ const url = new URL(e.request.url);
49
+ const cacheable =
50
+ url.origin === location.origin ||
51
+ url.hostname === "fonts.googleapis.com" ||
52
+ url.hostname === "fonts.gstatic.com";
53
+ if (e.request.method !== "GET" || !cacheable) return;
54
+ e.respondWith(
55
+ caches.match(e.request).then(
56
+ (cached) =>
57
+ cached ||
58
+ fetch(e.request)
59
+ .then((res) => {
60
+ if (res.ok) {
61
+ const copy = res.clone();
62
+ caches.open(CACHE).then((c) => c.put(e.request, copy));
63
+ }
64
+ return res;
65
+ })
66
+ .catch(() =>
67
+ e.request.mode === "navigate" ? caches.match("index.html") : undefined,
68
+ ),
69
+ ),
70
+ );
71
+ });