fix(navbar): Scroll animation

This commit is contained in:
Tibo De Peuter 2025-11-11 18:52:13 +01:00
parent af17f8b299
commit 3e35b6b9bf
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
2 changed files with 10 additions and 6 deletions

View file

@ -19,8 +19,6 @@ function getNavBar() {
position: sticky;
top: 0;
z-index: 1001;
transition: transform calc(2* var(--animation-duration)) ease;
}
.menu-toggle {
@ -36,7 +34,7 @@ function getNavBar() {
.menu-toggle.hidden {
display: none;
}
/* Collapsed menu */
.bar {
display: flex;
@ -45,6 +43,14 @@ function getNavBar() {
background-color: var(--background-color);
}
@media (prefers-reduced-motion: no-preference) {
.bar {
transform: translateY(0);
transition: transform var(--animation-duration) ease;
will-change: transform;
}
}
.bar.hidden {
transform: translateY(-100%);
}
@ -62,8 +68,6 @@ function getNavBar() {
background-color: var(--background-color);
text-transform: uppercase;
transition: opacity var(--animation-duration);
}
.menu.open {

View file

@ -175,7 +175,7 @@ button:hover .icon {
footer {
width: 100%;
bottom: 2vh;
padding: 10% 0;
padding: var(--gap) 0;
font-size: small;