Study this technique. An animation is created only once, not on every click. Instead, on a click you just change the reversed state of an animation. There's some logic in place so only the target element will play forward.   See the Pen wKLmzK by osublake (@osublake) on CodePen    
    • Like
    6