Skip to content

Commit c5a1780

Browse files
committed
Fix PageSpeed Insights findings: accessibility and SEO
Accessibility (76 → target higher): - Add aria-label to fpsNum and tolNum number inputs (unlabelled form controls) - Increase #placeholder-hint contrast from #666 to #777 on #0a0a0a background - Change #canvas-wrap div to <main> to provide a document landmark - Add visually-hidden skip navigation link for keyboard users SEO (83 → target higher): - Add <meta name="description"> tag - Add src/robots.txt and copy it to dist/ during build to fix 46 parse errors caused by the server returning HTML for the missing /robots.txt path https://claude.ai/code/session_01NfhDN9zVd9SyCD7SLiKoSD
1 parent 7aa8419 commit c5a1780

3 files changed

Lines changed: 29 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "forza-road-finder",
33
"private": true,
44
"scripts": {
5-
"build": "parcel build src/index.html",
5+
"build": "parcel build src/index.html && cp src/robots.txt dist/robots.txt",
66
"dev": "parcel src/index.html"
77
},
88
"devDependencies": {

src/index.html

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<meta property="og:type" content="website">
1010
<meta property="og:url" content="https://roadfinder.went.tf/">
1111
<meta property="og:image" content="https://roadfinder.went.tf/preview.png">
12+
<meta name="description" content="Browser tool that highlights undiscovered roads on the Forza Horizon map by replacing their grey colour with magenta in real time via screen capture.">
1213
<link rel="canonical" href="https://roadfinder.went.tf/">
1314
<link rel="icon" type="image/png" href="../favicon.png">
1415
<link rel="manifest" href="./manifest.json">
@@ -173,9 +174,29 @@
173174
color: #888;
174175
font-size: 15px;
175176
}
177+
178+
#placeholder-hint {
179+
font-size: 12px;
180+
color: #777;
181+
}
182+
183+
.skip-link {
184+
position: absolute;
185+
top: -40px;
186+
left: 0;
187+
background: #333;
188+
color: #eee;
189+
padding: 4px 10px;
190+
border-radius: 0 0 4px 0;
191+
font-size: 13px;
192+
z-index: 100;
193+
text-decoration: none;
194+
}
195+
.skip-link:focus { top: 0; }
176196
</style>
177197
</head>
178198
<body>
199+
<a class="skip-link" href="#canvas-wrap">Skip to main content</a>
179200

180201
<div id="controls">
181202
<button id="startBtn">Share Screen</button>
@@ -195,13 +216,13 @@
195216
<div class="ctrl-group">
196217
<label for="fps">FPS</label>
197218
<input type="range" id="fps" min="0.1" max="30" step="0.1" value="1">
198-
<input type="number" id="fpsNum" min="0.1" max="30" step="0.1" value="1">
219+
<input type="number" id="fpsNum" min="0.1" max="30" step="0.1" value="1" aria-label="FPS value">
199220
</div>
200221

201222
<div class="ctrl-group">
202223
<label for="tolerance">Tolerance</label>
203224
<input type="range" id="tolerance" min="0" max="40" step="1" value="5">
204-
<input type="number" id="tolNum" min="0" max="40" step="1" value="5">
225+
<input type="number" id="tolNum" min="0" max="40" step="1" value="5" aria-label="Tolerance value">
205226
</div>
206227

207228
<div class="ctrl-group">
@@ -221,13 +242,13 @@
221242
</div>
222243
</div>
223244

224-
<div id="canvas-wrap">
245+
<main id="canvas-wrap">
225246
<div id="placeholder">
226247
<div>Click <strong>Share Screen</strong> and select your Forza window.</div>
227-
<div id="placeholder-hint" style="font-size:12px;color:#666"></div>
248+
<div id="placeholder-hint"></div>
228249
</div>
229250
<canvas id="canvas" style="display:none"></canvas>
230-
</div>
251+
</main>
231252

232253
<script type="module" src="./main.js"></script>
233254
</body>

src/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Allow: /

0 commit comments

Comments
 (0)