IconOrbit data
Icon tiles travelling round a flat ellipse drawn as a thin ring, with a spark running the ring faster. Stack it behind a headline.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| icons* | list of string | ||
| radius | number (60 to 1600) | 640 | |
| squash | number (0.05 to 1) | 0.3 | |
| period | number (-120 to 120) | 11 | |
| size | number (20 to 400) | 100 | |
| color | color | "white" | |
| spark | 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 |
| ring | shape |
| spark | shape |
| tile | box |
Example#
{"el": "IconOrbit", "icons": ["scissors", "chat", "music", "send"]}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": 10,
"h": 10,
"children": [
{
"el": "shape",
"id": "ring",
"kind": "circle",
"w": "=radius*2",
"h": "=radius*2*squash",
"fill": "transparent",
"stroke": "rgba(255,255,255,.2)",
"strokeW": 2,
"motion": [{"do": "enter", "from": {"scale": 0.7, "opacity": 0}, "curve": "heavy"}]
},
{
"el": "shape",
"id": "spark",
"kind": "circle",
"w": 16,
"fill": "$spark",
"glow": "$spark",
"motion": [{"do": "orbit", "radius": "$radius", "squash": "$squash", "period": "=period*0.4"}]
},
{
"$each": "$icons",
"node": {
"el": "box",
"id": "tile",
"dir": "stack",
"w": "$size",
"h": "$size",
"radius": "=size*0.28",
"fill": "rgba(255,255,255,.1)",
"border": "rgba(255,255,255,.22)",
"borderW": 2,
"motion": [
{"do": "enter", "from": "pop", "delay": "=index*0.14", "curve": "bouncy"},
{
"do": "orbit",
"radius": "$radius",
"squash": "$squash",
"period": "$period",
"phase": "=index/count"
}
],
"children": [{"el": "icon", "name": "$item", "size": "=size*0.5", "color": "$color"}]
}
}
]
}