themes-noir/templates/overrides/noir/timeline.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

23 lines
2.3 KiB
Plaintext

{# noir override — timeline; preserves heading, intro, orientation, marker, steps[].label/.title/.text/.media. Marker rank-circles keep rounded-full; flag svg + {% img %} verbatim. #}
<section data-block-override="noir:timeline" class="py-16 md:py-24 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="mx-auto max-w-4xl px-4">
{% if heading %}<h2 class="noir-heading text-center text-3xl md:text-4xl" style="color:hsl(var(--foreground));">{{ heading }}</h2>{% endif %}
{% if intro %}<p class="noir-body mx-auto mt-4 max-w-2xl text-center text-lg" style="color:hsl(var(--muted-foreground));">{{ intro }}</p>{% endif %}
<ol class="mt-12 {% if orientation == "horizontal" %}grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-4{% else %}relative space-y-8 before:absolute before:left-4 before:top-2 before:h-[calc(100%-1rem)] before:w-px before:bg-border{% endif %}">
{% for step in steps %}
<li class="{% if orientation == "horizontal" %}text-center{% else %}relative pl-14{% endif %}">
<span class="noir-mono flex h-8 w-8 items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground {% if orientation == "horizontal" %}mx-auto{% else %}absolute left-0 top-0 ring-4 ring-background{% endif %}">
{% if marker == "numbered" %}{{ forloop.counter }}{% elif marker == "dot" %}<span class="h-2 w-2 rounded-full bg-primary-foreground"></span>{% else %}<svg width="16" height="16" class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#flag"></use></svg>{% endif %}
</span>
<div class="{% if orientation == "horizontal" %}mt-4{% else %}pt-1{% endif %}">
{% if step.label %}<p class="noir-label" style="color:hsl(var(--primary));">{{ step.label }}</p>{% endif %}
{% if step.title %}<h3 class="noir-heading mt-1 text-lg" style="color:hsl(var(--foreground));">{{ step.title }}</h3>{% endif %}
{% if step.text %}<p class="noir-body mt-1" style="color:hsl(var(--muted-foreground));">{{ step.text }}</p>{% endif %}
{% if step.media %}<div class="mt-3 overflow-hidden noir-hairline grayscale">{% img step.media alt=step.title class="w-full h-auto object-cover" %}</div>{% endif %}
</div>
</li>
{% endfor %}
</ol>
</div>
</section>