Skip to content

Commit 795cd76

Browse files
committed
wip: add Hero element to Homepage
1 parent 76d1c39 commit 795cd76

File tree

12 files changed

+328
-455
lines changed

12 files changed

+328
-455
lines changed

apps/developer-hub/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@phosphor-icons/react": "catalog:",
2424
"@pythnetwork/component-library": "workspace:*",
2525
"@react-hookz/web": "catalog:",
26+
"@rive-app/react-canvas": "^4.19.1",
2627
"@solana/web3.js": "catalog:",
2728
"bs58": "catalog:",
2829
"clsx": "catalog:",
@@ -37,6 +38,7 @@
3738
"react-aria": "catalog:",
3839
"react-dom": "catalog:",
3940
"recharts": "catalog:",
41+
"shiki": "catalog:",
4042
"superjson": "catalog:",
4143
"swr": "catalog:",
4244
"zod": "catalog:",
63.1 KB
Binary file not shown.

apps/developer-hub/src/app/page.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11

2+
import { Homepage } from "../components/Homepage/index.js";
3+
import { HomepageHero } from "../components/HomepageHero/index.js";
4+
25
const Page = () => {
36
return (
4-
<div>
5-
<h1>Developer Hub</h1>
6-
</div>
7+
<Homepage>
8+
<HomepageHero />
9+
10+
{/* Other sections will be added here */}
11+
</Homepage>
712
);
813
};
914

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.homepage {
4+
@include theme.max-width;
5+
6+
align-items: center;
7+
8+
> section {
9+
width: 100%;
10+
11+
& + section {
12+
margin-top: theme.spacing(12);
13+
14+
@include theme.breakpoint(md) {
15+
margin-top: theme.spacing(16);
16+
}
17+
18+
@include theme.breakpoint(lg) {
19+
margin-top: theme.spacing(20);
20+
}
21+
}
22+
}
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { ReactNode } from "react";
2+
3+
import styles from "./index.module.scss";
4+
5+
type Props = {
6+
children: ReactNode;
7+
};
8+
9+
export const Homepage = ({ children }: Props) => {
10+
return <div className={styles.homepage}>{children}</div>;
11+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.heroContent {
4+
display: flex;
5+
flex-direction: column;
6+
justify-content: center;
7+
8+
@include theme.breakpoint(md) {
9+
grid-column: 1 / 2;
10+
}
11+
12+
@include theme.breakpoint(lg) {
13+
grid-column: 1 / 3;
14+
}
15+
}
16+
17+
.title {
18+
font-size: theme.spacing(6);
19+
line-height: 1.2;
20+
font-weight: theme.font-weight(bold);
21+
margin-bottom: theme.spacing(3);
22+
color: theme.color("foreground");
23+
24+
@include theme.breakpoint(md) {
25+
font-size: theme.spacing(8);
26+
}
27+
}
28+
29+
.subtitle {
30+
font-size: theme.spacing(4);
31+
line-height: 1.5;
32+
margin-bottom: theme.spacing(6);
33+
color: theme.color("muted");
34+
35+
@include theme.breakpoint(md) {
36+
font-size: theme.spacing(5);
37+
}
38+
}
39+
40+
.ctaGroup {
41+
display: flex;
42+
flex-direction: column;
43+
gap: theme.spacing(4);
44+
45+
@include theme.breakpoint(sm) {
46+
flex-direction: row;
47+
align-items: center;
48+
}
49+
}
50+
51+
.secondaryLink {
52+
color: theme.color("foreground");
53+
text-decoration: none;
54+
font-weight: theme.font-weight(medium);
55+
56+
&:hover {
57+
text-decoration: underline;
58+
}
59+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Button } from "@pythnetwork/component-library/Button";
2+
import { Link } from "@pythnetwork/component-library/Link";
3+
4+
import styles from "./index.module.scss";
5+
6+
export const HeroContent = () => {
7+
return (
8+
<div className={styles.heroContent}>
9+
<h1 className={styles.title}>
10+
Real-time price data for your applications
11+
</h1>
12+
<p className={styles.subtitle}>
13+
Access accurate, decentralized price feeds for DeFi, trading, and more
14+
</p>
15+
<div className={styles.ctaGroup}>
16+
<Button variant="primary" size="lg" href="/pyth-core/getting-started">
17+
Get started with Price Feeds
18+
</Button>
19+
<Link href="#product-grid" className={styles.secondaryLink ?? ""}>
20+
Explore all products
21+
</Link>
22+
</div>
23+
</div>
24+
);
25+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.heroGraphic {
4+
position: relative;
5+
width: 100%;
6+
height: 400px;
7+
perspective: 1000px;
8+
9+
@include theme.breakpoint(md) {
10+
grid-column: 2 / 3;
11+
height: 500px;
12+
}
13+
14+
@include theme.breakpoint(lg) {
15+
grid-column: 3 / 4;
16+
height: 600px;
17+
}
18+
}
19+
20+
.graphicContainer {
21+
position: relative;
22+
width: 100%;
23+
height: 100%;
24+
transform-style: preserve-3d;
25+
transition: transform 0.5s ease-out;
26+
27+
&[data-animation-complete] {
28+
transform: rotateX(20deg) translateZ(-50px);
29+
}
30+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"use client";
2+
3+
import Rive from "@rive-app/react-canvas";
4+
5+
import styles from "./index.module.scss";
6+
7+
export const HeroGraphic = () => {
8+
return (
9+
<div className={styles.heroGraphic}>
10+
<div className={styles.graphicContainer}>
11+
<Rive
12+
src="/price_feeds_stack.riv"
13+
style={{ width: "500px", height: "700px" }}
14+
/>
15+
</div>
16+
</div>
17+
);
18+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.homepageHero {
4+
width: 100%;
5+
padding: theme.spacing(8) theme.spacing(4);
6+
position: relative;
7+
overflow: hidden;
8+
9+
@include theme.breakpoint(md) {
10+
padding: theme.spacing(12) theme.spacing(6);
11+
}
12+
}
13+
14+
.container {
15+
display: grid;
16+
grid-template-columns: 1fr;
17+
gap: theme.spacing(6);
18+
margin: 0 auto;
19+
20+
@include theme.breakpoint(md) {
21+
grid-template-columns: 1fr 1fr;
22+
}
23+
24+
@include theme.breakpoint(lg) {
25+
grid-template-columns: 2fr 1fr;
26+
}
27+
}

0 commit comments

Comments
 (0)