Moving portals are easy as long as they move "together", meaning that their relative speed is 0 to one another. Notice that even tho the cube is not moving, since we measure its position relative to the portal, it actually has a speed!