Opus Motion ★ Star on GitHub

Worlds · toy-town-traffic

Toy-town traffic

A seeded miniature city seen from a high oblique angle: blocks of low-rise buildings with coloured roofs and blue shadows, parks with round bright trees and ponds, crosswalks, and dozens of little cars that flow, queue at red lights and surge on green (IDM car-following simulated deterministically), pedestrians gathering at corners. Actors step at 8 / 12 Hz under the time-lapse while the camera rotates smoothly, a tilt-shift focus band follows the red hero car, and a time-lapse clock ramps from ×6 down to ×1 real time.

A free, MIT-licensed animated background from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Toy-town traffic: three frames of the animated background, start, middle and end
Toy-town traffic — start, middle and end of the 8.0-second motion.

What Toy-town traffic is for

Mobility / logistics / smart-city / real-estate explainers, "rush hour" metaphors for queues and load, satisfying looping backgrounds; nothing else in the library animates a traffic system.

  • traffic
  • city
  • town
  • miniature
  • tilt shift
  • time-lapse
  • cars
  • traffic lights
  • top-down
  • simulation
  • smart city
  • mobility
  • logistics
  • rush hour
  • diorama
  • environment
  • oblique

Details

Category
Animated worlds & backdrops
Length
8.0 s (240 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
no
Seamless loop
no
Text props
—
Colour props
heroColor carColors walls roofs asphalt grass water
Mood
—
Roles
backdrop

Use Toy-town traffic in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add toy-town-traffic --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render toy-town-traffic --props '{"heroColor":"#E23B2E","carColors":["#F4F4F2","#C9CED4","#2B2F36","#D6382C","#2E6FD0","#F2C230","#FFFFFF"],"walls":["#F6E7C8","#F1CFA8","#F4B9A0","#CDE3D0","#BFD7EA","#F8E08F"],"roofs":["#C8673A","#4F7FB8","#3F8F86","#E39B3C","#7C5A9A","#B84A3A"],"asphalt":"#4B4E53","grass":"#6FA24A","water":"#2F78C8"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export toy-town-traffic --as mp4 --props '{"heroColor":"#E23B2E","carColors":["#F4F4F2","#C9CED4","#2B2F36","#D6382C","#2E6FD0","#F2C230","#FFFFFF"],"walls":["#F6E7C8","#F1CFA8","#F4B9A0","#CDE3D0","#BFD7EA","#F8E08F"],"roofs":["#C8673A","#4F7FB8","#3F8F86","#E39B3C","#7C5A9A","#B84A3A"],"asphalt":"#4B4E53","grass":"#6FA24A","water":"#2F78C8"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="toy-town-traffic"
  props={{
    heroColor: '#E23B2E',
    carColors: [
      '#F4F4F2',
      '#C9CED4',
      '#2B2F36',
      '#D6382C',
      '#2E6FD0',
      '#F2C230',
      '#FFFFFF',
    ],
    walls: ['#F6E7C8', '#F1CFA8', '#F4B9A0', '#CDE3D0', '#BFD7EA', '#F8E08F'],
    roofs: ['#C8673A', '#4F7FB8', '#3F8F86', '#E39B3C', '#7C5A9A', '#B84A3A'],
    asphalt: '#4B4E53',
    grass: '#6FA24A',
    water: '#2F78C8',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="toy-town-traffic"
  props='{"heroColor":"#E23B2E","carColors":["#F4F4F2","#C9CED4","#2B2F36","#D6382C","#2E6FD0","#F2C230","#FFFFFF"],"walls":["#F6E7C8","#F1CFA8","#F4B9A0","#CDE3D0","#BFD7EA","#F8E08F"],"roofs":["#C8673A","#4F7FB8","#3F8F86","#E39B3C","#7C5A9A","#B84A3A"],"asphalt":"#4B4E53","grass":"#6FA24A","water":"#2F78C8"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "toy-town-traffic",
      "props": {
        "heroColor": "#E23B2E",
        "carColors": [
          "#F4F4F2",
          "#C9CED4",
          "#2B2F36",
          "#D6382C",
          "#2E6FD0",
          "#F2C230",
          "#FFFFFF"
        ],
        "walls": [
          "#F6E7C8",
          "#F1CFA8",
          "#F4B9A0",
          "#CDE3D0",
          "#BFD7EA",
          "#F8E08F"
        ],
        "roofs": [
          "#C8673A",
          "#4F7FB8",
          "#3F8F86",
          "#E39B3C",
          "#7C5A9A",
          "#B84A3A"
        ],
        "asphalt": "#4B4E53",
        "grass": "#6FA24A",
        "water": "#2F78C8"
      }
    }
  ]
}

Toy-town traffic props

20 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
seed5town layout + car colours seed
blocks[4,3][columns, rows] of city blocks (swapped automatically in portrait)
density0.55traffic density 0–1
rate[[0,6],[5.2,6],[6.8,1.2]]time-lapse rate keyframes [[seconds, rate]] — ≥6 steps at 8 Hz, 2–6 at 12 Hz, <2 smooth; drop to ~1 for the real-time detail
lightCycle16traffic-light cycle in world seconds
view"oblique"oblique (high three-quarter) or top (straight down)
rotation3.5camera rotation in degrees per second
pitch52oblique pitch in degrees (45–58)
followtruetilt-shift band follows the red hero car
band{"center":0.55,"width":0.08,"falloff":0.28,"maxBlur":15}tilt-shift band: centre (when not following), width, falloff (fractions of height), maxBlur px at 1080p
heroColor"#E23B2E"hero car colour
carColors["#F4F4F2","#C9CED4","#2B2F36","#D6382C","#2E6FD0","#F2C230","#FFFFFF"]colour pool for the other cars
walls["#F6E7C8","#F1CFA8","#F4B9A0","#CDE3D0","#BFD7EA","#F8E08F"]building wall colours
roofs["#C8673A","#4F7FB8","#3F8F86","#E39B3C","#7C5A9A","#B84A3A"]building roof colours
asphalt"#4B4E53"road colour
grass"#6FA24A"park / ground colour
water"#2F78C8"pond colour
clocktrueshow the time-lapse clock chip
saturation1.3miniature colour boost (1.3–1.7)
vignette0.35edge darkening 0–0.6

Notes & credits

Technique sources:

  • lemo-opuscar styles/tilt-shift/demo/traffic.js, story.js, main.js stepT (MIT, LemoLab)