File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ async function loadMatches() {
233233 liveContainer . innerHTML = '' ;
234234 finishedContainer . innerHTML = '' ;
235235
236+ const total = gameEntries . length ;
237+ let loaded = 0 ;
238+
236239 for ( const game of Object . values ( games ) ) {
237240 const { lichessGameId, white, black, status } = game ;
238241 if ( ! lichessGameId ) continue ;
@@ -268,7 +271,12 @@ async function loadMatches() {
268271 } else {
269272 finishedContainer . appendChild ( card ) ;
270273 }
274+
275+ loaded ++ ;
276+ const percent = Math . round ( ( loaded / total ) * 100 ) ;
277+ document . getElementById ( 'games-loading-bar' ) . style . width = `${ percent } %` ;
271278 }
279+ document . getElementById ( 'games-loading-bar-container' ) . style . display = 'none' ;
272280}
273281
274282function hideIframeLoader ( iframe ) {
Original file line number Diff line number Diff line change @@ -52,11 +52,17 @@ <h3>Troll Reports</h3>
5252 </ div >
5353
5454 < h2 > Live Games</ h2 >
55+ < div id ="games-loading-bar-container ">
56+ < div id ="games-loading-bar "> </ div >
57+ </ div >
5558 < div class ="scroll-container ">
5659 < div id ="live-matches " class ="matches-row "> </ div >
5760 </ div >
5861
5962 < h2 > Finished Games</ h2 >
63+ < div id ="games-loading-bar-container ">
64+ < div id ="games-loading-bar "> </ div >
65+ </ div >
6066 < div class ="scroll-container ">
6167 < div id ="finished-matches " class ="matches-row "> </ div >
6268 </ div >
Original file line number Diff line number Diff line change @@ -261,4 +261,19 @@ a:active {
261261 border-radius : 4px ;
262262 }
263263
264-
264+ # games-loading-bar-container {
265+ height : 6px ;
266+ width : 100% ;
267+ background-color : # ddd ;
268+ margin : 1rem 0 ;
269+ position : relative;
270+ border-radius : 3px ;
271+ overflow : hidden;
272+ }
273+
274+ # games-loading-bar {
275+ height : 100% ;
276+ width : 0% ;
277+ background-color : # 4CAF50 ;
278+ transition : width 0.2s ease;
279+ }
You can’t perform that action at this time.
0 commit comments