Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/cyberpunk. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
45 lines
1.5 KiB
Plaintext
45 lines
1.5 KiB
Plaintext
package main
|
|
|
|
// cyberpunkCardComponent renders the override for the built-in card block:
|
|
// dashed neon border, hover-lift with chromatic-aberration shadow.
|
|
templ cyberpunkCardComponent(title, body, href, media string) {
|
|
if href != "" {
|
|
<a
|
|
href={ templ.SafeURL(safeHref(href)) }
|
|
class="cyberpunk-card neon-edge-magenta block p-6 rounded-lg h-full transition-transform hover:-translate-y-0.5"
|
|
style="background-color: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px dashed hsl(var(--primary));"
|
|
>
|
|
@cyberpunkCardInner(title, body, media)
|
|
</a>
|
|
} else {
|
|
<article
|
|
class="cyberpunk-card neon-edge-magenta block p-6 rounded-lg h-full"
|
|
style="background-color: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px dashed hsl(var(--primary));"
|
|
>
|
|
@cyberpunkCardInner(title, body, media)
|
|
</article>
|
|
}
|
|
}
|
|
|
|
// cyberpunkCardInner renders the shared card body markup.
|
|
templ cyberpunkCardInner(title, body, media string) {
|
|
if media != "" {
|
|
<img
|
|
src={ media }
|
|
alt=""
|
|
class="cyberpunk-card-media w-full h-40 object-cover rounded mb-4"
|
|
onerror="this.style.display='none'"
|
|
/>
|
|
}
|
|
if title != "" {
|
|
<h3 class="cyberpunk-card-title text-lg font-semibold mb-2" style="color: hsl(var(--foreground)); font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);">
|
|
{ title }
|
|
</h3>
|
|
}
|
|
if body != "" {
|
|
<div class="cyberpunk-card-body text-sm leading-relaxed" style="color: hsl(var(--muted-foreground));">
|
|
@templ.Raw(body)
|
|
</div>
|
|
}
|
|
}
|