Sticker data
An icon on a round badge with a thick ring, tilted: it spins in and keeps a slight wiggle.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| icon | enum: check | x | plus | arrow | heart | star | bolt | play | clock | user | chat | mic | sparkle | search | bell | scissors | music | send | cursor | "bolt" | |
| size | number (60 to 600) | 210 | |
| fill | color | "accent2" | |
| ink | color | "night" | |
| ring | color | "white" | |
| tilt | number (-45 to 45) | -10 |
* 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 |
| badge | box |
| icon | icon |
Example#
{"el": "Sticker", "icon": "bolt"}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",
"id": "badge",
"dir": "stack",
"w": "$size",
"h": "$size",
"radius": 999,
"fill": "$fill",
"border": "$ring",
"borderW": "=size*0.07",
"shadow": 2,
"rotate": "$tilt",
"motion": [
{"do": "enter", "from": {"scale": 0, "rotate": -70, "opacity": 0}, "curve": "bouncy"},
{"do": "loop", "kind": "wiggle", "amount": 0.5, "period": 5}
],
"children": [
{
"el": "icon",
"id": "icon",
"name": "$icon",
"size": "=size*0.56",
"color": "$ink",
"strokeW": 2.4
}
]
}