css实现带动画的进度条效果代码
代码语言:html
所属分类:进度条
代码描述:css实现带动画的进度条效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap'> <style> @property --progress-value { syntax: "<integer>"; inherits: true; initial-value: 0; } :root { --progress-bar-color: #cfd8dc; --progress-value-color: #2196f3; --progress-empty-color-h: 4.1; --progress-empty-color-s: 89.6; --progress-empty-color-l: 58.4; --progress-filled-color-h: 122.4; --progress-filled-color-s: 39.4; --progress-filled-color-l: 49.2; } html, body { height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; } body { justify-content: space-evenly; max-height: 300px; width: 100%; max-width: 400px; font-family: "Roboto Mono", monospace; } progress[value] { display: block; position: relative; -webkit-appearance: none; -moz-appearance: none; appearance: none; width: 80%; height: 6px; border: 0; --border-radius: 10px; border-radius: var(--border-radius); counter-reset: progress var(--progress-value); --progress-value-string: counter(progress) "%"; --progress-max-decimal: calc(var(--value, 0) / var(--max, 0)); --progress-value-decimal: calc(var(--progress-value, 0) / var(--max, 0)); --progress-value-percent: calc(var(--progress-value-decimal) * 100%); --progress-value-color: hsl( calc((var(--progress-empty-color-h) + (var(--progress-filled-color-h) - var(--progress-empty-color-h)) * var(--progress-value-decimal)) * 1deg) calc((var(--progress-empty-color-s) + (var(--progress-filled-color-s) - var(--progress-empty-color-s)) * var(--progress-value-decimal)) * 1%) calc((var(--progress-empty-color-l) + (var(--progress-filled-color-l) - var(--progress-empty-color-l)) * var(--progress-value-decimal)) * 1%) ); -webkit-animation: calc(3s * var(--progress-max-decimal)) linear 0.5s 1 normal both progress; a.........完整代码请登录后点击上方下载按钮下载查看
网友评论0