Programmers love their code.
1979
transform & transform-originperspective & perspective-originscale3d, rotateY, rotateY, rotateZ, translate3d
transition: [
<property> ||
<duration> ||
<timing-function> ||
<delay> ]
animaton: [
<name> ||
<duration> ||
<timing-function> ||
<delay> ||
<iteration-count> ||
<direction> ||
<fill-mode> ]
@keyframes animation-name {
0%, 100% {...}
from, to {...}
50% {...}
}
animationstartanimationendanimationiterationsetTimeout
requestAnimationFrame
var world = anima.js()var world = anima.css()
var item = world.add(
document.querySelector("div")
)
item.animate(...).css()
translate rotate scale
item.animate({
translate: [x, y, z],
duration: 500,
ease: 'ease-in-out-quad',
delay: 100
})
matrix3d(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
)
scale and translate
matrix3d(
sX, 0, 0, 0,
0, sY, 0, 0,
0, 0, sZ, 0,
tX, tY, tZ, 1
)
matrix3d(
cos(Y)cos(Z),
cos(X)*cos(Z)
+sin(X)sin(Y)cos(Z),
sin(X)sin(Z)
-cos(X)sin(Y)cos(Z), 0,
...
)
A×B≠B×Ascale×rotate×translate