hovertile
Version:
A port of Mary Lou's hover tiles to React
59 lines (50 loc) • 1.18 kB
CSS
figure.marley figcaption {
text-align: right;
}
figure.marley .content,
figure.marley .hoverContent {
position: absolute;
right: 30px;
left: 30px;
padding: 10px 0;
}
figure.marley .hoverContent {
bottom: 30px;
line-height: 1.5;
-webkit-transform: translate3d(0,100%,0);
transform: translate3d(0,100%,0);
}
figure.marley .content {
top: 30px;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: translate3d(0,20px,0);
transform: translate3d(0,20px,0);
}
figure.marley:hover .content {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
figure.marley .content::after {
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 4px;
background: #fff;
content: '';
-webkit-transform: translate3d(0,40px,0);
transform: translate3d(0,40px,0);
}
figure.marley .content::after,
figure.marley .hoverContent {
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
}
figure.marley:hover .content::after,
figure.marley:hover .hoverContent {
opacity: 1;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}