@@ -17,8 +17,26 @@ import qdlPortsThree from '../assets/qdl-ports-three.svg'
1717import qdlPortsFour from '../assets/qdl-ports-four.svg'
1818import zadigCreateNewDevice from '../assets/zadig_create_new_device.png'
1919import zadigForm from '../assets/zadig_form.png'
20- import comma3XProduct from '../assets/comma3X.png'
21- import comma4Product from '../assets/four_screen_on.png'
20+ import comma3XProduct from '../assets/comma3X.webp'
21+ import comma4Product from '../assets/four_screen_on.webp'
22+
23+ // All images that need to be preloaded
24+ const preloadImages = [
25+ comma , bolt , cable , deviceExclamation , deviceQuestion , done , exclamation ,
26+ systemUpdate , qdlPortsThree , qdlPortsFour , zadigCreateNewDevice , zadigForm ,
27+ comma3XProduct , comma4Product
28+ ]
29+
30+ // Hidden preload component - renders all images offscreen so they're decoded and ready
31+ function ImagePreloader ( ) {
32+ return (
33+ < div style = { { position : 'absolute' , left : - 9999 , top : - 9999 , visibility : 'hidden' } } >
34+ { preloadImages . map ( ( src ) => (
35+ < img key = { src } src = { src } alt = "" />
36+ ) ) }
37+ </ div >
38+ )
39+ }
2240
2341
2442const steps = {
@@ -210,7 +228,7 @@ function LandingPage({ onStart }) {
210228 < div className = "text-center" >
211229 < h1 className = "text-4xl font-bold dark:text-white mb-4" > flash.comma.ai</ h1 >
212230 < p className = "text-xl text-gray-600 dark:text-gray-300 max-w-md" >
213- Restore your comma device back to a fresh factory state
231+ Restore your comma device to a fresh factory state
214232 </ p >
215233 </ div >
216234 < button
@@ -289,13 +307,13 @@ function ConnectInstructions({ deviceType, onNext }) {
289307 < div className = "wizard-screen flex flex-col items-center justify-center h-full gap-6 p-8" >
290308 < div className = "text-center" >
291309 < h2 className = "text-3xl font-bold dark:text-white mb-2" > Connect your device</ h2 >
292- < p className = "text-xl text-gray-600 dark:text-gray-300" > Follow these steps to put your device into QDL mode </ p >
310+ < p className = "text-xl text-gray-600 dark:text-gray-300" > Follow these steps to prepare your device for flashing </ p >
293311 </ div >
294312
295313 < div className = "flex flex-col md:flex-row gap-8 items-center" >
296314 < img
297315 src = { isCommaFour ? qdlPortsFour : qdlPortsThree }
298- alt = { isCommaFour ? "comma four ports" : "comma 3/ 3X ports" }
316+ alt = { isCommaFour ? "comma four ports" : "comma 3 and 3X ports" }
299317 className = "h-48 dark:invert"
300318 />
301319
@@ -422,8 +440,8 @@ function DevicePicker({ onSelect }) {
422440 : 'border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500'
423441 } `}
424442 >
425- < img src = { comma3XProduct } alt = "comma three or comma 3X" className = "h-32 object-contain" />
426- < span className = "text-xl font-semibold dark:text-white" > comma three < br /> comma 3X</ span >
443+ < img src = { comma3XProduct } alt = "comma 3 or comma 3X" className = "h-32 object-contain" />
444+ < span className = "text-xl font-semibold dark:text-white" > comma 3 < br /> comma 3X</ span >
427445 </ button >
428446
429447 < button
@@ -583,7 +601,12 @@ export default function Flash() {
583601
584602 // Render landing page
585603 if ( wizardScreen === 'landing' && ! error ) {
586- return < LandingPage onStart = { handleStart } />
604+ return (
605+ < >
606+ < ImagePreloader />
607+ < LandingPage onStart = { handleStart } />
608+ </ >
609+ )
587610 }
588611
589612 // Render device picker
0 commit comments