Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error page #380

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PrivacyPolicy from "./components/UI/privacypolicy";
import Licensing from "./components/UI/Licensing";
import TermsAndConditions from "./components/UI/termsandconditions";
import { BrowserRouter as Router , Routes, Route } from "react-router-dom";
import Error from "./components/UI/Error";



Expand Down Expand Up @@ -53,6 +54,7 @@ function App() {
<Route path="/privacypolicy" element={<PrivacyPolicy />} />
<Route path="/licensing" element={<Licensing />} />
<Route path="/termsandconditions" element={<TermsAndConditions />} />
<Route path="*" element={<Error />} />
</Routes>
</Router>
</>
Expand Down
31 changes: 31 additions & 0 deletions src/components/UI/Error.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { useState } from 'react';
import Header from '../Header/Header';
import Footer from '../UI/Footer';
import "../../styles/error.css";



const Error = () => {

const [isDarkMode, setDarkMode] = useState(false);

return (
<>
<div className={isDarkMode ? "dark-mode-app" : "light-mode-app"}>
<Header className="header" isDarkMode={isDarkMode} setDarkMode={setDarkMode} />
<div className="not-found-container">
<div className="content">
<p className="content-text">Oops! It looks like you're lost.</p>
<a href="/" className="home-button">
Go to Homepage
</a>
</div>
</div>
<Footer />
</div>

</>
);
};

export default Error;
70 changes: 70 additions & 0 deletions src/styles/error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

.not-found-container {
display: flex;
justify-content: center;
margin-top: -3.2rem;
align-items: center;
height: 95vh;
background-size: cover;
background-position: center;
text-align: center;
color: white;
}

.error-image {
max-width: 100%;
height: 375px;
margin-bottom: 20px;
}

.content {
border-radius: 10px;
}

.content-text {
font-size: 2rem;
margin-bottom: 70px;
}

.home-button {
border: none;
outline: none;
padding: 15px 20px;
color: #fff;
background: var(--primary-color);
border-radius: 5px;
font-family: var(--font-name);
font-size: 1.0rem;
font-weight: 500;
cursor: pointer;
transition: all 0.5s ease-in-out;
}

.home-button:hover {
box-shadow: 0.3rem 0.3rem #5844c1, -0.3rem -0.3rem #8b76f4;
color: white;
}

/* Light mode styles */
.light-mode-app .content {
color: #000;
}

/* Dark mode styles */
.dark-mode-app .content {
color: #fff;
}

@media (max-width: 768px) {
.content {
width: 90%;
padding: 15px;
}

.home-button {
font-size: 1rem;
padding: 8px 16px;
}
}


Loading