The main concept is put an element infront of the fading square, then fade out the square to give the masking effect.