Skip to content

Instantly share code, notes, and snippets.

@flowt-au
Last active July 28, 2018 19:58
Show Gist options
  • Save flowt-au/377764349d3b684ade66fd570fb70c72 to your computer and use it in GitHub Desktop.
Save flowt-au/377764349d3b684ade66fd570fb70c72 to your computer and use it in GitHub Desktop.
Glu Builder Startup
Glu Builder Startup
Init
setup -> Setup
# Main view for app
Viewport visible
click a project node -> Project detail panel visible
click Add new project -> Project detail panel visible
Project detail panel visible
Setup
# Config JSON file in samefolder as app
Look for config file
config file found -> Viewport visible
config file not found -> Create default config file
Create default config file
file is created -> Viewport visible
// Attach Figma frames (artboards) to states
// IDs can be found under "Share > Public Embed" in Figma
// ** Edit this: Figma File ID
const figmaFile = "BX8NrTvBoOeTrURIFNYej0nQ";
// ** Edit this: List state names and matching Figma frame/artboard IDs
const figmaNodes =
{"Project detail panel visible":"0%3A1"};
const figmaURL = "https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/" + figmaFile + "/Sample-File?node-id=";
/* RENDER */
function render(model){
const currentStateName = model.active_states[0].name;
for (f in figmaNodes)
if (currentStateName === f)
return $("iframe",{src: figmaURL + figmaNodes[f], width: '100%', height: '100%'});
}
/*function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`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