lanhaooclub

试试画一个完美的圆

  •  
  •   lanhaooclub · Jun 7, 2020 · 3746 views
    This topic created in 2342 days ago, the information mentioned may be changed or developed.

    网上看见的这个网站, 画一个完美的圆

    https://vole.wtf/perfect-circle/

    然后主页上也有一些神奇的东西。。。。🤦‍

    Supplement 1  ·  Jun 7, 2020
    还有一个🤦‍🤦‍🤦‍

    把球踢回给他们。。

    https://vole.wtf/kick-the-ball-back/
    13 replies  •  2020-06-08 00:16:23 +08:00
    300
    300
    Jun 7, 2020
    1
    93.8%最高 哈哈哈哈哈
    dandycheung
    dandycheung
    Jun 7, 2020 via iPhone
    2
    94.6
    ob
    ob
    Jun 7, 2020 via Android
    3
    96.5
    Ultraman
    Ultraman
    Jun 7, 2020 via Android
    4
    还触发个类似彩蛋的玩意儿
    https://i.loli.net/2020/06/07/C1OGnb3dcqIWLYM.jpg
    systemcall
    systemcall
    Jun 7, 2020
    5
    96.8
    小学的时候,信息课考试考过拿鼠标画圆
    lanhaooclub
    lanhaooclub
    OP
    Jun 7, 2020
    6
    @Ultraman 哈哈哈哈哈 uncontrollable urge 哈哈哈哈哈
    godonlyknows
    godonlyknows
    Jun 7, 2020 via Android
    7
    97.6
    IzayakI
    IzayakI
    Jun 7, 2020
    8
    @Ultraman 这是广告,让你关注他推特啥的
    IzayakI
    IzayakI
    Jun 7, 2020
    9
    92.9
    Ultraman
    Ultraman
    Jun 7, 2020
    10
    @IzayakI #8 我知道,但是这个文案还有视觉效果挺有意思的.
    miaeLKK
    miaeLKK
    Jun 7, 2020 via Android
    11
    分高的都是杨二嫂,对,就我笔下的那个,哈哈
    rabbbit
    rabbbit
    Jun 7, 2020❤️5
    12
    尽梨了,谁能告诉我剩下的那 0.2 差在哪?



    ```
    function sleep(time = 100) {
      return new Promise((reslove) => {
       setTimeout(() => {
        reslove();
      }, time)
     })
    }

    async function drawCircleByMouse(canvasEl, centerX, centerY, radius = 200) {
      let radian = 0;
      const pointers = [];

      while (radian < Math.PI * 2) {
       const x = centerX + Math.cos(radian) * radius
       const y = centerY + Math.sin(radian) * radius
       pointers.push({ x, y });
       radian += 0.1;
     }

      const startPoint = pointers[0];
      const mousedownEnt = new MouseEvent("mousedown", { clientX: startPoint.x, clientY: startPoint.y, bubbles: true });
      canvasEl.dispatchEvent(mousedownEnt);

      for (let point of pointers) {
       await sleep();
       const mousemoveEnt = new MouseEvent("mousemove", { clientX: point.x, clientY: point.y, bubbles: true });
       canvasEl.dispatchEvent(mousemoveEnt);
       radian += 0.01;
     }

      const mousemoveEnt = new MouseEvent("mousemove", { clientX: startPoint.x, clientY: startPoint.y, bubbles: true });
      canvasEl.dispatchEvent(mousemoveEnt);

      const endPoint = pointers[pointers.length - 1];
      const mouseupEnt = new MouseEvent("mouseup", { clientX: endPoint.x, clientY: endPoint.y, bubbles: true });
      canvasEl.dispatchEvent(mouseupEnt);
    }

    document.querySelector('a').click();
    setTimeout(async () => {
      const el = document.querySelector('div');
      const rect = el.getBoundingClientRect();
      const rem = window.innerHeight / 100 * 9;
      const centerX = window.innerWidth / 2;
      const centerY = window.innerHeight / 2 - 20;
      await drawCircleByMouse(el, centerX, centerY);
    }, 2000);
    ```
    lanhaooclub
    lanhaooclub
    OP
    Jun 8, 2020
    13
    @rabbbit 代码很棒, 剩下的 0.2,我这边屏幕 4800*4000, 设置 radius 1200 以上就 OK
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1406 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 19:04 · PVG 03:04 · LAX 11:04 · JFK 14:04
    ♥ Do have faith in what you're doing.