Skip to content

Commit

Permalink
加载中样式
Browse files Browse the repository at this point in the history
  • Loading branch information
heuuLZP committed Nov 15, 2018
1 parent ea682f5 commit 9ce31ad
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ cell | 移动端cell布局
fill-block | 填充空余部分
UI | UI组件
ul | 列表样式
spinner | loading加载中样式
33 changes: 33 additions & 0 deletions spinner/border.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>spinner</title>
<style>
body {
padding: 50px;
}
.spinner {
width: 100px;
height: 100px;
border-radius: 50%;
border: 5px solid transparent;
border-top-color: #FF6666;
animation: loading .8s linear infinite;
}
@keyframes loading {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="spinner"></div>
</body>
</html>
39 changes: 39 additions & 0 deletions spinner/svg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>spinner</title>
<style>
.spinner {
fill: none;
stroke: #FF6666;
stroke-width: 5px;
stroke-dasharray: 100 214;
stroke-dashoffset: 130;
transform-origin: 50% 50%;
animation: loading .8s linear infinite;
}
@keyframes loading {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<svg width="200" height="200">
<circle id="svg-circle" class="spinner" cx="100" cy="100" r="50"></circle>
</svg>
</body>
<script>
const circle = document.getElementById('svg-circle');
const radius = circle.r.baseVal.value;
const C = radius * 2 * Math.PI;
console.log(`周长是:${C}`);
</script>
</html>

0 comments on commit 9ce31ad

Please sign in to comment.