File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ const loadingBarEl = document . querySelector ( ".loading_inner" ) ;
2
+
3
+ let myWidth = 0 ;
4
+ const loadingBar = setInterval ( ( ) => {
5
+ myWidth ++ ;
6
+ if ( myWidth === 100 ) {
7
+ clearInterval ( loadingBar )
8
+ }
9
+ loadingBarEl . style . width = `${ myWidth } %`
10
+
11
+ } , 100 ) ;
12
+
13
+
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < title > Loading Bar</ title >
8
+ < link rel ="stylesheet " href ="styles.css ">
9
+ </ head >
10
+ < body >
11
+ < div class ="container ">
12
+ < h1 > Loading Bar</ h1 >
13
+ < div class ="loading_outer ">
14
+ < div class ="loading_inner "> </ div >
15
+ </ div >
16
+
17
+ </ div >
18
+
19
+ < script src ="app.js "> </ script >
20
+ </ body >
21
+ </ html >
Original file line number Diff line number Diff line change
1
+ h1 {
2
+ text-align : center;
3
+ }
4
+ .loading_outer {
5
+ width : 600px ;
6
+ height : 50px ;
7
+ border : 1px solid black;
8
+ margin : auto;
9
+ }
10
+ .loading_inner {
11
+ width : 800px ;
12
+ height : 50px ;
13
+ background-color : coral;
14
+ }
You can’t perform that action at this time.
0 commit comments