Louis Eveillard
Jul 10, 2017 · 1 min read

Almost exactly yes :)

The main.js code with Vue loads first and creates the UI from a default.php template. The UI is operational rightaway but can’t be used because being the overlay "Welcome to […]".

It also contains the following code (app being my Vue instance):

$(window).one(‘canvas_ready’, function () {
app.settings.canvas_is_ready = true;
});

"Loading…" is shown instead of the green button.

I load the sketch js file and at the end of function setup() :

$(window).trigger('canvas_ready');

Which shows the big green button to start the app because app.settings.canvas_is_ready becomes true :

<button 
v-if="settings.canvas_is_ready"
@click="closeWelcomeScreen">
Let the show begin!
</button>

There is no function to modify the canvas in the store, it's all happening in p5.js draw (ie, on requestAnimationFrame). The canvas is looking at the state at all time and compares what's in the canvas and what's in the state.

    Louis Eveillard

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade