File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 558558 let mathProblems = null ;
559559 async function loadMathProblems ( ) {
560560 if ( mathProblems ) return mathProblems ;
561+ showLoading ( ) ;
561562 try {
562563 const res = await fetch ( 'math.txt' , { cache : 'no-cache' } ) ;
563564 mathProblems = parseMathText ( await res . text ( ) ) ;
564565 return mathProblems ;
565566 } catch ( e ) {
566567 showMessage ( `Failed to load math problems: ${ e . message } ` , 'error' , 3000 ) ;
567568 return [ ] ;
569+ } finally {
570+ hideLoading ( ) ;
568571 }
569572 }
570573 function parseMathText ( text ) {
12491252 mathSession . accumulatedAttack += 20 ;
12501253 const btn = document . querySelector ( `#math-choice-${ choice . toLowerCase ( ) } ` ) ;
12511254 btn . classList . add ( 'correct' ) ;
1252- setTimeout ( ( ) => btn . classList . remove ( 'correct' ) , 500 ) ;
12531255 setTimeout ( ( ) => {
1256+ btn . classList . remove ( 'correct' )
12541257 mathSession . index += 1 ;
12551258 nextMathProblem ( ) ;
12561259 } , 500 ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ <h2>Tactics</h2>
4848 < button id ="btn-shop " class ="btn shop "> < i class ="fa-solid fa-shop "> </ i > Shop</ button >
4949 </ div >
5050
51- < p class ="hint "> Version: 1.8 (beta) - The Math Update!</ p >
51+ < p class ="hint "> Version: 1.8 - The Math Update!</ p >
5252 < a class ="hint " href ="https://github.com/willyblah/thegame " target ="_blank "> GitHub</ a > < span class ="hint "> |</ span >
5353 < a class ="hint " href ="https://github.com/willyblah/thegame/blob/main/README.md " target ="_blank "> About</ a >
5454 </ div >
@@ -209,6 +209,7 @@ <h2>Trickster Prize</h2>
209209 </ div >
210210 < div class ="controls "> < button id ="btn-prize-back " class ="btn "> Back</ button > </ div >
211211 </ div >
212+
212213 < div id ="math-screen " class ="screen hidden ">
213214 < div class ="math-topbar ">
214215 < div class ="left ">
You can’t perform that action at this time.
0 commit comments