Skip to content

Commit 90f3b65

Browse files
committed
Preloading assets
1 parent aa466b2 commit 90f3b65

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/layouts/BaseLayout.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ const { title } = Astro.props;
66
<head>
77
<meta charset="utf-8" />
88
<meta name="viewport" content="width=device-width" />
9+
<meta name="theme-color" content="#29303C" />
910
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
1011
<title>{title}</title>
12+
<!-- Preload logo assets so the fallback appears immediately and gears
13+
start decoding before the page finishes rendering everything else -->
14+
<link rel="preload" as="image" href="/images/logo_fallback.png" />
15+
<link rel="preload" as="image" href="/images/gears.webp" />
16+
<link rel="preload" as="image" href="/images/static.png" />
1117
</head>
1218
<body>
1319
<slot />

src/pages/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const paddedStamps = Array(copies).fill(stamps).flat();
3636
<!-- paddedStamps is the base set (repeated until ≥30 entries so it
3737
overflows the bar). Rendered twice total so the -50% trick loops
3838
seamlessly — at -50% you're exactly back to where you started. -->
39-
{paddedStamps.map(src => <img src={src} alt="" />)}
40-
{paddedStamps.map(src => <img src={src} alt="" />)}
39+
{paddedStamps.map(src => <img src={src} alt="" loading="lazy" decoding="async" />)}
40+
{paddedStamps.map(src => <img src={src} alt="" loading="lazy" decoding="async" />)}
4141
</div>
4242
</div>
4343
</div>

0 commit comments

Comments
 (0)