AuthCard data
A sign-up card that fills itself in: the password types as dots, then the button turns green and says it worked.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| title | string | "Create your account" | |
| string | "you@example.com" | ||
| button | string | "Sign up" | |
| done | string | "Signed in" | |
| wait | number (0 to 30) | 1.6 | |
| accent | color | "accent" | |
| fill | color | "paper" | |
| ink | color | "ink" |
* 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 |
| card | box |
| title | text |
| text | |
| password | text |
| button | box |
Example#
{"el": "AuthCard"}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": "card",
"w": 560,
"fill": "$fill",
"radius": 26,
"pad": 44,
"gap": 26,
"align": "stretch",
"shadow": 3,
"border": "rgba(128,128,140,.25)",
"borderW": 2,
"children": [
{
"el": "text",
"id": "title",
"text": "$title",
"size": 38,
"weight": 650,
"color": "$ink",
"align": "center"
},
{
"el": "box",
"gap": 8,
"align": "stretch",
"children": [
{
"el": "text",
"text": "Email",
"size": 22,
"weight": 500,
"font": "body",
"color": "muted"
},
{
"el": "box",
"radius": 12,
"pad": [16, 20],
"border": "rgba(128,128,140,.35)",
"borderW": 2,
"align": "start",
"children": [
{
"el": "text",
"id": "email",
"text": "$email",
"size": 28,
"font": "mono",
"weight": 450,
"color": "$ink",
"motion": [{"do": "type", "cps": 26, "delay": 0.2}]
}
]
}
]
},
{
"el": "box",
"gap": 8,
"align": "stretch",
"children": [
{
"el": "text",
"text": "Password",
"size": 22,
"weight": 500,
"font": "body",
"color": "muted"
},
{
"el": "box",
"radius": 12,
"pad": [16, 20],
"border": "$accent",
"borderW": 2,
"align": "start",
"children": [
{
"el": "text",
"id": "password",
"text": "••••••••••",
"size": 28,
"font": "mono",
"weight": 700,
"color": "$ink",
"motion": [{"do": "type", "cps": 12, "delay": 0.8}]
}
]
}
]
},
{
"el": "box",
"id": "button",
"dir": "stack",
"radius": 12,
"pad": [18, 20],
"fill": {"mix": ["$ink", "$accent", "=ok"]},
"motion": [{"do": "drive", "pose": {"scale": "=1+0.05*sin(clamp(ok)*pi)"}}],
"children": [
{
"el": "text",
"text": "$button",
"size": 28,
"weight": 650,
"font": "body",
"color": "$fill",
"motion": [{"do": "drive", "pose": {"opacity": "=1-clamp(ok*2)"}}]
},
{
"el": "box",
"dir": "row",
"gap": 10,
"align": "center",
"motion": [{"do": "drive", "pose": {"opacity": "=clamp(ok*2-1)"}}],
"children": [
{"el": "icon", "name": "check", "size": 30, "color": "night", "strokeW": 3},
{
"el": "text",
"text": "$done",
"size": 28,
"weight": 700,
"font": "body",
"color": "night"
}
]
}
]
}
]
}