mockup of
gsaplib with some core features.
from,to,fromTomethodstimelinemethod- last parameter of
from,to,fromTomethods is an object withdelay,duration,easeproperties - last parameter of
timelinemethod is an object withoffset,duration,easeproperties
duration,offsetproperties are in secondsratateproperty is in degreesopacityproperty is in range from 0 to 1x,yproperties are in pixels, but you can use percentage valuesx: "50%"
from,to,fromTo
- runs animation immediately
animate.from(
"h1",
{
y: -20,
opacity: 0,
},
{
duration: 2,
ease: "power4.out",
},
);- runs animation sequentially. controls with
offsetproperty
const tl = animate.timeline();
tl.fromTo(
"h1",
{
y: -20,
opacity: 0,
},
{
y: 20,
opacity: 1,
rotate: 45,
},
{
duration: 2,
ease: "power4.out",
},
);
tl.from(
"h2",
{
y: 20,
opacity: 0,
},
{
duration: 0.7,
ease: "power4.out",
},
);
tl.to(
"h3",
{
y: -10,
x: 100,
opacity: 0,
rotate: 90,
},
{
duration: 0.7,
ease: "power4.out",
},
);