Opus Motion ★ Star on GitHub

Product · add-to-cart-fly

Add to cart (thumbnail flies into cart)

A store header with a cart icon and a product card: the button is pressed, a copy of the product picture flies in an arc into the cart, the cart wiggles and its badge count bumps with a +1.

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

Add to cart (thumbnail flies into cart): three frames of the product animation, start, middle and end
Add to cart (thumbnail flies into cart) — start, middle and end of the 5.0-second motion.

What Add to cart (thumbnail flies into cart) is for

E-commerce explainers, store promos, app-store videos, "add to cart" UX demos — set the product picture, name, price, currency and labels.

  • ecommerce
  • cart
  • add to cart
  • shop
  • store
  • retail
  • product
  • checkout
  • ui
  • badge
  • flight

Details

Category
Product & e-commerce animations
Length
5.0 s (150 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
yes
Seamless loop
no
Text props
—
Colour props
productColor background card ink accent
Image props
src
Mood
photo, ui
Roles
subject

Use Add to cart (thumbnail flies into cart) in Remotion, React or HTML

Remotion project

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

# render an mp4 (run in the library folder)
node cli/mgl.mjs render add-to-cart-fly --props '{"productColor":"#E07A5F","background":"#F3EFE8","card":"#FFFFFF","ink":"#1D1B24","accent":"#E8553A","src":""}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export add-to-cart-fly --as webm-alpha --props '{"productColor":"#E07A5F","background":"#F3EFE8","card":"#FFFFFF","ink":"#1D1B24","accent":"#E8553A","src":""}'

React / Next.js

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

<MotionPlayer
  motion="add-to-cart-fly"
  props={{
    productColor: '#E07A5F',
    background: '#F3EFE8',
    card: '#FFFFFF',
    ink: '#1D1B24',
    accent: '#E8553A',
    src: '',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

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

<opus-motion motion="add-to-cart-fly"
  props='{"productColor":"#E07A5F","background":"#F3EFE8","card":"#FFFFFF","ink":"#1D1B24","accent":"#E8553A","src":""}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "add-to-cart-fly",
      "props": {
        "productColor": "#E07A5F",
        "background": "#F3EFE8",
        "card": "#FFFFFF",
        "ink": "#1D1B24",
        "accent": "#E8553A",
        "src": ""
      }
    }
  ]
}

Add to cart (thumbnail flies into cart) props

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

PropDefaultWhat it does
storeName"SHOPLY"wordmark in the header
productName"Canvas Tote Bag"product title on the card
price24price number (no currency)
currency"$"currency prefix, e.g. $, €, £, Rs.
buttonLabel"Add to cart"button text before the press
addedLabel"Added"button text after the press
cartLabel"Cart"small label next to the cart icon
startCount0items already in the cart (badge starts here)
adds2how many times the button is pressed (0-4)
gap40frames between presses
src""product image (public/ path or https URL); empty = procedural drawing
productKind0procedural drawing when no src: 0 bag, 1 mug, 2 headphones, 3 box, 4 bottle, 5 watch, 6 lamp, 7 t-shirt
productColor"#E07A5F"procedural product colour
background"#F3EFE8"page colour or 'transparent'
card"#FFFFFF"card colour
ink"#1D1B24"text and icon colour
accent"#E8553A"price, button and badge colour
startAt0frame the card starts entering

Notes & credits

Technique sources:

  • original (round 3)