themes-noir/templates/noir/landing.ninjatpl
Alex Dunmow 2f7239b76a fix(noir): reveal race, light-mode legibility, spacing, media, SVG guard
- Reveal: shorten scroll-reveal safety timeout below the capture settle and
  reveal-all when viewport height is unknown (headless), so main content is no
  longer stranded mid-fade at ~0.25 opacity in both modes; give the article
  template the robust reveal script it was missing. Fixes the washed-out
  light-mode body/quote copy AND the H1-over-first-line overlap (the translateY
  mid-transition was dropping the heading onto the body).
- Headings: add bottom margin per level so H1 no longer butts the first paragraph.
- Article: collapse the aside rail (and its divider border) when empty; populate
  each case article's aside with case-file marginalia.
- Light mode: bump muted-foreground contrast across all five presets (~L38->L30)
  for comfortable AA on secondary text; dark palettes untouched.
- Media: wire 6 licensed noir stock shots as seed media — harbour-night hero
  (with readable light-on-scrim hero text in both modes), per-article lead
  photos, typewriter on About.
- SVG geometry guard: explicit width/height on 26 <use> icon SVGs; replace 15
  unsized ::icon:: shortcodes with sized <svg><use> markup.
- Declare required_icon_packs (lucide, simple-icons).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:47:59 +08:00

31 lines
1.6 KiB
Plaintext

<!doctype html>
<html lang="en" class="{% if theme_mode == "dark" %}dark{% endif %}">
{{ head_html|safe }}
<body class="bg-background text-foreground antialiased min-h-screen flex flex-col noir-body">
{{ admin_banner_html|safe }}
<section class="w-full relative noir-grain noir-spotlight">{{ slots.hero|safe }}</section>
<main class="flex-grow">
{% if slots.main %}<div class="max-w-3xl mx-auto w-full px-4 py-10 noir-reveal">{{ slots.main|safe }}</div>{% endif %}
</main>
<section class="w-full">{{ slots.cta|safe }}</section>
<footer class="w-full mt-auto noir-rule">
<div class="max-w-5xl mx-auto px-4">{{ slots.footer|safe }}</div>
</footer>
{{ body_end_html|safe }}
<script>
(function(){
if(window.__noirReveal)return;window.__noirReveal=1;
document.documentElement.classList.add('noir-js');
var reduce=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var els=document.querySelectorAll('.noir-reveal');
if(reduce||!('IntersectionObserver' in window)){els.forEach(function(el){el.classList.add('noir-in');});return;}
var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting){e.target.classList.add('noir-in');io.unobserve(e.target);}});},{threshold:0,rootMargin:'0px 0px -8% 0px'});
function showAll(){els.forEach(function(el){el.classList.add('noir-in');});}
els.forEach(function(el){var r=el.getBoundingClientRect();var h=window.innerHeight||document.documentElement.clientHeight||0;if(!h||(r.top<h*0.95&&r.bottom>0)){el.classList.add('noir-in');}else{io.observe(el);}});
window.addEventListener('load',showAll);
setTimeout(showAll,450);
})();
</script>
</body>
</html>