Skip to content

Commit e614298

Browse files
committed
IAdd stripes, isolate to fix z-index issues
1 parent 30b8101 commit e614298

File tree

7 files changed

+51
-17
lines changed

7 files changed

+51
-17
lines changed

src/app/(main)/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export default function MainLayout({
1818
<ThemeProvider attribute="class">
1919
<MenuProvider>
2020
<Navbar items={topLevelNavbarItems} />
21-
<div className="bg-neu-0 text-neu-900 antialiased">{children}</div>
21+
<div className="isolate bg-neu-0 text-neu-900 antialiased">
22+
{children}
23+
</div>
2224
<Footer />
2325
</MenuProvider>
2426
</ThemeProvider>

src/app/conf/_design-system/utils/arrows-move-sideways.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export function arrowsMoveSideways(event: React.KeyboardEvent<HTMLElement>) {
1212

1313
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
1414
const vertical = event.currentTarget.dataset.vertical
15-
console.log({ vertical })
1615
repeat = vertical ? parseInt(vertical) : 1
1716
}
1817

src/app/not-found.tsx

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
import { usePathname } from "next/navigation"
44
import { useMounted } from "nextra/hooks"
55

6+
import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration"
7+
import stripesMask from "@/components/404-page/image.webp"
8+
69
import { Button } from "./conf/_design-system/button"
710
import MainLayout from "./(main)/layout"
811

912
import "@/globals.css"
1013
import "@/app/colors.css"
1114

12-
export default function Page() {
15+
export default function NotFoundPage() {
1316
const pathname = usePathname()
1417
const mounted = useMounted()
1518

@@ -29,22 +32,51 @@ export default function Page() {
2932

3033
return (
3134
<MainLayout>
32-
<div className="flex h-[500px] flex-col items-center justify-center gap-8 bg-neu-0 font-sans lg:h-[600px] lg:gap-10">
33-
<FourOhFourIcon className="text-pri-base" />
34-
<h1 className="text-4xl text-neu-900">Page not found</h1>
35-
<div className="flex gap-4 max-sm:flex-col">
36-
<Button variant="primary" href={url}>
37-
Submit an issue about broken link
38-
</Button>
39-
<Button variant="secondary" href="/">
40-
Go back home
41-
</Button>
35+
<style>{".nextra-nav-container.sticky { position: fixed }"}</style>
36+
<div className="relative">
37+
<Stripes />
38+
<div className="relative z-10 flex h-[500px] flex-col items-center justify-center gap-8 pt-[--nextra-navbar-height] font-sans lg:h-[600px] lg:gap-10">
39+
<FourOhFourIcon className="text-pri-base" />
40+
<h1 className="text-4xl text-neu-900">Page not found</h1>
41+
<div className="flex gap-4 max-sm:flex-col">
42+
<Button variant="primary" href={url}>
43+
Submit an issue about broken link
44+
</Button>
45+
<Button variant="secondary" href="/">
46+
Go back home
47+
</Button>
48+
</div>
4249
</div>
4350
</div>
4451
</MainLayout>
4552
)
4653
}
4754

55+
function Stripes() {
56+
return (
57+
<div
58+
aria-hidden
59+
className="pointer-events-none absolute inset-0"
60+
style={{
61+
maskImage: `url(${stripesMask.src})`,
62+
WebkitMaskImage: `url(${stripesMask.src})`,
63+
maskRepeat: "no-repeat",
64+
WebkitMaskRepeat: "no-repeat",
65+
maskPosition: "center 100%",
66+
WebkitMaskPosition: "center 100%",
67+
maskSize: "160%",
68+
WebkitMaskSize: "160%",
69+
}}
70+
>
71+
<StripesDecoration
72+
stripeWidth="8px"
73+
evenClassName="bg-[linear-gradient(180deg,hsl(var(--color-pri-light)/.4)_0%,hsl(var(--color-neu-0)/.2)_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-pri-dark)/0.6)_0%,hsl(var(--color-pri-darker)/0.3)_100%)]"
74+
oddClassName="bg-[linear-gradient(180deg,hsl(var(--color-neu-0))_0%,hsl(var(--color-neu-0)/0)_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-sec-dark)/0.4)_0%,transparent_100%)]"
75+
/>
76+
</div>
77+
)
78+
}
79+
4880
function FourOhFourIcon({ className }: { className?: string }) {
4981
return (
5082
<svg

src/components/footer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const HAS_CONFERENCE_BOX = true
112112

113113
export function Footer() {
114114
return (
115-
<footer className="relative !bg-neu-100 text-neu-900 dark:!bg-neu-0 max-md:px-0 max-md:pt-0">
115+
<footer className="relative isolate !bg-neu-100 text-neu-900 dark:!bg-neu-0 max-md:px-0 max-md:pt-0">
116116
<Stripes />
117117

118118
<div className="mx-auto max-w-[120rem] border-neu-400 dark:border-neu-100 3xl:border-x 3xl:dark:border-t">

src/components/index-page/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export function IndexPage() {
2121
name="description"
2222
content="GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data."
2323
/>
24-
<style>{".nextra-nav-container.sticky { position: fixed }"}</style>
2524
</Head>
25+
2626
<Hero />
2727
<TrustedBy />
2828
<WhatIsGraphQL />
@@ -35,6 +35,7 @@ export function IndexPage() {
3535
<UseCases />
3636
<QuotesFromTheIndustry />
3737
<JoinTheCommunity />
38+
<style>{".nextra-nav-container.sticky { position: fixed }"}</style>
3839
</div>
3940
)
4041
}

src/components/navbar/top-level-items.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function normalizeMetaToItems(meta: Record<string, any>, route = "/") {
3939
)
4040

4141
const result = normalizePages({
42-
list: pageMapItems,
42+
list: [{ data: meta }, ...pageMapItems],
4343
route,
4444
})
4545

src/components/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function Search({
126126
// Calling before navigation so selector `html:not(:has(*:focus))` in styles.css will work,
127127
// and we'll have padding top since input is not focused
128128
inputRef.current?.blur()
129-
await router.push(searchResult.route)
129+
await router?.push(searchResult.route)
130130
// Clear input after navigation completes
131131
setMenu(false)
132132
onChange("")

0 commit comments

Comments
 (0)