I want to change the point of rotation of a div. How to do that?

Basically I want to create something like a disco lights. I have a triangle which i want to rotate but its rotational point should be fixed at the top. I tried transform-origin but that is not giving me the expected results. I have a code pen. Please let me know how this can be done. https://codepen.io/kashyaprajan11/pen/xxaVbYw?editors=1100
6 Replies
b1mind
b1mind2y ago
I'm not at my PC atm but you need the deceleration on the element not the key frame? Transform-origin on .light
JWode
JWode2y ago
transform-origin: 'top left'; needs quotes around the top left?
b1mind
b1mind2y ago
No quotes
JWode
JWode2y ago
haha, correct 😄 just checked I'm out
kashyap_rajan
kashyap_rajan2y ago
😅 .. How can I do that. Thanks a lot 🙏
Jochem
Jochem2y ago
transform-origin - CSS: Cascading Style Sheets | MDN
The transform-origin CSS property sets the origin for an element's transformations.
Want results from more Discord servers?
Add your server