Skip to content

Commit

Permalink
PWA for jscadui (#109)
Browse files Browse the repository at this point in the history
What is added:

* icons of differents sizes (192 needed for apple and 512 for android)
* jscadui.manifest, declaring the PWA
* meta tags in index.html to enable manifest, apple touch icon and
theme-color (needed for PWA)
  • Loading branch information
othelarian authored Jul 10, 2024
1 parent 49991b6 commit 79b8cda
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 4 deletions.
Binary file added apps/jscad-web/static/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/jscad-web/static/icon_192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/jscad-web/static/icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/jscad-web/static/icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/jscad-web/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="/favicon.png">
<meta name="theme-color" content="#fff">
<link rel="manifest" href="/jscadui.manifest">
<link rel="apple-touch-icon" href="/icon_192.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D CAD designs with JavaScript code.">
<meta name="keywords" content="jscad, openjscad, javascript, typescript, cad, svg, stl, obj, csg, 3mf, 3d-design, 2d-design">
Expand Down
17 changes: 17 additions & 0 deletions apps/jscad-web/static/jscadui.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name":"JSCADUI",
"display":"standalone",
"description":"Parametric CAD in JS",
"lang":"en",
"background_color":"#fff",
"theme_color":"#fff",
"start_url":"index.html",
"icons":[
{"src":"/favicon.png","sizes":"64x64","type":"image/png"},
{"src":"/icon_128.png","sizes":"128x128","type":"image/png"},
{"src":"/icon_192.png","sizes":"192x192","type":"image/png"},
{"src":"/icon_256.png","sizes":"256x256","type":"image/png","purpose":"maskable"},
{"src":"/icon_512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}
],
"scope":"/"
}
3 changes: 2 additions & 1 deletion apps/jscad-web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"allowJs": true,
"skipLibCheck": true,
"outDir": "build_dev",
"moduleResolution": "node16"
"moduleResolution": "node16",
"module": "node16"
},
"include":["src"],
"exclude": ["node_modules", "build_dev", "build", "dist","build.js","jscad"]
Expand Down
7 changes: 4 additions & 3 deletions packages/fs-serviceworker/fs-serviceworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ self.addEventListener('install', event => {
self.skipWaiting()
})

/** Create a client wrapper, or return one from cahce. It is important to know
* that cache can dissapear (likely due to browser suspending the worker when idle).
* page calling init will createa a cached instance, but if dev tools in chrome

/** Create a client wrapper, or return one from cache. It is important to know
* that cache can disappear (likely due to browser suspending the worker when idle).
* page calling init will create a cached instance, but if dev tools in chrome
* are nto open, after about 10 seconds, looks like cache is gone (likely worker got suspended)
*
* @param {string} clientId
Expand Down

0 comments on commit 79b8cda

Please sign in to comment.