hovertile
Version:
A port of Mary Lou's hover tiles to React
65 lines (55 loc) • 1.39 kB
CSS
figure.oscar {
background: -webkit-linear-gradient(45deg, #22682a 0%, #9b4a1b 40%, #3a342a 100%);
background: linear-gradient(45deg, #22682a 0%,#9b4a1b 40%,#3a342a 100%);
}
figure.oscar img {
opacity: 0.9;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
figure.oscar figcaption {
padding: 3em;
background-color: rgba(58,52,42,0.7);
-webkit-transition: background-color 0.35s;
transition: background-color 0.35s;
}
figure.oscar figcaption::before {
position: absolute;
top: 30px;
right: 30px;
bottom: 30px;
left: 30px;
border: 1px solid #fff;
content: '';
}
figure.oscar .content {
margin: 20% 0 10px 0;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: translate3d(0,100%,0);
transform: translate3d(0,100%,0);
}
figure.oscar figcaption::before,
figure.oscar .hoverContent {
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: scale(0);
transform: scale(0);
}
figure.oscar:hover .content {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
figure.oscar:hover figcaption::before,
figure.oscar:hover .hoverContent {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
figure.oscar:hover figcaption {
background-color: rgba(58,52,42,0);
}
figure.oscar:hover img {
opacity: 0.4;
}