JSFiddle - React, Tailwind, and code Playground
by Ngoc Hieu
HTML
<div id="effect8" class="image">
<img src="http://1.bp.blogspot.com/-JjtYL1YZ14M/UtFlRL-w4vI/AAAAAAAAAEQ/xRJVh2astLE/s1600/effect-8.jpg" />
<div class="detail">
<h1 class="title">Hiệu ứng 8</h1>
<p>Chúng ta vẫn biết rằng, làm việc với một đoạn văn bản dễ đọc và rõ nghĩa dễ gây rối trí</p>
<a href="#">Xem tiếp</a>
</div>
</div>
CSS
.image{
width: 360px;
float: left;
margin: 10px;
position: relative;
overflow: hidden;
height: 240px;
}
.image img{
width: 100%;
}
h1.title{
text-transform: uppercase;
font-size: 25px;
font-weight: bold;
line-height: 25px;
padding: 10px;
position: relative;
}
.detail{
position: absolute;
width: 100%;
height: 100%;
top:0;
left: 0;
text-align: center;
}
p{
color: #fff;
padding: 10px;
}
a{
text-decoration: none;
display: inline-block;
padding: 10px 15px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border: 1px solid #111;
}
.mask{
position: absolute;
width: 100%;
height: 100%;
top:0;
left: 0;
bottom: 0;
right: 0;
}
#effect8 .detail{
background: rgba(0,0,0,0.9);
transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
z-index: -10;
transition: all 0.5s;
-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
}
#effect8 .title{
background: rgba(255,255,255,0.9);
box-shadow: 0px 1px 3px #f1f1f1;
}
#effect8 a{
background:rgba(255,255,255,0.9);
color: rgba(0,0,0,1);
transition: all 0.5s;
-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
border: none;
}
#effect8 img{
transition: all 0.5s;
-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
}
#effect8:hover img{
transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
}
#effect8:hover .detail{
transform: rotateY(0);
-moz-transform: rotateY(0);
...