Skip to content

Commit ef399b2

Browse files
committed
fix(web): guarantee hero text contrast on bright covers
A bottom-up gradient alone wasn't enough where the title/bio actually sit over a very bright cover (e.g. a sunlit street photo) — cream text stayed washed out. Add a flat ink tint over the whole cover to tame bright midtones, plus a stronger/taller bottom scrim and heavier text-shadow. Applied to the public cart hero, the editor live preview, and the landing phone mockups.
1 parent 60a3f5d commit ef399b2

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

web/app/(public)/c/[slug]/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ export default async function PublicCartPage({ params }: { params: { slug: strin
4141
priority
4242
sizes="100vw"
4343
/>
44-
{/* Stronger bottom scrim so cream text stays legible on light covers. */}
45-
<div className="absolute inset-0 bg-gradient-to-t from-ink/90 via-ink/55 to-ink/10" />
46-
<div className="absolute inset-x-0 bottom-0 px-5 sm:px-6 pb-6 sm:pb-10 max-w-3xl mx-auto text-cream [text-shadow:0_1px_10px_rgba(0,0,0,0.55)]">
44+
{/* Two-layer scrim: a flat tint tames bright covers, and a strong bottom
45+
gradient anchors the text — keeps cream text legible on ANY cover. */}
46+
<div className="absolute inset-0 bg-ink/25" />
47+
<div className="absolute inset-0 bg-gradient-to-t from-ink/95 via-ink/45 to-transparent" />
48+
<div className="absolute inset-x-0 bottom-0 px-5 sm:px-6 pb-6 sm:pb-10 max-w-3xl mx-auto text-cream [text-shadow:0_1px_12px_rgba(0,0,0,0.7)]">
4749
<div className="flex items-center gap-2 mb-2 sm:mb-3">
4850
<Image src={cart.ownerAvatarUrl} alt="" width={32} height={32} className="rounded-full border border-cream/40" unoptimized />
4951
<span className="text-sm font-medium">@{cart.ownerHandle}</span>
5052
</div>
5153
<h1 className="font-serif text-3xl sm:text-5xl leading-[1.05] mb-2 sm:mb-3">{cart.title}</h1>
52-
{cart.bio && <p className="text-sm sm:text-base text-cream/95 max-w-xl leading-relaxed">{linkify(cart.bio)}</p>}
54+
{cart.bio && <p className="text-sm sm:text-base text-cream max-w-xl leading-relaxed">{linkify(cart.bio)}</p>}
5355
</div>
5456
</section>
5557

web/app/(public)/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,13 @@ function PhoneCard({
268268
sizes="(max-width: 1024px) 50vw, 25vw"
269269
priority={front}
270270
/>
271-
<div className="absolute inset-0 bg-gradient-to-t from-ink/70 via-ink/15 to-transparent" />
272-
<div className="absolute bottom-3 left-3 right-3 text-cream">
271+
<div className="absolute inset-0 bg-ink/20" />
272+
<div className="absolute inset-0 bg-gradient-to-t from-ink/95 via-ink/45 to-transparent" />
273+
<div className="absolute bottom-3 left-3 right-3 text-cream [text-shadow:0_1px_8px_rgba(0,0,0,0.6)]">
273274
<p className="font-serif text-lg sm:text-xl leading-tight">
274275
{cart.title}
275276
</p>
276-
<p className="text-[10px] sm:text-xs opacity-80 mt-0.5">
277+
<p className="text-[10px] sm:text-xs opacity-90 mt-0.5">
277278
@{cart.ownerHandle}
278279
</p>
279280
</div>

web/app/dashboard/carts/[id]/editor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ function PreviewCartPage({ cart }: { cart: Cart }) {
352352
<div style={{ ["--accent" as string]: cart.accentHex } as React.CSSProperties}>
353353
<div className="relative aspect-[5/4]">
354354
<CartCover coverImageUrl={cart.coverImageUrl} accentHex={cart.accentHex} title={cart.title} />
355-
<div className="absolute inset-0 bg-gradient-to-t from-ink/90 via-ink/55 to-ink/10" />
356-
<div className="absolute bottom-3 left-3 right-3 text-cream [text-shadow:0_1px_8px_rgba(0,0,0,0.55)]">
355+
<div className="absolute inset-0 bg-ink/25" />
356+
<div className="absolute inset-0 bg-gradient-to-t from-ink/95 via-ink/45 to-transparent" />
357+
<div className="absolute bottom-3 left-3 right-3 text-cream [text-shadow:0_1px_10px_rgba(0,0,0,0.7)]">
357358
<p className="text-xs font-medium">@{cart.ownerHandle}</p>
358359
<p className="font-serif text-xl leading-tight">{cart.title}</p>
359360
</div>

0 commit comments

Comments
 (0)