Opus Motion ★ Star on GitHub

UI · card-fan

Card fan: deal & play / connect

Cards deal from a pile into a fanned hand, one is hovered, played to centre and hits an enemy (white flash, slash, damage pop, HP drain); 'connect' mode links three glass cards' icons and merges them.

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

Card fan: deal & play / connect: three frames of the UI animation, start, middle and end
Card fan: deal & play / connect — start, middle and end of the 7.0-second motion.

What Card fan: deal & play / connect is for

Game / deck-builder reels, feature cards, "these pieces connect" data stories, choosing an option.

  • cards
  • game
  • ui
  • deal
  • hit
  • connect

Details

Category
UI & product mockup animations
Length
7.0 s (210 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
no
Seamless loop
no
Text props
cards labels
Colour props
background accent
Mood
dark, ui, playful
Roles
subject
Pairs with
Sparkle burst, Number counter, Comic SFX burst

Use Card fan: deal & play / connect in Remotion, React or HTML

Remotion project

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

# render an mp4 (run in the library folder)
node cli/mgl.mjs render card-fan --props '{"cards":[{"title":"Ember Strike","cost":1,"icon":"flame","text":"Deal 10 damage.","color":"#d8673a"},{"title":"Frost Ward","cost":1,"icon":"shield","text":"Gain 8 Block.","color":"#4f7fd6"},{"title":"Spark Lance","cost":2,"icon":"bolt","text":"Deal 25 damage. Apply 3 Vulnerable.","color":"#c9a23a"},{"title":"Second Wind","cost":1,"icon":"leaf","text":"Draw 2 cards.","color":"#4fa86a"},{"title":"Iron Edge","cost":2,"icon":"sword","text":"Deal 13 damage.","color":"#8a6fd0"}],"labels":["CONNECT","REASON"],"background":"#0b0815","accent":"#4777D2"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export card-fan --as mp4 --props '{"cards":[{"title":"Ember Strike","cost":1,"icon":"flame","text":"Deal 10 damage.","color":"#d8673a"},{"title":"Frost Ward","cost":1,"icon":"shield","text":"Gain 8 Block.","color":"#4f7fd6"},{"title":"Spark Lance","cost":2,"icon":"bolt","text":"Deal 25 damage. Apply 3 Vulnerable.","color":"#c9a23a"},{"title":"Second Wind","cost":1,"icon":"leaf","text":"Draw 2 cards.","color":"#4fa86a"},{"title":"Iron Edge","cost":2,"icon":"sword","text":"Deal 13 damage.","color":"#8a6fd0"}],"labels":["CONNECT","REASON"],"background":"#0b0815","accent":"#4777D2"}'

React / Next.js

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

<MotionPlayer
  motion="card-fan"
  props={{
    cards: [
      {
        title: 'Ember Strike',
        cost: 1,
        icon: 'flame',
        text: 'Deal 10 damage.',
        color: '#d8673a',
      },
      {
        title: 'Frost Ward',
        cost: 1,
        icon: 'shield',
        text: 'Gain 8 Block.',
        color: '#4f7fd6',
      },
      {
        title: 'Spark Lance',
        cost: 2,
        icon: 'bolt',
        text: 'Deal 25 damage. Apply 3 Vulnerable.',
        color: '#c9a23a',
      },
      {
        title: 'Second Wind',
        cost: 1,
        icon: 'leaf',
        text: 'Draw 2 cards.',
        color: '#4fa86a',
      },
      {
        title: 'Iron Edge',
        cost: 2,
        icon: 'sword',
        text: 'Deal 13 damage.',
        color: '#8a6fd0',
      },
    ],
    labels: ['CONNECT', 'REASON'],
    background: '#0b0815',
    accent: '#4777D2',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

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

<opus-motion motion="card-fan"
  props='{"cards":[{"title":"Ember Strike","cost":1,"icon":"flame","text":"Deal 10 damage.","color":"#d8673a"},{"title":"Frost Ward","cost":1,"icon":"shield","text":"Gain 8 Block.","color":"#4f7fd6"},{"title":"Spark Lance","cost":2,"icon":"bolt","text":"Deal 25 damage. Apply 3 Vulnerable.","color":"#c9a23a"},{"title":"Second Wind","cost":1,"icon":"leaf","text":"Draw 2 cards.","color":"#4fa86a"},{"title":"Iron Edge","cost":2,"icon":"sword","text":"Deal 13 damage.","color":"#8a6fd0"}],"labels":["CONNECT","REASON"],"background":"#0b0815","accent":"#4777D2"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "card-fan",
      "props": {
        "cards": [
          {
            "title": "Ember Strike",
            "cost": 1,
            "icon": "flame",
            "text": "Deal 10 damage.",
            "color": "#d8673a"
          },
          {
            "title": "Frost Ward",
            "cost": 1,
            "icon": "shield",
            "text": "Gain 8 Block.",
            "color": "#4f7fd6"
          },
          {
            "title": "Spark Lance",
            "cost": 2,
            "icon": "bolt",
            "text": "Deal 25 damage. Apply 3 Vulnerable.",
            "color": "#c9a23a"
          },
          {
            "title": "Second Wind",
            "cost": 1,
            "icon": "leaf",
            "text": "Draw 2 cards.",
            "color": "#4fa86a"
          },
          {
            "title": "Iron Edge",
            "cost": 2,
            "icon": "sword",
            "text": "Deal 13 damage.",
            "color": "#8a6fd0"
          }
        ],
        "labels": [
          "CONNECT",
          "REASON"
        ],
        "background": "#0b0815",
        "accent": "#4777D2"
      }
    }
  ]
}

Card fan: deal & play / connect props

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

PropDefaultWhat it does
mode"hand"'hand' (deal, hover, play, hit) or 'connect' (three glass cards linked then merged)
cards[{"title":"Ember Strike","cost":1,"icon":"flame","text":"Deal 10 damage.","color":"#d86…hand cards {title, cost, icon, text, color}; icon = alarm|train|toast|flask|button|moon|sun|coffee|bolt|heart|star|gear|chat|leaf|check|flame|shield|sword
playIndex2which card is played
damage25damage number shown on the hit
status"Vulnerable +3"status text that rises after the damage
energy3energy orb value before playing (drops by the card cost)
enemyHp[38,62][current, max] enemy HP
fanAngle6outer card rotation in degrees
dealStagger0.08seconds between dealt cards
background"#0b0815"
labels["CONNECT","REASON"]connect mode: [first label, final label]
accent"#4777D2"connect mode rail / capsule colour

Notes & credits

Technique sources:

  • video21 7:20-15:10 card-hand-deal-and-play, hit-flash-damage-pop
  • video19 9:00-10:30 card-fan-connect