Last active
May 14, 2025 07:53
-
-
Save vielhuber/baa98a80a02035e5aca5f79291c99df1 to your computer and use it in GitHub Desktop.
view transition smooth animated site transitions #css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@view-transition { | |
navigation: auto; | |
} | |
@keyframes fade-in { | |
from { opacity: 0; } | |
to { opacity: 1; } | |
} | |
@keyframes fade-out { | |
from { opacity: 1; } | |
to { opacity: 0; } | |
} | |
@keyframes slide-in { | |
from { transform: translateY(100%); } | |
to { transform: translateY(0%); } | |
} | |
@keyframes slide-out { | |
from { transform: translateY(0%); } | |
to { transform: translateY(-100%); } | |
} | |
::view-transition-old(root) { | |
animation: 0.5s ease-in both fade-out; | |
} | |
::view-transition-new(root) { | |
animation: 0.5s ease-in both fade-in; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment