Skip to content

Commit 0d1205a

Browse files
Andrei L. Magneaclaude
authored andcommitted
feat(list): refine empty-list CTA placeholder banners
Polishes the empty-state banners shown on the Lists page (Smart Lists / My Lists) so they read as intentional promo cards rather than cramped text: - Smooth the artwork-to-background blend. The overlay gradient and image mask both gained eased multi-stop ramps (in both themes), removing the hard shoulder where the image met the flat background. - Switch the banner CTA to the new `outline` button style with a purple-600 stroke and readable foreground text, replacing the very bright filled purple. - Give the copy breathing room on the inline-start edge and widen the CTA button's inline padding. - Break the placeholder copy across two rows (first two short sentences, then the rest), with a single-line fallback for locales without ". " sentence breaks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3d3d190 commit 0d1205a

4 files changed

Lines changed: 51 additions & 7 deletions

File tree

projects/client/src/lib/sections/lists/components/cta/_internal/CtaButton.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,23 @@
4444
</script>
4545

4646
<trakt-cta-button>
47-
<Button {href} {size} {icon} variant="primary" style="flat" {...buttonProps}>
47+
<Button {href} {size} {icon} variant="primary" style="outline" {...buttonProps}>
4848
{intl.cta.text({ cta })}
4949
</Button>
5050
</trakt-cta-button>
5151

5252
<style>
5353
trakt-cta-button {
54+
--color-outline-stroke: var(--purple-600);
55+
--color-outline-text: var(--color-foreground);
56+
5457
:global(.trakt-button) {
5558
flex-direction: row-reverse;
5659
}
60+
61+
/* Extra breathing room on the inline edges (2 increments up from small) */
62+
:global(.trakt-button[data-size="small"]) {
63+
padding-inline: var(--ni-20);
64+
}
5765
}
5866
</style>

projects/client/src/lib/sections/lists/components/cta/_internal/CtaContent.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@
115115
116116
object-fit: cover;
117117
118-
mask: linear-gradient(var(--cta-mask-dir), transparent 0%, black 30%);
118+
mask: linear-gradient(
119+
var(--cta-mask-dir),
120+
transparent 0%,
121+
rgba(0, 0, 0, 0.2) 30%,
122+
rgba(0, 0, 0, 0.6) 55%,
123+
black 85%
124+
);
119125
}
120126
}
121127
</style>

projects/client/src/lib/sections/lists/components/cta/_internal/PlaceholderItem.svelte

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
1818
1919
const defaultVariant = $derived(useCtaCardVariant(cta));
2020
const { cover } = $derived(usePlaceholderCover(cta));
21+
22+
// Keep the first two (short) sentences on one row and the remainder on the
23+
// next. Locales that don't use ". " sentence breaks fall back to one line.
24+
const text = $derived.by(() => {
25+
const copy = intl.text({ cta });
26+
const sentences = copy.split(/(?<=\.)\s+/);
27+
28+
if (sentences.length < 3) {
29+
return copy;
30+
}
31+
32+
const firstRow = sentences.slice(0, 2).join(" ");
33+
const secondRow = sentences.slice(2).join(" ");
34+
35+
return `${firstRow}\n${secondRow}`;
36+
});
2137
</script>
2238

2339
{#snippet buttonIcon()}
@@ -32,7 +48,7 @@
3248
<div class="trakt-cta-placeholder">
3349
<div class="trakt-cta-description">
3450
<div class="trakt-cta-list-text">
35-
<p>{intl.text({ cta })}</p>
51+
<p>{text}</p>
3652
</div>
3753

3854
<CtaButton {cta} {intl} icon={buttonIcon} size="small" />
@@ -51,6 +67,12 @@
5167
height: 100%;
5268
5369
gap: var(--gap-m);
70+
71+
padding-inline-start: var(--gap-xl);
72+
73+
@include for-mobile {
74+
padding-inline-start: 0;
75+
}
5476
}
5577
5678
.trakt-cta-description {
@@ -84,6 +106,10 @@
84106
max-width: var(--ni-520);
85107
gap: var(--gap-m);
86108
109+
p {
110+
white-space: pre-line;
111+
}
112+
87113
:global(svg) {
88114
width: var(--ni-80);
89115
height: var(--ni-80);

projects/client/src/style/theme/modes.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@
5757
*/
5858
--color-cta-background-gradient: linear-gradient(
5959
260deg,
60-
color-mix(in srgb, var(--shade-10) 60%, transparent) 0%,
61-
var(--shade-10) 65%
60+
color-mix(in srgb, var(--shade-10) 45%, transparent) 0%,
61+
color-mix(in srgb, var(--shade-10) 68%, transparent) 40%,
62+
color-mix(in srgb, var(--shade-10) 88%, transparent) 72%,
63+
var(--shade-10) 100%
6264
);
6365

6466
/*
@@ -497,8 +499,10 @@
497499
*/
498500
--color-cta-background-gradient: linear-gradient(
499501
260deg,
500-
color-mix(in srgb, var(--shade-900) 60%, transparent) 0%,
501-
var(--shade-900) 65%
502+
color-mix(in srgb, var(--shade-900) 45%, transparent) 0%,
503+
color-mix(in srgb, var(--shade-900) 68%, transparent) 40%,
504+
color-mix(in srgb, var(--shade-900) 88%, transparent) 72%,
505+
var(--shade-900) 100%
502506
);
503507

504508
/*

0 commit comments

Comments
 (0)