Skip to content

Commit

Permalink
Merge pull request #1522 from khushi-joshi-05/revert-1405-enhance_navbar
Browse files Browse the repository at this point in the history
Revert "Enhance navbar"
  • Loading branch information
khushi-joshi-05 authored Jul 30, 2024
2 parents 952b54f + 0425720 commit a2884bd
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 158 deletions.
144 changes: 105 additions & 39 deletions Css-files/navbar.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* General Styles */
/* Variables */
:root {
/* General Colors */
--primary-bg-color: #ffffff;
--primary-text-color: #333335;
--secondary-bg-color: #f2f2f2;
Expand All @@ -9,6 +10,14 @@
--navbar-bg-color: #f2f2f2;
--navbar-hover-color: #e5e5e5;

/* Card Colors */
--card-bg-color: #ffffff;
--card-hover-color: #f5f5f5;

/* Footer Colors */
--footer-bg-color: #f2f2f2;
--footer-hover-color: #e5e5e5;

/* Additional Colors */
--container-bg: black;
--drop-bg: #212123;
Expand All @@ -18,15 +27,29 @@
}

.dark-theme {

--a: rgb(183, 175, 175);
--drop-bg: #ffffff;
--nav: white;
/* General Colors */
--primary-bg-color: #212123;
--primary-text-color: #ffffff;
--secondary-bg-color: #333335;
--accent-color: #9e5c48;

/* Navbar Colors */
--navbar-bg-color: #333335;
--navbar-hover-color: #474749;

/* Card Colors */
--card-bg-color: #2c2c2e;
--card-hover-color: #373739;

/* Footer Colors */
--footer-bg-color: #28282a;
--footer-hover-color: #333335;

/* Additional Colors */
--container-bg: rgb(224, 224, 252);
--drop-bg: #ffffff;
--a: black;
Expand Down Expand Up @@ -57,22 +80,20 @@
flex-grow: 0;
}


/* Navbar Links */
.nav-link {
position: relative;
color: var(--a);
text-shadow: 0 0 5px rgba(255,255,255, 0.75), 0 0 10px rgba(255,255,255, 0.75), 0 0 15px rgba(255,255,255, 0.75), 0 0 20px rgba(255,255,255, 0.75);
transition: color 0.3s, background-color 0.3s, text-shadow 0.3s;
transition: color 0.3s, background-color 0.3s;
}

.nav-link:hover {
color: #fff;
transform: scale(1.1);
border-radius: 5px;
text-shadow: 0 0 20px rgba(255, 165, 0, 1), 0 0 30px rgba(255, 165, 0, 1), 0 0 40px rgba(255, 165, 0, 1), 0 0 50px rgba(255, 165, 0, 1);
}

/* Center Links */

ul {
gap: 5px;
}
Expand All @@ -83,6 +104,7 @@ ul {
align-items: center;
}


.center-links .nav-item .nav-link:hover {
color: #f13800e4;
}
Expand Down Expand Up @@ -121,20 +143,21 @@ ul {
.navbar-nav.center-links .active {
color: #dc3545;
border-bottom: 2px solid #dc3545;
gap: 10px;
gap:10px;
}

.navbar-nav.end-links .active {
color: rgba(255, 183, 0, 0.705);
border-bottom: 2px solid rgba(255, 183, 0, 0.705);
gap: 10px;
gap:10px;
}



/* Dropdown Items */

#theme-toggle-icon {
width: 30px;
height:30px;
cursor: pointer;
}

Expand All @@ -150,49 +173,92 @@ ul {
padding: 4px 8px;
color: var(--a);
font-size: 15px;

background-color: var(--background-color);

transition: background-color 0.3s, transform 0.3s;

}

.dropdown-item:active {
background-color: #dc3545;
}

:root {
--background-color: #fff;
--text-color: #000;
--button-bg: #D0EEB0;
--button-hover-bg: #59a10c;
--card-bg: rgba(0, 0, 0, 0.8);
--carousel-caption-bg: rgba(0, 0, 0, 0.7);
}

body {
background-color: var(--background-color);
color: var(--text-color);
}

.section {
background-color: var(--background-color);
color: var(--text-color);
}

.btn-card {
background-color: var(--button-bg);
color: var(--text-color);
}

.card-1::after {
background-color: var(--button-hover-bg);
}

.card-1 {
background-color: var(--carousel-caption-bg);
}

/* Dark mode styles */
.about_us.dark-theme {
--background-color: #000;
--text-color: #fff;
--button-bg: #555;
--button-hover-bg: #333;
--card-bg: rgba(255, 255, 255, 0.8);
--carousel-caption-bg: rgba(255, 255, 255, 0.7);
}

