diff options
| author | Adam Soltys <[email protected]> | 2026-03-02 22:04:32 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-02 22:04:32 -0800 |
| commit | 0782781663b7f550eaae498ae3e430384afaf739 (patch) | |
| tree | 27db42dea69f486a9f097d9a9f355eb6f7d88ba0 | |
| parent | f73a6be565bace826404d470b8e8a8c1a25eb19e (diff) | |
| download | coinos-ui-0782781663b7f550eaae498ae3e430384afaf739.tar.gz coinos-ui-0782781663b7f550eaae498ae3e430384afaf739.zip | |
lighthouse improvements
| -rw-r--r-- | src/app.css | 3 | ||||
| -rw-r--r-- | src/app.html | 6 | ||||
| -rw-r--r-- | src/components/Image.svelte | 19 | ||||
| -rw-r--r-- | src/components/LandingHero.svelte | 2 | ||||
| -rw-r--r-- | src/components/LandingInfoCard.svelte | 5 | ||||
| -rw-r--r-- | src/components/LocaleSelector.svelte | 2 | ||||
| -rw-r--r-- | src/routes/+page.svelte | 12 | ||||
| -rw-r--r-- | static/fonts/Public_Sans/static/PublicSans-Regular.woff2 | bin | 0 -> 24300 bytes | |||
| -rw-r--r-- | static/images/adam.webp | bin | 11560 -> 2348 bytes | |||
| -rw-r--r-- | static/images/cole.webp | bin | 13340 -> 3270 bytes | |||
| -rw-r--r-- | static/images/customize.webp | bin | 81624 -> 32690 bytes | |||
| -rw-r--r-- | static/images/hero-image.webp | bin | 72000 -> 52420 bytes | |||
| -rw-r--r-- | static/images/lightning-qr.webp | bin | 80756 -> 33456 bytes | |||
| -rw-r--r-- | static/images/phone-checkout.webp | bin | 50980 -> 30164 bytes |
14 files changed, 38 insertions, 11 deletions
diff --git a/src/app.css b/src/app.css index 3ee2ca2a..14c5b032 100644 --- a/src/app.css +++ b/src/app.css @@ -38,7 +38,8 @@ @font-face { font-family: "PublicSans"; - src: url("/fonts/Public_Sans/static/PublicSans-Regular.ttf") format("truetype"); + src: url("/fonts/Public_Sans/static/PublicSans-Regular.woff2") format("woff2"); + font-display: swap; } :root { diff --git a/src/app.html b/src/app.html index e82ad055..42d00a9e 100644 --- a/src/app.html +++ b/src/app.html @@ -3,16 +3,14 @@ <head> <meta charset="utf-8" /> <link rel="icon" href="/favicon.ico" /> - <meta - name="viewport" - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" - /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="The easiest way to get started with bitcoin" /> <meta name="keywords" content="open source bitcoin lightning web wallet" /> <meta name="theme-color" content="#fff" /> <meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-status-bar-style" content="black-translucent" /> <link rel="apple-touch-icon" href="/images/icon-160.png" /> + <link rel="preload" href="/fonts/Public_Sans/static/PublicSans-Regular.woff2" as="font" type="font/woff2" crossorigin /> <link rel="manifest" href="/manifest.webmanifest" /> %sveltekit.head% <script> diff --git a/src/components/Image.svelte b/src/components/Image.svelte index d03c20c3..159a817f 100644 --- a/src/components/Image.svelte +++ b/src/components/Image.svelte @@ -1,5 +1,20 @@ <script lang="ts"> - let { image, style } = $props(); + let { image, style, loading = undefined, width = undefined, height = undefined, fetchpriority = undefined }: { + image: string; + style?: string; + loading?: "lazy" | "eager"; + width?: number; + height?: number; + fetchpriority?: "high" | "low" | "auto"; + } = $props(); </script> -<img src="/images/{image}.webp" alt={image} class={style} /> +<img + src="/images/{image}.webp" + alt={image} + class={style} + {loading} + {width} + {height} + {fetchpriority} +/> diff --git a/src/components/LandingHero.svelte b/src/components/LandingHero.svelte index 6e027e8d..2be86c98 100644 --- a/src/components/LandingHero.svelte +++ b/src/components/LandingHero.svelte @@ -37,7 +37,7 @@ </div> </div> - <Image image="hero-image" style="w-full md:w-2/3 max-w-5xl mx-auto mt-20" /> + <Image image="hero-image" style="w-full h-auto md:w-2/3 max-w-5xl mx-auto mt-20 aspect-[768/743]" width={768} height={743} fetchpriority="high" /> </div> <style> diff --git a/src/components/LandingInfoCard.svelte b/src/components/LandingInfoCard.svelte index d43e9956..e10a144b 100644 --- a/src/components/LandingInfoCard.svelte +++ b/src/components/LandingInfoCard.svelte @@ -2,12 +2,15 @@ import Image from "./Image.svelte"; import type { Snippet } from "svelte"; - let { image, title, description = undefined, order = undefined, children = undefined }: { image: string; title: string; description?: string; order?: string; children?: Snippet } = $props(); + let { image, title, description = undefined, order = undefined, loading = undefined, width = undefined, height = undefined, children = undefined }: { image: string; title: string; description?: string; order?: string; loading?: "lazy" | "eager"; width?: number; height?: number; children?: Snippet } = $props(); </script> <div class="flex flex-col-reverse lg:flex-row justify-center lg:gap-20 items-center"> <Image {image} + {loading} + {width} + {height} style="w-2/3 md:w-5/12 lg:w-2/5 xl:w-1/3 2xl:w-1/4 max-w-xl mx-auto lg:mx-0 mt-10 lg:mt-0 shrink-0 {order === 'reverse' && 'lg:order-last'}" /> diff --git a/src/components/LocaleSelector.svelte b/src/components/LocaleSelector.svelte index 6511eccd..135c8d79 100644 --- a/src/components/LocaleSelector.svelte +++ b/src/components/LocaleSelector.svelte @@ -13,7 +13,7 @@ }; </script> -<select name="language" bind:value={l} onchange={handleChange}> +<select name="language" aria-label="Language" bind:value={l} onchange={handleChange}> {#each $locales as locale} <option value={locale}>{$t(`lang.${locale}`)}</option> {/each} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f8c0d199..966ebdaf 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -24,6 +24,10 @@ ]; </script> +<svelte:head> + <link rel="preload" href="/images/hero-image.webp" as="image" type="image/webp" /> +</svelte:head> + <LandingHeader {howItWorks} {faq} {about} {user} /> <main class="space-y-20 md:space-y-40 py-20 md:py-32 lg:py-36 xl:py-40 px-5 md:px-0 pt-20"> @@ -32,9 +36,12 @@ image="lightning-qr" title={$t("landing.info1.title")} description={$t("landing.info1.description")} + loading="lazy" + width={640} + height={653} /> - <LandingInfoCard image="phone-checkout" title={$t("landing.info2.title")} order="reverse"> + <LandingInfoCard image="phone-checkout" title={$t("landing.info2.title")} order="reverse" loading="lazy" width={480} height={621}> {$t("landing.info2.description1")} <br /> <br /> @@ -49,6 +56,9 @@ image="customize" title={$t("landing.info3.title")} description={$t("landing.info3.description")} + loading="lazy" + width={640} + height={640} /> <div bind:this={howItWorks}></div> <div id="about"></div> diff --git a/static/fonts/Public_Sans/static/PublicSans-Regular.woff2 b/static/fonts/Public_Sans/static/PublicSans-Regular.woff2 Binary files differnew file mode 100644 index 00000000..4b6c16a8 --- /dev/null +++ b/static/fonts/Public_Sans/static/PublicSans-Regular.woff2 diff --git a/static/images/adam.webp b/static/images/adam.webp Binary files differindex 9b65a526..c730912e 100644 --- a/static/images/adam.webp +++ b/static/images/adam.webp diff --git a/static/images/cole.webp b/static/images/cole.webp Binary files differindex 8bdd741a..da5f1d78 100644 --- a/static/images/cole.webp +++ b/static/images/cole.webp diff --git a/static/images/customize.webp b/static/images/customize.webp Binary files differindex a5c9a37f..edb4d946 100644 --- a/static/images/customize.webp +++ b/static/images/customize.webp diff --git a/static/images/hero-image.webp b/static/images/hero-image.webp Binary files differindex c4dd22bd..30cd3dae 100644 --- a/static/images/hero-image.webp +++ b/static/images/hero-image.webp diff --git a/static/images/lightning-qr.webp b/static/images/lightning-qr.webp Binary files differindex 407c53da..bfd4173b 100644 --- a/static/images/lightning-qr.webp +++ b/static/images/lightning-qr.webp diff --git a/static/images/phone-checkout.webp b/static/images/phone-checkout.webp Binary files differindex 0d075c63..758431e6 100644 --- a/static/images/phone-checkout.webp +++ b/static/images/phone-checkout.webp |
