From cf7b91a327b8abbdb80bd2f55db377f7087f882c Mon Sep 17 00:00:00 2001 From: Donald Reddy Indelu Date: Mon, 10 Jun 2024 23:27:32 +0530 Subject: [PATCH] fix menu --- src/components/Hero/Hero.jsx | 4 +- src/components/Navbar/Navbar.css | 86 ++++++++++++++++++++------------ src/components/Navbar/Navbar.jsx | 10 ++-- 3 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/components/Hero/Hero.jsx b/src/components/Hero/Hero.jsx index d219fc0..fff689a 100644 --- a/src/components/Hero/Hero.jsx +++ b/src/components/Hero/Hero.jsx @@ -1,7 +1,6 @@ import React, { useEffect } from 'react'; import logo from '../../assets/A letter tech logo.png'; import Typed from 'typed.js'; -import { Link as ScrollLink } from 'react-scroll'; function Hero() { useEffect(() => { @@ -30,8 +29,7 @@ function Hero() {

Welcome to CosmoXplore, where NASA's API unveils celestial wonders. Discover breathtaking images and cutting-edge astronomical data, embarking on a cosmic journey that transcends the boundaries of earthly imagination.

- {/* */} - Explore +
diff --git a/src/components/Navbar/Navbar.css b/src/components/Navbar/Navbar.css index b5a1684..dd84ec7 100644 --- a/src/components/Navbar/Navbar.css +++ b/src/components/Navbar/Navbar.css @@ -3,10 +3,7 @@ top: 0; left: 0; width: 100dvw; - /* background: linear-gradient(to left, rgb(10, 0, 73), rgb(0, 0, 0)); - */ - background-image: linear-gradient(to left, rgba(10, 0, 73, 0.9), rgba(0, 0, 0, 0.9)); /* Semi-transparent background */ - + background-image: linear-gradient(to left, rgba(10, 0, 73, 0.9), rgba(0, 0, 0, 0.9)); color: #fff; padding: 1rem 2rem; text-align: center; @@ -15,21 +12,22 @@ justify-content: space-between; align-items: center; box-sizing: border-box; - box-shadow: 0 17px 20px rgba(0, 0, 0, 0.2); /* Add shadow here */ - backdrop-filter: blur(10px) saturate(150%); + box-shadow: 0 17px 20px rgba(0, 0, 0, 0.2); + backdrop-filter: blur(10px) saturate(150%); } .logo { display: flex; justify-content: center; - grid-column: 2/3; align-items: center; } -.logo-img{ + +.logo-img { width: 370px; } + .navigator { - overflow: hidden; + /* overflow: hidden; */ } .navigator.open { @@ -44,6 +42,8 @@ gap: 2rem; } +/* */ + .navbar-links.open { display: flex; flex-direction: column; @@ -62,12 +62,12 @@ opacity: 0.7; list-style-type: none; transition: 0.5s; - position: relative; + position: relative; } -.navbar-list-item:hover{ +.navbar-list-item:hover { font-weight: bold; - color:aqua; + color: aqua; opacity: 1; } @@ -77,26 +77,44 @@ transition: 0.5s; } +.active { + text-decoration: none; + opacity: 1; + color: rgb(0, 255, 255); + font-weight: bold; +} + .navbar-list-item:after { - content: ""; /* Empty content for pseudo-element */ - position: absolute; /* Absolute positioning for underline */ - width: 100%; /* Full width of the list item */ - height: 2px; /* Underline height */ - background-color: aqua; /* White underline color */ - opacity: 0; /* Initially hidden */ - transition: all 0.3s; /* Smooth transition on hover */ - bottom: -7px; /* Increased gap */ - left: 0; /* Align underline to the left of the list item */ -} - -.navbar-list-item:hover:after{ + content: ""; + /* Empty content for pseudo-element */ + position: absolute; + /* Absolute positioning for underline */ + width: 100%; + /* Full width of the list item */ + height: 2px; + /* Underline height */ + background-color: aqua; + /* White underline color */ + opacity: 0; + /* Initially hidden */ + transition: all 0.3s; + /* Smooth transition on hover */ + bottom: -7px; + /* Increased gap */ + left: 0; + /* Align underline to the left of the list item */ +} + +.navbar-list-item:hover:after { /* font-size: large; */ - opacity:1; + opacity: 1; } -.navbar-list-item-contact-us:hover{ + +.navbar-list-item-contact-us:hover { /* font-size: large; */ - opacity:1; + opacity: 1; } + .hamburger { display: none; } @@ -128,8 +146,8 @@ top: 0; right: 0; width: 30%; - height: 100%; - background-color: #030013; + height: 100dvh; + background-color: #030013ee; overflow: auto; z-index: 10; display: none; @@ -148,11 +166,13 @@ z-index: 100; } } -@media only screen and (max-width: 720px){ - .navigator{ + +@media only screen and (max-width: 720px) { + .navigator { width: 60%; } - .logo-img{ + + .logo-img { width: 250px; } -} +} \ No newline at end of file diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx index 2499cf0..2744b0b 100644 --- a/src/components/Navbar/Navbar.jsx +++ b/src/components/Navbar/Navbar.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { NavLink, Link as RouterLink, useNavigate, useLocation } from 'react-router-dom'; +import { NavLink, useNavigate, useLocation } from 'react-router-dom'; import { Link as ScrollLink, animateScroll as scroll } from 'react-scroll'; import logoWhite from '../../assets/logo_white.png'; import './Navbar.css'; @@ -109,17 +109,17 @@ function Navbar() {