feat(pwa): complete PWA configuration
- Generate PWA icons in multiple sizes (72-512px) - Create favicon.svg with app branding - Add offline.html fallback page - Update app.html with PWA meta tags - Add theme-color and apple-touch-icon - Configure viewport-fit for mobile notches - PWA manifest already configured in vite.config.js - Service worker caching already configured
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Generate PWA icons from SVG using ImageMagick (if available)
|
||||||
|
# Otherwise, create placeholder text files
|
||||||
|
|
||||||
|
SIZES=(72 96 128 144 152 192 384 512)
|
||||||
|
ICON_DIR="static/icons"
|
||||||
|
|
||||||
|
mkdir -p "$ICON_DIR"
|
||||||
|
|
||||||
|
if command -v convert &> /dev/null; then
|
||||||
|
echo "Generating icons with ImageMagick..."
|
||||||
|
for size in "${SIZES[@]}"; do
|
||||||
|
convert -background "#4f46e5" -fill white -font Arial-Bold \
|
||||||
|
-size ${size}x${size} -gravity center \
|
||||||
|
label:O "$ICON_DIR/icon-$size.png"
|
||||||
|
echo "Created icon-$size.png"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "ImageMagick not found. Creating placeholder icon files..."
|
||||||
|
for size in "${SIZES[@]}"; do
|
||||||
|
echo "Placeholder $size x $size icon" > "$ICON_DIR/icon-$size.png"
|
||||||
|
done
|
||||||
|
echo "Note: Install ImageMagick and re-run to generate real icons"
|
||||||
|
fi
|
||||||
@@ -2,7 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||||
|
<meta name="description" content="Mobile-first task management with offline support" />
|
||||||
|
<meta name="theme-color" content="#4f46e5" />
|
||||||
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||||
|
<link rel="apple-touch-icon" href="/icons/icon-192.png" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||||
|
<rect width="32" height="32" rx="6" fill="#4f46e5"/>
|
||||||
|
<text x="16" y="24" font-family="Arial" font-size="20" font-weight="bold" fill="white" text-anchor="middle">O</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 997 B |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,76 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>Offline - Opal Task Manager</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
color: #111827;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 4rem;
|
||||||
|
height: 4rem;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
color: #6b7280;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
color: #111827;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #6b7280;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.retry-btn {
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
background-color: #4f46e5;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.retry-btn:hover {
|
||||||
|
background-color: #4338ca;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<path d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
<h1>You're Offline</h1>
|
||||||
|
<p>It looks like you've lost your internet connection. Please check your connection and try again.</p>
|
||||||
|
<button class="retry-btn" onclick="window.location.reload()">Retry</button>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||