-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (193 loc) · 4.78 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--meta http-equiv="refresh" content="1;url="-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="ZulNs">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="robots" content="all">
<meta name="copyright" content="ZulNs">
<title>Circular Progress Bar Demo</title>
<link rel="icon" href="../favicon.svg" type="image/svg+xml">
<!--link rel="icon" href="favicon.png" type="image/png"-->
<!--link rel="icon" href="favicon.ico" type="image/x-icon"-->
<style rel="stylesheet" type="text/css">
html{box-sizing:border-box}
*,*:before,*:after{box-sizing:inherit}
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
html,body{font-family:Verdana,sans-serif;font-size:18px;line-height:1.5}html{overflow-x:hidden}
h1{font-size:36px}
h2{font-size:30px}
h3{font-size:24px}
h4{font-size:20px}
h5{font-size:18px}
h6{font-size:16px}
h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin:10px 0}
input{font:inherit;margin:0;padding:0}
input[type=range]{
-webkit-appearance:none;
margin:18px 0;
width:100%
}
input[type=range]:focus{
outline:none;
}
input[type=range]::-webkit-slider-runnable-track{
width:100%;
height:8.4px;
cursor:pointer;
animate:0.2s;
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d;
background:#3071a9;
border-radius:1.3px;
border:0.2px solid #010101
}
input[type=range]::-webkit-slider-thumb{
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d;
border:1px solid #000000;
height:36px;
width:16px;
border-radius:3px;
background:#ffffff;
cursor:pointer;
-webkit-appearance:none;
margin-top:-14px
}
input[type=range]:focus::-webkit-slider-runnable-track{
background:#367ebd;
}
input[type=range]::-moz-range-track{
width:100%;
height:8.4px;
cursor:pointer;
animate:0.2s;
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d;
background:#3071a9;
border-radius:1.3px;
border:0.2px solid #010101
}
input[type=range]::-moz-range-thumb{
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d;
border:1px solid #000000;
height:36px;
width:16px;
border-radius:3px;
background:#ffffff;
cursor:pointer
}
input[type=range]::-ms-track{
width:100%;
height:8.4px;
cursor:pointer;
animate:0.2s;
background:transparent;
border-color:transparent;
border-width:16px 0;
color:transparent
}
input[type=range]::-ms-fill-lower{
background:#2a6495;
border:0.2px solid #010101;
border-radius:2.6px;
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d
}
input[type=range]::-ms-fill-upper{
background:#3071a9;
border:0.2px solid #010101;
border-radius:2.6px;
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d
}
input[type=range]::-ms-thumb{
box-shadow:1px 1px 1px #000000,0px 0px 1px #0d0d0d;
border:1px solid #000000;
height:36px;
width:16px;
border-radius:3px;
background:#ffffff;
cursor:pointer
}
input[type=range]:focus::-ms-fill-lower{
background:#3071a9
}
input[type=range]:focus::-ms-fill-upper{
background:#367ebd
}
input[type=checkbox]{
transform:scale(1.5);
}
</style>
</head>
<body>
<h1>Circular Progress Bar Demo</h1>
<div style="margin:40px 0 0 16px">
<input id="check" type="checkbox" name="check" onclick="autoUpdate(this)">
<label for="check" style="margin-left:8px;">Auto updated</label>
</div>
<div style="margin:30px 0 0 16px">
<input id="slider" type="range" oninput="setValue()" onchange="setValue()" style="width:320px" min="0" max="100" value="50" step="1">
</div>
<script type="text/javascript" src="progress.js"></script>
<script type="text/javascript">
'use strict';
const pb=new Progress(),
elm=pb.getElement(),
slider=document.getElementById('slider');
let ctr=50,
dly=50,
toId=null,
isAuto=false,
isCountUp=true;
document.body.appendChild(elm);
elm.style.cssText='position:absolute;left:calc(50% - 50px);top:calc(50% - 50px)';
pb.setValue(50);
function autoUpdate(el){
if(el.checked){
slider.disabled=true;
if(isCountUp)incVal();
else decVal();
}
else{
clearTimeout(toId);
toId=null;
slider.disabled=false;
slider.value=pb.getValue();
}
}
function setValue(){
if(slider.value==ctr)return;
isCountUp=slider.value>ctr;
ctr=slider.value;
pb.setValue(ctr);
}
function incVal(){
if (ctr>100){
ctr=99;
isCountUp=false;
decVal();
}
else{
pb.setValue(ctr);
slider.value=ctr;
toId=setTimeout(incVal,dly);
ctr++;
}
}
function decVal(){
if (ctr<0){
ctr=1;
isCountUp=true;
incVal();
}
else{
pb.setValue(ctr);
slider.value=ctr;
toId=setTimeout(decVal,dly);
ctr--;
}
}
</script>
</body>
</html>