css+svg实现彩色圆环进度动画效果代码
代码语言:html
所属分类:响应式
代码描述:css+svg实现彩色圆环进度动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html { --page-background: #fff; --line-background: #eee; } .graph circle.one { --color: blue; --value: 3; --max: 4; } .graph circle.two { --color: teal; --value: 4; --max: 6; } .graph circle.three { --color: rebeccapurple; --value: 6; --max: 7; } .graph circle.four { --color: green; --value: 30; --max: 100; } .graph circle.five { --color: orange; --value: 4; --max: 10; } .graph circle.six { --color: orangered; --value: 7; --max: 10; } body { margin: 0; display: grid; place-content: center; height: 100vh; background: var(--page-background, white); } svg { width: 90vmin; height: 90vmin; } circle { fill: none; stroke: var(--color, red); stroke-width: 4; stroke-linecap: round; stroke-dasharray: calc(100px * var(--value, 0) / var(--max, 100)) 100; transform: rotate(90deg); transform-origin: 50% 50%; } .background circle { stroke: var(--line-background, white); stroke-width: 5; stroke-dasharray: none; } .graph circle { -webkit-animation: circle 2s ease-in-out both; animation: circle 2s e.........完整代码请登录后点击上方下载按钮下载查看
网友评论0