Skip to content

Instantly share code, notes, and snippets.

@hayes0724
Created October 11, 2020 21:51
Show Gist options
  • Save hayes0724/0c796db686af5fcb79c661a51745e4ff to your computer and use it in GitHub Desktop.
Save hayes0724/0c796db686af5fcb79c661a51745e4ff to your computer and use it in GitHub Desktop.
Crossfade square image
.image__wrapper {
display: block;
position: relative;
height: 100%;
width: 100%;
padding: 50%;
img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0;
transition: opacity 300ms ease-in;
transition-delay: 150ms;
&.active {
opacity: 1;
transition: opacity 300ms ease-in;
transition-delay: 0ms;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment