Customizing

root selects the old page or new page

::view-transition-old(root) {
  animation: var(--animation-slide-out-down) forwards;
}

::view-transition-new(root) {
  animation: var(--animation-slide-in-up) forwards;
}
See a demo