Globe data
A wireframe globe that draws itself, with arcs leaping between points on it.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| size | number (80 to 1600) | 520 | |
| color | 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 |
Example#
{"el": "Globe"}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",
"motion": [{"do": "enter", "from": {"scale": 0.7, "opacity": 0}, "curve": "heavy"}],
"children": [
{
"$each": 4,
"node": {
"el": "shape",
"kind": "circle",
"w": "=size*cos(index*0.42)",
"h": "$size",
"fill": "transparent",
"stroke": "$color",
"strokeW": 1.5,
"opacity": 0.45
}
},
{
"$each": 3,
"node": {
"el": "shape",
"kind": "circle",
"w": "=size*cos((index-1)*0.55)",
"h": "=size*cos((index-1)*0.55)*0.24",
"fill": "transparent",
"stroke": "$color",
"strokeW": 1.5,
"opacity": 0.4,
"motion": [{"do": "drive", "pose": {"y": "=(index-1)*size*0.27"}}]
}
},
{
"$each": 4,
"node": {
"el": "shape",
"kind": "path",
"w": "=size*0.5",
"h": "=size*0.26",
"vb": [100, 50],
"d": "M4 46 C 28 2, 72 2, 96 46",
"stroke": "white",
"strokeW": 1.6,
"rotate": "=index*83-60",
"motion": [
{
"do": "drive",
"pose": {"x": "=(rand(index,1)-0.5)*size*0.3", "y": "=(rand(index,2)-0.5)*size*0.3"}
},
{
"do": "draw",
"delay": "=0.5+index*0.45",
"curve": {"ease": "inOut", "duration": 0.7}
}
]
}
},
{
"$each": 6,
"node": {
"el": "shape",
"kind": "circle",
"w": 12,
"fill": "white",
"glow": "$color",
"motion": [
{
"do": "drive",
"pose": {"x": "=(rand(index,5)-0.5)*size*0.6", "y": "=(rand(index,6)-0.5)*size*0.6"}
},
{"do": "enter", "from": "shrink", "delay": "=0.4+index*0.2", "curve": "bouncy"}
]
}
}
]
}