Ask DN: Do you use CSS or JS for animations/transitions?

over 5 years ago from Clark Dinnison, Creator of Noon Pacific :: Designer + Developer

  • Nathan CooperNathan Cooper, over 5 years ago (edited over 5 years ago )

    I use CSS for transitions and animations. The application I develop for uses AngularJS, so I use its classes, e.g., ng-enter and ng-leave, as needed for triggers when CSS alone won't work.

    I use LESS for CSS and have made a number of mixins for commonly used transitions and animations. Some of those, specifically animations with keyframes are custom, for others I have used pre-made animations from Animate.CSS

    I recently discovered AniJS. It has a simple declarative syntax using the "data" attribute. It makes it relatively simple to create complex animation events that likely wouldn't be possible with CSS alone. The only discouraging thing for me about AniJS, is that its logic is inline. That could potentially become a maintenance issue or create unexpected results when events trigger multiple animations on a page at once. Regardless it's fun to play with and I recommend checking it out for prototyping if nothing else.

    1 point