- 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>
50 lines
4.2 KiB
Plaintext
50 lines
4.2 KiB
Plaintext
{# noir override — countdown; preserves heading, intro, target, variant, labelDays/Hours/Minutes/Seconds, expiredMessage, expiredUrl, expiredLabel, data-countdown/-timer/-expired, data-target, data-unit, arrow svg, and the timer IIFE verbatim. Only boxes/labels restyled. #}
|
|
<section data-block-override="noir:countdown" class="py-16 md:py-24 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
|
|
<div class="mx-auto max-w-4xl px-4 text-center">
|
|
{% if heading %}<h2 class="noir-heading 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-lg" style="color:hsl(var(--muted-foreground));">{{ intro }}</p>{% endif %}
|
|
<div class="mt-10" data-countdown>
|
|
<div class="flex items-start justify-center gap-3 sm:gap-6" data-countdown-timer data-target="{{ target }}" role="timer" aria-label="Time remaining">
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}noir-file min-w-[4.5rem] px-3 py-4 text-card-foreground{% endif %}"><span class="text-4xl font-bold tabular-nums sm:text-5xl" style="font-family:var(--font-mono);color:hsl(var(--primary));" data-unit="days">--</span><span class="noir-label mt-1" style="color:hsl(var(--muted-foreground));">{{ labelDays|default:"Days" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}noir-file min-w-[4.5rem] px-3 py-4 text-card-foreground{% endif %}"><span class="text-4xl font-bold tabular-nums sm:text-5xl" style="font-family:var(--font-mono);color:hsl(var(--primary));" data-unit="hours">--</span><span class="noir-label mt-1" style="color:hsl(var(--muted-foreground));">{{ labelHours|default:"Hours" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}noir-file min-w-[4.5rem] px-3 py-4 text-card-foreground{% endif %}"><span class="text-4xl font-bold tabular-nums sm:text-5xl" style="font-family:var(--font-mono);color:hsl(var(--primary));" data-unit="minutes">--</span><span class="noir-label mt-1" style="color:hsl(var(--muted-foreground));">{{ labelMinutes|default:"Minutes" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}noir-file min-w-[4.5rem] px-3 py-4 text-card-foreground{% endif %}"><span class="text-4xl font-bold tabular-nums sm:text-5xl" style="font-family:var(--font-mono);color:hsl(var(--primary));" data-unit="seconds">--</span><span class="noir-label mt-1" style="color:hsl(var(--muted-foreground));">{{ labelSeconds|default:"Seconds" }}</span></div>
|
|
</div>
|
|
<div class="mt-8 hidden" data-countdown-expired>
|
|
<p class="noir-heading text-xl" style="color:hsl(var(--foreground));">{{ expiredMessage|default:"This has started." }}</p>
|
|
{% if expiredUrl and expiredLabel %}<a href="{{ expiredUrl }}" class="noir-btn noir-btn-solid mt-4">{{ expiredLabel }}<svg width="16" height="16" class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#arrow-right"></use></svg></a>{% endif %}
|
|
</div>
|
|
</div>
|
|
<noscript><p class="mt-6 text-muted-foreground">Counting down to <time datetime="{{ target }}">{{ target }}</time>.</p></noscript>
|
|
</div>
|
|
</section>
|
|
<script>
|
|
(function(){
|
|
var timers = document.querySelectorAll('[data-countdown-timer]');
|
|
timers.forEach(function(el){
|
|
var target = new Date(el.getAttribute('data-target')).getTime();
|
|
if (isNaN(target)) return;
|
|
var wrap = el.closest('[data-countdown]');
|
|
var expired = wrap ? wrap.querySelector('[data-countdown-expired]') : null;
|
|
function pad(n){ return (n < 10 ? '0' : '') + n; }
|
|
function set(unit, value){ var node = el.querySelector('[data-unit="' + unit + '"]'); if (node) node.textContent = value; }
|
|
var interval;
|
|
function tick(){
|
|
var diff = target - Date.now();
|
|
if (diff <= 0){
|
|
el.style.display = 'none';
|
|
if (expired) expired.classList.remove('hidden');
|
|
if (interval) clearInterval(interval);
|
|
return;
|
|
}
|
|
set('days', Math.floor(diff / 86400000));
|
|
set('hours', pad(Math.floor(diff % 86400000 / 3600000)));
|
|
set('minutes', pad(Math.floor(diff % 3600000 / 60000)));
|
|
set('seconds', pad(Math.floor(diff % 60000 / 1000)));
|
|
}
|
|
tick();
|
|
interval = setInterval(tick, 1000);
|
|
});
|
|
})();
|
|
</script>
|