#version 120
uniform float time;
uniform vec2 resolution;

//
// Source: https://www.shadertoy.com/view/3dlcD4
//
void mainImage( out vec4 fragColor, in vec2 fragCoord ) 
{
  vec2 uv = fragCoord/resolution.xy;
  vec4 color1 = vec4(0.0);

  float sinX1 = cos(uv.x * 3.0 + time * 1.2) / 3.0 + 0.65;
  if (uv.y < sinX1) 
  {
    if (uv.y + 0.15 > sinX1) 
    {
      color1 = vec4(uv.x, uv.y, 1.0, 1.0);
      if (uv.y + 0.2 > sinX1) 
      {
        color1 -= (uv.y + 0.1 - sinX1) * 20.0;
      }
    } 
    else 
    {
      color1 = vec4(uv.x, uv.y, 1.0, 1.0);
      if (uv.y + 0.4 > sinX1) 
      {
        color1 += (uv.y + 0.2 - sinX1) * 20.0;
      } 
      else 
      {
        color1 = vec4(0.0, 0.0, 0.0, 1.0);
      }
    }
        
    fragColor = color1;
  }
}

void main( void )
{
  vec4 color = vec4(0.0,0.0,0.0,1.0); 
  mainImage(color, gl_FragCoord.xy);
  color.w = 1.0;
  gl_FragColor = color;
}  



