1
winterbells 2020-06-07 20:52:29 +08:00
93.8%最高 哈哈哈哈哈
|
2
dandycheung 2020-06-07 21:05:19 +08:00 via iPhone
94.6
|
3
ob 2020-06-07 21:07:19 +08:00 via Android
96.5
|
4
Ultraman 2020-06-07 21:09:25 +08:00 via Android
|
5
systemcall 2020-06-07 21:22:28 +08:00
96.8
小学的时候,信息课考试考过拿鼠标画圆 |
6
lanhaooclub OP @Ultraman 哈哈哈哈哈 uncontrollable urge 哈哈哈哈哈
|
7
godonlyknows 2020-06-07 21:28:54 +08:00 via Android
97.6
|
9
IzayakI 2020-06-07 21:34:54 +08:00
92.9
|
11
miaeLKK 2020-06-07 22:02:53 +08:00 via Android
分高的都是杨二嫂,对,就我笔下的那个,哈哈
|
12
rabbbit 2020-06-07 22:56:20 +08:00 5
尽梨了,谁能告诉我剩下的那 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); ``` |
13
lanhaooclub OP @rabbbit 代码很棒, 剩下的 0.2,我这边屏幕 4800*4000, 设置 radius 1200 以上就 OK
|