Skip to content

Instantly share code, notes, and snippets.

@xeladotbe
Created October 19, 2020 21:12
Show Gist options
  • Save xeladotbe/cabba5383925b16be3b7f35a5cbabe14 to your computer and use it in GitHub Desktop.
Save xeladotbe/cabba5383925b16be3b7f35a5cbabe14 to your computer and use it in GitHub Desktop.
{
"document": {
"type": "APL",
"version": "1.4",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {},
"commands": {},
"layouts": {},
"mainTemplate": {
"parameters": [
"payload"
],
"items": [
{
"type": "Container",
"direction": "row",
"bind": [
{
"name": "token",
"type": "number",
"value": -1
}
],
"handleTick": [
{
"minimumDelay": 500,
"commands": [
{
"type": "SetValue",
"property": "token",
"value": "${(token + 1) % payload.currentView.properties.tokens.length}"
}
]
}
],
"wrap": "wrap",
"data": "${payload.currentView.properties.tokens}",
"items": [
{
"color": "${index == token ? 'red' : 'white'}",
"type": "Text",
"spacing": "10dp",
"text": "${data}"
}
]
}
]
}
},
"datasources": {
"currentView": {
"type": "object",
"properties": {
"tokens": [
"this",
"is",
"my",
"red",
"text"
]
}
}
},
"sources": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment