rewritten to use animations instead of transitions