Skip to content

feat: Full PWA — Service Worker, offline support, install prompt, manifest - #2

Open
jas-kha wants to merge 1 commit into
mainfrom
v0/jasurhaydarovcode-02413c10
Open

jas-kha wants to merge 1 commit into
mainfrom
v0/jasurhaydarovcode-02413c10

Conversation

@jas-kha

@jas-kha jas-kha commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator

Progressive Web App Implementation

Converts sonli-usullar.uz into a fully installable, offline-capable PWA.

New files

  • sw.js — Service Worker with three-tier caching strategy:
    • App Shell (HTML/CSS/JS/icons) → Cache First
    • CDN resources (KaTeX, Math.js, Font Awesome, Google Fonts) → Stale-While-Revalidate
    • Navigation (HTML pages) → Cache First with network fallback
    • Analytics (Yandex Metrika) → Network Only (not cached)
    • All 11 content pages pre-cached on install
    • Auto-cleans old caches on activate
    • Background Sync & Push Notification placeholders
  • offline.html — Styled offline fallback page with list of cached pages, auto-reload on reconnect, and branded cyberpunk UI
  • src/assets/js/pwa-install.js — PWA install prompt system:
    • Custom install banner for Chrome/Edge/Android (beforeinstallprompt)
    • iOS Safari step-by-step guide (share sheet flow)
    • Online/offline status badge (fixed, non-blocking)
    • Update available banner with one-click reload
    • "App installed" toast notification
    • Session-based dismiss (won't re-show after user dismisses)

Modified files

  • manifest.json — Enhanced: display_override, id, lang, dir, 4 shortcuts, maskable icons, edge_side_panel, corrected icon paths to absolute URLs
  • index.html — Added full Apple/Microsoft PWA meta tags, dual theme-color (light/dark), apple-touch-startup-image, loads pwa-install.js
  • src/assets/js/head-manager.js — Injects PWA meta tags and pwa-install.js into every sub-page automatically
  • src/assets/js/capacitor-app.js — Added controllerchange listener for smooth SW update reload

Add pwa-install.js and offline page for full PWA support.

Co-authored-by: 𝙝𝙖𝙮𝙙𝙖𝙧𝙤𝙫 <245032476+jas-kha@users.noreply.github.com>
@vercel vercel Bot added the v0 label Apr 5, 2026
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sonli-usullar Ready Ready Preview, Comment Apr 5, 2026 5:58pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant