Automaten: Überschrift und Text in festen Zeilen statt zufälliger Umbrüche
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
interface Props {
|
interface Props {
|
||||||
label: string;
|
label: string;
|
||||||
|
/** Ein Zeilenumbruch ("\n") setzt eine feste Zeile, z. B. bei zwei Sätzen. */
|
||||||
title: string;
|
title: string;
|
||||||
lede?: string;
|
lede?: string;
|
||||||
/** Optional photo used as a full-bleed backdrop instead of the textured
|
/** Optional photo used as a full-bleed backdrop instead of the textured
|
||||||
@@ -11,6 +12,9 @@ interface Props {
|
|||||||
|
|
||||||
const { label, title, lede, image, imageAlt = "" } = Astro.props;
|
const { label, title, lede, image, imageAlt = "" } = Astro.props;
|
||||||
const dark = Boolean(image);
|
const dark = Boolean(image);
|
||||||
|
// Mit festen Zeilen bestimmt der Text die Breite, nicht die 16ch-Grenze —
|
||||||
|
// sonst bricht jede Zeile noch einmal mittendrin um.
|
||||||
|
const titleLines = title.split("\n");
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -43,14 +47,18 @@ const dark = Boolean(image);
|
|||||||
<div class="relative mx-auto max-w-[84rem] px-[var(--gutter)] pt-36 pb-16 sm:pt-44 sm:pb-24">
|
<div class="relative mx-auto max-w-[84rem] px-[var(--gutter)] pt-36 pb-16 sm:pt-44 sm:pb-24">
|
||||||
<span class:list={["reveal section-label", dark && "section-label-light"]}>{label}</span>
|
<span class:list={["reveal section-label", dark && "section-label-light"]}>{label}</span>
|
||||||
<h1
|
<h1
|
||||||
class:list={["reveal mt-6 max-w-[16ch]", dark ? "text-white" : "text-brand-ink"]}
|
class:list={[
|
||||||
|
"reveal mt-6",
|
||||||
|
titleLines.length > 1 ? "max-w-full" : "max-w-[16ch]",
|
||||||
|
dark ? "text-white" : "text-brand-ink",
|
||||||
|
]}
|
||||||
style="--delay: 0.08s"
|
style="--delay: 0.08s"
|
||||||
>
|
>
|
||||||
{title}
|
{titleLines.length > 1 ? titleLines.map((zeile) => <span class="block">{zeile}</span>) : title}
|
||||||
</h1>
|
</h1>
|
||||||
{lede && (
|
{lede && (
|
||||||
<p
|
<p
|
||||||
class:list={["reveal lede mt-7", dark ? "text-white/70" : "text-brand-text"]}
|
class:list={["reveal lede mt-7 whitespace-pre-line", dark ? "text-white/70" : "text-brand-text"]}
|
||||||
style="--delay: 0.16s"
|
style="--delay: 0.16s"
|
||||||
>
|
>
|
||||||
{lede}
|
{lede}
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ const standorte = automaten.map((automat, i) => ({
|
|||||||
>
|
>
|
||||||
<PageHero
|
<PageHero
|
||||||
label="Rund um die Uhr"
|
label="Rund um die Uhr"
|
||||||
title="Lust auf Honig & Co.? Jetzt 10x in Hamburg!"
|
title={"Lust auf Honig & Co.?\nJetzt 10x in Hamburg!"}
|
||||||
lede="Ab sofort gibt es alle unsere Produkte in unseren eigenen PLACE4BEES Honigautomaten in Hamburg. Jeden Tag geöffnet, kein Ladenschluss, keine Schlange — Glas ziehen und mitnehmen."
|
lede={"Ab sofort gibt es alle unsere Produkte in unseren eigenen PLACE4BEES Honigautomaten in Hamburg.\nJeden Tag geöffnet, kein Ladenschluss, keine Schlange\u00a0— Glas ziehen und mitnehmen."}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="brand-section bg-brand-surface py-[var(--section-y)]">
|
<section class="brand-section bg-brand-surface py-[var(--section-y)]">
|
||||||
|
|||||||
Reference in New Issue
Block a user