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

Feat: 404 not found page added with config #216 #229

Merged
merged 1 commit into from
Jun 4, 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
6 changes: 3 additions & 3 deletions frontend/package-lock.json

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

4 changes: 3 additions & 1 deletion frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import waiting from "./Images/neo-sakura-girl-and-dog-waiting-for-the-bus-in-the
import waiting2 from "./Images/waiting2.gif";
import { FaSearch, FaUser } from 'react-icons/fa';
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import PagenotFound from "./components/PagenotFound";

import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css";
Expand Down Expand Up @@ -110,7 +111,7 @@ const App = () => {
<Router>
<Routes>
<Route path="/settings" element={<Settings />} />
<Route path="*" element={
<Route path="/" element={
<div className="ui">
<Sidebar handleFocus={handleFocus} />
<div className="avatar">
Expand Down Expand Up @@ -250,6 +251,7 @@ const App = () => {
<Section3 data={data} index={currplaying} playSong={playSong} topsongs={topsongs} isTopSong={isTopSong} setTopSong={setTopSong} />
</div>
} />
<Route path="*" element={<PagenotFound />} />
</Routes>
</Router>
);
Expand Down
Binary file added frontend/src/Images/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions frontend/src/components/PagenotFound.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 90vh;
}
.pic {
width: 700px;
height: 700px;
animation: updown 2s ease-in-out infinite alternate;
}
@keyframes updown {
from {
transform: translateY(0);
}
to {
transform: translateY(20px);
}
}
a {
text-decoration: none;
color: #fff;
}
.btn {
position: absolute;
padding: 10px 20px;
background-color: #1d82d5;
color: #fff;
border-radius: 5px;
font-size: 20px;
font-weight: bold;
border: none;
top: 600px;
}
@media screen and (max-width: 600px) {
.pic {
width: 300px;
height: 300px;
}
.btn {
top: 400px;
}
}
11 changes: 11 additions & 0 deletions frontend/src/components/PagenotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pic from '/src/Images/404.png';
import './PagenotFound.css';
import { Link } from 'react-router-dom';
export default function PagenotFound() {
return (
<div className="center">
<img src={pic} alt="404 pic" class="pic"/>
<button className="btn"><Link to="/">Go Back</Link></button>
</div>
)
}
Loading