Skip to content

Commit

Permalink
navbar fixed, menu-tab added, responsive design added
Browse files Browse the repository at this point in the history
  • Loading branch information
NazimS committed Mar 18, 2023
1 parent 282bfff commit b4c3be3
Show file tree
Hide file tree
Showing 9 changed files with 737 additions and 77 deletions.
Binary file added img/blog1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dinner1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/lunch1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wine1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
338 changes: 306 additions & 32 deletions index.html

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

// navbar sticky begin

window.onscroll = function () {fixedNavbar()}

const navMenu = document.querySelector('.nav-menu')
let sticky = navMenu.offsetTop;

function fixedNavbar() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
navMenu.classList.add("sticky");
} else {
navMenu.classList.remove("sticky");
}
}

// navbar sticky end

//tab menu begin

function openMenu(evt, eatingTime) {
let i, tabcontent, tab;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
// tabcontent[tabcontent.length -1].style.display = "none";

}
tab = document.getElementsByClassName("tab");
for (i = 0; i < tab.length; i++) {
tab[i].className = tab[i].className.replace(" active", "");
}
document.getElementById(eatingTime).style.display = "flex";
evt.currentTarget.className += " active";
}

//tab menu end

// burger-menu begin
$(() => {
$('.openMenu').click(function() {
$('.mainMenu').slideToggle('slow');
});
$('.closeMenu').click(function() {
$('.mainMenu').slideToggle('slow');
});
});
// burger-menu end

0 comments on commit b4c3be3

Please sign in to comment.