-
Notifications
You must be signed in to change notification settings - Fork 0
/
progressbar.html
95 lines (95 loc) · 2.21 KB
/
progressbar.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
background: #e3edf7;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.skill{
width: 160px;
height: 160px;
position: relative;
}
.outer{
width: 160px;
height: 160px;
border-radius: 50%;
padding: 20px;
box-shadow: 6px 6px 10px -1px rgba(0,0,0,0.15), -6px -6px 10px -1px rgba(255,255,255,0.7);
}
.inner{
width: 120px;
height: 120px;
border-radius: 50%;
box-shadow: inset 6px 6px 10px -1px rgba(0,0,0,0.15), inset -6px -6px 10px -1px rgba(255,255,255,0.7);
display: flex;
justify-content: center;
align-items: center;
}
#number{
font-weight: 600;
color: #555;
}
circle{
fill: none;
stroke: url(#GradientColor);
stroke-width: 20px;
stroke-dasharray: 472;
stroke-dashoffset: 472;
animation: anim 2s linear forwards;
}
svg{
position: absolute;
top: 0;
left: 0;
}
@keyframes anim{
100%{
stroke-dashoffset: 80;
}
}
</style>
</head>
<body>
<div class="skill">
<div class="outer">
<div class="inner">
<div id="number">65%</div>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="160px" height="160px">
<defs>
<linearGradient id="GradientColor">
<stop offset="0%" stop-color="#e91e63" />
<stop offset="100%" stop-color="#673ab7" />
</linearGradient>
</defs>
<circle cx="80" cy="80" r="70" stroke-linecap="round" />
</svg>
</div>
<script>
let num = document.getElementById("number");
let counter = 0;
setInterval(() => {
if(counter === 90){
clearInterval()
}else{
counter += 1;
num.innerHTML = counter + "%";
}},22)
</script>
</body>
</html>