Skip to content

Commit 3792cce

Browse files
authored
feat(loops): Add Rafa's geometric hero background to promo card (#3780)
1 parent 883dc3f commit 3792cce

1 file changed

Lines changed: 91 additions & 7 deletions

File tree

packages/ui/src/features/loops/components/LoopsPromoCard.tsx

Lines changed: 91 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,82 @@ const EXAMPLES: { icon: Icon; label: string }[] = [
4646
},
4747
];
4848

49+
function GeometricPattern() {
50+
return (
51+
<svg
52+
className="absolute inset-0 h-full w-full text-white"
53+
viewBox="0 0 232 96"
54+
preserveAspectRatio="xMidYMid slice"
55+
aria-hidden="true"
56+
>
57+
<circle cx="26" cy="22" r="11" fill="currentColor" opacity="0.25" />
58+
<circle
59+
cx="204"
60+
cy="66"
61+
r="17"
62+
fill="none"
63+
stroke="currentColor"
64+
strokeWidth="3"
65+
opacity="0.3"
66+
/>
67+
<rect
68+
x="176"
69+
y="10"
70+
width="15"
71+
height="15"
72+
rx="2"
73+
transform="rotate(18 183 17)"
74+
fill="currentColor"
75+
opacity="0.2"
76+
/>
77+
<polygon points="64,10 75,30 53,30" fill="currentColor" opacity="0.3" />
78+
<path
79+
d="M8 62 l7 -8 7 8 7 -8 7 8"
80+
fill="none"
81+
stroke="currentColor"
82+
strokeWidth="2.5"
83+
strokeLinecap="round"
84+
strokeLinejoin="round"
85+
opacity="0.35"
86+
/>
87+
<circle cx="118" cy="14" r="4" fill="currentColor" opacity="0.35" />
88+
<path
89+
d="M148 78 h12 M154 72 v12"
90+
stroke="currentColor"
91+
strokeWidth="3"
92+
strokeLinecap="round"
93+
opacity="0.3"
94+
/>
95+
<circle
96+
cx="52"
97+
cy="78"
98+
r="6"
99+
fill="none"
100+
stroke="currentColor"
101+
strokeWidth="2.5"
102+
opacity="0.25"
103+
/>
104+
<rect
105+
x="96"
106+
y="70"
107+
width="10"
108+
height="10"
109+
transform="rotate(-12 101 75)"
110+
fill="currentColor"
111+
opacity="0.18"
112+
/>
113+
<polygon
114+
points="206,18 214,32 198,32"
115+
fill="none"
116+
stroke="currentColor"
117+
strokeWidth="2.5"
118+
strokeLinejoin="round"
119+
opacity="0.3"
120+
/>
121+
</svg>
122+
);
123+
}
124+
49125
export function LoopsPromoCard() {
50126
const loopsEnabled = useFeatureFlag(LOOPS_FLAG, import.meta.env.DEV);
51127
const dismissed = useLoopsPromoStore((state) => state.dismissed);
@@ -92,18 +168,20 @@ export function LoopsPromoCard() {
92168
<>
93169
{!dismissed && (
94170
<Box className="shrink-0 px-2 pb-2">
95-
<div className="group relative overflow-hidden rounded-md border border-gray-6 bg-gray-2">
171+
<div className="group relative overflow-hidden rounded-md border border-gray-6 bg-gray-2 transition-shadow hover:shadow-md">
96172
<button
97173
type="button"
98-
className="block w-full text-left transition-colors hover:bg-gray-3"
174+
className="block w-full text-left"
99175
onClick={openDialog}
100176
>
101-
<div className="flex h-24 items-center justify-center border-gray-6 border-b bg-gray-4">
177+
<div className="relative flex h-24 items-center justify-center bg-[#2f80fa]">
178+
<GeometricPattern />
102179
<img
103180
src={loopHog}
104181
alt=""
105-
className="h-[72px] w-auto object-contain"
182+
className="relative h-[72px] w-auto object-contain"
106183
/>
184+
<div className="absolute inset-x-0 bottom-0 h-10 bg-gradient-to-b from-transparent to-(--gray-2)" />
107185
</div>
108186
<div className="flex flex-col gap-0.5 px-3 pt-3 pb-3">
109187
<span className="font-medium text-[13px] text-gray-12">
@@ -129,7 +207,7 @@ export function LoopsPromoCard() {
129207
type="button"
130208
aria-label="Dismiss Loops announcement"
131209
title="Dismiss"
132-
className="absolute top-1.5 right-1.5 rounded-full bg-(--gray-a3) p-1 text-gray-11 opacity-0 transition-all hover:bg-(--gray-a5) hover:text-gray-12 focus-visible:opacity-100 group-hover:opacity-100"
210+
className="absolute top-1.5 right-1.5 rounded-full bg-black/20 p-1 text-white opacity-0 transition-all hover:bg-black/30 focus-visible:opacity-100 group-hover:opacity-100"
133211
onClick={handleDismiss}
134212
>
135213
<XIcon size={10} weight="bold" />
@@ -140,8 +218,14 @@ export function LoopsPromoCard() {
140218

141219
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
142220
<DialogContent className="sm:max-w-md">
143-
<div className="flex h-48 items-center justify-center border-gray-6 border-b bg-gray-4">
144-
<img src={loopHog} alt="" className="h-36 w-auto object-contain" />
221+
<div className="relative flex h-48 items-center justify-center bg-[#2f80fa]">
222+
<GeometricPattern />
223+
<img
224+
src={loopHog}
225+
alt=""
226+
className="relative h-36 w-auto object-contain"
227+
/>
228+
<div className="absolute inset-x-0 bottom-0 h-12 bg-gradient-to-b from-transparent to-(--background)" />
145229
</div>
146230
<div className="flex flex-col gap-4 px-5 pt-4 pb-5">
147231
<div className="flex flex-col gap-1.5">

0 commit comments

Comments
 (0)