diff --git a/src/pages/header.css b/src/pages/header.css index 8e763c3..074c72f 100644 --- a/src/pages/header.css +++ b/src/pages/header.css @@ -173,3 +173,64 @@ --background-color-light: #000000; --text-color-light: #fff; } +.hamburger{ + display: none !important; +} +.hamburger div { + width: 25px; + height: 3px; + background-color: #333; + transition: 0.4s; +} +.mode{ + display: none; +} +@media only screen and (max-width:510px){ +.hamburger { + align-items: center; +display: flex !important; +flex-direction: column; +justify-content: center; +gap: 5px; +cursor: pointer; +position: relative; +right: 20px !important; +} +.active .hamburger div{ + background-color: white !important; +} +.container{ + z-index: 1; +} + +.elements { + width: 100vw !important; + display: flex; + flex-direction: column; + padding-top: 10px !important; + align-items: center !important; + position: fixed; + gap: 20px !important; + top: 105px !important; + background-color: rgba(230, 230, 250, 0.6); /* Light purple with some transparency */ + backdrop-filter: blur(7px); /* Adjust the blur radius as needed */ + overflow: hidden; + right: 0px !important; + border-radius: 15px !important; +} + +.active .elements{ + background-color: rgba(0, 0, 0, 0.6); + color: white; +} +.container2{ + display: none !important; +} +.mode{ + position: absolute; + right: 20px !important; +}.mode{ + right: 70px !important; + display: block !important; +} +} \ No newline at end of file diff --git a/src/pages/header.js b/src/pages/header.js index 2a56f9c..25b30d5 100644 --- a/src/pages/header.js +++ b/src/pages/header.js @@ -8,15 +8,23 @@ import { FiMenu, FiX } from 'react-icons/fi'; function Header() { const { theme, toggleTheme } = useContext(ThemeContext); const [isMenuOpen, setIsMenuOpen] = useState(false); + const [isOpen,setIsOpen]=useState(false) function handleThemeToggle() { toggleTheme(theme === 'dark' ? 'light' : 'dark'); } - function handleMenuToggle() { - setIsMenuOpen(!isMenuOpen); - } - + function handleClick(e){ + if(theme=="dark"){ + toggleTheme('light') + }else{ + toggleTheme('dark') + } +} +// const {isDarkMode, togglerDarkMode} =useTheme(); +function handleHamClick(){ +isOpen?setIsOpen(false): setIsOpen(true) +} return (
@@ -25,23 +33,46 @@ function Header() { logo
-
- - Review Us - - - Login - - - About Us - - {theme === 'dark' ? : } -
-
- {isMenuOpen ? : } -
+
+ + Review Us + + + Login + + + About Us + + { + + theme=='dark'? : + } +
+ { + +theme=='dark'? : +} +
+
+
+
+
+ { + isOpen &&
+ + Review Us + + + Login + + + About Us + +
-
+ } + + ); }