Motion
Our motion utilities consists of two set of values, durations and easings.
Usage
Both variables can be combined in transitions as well in CSS animations to set the tone of an animation/transition (animation is used interchangeably with transition from now on).
In a transition declaration:
In an animation declaration:
Tokens
Duration
Hopper exposes 5 durations, they help convey a message and makes animations smooth and responsive.
Name | Value | |
---|---|---|
--hop-easing-duration-1 | 100ms | |
--hop-easing-duration-2 | 200ms | |
--hop-easing-duration-3 | 300ms | |
--hop-easing-duration-4 | 500ms | |
--hop-easing-duration-5 | 800ms |
Easings
Easings denotes a mathematical function that describes the rate at which a numerical value changes.They add life to motion by providing natural rests and setting the mood of an animation. Hopper provides 3 predefined easings, each having their use.
Productive
Used in animations that are not in the way, they quickly change from one state to another.
Focus
Used in animations that are designed to draw the user’s attention on what changed, in order to let them move on with their next task.
Expressive
Used in animations that are meant to give a sense of completeness or resolution to the user. Use them sparsely.
Name | Value | |
---|---|---|
--hop-easing-productive | cubic-bezier(0.22, 0.61, 0.36, 1) | |
--hop-easing-focus | cubic-bezier(0.46, 0.03, 0.52, 0.96) | |
--hop-easing-expressive | cubic-bezier(0.72, -0.66, 0.15, 1.5) |