#ifdef GL_ES
precision mediump float;
#endif

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

void main(void) {
       // fragment position
       vec2 p = (gl_FragCoord.xy/resolution.xy);

       float d = length(p - mouse);
       d =     (d * mod(time, 2.0)*2.0)-1.0;

       float v = sin(d*50.0);

       float rc = mod(time,2.0)-1.0;
       float gc = mod(time,3.0)-1.0;
       float bc = mod(time,4.0)-1.0;

       gl_FragColor = vec4(v*rc, v*gc, v*bc, 1.0);
}