Evergreen Timer 1
Evergreen Timer: a per-visitor countdown strip for VSL and webinar replay pages. The page supplies when this visitor's
Use it in a prompt
Use urgency/evergreen-timer from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/urgency/evergreen-timer.tsx. - Import it and pass your copy and images (Props tab):
import { EvergreenTimer } from "@/components/funneldna/urgency/evergreen-timer"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/urgency/evergreen-timer/component.tsx 668 lines
// layout: hello-strip
// Evergreen Timer: a per-visitor countdown strip for VSL and webinar replay pages. The page supplies when this visitor's
// window started (tracked by the host, so it never resets); the price, its exact end and one action read in one glance.
import * as React from "react"
import { CalendarClock, Lock } from "lucide-react"
export type EvergreenTimerCopy = {
/** Red headline while the window is open. Placeholders: {price}, {name}, {hours} (the window length). */
headline: string
/** Price line; {price} renders as the large figure. Also takes {name} and {hours}. */
priceLine: string
/** Short note under the price line. An empty string hides it. */
note: string
/** Line under the clock once the end time is known. {time} is the visitor's local end time. */
expiryLine: string
/** Line under the clock on first paint, before the visitor's start time is read. */
pendingExpiryLine: string
/** Large text inside the ring, e.g. "48h". */
windowBadge: string
/** Small text under the ring badge. */
windowLabel: string
/** Text under the lock once the window has closed. */
closedLabel: string
/** Labels under the digit tiles. */
units: { days: string; hours: string; minutes: string; seconds: string }
/** Accessible reading of the clock: {hours}, {minutes}, {seconds} are the amounts left. */
timerLabel: string
/** Same, for windows longer than 72 hours (adds {days}). */
timerLabelDays: string
/** Button label. */
label: string
/** Quiet line under the button. An empty string hides it. */
secondaryLabel: string
/** Headline after the window closes. */
expiredHeadline: string
/** Price line after the window closes. */
expiredPriceLine: string
/** Line under the clock after the window closes. {time} is when it ended. */
expiredExpiryLine: string
}
export type EvergreenTimerProps = {
/** The real per-visitor window in hours (e.g. 48). Required: without a real window the timer renders nothing. */
windowHours?: number
/**
* Epoch ms when this visitor's window started (their first visit), tracked and persisted by the host page or
* funnel. Required: the piece keeps no storage, so without a real start it renders nothing rather than a
* countdown that would restart on every reload.
*/
startedAt?: number
/** @deprecated Ignored: the piece no longer uses storage; the host supplies `startedAt`. */
storageKey?: string
/** @deprecated Never called: the piece no longer starts windows itself; the host supplies `startedAt`. */
onStart?: (startedAt: number) => void
/** Called once when the window closes. */
onExpire?: () => void
/** Offer name, used through {name}. */
offerName?: string
/** Offer price, used through {price}. */
price?: string
/** Visible words; any key left out keeps its default. */
copy?: Partial<Omit<EvergreenTimerCopy, "units">> & { units?: Partial<EvergreenTimerCopy["units"]> }
/** Checkout destination for the button. */
href?: string
/** Handles the button click. */
onAction?: () => void
/** Destination for the quiet line under the button (e.g. the replay); without it the line is plain text. */
secondaryHref?: string
/** Locale for the end time; defaults to the visitor's. */
locale?: string
/** Pins the strip to the top of the viewport like a hello bar. */
sticky?: boolean
disabled?: boolean
state?: "default" | "hover" | "active" | "disabled"
className?: string
}
const DEFAULT_COPY: EvergreenTimerCopy = {
headline: "This price is held for you",
priceLine: "{price} today. That's it.",
note: "Your {hours}-hour window started on your first visit.",
expiryLine: "Ends {time}",
pendingExpiryLine: "{hours}-hour window",
windowBadge: "{hours}h",
windowLabel: "Window",
closedLabel: "Closed",
units: { days: "Days", hours: "Hours", minutes: "Min", seconds: "Sec" },
timerLabel: "{hours} hours, {minutes} minutes and {seconds} seconds left at this price",
timerLabelDays: "{days} days, {hours} hours, {minutes} minutes and {seconds} seconds left at this price",
label: "Get It For {price}",
secondaryLabel: "or keep reading to see what's inside",
expiredHeadline: "Your {hours}-hour window has closed",
expiredPriceLine: "The {price} price is no longer available.",
expiredExpiryLine: "Ended {time}",
}
export function EvergreenTimer(props: EvergreenTimerProps) {
const {
windowHours,
startedAt,
onExpire,
offerName = "The Funnel Starter Kit",
price = "$47",
copy,
href,
onAction,
secondaryHref,
locale,
sticky = false,
disabled = false,
state = "default",
className = "",
} = props
const c: EvergreenTimerCopy = { ...DEFAULT_COPY, ...copy, units: { ...DEFAULT_COPY.units, ...copy?.units } }
const valid =
typeof windowHours === "number" && Number.isFinite(windowHours) && windowHours > 0 && typeof startedAt === "number" && Number.isFinite(startedAt)
const totalMs = valid ? (windowHours as number) * 3_600_000 : 0
const [start, setStart] = React.useState<number | null>(null)
const [now, setNow] = React.useState<number | null>(null)
const expireCb = React.useRef(onExpire)
expireCb.current = onExpire
const fired = React.useRef(false)
const uid = React.useId()
React.useEffect(() => {
if (!valid) return
const current = Date.now()
const begin = startedAt as number
fired.current = false
setStart(begin)
setNow(current)
if (current >= begin + totalMs) return
const id = window.setInterval(() => {
const t = Date.now()
setNow(t)
if (t >= begin + totalMs) window.clearInterval(id)
}, 1000)
return () => window.clearInterval(id)
}, [valid, startedAt, totalMs])
const known = start != null && now != null
const remaining = known ? Math.max(0, (start as number) + totalMs - (now as number)) : totalMs
const expired = valid && known && remaining <= 0
React.useEffect(() => {
if (expired && !fired.current) {
fired.current = true
expireCb.current?.()
}
}, [expired])
if (!valid) return null
const showDays = (windowHours as number) > 72
const totalSec = Math.ceil(remaining / 1000)
const d = Math.floor(totalSec / 86400)
const h = showDays ? Math.floor((totalSec % 86400) / 3600) : Math.floor(totalSec / 3600)
const m = Math.floor((totalSec % 3600) / 60)
const sec = totalSec % 60
const progress = totalMs ? remaining / totalMs : 0
const vars = { price, name: offerName, hours: String(windowHours) }
const end = start != null ? new Date(start + totalMs) : null
const expiryText = end
? fill(expired ? c.expiredExpiryLine : c.expiryLine, { ...vars, time: formatEnd(end, locale) })
: fill(c.pendingExpiryLine, vars)
const units: { key: string; value: string; label: string; tick?: boolean }[] = [
...(showDays ? [{ key: "days", value: pad(d), label: c.units.days }] : []),
{ key: "hours", value: pad(h), label: c.units.hours },
{ key: "minutes", value: pad(m), label: c.units.minutes },
{ key: "seconds", value: pad(sec), label: c.units.seconds, tick: true },
]
const timerText = fill(showDays ? c.timerLabelDays : c.timerLabel, {
days: String(d),
hours: String(h),
minutes: String(m),
seconds: String(sec),
})
const isDisabled = disabled || state === "disabled"
const btnClass = `cf-et__btn${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-active" : ""}`
const label = fill(c.label, vars)
const note = c.note ? fill(c.note, vars) : ""
const secondary = c.secondaryLabel ? fill(c.secondaryLabel, vars) : ""
return (
<div className={`cf-evergreen-timer${sticky ? " is-sticky" : ""}${className ? ` ${className}` : ""}`}>
<style>{CSS}</style>
<section
className={`cf-et__bar${expired ? " is-expired" : ""}${showDays ? " has-days" : ""}`}
aria-labelledby={`${uid}-title`}
>
<div className="cf-et__pod">
<Ring
progress={expired ? 0 : progress}
expired={expired}
badge={fill(c.windowBadge, vars)}
label={expired ? c.closedLabel : c.windowLabel}
/>
<div className="cf-et__clock">
<div className="cf-et__digits" role="timer" aria-live="off" aria-label={timerText}>
{units.map((u, i) => (
<React.Fragment key={u.key}>
{i > 0 && (
<span className="cf-et__colon" aria-hidden="true">
:
</span>
)}
<span className="cf-et__unit" aria-hidden="true">
<span className="cf-et__tile">
<span
key={u.tick ? u.value : u.key}
className={`cf-et__num${u.tick && known && !expired ? " is-tick" : ""}`}
>
{u.value}
</span>
</span>
<span className="cf-et__unit-label">{u.label}</span>
</span>
</React.Fragment>
))}
</div>
<p className="cf-et__ends">
<CalendarClock aria-hidden="true" />
<span>{expiryText}</span>
</p>
</div>
</div>
<div className="cf-et__copy">
<h3 id={`${uid}-title`} className="cf-et__title">
{fill(expired ? c.expiredHeadline : c.headline, vars)}
</h3>
<p className="cf-et__price-line">
{expired ? fill(c.expiredPriceLine, vars) : withPrice(c.priceLine, vars)}
</p>
{!expired && note && <p className="cf-et__note">{note}</p>}
</div>
{!expired && (
<div className="cf-et__action">
{href && !isDisabled ? (
<a className={btnClass} href={href} onClick={() => onAction?.()}>
{label}
</a>
) : (
<button type="button" className={btnClass} disabled={isDisabled} onClick={() => onAction?.()}>
{label}
</button>
)}
{secondary &&
(secondaryHref ? (
<a className="cf-et__more is-link" href={secondaryHref}>
{secondary}
</a>
) : (
<p className="cf-et__more">{secondary}</p>
))}
</div>
)}
</section>
</div>
)
}
export default EvergreenTimer
const R = 44
const CIRC = 2 * Math.PI * R
function Ring({ progress, expired, badge, label }: { progress: number; expired: boolean; badge: string; label: string }) {
const p = Math.min(1, Math.max(0, progress))
const angle = 2 * Math.PI * p
return (
<div className="cf-et__ring">
<svg viewBox="0 0 100 100" aria-hidden="true" focusable="false">
<g transform="rotate(-90 50 50)">
<circle className="cf-et__track" cx="50" cy="50" r={R} fill="none" strokeWidth="7" />
{p > 0 && (
<circle
className="cf-et__arc"
cx="50"
cy="50"
r={R}
fill="none"
strokeWidth="7"
strokeLinecap="round"
strokeDasharray={CIRC}
strokeDashoffset={CIRC * (1 - p)}
/>
)}
{p > 0 && (
<circle className="cf-et__head" cx={50 + R * Math.cos(angle)} cy={50 + R * Math.sin(angle)} r="4.5" />
)}
</g>
</svg>
<span className="cf-et__ring-center">
{expired ? <Lock aria-hidden="true" /> : <strong>{badge}</strong>}
<span>{label}</span>
</span>
</div>
)
}
function pad(n: number) {
return String(n).padStart(2, "0")
}
function fill(template: string, vars: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? vars[key] : match))
}
function withPrice(template: string, vars: Record<string, string>) {
const parts = template.split("{price}")
return parts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 && <span className="cf-et__price">{vars.price}</span>}
{fill(part, vars)}
</React.Fragment>
))
}
function formatEnd(end: Date, locale?: string) {
const far = Math.abs(end.getTime() - Date.now()) > 6 * 86_400_000
try {
return new Intl.DateTimeFormat(
locale,
far
? { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" }
: { weekday: "short", hour: "numeric", minute: "2-digit" }
).format(end)
} catch {
return end.toLocaleString()
}
}
const CSS = `
.cf-evergreen-timer {
--cf-et-alert: var(--timer-alert, var(--danger, oklch(0.5 0.17 27)));
--cf-et-tile-h: 3.5rem;
container-type: inline-size;
container-name: cf-et;
width: 100%;
font-family: var(--font-body, system-ui, sans-serif);
line-height: 1.5;
color: var(--ink, oklch(0.21 0.034 263));
}
.cf-evergreen-timer.is-sticky { position: sticky; top: 0; z-index: 40; }
.cf-evergreen-timer *, .cf-evergreen-timer *::before, .cf-evergreen-timer *::after { box-sizing: border-box; }
.cf-evergreen-timer .cf-et__bar {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "pod" "copy" "action";
overflow: hidden;
background: var(--card, oklch(1 0 0));
border: 1px solid var(--card-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 12%, transparent));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 256 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 256 / 0.2)));
}
/* Timer pod: the band-coloured face of the strip */
.cf-evergreen-timer .cf-et__pod {
grid-area: pod;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
min-width: 0;
padding: 1rem 1.125rem;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, oklch(1 0 0));
box-shadow: inset 0 -1px 0 oklch(from var(--band, oklch(0.27 0.067 256)) calc(l - 0.06) c h);
}
.cf-evergreen-timer .cf-et__ring { position: relative; flex: 0 0 auto; width: 5rem; aspect-ratio: 1; }
.cf-evergreen-timer .cf-et__ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cf-evergreen-timer .cf-et__track { stroke: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.16); }
.cf-evergreen-timer .cf-et__arc { stroke: var(--band-ink, oklch(1 0 0)); transition: stroke-dashoffset 1s linear; }
.cf-evergreen-timer .cf-et__head {
fill: var(--band-ink, oklch(1 0 0));
stroke: var(--band, oklch(0.27 0.067 256));
stroke-width: 2.5;
}
.cf-evergreen-timer .cf-et__ring-center {
position: absolute;
inset: 0;
display: grid;
place-content: center;
justify-items: center;
gap: 0.25rem;
line-height: 1;
text-align: center;
}
.cf-evergreen-timer .cf-et__ring-center strong {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.125rem;
letter-spacing: -0.01em;
font-variant-numeric: tabular-nums;
}
.cf-evergreen-timer .cf-et__ring-center svg { width: 1.25rem; height: 1.25rem; }
.cf-evergreen-timer .cf-et__ring-center span {
font-size: 0.6875rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: color-mix(in oklch, var(--band-ink, oklch(1 0 0)) 84%, var(--band, oklch(0.27 0.067 256)));
}
.cf-evergreen-timer .cf-et__clock { display: flex; flex: 1 1 auto; flex-direction: column; gap: 0.625rem; min-width: 0; max-width: 17rem; }
.cf-evergreen-timer .cf-et__digits { display: flex; align-items: flex-start; gap: 0.25rem; }
.cf-evergreen-timer .cf-et__unit { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: 0.375rem; min-width: 0; }
.cf-evergreen-timer .cf-et__tile {
position: relative;
display: grid;
place-items: center;
width: 100%;
height: var(--cf-et-tile-h);
padding: 0 0.25rem;
overflow: hidden;
border-radius: calc(var(--radius, 14px) * 0.6);
background: linear-gradient(
oklch(from var(--band, oklch(0.27 0.067 256)) calc(l + 0.09) c h),
oklch(from var(--band, oklch(0.27 0.067 256)) calc(l + 0.05) c h)
);
box-shadow:
inset 0 1px 0 oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.14),
inset 0 -2px 0 oklch(from var(--band, oklch(0.27 0.067 256)) calc(l - 0.05) c h),
0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 256)) calc(l - 0.08) c h / 0.5);
}
.cf-evergreen-timer .cf-et__tile::after {
content: "";
position: absolute;
left: 0;
right: 0;
top: 50%;
height: 1px;
background: oklch(from var(--band, oklch(0.27 0.067 256)) calc(l - 0.06) c h / 0.8);
}
.cf-evergreen-timer .cf-et__num {
position: relative;
z-index: 1;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.75rem;
line-height: 1;
letter-spacing: -0.01em;
font-variant-numeric: tabular-nums;
color: var(--band-ink, oklch(1 0 0));
}
.cf-evergreen-timer .has-days .cf-et__num { font-size: 1.5rem; }
.cf-evergreen-timer .cf-et__num.is-tick { animation: cf-et-tick 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes cf-et-tick { from { transform: translateY(-0.16em); } to { transform: none; } }
.cf-evergreen-timer .cf-et__unit-label {
font-size: 0.75rem;
font-weight: 700;
line-height: 1;
letter-spacing: 0.08em;
text-transform: uppercase;
color: color-mix(in oklch, var(--band-ink, oklch(1 0 0)) 84%, var(--band, oklch(0.27 0.067 256)));
}
.cf-evergreen-timer .cf-et__colon {
display: flex;
align-items: center;
height: var(--cf-et-tile-h);
font-family: var(--font-display, inherit);
font-weight: 800;
font-size: 1.375rem;
line-height: 1;
color: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.5);
}
.cf-evergreen-timer .cf-et__ends {
display: flex;
align-items: center;
gap: 0.4rem;
margin: 0;
font-size: 0.875rem;
font-weight: 600;
line-height: 1.3;
color: color-mix(in oklch, var(--band-ink, oklch(1 0 0)) 90%, var(--band, oklch(0.27 0.067 256)));
text-wrap: pretty;
}
.cf-evergreen-timer .cf-et__ends svg { flex: 0 0 auto; width: 1rem; height: 1rem; }
/* Copy: red sales-letter headline, price line, note */
.cf-evergreen-timer .cf-et__copy { grid-area: copy; min-width: 0; padding: 1.25rem 1.25rem 0.25rem; }
.cf-evergreen-timer .cf-et__title {
margin: 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.015em);
font-size: 1.375rem;
line-height: 1.15;
color: var(--cf-et-alert);
text-wrap: balance;
}
.cf-evergreen-timer .cf-et__price-line {
margin: 0.5rem 0 0;
font-size: 1.0625rem;
font-weight: 700;
line-height: 1.35;
color: var(--ink, oklch(0.21 0.034 263));
text-wrap: pretty;
}
.cf-evergreen-timer .cf-et__price {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.375em;
letter-spacing: -0.01em;
font-variant-numeric: tabular-nums;
}
.cf-evergreen-timer .cf-et__note {
max-width: 46ch;
margin: 0.5rem 0 0;
font-size: 1rem;
line-height: 1.5;
color: var(--muted, oklch(0.45 0.03 258));
text-wrap: pretty;
}
/* Action: one button, one quiet line */
.cf-evergreen-timer .cf-et__action {
grid-area: action;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 0.625rem;
min-width: 0;
padding: 1rem 1.25rem 1.25rem;
}
.cf-evergreen-timer .cf-et__btn {
--cf-et-b: var(--button-bg, var(--cta, oklch(0.576 0.209 29.5)));
--cf-et-b2: var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5)));
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
width: 100%;
min-height: 3.5rem;
margin: 0;
padding: 0.75rem 1.75rem;
border: 1px solid oklch(from var(--cf-et-b) calc(l - 0.14) c h);
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(180deg, oklch(from var(--cf-et-b) calc(l + 0.04) c h), var(--cf-et-b2));
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
font-family: var(--button-font, var(--font-display, inherit));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: 1.125rem;
line-height: 1.2;
letter-spacing: -0.005em;
text-align: center;
text-decoration: none;
text-wrap: balance;
text-shadow: var(--button-text-shadow, none);
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--cf-et-b) calc(l + 0.14) c h / 0.7),
inset 0 -3px 0 oklch(from var(--cf-et-b) calc(l - 0.16) c h),
var(--shadow-md, 0 1px 2px oklch(0.22 0.03 256 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 256 / 0.2)));
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cf-evergreen-timer .cf-et__btn:hover:not(:disabled),
.cf-evergreen-timer .cf-et__btn.is-hover:not(:disabled) {
transform: translateY(-1px);
background: linear-gradient(180deg, oklch(from var(--cf-et-b) calc(l + 0.08) c h), oklch(from var(--cf-et-b2) calc(l + 0.03) c h));
box-shadow:
inset 0 1px 0 oklch(from var(--cf-et-b) calc(l + 0.16) c h / 0.7),
inset 0 -3px 0 oklch(from var(--cf-et-b) calc(l - 0.16) c h),
var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 256 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 256 / 0.32));
}
.cf-evergreen-timer .cf-et__btn:active:not(:disabled),
.cf-evergreen-timer .cf-et__btn.is-active:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(180deg, var(--cf-et-b2), oklch(from var(--cf-et-b2) calc(l - 0.04) c h));
box-shadow:
inset 0 2px 3px oklch(from var(--cf-et-b) calc(l - 0.24) c h / 0.45),
var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 256 / 0.18), 0 1px 3px oklch(0.22 0.03 256 / 0.14));
}
.cf-evergreen-timer .cf-et__btn:focus-visible {
outline: 3px solid var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
outline-offset: 3px;
}
.cf-evergreen-timer .cf-et__btn:disabled {
cursor: not-allowed;
transform: none;
border-color: var(--button-2-border, transparent);
background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263)));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
}
.cf-evergreen-timer .cf-et__more {
align-self: center;
margin: 0;
font-size: 0.9375rem;
line-height: 1.4;
text-align: center;
color: var(--muted, oklch(0.45 0.03 258));
text-wrap: pretty;
}
.cf-evergreen-timer .cf-et__more.is-link {
border-radius: 4px;
text-decoration: underline;
text-decoration-color: oklch(from var(--muted, oklch(0.45 0.03 258)) l c h / 0.45);
text-underline-offset: 0.18em;
}
.cf-evergreen-timer .cf-et__more.is-link:hover { color: var(--ink, oklch(0.21 0.034 263)); text-decoration-color: currentColor; }
.cf-evergreen-timer .cf-et__more.is-link:focus-visible { outline: 2px solid var(--field-focus, var(--accent, oklch(0.5 0.17 257))); outline-offset: 3px; }
/* Narrow phones with a day tile: stack the ring above the clock */
@container cf-et (max-width: 26rem) {
.cf-evergreen-timer .has-days .cf-et__pod { flex-direction: column; }
.cf-evergreen-timer .has-days .cf-et__clock { width: 100%; }
}
/* Tablet: timer across the top, copy and action side by side */
@container cf-et (min-width: 40rem) {
.cf-evergreen-timer .cf-et__bar {
--cf-et-tile-h: 3.75rem;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas: "pod pod" "copy action";
align-items: center;
}
.cf-evergreen-timer .cf-et__pod { gap: 1.5rem; padding: 1.125rem 1.5rem; }
.cf-evergreen-timer .cf-et__ring { width: 5.5rem; }
.cf-evergreen-timer .cf-et__ring-center strong { font-size: 1.25rem; }
.cf-evergreen-timer .cf-et__clock { flex: 0 1 auto; max-width: none; }
.cf-evergreen-timer .cf-et__unit { flex: 0 0 4.25rem; }
.cf-evergreen-timer .cf-et__num, .cf-evergreen-timer .has-days .cf-et__num { font-size: 2rem; }
.cf-evergreen-timer .cf-et__copy { padding: 1.375rem 1.5rem; }
.cf-evergreen-timer .cf-et__title { font-size: 1.5rem; }
.cf-evergreen-timer .cf-et__action { align-items: center; padding: 1.375rem 1.5rem 1.375rem 0; }
.cf-evergreen-timer .cf-et__btn { width: auto; white-space: nowrap; }
}
/* Desktop: one slim strip, timer pod / copy / action */
@container cf-et (min-width: 68rem) {
.cf-evergreen-timer .cf-et__bar {
grid-template-columns: auto minmax(0, 1fr) auto;
grid-template-areas: "pod copy action";
}
.cf-evergreen-timer .cf-et__pod {
align-self: stretch;
padding: 1.25rem 1.75rem;
box-shadow: inset -1px 0 0 oklch(from var(--band, oklch(0.27 0.067 256)) calc(l - 0.06) c h);
}
.cf-evergreen-timer .cf-et__ring { width: 6rem; }
.cf-evergreen-timer .cf-et__copy { padding: 1.5rem 1.75rem; }
.cf-evergreen-timer .cf-et__action { padding: 1.5rem 1.75rem 1.5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
.cf-evergreen-timer .cf-et__num.is-tick { animation: none; }
.cf-evergreen-timer .cf-et__arc,
.cf-evergreen-timer .cf-et__btn { transition: none; }
.cf-evergreen-timer .cf-et__btn:hover:not(:disabled),
.cf-evergreen-timer .cf-et__btn.is-hover:not(:disabled),
.cf-evergreen-timer .cf-et__btn:active:not(:disabled),
.cf-evergreen-timer .cf-et__btn.is-active:not(:disabled) { transform: none; }
}
`
pieces/urgency/evergreen-timer/specimen.tsx 32 lines
import * as React from "react"
import { EvergreenTimer } from "../evergreen-timer"
import defaults from "../../studio-defaults.json"
const sample = defaults.sample
export const states = ["default", "hover", "active", "disabled"] as const
type SpecimenState = (typeof states)[number]
export default function EvergreenTimerSpecimen({ state = "default" }: { state?: SpecimenState }) {
// Sample visitor: first opened the replay 13 hours 22 minutes ago, inside a 48-hour per-visitor window.
const [startedAt] = React.useState(() => Date.now() - (13 * 60 + 22) * 60_000)
return (
<EvergreenTimer
windowHours={48}
startedAt={startedAt}
offerName={sample.name}
price={sample.price}
state={state}
href="#order"
secondaryHref="#replay"
copy={{
headline: "Your replay price is held for you",
priceLine: "{name} for {price} today. That's it.",
note: "One payment, no subscription. Your {hours}-hour window started when you first opened this replay.",
label: "Claim My Kit For {price}",
secondaryLabel: "or keep watching the replay",
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
windowHours OptionalEvergreenTimer |
number |
|
startedAt OptionalEvergreenTimer |
number |
|
storageKey OptionalEvergreenTimer |
string |
|
onStart OptionalEvergreenTimer |
(startedAt: number) => void |
|
onExpire OptionalEvergreenTimer |
() => void |
|
offerName OptionalEvergreenTimer |
string |
|
price OptionalEvergreenTimer |
string |
|
copy OptionalEvergreenTimer |
Partial<Omit<EvergreenTimerCopy, "units">> & { units?: Partial<EvergreenTimerCopy["units"]> } |
|
href OptionalEvergreenTimer |
string |
|
onAction OptionalEvergreenTimer |
() => void |
|
secondaryHref OptionalEvergreenTimer |
string |
|
locale OptionalEvergreenTimer |
string |
|
sticky OptionalEvergreenTimer |
boolean |
|
disabled OptionalEvergreenTimer |
boolean |
|
state OptionalEvergreenTimer |
"default" | "hover" | "active" | "disabled" |
|
className OptionalEvergreenTimer |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB