How would I animate this but not move the other side of cube? I am sure this is easy but for some reason I can't think how to do this correctly. 

I need the monitor to go straight up, not at an angle. 

The 1st gif is exactly what I am after, the 2nd gif is what I currently have. I have parented my pieces. Do I have to use bones instead? Thanks in advance.
Just add a Limit Rotation constraint to the piece in blue, provided the following pieces are parented in chain.

Make sure you set it to World Space coordinates, so it reads the absolute value instead of the parent.