void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    float tme = iTime*.5;
    float scale = 0.125;

    vec2 adjVec = vec2((sin(tme)*.5), (cos(tme)*.5));
    vec2 uv = fragCoord/iResolution.xy;
    vec2 uvM;
    float posMod;

    uvM = mod(uv + normalize(uv-0.5)*adjVec, scale);
    uv = normalize(uvM-vec2(scale/2.))*(adjVec+vec2(.5));

    if(mod(floor((uv.x)/scale),2.) == 0.)
            uvM.x = scale - uvM.x;
    if(mod(floor((uv.y)/scale),2.) == 0.)
            uvM.y = scale - uvM.y;

    uvM += adjVec*length(uvM + adjVec - vec2(0.5));

    // Time varying pixel color
    vec3 col = vec3(0.5 + 0.5*tan((cos(tme)+2.)*8.*(uvM.x/sin(uvM.y+0.2+(cos(tme)/2.+1.)))),
                    0.5 + 0.5*tan((sin(tme*1.2)+2.)*8.*(uvM.x/sin(uvM.y+0.2+(cos(tme)/2.+1.)))),
                    0.5 + 0.5*tan((cos(tme*1.3)+3.)*8.*(uvM.x/sin(uvM.y+0.2+(sin(tme)/2.+1.)))));

    // Output to screen
    fragColor = vec4(col,1.0);
}
