Skip to content

Commit

Permalink
add header responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
lvb2104 committed Aug 21, 2024
1 parent 3330917 commit 4793535
Show file tree
Hide file tree
Showing 3 changed files with 1,165 additions and 750 deletions.
97 changes: 97 additions & 0 deletions assets/css/responsive.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/* PC */
@media screen and (min-width: 992px) {
.mobile-header {
display: none;
}

.show-on-mobile {
display: none;
}
}

/* Avoid overlapping code */
/* Tablet and mobile */
@media screen and (max-width: 991px) {
.navbar {
position: relative;
}

.navbar .logo {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.navbar ul {
display: none;
}

.toggle-menu svg {
width: 24px;
color: #666;
}

.menu-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 1;
opacity: 0;
visibility: hidden;
transition: 0.25s ease;
}

.menu-drawer {
padding: 60px;
position: fixed;
inset: 0 40% 0 0;
background: #fff;
z-index: 2;
transform: translateX(-100%);
transition: 0.25s ease;
font-weight: 500;
}

.menu-drawer ul {
margin-top: 32px;
}

.menu-drawer ul a {
display: block;
color: #333;
padding: 14px 0;
}

.menu-checkbox:checked ~ .menu-overlay {
opacity: 1;
visibility: visible;
}

.menu-checkbox:checked ~ .menu-drawer {
transform: translateX(0);
}

.separate {
border-top: 1px solid #ebebeb;
}
}

/* Tablet */
@media screen and (min-width: 768px) and (max-width: 991px) {
.show-on-mobile {
display: none;
}
}

/* Mobile */
@media screen and (max-width: 767px) {
.menu-drawer {
inset: 0 25% 0 0;
padding: 40px;
}

.navbar .actions {
display: none;
}
}
Loading

0 comments on commit 4793535

Please sign in to comment.