40 lines
2.3 KiB
Markdown
40 lines
2.3 KiB
Markdown
# ascii PWA
|
||
|
||
A standalone, dependency-free ASCII art app. Rendering, copying and downloads
|
||
work entirely in the browser. After the first successful online visit, the
|
||
service worker caches the interface for offline use. Fonts are cached only when
|
||
selected; previously used fonts remain available offline. No Python, API, CDN,
|
||
package installation or build step is needed.
|
||
|
||
Run locally with `npm start` (or `node serve.mjs`), then open
|
||
`http://localhost:8080`. Run checks with `npm test`.
|
||
|
||
Deploy this directory to any HTTPS static host. The relative paths support both
|
||
an origin root and a subdirectory such as `/pwa/`. Serve `index.html`, `sw.js`
|
||
and the manifest with `Cache-Control: no-cache`. Serve `sw.js` as JavaScript.
|
||
The included development server applies these headers. Direct file opening
|
||
does not support service workers; use localhost or HTTPS.
|
||
|
||
The full font collection from FIGlet.js 1.8.2 is bundled locally, alongside the
|
||
original compact bitmap style. FIGlet.js handles rendering, with font-specific
|
||
character support and wrapping at 80 columns. Text is limited to 500 characters.
|
||
Text links use `?text=...&font=...`; lowercase font names in older links are also
|
||
accepted. Text renders automatically as you type or change fonts. Previous/next
|
||
buttons cycle through the collection, and the last selected font is remembered.
|
||
An explicit font in a shared link overrides the saved preference. The logo and
|
||
installed app launch open the homepage. Text is not saved or sent to a server.
|
||
|
||
English/Turkish and light/dark/system preferences are stored locally when
|
||
storage is available. Your supplied SVG is the favicon and logo, with vector
|
||
rendered PNG installation icons and separate maskable artwork.
|
||
|
||
When changing any shell asset, bump `VERSION` in `sw.js`. The new worker caches
|
||
the entire shell before offering an update. Accepting the update reloads open
|
||
clients; closing all existing app tabs also permits activation. Shell cleanup
|
||
only removes old versions for this app and installation scope. Previously used
|
||
fonts live in a separate cache pinned to the FIGlet.js version and survive shell
|
||
updates. A font you have never used needs a connection on its first selection.
|
||
|
||
Use the browser install action when available. On iOS, use Safari’s Share → Add
|
||
to Home Screen. Installation and device splash rendering need on-device checks.
|