Skip to content

Commit 4e20663

Browse files
authored
chore: redesign card (#3290)
1 parent 6e609e7 commit 4e20663

File tree

10 files changed

+35
-24
lines changed

10 files changed

+35
-24
lines changed

apps/preview/next/pages/showcases/Card/CardDefault.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { SfButton } from '@storefront-ui/react';
77
const cardDetails = [
88
{
99
image: 'http://localhost:3100/@assets/card-3.png',
10-
title: 'Sip Sustainably: The Rise of Boxed Water',
10+
title: "Trail Running: Nature's Ultimate Challenge",
1111
description:
12-
'Boxed water is a sustainable alternative to traditional plastic bottles, made from renewable resources.',
12+
"Explore the exhilarating world of trail running. Embrace nature's rugged terrains, elevate your fitness, and learn to conquer every path.",
1313
button: 'Read more',
1414
},
1515
{
@@ -34,18 +34,23 @@ export default function CardDefault() {
3434
{cardDetails.map(({ image, title, description, button }) => (
3535
<div
3636
key={title}
37-
className="flex flex-col min-w-[325px] max-w-[375px] lg:w-[496px] relative border border-neutral-200 rounded-md hover:shadow-xl"
37+
className="flex flex-col min-w-[325px] max-w-[375px] lg:w-[496px] relative border border-neutral-200 rounded-3xl hover:shadow-xl active:shadow-none transition-shadow group"
3838
>
3939
<a
40-
className="absolute inset-0 z-1 focus-visible:outline focus-visible:outline-offset focus-visible:rounded-md"
40+
className="absolute inset-0 z-1 focus-visible:outline focus-visible:outline-offset focus-visible:rounded-3xl"
4141
href="#"
4242
aria-label={title}
4343
/>
44-
<img src={image} alt={title} className="object-cover h-auto rounded-t-md aspect-video" />
45-
<div className="flex flex-col items-start p-4 grow">
44+
<img src={image} alt={title} className="object-cover h-auto rounded-t-3xl aspect-video" />
45+
<div className="flex flex-col items-end p-4 grow">
4646
<p className="font-medium typography-text-base">{title}</p>
4747
<p className="mt-1 mb-4 font-normal typography-text-sm text-neutral-700">{description}</p>
48-
<SfButton size="sm" variant="tertiary" className="relative mt-auto">
48+
<SfButton
49+
size="sm"
50+
variant="tertiary"
51+
className="mt-auto group-has-[:focus-visible]:outline group-has-[:focus-visible]:outline-offset pointer-events-none"
52+
tabIndex={-1}
53+
>
4954
{button}
5055
</SfButton>
5156
</div>

apps/preview/next/pages/showcases/Card/CategoryCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const categories = [
1313
image: 'http://localhost:3100/@assets/men_category.png',
1414
},
1515
{
16-
title: `Kid`,
16+
title: `Kids`,
1717
image: 'http://localhost:3100/@assets/kid_category.png',
1818
},
1919
];
@@ -23,19 +23,19 @@ export default function CategoryCard() {
2323
{categories.map(({ title, image }) => (
2424
<div className="relative min-w-[180px] flex-col max-w-[240px] group" key={title}>
2525
<a
26-
className="absolute w-full h-full z-[1] focus-visible:outline focus-visible:outline-offset focus-visible:rounded-md"
26+
className="absolute w-full h-full z-[1] focus-visible:outline focus-visible:outline-offset focus-visible:rounded-3xl"
2727
href="#"
2828
aria-label={title}
2929
/>
3030
<img
31-
className="rounded-full bg-neutral-100 group-hover:shadow-xl group-active:shadow-none"
31+
className="transition-[filter] drop-shadow-none group-hover:drop-shadow-xl group-active:drop-shadow-none"
3232
src={image}
3333
alt={title}
3434
width="240"
3535
height="240"
3636
/>
37-
<div className="flex justify-center">
38-
<a className="mt-4 font-semibold no-underline text-normal-900 typography-text-base group-hover:underline group-hover:text-primary-800 group-hover:font-normal group-active:text-primary-800 group-active:font-normal">
37+
<div className="flex justify-center p-4 gap-4">
38+
<a className="font-medium no-underline text-normal-900 typography-text-base group-hover:underline group-hover:text-primary-900 group-hover:font-normal group-active:underline group-active:text-primary-900 group-active:font-normal">
3939
{title}
4040
</a>
4141
</div>

apps/preview/nuxt/pages/showcases/Card/CardDefault.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
<div
55
v-for="({ image, title, description, button }, index) in cardDetails"
66
:key="`${title}-${index}`"
7-
class="flex flex-col min-w-[325px] max-w-[375px] lg:w-[496px] relative border border-neutral-200 rounded-md hover:shadow-xl"
7+
class="flex flex-col min-w-[325px] max-w-[375px] lg:w-[496px] relative border border-neutral-200 rounded-3xl hover:shadow-xl active:shadow-none transition-shadow group"
88
>
99
<a
10-
class="absolute inset-0 z-1 focus-visible:outline focus-visible:outline-offset focus-visible:rounded-md"
10+
class="absolute inset-0 z-1 focus-visible:outline focus-visible:outline-offset focus-visible:rounded-3xl"
1111
href="#"
1212
/>
13-
<img :src="image" :alt="title" class="object-cover h-auto rounded-t-md aspect-video" />
14-
<div class="flex flex-col items-start p-4 grow">
13+
<img :src="image" :alt="title" class="object-cover h-auto rounded-t-3xl aspect-video" />
14+
<div class="flex flex-col items-end p-4 grow">
1515
<p class="font-medium typography-text-base">{{ title }}</p>
1616
<p class="mt-1 mb-4 font-normal typography-text-sm text-neutral-700">{{ description }}</p>
17-
<SfButton size="sm" variant="tertiary" class="relative mt-auto">{{ button }}</SfButton>
17+
<SfButton
18+
size="sm"
19+
variant="tertiary"
20+
class="mt-auto group-has-[:focus-visible]:outline group-has-[:focus-visible]:outline-offset pointer-events-none"
21+
tabindex="-1"
22+
>{{ button }}</SfButton
23+
>
1824
</div>
1925
</div>
2026
</div>
@@ -25,9 +31,9 @@ import { SfButton } from '@storefront-ui/vue';
2531
const cardDetails = [
2632
{
2733
image: 'http://localhost:3100/@assets/card-3.png',
28-
title: 'Sip Sustainably: The Rise of Boxed Water',
34+
title: "Trail Running: Nature's Ultimate Challenge",
2935
description:
30-
'Boxed water is a sustainable alternative to traditional plastic bottles, made from renewable resources.',
36+
"Explore the exhilarating world of trail running. Embrace nature's rugged terrains, elevate your fitness, and learn to conquer every path.",
3137
button: 'Read more',
3238
},
3339
{

apps/preview/nuxt/pages/showcases/Card/CategoryCard.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
class="relative flex-col min-w-[140px] max-w-[240px] justify-center group"
77
>
88
<a
9-
class="absolute w-full h-full z-[1] focus-visible:outline focus-visible:outline-offset focus-visible:rounded-md"
9+
class="absolute w-full h-full z-[1] focus-visible:outline focus-visible:outline-offset focus-visible:rounded-3xl"
1010
href="#"
1111
:aria-label="title"
1212
/>
1313
<img
14-
class="rounded-full bg-neutral-100 group-hover:shadow-xl group-active:shadow-none"
14+
class="transition-[filter] drop-shadow-none group-hover:drop-shadow-xl group-active:drop-shadow-none"
1515
:src="image"
1616
:alt="title"
1717
width="240"
1818
height="240"
1919
/>
20-
<div class="flex justify-center">
20+
<div class="flex justify-center p-4 gap-4">
2121
<a
22-
class="mt-4 font-semibold no-underline text-normal-900 typography-text-base group-hover:underline group-hover:text-primary-800 group-hover:font-normal group-active:text-primary-800 group-active:font-normal"
22+
class="font-medium no-underline text-normal-900 typography-text-base group-hover:underline group-hover:text-primary-900 group-hover:font-normal group-active:underline group-active:text-primary-900 group-active:font-normal"
2323
>
2424
{{ title }}
2525
</a>
@@ -39,7 +39,7 @@ const categories = [
3939
image: 'http://localhost:3100/@assets/men_category.png',
4040
},
4141
{
42-
title: `Kid`,
42+
title: `Kids`,
4343
image: 'http://localhost:3100/@assets/kid_category.png',
4444
},
4545
];
2.51 MB
Loading
3.12 MB
Loading
3.05 MB
Loading
17 KB
Loading
36.4 KB
Loading
11.2 KB
Loading

0 commit comments

Comments
 (0)