THE LANGUAGE

Write a video in plain text.

puffinclips videos are short scripts: shapes, text, and keyframes that say how they change. You never have to write one yourself, because the assistant does it for you. But if you want to tweak a detail, or you are curious, this is the whole language, in about ten minutes.

Try it in the editor →
01

Your first video

A puffinclips video is a short text file. You declare shapes, then say how they change over time. That is all the language is. The same file always renders the same video.

Every script starts with one video block. After that you list shapes, and below them the keyframes: at 1.2s hello { ... } means "at 1.2 seconds, make hello look like this".

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

text hello { text: "Hello, puffin"; font: "bold"; size: 64; x: 320; y: 190; fill: #f6f0e4; opacity: 0; }

at 0.5s hello { opacity: 0; }
at 1.5s hello ease out { opacity: 1; y: 170; }
A frame rendered from the script above
Fades in and floats up 20 pixels.
02

The video block

Exactly one video block, at the top. Times are written 2s or 500ms.

SettingWhat it doesDefault
width, heightSize in pixels (1 to 4096)640 × 360
fpsFrames per second30
durationLength, like 12s4s
backgroundA colour#14141c
format"vertical" (1080×1920), "square", "1080p", "720p", "4k", "portrait""custom"
grain, vignetteFilm grain and dark edges, 0 to 10
scaleRender at more pixels, same layout1

Two constants are always available: width and height. Use them so your layout survives a size change.

script
video { format: "vertical"; duration: 12s; background: #0f1d33; grain: 0.04; vignette: 0.3; }

rect card { x: width / 2; y: height / 2; w: width - 160; h: 600; radius: 40; fill: #f6f0e4; }
A frame rendered from the script above
Using width and height keeps things centred in any format.
03

Shapes

A shape is kind name { property: value; }. The name is how you refer to it later. Every shape can be moved with x and y (its centre), turned with rot (degrees), sized with scale, and faded with opacity (0 to 1).

ShapeIts own properties
rectw h radius
circler
ellipserx ry
linex2 y2 (the end, relative to x, y)
polygonr sides
starr points inner
texttext size font align max_width
pathpoints or SVG data d
imagesrc w h fit
groupholds other shapes

Shapes can have an outline: stroke and stroke_width. Use fill: none; for outline only.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

rect box { x: 90; y: 100; w: 110; h: 80; radius: 14; fill: #ff6a2b; }
circle dot { x: 250; y: 100; r: 44; fill: #f6f0e4; }
ellipse egg { x: 400; y: 100; rx: 60; ry: 40; fill: none; stroke: #7fb0ff; stroke_width: 6; }
star spark { x: 550; y: 100; r: 48; points: 5; fill: #ff6a2b; }
polygon hex { x: 150; y: 260; r: 50; sides: 6; fill: #7fb0ff; }
line dash { x: 260; y: 260; x2: 150; y2: 0; stroke: #f6f0e4; stroke_width: 8; }
text label { text: "Shapes"; size: 40; font: "bold"; x: 500; y: 260; fill: #f6f0e4; }

stagger 100ms over [box, dot, egg, spark] { enter pop 0.2s 400ms; }
A frame rendered from the script above
04

Colours and gradients

Colours are written #rgb, #rrggbb or #rrggbbaa (the last two digits are transparency). none means transparent. Gradients are linear(angle, c1, c2, ...), radial(c1, c2, ...) and conic(angle, ...).

Helpers: rgb(r,g,b), hsl(h,s,l) and mix(c1, c2, 0.5).

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

rect a { x: 120; y: 180; w: 160; h: 240; radius: 20; fill: linear(90, #ff6a2b, #ff2f6d); }
rect b { x: 320; y: 180; w: 160; h: 240; radius: 20; fill: radial(#f6f0e4, #3563b8); }
rect c { x: 520; y: 180; w: 160; h: 240; radius: 20; fill: conic(0, #ff6a2b, #7fb0ff, #ff6a2b); }

stagger 150ms over [a, b, c] { enter fade_up 0.2s 500ms; }
A frame rendered from the script above
05

Keyframes: making things move

at TIME name { property: value; } sets the value at that time, and the shape glides there from its previous keyframe. Before its first keyframe a shape holds the value you declared it with.

Inside at, a property name means its previous value, so x: x + 200; means "move 200 to the right of where you were". Add ease NAME to shape the movement.

Tip. Interpolation starts from the previous keyframe, not from time zero. To make something appear at 3 seconds without drifting in from the start, use enter (next sections), or add a keyframe just before: at 2.9s a { opacity: 0; }.
script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

circle ball { x: 100; y: 180; r: 40; fill: #ff6a2b; }

at 0.5s ball { x: 100; }
at 2s ball ease in_out { x: x + 440; }
at 3.5s ball ease bounce { y: 280; r: 28; }
A frame rendered from the script above
"x: x + 440" is relative to the previous keyframe.
06

Easing

Easing is the personality of a move. Write ease NAME on the keyframe where the move ends.

NameFeel
linearConstant speed
in / out / in_outStart slow / end slow / both
smoothGentle in and out
backOvershoots a little, then settles
bounceLands and bounces
elasticSpringy wobble
stepJumps at the end
cubic(x1, y1, x2, y2)Any CSS cubic-bezier curve
spring(stiffness, damping)Physical spring. spring(120, 12) overshoots, spring(100, 40) does not
script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

rect a { x: 80; y: 90; w: 60; h: 60; radius: 12; fill: #f6f0e4; }
rect b { x: 80; y: 180; w: 60; h: 60; radius: 12; fill: #7fb0ff; }
rect c { x: 80; y: 270; w: 60; h: 60; radius: 12; fill: #ff6a2b; }

at 0.3s a { x: 80; }  at 2.5s a ease linear { x: 560; }
at 0.3s b { x: 80; }  at 2.5s b ease back { x: 560; }
at 0.3s c { x: 80; }  at 2.5s c ease spring(120, 12) { x: 560; }
A frame rendered from the script above
Same move, three easings.
07

Entrances, exits and show

Most of the time you just want something to appear nicely. Presets do that in one line:

enter NAME PRESET START DURATION;   // enter title fade_up 1s 600ms;
exit  NAME PRESET START DURATION;   // exit  title fade 5s 400ms;

Presets: fade fade_up fade_down slide_left slide_right slide_up slide_down pop wipe. Duration defaults to 500ms, and you can add ease back and so on.

show NAME from 1s to 4s; keeps a shape visible only between two times.

script
video { width: 640; height: 360; fps: 30; duration: 5s; background: #0f1d33; }

text title { text: "Launch day"; font: "bold"; size: 64; x: 320; y: 150; fill: #f6f0e4; }
text sub { text: "Everything is ready"; size: 28; x: 320; y: 220; fill: #7fb0ff; }

enter title fade_up 0.4s 700ms ease out;
enter sub fade 1s 600ms;
exit title fade 4s 500ms;
exit sub fade 4s 500ms;
A frame rendered from the script above
08

Sequences and stagger

Stagger runs the same entrance on a list of shapes, each a little later than the one before:

stagger 120ms over [a, b, c] { enter fade_up 1s 500ms; }

Sequence chains steps. Steps start together unless you write then, which waits for the earlier ones. wait 1s; pauses.

You can also give one keyframe to a whole list: at 2s over [a, b, c] { opacity: 0.2; }, or time a keyframe relative to the previous one: at +500ms name { ... }.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

rect a { x: 160; y: 180; w: 100; h: 100; radius: 18; fill: #ff6a2b; }
rect b { x: 320; y: 180; w: 100; h: 100; radius: 18; fill: #f6f0e4; }
rect c { x: 480; y: 180; w: 100; h: 100; radius: 18; fill: #7fb0ff; }

stagger 200ms over [a, b, c] { enter pop 0.5s 500ms ease back; }
A frame rendered from the script above
09

Text and fonts

Text is a shape. size is in pixels. align is "left", "center" (default) or "right": it decides which part of the text sits on x. Set max_width to wrap long text. \n starts a new line. Text is drawn as vector shapes, so it stays sharp when scaled.

Fonts (use font: "name"): sans bold serif mono display bebas condensed grotesk playfair dmserif script hand comic heavy retro code. Only these exist; there are no custom fonts yet.

Other text properties: letter_spacing, line_height, font_weight on fonts that support it.

Tip. Text with a {value} placeholder lets you count numbers up: text: "£{value:.2f}"; value: 0; then animate value.
script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

text big { text: "Make it\nmemorable"; font: "heavy"; size: 52; line_height: 1.05; align: "left"; x: 40; y: 110; fill: #f6f0e4; }
text small { text: "Wrapped text stays inside the box you give it, however long the sentence turns out to be."; font: "sans"; size: 22; align: "left"; max_width: 240; x: 370; y: 90; fill: #7fb0ff; }
text count { text: "{value:.0f}% done"; value: 0; font: "code"; size: 28; x: 460; y: 290; fill: #ff6a2b; }

at 0.2s count { value: 0; }
at 2.5s count ease out { value: 87; }
A frame rendered from the script above
Counting numbers use a {value} placeholder.
10

Variables and maths

let name = expression; defines a constant. Define it before you use it. Expressions use + - * /, brackets, and these functions:

min max abs clamp(v, lo, hi) round floor ceil sqrt pow(b, e) mod lerp(a, b, t) sin cos tan atan2 exp ln noise random(min, max, seed) wiggle(freq, amount) rgb hsl mix.

Careful. sin and cos take degrees. There is no ^ operator: write pow(x, 2) or x * x. Strings cannot be joined with +.
script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

let cx = width / 2;
let cy = height / 2;
let orbit = 100;

circle sun { x: cx; y: cy; r: 30; fill: #ff6a2b; }
circle planet { x: cx + orbit; y: cy; r: 14; fill: #7fb0ff; }

at 0s planet { x: cx + orbit; y: cy; }
at 1s planet ease linear { x: cx; y: cy + orbit; }
at 2s planet ease linear { x: cx - orbit; y: cy; }
at 3s planet ease linear { x: cx; y: cy - orbit; }
at 4s planet ease linear { x: cx + orbit; y: cy; }
A frame rendered from the script above
11

Repeat

repeat i in 0..8 { ... } makes copies. Use {i} in names and i in numbers (even in times). {i+1} works inside text.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

repeat i in 0..8 {
  rect bar{i} { x: 100 + i * 63; y: 300; w: 40; h: 10; anchor: "bottom"; radius: 6; fill: mix(#7fb0ff, #ff6a2b, i / 7); }
  at 0.5s + i * 120ms bar{i} { h: 10; }
  at 1.5s + i * 120ms bar{i} ease back { h: 60 + i * 24; }
}
A frame rendered from the script above
Eight bars, each starting 120ms after the last.
12

Groups

A group is a container. Move, rotate, scale or fade the group and everything inside follows. Children are positioned relative to the group's own x, y.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

group logo { x: 320; y: 180;
  circle disc { r: 80; fill: #f6f0e4; }
  polygon beak { x: 14; r: 34; sides: 3; rot: 90; fill: #ff6a2b; }
  circle eye { x: -22; y: -18; r: 9; fill: #0f1d33; }
}

at 0s logo { scale: 0.2; rot: -40; }
at 1.2s logo ease back { scale: 1; rot: 0; }
at 3s logo ease in_out { y: 160; }
A frame rendered from the script above
One keyframe moves the whole logo.
13

Components and layout

A component is a reusable group with parameters. Make one, then use it like a shape. row, stack and grid place their children automatically, so you never calculate positions.

component card(label, size = 40) {
  rect bg { w: size; h: size; }
  text t { text: label; }
}
card c1 { label: "Hi"; x: 100; y: 80; }     // its parts are c1.bg and c1.t

Layout options: gap, align (start, center, end), justify, padding, and columns for grids. The container's x, y is its centre.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

component pill(label) {
  rect bg { w: 150; h: 56; radius: 28; fill: #ff6a2b; }
  text t { text: label; font: "bold"; size: 24; fill: #0f1d33; }
}

row tags { x: 320; y: 180; gap: 20;
  pill p1 { label: "Fast"; }
  pill p2 { label: "Exact"; }
  pill p3 { label: "Yours"; }
}

stagger 150ms over [p1, p2, p3] { enter fade_up 1s 500ms; }
A frame rendered from the script above
The row spaces the three pills for you.
14

Effects

Add depth with shadow: (x, y, blur, colour), glow: (radius, colour), inner_shadow and blur. They also work on groups. blend mixes with what is underneath: "add", "multiply", "screen" and more. trim_end from 0 to 1 draws a line or outline on.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

rect card { x: 200; y: 180; w: 220; h: 160; radius: 20; fill: #f6f0e4; shadow: (0, 18, 24, #00000088); }
circle glow { x: 470; y: 180; r: 50; fill: #ff6a2b; glow: (30, #ff6a2baa); }
path swoosh { points: [(80, 320), (250, 280), (420, 330), (580, 290)]; smooth: true; stroke: #7fb0ff; stroke_width: 6; fill: none; trim_end: 0; }

at 0.3s swoosh { trim_end: 0; }
at 2.5s swoosh ease out { trim_end: 1; }
A frame rendered from the script above
15

Graphs

plot draws a function as a line you can animate like any path. fn uses the variable u. from and to set its range, xscale and yscale are pixels per unit, and x, y is the graph's origin. Animate trim_end from 0 to 1 to draw it on.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

line axis { x: 40; y: 180; x2: 560; y2: 0; stroke: #ffffff44; stroke_width: 2; }
plot wave { x: 60; y: 180; fn: sin(u * 60); from: 0; to: 12; xscale: 40; yscale: 90; stroke: #ff6a2b; stroke_width: 5; trim_end: 0; }

at 0.2s wave { trim_end: 0; }
at 3s wave ease in_out { trim_end: 1; }
A frame rendered from the script above
sin takes degrees, so u * 60 gives a wave every 6 units.
16

Controls with @

Put an attribute before a let and it becomes a control in the Script tab. Change the control and the picture updates, without touching the code.

AttributeControl
@slider(min, max, step)A slider and number box (step is optional)
@colorA colour picker
@textA text box
@choice("a", "b")A dropdown

"Apply to script" writes the chosen values back into the code. Use them like any variable: x: travel;, fill: ink;, text: headline;.

script
video { width: 640; height: 360; fps: 30; duration: 4s; background: #0f1d33; }

@text   let headline = "Edit me";
@color  let ink = #ff6a2b;
@slider(40, 120, 1) let headline_size = 72;

text title { text: headline; font: "bold"; size: headline_size; x: 320; y: 180; fill: ink; }
A frame rendered from the script above
Three controls appear in the Script tab for this.
17

Photos and sound

Photos need a file in your project (add them with the Photos button). Use image with a frame size and fit: "cover" fills the frame and crops, "contain" shows the whole picture. Give a photo a slow push-in by animating scale.

image shot { src: "bread.jpg"; x: 540; y: 900; w: 760; h: 900; fit: "cover"; radius: 36; }
at 0s shot { scale: 1; }
at 6s shot ease in_out { scale: 1.12; }

Put text on a photo only with a dark rectangle behind it (try opacity: 0.45).

Sound: audio "music.mp3" { volume: 0.25; fade_in: 1s; fade_out: 2s; loop: true; }. A voice-over is added for you as a narration track when you turn Voice-over on (Pro).

18

Themes

theme midnight; gives your video a ready palette: midnight daylight neon sunset forest ocean mono. Use its colours as theme.primary, theme.accent, theme.text, theme.muted, theme.surface and theme.background. Override one: theme neon { primary: #ff8800; }.

script
theme sunset;
video { width: 640; height: 360; duration: 3s; }

rect card { x: 320; y: 180; w: 420; h: 200; radius: 28; fill: theme.surface; }
text t { text: "Themed"; font: "bold"; size: 56; x: 320; y: 180; fill: theme.primary; }
A frame rendered from the script above
19

Common mistakes

You wroteDo this instead
"M 0 0 A " + xStrings cannot be joined with +. Use points: [...] or a literal d.
x ^ 2pow(x, 2) or x * x
sin(3.14)sin takes degrees. Use sin(deg(3.14)) for radians.
A shape pops in from nowhere at 3sUse enter name fade 3s, or add an earlier keyframe.
at 2s box { x: 100 }Properties end with a semicolon: x: 100;
Two lines of text overlappingPut them in a stack, or space the y values by at least the text size.
A photo name that is not in your projectOnly attached files exist. Check the Photos tab.

Every error names its line, and the Script tab lists them under the picture: click one to jump there.

Or skip all of it and just describe the video.

Make my video →