Root cause: featured_pour's empty-media placeholder used an external <use> SVG (svg class=h-24 w-24 + use href=/icons/lucide.svg#coffee) sized ONLY by Tailwind utilities. The host Tailwind JIT does not reliably emit utility classes used solely in a theme block template, so h-24/w-24 could be dropped from the generated stylesheet; the SVG (no viewBox, no intrinsic size) then ballooned to fill its aspect-square parent (~350-500px cup silhouettes over the hero/blog cards). Fix pins width/height geometry attributes on every <use> icon SVG so size is CSS-independent and deterministic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
43 lines
3.5 KiB
Plaintext
43 lines
3.5 KiB
Plaintext
<section 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="coffee-display text-3xl text-primary md:text-4xl">{{ heading }}</h2>{% endif %}
|
|
{% if intro %}<p class="coffee-body mx-auto mt-4 max-w-2xl text-lg text-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" %}coffee-card min-w-[4.5rem] px-3 py-4{% endif %}"><span class="coffee-mono text-4xl font-bold tabular-nums text-accent sm:text-5xl" data-unit="days">--</span><span class="coffee-hand mt-1 text-lg text-muted-foreground">{{ labelDays|default:"Days" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}coffee-card min-w-[4.5rem] px-3 py-4{% endif %}"><span class="coffee-mono text-4xl font-bold tabular-nums text-accent sm:text-5xl" data-unit="hours">--</span><span class="coffee-hand mt-1 text-lg text-muted-foreground">{{ labelHours|default:"Hours" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}coffee-card min-w-[4.5rem] px-3 py-4{% endif %}"><span class="coffee-mono text-4xl font-bold tabular-nums text-accent sm:text-5xl" data-unit="minutes">--</span><span class="coffee-hand mt-1 text-lg text-muted-foreground">{{ labelMinutes|default:"Minutes" }}</span></div>
|
|
<div class="flex flex-col items-center {% if variant == "boxes" %}coffee-card min-w-[4.5rem] px-3 py-4{% endif %}"><span class="coffee-mono text-4xl font-bold tabular-nums text-accent sm:text-5xl" data-unit="seconds">--</span><span class="coffee-hand mt-1 text-lg text-muted-foreground">{{ labelSeconds|default:"Seconds" }}</span></div>
|
|
</div>
|
|
<div class="mt-8 hidden" data-countdown-expired>
|
|
<p class="coffee-display text-xl text-primary">{{ expiredMessage|default:"This has started." }}</p>
|
|
{% if expiredUrl and expiredLabel %}<a href="{{ expiredUrl }}" class="kraft-tag mt-4 text-base px-5 py-3">{{ 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="coffee-body mt-6 text-muted-foreground">Counting down to <time datetime="{{ target }}">{{ target }}</time>.</p></noscript>
|
|
</div>
|
|
</section>
|
|
<script>
|
|
(function(){
|
|
document.querySelectorAll('[data-countdown-timer]').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>
|