Moving, rotating and scaling
Transform the coordinate space — translate, scale, and a 2×2 rotation matrix — then draw.
The trick behind all movement in a shader is the same: you do not move the shape, you transform the COORDINATE SPACE it lives in, then draw the shape normally. There are three transforms, and the first two are one operation each. To MOVE (translate), subtract an offset from the coordinate before drawing. To RESIZE (scale), multiply the coordinate — a bigger multiplier packs the shape into less space, so it looks smaller.
Here are both at once: the box is centered (subtract 0.5), scaled (× 2.0), then shifted to the right. Change the numbers and watch it move and resize.
ROTATE is the third transform, and the only one that needs a matrix: mat2(cos(a), -sin(a), sin(a), cos(a)) turns a vector by angle a. Two details matter: rotate around the CENTER (subtract 0.5 first so the pivot is the middle, not the corner), and feed the angle from u_time so it spins over time. Move, scale, rotate: those three, layered, are the foundation of every animated shader effect.
Your turn: make a bar that spins. Rotate the centered coordinate by u_time, then draw a horizontal bar in the rotated space so it sweeps around.
Make a bar that spins over time.
Build rot = mat2(cos(a), -sin(a), sin(a), cos(a)) with a = u_time, rotate the centered coord p = rot * (st - 0.5), then draw a bar where abs(p.y) < 0.1.