Counter Race: Two Runners. Native 1920×1080, 6.5s at 30fps.
Two numbers compared as a race. Each lane's runner dot moves along its track with its counter riding above it; both share one curve, so the distance run is proportional to the value. The winner's switch flips on at the finish with a burst.
Motion. Runners fade in and run (ease-out, never past the value) while the counters count; at the finish the end switches pop, the winner's flips on with one burst and the other dims. Why it moves. change + attention: the gap opening between the runners is the difference.
Mount
Copy every manifest file into your project (plus af-toggle-runtime). Mount with a unique host id, data-composition-id="af-toggle-counter-race-16x9", data-composition-src="compositions/af-toggle-counter-race-16x9.html", data-duration="6.5" and data-variable-values. Use the variant whose size matches your project (16x9, 9x16, 4x5, 1x1): each is laid out natively, never scaled.
Content slots
Nested slots are JSON strings. Every slot is checked against constraints.json and measured against the layout before anything draws; the block stops with a message naming the slot and the fix (it never truncates or shrinks text).
title (required): {"type":"string","minLength":1,"maxLength":40}a (required): {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":18},"value":{"type":"number","minimum":0,"maximum":1000000000}},"required":["label","value"]}b (required): {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":18},"value":{"type":"number","minimum":0,"maximum":1000000000}},"required":["label","value"]}prefix: {"type":"string","minLength":1,"maxLength":3}unit: {"type":"string","minLength":1,"maxLength":6}decimals: {"type":"integer","minimum":0,"maximum":2}note: {"type":"string","minLength":1,"maxLength":48}
- The larger value runs the full track; equal values tie (no winner).
Style: colourway (lime, cobalt, coral), accent (optional hex), footer, ground: dark only, exit (slide or cut).
Timing
6.5s. Everything has landed by 3.9s (60%), then the scene holds for reading (the grid and the faint rings slow to a residual drift, text stays still) and slides out to the left in a motion blur over the last 0.5 s, leaving the empty ground.
Example
``json { "title": "Views in the first week", "a": "{\"label\":\"Strong hook\",\"value\":12400}", "b": "{\"label\":\"Weak hook\",\"value\":3100}", "decimals": 0, "note": "Illustrative figures" } ``