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

Fixed Scroll View of Navbar links and added effects on TodaysSpecial component #215

Merged
merged 8 commits into from
Oct 11, 2024
15 changes: 12 additions & 3 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ input[type='radio'] {
}

.star {
cursor: pointer;
font-size: 2rem;
margin-bottom: 0;
cursor: pointer;
font-size: 2rem;
margin-bottom: 0;
}

.card {
transition: all 0.3s ease; /* Ensure smooth transitions */
}

/* Shadow effect on hover */
.card:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Add a shadow on hover */
}
8 changes: 7 additions & 1 deletion frontend/src/components/Pages/About.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import bgpic from '../../assets/img/abt1.jpg';

import bgpic from "../../assets/img/abt1.jpg";
import React, { useEffect } from 'react';


export default function About() {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div id="about" className="relative w-full h-screen md:mt-28">
<div
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/Pages/Boardgame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ export default function Boardgame() {
},
];

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<>
<div className="w-full mt-10 md:mt-0">
Expand Down Expand Up @@ -318,4 +322,4 @@ export default function Boardgame() {
</div>
</>
);
}
}
4 changes: 4 additions & 0 deletions frontend/src/components/Pages/Event.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export default function Event() {
};
}, []);

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<>
<div id="event" className="w-full h-fit bg-amber-100 md:overflow-hidden ">
Expand Down
31 changes: 18 additions & 13 deletions frontend/src/components/Pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import Landing from '../ui/Landing';
import ReviewCarousel from '../ui/ReviewCarousel';
import FeedbackForm from '../ui/FeedbackForm';
import About from './About';

import Landing from "../ui/Landing";
import ReviewCarousel from "../ui/ReviewCarousel";
import FeedbackForm from "../ui/FeedbackForm";
import About from "./About";
import React, { useEffect } from 'react';

export default function Home() {
return (
<div id="home" className="bg-[#FDF3C7]">
<Landing />
<About />
<ReviewCarousel />
<FeedbackForm />
</div>
);
}
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div id="home" className="bg-[#FDF3C7]">
<Landing />
<About/>
<ReviewCarousel/>
<FeedbackForm />
</div>
)
}
14 changes: 10 additions & 4 deletions frontend/src/components/Pages/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Link, useNavigate } from 'react-router-dom';
import photo from '../../assets/login.png';
import React, { useState } from 'react';
import { message } from 'antd';

import React, { useState , useEffect } from "react";
import photo from "../../assets/login.png";
import { Link, useNavigate } from "react-router-dom";
import { message } from "antd";


const Login = () => {
const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000';
Expand Down Expand Up @@ -43,6 +45,10 @@ const Login = () => {
}
};

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div className="w-screen h-screen flex items-center justify-center pt-10">
<img src={photo} alt="login" className=" w-3/4 absolute" />
Expand Down
18 changes: 15 additions & 3 deletions frontend/src/components/Pages/Menu.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useState } from 'react';

import { useState , useEffect } from 'react';

import { motion } from 'framer-motion';
import Mybook from './MyBook';
import TodaysSpecial from './TodaysSpecial';
Expand Down Expand Up @@ -28,6 +30,10 @@ function ParallaxImage() {
y: mousePosition.y / 30,
};

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<>
<div
Expand Down Expand Up @@ -61,10 +67,16 @@ function ParallaxImage() {
<h1 className="text-5xl md:text-9xl font-roboto">Flip Menu</h1>
<GiArrowDunk size={60} className="mt-2 text-orange-400" />
</div>
<div className="w-full md:flex md:items-center md:justify-center">
{/* <div className="w-full md:flex md:items-center md:justify-center">
<Mybook />
</div>
<TodaysSpecial /> */}
<div className="w-full md:flex md:items-center md:justify-center mb-20"> {/* Adjust this container */}
<Mybook />
</div>
<TodaysSpecial />
<div className="w-full md:flex md:items-center md:justify-center" style={{ paddingBottom: '80px' }}> {/* Add bottom padding here */}
<TodaysSpecial />
</div>
</div>
</>
);
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/Pages/MyBook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ function MyBook() {
return () => window.removeEventListener('resize', handleResize);
}, []);

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div
style={BgTextureStyle}
Expand Down
40 changes: 22 additions & 18 deletions frontend/src/components/Pages/Notfound.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import Notfound from '../../assets/Menu_assets/Notfound.gif';

const NotFound = () => {
return (
<div>
<div className="flex flex-col items-center justify-center h-screen">
<h1 className="text-5xl font-bold mb-8 text-center">404 Not Found</h1>
<img
src={Notfound} // Replace with your actual GIF path
alt="Not Found GIF"
className="w-full max-w-md"
/>
<p className="mt-8 text-lg text-gray-700 text-center">
Sorry, the page you are looking for could not be found.
</p>
</div>
</div>
);
};
import Notfound from "../../assets/Menu_assets/Notfound.gif"
import React, { useState , useEffect } from 'react';

const NotFound = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div>
<div className="flex flex-col items-center justify-center h-screen">
<h1 className="text-5xl font-bold mb-8 text-center">404 Not Found</h1>
<img
src={Notfound} // Replace with your actual GIF path
alt="Not Found GIF"
className="w-full max-w-md"
/>
<p className="mt-8 text-lg text-gray-700 text-center">
Sorry, the page you are looking for could not be found.
</p>
</div>
</div>
);
}
export default NotFound;
9 changes: 7 additions & 2 deletions frontend/src/components/Pages/Pages.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { forwardRef } from 'react';
import PropTypes from 'prop-types';

import PropTypes from "prop-types";
import React, { useState , useEffect , forwardRef } from 'react';


const Page = forwardRef((props, ref) => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div className="demoPage bg-white" ref={ref}>
<div className="h-full">{props.children}</div>
Expand Down
18 changes: 12 additions & 6 deletions frontend/src/components/Pages/Register.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useState } from 'react';
import pic from '../../assets/img/abt1.jpg';
import pic2 from '../../assets/img/abt1.png';
import pic3 from '../../assets/img/abt2.png';
import pic4 from '../../assets/img/abt3.png';
import pic5 from '../../assets/img/abt4.png';

import { useState , useEffect } from "react";
import pic from "../../assets/img/abt1.jpg";
import pic2 from "../../assets/img/abt1.png";
import pic3 from "../../assets/img/abt2.png";
import pic4 from "../../assets/img/abt3.png";
import pic5 from "../../assets/img/abt4.png";


export default function Register() {
const [date, setDate] = useState('');
Expand Down Expand Up @@ -32,6 +34,10 @@ export default function Register() {
.catch((error) => console.log(error));
};

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<>
<div className="w-full mx-auto mt-10 lg:mt-0 md:mt-0">
Expand Down
11 changes: 8 additions & 3 deletions frontend/src/components/Pages/Signup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';
import photo from '../../assets/login.png';
import { useNavigate } from 'react-router-dom';

import { useState , useEffect } from "react";
import photo from "../../assets/login.png";
import { useNavigate } from "react-router-dom";

const Signup = () => {
const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000';
Expand Down Expand Up @@ -70,6 +71,10 @@ const Signup = () => {
}
};

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div className="w-screen h-screen flex items-center justify-center pt-10">
<img src={photo} alt="login" className=" w-3/4 absolute" />
Expand Down
Loading
Loading