Hook Clock Roll 1
The stuck moment on a clock. Huge figures roll digit by digit to the time that hurts over a dark night scene, land hard, and the hook line types on beneath them. It is the cold, pain-led opening beat of a VSL or video ad (16:9, 9:16 and 1:1), never a deadline countdown.
Use it in a prompt
Use the video/hook-clock-roll video frame from the FunnelDNA library in my brand (landscape and vertical and square). Follow the video skill. Ask me for the script facts, voice and images you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/video/hook-clock-roll.tsx. - Import it and pass your copy and images (Props tab):
import { HookClockRoll } from "@/components/funneldna/video/hook-clock-roll"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/hook-clock-roll/component.tsx 322 lines
// When to use: The stuck moment on a clock. Huge figures roll digit by digit to the time that hurts over a dark night scene, land hard, and the hook line types on beneath them. It is the cold, pain-led opening beat of a VSL or video ad (16:9, 9:16 and 1:1), never a deadline countdown.
import * as React from "react"
import { useVideoConfig } from "remotion"
import { Pattern, type BackdropTreatment } from "../fx/fx"
import {
HOLD, IN_OUT, SafeArea, StageLight, StagePhoto, TONES, VideoStage, display, ok, phraseRange, progress, springAt, SPRINGS, tween,
useFitText, useHeld, useStage, useWords,
type StageTone, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 140, formats: ["landscape", "vertical", "square"], poster: 130 } satisfies VideoMeta
export type HookClockRollProps = {
format?: VideoFormat
durationInFrames?: number
/** Starting figures: a time ("09:57", "1:59:58") or a plain whole number. Digits and colons only. */
from?: string
/** The figures the roll lands on, the moment itself ("10:00"). Same shape as `from`. */
to?: string
/** Small mark with the figures ("a.m.", "p.m."): beside them in landscape, tucked under them in 9:16 and 1:1; empty draws nothing. */
suffix?: string
/** The hook line that types on under the figures, one short sentence about the moment. */
line?: string
/** The phrase inside `line` whose colour steps to the accent as it is spoken. */
highlight?: string
/** Voice timings for `line`. Without them the words land evenly after the last tick. */
words?: Word[]
/** The field: band (the dark end of the palette, default) or surface (the bright end). */
tone?: Exclude<StageTone, "card">
/** Scene photo behind the figures (pass slot("scene", …)): a slow push with a scrim pooled behind the type. Without one, faded rings and a stage light. */
scene?: string
/** How the photo takes the theme: natural (its own colours under a scrim) or duotone (mapped to the tokens). */
treatment?: BackdropTreatment
/** Photo focal point (CSS object-position). */
focus?: string
}
/** Height of one digit window, in em of the figures: the 1em line plus clearance so no glyph touches the clip edge. */
const CELL = 1.12
/** Side padding inside each digit window, in em, so wide faces (Montserrat, Archivo Black) never meet the edge. */
const PAD = 0.05
/** Rendered width of the figures over their bare measured width (window padding plus the colon's air). */
const SPREAD = 1.14
/** Furthest a rendered digit layer may sit from its window, in windows, so no layer is ever drawn fully outside it. */
const EDGE = 0.995
/** Tallest glyph box (ascent + descent, in em) among the library's display faces (Playfair reaches 1.33): text boxes overhang their line by half the excess. */
const FACE = 1.34
/** Furthest the last tick's spring undershoot lets a figure sink, in em of the figures. */
const DIP = 0.03
/** Clear air between the figures' lowest glyph box and the line's highest, in em of the figures. */
const AIR = 0.1
/** Line height of the hook line. */
const LINE_LH = 1.06
type Layout = {
/** Share of the safe width the figures fill, and the share when a side suffix shares the row. */
figW: number; figWSide: number
/** Share of the safe height the figures may take, and their largest size (stage px). */
figH: number; figMax: number
/** Suffix size as a share of the figures. */
suf: number
line: { w: number; guess: number; max: number; min: number; lines: number[] }
}
/** Each format composed on purpose: wide figures with a side suffix in 16:9, a stacked tower in 9:16, a centred block in 1:1. */
const LAYOUT: Record<VideoFormat, Layout> = {
landscape: { figW: 0.86, figWSide: 0.76, figH: 0.54, figMax: 440, suf: 0.2, line: { w: 0.94, guess: 116, max: 130, min: 90, lines: [1, 2, 3] } },
vertical: { figW: 0.86, figWSide: 0.86, figH: 0.34, figMax: 360, suf: 0.24, line: { w: 1, guess: 130, max: 150, min: 84, lines: [2, 3, 4] } },
square: { figW: 0.9, figWSide: 0.9, figH: 0.42, figMax: 330, suf: 0.22, line: { w: 1, guess: 112, max: 128, min: 84, lines: [2, 3] } },
}
const FIG_LINES = [1]
/** Hook: the figures roll tick by tick, the last tick lands hard, the frame dims and the line types on beneath. */
export function HookClockRoll({
format = "landscape",
durationInFrames = video.durationInFrames,
from = "09:57",
to = "10:00",
suffix = "",
line = "",
highlight,
words,
tone = "band",
scene,
treatment = "natural",
focus,
}: HookClockRollProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { text, u, width, height } = useStage()
const colors = TONES[tone]
const field = tone === "band" ? "--band" : "--surface"
const L = LAYOUT[format] ?? LAYOUT.landscape
// 9:16 and 1:1 stack the suffix under the figures so the figures take the full width; 16:9 sets it beside them.
const stack = format !== "landscape"
// The roll: discrete ticks that come faster and faster, and the last one lands on a firm spring at `land` (about 2 s).
const clock = React.useMemo(() => readClock(from, to), [from, to])
const start = 8
const land = Math.max(start + 12, Math.min(60, durationInFrames - HOLD - 44))
const roll = rollAt(f, fps, clock.a, clock.b, start, land)
const shown = formatValue(roll.cur, clock.widths)
const coming = formatValue(roll.next, clock.widths)
// Motion: the photo's slow push, the rise, the ticks, the blinking colon, the hard landing and the words.
const rise = (1 - progress(f, 0, 10)) * 16 * u
const beat = f >= land ? 1 + 0.05 * (1 - springAt(f, land, fps, SPRINGS.firm)) : 1
const dim = progress(f, land, land + 3, (t) => t)
const ringScale = tween(f, [0, durationInFrames - HOLD], [1, 1.07], IN_OUT)
const colonOn = f >= durationInFrames - HOLD || Math.floor(f / 15) % 2 === 0
// Display type is measured in the theme's own face, inside the real boxes it is drawn in.
const areaW = width - text.left - text.right, areaH = height - text.top - text.bottom
const sideSuffix = !!suffix && !stack
const figRef = React.useRef<HTMLDivElement>(null)
const figW = (areaW * (sideSuffix ? L.figWSide : L.figW)) / SPREAD
const figH = areaH * L.figH
const fig = useFitText(figRef, clock.widest, {
boxW: figW, boxH: figH, guess: Math.min(figH / CELL, figW / (Math.max(1, clock.widest.length) * 0.6)),
max: L.figMax * u, min: 120 * u, lines: FIG_LINES,
})
const sufSize = Math.max(56 * u, fig * L.suf)
const sufLift = stack ? fig * 0.1 : 0
const stacked = !!suffix && stack
// The figures block as laid out, and the lowest glyph box inside it (the face's full ascent + descent, plus the
// last tick's settle dip), so the line clears what is drawn, not just the boxes.
const blockH = fig * CELL + (stacked ? sufSize - sufLift : 0)
const reach = Math.max(fig * (CELL + (FACE - CELL) / 2 + DIP), stacked ? blockH + (sufSize * (FACE - 1)) / 2 : 0)
const clearBase = reach - blockH + fig * AIR
const lineOver = (px: number) => (px * (FACE - LINE_LH)) / 2
const lineRef = React.useRef<HTMLHeadingElement>(null)
const lineW = areaW * L.line.w
const lineH = Math.max(areaH - blockH - clearBase - lineOver(L.line.max * u), 140 * u)
const lineSize = useFitText(lineRef, line, {
boxW: lineW, boxH: lineH, guess: L.line.guess * u,
max: L.line.max * u, min: L.line.min * u, lines: L.line.lines,
})
// At least a tenth of the figure size of clear air between the two blocks in every format and every frame.
const gap = clearBase + lineOver(lineSize)
// Type-on under the figures: an even pace after the landing, or the voice's own timing.
const wordsFrom = land + 4
const count = line.split(/\s+/).filter(Boolean).length
const lastAt = Math.max(wordsFrom, Math.min(durationInFrames - HOLD - 20, wordsFrom + 8 * Math.max(0, count - 1)))
const timed = useWords(line, words, durationInFrames, { from: wordsFrom, span: lastAt / durationInFrames })
const range = phraseRange(timed, highlight)
const stepAt = range ? Math.min(timed[range[1] - 1].at + 3, durationInFrames - HOLD - 4) : durationInFrames
const step = range ? progress(f, stepAt, stepAt + 3, (t) => t) : 0
// Colour-step target: the text-safe accent on the surface; on the band, the brand accent lifted toward the band's
// (neutral) text colour in OKLCH, so it keeps its hue and chroma and holds contrast.
// 42% accent keeps the hue readable while staying light enough for 4.5:1 over the scrimmed photo under every theme.
const keyInk = tone === "band" ? "color-mix(in oklch, var(--accent-fill, var(--accent)) 42%, var(--band-ink))" : "var(--accent)"
const light = 0.16 - 0.06 * dim
const parts: React.ReactNode[] = []
timed.forEach((x, i) => {
const k = progress(f, x.at, x.at + 6)
const c = range && i >= range[0] && i < range[1] ? step : 0
parts.push(
<span key={x.i} style={{
display: "inline-block", opacity: k, transform: `translateY(${(1 - k) * 18 * u}px)`,
color: c > 0 ? `color-mix(in oklch, ${keyInk} ${Math.round(c * 100)}%, ${colors.ink})` : undefined,
}}>{x.w}</span>,
)
if (i < timed.length - 1) parts.push(" ")
})
// Each digit window is sized by the face itself (an invisible tabular 0 plus padding) and clips only vertically,
// so no glyph is ever cut at the sides. It holds the digit on screen and, mid-tick, only the one rolling in.
const len = Math.max(shown.length, coming.length)
const a = shown.padStart(len, " "), b = coming.padStart(len, " ")
const cells = [...a].map((ch, i) => {
if (ch === ":") {
return (
<span key={i} style={{ display: "inline-flex", alignItems: "center", flex: "none", height: `${CELL}em`, padding: "0 0.02em", visibility: colonOn ? "visible" : "hidden" }}>
<span style={{ display: "block", lineHeight: 1, transform: "translateY(-0.05em)" }}>:</span>
</span>
)
}
const next = b[i] ?? ch
const r = ch === next ? 0 : roll.r
// Only layers at least partly inside the window render: the outgoing digit while it is still rolling out
// (0 < r < 1), the incoming one once it has started (r > 0). A settled window (r = 0, or the last tick at or past
// r = 1) holds exactly one digit, so no layer is ever left fully rolled out above or below the frame.
const rolling = r > 0 && r < 1
return (
<span key={i} style={{
position: "relative", display: "inline-block", flex: "none", height: `${CELL}em`, minWidth: "0.6em", padding: `0 ${PAD}em`,
overflowX: "visible", overflowY: "clip", textAlign: "center",
}}>
<span aria-hidden style={{ display: "block", lineHeight: `${CELL}em`, visibility: "hidden" }}>0</span>
{r > 0 ? null : <DigitLayer key="settled" ch={ch} y={0} />}
{rolling ? <DigitLayer key="out" ch={ch} y={Math.max(-EDGE, -r)} /> : null}
{r > 0 ? <DigitLayer key="in" ch={next} y={Math.max(-EDGE, Math.min(EDGE, 1 - r))} /> : null}
</span>
)
})
return (
<VideoStage format={format} tone={tone}>
{scene
? <StagePhoto src={scene} frame={f} dur={durationInFrames - HOLD} push={format === "square" ? [1.04, 1.1] : [1.03, 1.09]} treatment={treatment}
tone={tone === "band" ? "band" : "surface"} side="center" position={focus} />
: (
// Without a photo: faded rings fill the stage, centred on the type, slowly pushing in.
<div aria-hidden style={{
position: "absolute", left: "50%", top: text.top + areaH / 2, width: width * 1.3, height: height * 1.3, zIndex: 0,
pointerEvents: "none", transform: `translate(-50%, -50%) scale(${ringScale})`, opacity: 1 - 0.06 * dim,
}}>
<Pattern name="rings" tone={colors.fx} fade="edges" />
</div>
)}
{scene || tone !== "band" ? null : <StageLight x="50%" strength={light} tone={colors.fx} floor={false} />}
{/* A pool of the field's own colour behind the figures and line, so the daylight in the photo never sits under the type. */}
{scene ? (
<div aria-hidden style={{
position: "absolute", left: text.left + areaW / 2, top: text.top + areaH / 2, width: areaW * 1.3, height: areaH * 1.25,
transform: "translate(-50%, -50%)", pointerEvents: "none", zIndex: 0,
background: `radial-gradient(closest-side, ${ok(field, 0, 0.86)}, ${ok(field, 0, 0.8)} 55%, ${ok(field, 0, 0.5)} 80%, ${ok(field, 0, 0)})`,
}} />
) : null}
{/* The frame dims at the hard tick; only the field darkens, so the type keeps its contrast. */}
<div aria-hidden style={{
position: "absolute", inset: 0, pointerEvents: "none",
background: `oklch(from var(--shadow, oklch(0.22 0.03 260)) calc(l - 0.12) c h / ${(0.06 * dim).toFixed(3)})`,
}} />
<SafeArea style={{ justifyContent: "center", alignItems: "center", textAlign: "center" }}>
{/* The rise moves figures and line together, so the air between them never closes. */}
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", width: "100%", transform: `translateY(${rise}px)` }}>
{/* The landing beat grows from the block's bottom edge, upward, away from the line. */}
<div style={{
position: "relative", display: "flex", flexDirection: stack ? "column" : "row", alignItems: stack ? "flex-end" : "flex-start",
gap: stack ? 0 : fig * 0.05, transform: `scale(${beat})`, transformOrigin: "50% 100%",
}}>
{/* Lining figures: serif display faces otherwise drop 9 and 5 below the line and the clock bounces. */}
<div ref={figRef} role="img" aria-label={[formatValue(clock.b, clock.widths), suffix].filter(Boolean).join(" ")} style={{
...display(fig, { lineHeight: 1, letterSpacing: 0, whiteSpace: "nowrap" }),
display: "flex", alignItems: "flex-start", fontVariantNumeric: "tabular-nums lining-nums", color: colors.ink,
}}>
{cells}
</div>
{suffix ? (
<div aria-hidden style={{
...display(sufSize, { lineHeight: 1, letterSpacing: 0, whiteSpace: "nowrap" }), color: colors.ink,
marginTop: stack ? -sufLift : fig * 0.17, marginRight: stack ? fig * PAD : 0,
}}>
{suffix}
</div>
) : null}
</div>
{line ? (
<h2 ref={lineRef} style={{ ...display(lineSize, { lineHeight: LINE_LH }), margin: 0, marginTop: gap, maxWidth: lineW, color: colors.ink }}>
{parts}
</h2>
) : null}
</div>
</SafeArea>
</VideoStage>
)
}
export default HookClockRoll
/** One digit inside its window, shifted by `y` windows (0 = in place, toward -1 = rolling out above, toward 1 = waiting below). */
function DigitLayer({ ch, y }: { ch: string; y: number }) {
return (
<span style={{
position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", lineHeight: 1,
transform: `translateY(${(y * 100).toFixed(3)}%)`,
}}>{glyph(ch)}</span>
)
}
/** Ticks up to this many roll one by one. Longer runs roll continuously, faster and faster, into the same hard stop. */
const DISCRETE = 6
/** Frames one tick takes to roll. */
const ROLL = 5
/** Mixed-radix value of figures split at colons (later segments count to 60); widths keep each segment's padding. */
function readClock(from: string, to: string) {
const split = (s: string) => s.split(":").map((p) => p.replace(/\D/g, ""))
const bp = split(to)
const ap = split(from).slice(-bp.length)
while (ap.length < bp.length) ap.unshift("0")
const value = (parts: string[]) => parts.reduce((v, p, i) => (i ? v * 60 : 0) + (Number(p) || 0), 0)
const widths = bp.map((p, i) => (bp.length > 1 ? Math.max(p.length, (ap[i] ?? "").length, i ? 2 : 1) : 1))
const a = value(ap), b = value(bp)
const fa = formatValue(a, widths), fb = formatValue(b, widths)
return { a, b, widths, widest: (fa.length > fb.length ? fa : fb).replace(/\d/g, "0") }
}
function formatValue(v: number, widths: number[]) {
let rest = Math.max(0, Math.round(v))
const out: string[] = []
for (let i = widths.length - 1; i > 0; i--) {
out.unshift(String(rest % 60).padStart(widths[i], "0"))
rest = Math.floor(rest / 60)
}
out.unshift(String(rest).padStart(widths[0], "0"))
return out.join(":")
}
/** The value shown, the value rolling in, and how far the roll has come (it may overshoot a little on the last tick). */
function rollAt(f: number, fps: number, a: number, b: number, start: number, land: number) {
const n = Math.abs(b - a), dir = b >= a ? 1 : -1
if (!n) return { cur: a, next: a, r: 0 }
if (n > DISCRETE) {
const k = progress(f, start, land, (t) => t * t) * n
const i = Math.min(n, Math.floor(k))
return i >= n ? { cur: b, next: b, r: 0 } : { cur: a + dir * i, next: a + dir * (i + 1), r: k - i }
}
const tick = (k: number) => Math.round(start + (land - start) * Math.pow(k / n, 0.62))
for (let k = n; k >= 1; k--) {
const s = tick(k) - ROLL
if (f < s) continue
if (k === n) return f >= s + 24 ? { cur: b, next: b, r: 0 } : { cur: a + dir * (n - 1), next: b, r: springAt(f, s, fps, SPRINGS.firm) }
const r = progress(f, s, s + ROLL, (t) => t * t)
return r >= 1 ? { cur: a + dir * k, next: a + dir * k, r: 0 } : { cur: a + dir * (k - 1), next: a + dir * k, r }
}
return { cur: a, next: a, r: 0 }
}
const glyph = (ch: string) => (ch === " " ? "\u00a0" : ch)
pieces/video/hook-clock-roll/specimen.tsx 28 lines
import * as React from "react"
import night from "../../fx/backdrops/night"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { HookClockRoll, video, type HookClockRollProps } from "../hook-clock-roll"
export const states = ["landscape", "vertical", "square"]
/** Start value on screen, the last tick landing, the line typed on, final hold. */
export const keyframes = [8, 62, 100, 139]
// Fictional sample: Dayshade Sleep, a sleep coaching programme for night-shift workers.
export const sample: HookClockRollProps = {
from: "09:57",
to: "10:00",
suffix: "a.m.",
line: "and you are still awake.",
highlight: "still awake.",
// The designed still (fx "Desk at night", bundled with the fx kit so every render can load it); the specimen swaps in the brand's scene slot at render time.
scene: night,
focus: "60% 50%",
}
/** The sample business in its own colours and type (sample-palettes.md: plum-night · workhorse); Original and every preset stay one click away. */
export const sampleBrand = { name: "Dayshade Sleep", theme: "dark", background: "#201327", colors: ["#e86fb4", "#9ad1c4"], fonts: ["Archivo", "Inter"] }
export default function HookClockRollSpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={HookClockRoll} props={{ ...sample, scene: slot("scene", night) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalHookClockRoll |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalHookClockRoll |
number |
Default video.durationInFrames
|
from OptionalHookClockRoll |
string |
Default "09:57"
|
to OptionalHookClockRoll |
string |
Default "10:00"
|
suffix OptionalHookClockRoll |
string |
Default ""
|
line OptionalHookClockRoll |
string |
Default ""
|
highlight OptionalHookClockRoll |
string |
|
words OptionalHookClockRoll |
Word[] |
|
tone OptionalHookClockRoll |
Exclude<StageTone, "card"> |
Default "band"
|
scene OptionalHookClockRoll |
string |
|
treatment OptionalHookClockRoll |
BackdropTreatment |
Default "natural"
|
focus OptionalHookClockRoll |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
None listed in this pack.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
7ef109748b828d4d.webp
image/webp · 22.2 KB