Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Last active May 14, 2025 07:53
Show Gist options
  • Save vielhuber/baa98a80a02035e5aca5f79291c99df1 to your computer and use it in GitHub Desktop.
Save vielhuber/baa98a80a02035e5aca5f79291c99df1 to your computer and use it in GitHub Desktop.
view transition smooth animated site transitions #css
@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