-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
334 lines (324 loc) · 15.9 KB
/
index.html
File metadata and controls
334 lines (324 loc) · 15.9 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ShopHub - Modern E-Commerce Store</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Stripe.js -->
<script src="https://js.stripe.com/v3/"></script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar">
<div class="container">
<div class="nav-brand">
<i class="fas fa-shopping-bag"></i>
<span>ShopHub</span>
</div>
<ul class="nav-menu">
<li><a href="#home">Home</a></li>
<li><a href="#products">Products</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<div class="nav-actions">
<button class="cart-btn" id="cartBtn">
<i class="fas fa-shopping-cart"></i>
<span class="cart-count" id="cartCount">0</span>
</button>
<div class="hamburger">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<section id="home" class="hero">
<div class="container">
<div class="hero-content">
<h1 class="hero-title">Welcome to <span class="highlight">ShopHub</span></h1>
<p class="hero-subtitle">Discover Amazing Products at Great Prices</p>
<p class="hero-description">Shop the latest trends and find everything you need in one place.</p>
<a href="#products" class="btn btn-primary">Shop Now</a>
</div>
</div>
</section>
<!-- Products Section -->
<section id="products" class="products">
<div class="container">
<h2 class="section-title">Featured Products</h2>
<div class="filter-buttons">
<button class="filter-btn active" data-category="all">All Products</button>
<button class="filter-btn" data-category="electronics">Electronics</button>
<button class="filter-btn" data-category="clothing">Clothing</button>
<button class="filter-btn" data-category="accessories">Accessories</button>
<button class="filter-btn" data-category="books">Books</button>
</div>
<div class="products-grid" id="productsGrid">
<!-- Products will be dynamically loaded here -->
</div>
</div>
</section>
<!-- Shopping Cart Sidebar -->
<div class="cart-sidebar" id="cartSidebar">
<div class="cart-header">
<h2>Shopping Cart</h2>
<button class="close-cart" id="closeCart">
<i class="fas fa-times"></i>
</button>
</div>
<div class="cart-items" id="cartItems">
<div class="empty-cart">
<i class="fas fa-shopping-cart"></i>
<p>Your cart is empty</p>
</div>
</div>
<div class="cart-footer">
<div class="cart-total">
<strong>Total: $<span id="cartTotal">0.00</span></strong>
</div>
<button class="btn btn-primary checkout-btn" id="checkoutBtn">Checkout</button>
</div>
</div>
<div class="cart-overlay" id="cartOverlay"></div>
<!-- Checkout Modal -->
<div class="checkout-modal" id="checkoutModal">
<div class="checkout-content">
<div class="checkout-header">
<h2>Checkout</h2>
<button class="close-checkout" id="closeCheckout">
<i class="fas fa-times"></i>
</button>
</div>
<form class="checkout-form" id="checkoutForm">
<div class="form-section">
<h3>Shipping Information</h3>
<div class="form-group">
<label>Full Name</label>
<input type="text" id="fullName" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" id="email" required>
</div>
<div class="form-group">
<label>Address</label>
<input type="text" id="address" required>
</div>
<div class="form-row">
<div class="form-group">
<label>City</label>
<input type="text" id="city" required>
</div>
<div class="form-group">
<label>Zip Code</label>
<input type="text" id="zipCode" required>
</div>
</div>
</div>
<div class="form-section">
<h3>Payment Method</h3>
<div class="payment-methods">
<div class="payment-option">
<input type="radio" id="paymentStripe" name="paymentMethod" value="stripe" checked>
<label for="paymentStripe" class="payment-label">
<i class="fab fa-cc-stripe"></i>
<span>Credit/Debit Card (Stripe)</span>
<div class="payment-icons">
<i class="fab fa-cc-visa"></i>
<i class="fab fa-cc-mastercard"></i>
<i class="fab fa-cc-amex"></i>
</div>
</label>
</div>
<div class="payment-option">
<input type="radio" id="paymentCrypto" name="paymentMethod" value="crypto">
<label for="paymentCrypto" class="payment-label">
<i class="fab fa-bitcoin"></i>
<span>Cryptocurrency</span>
<div class="payment-icons">
<i class="fab fa-bitcoin"></i>
<i class="fab fa-ethereum"></i>
<span>+ More</span>
</div>
</label>
</div>
<div class="payment-option">
<input type="radio" id="paymentMpesa" name="paymentMethod" value="mpesa">
<label for="paymentMpesa" class="payment-label">
<i class="fas fa-mobile-alt"></i>
<span>M-Pesa</span>
<div class="payment-icons">
<i class="fas fa-mobile-alt"></i>
<span>Mobile Money</span>
</div>
</label>
</div>
</div>
<!-- Stripe Card Payment Form -->
<div id="stripePaymentForm" class="payment-form-section">
<div class="form-group">
<label>Card Number</label>
<div id="cardNumber" class="stripe-element">
<!-- Stripe Elements will create form elements here -->
</div>
</div>
<div class="form-row">
<div class="form-group">
<label>Expiry Date</label>
<div id="cardExpiry" class="stripe-element">
<!-- Stripe Elements will create form elements here -->
</div>
</div>
<div class="form-group">
<label>CVV</label>
<div id="cardCvc" class="stripe-element">
<!-- Stripe Elements will create form elements here -->
</div>
</div>
</div>
<div id="cardErrors" class="error-message" role="alert"></div>
</div>
<!-- Crypto Payment Form -->
<div id="cryptoPaymentForm" class="payment-form-section" style="display: none;">
<div class="form-group">
<label>Select Cryptocurrency</label>
<select id="cryptoCurrency" class="form-select">
<option value="BTC">Bitcoin (BTC)</option>
<option value="ETH">Ethereum (ETH)</option>
<option value="USDC">USD Coin (USDC)</option>
<option value="LTC">Litecoin (LTC)</option>
<option value="BCH">Bitcoin Cash (BCH)</option>
</select>
</div>
<div class="crypto-info">
<div class="crypto-amount">
<p><strong>Amount to pay:</strong></p>
<p class="crypto-value" id="cryptoAmount">Calculating...</p>
</div>
<div class="crypto-address" id="cryptoAddressSection" style="display: none;">
<p><strong>Send payment to:</strong></p>
<div class="address-box">
<code id="cryptoAddress">Generating address...</code>
<button type="button" class="copy-btn" onclick="copyCryptoAddress()">
<i class="fas fa-copy"></i> Copy
</button>
</div>
<p class="crypto-note">Send exact amount to this address. Payment will be verified automatically.</p>
</div>
</div>
</div>
<!-- M-Pesa Payment Form -->
<div id="mpesaPaymentForm" class="payment-form-section" style="display: none;">
<div class="mpesa-info">
<div class="mpesa-logo">
<i class="fas fa-mobile-alt"></i>
<h4>M-Pesa Payment</h4>
</div>
<p class="mpesa-description">Enter your M-Pesa registered phone number to receive a payment prompt.</p>
</div>
<div class="form-group">
<label>M-Pesa Phone Number</label>
<div class="phone-input-wrapper">
<span class="phone-prefix">+254</span>
<input type="tel" id="mpesaPhoneNumber" placeholder="712345678" maxlength="9" required>
</div>
<small class="form-hint">Enter your M-Pesa registered phone number (without country code)</small>
</div>
<div class="mpesa-amount-display">
<div class="amount-row">
<span>Amount to pay:</span>
<strong id="mpesaAmount">KES 0.00</strong>
</div>
<div class="amount-row">
<span>Transaction fee:</span>
<span id="mpesaFee">KES 0.00</span>
</div>
<div class="amount-row total-row">
<span>Total:</span>
<strong id="mpesaTotal">KES 0.00</strong>
</div>
</div>
<div class="mpesa-instructions">
<h5><i class="fas fa-info-circle"></i> Instructions:</h5>
<ol>
<li>Enter your M-Pesa registered phone number</li>
<li>Click "Pay with M-Pesa" button</li>
<li>You will receive an STK Push prompt on your phone</li>
<li>Enter your M-Pesa PIN to complete the payment</li>
<li>Wait for payment confirmation</li>
</ol>
</div>
<div id="mpesaStatus" class="mpesa-status" style="display: none;">
<div class="status-message">
<i class="fas fa-spinner fa-spin"></i>
<span id="mpesaStatusText">Processing payment...</span>
</div>
</div>
</div>
</div>
<div class="checkout-summary">
<h3>Order Summary</h3>
<div id="checkoutItems"></div>
<div class="summary-total">
<strong>Total: $<span id="checkoutTotal">0.00</span></strong>
</div>
</div>
<button type="submit" class="btn btn-primary">Place Order</button>
</form>
</div>
</div>
<div class="checkout-overlay" id="checkoutOverlay"></div>
<!-- Success Message -->
<div class="success-message" id="successMessage">
<i class="fas fa-check-circle"></i>
<p>Order placed successfully!</p>
</div>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-content">
<div class="footer-section">
<h3>ShopHub</h3>
<p>Your one-stop shop for all your needs. Quality products, great prices, fast delivery.</p>
</div>
<div class="footer-section">
<h4>Quick Links</h4>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#products">Products</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Customer Service</h4>
<ul>
<li><a href="#">Shipping Info</a></li>
<li><a href="#">Returns</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Privacy Policy</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Connect</h4>
<div class="social-links">
<a href="#"><i class="fab fa-facebook"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin"></i></a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 ShopHub. All rights reserved.</p>
</div>
</div>
</footer>
<script src="script.js"></script>
</body>
</html>