Skip to content

Instantly share code, notes, and snippets.

@steveruizok
Last active May 8, 2018 19:33
Show Gist options
  • Save steveruizok/86ea8c05e152af5abac6974cb61ad47e to your computer and use it in GitHub Desktop.
Save steveruizok/86ea8c05e152af5abac6974cb61ad47e to your computer and use it in GitHub Desktop.
specialButton = undefined
handleTap = (event, layer) ->
if specialButton is @
@backgroundColor = "grey"
specialButton = undefined
return
specialButton = @
@backgroundColor = "orange"
for sib in @siblings
sib.backgroundColor = "grey"
buttons = _.range(6).map (i) =>
btn = new Layer
size: 80
y: Align.center()
x: 128
backgroundColor: "grey"
btn.onTap handleTap
return btn
for button, i in buttons
continue if i is 0
button.x = buttons[i-1].maxX + 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment