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

added 404 page #422

Closed
wants to merge 4 commits into from
Closed
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
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"bootstrap": "^5.3.2",
"framer-motion": "^11.0.3",
"lottie-react": "^2.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ body {
}

.main-container {
transition: margin-left 0.5s ease;
/* transition: margin-left 0.5s ease; */
}

@media (min-width: 768px) {
.main-container.shifted {
margin-left: 120px;
/* margin-left: 120px; */
}
}
9 changes: 8 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import './App.css';
import SideBar from './components/Sidebar/SideBar';
import Links from './components/Links';
import MainPage from './components/Pages/MainPage';
import Error from './components/Error/Error';


import CursorComponent from './components/Cursor/Cursor'


const categories = ['angular', '', 'frontend', 'next', 'node', 'react', 'vanilla', 'vue'];
const routes = Links();

Expand All @@ -33,13 +36,17 @@ function App() {
<div className={`main-container ${isSidebarOpen ? 'shifted' : ''}`}>

<Routes>
<Route path='/*' element={<Error/>}></Route>
{categories.map((category) => {
return <Route key={category} exact path={`/${category}`} element={<MainPage className='main-page' setProgress={setProgress} key={category} category={category} routes={routes} query={query}/>} />;
})}
</Routes>
</div>
</SideBar>





</Router>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/assets/404.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions src/components/Error/Error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.flex{
display: flex;
flex-direction: column;
gap: 2rem;
align-items: center;
margin:2rem 2rem auto 0;
width: 100vw;
height: auto;
overflow-x:hidden;
}



.but{
padding: 1rem;
background-color: #212121;
color: #fff;
border-radius: 10px;
border: black solid;
}

.but:hover{
color: #212121;
background-color: #fff;
}
16 changes: 16 additions & 0 deletions src/components/Error/Error.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Lottie from "lottie-react";
import err from "../../assets/404.json";
import './Error.css'
function Error(){
return (
<center className="flex">
<div>
<Lottie animationData={err}/>
</div>

<a href='/'> <button className="but">HOME</button> </a>
</center>
)
}

export default Error;
2 changes: 1 addition & 1 deletion src/components/Pages/mainpage.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: none;
background: none;
width: 150px;
margin-left: auto;
/* margin-left: auto; */
}

/* Main Page Styles */
Expand Down