Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Angular Animations – Und plötzlich ist meine Ap...

Angular Animations – Und plötzlich ist meine App so richtig sexy!

Bei der Gestaltung moderner Webanwendungen spielen Animationen eine tragende Rolle. Animationen ermöglichen dem Benutzer eine User Experience, die ansprechend ist und die Aufmerksamkeit des Users auf die relevanten Teile leitet. Gute Benutzeroberflächen wechseln reibungslos zwischen den Zuständen mit ineinanderfliessenden Animationen. In dieser Session wird das Konzept von Animationen in Angular erklärt und wir schauen uns an, wie auch ihre App so richtig sexy wird.

Thomas Gassmann

September 22, 2020
Tweet

More Decks by Thomas Gassmann

Other Decks in Programming

Transcript

  1. Agenda • Introduction • Structure of an animation • Animate

    various elements • Reusable animations.
  2. CSS Animation • Limited control • Good for simple animations

    like showing a tooltip or toggeling an UI element • Not recommended for fine-tuned control.
  3. Void State • Not part of the DOM • Element

    is entering the page • Element is leaving the page Add an Item: void => * Delete an Item: * => void
  4. Wildcard State • Matches any animation state • Implemented with

    an asterix (*) • Useful for defining transitions regardless of the element’s start or end state
  5. Animate multiple elements • query() finds one or more inner

    HTML elements • stagger() applies a cascading delay to animations for multiple elements • group() runs multiple animation steps in parallel.
  6. Animate Builder • Animations can also be constructed/sequenced within a

    component (instead of just the metadata) • By injecting AnimationBuilder into your component • And then building an animation player.
  7. Routing • Animating routes in Angular is much the same

    as querying for elements and animating them • First, setup a @routerAnimations trigger
  8. Reusable Animations • animation() function: Produces a reusable animation that

    can be invoked from elsewhere. Used together with useAnimation(). • useAnimation() function: Starts a reusable animation that is created using the animation() function.
  9. Recap • CSS Animations are good for simple animations •

    @angular/animations is a powerful framework • Animations can help to increase user experience • However, use animations carefully • Otherwise…