#define M_PI 3.141592

// tweaked version of this by 'bmodone' - https://www.shadertoy.com/view/4llcDH

float radial(vec2 uv, float offset, float repeat)
{
    float a = mod((atan(uv.y, uv.x) + M_PI + (offset * 2.0 * M_PI)) * repeat / M_PI, 2.0);
    return min(a,2.0-a);
}

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = ( fragCoord - 0.5* iResolution.xy ) / iResolution.y;
    
    float off = length(uv);
 	float d = off - 0.2;
    float a = radial(uv, sin(off*4.0-iTime*0.5)/16.0, 7.0) - 0.6;

    d = a-d;
    
    float m = clamp(-d*2.0, 0.0, 1.0);
    
    vec3 col = mix(vec3(0.6, 0.1, 0.9), vec3(0.82, 0.81, 0.6-d), m);
    
    col *= (sin(-off * 6.0 - iTime*2.0) / 7.0) + 0.9;
    
	fragColor = vec4(col,1.0);
}
