-
Notifications
You must be signed in to change notification settings - Fork 0
/
progress_circle.html
89 lines (83 loc) · 2.19 KB
/
progress_circle.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
<!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>
.box{
position: relative;
width: 300px;
height: 400px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: #fff;
box-shadow: 0 30px 60px rgba(0,0,0,.2);
}
.box .percent{
position: relative;
width: 150px;
height: 150px;
}
.box .percent svg{
position: relative;
width: 150px;
height: 150px;
}
.box .percent svg circle{
width: 150px;
height: 150px;
fill: none;
stroke-width: 10;
stroke: #000;
transform: translate(5px,5px);
stroke-dasharray: 440;
stroke-dashoffset: 440;
stroke-linecap: round;
}
.box .percent svg circle:nth-child(1){
stroke-dashoffset: 0;
stroke: #f3f3f3;
}
.box .percent svg circle:nth-child(2){
stroke: #03a9f4;
}
.box .percent .number{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #111;
}
.box .percent .number h2{
font-size: 48px;
}
.box .percent .number h2 span{
font-size: 24px;
}
.box .text{
padding: 10px 0 0;
}
</style>
</head>
<body>
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70" style="stroke-dashoffset: calc(440 - (440 * 87) / 100);"></circle>
</svg>
<div class="number">
<h2>87<span>%</span></h2>
</div>
</div>
<h2 class="text">Progress</h2>
</div>
</body>
</html>