Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
Angular2 animation rotate direction?

I have a menu icon within Angular2, which should always rotates clockwise. When show, it should rotates from -360 degree to -180 degree. When hide, it should rotates from -180 degree to 0 degree.

But with this animation settings it rotates counterclockwise with transition state 'hide' to 'show'. How can I make it rotate clockwise?

export const MenuButtonAnimation = trigger('menuState', [
        state('hide', style({ transform: 'rotate(0)' })),
        state('show', style({ transform: 'rotate(-180deg)' })),
        transition('hide => show', animate('350ms ease-out')),
        transition('show => hide', animate('350ms ease-in'))
    ]);
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Add style { transform: 'rotate(-360deg)' } for 'hide => show', to properly hint browser to treat 0 deg as -360 deg (although they are logically the same).

export const MenuButtonAnimation = trigger('menuState', [
        state('hide', style({ transform: 'rotate(0)' })),
        state('show', style({ transform: 'rotate(-180deg)' })),
        transition('hide => show', [style({transform: 'rotate(-360deg)'}), animate('350ms ease-out')]),
        transition('show => hide', animate('350ms ease-in'))
    ]);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!