You can set it up using expressions and manipulating the scale, position, anchor point and shape size for parametric shape layer rectangles. Conversely, applying multiple linear wipes to suitably colored layers can be rigged to act accordingly.
linear wipes are cool but my shapes acts on both sides so linear wipe wouldnt work for my case.
Any ideas/tutorials for the expressions that might be useful? I'm quite new to expressions.
linear wipe wouldnt work for my case.
Sure it does. Nothing stops you from applying as many as you need to the same layer. The rest is merely using a bunch of linear() interpolators to convert absolut pixel coordinates to the relavant wipe percentages and vice versa. Same for shape layers. All you ever need is figure out where the edges are and in case of rectangles that is simple enough. In fact you may not even need to make this super-fancy. It's just an illusion. Simple pick-whipping of some position data for the middle section might suffice toi cover up the left and right parts underneath.