/* 1. Define the Animation Keyframes */ @keyframes menuSlideUpFade { 0% { opacity: 0; transform: translateY(25px); /* Start 25px below final position */ } 100% { opacity: 1; transform: translateY(0); } } /* 2. Initial State (Hidden and positioned below) */ .stagger-menu-container .stagger-item { /* Hide the text initially */ opacity: 0; transform: translateY(25px); /* Ensure the text is clipped so it slides up cleanly */ overflow: hidden; } /* 3. Animation Application (Triggered by 'is-active' class) */ /* The animation will run only when the parent container has the 'is-active' class */ .stagger-menu-container.is-active .stagger-item { /* Apply the animation */ animation: menuSlideUpFade 0.7s forwards; /* Use the custom CSS variable for delay (set by JS) */ animation-delay: var(--stagger-delay); /* Use the premium easing curve for a smooth stop */ animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
Skip to content