Skip to content

Instantly share code, notes, and snippets.

@phivk
Last active July 27, 2018 08:07
Show Gist options
  • Save phivk/65939ba73f414194b77e7fbf987d7941 to your computer and use it in GitHub Desktop.
Save phivk/65939ba73f414194b77e7fbf987d7941 to your computer and use it in GitHub Desktop.
GMAB Style Transfer Selfie Station
GMAB Style Transfer Selfie Station
Remote Control Down*
Landing Screen
user_pick up remote control -> Remote Control Up
Remote Control Up
user_put down remote control -> Remote Control Down
Next Style Presented & Get Ready
auto_next -> Counting Down
Counting Down
auto_next -> Ready To Take Photo
Ready To Take Photo
auto_next -> Processing Animation
Processing Animation
auto_next -> Selfie in Bazovsky Style
Selfie in Bazovsky Style
auto_next -> Restart Instructions
Restart Instructions
user_put down remote control -> Remote Control Down
function render_state(state){
if (state.image_url) {
return $("img",
{
src: state.image_url,
style: {
width: "100px",
margin: "1rem"
}
}
);
}
else {
return $(
"div",
{
style: {
display: 'inline-block',
width: "10rem",
margin: '1rem',
}
},
state.name
);
}
}
function render_button(model, eventToEmit, buttonText) {
console.log(model);
return $(
'button',
{
style: {
display: 'inline-block',
width: "100px",
margin: '1rem',
},
onClick: function(){ model.emit(eventToEmit) }
},
buttonText
)
}
function render(model){
console.log(model);
return $(
"div",
render_state(model.active_states[0]),
render_state(model.active_states[0].parent),
$("br"),
render_button(
model,
'auto_next',
model.active_states[0].parent.name === "Remote Control Up" ? "auto_next" : ""
),
render_button(
model,
model.active_states[0].parent.name === "Remote Control Up" ? "user_put down remote control" : "user_pick up remote control",
model.active_states[0].parent.name === "Remote Control Up" ? "user_put down remote control" : "user_pick up remote control"
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment