Skip to content

Instantly share code, notes, and snippets.

@mhairston
Last active August 4, 2021 14:29
Show Gist options
  • Save mhairston/fd57f6a926070560af6cc0097d27b592 to your computer and use it in GitHub Desktop.
Save mhairston/fd57f6a926070560af6cc0097d27b592 to your computer and use it in GitHub Desktop.
My Awesome Sketch (https://sketch.systems)
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
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