refactor(section): snap-out old section-body on navigation
The explicit fade-and-slide-left OLD animation left a visible ghost of the previous section's content behind the incoming slide. Replacing it with an instant opacity:0 keeps the transition clean while preserving the NEW slide-in delay so the snap-out has a beat to register. Drops the now-dead keyframes and --slide-section-body-out token.
This commit is contained in:
@@ -96,7 +96,6 @@
|
|||||||
--duration-spring: 220ms;
|
--duration-spring: 220ms;
|
||||||
--delay-normal: 200ms;
|
--delay-normal: 200ms;
|
||||||
--slide-section-body-in: clamp(1.25rem, 5vw, 3rem);
|
--slide-section-body-in: clamp(1.25rem, 5vw, 3rem);
|
||||||
--slide-section-body-out: clamp(0.5rem, 1.5vw, 0.75rem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@theme inline {
|
@theme inline {
|
||||||
@@ -384,12 +383,13 @@
|
|||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section body slide-in from right */
|
/* Section body — snap OLD out and slide NEW in. Running an explicit OLD
|
||||||
|
* animation left a visible ghost of the previous section's content sitting
|
||||||
|
* behind the incoming slide; hiding it immediately keeps the transition
|
||||||
|
* clean and prevents the two-content overlap. */
|
||||||
::view-transition-old(section-body) {
|
::view-transition-old(section-body) {
|
||||||
animation-name: section-body-out;
|
animation: none;
|
||||||
animation-duration: var(--duration-normal);
|
opacity: 0;
|
||||||
animation-timing-function: var(--ease-default);
|
|
||||||
animation-fill-mode: both;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::view-transition-new(section-body) {
|
::view-transition-new(section-body) {
|
||||||
@@ -397,20 +397,11 @@
|
|||||||
animation-duration: var(--duration-spring);
|
animation-duration: var(--duration-spring);
|
||||||
animation-timing-function: var(--ease-spring);
|
animation-timing-function: var(--ease-spring);
|
||||||
animation-fill-mode: both;
|
animation-fill-mode: both;
|
||||||
|
/* Hold the start-state for this delay before the slide-in begins — gives
|
||||||
|
* the snap-out a beat to register visually before new content arrives. */
|
||||||
animation-delay: var(--delay-normal);
|
animation-delay: var(--delay-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes section-body-out {
|
|
||||||
from {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateX(0) scale(1);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(calc(-1 * var(--slide-section-body-out))) scale(0.98);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes section-body-in {
|
@keyframes section-body-in {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user