<div id="product-{{id}}" class="product" style="background-color: {{color}}">
<a class="product-link" href="javascript://">
<button class="product-buy">Buy <span>now</span></button>
<div class="product-content">
<p class="product-pic"><img src="https://contestimg.wish.com/api/webimage/570b12842dffa05902abb95b-contest.jpg?cache_buster=da0d5e09da0c93a940107fe4e3dd842e"></p>
<p class="product-title">Men's spring pants</p>
<p class="product-size">L</p>
<p class="product-price">$9.99</p>
</div>
</a>
</div>
$anim: .2s;
.product {
width: 200px;
height: 150px;
box-sizing: border-box;
background: #ddeaea;
background-image: url('../img/gas_plaster.png');
position: relative;
overflow: hidden;
&:hover {
background-color: #a6bbbb;
a {}
}
-webkit-transition: all $anim;
transition: all $anim;
}
.product-link {
@extend .box;
color: #4e4e4e;
text-decoration: none;
font-size: 12px;
padding: 10px;
display: block;
&:hover {
background: rgba(255, 255, 255, 0.25);
.product-content {
// border: 3px solid gray;
// padding: 5px;
// border-radius: 7px;
}
.product-face {
margin: 5px 0 0 5px;
font-size: 30px;
color: black;
}
.product-buy {
bottom: 10px;
right: 10px;
}
.product-size {
top: -100%;
left: -100%;
}
.product-price {
bottom: -100%;
left: -100%;
}
.product-date {
top: -100%;
right: -100%;
}
}
}
.product-content {
-webkit-transition: all $anim;
transition: all $anim;
-webkit-transition-delay: $anim;
/* Safari */
transition-delay: $anim;
border: 3px solid transparent;
height: 100%;
box-sizing: border-box;
}
.product-buy {
@extend .product-data;
-webkit-transition: all $anim ease-out;
transition: all $anim ease-out;
bottom: -100%;
right: -100%;
border: none;
background: gray;
padding: 5px;
overflow: hidden;
font-size: 20px;
border-radius: 5px;
font-family: 'Delius Swash Caps', sans-serif;
cursor: pointer;
span {
margin-left: -35px;
-webkit-transition: all $anim ease-in;
transition: all $anim ease-in;
-webkit-transition-delay: $anim;
/* Safari */
transition-delay: $anim;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
opacity: 0;
}
&:hover {
span {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
opacity: 1;
margin-left: 0;
// display: block;
}
&~.product-content {
border: 3px solid gray;
padding: 5px;
border-radius: 7px;
}
&~.product-content .product-face {
font-size: 60px;
color: rgba(0, 0, 0, 0.1);
}
&~.product-content .product-size {
color: black;
font-size: 14px;
left: 20px !important;
top: 20px !important;
}
&~.product-content .product-price {
color: black;
font-size: 14px;
bottom: 20px !important;
left: 20px !important;
}
&~.product-content .product-date {
color: black;
font-size: 14px;
top: 20px !important;
right: 20px !important;
}
}
}
.product-data {
-webkit-transition: all $anim;
transition: all $anim;
position: absolute;
}
.product-face {
-webkit-transition: all $anim;
transition: all $anim;
text-align: center;
margin-top: 56px;
white-space: nowrap;
font-size: 20px;
font-family: 'Roboto Condensed';
}
.product-size {
@extend .product-data;
top: 10px;
left: 10px;
}
.product-price {
@extend .product-data;
bottom: 10px;
left: 10px;
}
.product-title {
@extend .product-data;
top: 10px;
right: 10px;
}
.advert {
@extend .box;
padding-top: 15px;
}
.advert img {
width: 100%;
}
.loading,
.end-of-catalogue {
padding: 10px;
text-align: center;
font-size: 22px;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.