Skip to content

Instantly share code, notes, and snippets.

@jorisvddonk
Last active January 18, 2017 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorisvddonk/373436d94d4c875e435ba40faa756865 to your computer and use it in GitHub Desktop.
Save jorisvddonk/373436d94d4c875e435ba40faa756865 to your computer and use it in GitHub Desktop.
Utomik Game browser - JSONETTE app

This is a very basic Utomik game browser for your smartphone! It's built using Jasonette. I spent about 30 minutes on it from the moment I heard about Jasonette.

How to use

  1. Install Jason, the jsonette viewer on your iOS/Android phone. NOTE: For Android, you might want to install this more up to date version of the viewer instead.
  2. Open Jason
  3. In Jason, where it says 'enter a valid jason url', enter the raw URL to the .json file in this gist, then hit 'Go'.
  4. Tap on 'Utomik game browser' and SEE GAMES. Wow. Such amaze.
{
"$jason": {
"head": {
"title": "Utomik game browser",
"actions": {
"$load": {
"type": "$network.request",
"options": {
"url": "https://api.utomik.com/v1/applications"
},
"success": {
"type": "$render"
}
}
},
"templates": {
"body": {
"style": {
"border": "none"
},
"sections": [
{
"header": {
"type": "label",
"text": "Utomik games! Tap on a game to view details about it.",
"style": {
"background": "#f5f5f5",
"padding": "20"
}
},
"items": {
"{{#each $jason.sort(function(a,b){if(a.name.en.toLowerCase() < b.name.en.toLowerCase()){return -1}if(a.name.en.toLowerCase() > b.name.en.toLowerCase()){return 1}return 0})}}": {
"type": "horizontal",
"style": {
"padding": "10",
"spacing": "10"
},
"components": [
{
"type": "image",
"style": {
"width": "50"
},
"url": "{{var img = images.find(function(x){return x.tag === 'BI';}); return (img !== undefined ? img.download_url : undefined)}}"
},
{
"type": "label",
"style": {
"size": "14"
},
"text": "{{name.en}}"
}
],
"action": {
"type": "$util.alert",
"options": {
"title": "{{name.en}}",
"description": "{{excerpt.en}}"
}
}
}
}
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment