animation
I don't understand why is it that
square
isn't doing a 360deg rotation but instead it goes back up -100px on the y-axis
https://codepen.io/pen/?editors=11008 Replies
can someone explain to me what's happening please
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ah yea, you forgot to save the pen, it will generate a custom link
going of on your question, you are probably doing a rotation transition/animation on a tansform property that was already used for a translate, you'll need to repeat the translate when doing the rotation
darn 1 second
https://codepen.io/bbonsaye/pen/dyjaNpG?editors=1100
yeah @markboots. I think that's what's happening, in a new pen, I've tried doing something to repeat it but it's giving me an unexpected result ( a cool animation though xD)
something like this
if you have used a transform on the original, youll have to repeat the same value in the animation
ok let me try that
this should do for you
the rotate animation does the translateY for the square (or 0 in case of the circle) and then the rotate for both
im using a custom variable to pass the translateY value of the square
the link I sent, I managed to do sort of, it but I had to create 2 keyframe animations, but the square rotation seems way bigger
I'll take a look at your solution right now
your solution works
for the square, instead of it doing a 360deg downwards, I changed its
transition-origin
to -100px
and it's giving me a much wider circle for some reason
for the square
a transform-origin: 0 -50px;
brings it much closer but it's still off by a bit, but I wonder why -100px
doesn't work