adsscale-pro / style.css
OShayL's picture
Create mobile menu for Hamburger Drawer
061b9d4 verified
Raw History Blame Contribute Delete
3.83 kB
/* Hamburger Menu Icon Animation */
.hamburger-icon {
width: 18px;
height: 14px;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
transition: all 0.3s ease;
}
.hamburger-line {
width: 100%;
height: 2px;
background: #e5e7eb;
border-radius: 1px;
transition: all 0.3s ease;
transform-origin: center;
}
/* Hamburger to X animation */
#menuToggle.active .hamburger-line:nth-child(1) {
transform: translateY(6px) rotate(45deg);
}
#menuToggle.active .hamburger-line:nth-child(2) {
opacity: 0;
transform: scaleX(0);
}
#menuToggle.active .hamburger-line:nth-child(3) {
transform: translateY(-6px) rotate(-45deg);
}
/* Mobile Hamburger Drawer Styles */
.mobile-drawer-panel {
box-shadow: -20px 0 40px rgba(0,0,0,0.4);
}
/* Drawer entrance animations */
.mobile-drawer-panel.translate-x-full {
transform: translateX(100%);
}
.mobile-drawer-panel:not(.translate-x-full) {
transform: translateX(0);
}
/* Enhanced mobile navigation styles */
@media (max-width: 767px) {
.mobile-nav-link {
position: relative;
overflow: hidden;
transform: translateZ(0);
}
.mobile-nav-link::before {
content: '';
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 0;
background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(6,182,212,0.12) 100%);
transition: width 0.3s ease;
z-index: -1;
}
.mobile-nav-link:hover::before {
width: 100%;
}
.mobile-nav-link:active {
transform: translateX(2px) scale(0.98);
}
}
/* Enhanced blue gradient for mobile CTA */
.mobile-menu-cta {
background: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #3b82f6 100%);
background-size: 200% 200%;
animation: gradientShift 3s ease infinite;
box-shadow: 0 10px 30px rgba(99,102,241,0.4), 0 6px 16px rgba(6,182,212,0.3);
position: relative;
overflow: hidden;
}
.mobile-menu-cta::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.6s ease;
}
.mobile-menu-cta:hover::before {
left: 100%;
}
.mobile-menu-cta:hover {
transform: translateY(-2px);
box-shadow: 0 15px 40px rgba(99,102,241,0.5), 0 8px 20px rgba(6,182,212,0.4);
}
@keyframes gradientShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* Backdrop animation */
#mobileMenu:not(.hidden) #mobileMenuBackdrop {
animation: backdropFadeIn 0.3s ease-out;
}
@keyframes backdropFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Ensure proper mobile spacing */
@media (max-width: 640px) {
.pt-28 {
padding-top: 6rem;
}
/* Prevent body scroll when drawer is open */
body.drawer-open {
overflow: hidden;
position: fixed;
width: 100%;
}
}
/* Drawer panel content animations */
.mobile-drawer-panel .mobile-nav-link {
opacity: 0;
transform: translateX(20px);
animation: slideInRight 0.3s ease forwards;
}
.mobile-drawer-panel .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-drawer-panel .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-drawer-panel .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-drawer-panel .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
@keyframes slideInRight {
to {
opacity: 1;
transform: translateX(0);
}
}
/* Prevent content jumping during drawer open/close */
.mobile-drawer-panel {
will-change: transform;
}