From 3bf812cd0aa478369faa97ccc57a4fa240e42b67 Mon Sep 17 00:00:00 2001 From: prd-poc developer Date: Mon, 13 Jul 2026 09:20:01 +0000 Subject: [PATCH] Render PRADA logo in hero-cover ribbon Swap the hero-cover metadata ribbon's brand cell for the PRADA wordmark to match the design, instead of the authored "Fondazione Prada" text. Co-Authored-By: Claude Opus 4.7 --- blocks/hero/hero.css | 9 +++++++++ blocks/hero/hero.js | 11 +++++++++++ scripts/producer-logos.js | 9 +++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/blocks/hero/hero.css b/blocks/hero/hero.css index 3b0aace..ae72970 100644 --- a/blocks/hero/hero.css +++ b/blocks/hero/hero.css @@ -95,6 +95,15 @@ margin-left: -1px; } +/* producer logo (JS-swapped for the last ribbon cell): sized to the 13px ribbon + text so it reads as an inline wordmark. Brightened to white on the dark cover. */ +.hero.hero-cover > div:nth-child(2) > div:first-child .producer-logo { + display: block; + height: 13px; + width: auto; + filter: brightness(0) invert(1); +} + /* title cell: two solid 80px display lines, left-aligned white */ .hero.hero-cover > div:nth-child(2) > div:last-child { display: flex; diff --git a/blocks/hero/hero.js b/blocks/hero/hero.js index e69de29..9d70fbc 100644 --- a/blocks/hero/hero.js +++ b/blocks/hero/hero.js @@ -0,0 +1,11 @@ +import applyProducerLogo from '../../scripts/producer-logos.js'; + +export default function decorate(block) { + // hero-cover: content row (2nd child) holds a metadata ribbon over the title. + // The ribbon's last cell is the producing brand — render it as the PRADA + // wordmark to match the design, regardless of the authored text. + if (!block.classList.contains('hero-cover')) return; + const content = block.children[1]; + const ribbon = content?.firstElementChild; + applyProducerLogo(ribbon?.querySelector('p:last-child'), 'prada'); +} diff --git a/scripts/producer-logos.js b/scripts/producer-logos.js index 7b7daee..b1ad965 100644 --- a/scripts/producer-logos.js +++ b/scripts/producer-logos.js @@ -13,12 +13,13 @@ const LOGOS = { const normalize = (text) => text.trim().toLowerCase().replace(/\s+/g, ' '); /** - * If `el`'s text matches a known producer, replace its contents with that - * producer's logo image. Returns true when a logo was applied. + * Replace `el`'s contents with a producer's logo image. By default the producer + * is resolved from `el`'s text; pass `key` to force a specific producer (e.g. a + * fixed brand mark) regardless of the text. Returns true when a logo was applied. */ -export default function applyProducerLogo(el) { +export default function applyProducerLogo(el, key) { if (!el) return false; - const logo = LOGOS[normalize(el.textContent)]; + const logo = LOGOS[normalize(key ?? el.textContent)]; if (!logo) return false; const img = document.createElement('img');