.about_us.dark-theme {
background-color: var(--background-color);
color: var(--text-color);
}

.about_us.dark-theme .section {
background-color: var(--background-color);
color: var(--text-color);
}

.about_us.dark-theme .btn-card {
background-color: var(--button-bg);
color: var(--text-color);
}

.about_us.dark-theme .btn-card:hover {
background-color: var(--button-hover-bg);
}

.about_us.dark-theme .carousel-caption {
background-color: var(--carousel-caption-bg);
}


.dropdown-item:hover {
background-color: #007bff;
color: #fff;
transform: scale(1.1);
}

/* Bubbles Animation */
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url('https://cdn.pixabay.com/photo/2015/04/17/12/20/soap-bubble-726523_960_720.png') repeat;
z-index: -1;
animation: moveBubbles 30s linear infinite;
opacity: 0.5;
}

@keyframes moveBubbles {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-1000px);
}
}

/* Additional Styles for Dark Theme */
.dark-theme .nav-link {
color: var(--a);
text-shadow: 0 0 5px rgba(0255, 255, 255, 0.75), 0 0 10px rgba(0255, 255, 255, 0.75), 0 0 15px rgba(0255, 255, 255, 0.75), 0 0 20px rgba(0255, 255, 255, 0.75);
/* Theme Toggle Icon */
#theme-toggle-icon {
width: 30px;
cursor: pointer;
}

.dark-theme .nav-link:hover {
text-shadow: 0 0 20px rgba(0, 255, 0, 1), 0 0 30px rgba(0, 255, 0, 1), 0 0 40px rgba(0, 255, 0, 1), 0 0 50px rgba(0, 255, 0, 1);
}
6 changes: 1 addition & 5 deletions Html-files/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@
<div class="collapse navbar-collapse hamburgeritems centerdiv order-2 order-lg-0">
<ul class="navbar-nav center-links">
<li class="nav-item">

<a class="nav-link active" aria-current="page" href="../index.html">



<a class="nav-link" aria-current="page" href="index.html">
<i class="fa-solid fa-home"></i> Home
</a>
</li>
Expand Down
49 changes: 18 additions & 31 deletions Html-files/navbar.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,40 @@

// Theme Toggle
const themeToggleIcon = document.getElementById("theme-toggle-icon");


//Themechange icon toggling behaviour



let themeToggleIcon = document.getElementById("theme-toggle-icon");
let themeToggleLogo = document.getElementById("theme-toggle-logo");
themeToggleIcon.addEventListener("click", function () {
document.body.classList.toggle("dark-theme");
document.body.classList.toggle(":root")
if (document.body.classList.contains("dark-theme")) {

themeToggleIcon.src = "Images/navbar/sun.png";
themeToggleIcon.src = "../Images/navbar/sun.png";
themeToggleLogo.src = "Images/logo/Logo-Dark.png";
} else {
themeToggleIcon.src = "Images/navbar/moon.png";
themeToggleIcon.src = "../Images/navbar/moon.png";
themeToggleLogo.src="Images/logo/Logo-Light.png";
}
});

// Navbar Background Change on Scroll
window.addEventListener("scroll", function () {
const navbar = document.querySelector(".navbar");
if (window.scrollY > 100) {
navbar.classList.add("scrolled");
} else {
navbar.classList.remove("scrolled");
}
});
//Services dropdown

// Services dropdown
const dropdownli = document.querySelector(".nav-item.dropdown");
const navlinka = document.querySelector('.nav-link.services');
const menu = document.querySelector('.dropdown .dropdown-menu');

dropdownli.addEventListener("mouseenter", () => {
navlinka.classList.add("show");
menu.classList.add("show");
navlinka.setAttribute('aria-expanded', 'true');
menu.setAttribute("data-bs-popper", 'static');
navlinka.classList.add("show");
menu.classList.add("show");
navlinka.setAttribute('aria-expanded', 'true');
menu.setAttribute("data-bs-popper", 'static');
});

menu.addEventListener("mouseleave", () => {
menu.classList.remove("show");
navlinka.classList.remove("show");
navlinka.setAttribute('aria-expanded', 'false');
menu.removeAttribute("data-bs-popper");
dropdownli.addEventListener("mouseleave", () => {
menu.classList.remove("show");
navlinka.classList.remove("show");
navlinka.setAttribute('aria-expanded', 'false');
menu.removeAttribute("data-bs-popper");
})
dropdownli.addEventListener("mouseleave", () => {
menu.classList.remove("show");
navlinka.classList.remove("show");
navlinka.setAttribute('aria-expanded', 'false');
menu.removeAttribute("data-bs-popper");
})
});
Loading

0 comments on commit a2884bd

Please sign in to comment.