-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
225 lines (211 loc) · 6.7 KB
/
index.html
File metadata and controls
225 lines (211 loc) · 6.7 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://unpkg.com/react@16.3.1/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.3.1/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/react-router-dom@5.0.0/umd/react-router-dom.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
crossorigin="anonymous"
/>
<title>Thinking in React</title>
</head>
<body>
<!-- Styles -->
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
* {
padding: 0;
margin: 0;
font-family: "Poppins", sans-serif;
font-weight: 500;
}
.product-image-tile {
position: relative;
background: url(./img/tesla.jpg);
border-radius: 10px;
overflow: hidden;
width: 400px;
height: 600px;
}
.product-image {
position: absolute;
height: 600px;
top: 50%;
left: 50%;
z-index: 2;
transform: translate(-50%, -50%);
border-radius: 15px;
}
.go-to-product {
position: absolute;
border-radius: 10px 0 10px 0;
padding: 15px 20px;
bottom: 0;
right: 0;
z-index: 3;
}
.go-to-product > p {
font-size: 16px;
font-weight: 500;
margin: 0 0 0 0;
}
</style>
<!-- root -->
<div id="root"></div>
<!-- React -->
<script type="text/babel">
//product image tile
const ProductImageTile = () => {
return (
<div class="product-image-tile">
<img class="product-image" src="./img/tesla.jpg" alt="tesla" />
<div class="btn go-to-product bg-light d-flex justify-content-center align-items-baseline">
<p class="text-warning lead">
Go to product <i class="fas fa-arrow-right"></i>
</p>
</div>
</div>
);
};
const UserCard = () => {
return <h1>User Card</h1>;
};
//navbar component
const NavBar = () => {
return (
<nav class="navbar py-3 navbar-expand-lg navbar-light bg-white fs-6 fw-bold">
<div class="container-fluid px-5 d-flex align-items-center">
<a class="navbar-brand me-5" href="#">
<img src="./img/amazon.png" width="50" alt="Brand Logo" />
</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="#">
<i class="fas fa-th-large fs-5 mx-2"> </i>
Catalog
</a>
</li>
<li class="nav-item mx-3">
<a class="nav-link" href="#">
<i class="fas fa-certificate fs-5 mx-2"></i>
Best deals
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fas fa-briefcase fs-5 mx-2"></i>
Become seller
</a>
</li>
</ul>
</div>
</div>
</nav>
);
};
//hero section
const HeroSection = () => {
return (
<div class="container-fluid bg-light py-5">
<div class="container-sm">
<div class="d-flex flex-row justify-content-around">
<ProductDetails />
<ProductImageTile />
</div>
</div>
</div>
);
};
//product details
const ProductDetails = () => {
return (
<div>
<ProductDescriptionBox />
<ProductPriceBox />
<GoToShop />
</div>
);
};
const ProductDescriptionBox = () => {
return (
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
<p class="card-text">
Some quick example text to build on the card title and make up
the bulk of the card's content.
</p>
</div>
</div>
);
};
const ProductPriceBox = () => {
return (
<div>
<h1>Product Price Box</h1>
</div>
);
};
const GoToShop = () => {
return (
<div>
<ProductImagesBox />
</div>
);
};
const ProductImagesBox = () => {
return (
<div>
<h1>Product Images Box</h1>
</div>
);
};
class App extends React.Component {
render() {
return (
<div>
<NavBar />
<HeroSection />
</div>
);
}
}
ReactDOM.render(<App />, document.querySelector("#root"));
</script>
<script>
feather.replace();
</script>
</body>
</html>