web299.com
全部
教育
语言/资格考试
法律
互联网
政务民生
Word模板
Excel模板
PPT模板
网页特效
小程序模板
网站模板
首页
教育
语言/资格考试
法律
互联网
政务民生
Word模板
Excel模板
PPT模板
网页特效
小程序模板
网站模板
当前位置:
首页
>
网页特效
>
进度条
svg圆形进度条插件svg-gauge
分类:
进度条
日期:
2024-05-14
点击(0)
评论(0)
演 示
免费下载
简介
##### HTML结构 最简单的按钮HTML结构如下。 ```html
``` ##### CSS样式 ```html .gauge-container { width: 150px; height: 150px; display: block; padding: 10px; } .gauge-container > .gauge > .dial { stroke: #eee; stroke-width: 2; fill: rgba(0,0,0,0); } .gauge-container > .gauge > .value { stroke: rgb(47, 227, 255); stroke-width: 2; fill: rgba(0,0,0,0); } .gauge-container > .gauge > .value-text { fill: rgb(47, 227, 255); font-family: sans-serif; font-weight: bold; font-size: 1em; } ``` ##### javaScript ```html // npm install npm install svg-gauge // Require JS var Gauge = require("svg-gauge"); // Standalone var Gauge = window.Gauge; // Create a new Gauge var cpuGauge = Gauge(document.getElementById("cpuSpeed"), { max: 100, // custom label renderer label: function(value) { return Math.round(value) + "/" + this.max; }, value: 50, // Custom dial colors (Optional) color: function(value) { if(value < 20) { return "#5ee432"; // green }else if(value > 40) { return "#fffa50"; // yellow }else if(value > 60) { return "#f7aa38"; // orange }else { return "#ef4655"; // red } } }); ``` // Set gauge value cpuGauge.setValue(75); // Set value and animate (value, animation duration in seconds) cpuGauge.setValueAnimated(90, 1);
相关推荐
html5浪漫粒子表白文字特效
SlidesJS幻灯片特效
html5瀑布流相册特效
css3 svg实现的情人节表白鲜花动画特效
t-scroll.js基于ES6的DOM元素,过渡动画库插件
纯js写省市区三级联动效果
广告
广告