RotatingWord data
A title whose stem stays while its last word swaps: 'Made for' founders, teachers, teams. The last word holds.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| stem* | string | ||
| words* | list of string | ||
| hold | number (0.3 to 10) | 1 | |
| size | number (30 to 400) | 120 | |
| ink | color | "ink" | |
| accent | color | "accent" |
* 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 |
| stem | text |
| word | text |
Example#
{"el": "RotatingWord", "stem": "Made for", "words": ["founders", "teachers", "teams"]}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",
"local": true,
"dir": "row",
"gap": "=size*0.28",
"align": "center",
"children": [
{
"el": "text",
"id": "stem",
"text": "$stem",
"size": "$size",
"weight": 800,
"color": "$ink",
"motion": [{"do": "enter", "from": {"y": 30, "opacity": 0}, "curve": "smooth"}]
},
{
"el": "box",
"dir": "stack",
"align": "start",
"justify": "start",
"children": [
{
"$each": "$words",
"node": {
"el": "text",
"id": "word",
"text": "$item",
"size": "$size",
"weight": 800,
"color": "$accent",
"motion": {
"$if": "=index<count-1",
"then": [
{"do": "during", "at": "=index*hold", "until": "=(index+1)*hold"},
{
"do": "enter",
"from": {"y": 44, "opacity": 0, "blur": 6},
"at": "=index*hold",
"curve": "punchy"
},
{
"do": "exit",
"to": {"y": -44, "opacity": 0},
"at": "=(index+1)*hold-0.18",
"curve": {"ease": "in", "duration": 0.18}
}
],
"else": [
{
"do": "enter",
"from": {"y": 44, "opacity": 0, "blur": 6},
"at": "=index*hold",
"curve": "punchy"
}
]
}
}
}
]
}
]
}