Skip to content

Appeal

Idle life (breathing, blinking, reacting) that makes things likeable.

Edit this page

Appeal is charisma, and it isn’t the same as cuteness: a villain can be appealing too. It comes from clear, simple shapes, pleasing proportions and signs of life. A character that breathes, blinks and reacts feels present even when it’s doing nothing. In the demo, Dot does all three.

Now showing: AppealOpen the Appeal demo on its own page (opens in a new tab)
Show the demo's source

The complete page: it loads toon.css and toon.js, plus demo-theme.js (theme colors), demo-runtime.js (gives the demo its own clock) and, for the characters, cast.js.

<!doctype html>
<html lang="en" data-style="saturday">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>12 · Appeal — toon</title>
<link rel="stylesheet" href="../src/toon.css">
<link rel="stylesheet" href="demo.css">
<style>
body { font-size: 15px; line-height: 1.5; max-width: var(--demo-max-width); margin: 2rem auto; padding: 0 1rem; }
canvas { display: block; width: 100%; height: 340px; margin-bottom: var(--space-sm); cursor: pointer; }
button { font: 600 14px system-ui; padding: .5em 1.2em; border-radius: 999px; border: 1.5px solid var(--demo-faint); background: var(--demo-surface); color: var(--demo-ink); cursor: pointer; }
</style>
</head>
<body>
<h1>Appeal</h1>
<p>Appeal is charisma: simple readable shapes, soft curves, and a sense of life. Dot breathes and blinks on an irregular rhythm.</p>
<canvas id="c" style="cursor:pointer" role="img" aria-label="Dot breathes, blinks on an irregular rhythm and follows the pointer with its eyes. On request, Dot hops happily."></canvas>
<p class="demo-try"><button type="button" class="demo-act" id="act">Make Dot happy</button> Move your pointer and Dot watches it. Press <i>Make Dot happy</i> or click the canvas.</p>
<script src="../src/toon.js"></script>
<script src="demo-theme.js"></script>
<script src="cast-shapes.js"></script>
<script src="cast.js"></script>
<script src="demo-runtime.js"></script>
<script>
ToonDemos.register('12-appeal', (document, Toon, DemoTheme) => {
const T = DemoTheme; // design tokens, live (see demo-theme.js)
const { createStage, ticker, tween, sequence, ease, breathe, blink, Spring, withSquash, groundShadow, clamp } = Toon;
const stage = createStage(document.getElementById('c'));
const { ctx } = stage;
const dot = { hop: 0, sy: 1 };
let happy = false, busy = false, happyTimer = 0, mouse = { x: stage.width / 2, y: stage.height / 2 };
const look = { x: new Spring(0, { stiffness: 140, damping: 16 }), y: new Spring(0, { stiffness: 140, damping: 16 }) };
const set = v => Object.assign(dot, v);
const to = (pose, d, e) => () => tween({ from: { ...dot }, to: pose, duration: d, ease: e, onUpdate: set });
stage.canvas.addEventListener('pointermove', e => { const r = stage.canvas.getBoundingClientRect(); mouse = { x: e.clientX - r.left, y: e.clientY - r.top }; });
const act = async () => {
if (busy) return; busy = happy = true; clearTimeout(happyTimer); // an older timer must not end this hop's smile
await sequence(to({ sy: 0.8 }, 120, ease.outQuad), to({ hop: 60, sy: 1.12 }, 260, ease.outQuad),
to({ hop: 0, sy: 1 }, 240, ease.inQuad), to({ sy: 0.82 }, 70, ease.outQuad), to({ sy: 1 }, 450, ease.outElastic));
busy = false; happyTimer = setTimeout(() => (happy = false), 600);
};
stage.canvas.addEventListener('click', act);
document.getElementById('act').addEventListener('click', act);
stage.loop((dt, t) => {
const H = 140, cx = stage.width / 2, ground = stage.height - 40, cy = ground - H / 2 - dot.hop;
const b = breathe(t, { rate: 0.35, amount: 0.025 }); // [APPEAL] alive at rest
const shut = happy ? 0 : blink(t, { every: 3 });
look.x.target = clamp((mouse.x - cx) / 120, -1, 1); look.y.target = clamp((mouse.y - cy) / 120, -1, 1);
const lx = look.x.step(dt), ly = look.y.step(dt);
stage.clear();
groundShadow(ctx, cx, ground, 60, dot.hop, { maxHeight: 200 });
withSquash(ctx, cx, cy, { sx: b.sx / dot.sy, sy: b.sy * dot.sy }, c =>
Cast.draw(c, 'dot', { x: 0, y: 0, h: H, fill: T.primary, ink: T.ink, mood: happy ? 'happy' : 'neutral',
blink: shut, look: { x: lx, y: ly } }), { x: 0, y: H / 2 });
});
});
</script>
</body>
</html>

To give a character life at rest, add .toon-pop-in to a wrapper, .toon-breathe to the body and .toon-blink to the eyes. This snippet runs as-is:

<link rel="stylesheet" href="toon.css">
<!-- One preset per element: pop in on the wrapper, breathe
on the body, blink on the eyes. On a dark body, set
--face to white so the brows and mouth stay readable. -->
<div class="toon-pop-in" style="width:120px">
<svg class="toon-breathe" viewBox="0 0 120 120"
width="120" height="120" aria-hidden="true"
style="display:block; overflow:visible">
<circle cx="63" cy="66" r="52" fill="currentColor"/>
<circle cx="60" cy="62" r="52" stroke="currentColor"
stroke-width="4.5" style="fill:var(--toon-color)"/>
<g fill="none" stroke-width="2.6" stroke-linecap="round"
style="stroke:var(--face, #1a1a1a)">
<path d="M32 40 Q40 33 50 37 M70 37 Q80 33 88 40"/>
<path d="M48 82 Q60 92 72 82"/>
</g>
<!-- fill-box: the eyes squash about their own center -->
<g class="toon-blink"
style="transform-box:fill-box; transform-origin:center">
<circle cx="44" cy="56" r="9" fill="#fff"
stroke-width="3" style="stroke:var(--face, #1a1a1a)"/>
<circle cx="76" cy="56" r="9" fill="#fff"
stroke-width="3" style="stroke:var(--face, #1a1a1a)"/>
<circle cx="45" cy="57" r="4.5" fill="#1a1a1a"/>
<circle cx="77" cy="57" r="4.5" fill="#1a1a1a"/>
</g>
</svg>
</div>

Below, the snippet’s face is on the right, next to the same face with no presets:

Now showing: CSS appealOpen the CSS appeal demo on its own page (opens in a new tab)

Each preset sets animation, so nest the elements: one element per preset. .toon-breathe scales from the bottom edge, so the character stays on the ground.

breathe() returns a small scale for withSquash(), so the body swells and settles. blink() returns how far the lids are closed, from 0 to 1, with uneven gaps between blinks. Two Spring objects move the eyes toward the pointer and let them settle softly.

  • Simplify the silhouette. If you can’t recognize the shape filled in black, simplify it.
  • Vary proportions. Big and small shapes together are more interesting than all-medium ones: big eyes on a round body read at a glance.
  • Keep idle motion subtle. A scale change of 2–4% is enough. More makes the character look anxious.
  • Avoid a metronome. blink() varies the gap between blinks, and a breath of about 3 seconds keeps the two rhythms from lining up.

The Dot demo also shows secondary action (blinking while breathing) and follow-through (the eyes settle on springs).

For every option, see the Canvas appeal functions and the CSS appeal presets.