FeatureDeck data
A product tour: on the left a title, a line and a button change with each feature; on the right its card swings in over the last one; a stepper underneath fills as it goes.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| items* | list of object | ||
| kicker | string | "" | |
| hold | number (0.5 to 30) | 2.2 | |
| w | number (600 to 1900) | 1640 | |
| fill | color | "night>accent" | |
| ink | color | "ink" | |
| font | enum: display | body | mono | serif | "display" |
* required. Every node also takes the common props: id, motion, start, place, scale, rotate, opacity, w, h. A colour is a palette name, never a value.
Parts#
Named parts can be restyled from outside without making a new component: "parts": { "root": { … } }.
| Part | Is a |
|---|---|
| root | box |
| kicker | text |
| title | text |
| body | text |
| cta | box |
| card | box |
Example#
{
"el": "FeatureDeck",
"kicker": "One place to make it",
"items": [
{"title": "Cut", "body": "Pauses and retakes go by themselves.", "cta": "See a cut"},
{"title": "Caption", "body": "Timed to every word.", "cta": "See captions"}
]
}How it is made#
This component is plain data. Its whole definition is the tree below: copy it into a scene's components list under a new name to make your own version. See Custom components.
{
"el": "box",
"dir": "row",
"w": "$w",
"justify": "between",
"align": "center",
"local": true,
"children": [
{
"el": "box",
"gap": 40,
"align": "start",
"w": 720,
"children": [
{
"el": "text",
"id": "kicker",
"text": "$kicker",
"size": 30,
"weight": 500,
"font": "body",
"color": "muted"
},
{
"el": "box",
"dir": "stack",
"w": 720,
"h": 420,
"children": [
{
"$each": "$items",
"as": "it",
"node": {
"el": "box",
"gap": 24,
"align": "start",
"w": 720,
"motion": [
{"do": "during", "at": "=index*hold", "until": "=(index+1)*hold"},
{
"do": "enter",
"from": {"y": 34, "opacity": 0, "blur": 6},
"at": "=index*hold",
"curve": "smooth"
},
{
"do": "exit",
"to": {"y": -30, "opacity": 0},
"at": "=(index+1)*hold-0.28",
"curve": {"ease": "in", "duration": 0.28}
}
],
"children": [
{
"el": "text",
"id": "title",
"text": "$it.title",
"size": 104,
"weight": 500,
"font": "$font",
"color": "$ink",
"tracking": -0.03
},
{
"el": "text",
"id": "body",
"text": "$it.body",
"size": 36,
"weight": 450,
"font": "body",
"color": "muted",
"maxW": 640,
"leading": 1.4
},
{
"el": "box",
"id": "cta",
"radius": 999,
"fill": "$ink",
"pad": [14, 32],
"children": [
{
"el": "text",
"text": "$it.cta",
"size": 28,
"weight": 600,
"font": "body",
"color": "paper"
}
]
}
]
}
}
]
},
{
"el": "box",
"dir": "row",
"gap": 10,
"children": [
{
"$each": "$items",
"node": {
"el": "box",
"w": 120,
"h": 5,
"radius": 3,
"fill": "rgba(128,128,140,.3)",
"clip": true,
"align": "start",
"children": [
{
"el": "shape",
"kind": "rect",
"w": 120,
"h": 5,
"fill": "accent",
"origin": "left",
"motion": [{"do": "drive", "pose": {"scaleX": "=clamp((lt-index*hold)/hold)"}}]
}
]
}
}
]
}
]
},
{
"el": "box",
"dir": "stack",
"w": 760,
"h": 620,
"perspective": 1600,
"children": [
{
"$each": "$items",
"as": "it",
"node": {
"el": "box",
"id": "card",
"w": 760,
"h": 620,
"radius": 36,
"fill": "$fill",
"shadow": 3,
"clip": true,
"pad": 44,
"justify": "between",
"align": "start",
"motion": [
{"do": "during", "at": "=index*hold", "until": "=(index+1)*hold+0.4"},
{
"do": "enter",
"from": {"x": 520, "rotateY": -38, "opacity": 0, "blur": 10},
"at": "=index*hold",
"curve": "heavy"
},
{
"do": "exit",
"to": {"scale": 0.92, "x": -60, "opacity": 0},
"at": "=(index+1)*hold",
"curve": {"ease": "in", "duration": 0.4}
}
],
"children": [
{
"el": "box",
"dir": "row",
"gap": 14,
"align": "center",
"children": [
{
"el": "icon",
"name": {"$if": "$it.icon", "then": "$it.icon", "else": "sparkle"},
"size": 38,
"color": "white"
},
{
"el": "text",
"text": "$it.title",
"size": 32,
"weight": 600,
"font": "body",
"color": "white"
}
]
},
{
"el": "box",
"gap": 16,
"align": "start",
"w": "fill",
"children": [
{
"$each": 5,
"as": "k",
"node": {
"el": "shape",
"kind": "rect",
"w": "=260+rand(k,index)*380",
"h": 16,
"radius": 8,
"fill": "rgba(255,255,255,.32)",
"motion": [
{
"do": "enter",
"from": {"scaleX": 0, "opacity": 0},
"delay": "=0.3+k*0.07",
"curve": "snap"
}
],
"origin": "left"
}
}
]
}
]
}
}
]
}
]
}