diff --git a/Navigation Bar/index.html b/Navigation Bar/index.html new file mode 100644 index 0000000..eb8fda5 --- /dev/null +++ b/Navigation Bar/index.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + Responsive Navigation Bar + + + + + +
+ Hero Section + +
+
+
+ Servise Section +
+ +
+
+ About me Section +
+ + + \ No newline at end of file diff --git a/Navigation Bar/script.js b/Navigation Bar/script.js new file mode 100644 index 0000000..d9e63bb --- /dev/null +++ b/Navigation Bar/script.js @@ -0,0 +1,83 @@ +let nav_btn = document.getElementById("nav-btn"); +let nav = document.querySelector("nav"); +let navlist = document.querySelector('.navbar-list'); + + +// console.log(nav_btn) + + + + + + + +// console.log(navlist) + + + + + +var navopen = 0; + +// console.log(navopen); + + +nav_btn.addEventListener('click', () => { + // open.style.display = none; + // open.style.display = "none"; + // nav.style.display = "none"; + + + // nav.style.height = '100%'; + // navlist.style.display = "none"; + // nav_btn.style.display = "none"; + + + + if (navopen == 0) { + nav.style.height = '100vh'; + // nav_btn.style.display = "none"; + console.log(navopen); + nav_btn.classList.remove("fa-bars"); + nav_btn.classList.add("fa-xmark"); + + + navlist.style.display = "flex"; + // close_nav.style.display = "none"; + + // console.log(navlist) + + navopen = 1; + + + + + } + else { + // nav.classList + nav_btn.classList.add("fa-bars"); + nav_btn.classList.remove("fa-xmark"); + nav.style.height = 'auto'; + navlist.style.display = "none"; + + // nav_btn.style.display = "block"; + // close_nav.style.display = "block"; + navopen = 0; + + + + + } + + + + + + +}) + + +// music.addEventListener('timeupdate', () => { +// progress = parseInt((music.currentTime / music.duration) * 100); +// myProgressbar.value = progress; +// }) \ No newline at end of file diff --git a/Navigation Bar/style.css b/Navigation Bar/style.css new file mode 100644 index 0000000..2e565d8 --- /dev/null +++ b/Navigation Bar/style.css @@ -0,0 +1,151 @@ +*{ + margin: 0; + padding: 0; +} + +nav{ + display: flex; + align-items: center; + height: 7vh; + justify-content: space-between; + background-color: blueviolet; + color: white; + +} + +.navbar-list{ + display: flex; + gap: 18px; +} + +.navbar-list> li{ + display: inline; + +} + +.sec{ + display: flex; + width: 100vw; + height: 100vh; + background-color: rgb(183, 217, 13); + align-items: center; + justify-content: center; + color: white; + +} + +.mobile-navbar-btn{ + + display: none; + gap: 12px; + cursor: pointer; + color: black; + cursor: pointer; + margin: 0px 45px; + + +} + +.navbar-list{ + display: flex; + gap: 18px; +} + +.navbar-list> li{ + display: inline; + font-size: 2rem; + +} + + + +.mobile-nav-icon{ + font-size: 2em; + line-height: .03125em + + + + +} + +.mobile-nav-icon[name="close-outline"]{ + display: none; +} + +@media screen and (max-width:600px) { + +.mobile-navbar-btn { + + display: flex; + justify-content: right; + position: absolute; + top: 0; + padding: 12px 12px; + + width: 100%; + gap: 12px; + background-color: rgb(211, 35, 35); + + + +} + +.mobile-navbar-btn > ion-icon { + + margin-right: 30px; + border: 2px solid black; + + + + +} + +.mobile-navbar-btn > i{ + padding: 5px; + + margin-right: 30px; + border: 2px solid black; + + + + +} + + +.logo{ + display: none; +} + + +nav{ + position: absolute; + width: 100%; + /* display: none; */ + align-items: center; + justify-content: center; + height: auto; + top: 0; + left: 0; + + +} + +.navbar-list{ + + display: none; + + flex-direction: column; +} + +.navbar-list> li{ + /* display: none; */ + + + +} + + + + + +} \ No newline at end of file