JSFiddle - React, Tailwind, and code Playground
by Sergey khorev
HTML
<div class="grid">
<figure class="effect-lily">
<img src="https://skb44.ru/upload/iblock/f46/f462fd08adf7e617c9e35da826f7ed6f.jpg" alt="img02">
<figcaption>
<h2>дома <span>до двухсот м<sup>2</sup></span></h2>
<p>Проекты домов из клееного бруса до двухсот квадратных метров</p>
<a href="/tipovye-proekty/doma-do-200-m2/">перейти</a>
</figcaption>
</figure>
<figure class="effect-lily">
<img src="https://skb44.ru/upload/iblock/39d/39dc23b26cb88c657c8a97e7881194a2.jpg" alt="img02">
<figcaption>
<h2>Дома <span>от двухсот м<sup>2</sup></span></h2>
<p>Проекты домов из клееного бруса от двухсот квадратных метров</p>
<a href="/tipovye-proekty/doma-ot-200-m2/">перейти</a>
</figcaption>
</figure>
<figure class="effect-lily">
<img src="https://skb44.ru/upload/resize_cache/iblock/fff/1280_1280_1/fff3c650b322fb1962cd9e380b30b349.jpg" alt="img02">
<figcaption>
<h2>Бани <span>из клееного бруса</span></h2>
<p>Типовые проекты бань из клееного бруса<br></p>
<a href="/tipovye-proekty/bani/">перейти</a>
</figcaption>
</figure>
</div>
CSS
.grid {
position: relative;
margin: 0 auto;
padding: 1em 0 1em;
max-width: 1270px;
list-style: none;
text-align: center;
}
/* Common style */
.grid figure {
position: relative;
float: left;
overflow: hidden;
margin: 10px 1%;
min-width: 310px;
max-width: 366px;
max-height: 240px;
width: 48%;
background: #353535;
text-align: center;
cursor: pointer;
}
.grid figure img {
position: relative;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.7;
}
.grid figure figcaption {
padding: 1em;
padding-top: 2.5em;
color: #fff;
text-transform: uppercase;
font-size: 1.15em;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.grid figure figcaption::before,
.grid figure figcaption::after {
pointer-events: none;
}
.grid figure figcaption,
.grid figure figcaption > a {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Anchor will cover the whole item by default */
/* For some effects it will show as a button */
.grid figure figcaption > a {
z-index: 1000;
text-indent: 200%;
white-space: nowrap;
font-size: 0;
opacity: 0;
}
.grid figure h2 {
word-spacing: -0.15em;
font-weight: 300;
}
.grid figure h2 span {
font-weight: 800;
}
.grid figure h2,
.grid figure p {
margin: 0;
}
.grid figure p {
letter-spacing: 1px;
font-size: 68.5%;
}
figure.effect-lily img {
max-width: none;
width: -webkit-calc(100% + 50px);
width: calc(100% + 10px);
opacity: 0.6;
-webkit-transition: opacity 0.45s, -webkit-transform 0.45s;
transition: opacity 0.45s, transform 0.45s;
-webkit-transform: translate3d(-4px,0, 0);
transform: translate3d(-4px,0,0);
}
figure.effect-lily figcaption {
text-align: left;
}
figure.effect-lily figcaption > div {
position: absolute;
bottom: 0;
left: 0;
padding: 2em;
width: 100%;
height: 50%;
}
figure.effect-lily h2,
figure.effect-lily p {
-webkit-transform: translate3d(0,40px,0);
transform: translate3d(0,40px,0);
}
figure.effect-lily h2 {
-webkit-transition:...