直播网站源码,背景色渐变
实现页面从白色背景过度到蓝色
var t = d3.transition()
.duration(2000);
d3.select("body").transition(t).style("background-color", "lightblue");
const colors = ['red', 'yellow', 'blue']
let j = 0
function* _sf(i) {
while(j < i) {
let color = colors[j % 3]
let t = d3.transition()
.duration(2000)
d3.select('body').transition(t).style("background-color", color);
j += 1
yield
}
}
const a = _sf(1000)
setInterval(() => {
a.next()
}, 2000)
以上就是 直播网站源码,背景色渐变,更多内容欢迎关注之后的文章
标签:color,渐变,transition,背景色,源码,d3 From: https://www.cnblogs.com/yunbaomengnan/p/17516656.html