File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 trackClick ,
1717 } from " $lib/helpers.js" ;
1818 import { browser } from " $app/environment" ;
19+ import { ReplicaModificationsStatus } from " @aws-sdk/client-s3" ;
1920
2021 let game: Game | null = $state (null );
2122 let adblock = $state (false );
329330 } else {
330331 adContinued = true ;
331332 }
333+
334+ if (iframe ) {
335+ iframe .focus ();
336+ refocus ();
337+ } else {
338+ setTimeout (() => {
339+ iframe ?.focus ();
340+ refocus ();
341+ }, 3000 ); // try to wait 3 seconds before focusing again
342+ }
343+
344+ let tries = 0 ;
345+ function refocus() {
346+ setTimeout (() => {
347+ if (iframe ) {
348+ iframe .blur ();
349+ iframe .focus ();
350+ } else {
351+ if (++ tries < 4 ) {
352+ // Allow 12 seconds of DOM freeze
353+ refocus ();
354+ }
355+ }
356+ }, 3000 );
357+ }
332358 }
333359 </script >
334360
381407 alt ={` Cover art for ${game .fName } ` }
382408 src ="https://cdn.jsdelivr.net/gh/ccported/games@ {commitHash }/ {game .gameID }{game .thumbPath }"
383409 />
384- <div style ="color: #aaa;" >Build: {commitHash .slice (0 , 7 )}...{commitHash .slice (- 7 )}</div >
410+ <div style =" color: #aaa;" >
411+ Build: {commitHash .slice (0 , 7 )}...{commitHash .slice (- 7 )}
412+ </div >
385413 {:else }
386414 <div class =" img" ></div >
387415 {/if }
You can’t perform that action at this time.
0 commit comments