Gumowski / Mira Thing
D = document
B = D.body
S = 1200
with(
B.appendChild(Object.assign(
D.createElement`canvas`, {
width: S,
height: S
})).getContext`2d`) {
canvas.style.transformOrigin = '0 0'
canvas.style.transform = 'scale(.5)'
b = .9998
xn1 = 5
yn1 = 0
xn = yn = 0
scale = 20
iterations = 1000
f = x => {
x2 = x * x
return a * x + (2 * (1 - a) * x2) / (1 + x2)
}
mouseX = mouseY = 0
onpointermove = e => {
mouseX = e.clientX
mouseY = e.clientY
}
dwn = 0
fillStyle = '#000'
fillRect(0, 0, S, S)
loop = _ => {
a = mouseY / 1000
xn1 = mouseX / 30
yn1 = 0
dwn += 1
for (var i = 0; i < iterations; i++) {
xn = xn1;
yn = yn1;
fillStyle = `hsla(${i / 30}, ${dwn / 6}%, 50%, .2)`
xn1 = b * yn + f(xn)
yn1 = -xn + f(xn1)
fillRect(S * .5 + xn1 * scale, yn1 * scale / 2 + dwn, 1, 1)
}
requestAnimationFrame(loop)
}
loop()
}
Move your around as the Gumowski / Mira shape moves down the screen…