feat(pwa): dynamic theme-color meta tags + transparent/dark mode icons
All checks were successful
Build & Push Docker Image / test-and-build (push) Successful in 1m3s
- +layout.svelte: replace Svelte logo favicon with actual InstaChef icons; add two <meta name="theme-color"> tags with media queries so the browser chrome (mobile top bar) matches --bg for light (#FFF8F5) and dark (#110510); add <meta name="color-scheme" content="dark light"> - manifest.json: split 'any maskable' into separate 'any' and 'maskable' entries; maskable uses icon-512-maskable.png (icon with 10% safe-zone padding on gradient bg) - New icons: - icon-256/512.png → replaced with transparent-background versions - icon-256/512-transparent.png → white bg removed via flood-fill BFS - icon-256/512-dark.png → transparent icon on brand gradient (#833AB4→#E1306C) - icon-512-maskable.png → 80% icon centered on gradient (PWA maskable safe zone) - favicon-32.png → 32x32 transparent icon for browser tab - favicon.png (192×192) → updated to transparent InstaChef icon Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import favicon from '$lib/assets/favicon.svg';
|
||||
import InstallPrompt from './components/InstallPrompt.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import './layout.css';
|
||||
@@ -11,16 +10,20 @@
|
||||
if (!root) return;
|
||||
const mq = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
root.setAttribute('data-theme', mq.matches ? 'dark' : 'light');
|
||||
const handler = (e: MediaQueryListEvent) => {
|
||||
root.setAttribute('data-theme', e.matches ? 'dark' : 'light');
|
||||
};
|
||||
const handler = (e: MediaQueryListEvent) => root!.setAttribute('data-theme', e.matches ? 'dark' : 'light');
|
||||
mq.addEventListener('change', handler);
|
||||
return () => mq.removeEventListener('change', handler);
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="icon" href={favicon} />
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon.png" />
|
||||
<!-- Theme color: matches --bg in light/dark theme -->
|
||||
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#FFF8F5" />
|
||||
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#110510" />
|
||||
<meta name="color-scheme" content="dark light" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
|
||||
<link
|
||||
|
||||
BIN
static/favicon-32.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 42 KiB |
BIN
static/icon-256-dark.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
static/icon-256-transparent.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 65 KiB |
BIN
static/icon-512-dark.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
static/icon-512-maskable.png
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
static/icon-512-transparent.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 138 KiB |
@@ -11,13 +11,19 @@
|
||||
"src": "/favicon.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512-maskable.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"share_target": {
|
||||
|
||||