-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
380 lines (369 loc) · 12.9 KB
/
index.html
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Elami Publications</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f2f5;
color: #333;
}
.part1, .part2, .part3 {
padding: 20px;
margin: 20px auto;
width: 80%;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.part1 {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
padding: 20px;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.part1 img {
max-width: 150px;
border-radius: 8px;
flex-shrink: 0;
}
.part1-content {
flex-grow: 1;
text-align: center;
padding: 0 20px;
}
.part1-content h2 {
margin-bottom: 10px;
color: #007bff;
font-size: 1.2em;
}
.part1-content p {
margin: 5px 0;
line-height: 1.6;
color: #333;
font-size: 1.1em;
font-weight: 500;
}
.highlight {
color: #007bff;
font-weight: bold;
}
.part2 {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
}
.book {
position: relative;
text-align: center;
padding: 15px;
border: 1px solid #ddd;
border-radius: 8px;
transition: transform 0.3s, box-shadow 0.3s;
}
.book:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.book img {
max-width: 100%;
height: auto;
border-radius: 8px;
}
.book h3 {
margin: 10px 0;
font-size: 1.1em;
color: #007bff;
}
.add-to-cart {
position: absolute;
bottom: 10px;
right: 10px;
font-size: 1.2em;
color: #28a745;
cursor: pointer;
transition: color 0.3s;
}
.add-to-cart:hover {
color: #218838;
}
.part3 {
text-align: center;
}
.social-icons a {
margin: 0 10px;
text-decoration: none;
color: #333;
font-size: 1.5em;
transition: color 0.3s;
}
.social-icons a:hover {
color: #007bff;
}
.cart-icon {
position: absolute;
top: 20px;
right: 20px;
font-size: 1.5em;
cursor: pointer;
color: #333;
transition: color 0.3s;
display: flex;
align-items: center;
}
.cart-icon:hover {
color: #007bff;
}
.cart-count {
background-color: #ff0000;
color: #fff;
border-radius: 50%;
padding: 2px 6px;
font-size: 0.8em;
margin-left: 5px;
}
.cart-details {
display: none;
position: fixed;
top: 60px;
right: 20px;
width: 300px;
max-width: 90%;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
padding: 20px;
z-index: 1000;
}
.cart-details h2 {
margin-bottom: 15px;
font-size: 1.5em;
color: #007bff;
}
.cart-details ul {
list-style-type: none;
padding: 0;
margin: 0;
}
.cart-details li {
padding: 10px;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
}
.cart-details p {
font-size: 1.2em;
margin-top: 15px;
}
.cart-details button {
background-color: #28a745;
color: #fff;
border: none;
padding: 10px;
border-radius: 5px;
cursor: pointer;
width: 100%;
margin-top: 10px;
}
.cart-details button:hover {
background-color: #218838;
}
/* Responsive Styles */
@media (max-width: 768px) {
.part1 {
flex-direction: column;
align-items: center;
text-align: center;
}
.part1 img {
margin-bottom: 15px;
display: block;
margin-left: auto;
margin-right: auto;
}
.part1-content {
padding: 10px 0;
text-align: center;
width: 100%;
}
.part1, .part2, .part3 {
width: 90%;
}
.part2 {
grid-template-columns: repeat(2, 1fr) !important;
}
.cart-details {
right: 5%;
}
.add-to-cart {
font-size: 1em;
}
}
@media (max-width: 480px) {
.part1 {
flex-direction: column;
align-items: flex-start;
}
.part2 {
grid-template-columns: 1fr;
}
.cart-icon {
font-size: 1.2em;
}
.cart-details {
width: 95%;
right: 2.5%;
}
}
</style>
</head>
<body>
<div class="part1">
<img src="images/coverpage.png" alt="Elami Publications">
<div class="part1-content">
<p>Elami is an <span class="highlight">independent publication platform</span> committed to encouraging a variety of creative pursuits in the Telugu world.</p>
</div>
<div class="part1-content">
<h2>User Reviews</h2>
<p>"This is a great book!"</p>
</div>
</div>
<div class="part2">
<div class="book" data-title="ఎమోషనల్ ప్రెగ్నెన్సీ" data-price="150">
<img src="images/emotionalpregnenacy.png" alt="Book Cover">
<h3>ఎమోషనల్ ప్రెగ్నెన్సీ</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="మనసు నుంచి మనసుకి" data-price="150">
<img src="images/manasunundimanasuki.png" alt="Book Cover">
<h3>మనసు నుంచి మనసుకి</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="నెమరేసే స్టోరీస్" data-price="150">
<img src="images/nemaresestories.png" alt="Book Cover">
<h3>నెమరేసే స్టోరీస్</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="పట్టణంలో బతుకుదామని" data-price="150">
<img src="images/pattanamlobatukudamani.png" alt="Book Cover">
<h3>పట్టణంలో బతుకుదామని</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="పంజరం" data-price="150">
<img src="images/panjaram.png" alt="Book Cover">
<h3>పంజరం</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="Book Title 6" data-price="150">
<img src="images/book6.jpg" alt="Book Cover">
<h3>Book Title 6</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="Book Title 7" data-price="150">
<img src="images/book7.jpg" alt="Book Cover">
<h3>Book Title 7</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
<div class="book" data-title="Book Title 8" data-price="150">
<img src="images/book8.jpg" alt="Book Cover">
<h3>Book Title 8</h3>
<i class="fas fa-cart-plus add-to-cart"></i>
</div>
</div>
<div class="part3">
<h2>Follow Us</h2>
<div class="social-icons">
<a href="https://www.youtube.com/@elamipublications" target="_blank"><i class="fab fa-youtube"></i></a>
<a href="https://instagram.com/elamipublications" target="_blank"><i class="fab fa-instagram"></i></a>
<a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a>
<a href="https://facebook.com/elamipublications" target="_blank"><i class="fab fa-facebook"></i></a>
<a href="mailto:[email protected]"><i class="fas fa-envelope"></i></a>
<a href="https://wa.me/1234567890" target="_blank"><i class="fab fa-whatsapp"></i></a>
</div>
</div>
<div class="cart-icon" id="cart-icon">
<i class="fas fa-shopping-cart"></i>
<span class="cart-count" id="cart-count">0</span>
</div>
<div class="cart-details" id="cart-details">
<h2>Shopping Cart</h2>
<ul id="cart-items"></ul>
<p>Total: <span id="total-price">0</span></p>
<button id="checkout-button">Checkout</button>
</div>
<script>
const cartItems = [];
const cartItemsList = document.getElementById('cart-items');
const totalPriceElement = document.getElementById('total-price');
const cartIcon = document.getElementById('cart-icon');
const cartDetails = document.getElementById('cart-details');
const cartCount = document.getElementById('cart-count');
document.querySelectorAll('.book h3').forEach(book => {
book.addEventListener('click', function() {
const bookElement = this.parentElement;
const title = bookElement.getAttribute('data-title');
const price = parseFloat(bookElement.getAttribute('data-price'));
cartItems.push({ title, price });
updateCart();
});
});
document.querySelectorAll('.add-to-cart').forEach(icon => {
icon.addEventListener('click', function(event) {
event.stopPropagation();
const bookElement = this.parentElement;
const title = bookElement.getAttribute('data-title');
const price = parseFloat(bookElement.getAttribute('data-price'));
const existingItem = cartItems.find(item => item.title === title);
if (existingItem) {
existingItem.quantity += 1;
existingItem.totalPrice += price;
} else {
cartItems.push({ title, price, quantity: 1, totalPrice: price });
}
updateCart();
});
});
function updateCart() {
cartItemsList.innerHTML = '';
let totalPrice = 0;
cartItems.forEach(item => {
const li = document.createElement('li');
li.textContent = `${item.title} - ₹${item.totalPrice.toFixed(2)} (x${item.quantity})`;
cartItemsList.appendChild(li);
totalPrice += item.totalPrice;
});
totalPriceElement.textContent = `₹${totalPrice.toFixed(2)}`;
cartCount.textContent = cartItems.reduce((acc, item) => acc + item.quantity, 0);
}
cartIcon.addEventListener('click', function(event) {
event.stopPropagation(); // Prevent the click from propagating to the document
cartDetails.style.display = cartDetails.style.display === 'none' ? 'block' : 'none';
});
document.addEventListener('click', function(event) {
if (!cartDetails.contains(event.target) && event.target !== cartIcon) {
cartDetails.style.display = 'none';
}
});
document.getElementById('checkout-button').addEventListener('click', function() {
alert('Proceeding to payment...');
// Here you can integrate a payment gateway like PayPal
});
window.addEventListener('scroll', function() {
if (cartDetails.style.display === 'block') {
cartDetails.style.display = 'none';
}
});
</script>
</body>
</html>