Your browser does not support the CSS View Transition API 😢

Welcome to Page 2

This is the CSS used to acheive our animation.

With the addition of this custom CSS, note some of the layout issues. For instance, the way the transitioning page overlaps the sticky header.

Note: as of this writing, view transitions don't seem to support the use of the translate property; it only works with the original transform syntax.


main {
	view-transition-name: main;
}

@keyframes flipIn {
	from {
		opacity: 0;
		scale: 0.5;
		transform: translate(-100%, 0) scale(0.5) rotate(-359deg);
	}

	to {
		opacity: 1;
		scale: 1;
		transform: translate(0) scale(1) rotate(0);
	}
}

@keyframes flipOut {
	from {
		opacity: 1;
		transform: rotate(0) scale(1);
	}

	to {
		opacity: 0;
		transform: rotate(359deg) scale(.5) translate(1000px, 0);
	}
}

/* New stuff coming in */
:root::view-transition-new(main) {
	animation: flipIn 0.3s ease-in forwards;
	width: fit-content;
	z-index: 1;
}

/* Old stuff coming out */
:root::view-transition-old(main) {
	animation: flipOut 0.2s ease-out forwards;
	width: fit-content;
	z-index: 1;
}