make it better

This commit is contained in:
Ray
2017-07-24 18:40:56 +01:00
commit 586fe2bec3
38 changed files with 4127 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
.product {
cursor: pointer;
position: relative;
padding-bottom: 100px;
border-radius: 5px;
overflow: hidden;
-webkit-transition: all 500ms ease-out;
-moz-transition: all 500ms ease-out;
-o-transition: all 500ms ease-out;
transition: all 500ms ease-out;
}
.product:hover {
box-shadow: 0px 13px 21px -5px rgba(0, 0, 0, 0.2);
}
.product img {
width: 100%;
}
.stats-container {
background: #fff;
padding: 25px 15px;
position: absolute;
bottom: 0;
width: 100%;
}
.stats-container .product_name {
font-size: 22px;
color: #393c45;
}
.stats-container p {
font-size: 16px;
color: #b1b1b3;
margin: 0;
}
.stats-container .product_price {
float: right;
color: #48cfad;
font-size: 22px;
font-weight: 600;
}
.image_overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #48cfad;
opacity: 0;
-webkit-transition: all 200ms ease-out;
-moz-transition: all 200ms ease-out;
-o-transition: all 200ms ease-out;
transition: all 200ms ease-out;
}
.product.compare .image_overlay,
.product:hover .image_overlay {
opacity: 0.7;
}
.view_details {
position: absolute;
top: 112px;
left: 50%;
margin-left: -85px;
border: 2px solid #fff;
color: #fff;
font-size: 19px;
text-align: center;
text-transform: uppercase;
font-weight: 700;
padding: 10px 0;
width: 172px;
opacity: 0;
-webkit-transition: all 200ms ease-out;
-moz-transition: all 200ms ease-out;
-o-transition: all 200ms ease-out;
transition: all 200ms ease-out;
}
.view_details:hover {
background: #fff;
color: #48cfad;
cursor: pointer;
}
.product:hover .view_details {
opacity: 1;
width: 152px;
font-size: 15px;
margin-left: -75px;
top: 150px;
-webkit-transition: all 200ms ease-out;
-moz-transition: all 200ms ease-out;
-o-transition: all 200ms ease-out;
transition: all 200ms ease-out;
}

View File

@@ -0,0 +1,34 @@
import React from 'react'
import './index.css'
// const Product = ({product, compare}) =>
// <div key={product.id} className="col-3 product-card">
// <Card inverse
// onClick={() => compare(product)}
// color={product.compare ? "success" : "primary"}
// >
// <CardBlock>
// <CardTitle>{product.name}</CardTitle>
// </CardBlock>
// </Card>
// </div>;
const Product = ({product, compare}) =>
<div key={product.id} className="col-3">
<div className={"product " + (product.compare ? "compare" : "")} >
<img src={product.image} alt={product.name} />
<div className="image_overlay"></div>
<div className="view_details" onClick={() => compare(product)}>
{product.compare ? "Remove" : "Compare"}
</div>
<div className="stats">
<div className="stats-container">
<span className="product_price">{product.price}</span>
<span className="product_name">{product.name}</span>
<p>Men's running shirt</p>
</div>
</div>
</div>
</div>;
export default Product;