Greensock animation and slidebox

Hi, I am trying to create an animated walkthrough for the beginning of my app. I created a codepen to show what I am trying to accomplish. When you swipe on the swipebox the timeline animation plays fine. However, I want to be able to reverse this greensock timeline when the user swipes back. For some reason when I try to use same function on the index of the second slide, it throws an error “Uncaught ReferenceError: t1 is not defined”. (t1 being the variable for my greensock timeline, var tl = new TimelineMax) Really unusual since both conditionals are within the same function, and the first slide can access t1 just fine & plays the animation as expected. I would appreciate any help, and can share my walkthrough animation once I finish as a thank you!

See the Pen ZYRmLw by Katherine Martinez (@kmartinezmedia) on CodePen.