Skip to content

Instantly share code, notes, and snippets.

@xeladotbe
Created May 31, 2020 16:28
Show Gist options
  • Save xeladotbe/6921dd98715f0d22932e69a804108e63 to your computer and use it in GitHub Desktop.
Save xeladotbe/6921dd98715f0d22932e69a804108e63 to your computer and use it in GitHub Desktop.
{
"type": "APL",
"version": "1.3",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {},
"commands": {
"Countdown": {
"parameters": [
{
"name": "seconds",
"default": 99,
"type": "number"
}
],
"commands": [
{
"type": "SetValue",
"property": "text",
"value": "${seconds}"
},
{
"when": "${seconds > 0}",
"type": "Sequential",
"commands": [
{
"type": "Idle",
"delay": 1000
},
{
"type": "Countdown",
"seconds": "${seconds - 1}"
}
]
}
]
}
},
"layouts": {},
"mainTemplate": {
"parameters": [
"payload"
],
"items": [
{
"type": "Container",
"width": "100vw",
"height": "100vh",
"items": [
{
"type": "Text",
"text": "",
"onMount": [
{
"type": "Countdown"
}
]
}
]
}
]
}
}
{
"type": "APL",
"version": "1.3",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {},
"commands": {},
"layouts": {},
"mainTemplate": {
"parameters": [
"payload"
],
"items": [
{
"type": "Container",
"width": "100vw",
"height": "100vh",
"items": [
{
"type": "Text",
"text": "${Math.max(99 - Math.floor(elapsedTime / 1000), 0)}"
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment