File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ < html >
2+
3+ < head >
4+ < title > Racing</ title >
5+ < link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css "
6+ integrity ="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk " crossorigin ="anonymous ">
7+ < style >
8+ body {
9+ margin : 10px ;
10+ }
11+ .progress {
12+ height : 1.5em ;
13+ }
14+ .img-responsive {
15+ width : auto;
16+ height : 1.5em ;
17+ }
18+ </ style >
19+
20+ </ head >
21+
22+ < body onload ="init() ">
23+ < div class ="progress ">
24+ < div id ="rabbitBar " class ="progress-bar bg-warning " role ="progressbar " style ="width: 0% " aria-valuenow ="0 "
25+ aria-valuemin ="0 " aria-valuemax ="100 "> </ div >
26+ < img src ="tennis-ball.png " alt ="tennis ball progress bar " class ="img img-responsive ">
27+ </ div >
28+
29+ < script src ="https://code.jquery.com/jquery-3.5.1.slim.min.js "
30+ integrity ="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj "
31+ crossorigin ="anonymous "> </ script >
32+ < script src ="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js "
33+ integrity ="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo "
34+ crossorigin ="anonymous "> </ script >
35+ < script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js "
36+ integrity ="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI "
37+ crossorigin ="anonymous "> </ script >
38+ < script >
39+ let rabbitTimer ;
40+ let rabbitProgress = 0 ;
41+
42+ function init ( ) {
43+ rabbitTimer = setInterval ( go , 500 ) ;
44+ }
45+
46+ function go ( ) {
47+ const bar = document . getElementById ( 'rabbitBar' ) ;
48+ rabbitProgress += 10 ;
49+ bar . style . width = `${ rabbitProgress } %` ;
50+
51+ if ( rabbitProgress >= 100 ) {
52+ clearInterval ( rabbitTimer ) ;
53+ console . log ( 'done' ) ;
54+ }
55+ }
56+ </ script >
57+ </ body >
58+
59+ </ html >
You can’t perform that action at this time.
0 commit comments