refine: smart nav thresholds and improved transitions
This commit is contained in:
@ -154,7 +154,7 @@ const onScroll = () => {
|
|||||||
scrolled.value = currentScrollY > 40
|
scrolled.value = currentScrollY > 40
|
||||||
|
|
||||||
// Lógica de ocultar/mostrar según dirección
|
// Lógica de ocultar/mostrar según dirección
|
||||||
if (currentScrollY > lastScrollY && currentScrollY > 150) {
|
if (currentScrollY > lastScrollY && currentScrollY > 80) {
|
||||||
// Scroll hacia abajo y ya pasamos el hero: ocultar
|
// Scroll hacia abajo y ya pasamos el hero: ocultar
|
||||||
navVisible.value = false
|
navVisible.value = false
|
||||||
} else {
|
} else {
|
||||||
@ -204,11 +204,14 @@ const scrollToInstall = () =>
|
|||||||
.nav {
|
.nav {
|
||||||
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
|
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
|
||||||
height: 160px; display: flex; align-items: center; padding: 0 24px;
|
height: 160px; display: flex; align-items: center; padding: 0 24px;
|
||||||
transition: all .4s cubic-bezier(0.4, 0, 0.2, 1);
|
transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
background .4s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
height .4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
will-change: transform, background, height;
|
will-change: transform, background, height;
|
||||||
}
|
}
|
||||||
.nav--hidden {
|
.nav--hidden {
|
||||||
transform: translateY(-100%);
|
transform: translateY(-100%);
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.nav--solid {
|
.nav--solid {
|
||||||
background: rgba(255,255,255,.95);
|
background: rgba(255,255,255,.95);
|
||||||
@ -438,7 +441,7 @@ const scrollToInstall = () =>
|
|||||||
/* Tablet + */
|
/* Tablet + */
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.nav { padding: 0 40px; }
|
.nav { padding: 0 40px; }
|
||||||
.hero { padding: 100px 48px 88px; }
|
.hero { padding: 180px 48px 88px; }
|
||||||
.nav__link { display: block; }
|
.nav__link { display: block; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user