Hey all, working on a site and everything is going ok so far. When I click a button (the black one on the left of the screen for now) my gear spins…when I click it again, it resets its angle and starts the animation over. I want it to continue from it’s new angle so it’s a smooth animation on every click. I’m sure it’s some simple JS that just needs to be plopped in but I can’t figure it out. Thanks in advance!
Every time you start the animation, it starts at 0 because that’s what you have your variable ‘ang’ set to. You need to find a way to check the current value of the rotation on each click and only add 45 to that number.