themes-y2k/blocks/waveform_player.ninjatpl
Alex Dunmow a86a54639a feat: convert to codeless .bnp — templates + manifest, Go/templ deleted (WO-WZ-021)
Convert the Y2K theme from a Go+templ wasm plugin to a fully codeless .bnp:
blocks/blocks.yaml + .ninjatpl, page/system templates, template overrides,
email wrapper, master pages and CSS declared in manifest.yaml. All *.go, *.templ,
*_templ.go, go.mod and go.sum deleted; schemas moved schemas/ -> blocks/.

Static parity proven 48/48 identical against the templ baseline (10 blocks x
full+empty+variant branches, 4 overrides incl. heading L1-6, email full+empty).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 15:10:52 +08:00

14 lines
1.3 KiB
Plaintext

{% if audioUrl or trackTitle %}<figure class="y2k-bevel y2k-chrome-bg rounded-xl overflow-hidden flex items-stretch gap-4 p-3 my-4" data-block-key="y2k:waveform_player">
<div class="w-20 h-20 shrink-0 y2k-image-frame overflow-hidden bg-muted">
{% if coverImage %}<img src="{{ coverImage }}" alt="{{ trackTitle }}" class="w-full h-full object-cover">{% else %}<svg viewBox="0 0 24 24" class="w-full h-full text-muted-foreground p-4" fill="currentColor" aria-hidden="true"><path d="M9 19V6l11-3v13"></path></svg>{% endif %}
</div>
<div class="flex-1 min-w-0 flex flex-col justify-between gap-2">
<figcaption class="flex items-baseline justify-between gap-3 min-w-0">
<span class="y2k-heading text-base truncate text-foreground">{{ trackTitle|default:"untitled track" }}</span>
{% if artist %}<span class="text-xs uppercase tracking-wider text-muted-foreground shrink-0">{{ artist }}</span>{% endif %}
</figcaption>
<canvas class="w-full h-12 bg-muted/40 rounded" data-y2k-waveform data-audio-url="{{ audioUrl }}" aria-label="audio waveform"></canvas>
{% if audioUrl %}<audio controls preload="none" class="w-full" src="{{ audioUrl }}">Your browser does not support the audio element.</audio>{% else %}<p class="text-xs text-muted-foreground">No audio source configured.</p>{% endif %}
</div>
</figure>{% endif %}