One style $9 · any 5 for $29 · all 140 styles $79 · Team $199One style $9 · any 5 $29 · all $79 →

← Blog

Text animation code to MP4: CodePen effects as video

ReelStyles ·

A CodePen text animation runs in a browser tab and disappears when you close it. To keep it as a video, you port the effect to a timeline that a renderer can step through one frame at a time, then render it to MP4 with HyperFrames. The typing and slide-up reveals found on CodePen port in a few lines, and Claude Code can do the port for you. ReelStyles sells ready type styles, like kinetic type, when you want a whole look and not one effect.

Why a CodePen does not record well

A CSS animation plays in real time. A screen recorder captures it at whatever speed your computer manages, so frames drop and the cursor jitters. HyperFrames works differently. Its docs say rendering never plays the animation. It asks for one frame, waits, captures it, then asks for the next. For that to work the animation has to be seekable: the same frame number must always give the same picture.

The HyperFrames docs list CSS, GSAP, Anime.js, Lottie, Three.js and Web Animations among the animation types its runtime can seek, as long as they are registered. GSAP is the usual way to write them. So the safe route is to rewrite the effect as a paused GSAP timeline. I have not rendered these exact snippets for this post, so run the checks in step 4 on yours.

Step 1: pick the pen

Two effects cover most Shorts.

The typing effect. A typing demo usually uses a monospace font, white-space: nowrap, overflow: hidden, a width that grows from 0 and steps(N) easing, where N is the number of characters. A blinking border acts as the cursor.

The slide-up reveal. The h1 has overflow: hidden, and an inner span moves from translateY(100%) to translateY(0) with a cubic-bezier curve.

Step 2: set up HyperFrames

You need Node.js 22.19 or newer and FFmpeg. Then install the skills:

npx skills add heygen-com/hyperframes

Pick "Core Skills", restart Claude Code in an empty folder, and check that /hyperframes appears.

Step 3: port the effect

Paste the pen's HTML and CSS into Claude Code with this ask:

Using /hyperframes, turn this CodePen effect into a 9:16 video, 6 seconds long.
Rewrite the CSS animation as a paused GSAP timeline registered on
window.__timelines. No Date.now, no unseeded randomness.
[paste the pen's HTML and CSS]

For the typing effect, the port looks like this:

<div id="root" data-composition-id="root" data-start="0"
     data-width="1080" data-height="1920">
  <p id="line" class="clip" data-start="0" data-duration="6" data-track-index="1">
    Ship it on Friday.
  </p>
  <script>
    const tl = gsap.timeline({ paused: true });
    tl.fromTo("#line", { width: "0ch" },
      { width: "18ch", duration: 2, ease: "steps(18)" }, 0.5);
    tl.fromTo("#line", { borderRightColor: "#fff" },
      { borderRightColor: "transparent", duration: 0.5,
        ease: "steps(1)", repeat: 7 }, 0);
    window.__timelines = window.__timelines || {};
    window.__timelines["root"] = tl;
  </script>
</div>

The line has 18 characters, so the width goes from 0ch to 18ch in 18 steps, and the CSS on #line keeps white-space: nowrap, overflow: hidden, a monospace font and a border-right. The cursor tween has a fixed repeat count. An infinite blink gives the renderer a timeline with no end, and the HyperFrames docs say every composition needs a known end.

You should see the text grow letter by letter in the preview, with a cursor blinking at its edge.

Step 4: check and render

npx hyperframes lint
npx hyperframes check
npx hyperframes snapshot --at 0.5,1.5,2.5,4
npx hyperframes render --output typing.mp4

Open the snapshot stills and confirm the text stops at the right character. The docs warn that motion that looks fine in continuous playback can still break when the renderer jumps straight to a frame. For the exact same output across machines, they suggest npx hyperframes render --docker --output typing.mp4.

Common errors

Make it a Short

Put the text in the middle third of the 9:16 frame, with large type and plenty of margin. For a full channel look with matching colours and motion, see kinetic typography video with Claude Code and particle text animation. The pricing page shows what the kits include.

Questions

Can I record a CodePen with a screen recorder instead?

You can, but the speed depends on your computer. A frame-by-frame render gives the same result every time.

Does HyperFrames cost anything?

The docs say the framework, CLI and skills are Apache-2.0 and that local rendering needs no account.

Can the same code make text that follows a voice?

Yes. Ask Claude to time each line to the audio file, and see voiceover for Claude Code videos.

Sources

The CodePen patterns are common CSS (width, steps(), overflow hidden), so I link no single pen. The HyperFrames facts come from its own docs:

See all 140 styles and the price