feat: add PWA support with service worker and update prompt

- Updated package.json to include vite-plugin-pwa and workbox-window.
- Added icon SVGs for PWA: icon-512.svg and maskable-512.svg.
- Created a manifest.json for PWA configuration.
- Implemented PwaUpdatePrompt component to notify users of available updates.
- Enhanced CookieConsent and SiteAssistant components for better layout and responsiveness.
- Updated global CSS for safe-area insets and mobile-first enhancements.
- Registered service worker in usePwaRegistration hook for managing updates.
- Modified Vite configuration to integrate PWA features and caching strategies.
This commit is contained in:
Your Name
2026-04-06 08:12:32 +02:00
parent c483e8508b
commit a539ad43af
23 changed files with 4393 additions and 28 deletions

View File

@@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="512" y2="512" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#4F46E5"/>
<stop offset="100%" stop-color="#7C3AED"/>
</linearGradient>
</defs>
<rect width="512" height="512" rx="112" fill="url(#bg)"/>
<path d="M160 128h112l80 80v176a16 16 0 0 1-16 16H160a16 16 0 0 1-16-16V144a16 16 0 0 1 16-16z" fill="rgba(255,255,255,0.15)" stroke="#fff" stroke-width="16"/>
<path d="M272 128v64a16 16 0 0 0 16 16h64" stroke="#fff" stroke-width="16" fill="none"/>
<path d="M192 256h128M192 296h96M192 336h64" stroke="#93C5FD" stroke-width="14" stroke-linecap="round"/>
<text x="312" y="432" font-family="Arial,Helvetica,sans-serif" font-weight="700" font-size="128" fill="#E0E7FF" opacity="0.6">D</text>
</svg>

After

Width:  |  Height:  |  Size: 868 B

View File

@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
<!-- Maskable icon: safe zone is central 80% (409.6px), so content fits within ~51-461 -->
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="512" y2="512" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#4F46E5"/>
<stop offset="100%" stop-color="#7C3AED"/>
</linearGradient>
</defs>
<!-- Full bleed background -->
<rect width="512" height="512" fill="url(#bg)"/>
<!-- Content centered within safe zone -->
<path d="M176 144h96l72 72v160a14 14 0 0 1-14 14H176a14 14 0 0 1-14-14V158a14 14 0 0 1 14-14z" fill="rgba(255,255,255,0.15)" stroke="#fff" stroke-width="14"/>
<path d="M272 144v56a14 14 0 0 0 14 14h56" stroke="#fff" stroke-width="14" fill="none"/>
<path d="M204 264h112M204 300h84M204 336h56" stroke="#93C5FD" stroke-width="12" stroke-linecap="round"/>
<text x="296" y="416" font-family="Arial,Helvetica,sans-serif" font-weight="700" font-size="112" fill="#E0E7FF" opacity="0.6">D</text>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,57 @@
{
"name": "Dociva — Free Online File Tools",
"short_name": "Dociva",
"description": "30+ free tools: merge, split, compress, convert PDFs, images, videos & text. No signup required.",
"start_url": "/",
"id": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#2563eb",
"orientation": "any",
"scope": "/",
"categories": ["productivity", "utilities"],
"dir": "auto",
"lang": "en",
"prefer_related_applications": false,
"icons": [
{
"src": "/favicon.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any"
},
{
"src": "/icons/icon-512.svg",
"sizes": "512x512",
"type": "image/svg+xml",
"purpose": "any"
},
{
"src": "/icons/maskable-512.svg",
"sizes": "512x512",
"type": "image/svg+xml",
"purpose": "maskable"
}
],
"screenshots": [],
"shortcuts": [
{
"name": "Compress PDF",
"short_name": "Compress",
"url": "/compress-pdf",
"icons": [{ "src": "/favicon.svg", "sizes": "any", "type": "image/svg+xml" }]
},
{
"name": "Merge PDF",
"short_name": "Merge",
"url": "/merge-pdf",
"icons": [{ "src": "/favicon.svg", "sizes": "any", "type": "image/svg+xml" }]
},
{
"name": "Convert to PDF",
"short_name": "Convert",
"url": "/image-to-pdf",
"icons": [{ "src": "/favicon.svg", "sizes": "any", "type": "image/svg+xml" }]
}
]
}