Skip to content

Commit 4569d06

Browse files
author
Chai Landau
committed
fix: update switchback and card grid styles
1 parent c0db2ca commit 4569d06

File tree

4 files changed

+59
-33
lines changed

4 files changed

+59
-33
lines changed

src/app/page.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ export default function Home() {
1212
nextText="Jan 26, 2023"
1313
/>
1414
<div className="page-content">
15+
<Switchback
16+
eyebrow="On this day"
17+
leftContent={
18+
<h2 className="heading">
19+
<span>45,515</span> text gen
20+
<br /> models existed
21+
</h2>
22+
}
23+
rightContent={
24+
<p>
25+
We like to say that in AI, a week is a month and a month is a
26+
year, and the "latest and greatest model" changes just as quickly.
27+
We tracked the most popular text-gen models starting in January
28+
2023 to highlight the rapid rate of change in the AI industry.
29+
Click through time to see how quickly the state-of-the-art
30+
changes.
31+
</p>
32+
}
33+
/>
1534
<CardGrid
1635
heading={
1736
<h1>
@@ -82,24 +101,6 @@ export default function Home() {
82101
},
83102
]}
84103
/>
85-
<Switchback
86-
leftContent={
87-
<h2 className="heading">
88-
<span>45,515</span> text gen
89-
<br /> models existed
90-
</h2>
91-
}
92-
rightContent={
93-
<p>
94-
We like to say that in AI, a week is a month and a month is a
95-
year, and the "latest and greatest model" changes just as quickly.
96-
We tracked the most popular text-gen models starting in January
97-
2023 to highlight the rapid rate of change in the AI industry.
98-
Click through time to see how quickly the state-of-the-art
99-
changes.
100-
</p>
101-
}
102-
/>
103104
</div>
104105
</main>
105106
);

src/components/Switchback/Switchback.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
import { FC, ReactElement } from "react";
22

33
interface SwitchbackProps {
4+
/** Optional eyebrow */
5+
eyebrow?: string;
46
/** Content for switback left side (top on mobile) */
57
leftContent: ReactElement;
68
/** Content for switback right side (bottom on mobile) */
79
rightContent: ReactElement;
810
}
9-
const Switchback: FC<SwitchbackProps> = ({ leftContent, rightContent }) => {
11+
const Switchback: FC<SwitchbackProps> = ({
12+
eyebrow,
13+
leftContent,
14+
rightContent,
15+
}) => {
1016
return (
1117
<div className="switchback">
12-
<div>{leftContent}</div>
13-
<div>{rightContent}</div>
18+
<div className="container">
19+
<div>
20+
{eyebrow && (
21+
<div className="eyebrow">
22+
<span>{eyebrow}</span>
23+
</div>
24+
)}
25+
{leftContent}
26+
</div>
27+
<div>{rightContent}</div>
28+
</div>
1429
</div>
1530
);
1631
};

src/styles/components/card-grid.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.card-grid {
22
.heading {
3-
@apply text-lg text-center mb-8 sm:text-[2.75rem] sm:mb-11 transition-font-size md:mb-12 mt-2;
3+
@apply text-lg sm:text-center mb-8 sm:text-[2.75rem] sm:mb-11 transition-font-size md:mb-12 mt-2;
44

55
br {
66
@apply xs:hidden;
Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
.switchback {
2-
@apply flex flex-col gap-3 mt-8 m-auto max-w-lg md:flex-row md:gap-6 md:mt-16 md:max-w-screen-lg md:px-6;
3-
& > div {
4-
@apply w-full;
5-
}
6-
.heading {
7-
@apply text-lg md:text-[40px] lg:text-xl transition-font-size;
8-
br {
9-
@apply min-[550px]:hidden md:block;
2+
@apply mb-10 mt-1 border-b border-gray-100 pb-10 md:mt-3 md:px-6 md:pb-14 md:mb-14 lg:pb-20 lg:mb-20 dark:border-b-gray-900;
3+
.container {
4+
@apply m-auto flex max-w-lg flex-col gap-3 items-center md:flex-row md:gap-6 md:max-w-screen-lg;
5+
& > div {
6+
@apply w-full;
7+
}
8+
.eyebrow {
9+
@apply mb-4 flex text-body-sm uppercase tracking-wide text-gray-700 dark:text-gray-400;
10+
span {
11+
@apply rounded-2xl border border-gray-300 bg-gray-25 px-3 py-1 dark:border-gray-700 dark:bg-gray-900;
12+
}
13+
}
14+
15+
.heading {
16+
@apply text-lg md:text-[40px] lg:text-xl transition-font-size;
17+
br {
18+
@apply min-[550px]:hidden md:block;
19+
}
20+
}
21+
p {
22+
@apply text-gray-700 dark:text-gray-200;
1023
}
11-
}
12-
p {
13-
@apply text-gray-700 dark:text-gray-200;
1424
}
1525
}

0 commit comments

Comments
 (0)