From cf51306b39a16ff2631f38c1831f10f3ec13c6b8 Mon Sep 17 00:00:00 2001 From: biswa Date: Fri, 25 Oct 2024 16:52:04 +0530 Subject: [PATCH] Button and icons hover and animation added --- client/src/components/Navbar.jsx | 107 +++++++++++++++++++++++++++---- 1 file changed, 94 insertions(+), 13 deletions(-) diff --git a/client/src/components/Navbar.jsx b/client/src/components/Navbar.jsx index 258115f..514c97f 100644 --- a/client/src/components/Navbar.jsx +++ b/client/src/components/Navbar.jsx @@ -1,13 +1,7 @@ import React, { useState, useEffect, useCallback, useContext } from 'react'; import { NavLink } from 'react-router-dom'; import { IoMenu, IoClose } from 'react-icons/io5'; -import { - FaHome, - FaUser, - FaHospital, - FaUserPlus, - FaHospitalAlt, -} from 'react-icons/fa'; +import { FaHome, FaHospital, FaUserPlus, FaHospitalAlt } from 'react-icons/fa'; import { AiOutlineInfoCircle } from 'react-icons/ai'; import { MdOutlineLocalHospital, MdLogin, MdDarkMode } from 'react-icons/md'; import { WiDaySunny } from 'react-icons/wi'; @@ -136,7 +130,9 @@ const Navbar = () => { onClick={() => setMobileMenuOpen(false)} > -

Hospitals

+

+ Hospitals +

)} @@ -151,7 +147,9 @@ const Navbar = () => { onClick={() => setMobileMenuOpen(false)} > -

Lab Tests

+

+ Lab Tests +

{ <> -

Lab Test

+

+ Lab Test +

- +

Hospitals Around @@ -288,7 +291,10 @@ const Navbar = () => { {/* Show only Hospitals Around for hospital */} {isAuthenticated && user?.role === 'hospital' && ( - +

Hospitals Around @@ -330,7 +336,7 @@ const Navbar = () => { ) : (

- { to="/register" > Register + */} + { + e.currentTarget.style.transform = 'scale(1.1)'; + e.currentTarget.style.boxShadow = + '0px 8px 16px rgba(0, 0, 0, 0.4)'; + }} + onMouseLeave={(e) => { + e.currentTarget.style.transform = 'scale(1)'; + e.currentTarget.style.boxShadow = + '0px 4px 8px rgba(0, 0, 0, 0.2)'; + }} + className="flex gap-2 items-center px-5 py-1 rounded-lg font-bold" + to="/login" + > + + (e.currentTarget.style.transform = + 'rotate(360deg) scale(1.2)') + } + onMouseLeave={(e) => + (e.currentTarget.style.transform = 'rotate(0deg) scale(1)') + } + />{' '} + Login + + + { + e.currentTarget.style.transform = 'scale(1.1)'; + e.currentTarget.style.boxShadow = + '0px 8px 16px rgba(0, 0, 0, 0.4)'; + }} + onMouseLeave={(e) => { + e.currentTarget.style.transform = 'scale(1)'; + e.currentTarget.style.boxShadow = + '0px 4px 8px rgba(0, 0, 0, 0.2)'; + }} + className="flex gap-2 items-center px-5 py-1 rounded-lg font-bold" + to="/register" + > + + (e.currentTarget.style.transform = + 'rotate(-360deg) scale(1.2)') + } + onMouseLeave={(e) => + (e.currentTarget.style.transform = 'rotate(0deg) scale(1)') + } + />{' '} + Register
)}