BennyTuner Posted March 19, 2021 Share Posted March 19, 2021 I forked the 'draggable knob...' pen to show you my problem I can get my knob to spin but only on a corner! I need it to spin on its center axis See the Pen OJbeGvQ by bennysutton (@bennysutton) on CodePen Link to comment Share on other sites More sharing options...
PointC Posted March 19, 2021 Share Posted March 19, 2021 You'd need to set the transformOrigin to center. You'll also want to use the GSAP 3 scripts instead of 2 and load inertia. Here's a fork with those changes. See the Pen 34e476b8db5cf305361230fb377e67fc by PointC (@PointC) on CodePen Happy tweening. 5 Link to comment Share on other sites More sharing options...
BennyTuner Posted March 19, 2021 Author Share Posted March 19, 2021 cool! is there any way I can get values to control another animation? Link to comment Share on other sites More sharing options...
Solution PointC Posted March 19, 2021 Solution Share Posted March 19, 2021 Sure. You can map the rotation to any other animation or value you like. I actually have an entire tutorial about mapping dials to change HSLA color values. https://www.motiontricks.com/hsla-color-dials-with-maprange/ There are multiple demos in the tutorial, but this is the final result. See the Pen ExKRrEX by PointC (@PointC) on CodePen Happy tweening. 3 1 Link to comment Share on other sites More sharing options...
BennyTuner Posted March 19, 2021 Author Share Posted March 19, 2021 awesome I'm all over it 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now