Skip to content

Commit

Permalink
add tranition formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilverstein committed Dec 19, 2024
1 parent 6352aad commit 49740be
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/wp-content/themes/twentyseventeen/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,40 @@ html {
navigation: auto;
}

/* Mark the `<main>` element as the element that should transition */
#content {
view-transition-name: my-main-content;
}

/* Apply animations to the snapshots */
/* Note, `main-content` is the view transition name specified in the previous CSS block */
::view-transition-old(my-main-content) {
animation: 500ms ease-out both slide-out;
}

::view-transition-new(my-main-content) {
animation: 500ms ease-out both slide-in;
}

/* Define the animations */
@keyframes slide-out {
from {
transform: translateX(0);
}
to {
transform: translateX(-100%);
}
}

@keyframes slide-in {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}

body {
margin: 0;
}
Expand Down

0 comments on commit 49740be

Please sign in to comment.