generated from nhcarrigan/template
feat: transform library into Progressive Web App (PWA)
Implements issue #52 - adds complete PWA functionality with offline support, installability, and app-like experience. PWA Features: - Installable on mobile devices and desktop - Offline support with smart caching strategies - App-like experience with standalone display mode - Full-screen mode and app icon on home screen - Install prompt with beautiful banner UI Manifest Configuration: - Created manifest.json with app metadata - App name: "Naomi's Library" - Theme colour: #9d4edd (witchy purple!) - Background colour: #1a1a2e (dark theme) - Display mode: standalone (app-like) - Icons: Multiple sizes specified (72-512px, maskable variants) - Categories: entertainment, lifestyle Service Worker Implementation: - Cache-first strategy for static assets (JS, CSS, fonts, images) - Network-first strategy for API requests with cache fallback - Network-first strategy for HTML pages with cache fallback - Cache versioning: library-v1 (static, dynamic, images) - Automatic cache cleanup on activation - Update checking every 60 seconds - Message handling for cache clearing and skipWaiting Offline Support: - Created offline.html fallback page with beautiful UI - Auto-retry when network comes back online - Purple gradient matching app theme - Informative messaging about offline state Install Prompt: - Created PwaInstallComponent with banner UI - Detects installability and shows prompt - "Install" and "Not Now" actions - Responsive design for mobile and desktop - Session storage for dismissal state - Animated slide-up entrance Services: - PwaService: Manages service worker registration, install prompts, cache clearing - Automatic initialization on app bootstrap - Signals for reactivity: isInstallable, isInstalled, promptEvent - Update detection and notification HTML Updates: - Added PWA meta tags (theme-color, description) - Linked manifest.json - Apple-specific meta tags for iOS support - Apple touch icon specified Build Configuration: - Updated project.json to include PWA assets - manifest.json, service-worker.js, offline.html copied to dist root Integration: - Added PwaService to app bootstrap - Integrated PwaInstallComponent in main app template - Install banner appears at bottom of screen - Dismissible with session storage Technical Notes: - Service worker uses efficient caching strategies per resource type - Handles Chrome extensions and non-HTTP protocols gracefully - Supports message-based cache clearing - Includes skipWaiting for immediate updates - Compatible with iOS, Android, and desktop PWA standards The library is now a fully-functional Progressive Web App that users can install on any device! The app works offline with cached content and provides an app-like experience with no browser UI in standalone mode. Note: App icons still need to be generated/provided (placeholder paths specified in manifest). ✨ This feature was built by Hikari~ 🌸
This commit is contained in:
@@ -5,7 +5,14 @@
|
||||
<title>Naomi's Library</title>
|
||||
<base href="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Naomi's curated collection of games, books, music, shows, manga, and art. Browse, engage, and suggest new additions!" />
|
||||
<meta name="theme-color" content="#9d4edd" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="apple-touch-icon" href="/assets/icons/icon-192x192.png" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Library" />
|
||||
<script defer src="https://analytics.nhcarrigan.com/js/pa-YUXAn1vhhRttySUAw_LMN.js"></script>
|
||||
<script>
|
||||
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
|
||||
|
||||
Reference in New Issue
Block a user