diff options
author | Anthony Wang | 2024-01-29 02:56:06 -0500 |
---|---|---|
committer | Anthony Wang | 2024-01-29 02:56:06 -0500 |
commit | d2ecf019b33e607e5f85d10bb2be0b1bcf3daa14 (patch) | |
tree | 8b70d1c313777552114591d74e35be36e11a620c /script.js | |
parent | bf7131f7b2b529ab591235d738e98cf1f90ab864 (diff) |
EXPANDING CIRCLES YAY
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -38,12 +38,12 @@ document.querySelectorAll("svg").forEach(function(svg) { a.cm.y += p.y a.p.push(p) // Show circles for debugging - let circle = document.createElementNS("http://www.w3.org/2000/svg", "circle"); + /* let circle = document.createElementNS("http://www.w3.org/2000/svg", "circle"); circle.setAttribute("cx", p.x); circle.setAttribute("cy", p.y); circle.setAttribute("r", rad); circle.setAttribute("fill", "red"); - svg.appendChild(circle) + svg.appendChild(circle) */ } }) a.cm.x /= a.p.length @@ -201,8 +201,18 @@ function updatev(event) { a.vy += 100 * (a.y - event.clientY) / d } - // TODO: Display spreading out circles - + // Display spreading out circles + let circle = document.createElement("div") + circle.style.width = circle.style.height = "10px" + circle.style.left = event.clientX - 5 + "px" + circle.style.top = event.clientY - 5 + "px" + document.body.appendChild(circle) + circle.offsetWidth + circle.style.transform = "scale(500)" + circle.style.opacity = "0" + setTimeout(function () { + document.body.removeChild(circle); + }, 1000); } cnt = 0 |