Insight on the Cubic Bezier: CSS Animated Soul
In the CSS animation and transition,
transition-timing-function
The rate of change in the attribute value over time is determined.
Cubic Bezier (three Bézier curves)
It is the most powerful tool for defining such rates. It's four parameters.
(x1, y1, x2, y2)
Composition, representing the coordinates of the two control points.
1. Mathematical logic of the Bézier curve
A Bézier curve is defined as
0.0
Present.
1.0
within the coordinates:
- X-axis: Representative time schedule. Must be between 0 and 1.
- Y-axis: represents the completion of animated art. Usually between 0 and 1, but also beyond this range (with a rebound or a burst effect).
- Control point P1 (x1, y1) and P2 (x2, y2: They attract curves like magnets, and they determine the speed and speed of change.
2. Specific issues addressed: a rigid mechanism to say goodbye
Scenario one: Physical motion of nature.
Default
linear
Animations are very rigid, because no object in the real world is instantaneous and keeps constant. Use
ease-in-out
Or a custom Bézier curve can simulate the inertia of the object, making UI interactive more intuitive.
Scene 2: Return to animation (Bounce/Back). Set the value of the y-axis to be greater than 1 or less 0, you can achieve the effect of “back-to-back” or “break-out before returning”. This is very popular in the interaction between button clicks, window pops.
Scenario three: brand personality. Different brands have different kinetic characteristics. Some brands seek extreme speed responses ( steep curves) and others seek elegance (squalid curves). This tool allows you to fine-tune the most dynamic effect that fits brand-modified.
3. Debugging techniques
Use this tool to debug
Compare Preview
Functions are very important. Put your custom curves and standard
ease
and
linear
Synchronization allows you to feel more clearly the speed difference between the start, middle and end stages of animation.