// Update to my earlier shader here: https://www.shadertoy.com/view/NdsSDM
// Adding some more colour and making a few tweaks to the animation

float as(vec2 uv, float v, float w)
{
    float t = length(uv);
    float wt = w * t;
    float vt = v * t;
    vec2 s = vec2 ( ( vt + uv.x ) * cos(wt), (vt + uv.y) * sin(wt) );
    return length(s);

}

float spr(vec2 uv)
{
    return (((smoothstep(as(uv, 0.01, 32.0*(sin(iTime*0.1)*abs(cos(iTime*0.2)+2.0)*5.0)), 0.001, 0.32)*1.75)-1.0)*-1.0);
}

mat2 rot(float a)
{
	return mat2(cos(a),-sin(a),sin(a),cos(a));
}
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = (fragCoord - 0.5 * iResolution.xy)/iResolution.y;
    uv = (uv*2.0) * rot(iTime*0.5);
    vec3 col = vec3(0.0);
    float t = iTime * 0.4;
    float r = sin(t)*0.90;
    float m = spr(uv-vec2(sin(t), cos(t))*r);
    float n = spr(uv-vec2(cos(t), sin(t))*r);
    float o = spr(uv+vec2(sin(t), cos(t))*r);
    float p = spr(uv+vec2(cos(t), sin(t))*r);

	col = vec3(m+n+o+p) * vec3(max(0.01,sin(t+2203.0)*m+n), max(0.01,sin(t+1300.0)*n+o), max(0.001,cos(t)*o+p));
    fragColor = vec4( pow(col,vec3(0.454545)),1.0);
}
