直播視訊網站原始碼,進度條漸變效果
阿新 • • 發佈:2021-07-30
直播視訊網站原始碼,進度條漸變效果實現的相關程式碼
```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> ```
以上就是直播視訊網站原始碼,進度條漸變效果實現的相關程式碼, 更多內容歡迎關注之後的文章