One End Card, Several Market Versions
Narrow the campaign end card and the translated CTA wraps. Switch territories and the release date changes format. The link needs to follow that selection, too. A composition that looked settled in the campaign deck now has several moving parts.
The deliverable is straightforward: one responsive HTML component, a market-indexed JSON configuration, and a JavaScript renderer. Together, they keep language, release information, and destination coordinated without multiplying templates.
I would preserve the same hierarchy across every version: campaign title first, release timing secondary, CTA unmistakably interactive. The composition should accommodate longer copy while keeping those relationships intact. That gives the motion sequence a consistent landing point, even when the final frame changes language.
Give Territory, Language, and Timing Separate Jobs
A market key identifies the commercial territory. Its configuration supplies the destination and release information. The locale controls translated copy and date formatting; dir controls reading direction. Keep those responsibilities explicit.
A browser language preference cannot reliably choose a commercial destination. A French-speaking viewer may need a Canadian destination, for example. Let the host page or territory selector provide the market key.
This JSON template shows the contract. Replace the uppercase destination and timing tokens with reviewed values before rendering. releaseDate takes a calendar string in YYYY-MM-DD format; launchAt takes a timestamp with an explicit offset.
{
"fallbackMarket": "DE",
"markets": {
"DE": {
"locale": "de-DE",
"dir": "ltr",
"ctaLabel": "Jetzt den vollständigen Trailer ansehen",
"destination": "REVIEWED_DE_HTTPS_DESTINATION",
"releaseDate": "RELEASE_DAY",
"launchAt": null,
"displayTimeZone": "Europe/Berlin"
},
"AE": {
"locale": "ar-AE",
"dir": "rtl",
"ctaLabel": "شاهد الإعلان الكامل الآن",
"destination": "REVIEWED_AE_HTTPS_DESTINATION",
"releaseDate": null,
"launchAt": "LAUNCH_TIMESTAMP_WITH_OFFSET",
"displayTimeZone": "Asia/Dubai"
}
}
}
Choose the timing field by the promise the card makes. A theatrical release day belongs in releaseDate. An event beginning at a precise moment belongs in launchAt, displayed in the market’s displayTimeZone. Populate exactly one timing field per entry so the visible date has an unambiguous meaning.
Let Longer CTAs Set the Card’s Height
A fixed-height text box makes a brittle end frame. Give the title and timing a flexible track, let the CTA wrap, and allow the whole component to grow.
The markup needs stable hooks for rendering, plus language and direction at the component root. Keep the CTA as an anchor: its job is navigation.
<section data-end-card lang="de-DE" dir="ltr"
aria-labelledby="campaign-title" hidden>
<div data-end-card-copy>
<h2 id="campaign-title">Campaign title</h2>
<p><time data-release></time></p>
</div>
<a data-cta></a>
</section>
The title remains fixed in this example. If the campaign localizes it, add a reviewed title field and update it through the same renderer.
[data-end-card] {
box-sizing: border-box;
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: clamp(1rem, 3vw, 2rem);
max-inline-size: 72rem;
margin-inline: auto;
padding-block: clamp(1.5rem, 5vw, 4rem);
padding-inline: clamp(1rem, 4vw, 3rem);
text-align: start;
}
[data-end-card][hidden] { display: none; }
[data-end-card-copy] { min-inline-size: 0; }
[data-end-card] h2 { margin-block: 0 0.5em; }
[data-end-card] p { margin-block: 0; }
[data-cta] {
box-sizing: border-box;
display: block;
max-inline-size: 100%;
padding-block: 0.85em;
padding-inline: 1.25em;
color: #fff;
background: #171717;
text-align: center;
overflow-wrap: anywhere;
}
[data-cta]:focus-visible {
outline: 3px solid #005fcc;
outline-offset: 4px;
}
@media (min-width: 48rem) {
[data-end-card] {
grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
align-items: center;
}
}
Logical properties let spacing and alignment follow the script. Artwork needs its own direction decision. Preserve the approved orientation of photography, brand lockups, and key art; use explicitly localized artwork when the campaign calls for a different composition.
Keep the Release Day from Crossing Midnight
A calendar date names a day. A timestamp identifies a moment. Feeding both through the browser’s default time zone can change the campaign’s message.
For a calendar date, split the components deliberately, construct a UTC value, and format it in UTC. This keeps a viewer west of Greenwich from seeing the previous day. For a launch instant, use the configured market time zone.
function calendarValue(value) {
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
throw new Error('Invalid release date');
}
const [year, month, day] = value.split('-').map(Number);
const date = new Date(Date.UTC(year, month - 1, day));
date.setUTCFullYear(year);
if (date.toISOString().slice(0, 10) !== value) {
throw new Error('Invalid calendar day');
}
return date;
}
function formatDate(value, locale, timeZone) {
return new Intl.DateTimeFormat(locale, {
timeZone,
dateStyle: 'long'
}).format(value);
}
function releaseDisplay(config) {
const { releaseDate, launchAt, locale, displayTimeZone } = config;
if (Boolean(releaseDate) === Boolean(launchAt)) {
throw new Error('Choose one timing field');
}
if (releaseDate) {
return {
machine: releaseDate,
text: formatDate(calendarValue(releaseDate), locale, 'UTC')
};
}
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(launchAt)) {
throw new Error('Launch timestamp needs an explicit offset');
}
calendarValue(launchAt.slice(0, 10));
const instant = new Date(launchAt);
if (!Number.isFinite(instant.getTime())) {
throw new Error('Invalid launch instant');
}
return {
machine: launchAt,
text: formatDate(instant, locale, displayTimeZone)
};
}
The visible date follows the chosen formatting path. The datetime attribute retains the original calendar string or offset timestamp. Enforce any release embargo on the server; this component presents the schedule.
Render the CTA and Destination from One Selection
Validate the complete selection before changing the card. An Arabic CTA pointing to the German destination is a broken campaign handoff, even if both pieces look correct in isolation.
Load the JSON as endCardConfig. The renderer below resolves the market once, prepares the date and destination, checks the DOM hooks, then performs the updates synchronously.
function renderEndCard(root, requestedMarket) {
const { markets, fallbackMarket } = endCardConfig;
const key = Object.hasOwn(markets, requestedMarket)
? requestedMarket : fallbackMarket;
const config = markets[key];
if (!config) throw new Error('Missing market configuration');
for (const field of [
'locale', 'dir', 'ctaLabel', 'destination', 'displayTimeZone'
]) {
if (typeof config[field] !== 'string' || !config[field].trim()) {
throw new Error(`Missing ${field}`);
}
}
if (!['ltr', 'rtl'].includes(config.dir)) {
throw new Error('Invalid direction');
}
const locale = Intl.getCanonicalLocales(config.locale)[0];
if (!locale) throw new Error('Missing locale');
new Intl.DateTimeFormat(locale, {
timeZone: config.displayTimeZone
});
const destination = new URL(config.destination);
if (destination.protocol !== 'https:') {
throw new Error('Destination must use HTTPS');
}
const release = releaseDisplay({ ...config, locale });
const time = root.querySelector('[data-release]');
const cta = root.querySelector('[data-cta]');
if (!time || !cta) throw new Error('Missing component hooks');
root.lang = locale;
root.dir = config.dir;
time.dateTime = release.machine;
time.textContent = release.text;
cta.textContent = config.ctaLabel;
cta.href = destination.href;
root.hidden = false;
}
Call renderEndCard(root, selectedMarket) on initial load and whenever the territory changes. Keep destinations in the reviewed configuration. A query parameter may select a recognized market key; it should never supply the destination itself.
Using textContent keeps translated strings out of the HTML parser. Assigning the validated URL through href keeps the navigation update explicit. If validation fails, the previous complete card remains unchanged, or the initial card stays hidden.
Preflight Each Market as a Complete End Card
Copy approval is only part of release approval. Test the assembled card, including its link, timing, and reading direction.
- Incorrect destination: open every configured CTA and check its territory. Review the wording and destination together.
- Clipped CTA: test narrow and wide viewports, increased text size, and the longest approved labels. Confirm that wrapping preserves the full label and visible keyboard focus.
- Wrong reading direction: switch repeatedly between left-to-right and right-to-left entries. Check text alignment, track order, punctuation, and unchanged artwork orientation.
- Shifted date: emulate time zones on both sides of Greenwich and inspect the visible date alongside
datetime. Calendar dates should retain their day; launch instants should follow the configured display zone. - Incomplete updates: switch markets repeatedly, including an unknown key. Confirm that the fallback resolves correctly and that invalid timing or destinations leave no partially updated card.
Publish each market only after its CTA, destination, release timing, and direction have been approved together in the rendered component.

















