Skip to content

Commit 73020e6

Browse files
authored
remove index.less, refactor unused styles from landing page (#1677)
1 parent b49eec6 commit 73020e6

File tree

7 files changed

+59
-220
lines changed

7 files changed

+59
-220
lines changed

Diff for: src/components/index-page/hero.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { clsx } from "clsx"
55

66
export function Hero() {
77
return (
8-
<div className="hero">
8+
<div className="[background:url('/img/graph-wash.png'),#171e26_repeat_center_center] xl:py-20">
99
<div className="container conf-block">
1010
<section
1111
className={clsx(

Diff for: src/components/index-page/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { WhoIsUsing } from "./who-is-using"
99

1010
export function IndexPage() {
1111
return (
12-
<div className="index xl:mt-10">
12+
<div className="index">
1313
<Hero />
1414
<section className="text-center flex flex-col container items-center conf-block max-w-3xl">
1515
<h2>A query language for your API</h2>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.cursor {
2+
animation: cursor-blink 0.5s infinite linear both alternate;
3+
4+
@keyframes cursor-blink {
5+
0%, 30% {
6+
opacity: 0;
7+
}
8+
70%, 100% {
9+
opacity: 1;
10+
}
11+
}
12+
}

Diff for: src/components/index-page/predictable-results.tsx renamed to src/components/index-page/predictable-results/index.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { useEffect, useRef } from "react"
2-
import { PredictableResult } from "../code-blocks"
2+
import { PredictableResult } from "../../code-blocks"
33
import { Pre } from "nextra/components"
4+
import { clsx } from "clsx"
5+
import classes from "./index.module.css"
46

57
export function PredictableResults() {
68
const ref = useRef<HTMLDivElement>(null)
@@ -85,19 +87,24 @@ export function PredictableResults() {
8587
</div>
8688
<div
8789
ref={ref}
88-
className="faux-graphiql nextra-codeblocks flex *:w-1/2 [&_pre]:!h-48"
90+
className="nextra-codeblocks flex *:w-1/2 [&_pre]:!h-48"
8991
aria-hidden
9092
>
9193
<Pre data-filename="Query" className="p-4">
9294
{"{"}
9395
{"\n hero {"}
9496
{"\n name"}
9597
{"\n height\n mass".split("").map((char, i) => (
96-
<span key={i} id={"ch" + i} className="ch">
98+
<span key={i} id={"ch" + i} className="hidden">
9799
{char === "\n" ? <br /> : char}
98100
</span>
99101
))}
100-
<span className="cursor" />
102+
<span
103+
className={clsx(
104+
"inline-block !bg-primary/50 h-4 w-2 ml-px -mb-0.5",
105+
classes.cursor,
106+
)}
107+
/>
101108
{"\n }"}
102109
{"\n}"}
103110
</Pre>

Diff for: src/components/index-page/single-request/index.tsx

+34-45
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,47 @@
11
import { QueryHeroFriends, ResponseHeroFriends } from "../../code-blocks"
2-
import { clsx } from "clsx"
32
import classes from "./index.module.css"
43
import phoneImage from "public/img/phone.svg"
54
import serverImage from "public/img/server.svg"
65
import NextImage from "next-image-export-optimizer"
76

87
export function SingleRequest() {
98
return (
10-
<div
11-
className={clsx(
12-
// "bg-gray-200",
13-
"grayWash",
14-
)}
9+
<section
10+
className="*:w-full lg:*:w-1/2 gap-14 flex max-lg:flex-col container conf-block !justify-around [&_pre]:!bg-transparent"
11+
id="single-request"
1512
>
16-
<section
17-
className="*:w-full lg:*:w-1/2 gap-14 flex max-lg:flex-col container conf-block !justify-around [&_pre]:!bg-transparent"
18-
id="single-request"
19-
>
20-
<div className="max-lg:text-center">
21-
<h2>
22-
Get many resources <br className="max-lg:hidden" />
23-
in a single request
24-
</h2>
25-
{/*Illustration: a query 2 or 3 levels deep]*/}
26-
<p>
27-
GraphQL queries access not just the properties of one resource but
28-
also smoothly follow references between them. While typical REST
29-
APIs require loading from multiple URLs, GraphQL APIs get all the
30-
data your app needs in a single request. Apps using GraphQL can be
31-
quick even on slow mobile network connections.
32-
</p>
13+
<div className="max-lg:text-center">
14+
<h2>
15+
Get many resources <br className="max-lg:hidden" />
16+
in a single request
17+
</h2>
18+
{/*Illustration: a query 2 or 3 levels deep]*/}
19+
<p>
20+
GraphQL queries access not just the properties of one resource but
21+
also smoothly follow references between them. While typical REST APIs
22+
require loading from multiple URLs, GraphQL APIs get all the data your
23+
app needs in a single request. Apps using GraphQL can be quick even on
24+
slow mobile network connections.
25+
</p>
26+
</div>
27+
<div className="-my-8 h-[520px] relative pointer-events-none" aria-hidden>
28+
<NextImage
29+
src={serverImage}
30+
alt="Server"
31+
className="absolute left-1/2 -translate-x-1/2"
32+
/>
33+
<NextImage
34+
src={phoneImage}
35+
alt="Phone"
36+
className="absolute left-1/2 -translate-x-1/2 bottom-0"
37+
/>
38+
<div className={classes.query}>
39+
<QueryHeroFriends />
3340
</div>
34-
<div
35-
className="-my-8 h-[520px] relative pointer-events-none"
36-
aria-hidden
37-
>
38-
<NextImage
39-
src={serverImage}
40-
alt="Server"
41-
className="absolute left-1/2 -translate-x-1/2"
42-
/>
43-
<NextImage
44-
src={phoneImage}
45-
alt="Phone"
46-
className="absolute left-1/2 -translate-x-1/2 bottom-0"
47-
/>
48-
<div className={classes.query}>
49-
<QueryHeroFriends />
50-
</div>
51-
<div className={classes.response}>
52-
<ResponseHeroFriends />
53-
</div>
41+
<div className={classes.response}>
42+
<ResponseHeroFriends />
5443
</div>
55-
</section>
56-
</div>
44+
</div>
45+
</section>
5746
)
5847
}

Diff for: src/index.less

-168
This file was deleted.

Diff for: src/pages/_app.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useRouter } from "next/router"
44
import { useEffect } from "react"
55
import "@/globals.css"
66
import "@/codemirror.less"
7-
import "@/index.less"
87

98
const robotoFlex = Roboto_Flex({
109
subsets: ["latin"],

0 commit comments

Comments
 (0)