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 A 404 Page with some Animation just attach a image and it will float i thought image should be accordingly so left it #492

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
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Route, BrowserRouter as Router, Routes } from "react-router-dom"; // Im
import "bootstrap/dist/css/bootstrap.min.css"; // Import Bootstrap CSS
import Home from "./components/Home";
import Template from "./components/Auth/Template";
import NothingPage from "./components/NothingPage";

import MovieDetails from './components/MovieDetails';
import AboutUs from "./components/AboutUs";
Expand Down Expand Up @@ -51,6 +52,7 @@ function App() {
<Route path="/plays" element={<PlaysPage/>}/>
<Route path="/sports/:id" element={<SportDetails />} />
<Route path="/gift-cards" element={<GiftCard />} />
<Route path="*" element={<NothingPage />} />

</Routes>
</Router>
Expand Down
65 changes: 65 additions & 0 deletions src/components/NothingPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from 'react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';

const Container = styled(motion.div)`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f0f0;
`;

const Astronaut = styled(motion.img)`
width: 200px;
margin-bottom: 20px;
`;

const Message = styled(motion.h1)`
font-size: 3rem;
font-weight: bold;
color: #333;
`;

const NothingPage = () => {
const containerVariants = {
hidden: { opacity: 0 },
visible: { opacity: 1, transition: { duration: 0.5 } },
};

const astronautVariants = {
float: {
y: [0, -20, 0],
transition: {
duration: 3,
ease: "easeInOut",
loop: Infinity,
}
}
};

return (
<Container
variants={containerVariants}
initial="hidden"
animate="visible"
>
<Astronaut
src="astronaut.png"
alt="Astronaut"
variants={astronautVariants}
animate="float"
/>
<Message
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
>
404 - Page Not Found
</Message>
</Container>
);
};

export default NothingPage;