-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeatureProduct.js
More file actions
117 lines (111 loc) · 2.82 KB
/
FeatureProduct.js
File metadata and controls
117 lines (111 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { useProductContext } from "../context/ProductContext";
import styled from "styled-components";
import Product from "./Product";
import Spinner from "./Spinner";
const FeatureProduct = () => {
const { isLoading, featureProducts } = useProductContext();
if (isLoading) {
return <div> <Spinner></Spinner></div>;
}
return (
<Wrapper className="section">
<div className="common-heading" style={{backgroundColor:"#040166",marginTop:"-50px",padding:"1rem",textAlign:"center",textDecoration:"underline",color:"white"}}>Our Best Products</div>
<div className="container">
<div className="grid grid-three-column">
{featureProducts.map((curElem) => {
return <Product key={curElem.id} {...curElem} />;
})}
</div>
</div>
</Wrapper>
);
};
const Wrapper = styled.section`
padding: 9rem 0;
background-color: ${({ theme }) => theme.colors.bg};
.container {
max-width: 120rem;
}
figure {
width: auto;
display: flex;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
transition: all 0.5s linear;
&::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 0%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
transition: all 0.2s linear;
cursor: pointer;
}
&:hover::after {
width: 100%;
}
&:hover img {
transform: scale(1.2);
}
img {
max-width: 90%;
margin-top: 1.5rem;
height: 20rem;
transition: all 0.2s linear;
}
.caption {
position: absolute;
top: 5%;
right: 5%;
text-transform: uppercase;
background-color: ${({ theme }) => theme.colors.bg};
color: ${({ theme }) => theme.colors.helper};
padding: 0.8rem 2rem;
font-size: 1.2rem;
border-radius: 2rem;
}
}
.card {
background-color: #fff;
border-radius: 1rem;
.card-data {
padding: 0 2rem;
}
.card-data-flex {
margin: 2rem 0;
display: flex;
justify-content: space-between;
align-items: center;
}
h3 {
color: ${({ theme }) => theme.colors.text};
text-transform: capitalize;
}
.card-data--price {
color: ${({ theme }) => theme.colors.helper};
}
.btn {
margin: 2rem auto;
background-color: rgb(0 0 0 / 0%);
border: 0.1rem solid rgb(98 84 243);
display: flex;
justify-content: center;
align-items: center;
&:hover {
background-color: rgb(98 84 243);
}
&:hover a {
color: #fff;
}
a {
color: rgb(98 84 243);
font-size: 1.4rem;
}
}
}
`;
export default FeatureProduct;