Last active
August 23, 2019 21:15
-
-
Save johnkazer/3c6953347333c095b67f3215559d821b to your computer and use it in GitHub Desktop.
Reviewing CT Style
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
Reviewing CT Style | |
Colours | |
click -> Process | |
Colour_1 -> Info_1 | |
Process | |
click -> Colours | |
Info_1 | |
return -> Colours |
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
// CT Style | |
const figmaFile = "PtNa26Kz79mEK8LQ7X47VD"; | |
// ** Edit this: List state names and matching frame IDs | |
const nodes = | |
[ | |
{ | |
"name": "Colours", | |
"id": "1:3" | |
}, | |
{ | |
"name": "Frame", | |
"id": "1:4" | |
}, | |
{ | |
"name": "Process", | |
"id": "6:12" | |
} | |
] | |
const figmaURL = "https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/" + figmaFile + "/Sample-File?node-id="; | |
const extractId = name => nodes.find(node => node.name === name) | |
function render(model){ | |
const currentStateName = model.active_states[0].name; | |
const node = extractId(currentStateName) | |
const id = node ? node.id : '' | |
return $("iframe",{src: figmaURL + escape(id), width: '100%', height: '100%'}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment