Skip to content

Commit 70005fe

Browse files
authored
quicklinks on splash screen (#137)
* quicklinks for docs, github, discord * light mode bg colors for authority + footer sections * dark mode for splash page
1 parent 3f9a4e8 commit 70005fe

File tree

4 files changed

+91
-27
lines changed

4 files changed

+91
-27
lines changed

app/icons.svg

Lines changed: 12 additions & 1 deletion
Loading

app/pages/splash.tsx

Lines changed: 79 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export let loader = async () => {
1010
return { stats };
1111
};
1212

13+
// TODO: target="_blank" for discord?
14+
1315
export const meta: Route.MetaFunction = ({ matches }) => {
1416
let { isProductionHost } = matches[0].data;
1517
let robots = isProductionHost ? "index,follow" : "noindex, nofollow";
@@ -20,6 +22,29 @@ export const meta: Route.MetaFunction = ({ matches }) => {
2022
];
2123
};
2224

25+
type QuickLink = {
26+
icon: string;
27+
title: string;
28+
to: string;
29+
};
30+
const quicklinks: QuickLink[] = [
31+
{
32+
icon: "atom",
33+
title: "Docs",
34+
to: "home",
35+
},
36+
{
37+
icon: "github-outline",
38+
title: "GitHub",
39+
to: "https://github.com/remix-run/react-router",
40+
},
41+
{
42+
icon: "discord-outline",
43+
title: "Discord",
44+
to: "https://rmx.as/discord",
45+
},
46+
];
47+
2348
type Highlight = {
2449
icon: string;
2550
title: string;
@@ -57,20 +82,20 @@ const adventures: Adventure[] = [
5782
title: "I'm new!",
5883
description: "Learn how to get the most out of React Router",
5984
linkText: "Start Here",
60-
linkTo: "./home",
85+
linkTo: "home",
6186
},
6287
{
6388
title: "I'm on v6",
6489
description: "Upgrade to v7 in just a few steps",
6590
linkText: "Upgrade Now",
66-
linkTo: "./upgrading/v6",
91+
linkTo: "upgrading/v6",
6792
},
6893
{
6994
title: "I want to adopt framework features",
7095
description:
7196
"Learn how to adopt the new framework features in your existing React Router app",
7297
linkText: "Adopt Framework Features",
73-
linkTo: "./upgrading/component-routes",
98+
linkTo: "upgrading/component-routes",
7499
},
75100
{
76101
title: "I'm stuck",
@@ -82,27 +107,53 @@ const adventures: Adventure[] = [
82107

83108
export default function Home({ loaderData }: Route.ComponentProps) {
84109
return (
85-
<main className="flex min-h-full w-full flex-col items-center justify-center">
86-
<section className="from-23% via-82% flex w-full flex-col items-center gap-y-12 bg-gradient-to-b from-[#CCD2DE] via-[#D9DDE6] to-[#FAFBFD] to-100% pt-[96px] md:pt-[160px]">
110+
<main className="flex min-h-full w-full flex-col items-center justify-center dark:bg-gray-900">
111+
<section className="from-23% via-82% flex w-full flex-col items-center gap-y-12 bg-gradient-to-b from-[#CCD2DE] via-[#D9DDE6] to-white to-100% py-[96px] dark:from-[#595F6C] dark:via-[#202228] dark:via-65% dark:to-gray-900 md:py-[160px]">
87112
<h1>
88-
<img
89-
src="/splash/hero-3d-logo.webp"
90-
alt="React Router logo, nine dots in an upward triangle (one on top, two in the middle, three on the bottom) with a path of three highlighted and connected from top to bottom, next to the text React Router"
91-
className="aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]"
92-
/>
113+
<picture className="aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]">
114+
<source
115+
srcSet="/splash/hero-3d-logo.webp"
116+
media="(prefers-color-scheme: light)"
117+
/>
118+
<source
119+
srcSet="/splash/hero-3d-logo.dark.webp"
120+
media="(prefers-color-scheme: dark)"
121+
/>
122+
<img
123+
src="/splash/hero-3d-logo.webp"
124+
alt="React Router logo, nine dots in an upward triangle (one on top, two in the middle, three on the bottom) with a path of three highlighted and connected from top to bottom, next to the text React Router"
125+
className="aspect-[32/5] w-[360px] md:w-[480px] lg:w-[640px] 2xl:w-[960px]"
126+
/>
127+
</picture>
93128
</h1>
94-
<p className="mx-12 max-w-[540px] text-center text-xl text-gray-700 md:mx-0">
129+
<p className="mx-12 max-w-[540px] text-center text-xl text-gray-700 dark:text-gray-200 md:mx-0">
95130
A user‑obsessed, standards‑focused, multi‑strategy router you can
96131
deploy anywhere.
97132
</p>
98-
<Link
99-
to="/home"
100-
className="flex items-center p-8 pb-[96px] font-bold underline"
101-
>
102-
Read the docs
103-
</Link>
133+
<div className="flex flex-col md:h-[72px] md:w-[460px] md:flex-row">
134+
{quicklinks.map(({ icon, title, to }, i) => (
135+
<Link
136+
key={title}
137+
to={to}
138+
className={
139+
"flex gap-x-2 border border-gray-200 px-9 py-6 text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-200 dark:hover:text-gray-700" +
140+
(i === 0
141+
? " rounded-t-lg border-b-0 md:rounded-l-lg md:rounded-tr-none md:border-b md:border-r-0"
142+
: "") +
143+
(i === 2
144+
? " rounded-b-lg border-t-0 md:rounded-r-lg md:rounded-bl-none md:border-l-0 md:border-t"
145+
: "")
146+
}
147+
>
148+
<svg className="h-6 w-6">
149+
<use href={`${iconsHref}#${icon}`} />
150+
</svg>
151+
{title}
152+
</Link>
153+
))}
154+
</div>
104155
</section>
105-
<section className="flex w-full flex-col items-center gap-y-24 bg-gradient-to-b from-[#FAFBFD] to-white px-12 py-12 md:gap-y-16 lg:gap-y-12">
156+
<section className="flex w-full flex-col items-center gap-y-24 px-12 pb-12 dark:bg-gray-900 md:gap-y-16 lg:gap-y-12">
106157
<div className="grid gap-x-16 gap-y-6 md:grid-flow-col">
107158
<img
108159
src="/splash/v7-badge-1.svg"
@@ -113,13 +164,13 @@ export default function Home({ loaderData }: Route.ComponentProps) {
113164
className="h-[52px] w-[140px] md:h-[72px] md:w-[194px]"
114165
/>
115166
</div>
116-
<h2 className="text-center text-3xl font-semibold text-gray-800">
167+
<h2 className="text-center text-3xl font-semibold text-gray-800 dark:text-gray-100">
117168
What to expect from this version:
118169
</h2>
119170
<dl className="grid max-w-[540px] gap-x-12 gap-y-6 lg:max-w-5xl lg:grid-flow-col">
120171
{highlights.map(({ icon, title, description }) => (
121172
<div key={title} className="relative flex flex-col gap-2 pl-14">
122-
<dt className="text-xl font-semibold text-gray-800">
173+
<dt className="text-xl font-semibold text-gray-800 dark:text-gray-100">
123174
<svg className="absolute left-0 top-0 h-8 w-8">
124175
<use href={`${iconsHref}#${icon}`} />
125176
</svg>
@@ -131,18 +182,20 @@ export default function Home({ loaderData }: Route.ComponentProps) {
131182
</dl>
132183
</section>
133184
<section className="flex flex-col gap-y-12 p-12">
134-
<h2 className="mx-[-10px] text-center text-3xl font-semibold text-gray-800 dark:text-white">
185+
<h2 className="mx-[-10px] text-center text-3xl font-semibold text-gray-800 dark:text-gray-100">
135186
Choose Your Adventure:
136187
</h2>
137188
<div className="grid max-w-[1200px] gap-6 md:grid-cols-2 2xl:grid-cols-4">
138189
{adventures.map(({ title, description, linkText, linkTo }) => (
139190
<Link
140191
key={title}
141192
to={linkTo}
142-
className="flex flex-col justify-between gap-y-6 rounded-lg border border-[#D9D9D9] p-8 hover:bg-gray-50 dark:hover:bg-gray-700"
193+
className="flex flex-col justify-between gap-y-6 rounded-lg border border-[#D9D9D9] p-8 hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-700"
143194
>
144195
<div className="flex flex-col gap-y-4">
145-
<h3 className="text-2xl font-semibold">{title}</h3>
196+
<h3 className="text-2xl font-semibold dark:text-gray-100">
197+
{title}
198+
</h3>
146199
<p className="text-[#757575] dark:text-gray-300">
147200
{description}
148201
</p>
@@ -154,7 +207,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
154207
))}
155208
</div>
156209
</section>
157-
<section className="grid w-full place-content-center bg-gray-50 p-12">
210+
<section className="grid w-full place-content-center p-12">
158211
<Suspense fallback={null}>
159212
<Await resolve={loaderData.stats} errorElement={null}>
160213
{(stats) => (
@@ -165,7 +218,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
165218
<use href={`${iconsHref}#${svgId}`} />
166219
</svg>
167220
<div className="flex flex-col">
168-
<dd className="text-2xl font-semibold text-gray-700">
221+
<dd className="text-2xl font-semibold text-gray-700 dark:text-gray-200">
169222
{count?.toLocaleString("en-US")}
170223
</dd>
171224
<dt className="text-gray-400">{label}</dt>
@@ -177,7 +230,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
177230
</Await>
178231
</Suspense>
179232
</section>
180-
<section className="grid h-[205px] w-full place-content-center place-items-center gap-y-6 bg-gray-900 p-12">
233+
<section className="grid h-[205px] w-full place-content-center place-items-center gap-y-6 bg-gray-50 p-12 dark:bg-black">
181234
<img src="/splash/shopify-badge.svg" className="h-[68px] w-[190px]" />
182235
<p className="text-sm text-gray-400">© 2024 Shopify, Inc.</p>
183236
</section>

public/splash/hero-3d-logo.dark.webp

34.2 KB
Binary file not shown.

public/splash/hero-3d-logo.webp

-3.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)