hovertile
Version:
A port of Mary Lou's hover tiles to React
79 lines (66 loc) • 1.65 kB
CSS
figure.julia {
background: #2f3238;
}
figure.julia img {
max-width: none;
height: 400px;
-webkit-transition: opacity 1s, -webkit-transform 1s;
transition: opacity 1s, transform 1s;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
figure.julia figcaption {
text-align: left;
}
figure.julia .content {
position: relative;
padding: 0.5em 0;
}
figure.julia .hoverContent {
display: inline-block;
margin: 0 0 0.25em;
padding: 0.4em 1em;
background: rgba(255,255,255,0.9);
color: #2f3238;
text-transform: none;
font-weight: 500;
font-size: 75%;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(-360px,0,0);
transform: translate3d(-360px,0,0);
}
figure.julia .hoverContent:first-child {
-webkit-transition-delay: 0.15s;
transition-delay: 0.15s;
}
figure.julia .hoverContent:nth-of-type(2) {
-webkit-transition-delay: 0.1s;
transition-delay: 0.1s;
}
figure.julia .hoverContent:nth-of-type(3) {
-webkit-transition-delay: 0.05s;
transition-delay: 0.05s;
}
figure.julia:hover .hoverContent:first-child {
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
figure.julia:hover .hoverContent:nth-of-type(2) {
-webkit-transition-delay: 0.05s;
transition-delay: 0.05s;
}
figure.julia:hover .hoverContent:nth-of-type(3) {
-webkit-transition-delay: 0.1s;
transition-delay: 0.1s;
}
figure.julia:hover img {
opacity: 0.4;
-webkit-transform: scale3d(1.1,1.1,1);
transform: scale3d(1.1,1.1,1);
}
figure.julia:hover .hoverContent {
opacity: 1;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}