Skip to content

Commit 9383603

Browse files
committed
creating and styling 404 page
1 parent 6c8a433 commit 9383603

File tree

2 files changed

+110
-1
lines changed

2 files changed

+110
-1
lines changed

src/pages/404.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import Layout from "@theme/Layout";
2+
import Link from "@docusaurus/Link";
3+
import styles from "./styles.module.css";
4+
import useBaseUrl from "@docusaurus/useBaseUrl";
5+
6+
export default function Custom404() {
7+
return (
8+
<Layout title="404 - Not Found">
9+
<main className={styles.notFoundContainer}>
10+
<div className={styles.notFoundContent}>
11+
<h1 className={styles.notFoundTitle}>Oops! 404</h1>
12+
<h2 className={styles.notFoundSubtitle}>Not Found...</h2>
13+
14+
<p className={styles.notFoundDescription}>
15+
Looks like you've wandered off the beaten path. Our team is working
16+
to get you back on track and find what you're looking for.
17+
</p>
18+
19+
<div className={styles.notFoundActions}>
20+
<Link className={styles.notFoundPrimaryBtn} to="/">
21+
Back To Home
22+
</Link>
23+
24+
<button
25+
className={styles.notFoundSecondaryBtn}
26+
onClick={() => window.history.back()}
27+
>
28+
Back to Previous Page
29+
</button>
30+
</div>
31+
</div>
32+
33+
<div className={styles.notFoundImageWrapper}>
34+
<img
35+
src={useBaseUrl("/img/keploy-logo-dark.svg")}
36+
alt="Keploy logo"
37+
className={styles.notFoundLogo}
38+
/>
39+
</div>
40+
</main>
41+
</Layout>
42+
);
43+
}

src/pages/styles.module.css

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,70 @@
159159
.announcementInner {
160160
margin: 0 auto;
161161
max-width: 768px;
162-
}
162+
}
163+
164+
.notFoundContainer {
165+
min-height: calc(100vh - 80px);
166+
display: grid;
167+
grid-template-columns: 1.2fr 1fr;
168+
align-items: center;
169+
padding: 4rem 6rem;
170+
}
171+
172+
.notFoundTitle {
173+
font-size: 72px;
174+
font-weight: 700;
175+
color: var(--ifm-color-primary);
176+
}
177+
178+
.notFoundSubtitle {
179+
font-size: 56px;
180+
font-weight: 700;
181+
color: var(--ifm-color-primary);
182+
margin-bottom: 1.5rem;
183+
}
184+
185+
.notFoundDescription {
186+
font-size: 18px;
187+
color: #6b7280;
188+
max-width: 520px;
189+
margin-bottom: 2rem;
190+
}
191+
192+
.notFoundActions {
193+
display: flex;
194+
gap: 1rem;
195+
}
196+
197+
.notFoundPrimaryBtn {
198+
padding: 0.75rem 1.5rem;
199+
border-radius: 999px;
200+
background: var(--ifm-color-primary);
201+
color: #fff;
202+
font-weight: 600;
203+
}
204+
205+
.notFoundSecondaryBtn {
206+
padding: 0.75rem 1.5rem;
207+
border-radius: 999px;
208+
border: 1px solid var(--ifm-color-primary);
209+
background: transparent;
210+
color: var(--ifm-color-primary);
211+
font-weight: 600;
212+
cursor: pointer;
213+
}
214+
215+
.notFoundImageWrapper {
216+
display: flex;
217+
justify-content: center;
218+
}
219+
220+
.notFoundImage {
221+
max-width: 420px;
222+
width: 100%;
223+
}
224+
225+
.notFoundLogo {
226+
max-width: 260px;
227+
opacity: 0.9;
228+
}

0 commit comments

Comments
 (0)