Skip to content

Commit de9fefb

Browse files
authored
Improve Lighthouse LCP and accessibility scores (#23)
Preload the LCP image (install.webp) from the HTML and add fetchpriority="high" so the browser discovers it before JS executes. Use a <main> landmark for the primary content container to satisfy the "document has a main landmark" accessibility audit.
1 parent a85e2ab commit de9fefb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<link rel="manifest" href="manifest.json">
2828
<link rel="icon" type="image/png" href="favicon.png">
2929
<link rel="canonical" href="https://isle.pizza">
30+
<link rel="preload" as="image" href="/images/install.webp" fetchpriority="high">
3031
<style>
3132
body { margin: 0; background-color: #000000; }
3233
#app:empty { visibility: hidden; }

src/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
<UpdatePopup />
127127
<ConfigToast />
128128
129-
<div id="main-container">
129+
<main id="main-container">
130130
<div class="page-wrapper" class:active={$currentPage === 'main'}>
131131
<TopContent />
132132
<Controls />
@@ -156,7 +156,7 @@
156156
<p><strong>DEVELOPMENT MODE</strong></p>
157157
{/if}
158158
</div>
159-
</div>
159+
</main>
160160
161161
<CanvasWrapper />
162162

src/lib/TopContent.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
<div id="top-content">
7070
<div class="video-container">
71-
<img id="install-video" width="260" height="260" src="images/install.webp" alt="Install Game">
71+
<img id="install-video" width="300" height="300" fetchpriority="high" src="images/install.webp" alt="Install Game">
7272
<span
7373
id="sound-toggle-emoji"
7474
title={$soundEnabled ? 'Pause Audio' : 'Play Audio'}

0 commit comments

Comments
 (0)