themes-coffee/doodle_divider.templ
Alex Dunmow 11c6c8c63e initial: theme plugin coffee
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/coffee.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:22 +08:00

48 lines
2.2 KiB
Plaintext

package main
// doodleDividerComponent renders an inline SVG divider whose motif is
// selected by the editor. Each motif draws a distinct hand-drawn shape so
// they look visibly different even at thumbnail size.
templ doodleDividerComponent(motif string) {
<div data-block="coffee:doodle_divider" data-motif={ motif } class="my-8 flex items-center justify-center text-accent">
switch motif {
case "croissant":
<svg viewBox="0 0 200 32" class="w-48 h-8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 18 L70 18"></path>
<path d="M130 18 L196 18"></path>
<path d="M85 22 Q 90 8 100 8 Q 110 8 115 22"></path>
<path d="M88 20 L92 14"></path>
<path d="M96 18 L100 10"></path>
<path d="M104 18 L108 10"></path>
<path d="M112 20 L108 14"></path>
</svg>
case "cup":
<svg viewBox="0 0 200 32" class="w-48 h-8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 18 L75 18"></path>
<path d="M125 18 L196 18"></path>
<path d="M88 8 L112 8 L110 24 L90 24 Z"></path>
<path d="M112 12 Q 120 12 120 16 Q 120 20 112 20"></path>
<path d="M93 4 Q 95 1 97 4"></path>
<path d="M99 4 Q 101 1 103 4"></path>
<path d="M105 4 Q 107 1 109 4"></path>
</svg>
case "leaf":
<svg viewBox="0 0 200 32" class="w-48 h-8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 18 L80 18"></path>
<path d="M120 18 L196 18"></path>
<path d="M90 20 Q 100 4 110 20 Q 100 24 90 20 Z"></path>
<path d="M93 19 L107 19"></path>
</svg>
default:
<svg viewBox="0 0 200 32" class="w-48 h-8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 18 L80 18"></path>
<path d="M120 18 L196 18"></path>
<ellipse cx="95" cy="18" rx="6" ry="9"></ellipse>
<path d="M95 9 L95 27"></path>
<ellipse cx="108" cy="18" rx="6" ry="9"></ellipse>
<path d="M108 9 L108 27"></path>
</svg>
}
</div>
}