diff --git a/frontend/src/App.css b/frontend/src/App.css index 198e47bb..6af73281 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -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 */ + } diff --git a/frontend/src/components/Pages/About.jsx b/frontend/src/components/Pages/About.jsx index 5a67a734..f4ab679b 100644 --- a/frontend/src/components/Pages/About.jsx +++ b/frontend/src/components/Pages/About.jsx @@ -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 (
{ + window.scrollTo(0, 0); + }, []); + return ( <>
@@ -318,4 +322,4 @@ export default function Boardgame() {
); -} +} \ No newline at end of file diff --git a/frontend/src/components/Pages/Event.jsx b/frontend/src/components/Pages/Event.jsx index 7f2bf488..1663f37a 100644 --- a/frontend/src/components/Pages/Event.jsx +++ b/frontend/src/components/Pages/Event.jsx @@ -111,6 +111,10 @@ export default function Event() { }; }, []); + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( <>
diff --git a/frontend/src/components/Pages/Home.jsx b/frontend/src/components/Pages/Home.jsx index 9b6aa343..2f5001f1 100644 --- a/frontend/src/components/Pages/Home.jsx +++ b/frontend/src/components/Pages/Home.jsx @@ -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 ( -
- - - - -
- ); -} + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( +
+ + + + +
+ ) +} \ No newline at end of file diff --git a/frontend/src/components/Pages/Login.jsx b/frontend/src/components/Pages/Login.jsx index dd6588ce..ecd9139d 100644 --- a/frontend/src/components/Pages/Login.jsx +++ b/frontend/src/components/Pages/Login.jsx @@ -1,8 +1,10 @@ -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"; import Cookies from 'js-cookie' + const Login = () => { const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000'; const [data, setData] = useState({ @@ -47,6 +49,10 @@ const Login = () => { } }; + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return (
login diff --git a/frontend/src/components/Pages/Menu.jsx b/frontend/src/components/Pages/Menu.jsx index 5dcbff43..70fdddae 100644 --- a/frontend/src/components/Pages/Menu.jsx +++ b/frontend/src/components/Pages/Menu.jsx @@ -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'; @@ -28,6 +30,10 @@ function ParallaxImage() { y: mousePosition.y / 30, }; + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( <>
Flip Menu
-
+ {/*
+ +
+ */} +
{/* Adjust this container */}
- +
{/* Add bottom padding here */} + +
); diff --git a/frontend/src/components/Pages/MyBook.jsx b/frontend/src/components/Pages/MyBook.jsx index e0061a62..ca9866ed 100644 --- a/frontend/src/components/Pages/MyBook.jsx +++ b/frontend/src/components/Pages/MyBook.jsx @@ -42,6 +42,10 @@ function MyBook() { return () => window.removeEventListener('resize', handleResize); }, []); + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return (
{ - return ( -
-
-

404 Not Found

- Not Found GIF -

- Sorry, the page you are looking for could not be found. -

-
-
- ); -}; +import Notfound from "../../assets/Menu_assets/Notfound.gif" +import React, { useState , useEffect } from 'react'; +const NotFound = () => { + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( +
+
+

404 Not Found

+ Not Found GIF +

+ Sorry, the page you are looking for could not be found. +

+
+
+ ); +} export default NotFound; diff --git a/frontend/src/components/Pages/Pages.jsx b/frontend/src/components/Pages/Pages.jsx index 57aeddc7..473dd4e8 100644 --- a/frontend/src/components/Pages/Pages.jsx +++ b/frontend/src/components/Pages/Pages.jsx @@ -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 (
{props.children}
diff --git a/frontend/src/components/Pages/Register.jsx b/frontend/src/components/Pages/Register.jsx index 91b88e90..b01b506d 100644 --- a/frontend/src/components/Pages/Register.jsx +++ b/frontend/src/components/Pages/Register.jsx @@ -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(''); @@ -32,6 +34,10 @@ export default function Register() { .catch((error) => console.log(error)); }; + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( <>
diff --git a/frontend/src/components/Pages/Signup.jsx b/frontend/src/components/Pages/Signup.jsx index 1fdd97e7..0d8e47b6 100644 --- a/frontend/src/components/Pages/Signup.jsx +++ b/frontend/src/components/Pages/Signup.jsx @@ -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'; @@ -70,6 +71,10 @@ const Signup = () => { } }; + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return (
login diff --git a/frontend/src/components/Pages/TodaysSpecial.jsx b/frontend/src/components/Pages/TodaysSpecial.jsx index 0d15c297..5b911ffc 100644 --- a/frontend/src/components/Pages/TodaysSpecial.jsx +++ b/frontend/src/components/Pages/TodaysSpecial.jsx @@ -11,64 +11,27 @@ import caesar_salad from '../../assets/TSimg/caesar_salad.webp'; const menuItems = { coffee: [ - { - name: 'Espresso', - description: 'Rich and bold coffee shot.', - image: espresso, - }, - { - name: 'Cappuccino', - description: 'Creamy coffee with frothy milk.', - image: cappuccino, - }, - { - name: 'Latte', - description: 'Smooth coffee with steamed milk.', - image: latte, - }, + { name: "Espresso", description: "Rich and bold coffee shot.", image: espresso, originalPrice: "$3.00", offerPrice: "$2.50" }, + { name: "Cappuccino", description: "Creamy coffee with frothy milk.", image: cappuccino, originalPrice: "$3.50", offerPrice: "$3.00" }, + { name: "Latte", description: "Smooth coffee with steamed milk.", image: latte, originalPrice: "$4.00", offerPrice: "$3.50" }, ], drinks: [ - { - name: 'Mango Smoothie', - description: 'Refreshing mango blend.', - image: mango_smoothie, - }, - { - name: 'Lemonade', - description: 'Zesty and chilled lemonade.', - image: lemonade, - }, - { - name: 'Iced Tea', - description: 'Cool iced tea with lemon.', - image: iced_tea, - }, + { name: "Mango Smoothie", description: "Refreshing mango blend.", image: mango_smoothie, originalPrice: "$4.50", offerPrice: "$4.00" }, + { name: "Lemonade", description: "Zesty and chilled lemonade.", image: lemonade, originalPrice: "$2.50", offerPrice: "$2.00" }, + { name: "Iced Tea", description: "Cool iced tea with lemon.", image: iced_tea, originalPrice: "$2.00", offerPrice: "$1.50" }, ], food: [ - { - name: 'Cheese Sandwich', - description: 'Toasted sandwich with cheese.', - image: cheese_sandwich, - }, - { - name: 'Pasta Primavera', - description: 'Veggies and pasta in a light sauce.', - image: pasta_primavera, - }, - { - name: 'Caesar Salad', - description: 'Crispy salad with Caesar dressing.', - image: caesar_salad, - }, + { name: "Cheese Sandwich", description: "Toasted sandwich with cheese.", image: cheese_sandwich, originalPrice: "$3.50", offerPrice: "$3.00" }, + { name: "Pasta Primavera", description: "Veggies and pasta in a light sauce.", image: pasta_primavera, originalPrice: "$5.50", offerPrice: "$5.00" }, + { name: "Caesar Salad", description: "Crispy salad with Caesar dressing.", image: caesar_salad, originalPrice: "$5.00", offerPrice: "$4.50" }, + ], }; const TodaysSpecial = () => { - const [todaysSpecial, setTodaysSpecial] = useState({ - coffee: {}, - drink: {}, - food: {}, - }); + + const [todaysSpecial, setTodaysSpecial] = useState({ coffee: {}, drink: {}, food: {} }); + const [hoveredItem, setHoveredItem] = useState(null); // State to track the hovered item // Function to update today's special (cycling through 3 items) const updateTodaysSpecial = () => { @@ -91,32 +54,64 @@ const TodaysSpecial = () => {

Today's Special

-
- {todaysSpecial.coffee.name} + {/* Coffee Card */} +
setHoveredItem('coffee')} + onMouseLeave={() => setHoveredItem(null)} + > + {todaysSpecial.coffee.name} +

{todaysSpecial.coffee.name}

{todaysSpecial.coffee.description}

+ {/* Show prices below the image and description */} + {hoveredItem === 'coffee' && ( +
+

{todaysSpecial.coffee.originalPrice}

+

{todaysSpecial.coffee.offerPrice}

+
+ )}
-
- {todaysSpecial.food.name} + + {/* Food Card */} +
setHoveredItem('food')} + onMouseLeave={() => setHoveredItem(null)} + > + {todaysSpecial.food.name} +

{todaysSpecial.food.name}

{todaysSpecial.food.description}

+ {/* Show prices below the image and description */} + {hoveredItem === 'food' && ( +
+

{todaysSpecial.food.originalPrice}

+

{todaysSpecial.food.offerPrice}

+
+ )}
-
- {todaysSpecial.drink.name} + + {/* Drink Card */} +
setHoveredItem('drink')} + onMouseLeave={() => setHoveredItem(null)} + > + {todaysSpecial.drink.name} +

{todaysSpecial.drink.name}

{todaysSpecial.drink.description}

+ {/* Show prices below the image and description */} + {hoveredItem === 'drink' && ( +
+

{todaysSpecial.drink.originalPrice}

+

{todaysSpecial.drink.offerPrice}

+
+ )}