Hand-Drawn SVG Doodles
Generate hand-drawn style SVG assets programmatically. 68 built-in doodles across 3 categories: annotation marks, illustrations, and text lettering (Japanese + English). Zero dependencies, fully offline.
Files
engine/handdrawn.js— the generative engine + all 68 doodle definitions. Self-contained; copy it into the user's project.catalog/— browsable catalog pages. Opencatalog/index.htmlfor the full asset browser with live style controls.catalog/swiss.html,swiss2.html,swiss3.html— Swiss-design samples: strict grid + grotesque type + hand-drawn annotation layer in red/black. The recommended reference for high-quality usage.demo.html— minimal showcase used for the boil-animation video.example.html— minimal usage example.
Quick start
<script src="handdrawn.js"></script>
<div data-doodle="circle-loop" style="width:120px"></div>
<script>
HanddrawnSVG.hydrate(); // fill all [data-doodle] elements
HanddrawnSVG.enableBoil(); // hover -> lines wobble (boil effect)
</script>
Or generate a raw SVG string: HanddrawnSVG.svg('arrow-r') and inject/export it anywhere.
Key API
HanddrawnSVG.svg(id, {uid, vb, par})→ SVG markup string (seeded = reproducible)HanddrawnSVG.hydrate(root)→ render into all[data-doodle]elements. Optionaldata-vb/data-parattributes override viewBox / preserveAspectRatio (usepar="none"+ wide viewBox to stretch dividers/underlines)HanddrawnSVG.enableBoil()→ one-time setup; hover/touch re-renders lines with shifting seeds (hand-drawn "boil" animation). Respectsprefers-reduced-motionHanddrawnSVG.list()→ all 68 idsHanddrawnSVG.opts({rough, width, warp, pressure, color, anim})→ change global style. Defaults: rough 1.5, width 3.4, warp 7.5, pressure 100 — keep roughness LOW (1–2); pressure does the real hand-drawn work (tapered stroke ribbons)
Doodle ids (68)
Marks: arrow-r, arrow-bent, arrow-dbl, arrow-straight, arrow-up, elbow, uline-wave, uline-dbl, uline-straight, circle-loop, box-loop, double-circle, check, cross, star, highlight, sticky, divider, checkbox, strike, dots Illustrations: bubble, thought, ribbon, lightning, spiral, cloud, sun, flower, heart, sparkle, cursor, moon, lightbulb, coffee, pencil, megaphone, umbrella, cool-s, wave, cube3d, smiley, pentagram, vitruvian, aerial-screw, icosahedron, lune-rosette, manicule, asterism, dagger, bird-perched, bird-hop, bird-flap, bird-sing Text: t-whatif, t-note, t-memo, t-idea, t-ok (English) / t-memo-jp(メモ), t-idea-jp(アイデア), t-chui(注意), t-nani(何?), t-exclaim(!), t-thanks(ありがとう), t-sugoi(すごい!), t-naruhodo(なるほど), t-hai(はい) (Japanese)
Design guidance
- Use doodles as an annotation layer, not decoration everywhere: circle key headings, arrow to important blocks, underline emphasis, margin notes. Sparse placement looks intentional; scattered looks messy. See
catalog/swiss*.html— strict Swiss grid underneath, sparse hand-drawn marking layer on top. - Colors:
currentColorinherits text color — control via CSScoloron the host element. Strongest combo: monochrome ink + single red accent (#E30613). - Custom doodles: define strokes as point arrays using the geometry helpers inside the engine (
pts_line, pts_arc, pts_qbez, pts_wave, pts_poly, pts_rr, pts_star, pts_heartin a 200×120 viewBox coordinate space), add toS+DOODLES. - Closed shapes get uniform-width strokes; open strokes get pressure-tapered ribbon fills. Set
raw:trueon a stroke to keep polygon corners sharp (needed for lightning, cursors, megaphones). - Stretched full-width rules/underlines:
data-vb="0 0 200 40" data-par="none"on the host.