#version 120

uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;


float sdCircle( vec2 p, float r )
{
  return length(p) - r;
}


void main()
{
  
  // https://www.shadertoy.com/view/3ltSW2
  
  vec2 p = (2.0*gl_FragCoord.xy-resolution.xy)/resolution.y;

	float d = sdCircle(p,0.9);
    
	// coloring
  //float c = sign(d);
  //vec3 col = vec3(c);
  vec3 col = vec3(1.0, 1.0, 1.0) - sign(d)*vec3(0.1,0.4,0.7);
  col *= 1.0 - exp(-3.0*abs(d));
	col *= 0.8 + 0.2*cos(150.0*d + time);
 	col = mix( col, vec3(1.0), 1.0-smoothstep(0.0,0.01,abs(d)) );
 	//col.xy *= p.xy;

	gl_FragColor = vec4(col,1.0);
  
}







