Why Do We Animate Elements?
- Set a client’s site apart
- Make it “pop”
Why Do We Animate Elements?
- Set a client’s site apart
- Make it “pop”
- Show off dev skill
Why Do We Animate Elements?
- Set a client’s site apart
- Make it “pop”
- Show off dev skill
- Communicate meaning about content
We Make Up Stories
Whenever things happen,
we automatically invent a narrative
to explain those events.
post hoc ergo propter hoc
Animation Tells
the Right Story
When we animate an interface correctly, we make sure users don’t make up the wrong story.
What Does Animation Communicate?
“Play with Me”
- Use motion to show that content is interactive.
- Connected to
:hover
- Links, inputs, buttons
“Ya Done Good, Kid”
- Use motion to confirm the success/failure of a user’s action.
- Shaking submit button if fields don’t validate
“We’re Connected”
- Use motion to show the relationship between pieces of content.
- Moving captions as carousel images move
- Transitioning help text as users hover over related elements
“I’m Important”
- Use motion to show which pieces of content deserve the user’s attention.
- Growing CTA button
- Growing active form field
“I Come from …”
- Use motion to show the source of some content.
- Animating sub-menu on
:hover
of parent link
“I Come from …”
“I’m Going …”
- Use motion to show the destination of some content.
- “Add to Cart” button
Easing Curves
- Linear motion is flat and lifeless.
- Easing brings an element of life to animations.
Cubic Bezier Curves
More Cubic Bezier Curves
Building Your Own
Make It Smooth
“do the performance its good ok”
Make It Smooth
box-shadow
top
, right
, bottom
, left
margin
, padding
font-size
, border
height
, width
Resources: CSS Triggers, Jank Free
Transitions vs. Animations
Transitions vs. Animations
- Transitions: simple off/on state changes
- Animations: complex motion,
usually tied to a trigger event,
differing start/end states
James Steinbach
Staff Front-End Engineer
at Okta
jdsteinbach