Open the studio

Offer

A product, a discount made for one customer, and a code revealed in one tap

Commerce · 8 s · 2.0 kB

offer: A product, a discount made for one customer, and a code revealed in one tap

Download MP4 GIF PNG

<script type="module" src="https://makini.st/player.js"></script>
<makinist-player scene="https://makini.st/scenes/offer.json" data='{
  "brand": "Carrow &amp; Co",
  "name": "Nadia",
  "accent": "#9a3412",
  "kicker": "JUST FOR YOU",
  "discount": "30%",
  "product": "off the Ridge backpack",
  "ends": "until Sunday at midnight",
  "code": "RIDGE-30-NADIA",
  "photo": "51fd33a38b859e86da766b60c55cd5c006559b0dd4d5bd262327e176dd37853a",
  "logo": "fdc37cd745fc964b37878a722266378681a9d6b8411511ae74719e8abe3d14a6",
  "facts": "The Ridge backpack is Carrow &amp; Co&#39;s waxed-canvas daypack. The code RIDGE-30-NADIA takes 30% off once, online, until Sunday at midnight. It cannot be combined with other offers."
}'></makinist-player>

The tag plays this customer's version in any page: the browser draws it from the scene and their row, and no video file is sent.

The scene

offer.json

{
  "format": "makinist/4",
  "canvas": {
    "width": 1080,
    "height": 1080,
    "fps": 60,
    "duration_frames": 480
  },
  "background": "#0b0d12",
  "state": {
    "brand": "",
    "accent": "#9a3412",
    "kicker": "",
    "discount": "",
    "product": "",
    "ends": "",
    "code": "",
    "shown": 0,
    "hint": "tap anywhere, or press space",
    "photo": "51fd33a38b859e86da766b60c55cd5c006559b0dd4d5bd262327e176dd37853a",
    "logo": "fdc37cd745fc964b37878a722266378681a9d6b8411511ae74719e8abe3d14a6",
    "reply": "",
    "facts": "",
    "question": "",
    "focus": 0,
    "said": 0,
    "veil_discount": 0,
    "veil_ends": 0,
    "veil_code": 0,
    "name": "",
    "flash": 0
  },
  "layers": [
    {
      "id": "photo",
      "kind": "image",
      "props": {
        "x": 0,
        "y": 0,
        "w": 420,
        "h": 1080
      },
      "image": {
        "sha256": {
          "bind": "photo"
        },
        "fit": "cover"
      },
      "tracks": {
        "x": [
          {
            "frame": 0,
            "value": -40
          },
          {
            "frame": 480,
            "value": -52,
            "ease": "linear"
          }
        ],
        "w": [
          {
            "frame": 0,
            "value": 420
          },
          {
            "frame": 480,
            "value": 445,
            "ease": "linear"
          }
        ],
        "y": [
          {
            "frame": 0,
            "value": -20
          },
          {
            "frame": 480,
            "value": -54,
            "ease": "linear"
          }
        ],
        "h": [
          {
            "frame": 0,
            "value": 1120
          },
          {
            "frame": 480,
            "value": 1187,
            "ease": "linear"
          }
        ],
        "opacity": [
          {
            "frame": 0,
            "value": 0
          },
          {
            "frame": 25,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "panel",
      "kind": "rect",
      "props": {
        "x": 340,
        "y": 0,
        "w": 740,
        "h": 1080,
        "fill": {
          "bind": "accent"
        }
      },
      "tracks": {
        "x": [
          {
            "frame": 0,
            "value": 1080
          },
          {
            "frame": 35,
            "value": 340,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "logo",
      "kind": "image",
      "props": {
        "x": 400,
        "y": 90,
        "w": 240,
        "h": 64
      },
      "image": {
        "sha256": {
          "bind": "logo"
        },
        "fit": "contain"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 30,
            "value": 0
          },
          {
            "frame": 50,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "kicker",
      "kind": "text",
      "props": {
        "x": 400,
        "y": 230,
        "size": 24,
        "fill": "#ffffffcc",
        "width": 650
      },
      "text": {
        "template": "{kicker}",
        "font": "Inter SemiBold"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 45,
            "value": 0
          },
          {
            "frame": 65,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "name.band",
      "kind": "rect",
      "props": {
        "x": 340,
        "y": 236,
        "w": 740,
        "h": 196,
        "fill": "#ffffff2e",
        "opacity": {
          "bind": "flash"
        }
      }
    },
    {
      "id": "name",
      "kind": "text",
      "props": {
        "x": 390,
        "y": 330,
        "size": 72,
        "fill": "#ffffff",
        "width": 650,
        "line_height": 1.0
      },
      "text": {
        "template": "{name}",
        "font": "Inter Display Bold"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 50,
            "value": 0
          },
          {
            "frame": 70,
            "value": 1,
            "ease": "power2.out"
          }
        ],
        "y": [
          {
            "frame": 50,
            "value": 350
          },
          {
            "frame": 80,
            "value": 330,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "discount",
      "kind": "text",
      "props": {
        "x": 394,
        "y": 560,
        "size": 150,
        "fill": "#ffffff"
      },
      "text": {
        "template": "{discount}",
        "font": "Inter Display Bold"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 60,
            "value": 0
          },
          {
            "frame": 80,
            "value": 1,
            "ease": "power2.out"
          }
        ],
        "size": [
          {
            "frame": 60,
            "value": 110
          },
          {
            "frame": 110,
            "value": 150,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "product",
      "kind": "text",
      "props": {
        "x": 400,
        "y": 642,
        "size": 48,
        "fill": "#ffffff",
        "width": 650,
        "line_height": 1.05
      },
      "text": {
        "template": "{product}",
        "font": "Instrument Serif"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 90,
            "value": 0
          },
          {
            "frame": 110,
            "value": 1,
            "ease": "power2.out"
          }
        ],
        "y": [
          {
            "frame": 90,
            "value": 662
          },
          {
            "frame": 120,
            "value": 642,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "ends",
      "kind": "text",
      "props": {
        "x": 400,
        "y": 740,
        "size": 24,
        "fill": "#ffffffcc",
        "width": 650
      },
      "text": {
        "template": "{ends}",
        "font": "Inter Regular"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 120,
            "value": 0
          },
          {
            "frame": 140,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "button",
      "kind": "rect",
      "props": {
        "x": 400,
        "y": 830,
        "w": 420,
        "h": 88,
        "fill": "#ffffff",
        "radius": 44
      },
      "tracks": {
        "opacity": [
          {
            "frame": 180,
            "value": 0
          },
          {
            "frame": 200,
            "value": 1,
            "ease": "power2.out"
          }
        ],
        "x": [
          {
            "frame": 180,
            "value": 400
          },
          {
            "frame": 210,
            "value": 400,
            "ease": "power2.out"
          },
          {
            "frame": 230,
            "value": 394,
            "ease": "power2.out"
          },
          {
            "frame": 250,
            "value": 400,
            "ease": "power2.out"
          },
          {
            "frame": 290,
            "value": 394,
            "ease": "power2.out"
          },
          {
            "frame": 310,
            "value": 400,
            "ease": "power2.out"
          }
        ],
        "w": [
          {
            "frame": 180,
            "value": 420
          },
          {
            "frame": 210,
            "value": 420,
            "ease": "power2.out"
          },
          {
            "frame": 230,
            "value": 432,
            "ease": "power2.out"
          },
          {
            "frame": 250,
            "value": 420,
            "ease": "power2.out"
          },
          {
            "frame": 290,
            "value": 432,
            "ease": "power2.out"
          },
          {
            "frame": 310,
            "value": 420,
            "ease": "power2.out"
          }
        ],
        "y": [
          {
            "frame": 180,
            "value": 830
          },
          {
            "frame": 210,
            "value": 830,
            "ease": "power2.out"
          },
          {
            "frame": 230,
            "value": 826,
            "ease": "power2.out"
          },
          {
            "frame": 250,
            "value": 830,
            "ease": "power2.out"
          },
          {
            "frame": 290,
            "value": 826,
            "ease": "power2.out"
          },
          {
            "frame": 310,
            "value": 830,
            "ease": "power2.out"
          }
        ],
        "h": [
          {
            "frame": 180,
            "value": 88
          },
          {
            "frame": 210,
            "value": 88,
            "ease": "power2.out"
          },
          {
            "frame": 230,
            "value": 96,
            "ease": "power2.out"
          },
          {
            "frame": 250,
            "value": 88,
            "ease": "power2.out"
          },
          {
            "frame": 290,
            "value": 96,
            "ease": "power2.out"
          },
          {
            "frame": 310,
            "value": 88,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "button.label",
      "kind": "text",
      "props": {
        "x": 400,
        "y": 886,
        "size": 30,
        "fill": {
          "bind": "accent"
        },
        "width": 420
      },
      "text": {
        "template": "Show my code",
        "font": "Inter SemiBold",
        "align": "center"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 190,
            "value": 0
          },
          {
            "frame": 210,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "code.ring",
      "kind": "rect",
      "props": {
        "x": 380,
        "y": 812,
        "w": 460,
        "h": 124,
        "fill": "#ffffff",
        "radius": 36
      },
      "tracks": {
        "opacity": [
          {
            "frame": 240,
            "value": 0.08
          },
          {
            "frame": 300,
            "value": 0.3,
            "ease": "power2.out"
          },
          {
            "frame": 360,
            "value": 0.08,
            "ease": "power2.out"
          },
          {
            "frame": 420,
            "value": 0.3,
            "ease": "power2.out"
          },
          {
            "frame": 480,
            "value": 0.08,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "code.box",
      "kind": "rect",
      "props": {
        "x": 388,
        "y": 820,
        "w": 444,
        "h": 108,
        "fill": "#0b0d12",
        "radius": 28,
        "opacity": {
          "bind": "shown"
        }
      }
    },
    {
      "id": "code",
      "kind": "text",
      "props": {
        "x": 396,
        "y": 890,
        "size": 38,
        "fill": "#ffffff",
        "width": 428,
        "opacity": {
          "bind": "shown"
        }
      },
      "text": {
        "template": "{code}",
        "font": "Inter Display Bold",
        "align": "center"
      }
    },
    {
      "id": "hint",
      "kind": "text",
      "props": {
        "x": 400,
        "y": 975,
        "size": 22,
        "fill": "#ffffffcc",
        "width": 420
      },
      "text": {
        "template": "{hint}",
        "font": "Inter Regular",
        "align": "center"
      },
      "tracks": {
        "opacity": [
          {
            "frame": 220,
            "value": 0
          },
          {
            "frame": 240,
            "value": 1,
            "ease": "power2.out"
          }
        ]
      }
    },
    {
      "id": "ask.veil.discount",
      "kind": "rect",
      "props": {
        "x": 360,
        "y": 420,
        "w": 700,
        "h": 290,
        "fill": {
          "bind": "accent"
        },
        "opacity": {
          "bind": "veil_discount"
        }
      }
    },
    {
      "id": "ask.veil.ends",
      "kind": "rect",
      "props": {
        "x": 360,
        "y": 712,
        "w": 700,
        "h": 44,
        "fill": {
          "bind": "accent"
        },
        "opacity": {
          "bind": "veil_ends"
        }
      }
    },
    {
      "id": "ask.veil.code",
      "kind": "rect",
      "props": {
        "x": 370,
        "y": 816,
        "w": 460,
        "h": 120,
        "fill": {
          "bind": "accent"
        },
        "opacity": {
          "bind": "veil_code"
        }
      }
    },
    {
      "id": "ask.reply",
      "kind": "text",
      "props": {
        "line_height": 1.3,
        "opacity": {
          "bind": "said"
        },
        "x": 400,
        "y": 772,
        "size": 24,
        "fill": "#ffffff",
        "width": 650
      },
      "text": {
        "template": "{reply}",
        "font": "Inter Regular"
      }
    }
  ],
  "on": [
    {
      "event": "key:space",
      "if": {
        "shown": 0
      },
      "from": 190,
      "set": {
        "shown": 1,
        "hint": "use it at checkout, online or in store"
      },
      "action": "claim"
    },
    {
      "event": "ask:sent",
      "set": {
        "reply": "",
        "said": 0,
        "veil_discount": 0,
        "veil_ends": 0,
        "veil_code": 0
      }
    },
    {
      "event": "ask:answered",
      "set": {
        "said": 1,
        "veil_discount": 0,
        "veil_ends": 0,
        "veil_code": 0
      }
    },
    {
      "event": "ask:answered",
      "if": {
        "focus": 1
      },
      "set": {
        "veil_ends": 0.4,
        "veil_code": 0.4
      }
    },
    {
      "event": "ask:answered",
      "if": {
        "focus": 2
      },
      "set": {
        "veil_discount": 0.4,
        "veil_code": 0.4
      }
    },
    {
      "event": "ask:answered",
      "if": {
        "focus": 3
      },
      "set": {
        "veil_discount": 0.4,
        "veil_ends": 0.4
      }
    },
    {
      "event": "ask:failed",
      "set": {
        "reply": "Sorry, I couldn't answer that. Try again?",
        "said": 1
      }
    }
  ],
  "tween": {
    "said": {
      "frames": 12
    },
    "veil_discount": {
      "frames": 12
    },
    "veil_ends": {
      "frames": 12
    },
    "veil_code": {
      "frames": 12
    },
    "flash": {
      "frames": 12
    }
  },
  "ask": {
    "instructions": "You are the host of one customer's video, for the brand in `brand`: an offer made for them. Answer their question in `reply` in one or two short sentences, at most 160 characters, warm and plain, in the language they ask in. Use only facts from what the video shows and from `facts`: never invent a price, a date, a place or a promise. Set `focus` to the line your answer is about (the discount, when it ends, or the code), or none. If the question is about anything else, say kindly that you can only talk about this offer.",
    "writes": [
      "reply",
      "focus"
    ],
    "choices": {
      "focus": [
        [
          "none",
          0
        ],
        [
          "discount",
          1
        ],
        [
          "ends",
          2
        ],
        [
          "code",
          3
        ]
      ]
    },
    "question": "question",
    "suggestions": [
      "How much do I save?",
      "When does it end?",
      "How do I use the code?",
      "Is there anything else for me?"
    ]
  }
}

The data row

row.json

{
  "brand": "Carrow & Co",
  "name": "Nadia",
  "accent": "#9a3412",
  "kicker": "JUST FOR YOU",
  "discount": "30%",
  "product": "off the Ridge backpack",
  "ends": "until Sunday at midnight",
  "code": "RIDGE-30-NADIA",
  "photo": "51fd33a38b859e86da766b60c55cd5c006559b0dd4d5bd262327e176dd37853a",
  "logo": "fdc37cd745fc964b37878a722266378681a9d6b8411511ae74719e8abe3d14a6",
  "facts": "The Ridge backpack is Carrow & Co's waxed-canvas daypack. The code RIDGE-30-NADIA takes 30% off once, online, until Sunday at midnight. It cannot be combined with other offers."
}