Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple toggle button setup for Framer.js
toggleBatch = (arrayOfLayers) ->
for button in arrayOfLayers
button.states.add
off:
opacity: 0.30
index : 19
on:
opacity: 1
index : 20
button.states.switchInstant("off")
button.onTap (event, layer) ->
others = _.without(arrayOfLayers, layer)
for other in others
other.states.switch("off")
layer.states.switch("on")
arrayOfLayers[0].states.switch("on")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.