FocusRing data
A ring that closes in on something and holds, with a small tag on its edge: "look here".
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| size | number (60 to 1600) | 520 | |
| tag | string | "" | |
| color | color | "accent2" |
* 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 |
| ring | shape |
| tag | box |
Example#
{"el": "FocusRing", "tag": "you"}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": "stack",
"w": "$size",
"h": "$size",
"children": [
{
"el": "shape",
"id": "ring",
"kind": "circle",
"w": "$size",
"fill": "transparent",
"stroke": "$color",
"strokeW": 5,
"glow": "$color",
"motion": [
{"do": "enter", "from": {"scale": 1.6, "opacity": 0}, "curve": "punchy"},
{"do": "loop", "kind": "pulse", "amount": 0.5, "period": 1.4}
]
},
{
"el": "box",
"id": "tag",
"radius": 999,
"fill": "$color",
"pad": [6, 22],
"motion": [
{"do": "drive", "pose": {"x": "=size*0.36", "y": "=-size*0.36"}},
{"do": "enter", "from": "pop", "delay": 0.25, "curve": "bouncy"}
],
"children": [{"el": "text", "text": "$tag", "size": 34, "weight": 700, "color": "night"}]
}
]
}