Exemple:
.block {
transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}
La fonction cubic-bezier()
permet de définir un timing personnalisé pour une transition donnée.
cubic-bezier(x1,y1,x2,y2)
Les coordonnées indiquent les positions des poignées Bezier de début et de fin (entre 0 et 1).
La courbe créée correspond à l’accélération de l’animation au fil du temps:
Quelques exemples:
Courbes béziers
Les mots clés ease
, linear
, ease-in
, ease-out
, ease-in-out
sont des raccourcis pour les courbes bézier usuelles.
Exemple:
.animate {
animation: my-animation .8s steps(10) infinite;
}
La fonction steps permet d’afficher une animation par saccades,
ce qui peut permettre de simuler une animation GIF par exemple.
steps(<integer>, [start \| end])
Quelques exemples:
|
|
|
Hello
|