zoukankan      html  css  js  c++  java
  • 闲来无写的,就是中间有一条小细线,求大神指点。

      <!DOCTYPE html>
      <html>
       
      <head>
      <meta charset="UTF-8">
      <title></title>
      </head>
       
      <body>
      <canvas id="canvas" width="500" height="500"></canvas>
      <script type="text/javascript">
      var oC = document.getElementById("canvas");
      var ctx = oC.getContext("2d");
       
      ctx.translate(250,250);
      function autoplay() {
      // 左边
      ctx.beginPath();
      ctx.fillStyle = "black";
      ctx.arc(0, 0, 200, Math.PI * 0.5, Math.PI * 1.5, false);
      ctx.fill();
      ctx.closePath();
       
       
      // 右边
      ctx.beginPath();
      ctx.fillStyle = "white";
      ctx.strokeStyle = "black";
      ctx.arc(0, 0, 200, Math.PI * 1.5, Math.PI * 0.5, false);
      ctx.fill();
      ctx.stroke();
      ctx.closePath();
      // 小大的
      ctx.beginPath();
      ctx.fillStyle = "white";
      ctx.arc(0, -100, 100, Math.PI * 0.5, Math.PI * 1.5, false);
      ctx.fill();
      ctx.closePath();
       
      ctx.beginPath();
      ctx.fillStyle = "black";
      ctx.arc(0, 100, 100, Math.PI * 1.5, Math.PI * 0.5, false);
      ctx.fill();
      //小小的
      ctx.beginPath();
      ctx.fillStyle = "white";
      ctx.arc(0, 100, 35, 0, Math.PI * 2, false);
      ctx.fill();
      ctx.closePath();
       
      ctx.beginPath();
      ctx.fillStyle = "black";
      ctx.arc(0, -100, 35, 0, Math.PI * 2, false);
      ctx.fill();
      ctx.closePath();
      }
       
       
      var deg = 0;
      // setInterval(function(){
      // deg += Math.PI / 6;
      // // 清空
      // ctx.clearRect(-250,-250,500,500);
      // ctx.rotate(Math.PI / 100);
      // autoplay();
      // },20)
       
       
      // function move(){
      // deg = Math.PI / 6;
      // // 清空
      // ctx.clearRect(-250,-250,500,500);
      // ctx.rotate(Math.PI / 100);
      // autoplay();
      // setTimeout(move,100);
      // }
      // move();
      function move(){
      deg = Math.PI / 6;
      // 清空
      ctx.clearRect(-250,-250,500,500);
      ctx.rotate(Math.PI / 100);
      autoplay();
      // 当浏览器渲染刷新的时候调用
      window.requestAnimationFrame(move);
      }
      move();
      </script>
      </body>
       
      </html>
       
       
       
       
       
       
       
       
       
  • 相关阅读:
    C++ 虚函数在基类与派生类对象间的表现及其分析
    借@阿里巴巴 耍了个帅——HTML5 JavaScript实现图片文字识别与提取
    Dede(织梦) CMS SQL Injection Vulnerability
    dedecms v5.5 final getwebshell exploit(datalistcp.class.php)
    DEDECMS网站管理系统Get Shell漏洞
    织梦(Dedecms)select_soft_post.php页面变量未初始漏洞
    织梦(Dedecms) 5.1 feedback_js.php 注入漏洞
    织梦(DEDE)CMS V5.3 覆盖任意变量导致远程包含漏洞
    dedecms织梦 v5.5 两处跨站漏洞
    dedecms织梦 v5.6 两处跨站漏洞
  • 原文地址:https://www.cnblogs.com/haotian-dada666/p/5799997.html
Copyright © 2011-2022 走看看