Skip to content

Commit

Permalink
Merge pull request #36 from atapas/23-create-a-better-404-page
Browse files Browse the repository at this point in the history
adding 404 styling
  • Loading branch information
atapas authored Apr 18, 2022
2 parents 567d6ea + 3b82b76 commit 21cdac7
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
63 changes: 63 additions & 0 deletions src/common/404/404.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.page-404 {
padding: 2rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: calc(100vh - 120px);
}

.page-404-image {
max-width: 100%;
height: auto;
}

.page-404-lead {
margin: 0;
font-family: var(--ff-accent);
font-size: var(--fs-xl);
text-align: center;
}

@media screen and (max-width: 768px) {
.page-404-lead {
line-height: var(--lh-rg);
margin-bottom: 1rem;
}
}

.page-404-desc {
margin-top: 0;
font-size: var(--fs-md);
text-align: center;
}

.page-404-link {
position: relative;
color: var(--color-neutral-80);
text-decoration: none;
transition: all .5s ease-in-out;
font-weight: var(--fw-semibold);
}
.page-404-link:after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 2px;
height: 2px;
background-color: var(--color-brand-primary);
transition: all .1s ease-in-out;
}

.page-404-link:hover,
.page-404-link:focus {
color: var(--color-neutral-90);
}

.page-404-link:hover:after,
.page-404-link:focus:after {
height: 5px;
bottom: 0;
/* background-color: var(--color-neutral-90); */
}
11 changes: 7 additions & 4 deletions src/common/404/PageNotFound.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Link } from 'react-router-dom';
import { ReactComponent as Image404 } from "images/img-404.svg";
import "./404.css";

const PageNotFound = () => {

return(
<main style={{ padding: "1rem" }}>
<p>OOPs!!! Look like you are lost.</p>
<p>
Why don't you go back to <Link to="/">home</Link>?
<main className='page-404'>
<Image404 className="page-404-image" />
<p className='page-404-lead'>Look like you are lost</p>
<p className='page-404-desc'>
Why don't you go back to <Link to="/" className='page-404-link'>home</Link>?
</p>
</main>
);
Expand Down
1 change: 1 addition & 0 deletions src/images/img-404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 21cdac7

@vercel
Copy link

@vercel vercel bot commented on 21cdac7 Apr 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.