直播视频网站源码,进度条渐变效果
直播视频网站源码,进度条渐变效果实现的相关代码
```cpp <!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="300" height="300" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag. </canvas> <script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var grd=ctx.createRadialGradient(150,150,1,150,150,90); grd.addColorStop(0,"red"); grd.addColorStop(0.1,"black"); grd.addColorStop(0.3,"yellow"); grd.addColorStop(0.5,"green"); grd.addColorStop(0.7,"yellow"); grd.addColorStop(0.9,"green"); grd.addColorStop(1,"black"); ctx.fillStyle=grd; ctx.fillRect(10,10,280,280); </script> </body> </html> ```
```cpp <!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="300" height="300" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag. </canvas> <script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var grd=ctx.createRadialGradient(150,150,1,150,150,90); grd.addColorStop(0,"red"); grd.addColorStop(0.1,"black"); grd.addColorStop(0.3,"yellow"); grd.addColorStop(0.5,"green"); grd.addColorStop(0.7,"yellow"); grd.addColorStop(0.9,"green"); grd.addColorStop(1,"black"); ctx.fillStyle=grd; ctx.fillRect(10,10,280,280); </script> </body> </html> ```
以上就是直播视频网站源码,进度条渐变效果实现的相关代码, 更多内容欢迎关注之后的文章