Skip to content

Commit

Permalink
Added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakesh9100 authored Dec 16, 2024
1 parent a9039f6 commit 228edcf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 58 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

18 changes: 13 additions & 5 deletions assets/commonscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const updateProgress = () => {
document.addEventListener('scroll', updateProgress);

// Toggle mobile menu visibility
const hamBurger = document.querySelector(".hamburger");
const nMenu = document.querySelector(".nav-menu");
const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-menu");

document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
Expand All @@ -20,11 +20,19 @@ document.addEventListener("DOMContentLoaded", function () {
});

// Hamburger menu
hamBurger.addEventListener("click", mobileMenu);
hamburger.addEventListener("click", mobileMenu);

function mobileMenu() {
hamBurger.classList.toggle("active");
nMenu.classList.toggle("active");
hamburger.classList.toggle("active");
navMenu.classList.toggle("active");
}

const navLink = document.querySelectorAll(".nav-link");
navLink.forEach(n => n.addEventListener("click", closeMenu));

function closeMenu() {
hamburger.classList.remove("active");
navMenu.classList.remove("active");
}

// Hide or show scroll progress indicator
Expand Down
4 changes: 0 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@
<span class="bar"></span>
<span class="bar"></span>
</div>
<ul class="nav-menu">
<!-- Additional nav items -->
</ul>

</nav>
</header>
<!-- Navigation bar section ends -->
Expand Down
39 changes: 0 additions & 39 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,6 @@ window.addEventListener('scroll', () => {
});
});

// Toggle mobile menu visibility
const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-menu");

document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
document.querySelector("body").classList.add("loaded");
}, 500);
});

document.addEventListener("DOMContentLoaded", () => {
const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-menu");

// Verify the elements exist
if (!hamburger || !navMenu) {
console.error("Hamburger or nav-menu element not found.");
return;
}

// Attach click event to toggle menu visibility
hamburger.addEventListener("click", () => {
console.log("Hamburger clicked.");
hamburger.classList.toggle("active");
navMenu.classList.toggle("show");
});

// Close menu when a link is clicked
const navLinks = document.querySelectorAll(".nav-link");
navLinks.forEach(link => {
link.addEventListener("click", () => {
console.log("Nav link clicked.");
hamburger.classList.remove("active");
navMenu.classList.remove("show");
});
});
});


// Google Translate
function googleTranslateElementInit() {
new google.translate.TranslateElement({
Expand Down
9 changes: 2 additions & 7 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2174,15 +2174,10 @@ footer {
backdrop-filter: blur(7px);
transition: 0.5s ease-in-out;
}
.nav-menu.show {
display: flex; /* Or block, depending on your design */
}


.nav-item {
margin: 10px ;
font-size: 30px;

margin: 1.8rem 0;
font-size: 25px;
}

nav li:hover {
Expand Down

0 comments on commit 228edcf

Please sign in to comment.