Skip to content

Commit 6f730a6

Browse files
authored
feat: add new service card design (#593)
* feat: add new service card design * fix: add external arrow icon when button is wide enough
1 parent 4496490 commit 6f730a6

16 files changed

+228
-192
lines changed
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

apps/website/public/cog.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 7 additions & 0 deletions
Loading

apps/website/public/streamline.svg

Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
import ExternalLink from "./ExternalLink.astro";
3+
4+
interface Props {
5+
href: string;
6+
linkText: string;
7+
title: string;
8+
}
9+
10+
const { href, linkText, title } = Astro.props;
11+
---
12+
13+
<div class="bg-white p-4 rounded-md gap-2 grid md:w-[65%]">
14+
<span class="text-contrast text-sm sm:text-base font-semibold">{title}</span>
15+
<ExternalLink href={href} text={linkText} />
16+
</div>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
import classnames from "classnames";
3+
4+
interface Props {
5+
id: string;
6+
href: string;
7+
classNames?: string | string[];
8+
}
9+
10+
const { id, href, classNames } = Astro.props;
11+
---
12+
13+
<a
14+
id={id}
15+
class={classnames(
16+
"flex font-medium w-fit h-11 sm:h-[61px] items-center px-4 py-2 rounded-md text-sm sm:text-base text-center whitespace-nowrap bg-crocoder-yellow text-contrast hover:opacity-90 gap-2",
17+
classNames,
18+
)}
19+
href={href}
20+
>
21+
<slot />
22+
</a>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
interface Props {
3+
href: string;
4+
text: string;
5+
}
6+
7+
const { href, text } = Astro.props;
8+
---
9+
10+
<div class="flex gap-2 items-center">
11+
<a
12+
class="text-contrast underline underline-offset-2 text-sm sm:text-base"
13+
href={href}
14+
>
15+
{text}
16+
</a>
17+
<img
18+
src={"arrow-top-right.svg"}
19+
alt="Arrow Top Right"
20+
role="presentation"
21+
class="h-3 w-3 sm:h-4 sm:w-4"
22+
/>
23+
</div>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
interface Props {
3+
subtitle: string;
4+
iconPath: string;
5+
}
6+
7+
const { subtitle, iconPath } = Astro.props;
8+
---
9+
10+
<span class="flex gap-3 items-center">
11+
<img
12+
src={iconPath}
13+
alt=""
14+
role="presentation"
15+
class="lg:mt-[2px] h-6 w-6 sm:h-8 sm:w-8 md:h-12 md:w-12"
16+
/>
17+
<h4
18+
class="font-medium text-base sm:text-lg leading-[110%] md:text-[22px] text-left"
19+
>
20+
{subtitle}
21+
</h4>
22+
</span>
Lines changed: 61 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
---
2-
import classnames from "classnames";
32
import { Image } from "astro:assets";
3+
import classnames from "classnames";
4+
import BlogLink from "./BlogLink.astro";
5+
import CTA from "./CTA.astro";
6+
import IconSubtitle from "./IconSubtitle.astro";
47
58
interface Props {
69
idx: number;
710
title: string;
8-
subtitle: string;
11+
subtitles: Array<{
12+
iconPath: string;
13+
text: string;
14+
}>;
915
content: any;
1016
styles?: string;
11-
imgPath: string;
12-
imgAlt: string;
13-
iconPath: string;
17+
img: {
18+
path: string;
19+
alt?: string;
20+
};
1421
classNames?: string | string[];
22+
link: {
23+
href: string;
24+
text: string;
25+
title?: string;
26+
};
1527
}
1628
17-
const {
18-
title,
19-
subtitle,
20-
content,
21-
styles,
22-
imgPath,
23-
imgAlt,
24-
iconPath,
25-
classNames,
26-
} = Astro.props;
29+
const { title, subtitles, content, styles, img, classNames, link } =
30+
Astro.props;
2731
2832
const images = import.meta.glob("../assets/*.*");
29-
const src = images[`../assets${imgPath}`] as any as () => Promise<{
33+
const src = images[`../assets${img.path}`] as any as () => Promise<{
3034
default: ImageMetadata;
3135
}>;
3236
@@ -53,7 +57,6 @@ const image = await src();
5357
class={classnames(
5458
`text-white
5559
h-full
56-
lg:h-[620px]
5760
p-5
5861
md:p-7
5962
lg:p-12
@@ -65,7 +68,6 @@ const image = await src();
6568
lg:gap-x-7
6669
lg:gap-y-12
6770
lg:grid-cols-2
68-
lg:grid-rows-[min-content_auto]
6971
backdrop-blur-[15px]
7072
`,
7173
classNames,
@@ -74,38 +76,59 @@ const image = await src();
7476
<div
7577
class="col-span-6 grid max-lg:grid-rows-[min-content_min-content_auto] gap-4 md:gap-7 lg:grid-cols-2 lg:col-span-2 lg:items-start justify-between"
7678
>
77-
<span class="grid md:flex gap-4 md:gap-7">
78-
<img
79-
src={iconPath}
80-
alt=""
81-
role="presentation"
82-
class="lg:mt-[2px] h-8 w-8 md:h-12 md:w-12"
79+
<h2
80+
class="font-medium text-xl sm:text-[28px] md:text-5xl text-left leading-[110%] lg:col-start-1 lg:row-start-1"
81+
>
82+
{title}
83+
</h2>
84+
85+
<div class="flex flex-col gap-4 md:gap-9 lg:row-span-2">
86+
<div class="grid md:grid-cols-2 gap-4">
87+
{
88+
subtitles.map(({ iconPath, text }) => (
89+
<IconSubtitle subtitle={text} iconPath={iconPath} />
90+
))
91+
}
92+
</div>
93+
<div
94+
class="[&_p]:text-sm [&_p]:leading-[26px] sm:[&_p]:text-base md:[&_p]:text-[20px] md:[&_p]:font-normal md:[&_p]:leading-8 text-left"
95+
set:html={content.html}
8396
/>
84-
<div class="gap-y-2 flex flex-col">
85-
<h4
86-
class="font-medium text-lg leading-[22px] md:text-[28px] md:leading-[30px] text-left"
87-
>
88-
{title}
89-
</h4>
90-
<p class="text-base md:text-lg">{subtitle}</p>
97+
<div>
98+
{
99+
link?.title ? (
100+
<BlogLink
101+
href={link.href}
102+
title={link.title}
103+
linkText={link.text}
104+
/>
105+
) : (
106+
<CTA id="contact-cta" href={link.href}>
107+
{link.text}
108+
<img
109+
src={"arrow-top-right.svg"}
110+
alt="Arrow Top Right"
111+
role="presentation"
112+
class="hidden min-[330px]:block h-3 w-3 sm:h-4 sm:w-4"
113+
/>
114+
</CTA>
115+
)
116+
}
91117
</div>
92-
</span>
118+
</div>
119+
93120
<div
94-
class="flex flex-col justify-center items-center row-start-3 lg:justify-start lg:col-span-1 lg:row-start-2"
121+
class="flex flex-col justify-center items-center lg:justify-start lg:col-start-1 lg:row-start-2"
95122
>
96123
<Image
97124
class="object-cover w-full max-lg:max-w-[640px] xl:p-6"
98125
src={image.default}
99-
alt={imgAlt}
126+
alt={img.alt || ""}
100127
widths={[320, 480, 578, 640]}
101128
sizes="(max-width: 1024px) calc(100vw - 56px), 640px"
102129
loading="lazy"
103130
/>
104131
</div>
105-
<div
106-
class="flex flex-col lg:flex-col row-start-2 lg:col-span-1 lg:col-start-2 lg:row-span-2 [&_p]:text-base [&_p]:text-sm [&_p]:leading-[26px] md:[&_p]:text-[20px] md:[&_p]:font-normal md:[&_p]:leading-8 text-left"
107-
set:html={content.html}
108-
/>
109132
</div>
110133
</section>
111134
</div>

0 commit comments

Comments
 (0)