Make a focus timer
where the mascot falls if you leave.
Mugi hangs from a sunflower seed while your user focuses. Leave the app and Mugi slips to one paw. Come back in time and it grabs on again. Stay away ten seconds and it falls. Press START below, then switch tabs.
Press START. Mugi hangs on while you focus.
- action::away
- false
- action::fall
- false
- Playing
- hang loop
Or switch to another browser tab during a session. Mugi notices, and this tab’s title calls you back.
What Masko made
One loop for each pose and one animation for each move. Hover a clip to play it.
- Hangloop
- Sliphang → slip, when away
- Slippingloop
- Grab on againslip → hang, back in time, free
- Fallslip → fallen, after 10 s away
- Fallenloop
How it works
- 1
Make the character and its poses
Create Mugi from a prompt or a picture, then make each pose as an image of the same character: hanging, slipping and fallen.
Create a mascot - 2
Connect the poses in a state graph
Each pose is a node with its own loop. away moves Mugi from hang to slip and back, and fall drops it to the floor. The move back up is the slip played backwards, so it is free.
Build a canvas - 3
Let Masko animate it, then set the inputs
Generate all makes every loop and every move. Your app sets away when the user leaves and fall after ten seconds away, and plays the matching move.
Export a canvas
The moves on Mugi’s canvas
{
"inputs": ["action::away", "action::fall"],
"edges": [
{ "id": "hang-to-slip",
"conditions": [{ "input": "action::away", "op": "==", "value": true }] },
{ "id": "slip-to-hang", "reverse": true, "reverseOfEdgeId": "hang-to-slip",
"conditions": [{ "input": "action::away", "op": "==", "value": false }] },
{ "id": "slip-to-fallen",
"conditions": [{ "input": "action::fall", "op": "==", "value": true }] }
]
}Leaving the app, on the web
// setInput is your player: it plays the move whose condition now matches.
let timer;
document.addEventListener('visibilitychange', () => {
setInput('action::away', document.hidden);
clearTimeout(timer);
if (document.hidden) {
timer = setTimeout(() => setInput('action::fall', true), 10_000);
}
});Watch the whole story
The same app as a 27-second video: one session, one slip, one fall.
Questions
How does the app know the user left?
On the web, the page visibility event fires when the tab is hidden, as in the demo above. On iOS, watch scenePhase leave active; on Android, use onPause and onResume. Set away when the app leaves the screen and clear it when it comes back.
Is the seed part of the animation?
No. The app draws the string and the seed, and moves the seed to Mugi’s paws in every frame, so Mugi can let go of it when it falls.
How much did Mugi cost?
62 credits: 8 to explore the look, 4 for the poses including one redo, and 50 for five animations. The grab back on is the slip played backwards, which is free.
Where does the idea come from?
From SwingCat, a focus timer by @o_shinworks where a cat falls if you leave the app. Mugi is our take on it, made with Masko.
Where can it play?
Anywhere a transparent video plays. The export gives WebM for Chrome and Firefox and HEVC for Safari and iOS, and the playback guide covers Android.
