themes-y2k/templates/overrides/y2k/auth-status.ninjatpl
Alex Dunmow 47776c0b6f feat(y2k): remediation — fix hero, light-mode contrast, seed media, fonts, article
- hero: read styled-text fields as `field|get:"text"|default:field` so the
  home hero renders (bare-string seed values were hard-erroring the block to
  empty output — the "weird af header" root cause; page jumped navbar→audio).
- light-mode: add a background-token radial scrim behind the hero headline
  (lightens the centre in light, darkens in dark) for legible text over the mesh.
- seed media: ship 6 licensed stock images; wire 4 as Records cover art
  (chrome-liquid-metal/holographic-foil/abstract-neon/cassette) + the waveform
  now-playing cover (neon-rave) + a chrome image on About.
- waveform: replace the "No audio source set yet." placeholder with a deliberate
  "SIDE A // live to tape" mono transport readout.
- fonts: @font-face Orbitron/Inter/Share Tech Mono from /templates/y2k/fonts/*
  + typography refs in all presets (bundled fonts were inert dead code).
- article: expand tracking-to-tape to 10 band-journal paragraphs (kills the
  ~350px blog dead space).
- SVG geometry guard: explicit width/height on every sprite <use> icon +
  replace ::icon:: shortcodes with sized <svg> (Tailwind JIT balloon guard).
- capture Wave B screenshots (home/about/article × light+dark, 2880×1800);
  preview.png = dark home (dark-canonical theme).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 20:33:51 +08:00

37 lines
3.0 KiB
Plaintext

{# auth-status y2k override — reproduces the builtin's hardcoded wiring: /login + /login?tab=register when logged out; /account, /account/reviews, and hx-post /api/auth/logout dropdown when logged in; hx-post /api/auth/resend-verification banner when unverified. State from context.*. #}
{% if not context.isPublicLoggedIn %}
<div class="auth-status flex items-center gap-2">
<a href="/login" class="y2k-mono rounded-md px-3 py-1.5 text-sm font-medium uppercase tracking-wide opacity-80 transition-colors hover:bg-primary/10 hover:opacity-100">Login</a>
<a href="/login?tab=register" class="y2k-mono clip-cut rounded-md bg-accent px-3 py-1.5 text-sm font-medium uppercase tracking-wide text-accent-foreground hover:bg-accent/90">Sign Up</a>
</div>
{% else %}
{% if not context.publicEmailVerified %}<div class="fixed top-16 inset-x-0 z-40 border-y border-destructive/50 bg-destructive/15 px-4 py-2 text-center text-sm text-destructive">
<span class="y2k-mono uppercase tracking-wide">Verify your email address.</span> <button hx-post="/api/auth/resend-verification" hx-swap="outerHTML" class="underline font-medium">Resend verification email</button>
</div>{% endif %}
<div class="auth-status relative">
<button type="button" onclick="this.nextElementSibling.classList.toggle('hidden')" class="flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium opacity-90 transition-colors hover:bg-primary/10 hover:opacity-100">
<span class="clip-cut flex h-7 w-7 items-center justify-center rounded-md bg-accent text-accent-foreground"><svg width="16" height="16" class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#user"></use></svg></span>
<span class="y2k-mono uppercase tracking-wide">{{ context.publicDisplayName|default:context.publicUsername }}</span>
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
</button>
<div id="auth-dropdown-menu" class="hud-frame hidden absolute right-0 top-full mt-1 w-48 rounded-md border border-primary/40 bg-card py-1 text-card-foreground neon-edge-magenta z-50">
<a href="/account" class="y2k-mono block px-4 py-2 text-sm uppercase tracking-wide text-card-foreground hover:bg-primary/10">My Profile</a>
<a href="/account/reviews" class="y2k-mono block px-4 py-2 text-sm uppercase tracking-wide text-card-foreground hover:bg-primary/10">My Reviews</a>
<hr class="my-1 border-border"/>
<button hx-post="/api/auth/logout" hx-swap="none" class="y2k-mono block w-full px-4 py-2 text-left text-sm uppercase tracking-wide text-destructive hover:bg-primary/10">Logout</button>
</div>
<script>
(function(){
document.addEventListener('click', function(e) {
var menu = document.getElementById('auth-dropdown-menu');
var btn = document.querySelector('.auth-status > button');
if (!menu || !btn) return;
if (!btn.contains(e.target) && !menu.contains(e.target)) {
menu.classList.add('hidden');
}
});
})();
</script>
</div>
{% endif %}