TypeLine data
A line that types itself with a caret after it: a thin bar, or a glowing block (block: true).
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| text* | string | ||
| size | number (20 to 600) | 96 | |
| color | color | "ink" | |
| weight | number (100 to 900) | 600 | |
| font | enum: display | body | mono | serif | "display" | |
| cps | number (1 to 200) | 20 | |
| block | bool | false | |
| caret | color | "accent" | |
| delay | number (0 to 60) | 0 |
* 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 |
| line | text |
| caret | shape |
Example#
{"el": "TypeLine", "text": "What do you want to make?"}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",
"align": "center",
"gap": "=size*0.1",
"children": [
{
"el": "text",
"id": "line",
"text": "$text",
"size": "$size",
"weight": "$weight",
"font": "$font",
"color": "$color",
"tracking": -0.02,
"motion": [{"do": "type", "cps": "$cps", "delay": "$delay"}]
},
{
"el": "shape",
"id": "caret",
"kind": "rect",
"w": {"$if": "$block", "then": "=size*0.5", "else": "=max(4,size*0.06)"},
"h": "=size*0.95",
"radius": {"$if": "$block", "then": 8, "else": 2},
"fill": "$caret",
"glow": {"$if": "$block", "then": "$caret", "else": null},
"motion": [{"do": "drive", "pose": {"opacity": "=0.3+0.7*step(0.5,mod(lt*1.5,1))"}}]
}
]
}