Skip to content

Commit

Permalink
Responsiveness Added
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhaalu-69 committed Jun 28, 2023
1 parent 580921e commit e0168f8
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
46 changes: 46 additions & 0 deletions css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,49 @@ span {
font-size: 2.4rem;
color: var(--second-bg-color);
}


/* BREAKPOINTS */

@media (max-width: 1200px) {
html {
font-size: 55%;
}
}
@media (max-width: 991px) {
.header {
padding: 2rem 3%;
}
section {
padding: 10rem 3% 2rem;
}
.footer {
padding: 2rem 3%;
}
}
@media (max-width: 768px) {
#menu-icon {
display: block;
}
.navbar {
position: absolute;
top: 100%;
left: 0;
width: 100%;
padding: 1rem 3%;
background: var(--bg-color);
border-top: 0.1rem solid rgba(0, 0, 0, 0.2);
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
display: none;
}
.navbar a {
display: block;
font-size: 2rem;
margin: 3rem 0 ;
}
}

/* Utility Classes */
.active {
display: block;
}
10 changes: 10 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Active section manager
let navLinks = document.querySelectorAll('header nav a');
let sections = document.querySelectorAll('section');

Expand All @@ -16,3 +17,12 @@ window.onscroll = () => {
}
});
};

// toggle icon navbar
let menuIcon = document.querySelector('#menu-icon');
let navbar = document.querySelector('.navbar');

menuIcon.onclick = function () {
menuIcon.classList.toggle('bx-x');
navbar.classList.toggle('active');
};

0 comments on commit e0168f8

Please sign in to comment.