From 0b3dd45c30db59281b99ddd38558e2f68ec91440 Mon Sep 17 00:00:00 2001 From: Reportieris Date: Mon, 22 Jul 2024 02:42:58 +0300 Subject: [PATCH] trying to make the hamburger button to expand diagonally downward and to the left. Doesn't want to work no matter what I try. --- components/Navbar.tsx | 145 ++++++++-------------- public/images/NewImages/Nav_BcardLogo.svg | 15 +++ public/images/NewImages/Nav_Hamburger.svg | 5 + src/styles/Navbar.module.css | 58 ++++----- 4 files changed, 100 insertions(+), 123 deletions(-) create mode 100644 public/images/NewImages/Nav_BcardLogo.svg create mode 100644 public/images/NewImages/Nav_Hamburger.svg diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 90c4f05..53b331a 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,114 +1,71 @@ import React, { useState } from "react"; import Image from "next/image"; import Link from "next/link"; -import { useRouter } from "next/router"; -import styles from '@/styles/Navbar.module.css' -import logo from "../public/images/new-logo.png"; -import hamburger from "../public/images/hamburger.svg"; +import logo from "../public/images/NewImages/Nav_BcardLogo.svg"; +import hamburger from "../public/images/NewImages/Nav_Hamburger.svg"; const Navbar = () => { const [isOpen, setIsOpen] = useState(false); - const router = useRouter(); - - const handleToggle = () => { - setIsOpen(!isOpen); - }; - - const isActive = (pathname: string) => { - return router.pathname === pathname ? `text-purple-500 ${styles['border-bottom']}` : `${styles['border-hover-bottom']}` - }; return ( - + + ); }; diff --git a/public/images/NewImages/Nav_BcardLogo.svg b/public/images/NewImages/Nav_BcardLogo.svg new file mode 100644 index 0000000..87dd0d3 --- /dev/null +++ b/public/images/NewImages/Nav_BcardLogo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/public/images/NewImages/Nav_Hamburger.svg b/public/images/NewImages/Nav_Hamburger.svg new file mode 100644 index 0000000..8a7660b --- /dev/null +++ b/public/images/NewImages/Nav_Hamburger.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/styles/Navbar.module.css b/src/styles/Navbar.module.css index 9a2a430..79624ae 100644 --- a/src/styles/Navbar.module.css +++ b/src/styles/Navbar.module.css @@ -1,33 +1,33 @@ -.border-bottom{ - position: relative; +.border-bottom { + position: relative; } -.border-bottom::after{ - content: ""; - width: 100%; - height: 3px; - position: absolute; - bottom: 0; - left: 0; - margin-bottom: -6px; - --tw-text-opacity: 1; - background-color: rgb(168 85 247 / var(--tw-text-opacity)); +.border-bottom::after { + content: ""; + width: 100%; + height: 3px; + position: absolute; + bottom: 0; + left: 0; + margin-bottom: -6px; + --tw-text-opacity: 1; + background-color: rgb(168 85 247 / var(--tw-text-opacity)); } -.border-hover-bottom{ - position: relative; +.border-hover-bottom { + position: relative; } -.border-hover-bottom::after{ - content: ""; - width: 100%; - height: 3px; - position: absolute; - bottom: 0; - left: 0; - margin-bottom: -6px; - --tw-text-opacity: 1; - background-color: #ccc; - transform: scaleX(0); - transition: 0.5s; +.border-hover-bottom::after { + content: ""; + width: 100%; + height: 3px; + position: absolute; + bottom: 0; + left: 0; + margin-bottom: -6px; + --tw-text-opacity: 1; + background-color: #ccc; + transform: scaleX(0); + transition: 0.5s; +} +.border-hover-bottom:hover::after { + transform: scaleX(1); } -.border-hover-bottom:hover::after{ - transform: scaleX(1); -} \ No newline at end of file