+ 1

[SOLVED] How to make transition only rotate? please help

ex. I have translate and rotate, I need to animate rotate but not animate translate transition: transform 1s ease; (animates translate too) transition: rotate 1s ease; (not work) HOW not to animate the translate, but to animate the rotate?

27th Dec 2021, 4:41 PM
Арсений G-5
Арсений G-5 - avatar
6 Antworten
+ 2
transition: transform 1s ease; tansform: rotate(90deg); trasition: ; transform: translate(10px,10px);
28th Dec 2021, 9:36 AM
Арсений G-5
Арсений G-5 - avatar
+ 4
If the element is hovered #element:hover{ transform:rotate(20deg); } #element{ transition:1s ease; } Please note the # is optional likewise the 20deg
27th Dec 2021, 4:51 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
+ 2
yes but it animates translate(move)
27th Dec 2021, 5:22 PM
Арсений G-5
Арсений G-5 - avatar
+ 2
How?
27th Dec 2021, 7:28 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
+ 1
I want to use this in my game, and there the player moves and turns. I need to make it move sharply, but turn smoothly https://code.sololearn.com/Wf9YP1l6u4jY/?ref=app
28th Dec 2021, 8:11 AM
Арсений G-5
Арсений G-5 - avatar
+ 1
It looks good now but still needs some edit https://code.sololearn.com/W85vl5pMuMLA/?ref=app
28th Dec 2021, 11:02 AM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar