Basic text
Fade a title in and out.
// One title animated with hand-rolled keyframes — addText + animate + $.wait.
const $ = new VideoFlow({
name: 'Basic Text',
width: 1920,
height: 1080,
fps: 30,
});
// fontSize is in em (1em = 1% of project width).
const title = $.addText({
text: 'Hello, VideoFlow!',
fontSize: 9,
fontWeight: 800,
color: '#ffffff',
});
// Entry: fade + scale-up. animate() pushes two keyframes and advances flow.
title.animate(
{ opacity: 0, scale: 0.8 },
{ opacity: 1, scale: 1 },
{ duration: '0.8s' },
);
$.wait('1.5s');
title.animate(
{ opacity: 1, scale: 1 },
{ opacity: 0, scale: 1.2 },
{ duration: '0.8s' },
);
return $;