Last active
August 4, 2021 14:29
-
-
Save mhairston/fd57f6a926070560af6cc0097d27b592 to your computer and use it in GitHub Desktop.
My Awesome Sketch (https://sketch.systems)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My Awesome Sketch | |
Normal State* | |
hover -> Hover State | |
click -> Selected State | |
Hover State | |
unhover -> Normal State | |
click -> HoverSelected State | |
Selected State | |
hover -> HoverSelected State | |
clickanyother -> Normal State | |
HoverSelected State | |
unhover -> Selected State | |
clickanyother -> Normal State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
let style = {}; | |
switch(current_state_name) { | |
case "Normal State": | |
style = {color: "blue", backgroundColor: "#eee"}; | |
break; | |
case "Hover State": | |
style = {color: "#333", backgroundColor: "#ffc"}; | |
break; | |
case "Selected State": | |
style = {color: "#888", backgroundColor: "#fcc"}; | |
case "HoverSelected State": | |
style = {color: "#333", backgroundColor: "#ffc"} | |
break; | |
} | |
return $("h1", | |
{style: style}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment