From ff8861ae88b598a94cee1f38ba6eeeecf2e497af Mon Sep 17 00:00:00 2001 From: Amnyadav Date: Sat, 12 Oct 2024 00:46:27 +0530 Subject: [PATCH] optimized image loading time using lazy loading --- frontend/src/components/Pages/Admin.jsx | 1 + frontend/src/components/Pages/Boardgame.jsx | 1 + frontend/src/components/Pages/Event.jsx | 16 +++++++++------- frontend/src/components/Pages/Login.jsx | 2 +- .../Pages/MenuPages.jsx/Boba/ThirdPage.jsx | 2 ++ .../Pages/MenuPages.jsx/Coffee/FirstPage.jsx | 5 +++-- .../Pages/MenuPages.jsx/ThankPage/ThankPage.jsx | 2 ++ frontend/src/components/Pages/Notfound.jsx | 1 + frontend/src/components/Pages/Register.jsx | 2 ++ frontend/src/components/Pages/ResetPassword.jsx | 2 +- frontend/src/components/Pages/Signup.jsx | 2 +- frontend/src/components/Pages/TodaysSpecial.jsx | 6 +++--- frontend/src/components/Shared/Navbar.jsx | 1 + .../src/components/Shared/footer/Content.jsx | 1 + frontend/src/components/ui/FeedbackForm.jsx | 1 + frontend/src/components/ui/Landing.jsx | 4 ++-- frontend/src/index.css | 4 ++++ 17 files changed, 36 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/Pages/Admin.jsx b/frontend/src/components/Pages/Admin.jsx index 180c8f60..bc588822 100644 --- a/frontend/src/components/Pages/Admin.jsx +++ b/frontend/src/components/Pages/Admin.jsx @@ -274,6 +274,7 @@ const Admin = () => { {event.title} diff --git a/frontend/src/components/Pages/Boardgame.jsx b/frontend/src/components/Pages/Boardgame.jsx index 96ca0fcf..001bb69a 100644 --- a/frontend/src/components/Pages/Boardgame.jsx +++ b/frontend/src/components/Pages/Boardgame.jsx @@ -245,6 +245,7 @@ export default function Boardgame() { {board.title}

Upcoming Events and much more....

- game - game + game + game
@@ -189,19 +190,19 @@ export default function Event() {
@@ -223,6 +224,7 @@ export default function Event() { {event.title}
diff --git a/frontend/src/components/Pages/Login.jsx b/frontend/src/components/Pages/Login.jsx index ecd9139d..8c37eb48 100644 --- a/frontend/src/components/Pages/Login.jsx +++ b/frontend/src/components/Pages/Login.jsx @@ -55,7 +55,7 @@ const Login = () => { return (
- login + login
handleSubmit(e)} className="form z-10 p-16 bg-lightblue flex flex-col items-start justify-center gap-5 rounded-lg border-2 border-black shadow-[4px_4px_0px_0px_black] bg-[#f1e9dc]" diff --git a/frontend/src/components/Pages/MenuPages.jsx/Boba/ThirdPage.jsx b/frontend/src/components/Pages/MenuPages.jsx/Boba/ThirdPage.jsx index 61699b22..b8974b04 100644 --- a/frontend/src/components/Pages/MenuPages.jsx/Boba/ThirdPage.jsx +++ b/frontend/src/components/Pages/MenuPages.jsx/Boba/ThirdPage.jsx @@ -148,11 +148,13 @@ const ThirdPage = () => { src={bubbleTea} className="md:h-40 md:w-50 h-20 w-20 object-contain" alt="Bubble Tea" + loading="lazy" /> Bubble Tea
diff --git a/frontend/src/components/Pages/MenuPages.jsx/Coffee/FirstPage.jsx b/frontend/src/components/Pages/MenuPages.jsx/Coffee/FirstPage.jsx index df5dc187..0defc8ef 100644 --- a/frontend/src/components/Pages/MenuPages.jsx/Coffee/FirstPage.jsx +++ b/frontend/src/components/Pages/MenuPages.jsx/Coffee/FirstPage.jsx @@ -146,13 +146,14 @@ const FirstPage = () => {
- Coffee + Coffee Coffee - Coffee + Coffee
diff --git a/frontend/src/components/Pages/MenuPages.jsx/ThankPage/ThankPage.jsx b/frontend/src/components/Pages/MenuPages.jsx/ThankPage/ThankPage.jsx index c00849a5..3cda0ba1 100644 --- a/frontend/src/components/Pages/MenuPages.jsx/ThankPage/ThankPage.jsx +++ b/frontend/src/components/Pages/MenuPages.jsx/ThankPage/ThankPage.jsx @@ -10,6 +10,7 @@ const ThankPage = () => { Sip&Play Cafe Logo { Sip&Play Cafe Logo { Not Found GIF

diff --git a/frontend/src/components/Pages/Register.jsx b/frontend/src/components/Pages/Register.jsx index b01b506d..c55aff36 100644 --- a/frontend/src/components/Pages/Register.jsx +++ b/frontend/src/components/Pages/Register.jsx @@ -54,6 +54,7 @@ export default function Register() { Board Game Cafe @@ -165,6 +166,7 @@ export default function Register() { {game.title}

{game.title}
diff --git a/frontend/src/components/Pages/ResetPassword.jsx b/frontend/src/components/Pages/ResetPassword.jsx index e2b4ab8a..9174d075 100644 --- a/frontend/src/components/Pages/ResetPassword.jsx +++ b/frontend/src/components/Pages/ResetPassword.jsx @@ -73,7 +73,7 @@ const ResetPassword = () => { return (
- login + login handleSubmit(e)} className="form z-10 p-16 bg-lightblue flex flex-col items-start justify-center gap-5 rounded-lg border-2 border-black shadow-[4px_4px_0px_0px_black] bg-[#f1e9dc]" diff --git a/frontend/src/components/Pages/Signup.jsx b/frontend/src/components/Pages/Signup.jsx index 0d8e47b6..308d9acb 100644 --- a/frontend/src/components/Pages/Signup.jsx +++ b/frontend/src/components/Pages/Signup.jsx @@ -77,7 +77,7 @@ const Signup = () => { return (
- login + login
Play Cafe, diff --git a/frontend/src/components/Pages/TodaysSpecial.jsx b/frontend/src/components/Pages/TodaysSpecial.jsx index 5b911ffc..bb952aa6 100644 --- a/frontend/src/components/Pages/TodaysSpecial.jsx +++ b/frontend/src/components/Pages/TodaysSpecial.jsx @@ -61,7 +61,7 @@ const TodaysSpecial = () => { onMouseEnter={() => setHoveredItem('coffee')} onMouseLeave={() => setHoveredItem(null)} > - {todaysSpecial.coffee.name} + {todaysSpecial.coffee.name}

{todaysSpecial.coffee.name}

{todaysSpecial.coffee.description}

@@ -81,7 +81,7 @@ const TodaysSpecial = () => { onMouseEnter={() => setHoveredItem('food')} onMouseLeave={() => setHoveredItem(null)} > - {todaysSpecial.food.name} + {todaysSpecial.food.name}

{todaysSpecial.food.name}

{todaysSpecial.food.description}

@@ -101,7 +101,7 @@ const TodaysSpecial = () => { onMouseEnter={() => setHoveredItem('drink')} onMouseLeave={() => setHoveredItem(null)} > - {todaysSpecial.drink.name} + {todaysSpecial.drink.name}

{todaysSpecial.drink.name}

{todaysSpecial.drink.description}

diff --git a/frontend/src/components/Shared/Navbar.jsx b/frontend/src/components/Shared/Navbar.jsx index 4993a7ae..e74f284b 100644 --- a/frontend/src/components/Shared/Navbar.jsx +++ b/frontend/src/components/Shared/Navbar.jsx @@ -82,6 +82,7 @@ const Navbar = () => { className="w-14 h-14 bg-white rounded-full p-0" alt="logo" src={Logo} + loading="lazy" />
diff --git a/frontend/src/components/Shared/footer/Content.jsx b/frontend/src/components/Shared/footer/Content.jsx index 0812a3d7..b39070aa 100644 --- a/frontend/src/components/Shared/footer/Content.jsx +++ b/frontend/src/components/Shared/footer/Content.jsx @@ -31,6 +31,7 @@ const Section2 = () => { className="w-24 bg-transparent p-0 rounded-3xl h-24" alt="logo" src={Logo} + loading="lazy" />
)} diff --git a/frontend/src/components/ui/FeedbackForm.jsx b/frontend/src/components/ui/FeedbackForm.jsx index e4b080f2..0865750f 100644 --- a/frontend/src/components/ui/FeedbackForm.jsx +++ b/frontend/src/components/ui/FeedbackForm.jsx @@ -99,6 +99,7 @@ const FeedbackForm = () => { Chess
diff --git a/frontend/src/components/ui/Landing.jsx b/frontend/src/components/ui/Landing.jsx index 068c9e41..30f93f11 100644 --- a/frontend/src/components/ui/Landing.jsx +++ b/frontend/src/components/ui/Landing.jsx @@ -46,11 +46,11 @@ function Landing() {
- +
- +
diff --git a/frontend/src/index.css b/frontend/src/index.css index 07307322..60f8d899 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -36,3 +36,7 @@ background-color: #004d43; border-radius: 10px; } + +body { + overflow-x: hidden; +} \ No newline at end of file