-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathsuccess.html
More file actions
289 lines (247 loc) · 9.3 KB
/
success.html
File metadata and controls
289 lines (247 loc) · 9.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Order Success</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f8f9fa;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
overflow: hidden;
color: #333;
}
.success-container {
text-align: center;
background-color: white;
border-radius: 10px;
padding: 40px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
max-width: 600px;
width: 90%;
position: relative;
z-index: 10;
}
.success-icon {
width: 100px;
height: 100px;
background-color: #28a745;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 30px;
transform: scale(0);
animation: popIn 0.5s ease-out forwards 0.3s;
}
.checkmark {
color: white;
font-size: 50px;
font-weight: bold;
transform: rotate(45deg);
display: inline-block;
opacity: 0;
animation: fadeIn 0.3s ease-out forwards 0.8s;
}
h1 {
margin: 0;
font-size: 32px;
opacity: 0;
animation: slideUp 0.5s ease-out forwards 1s;
}
p {
margin: 20px 0;
font-size: 18px;
line-height: 1.6;
opacity: 0;
animation: slideUp 0.5s ease-out forwards 1.3s;
}
.order-details {
background-color: #f8f9fa;
padding: 20px;
border-radius: 8px;
margin: 30px 0;
text-align: left;
opacity: 0;
animation: fadeIn 0.5s ease-out forwards 1.6s;
}
.order-details p {
margin: 10px 0;
animation: none;
opacity: 1;
}
.buttons {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 30px;
opacity: 0;
animation: slideUp 0.5s ease-out forwards 1.9s;
}
.btn {
padding: 12px 24px;
border-radius: 50px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
}
.btn-primary {
background-color: #007bff;
color: white;
border: none;
}
.btn-primary:hover {
background-color: #0069d9;
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 105, 217, 0.3);
}
.btn-outline {
background-color: transparent;
color: #007bff;
border: 2px solid #007bff;
}
.btn-outline:hover {
background-color: #f1f8ff;
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 105, 217, 0.1);
}
.confetti {
position: absolute;
width: 10px;
height: 10px;
opacity: 0;
animation: confettiFall 4s ease-out forwards;
}
@keyframes popIn {
0% { transform: scale(0); }
60% { transform: scale(1.2); }
100% { transform: scale(1); }
}
@keyframes fadeIn {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes slideUp {
0% { opacity: 0; transform: translateY(30px); }
100% { opacity: 1; transform: translateY(0); }
}
@keyframes confettiFall {
0% {
transform: translateY(-100px) rotate(0deg);
opacity: 1;
}
100% {
transform: translateY(calc(100vh + 100px)) rotate(720deg);
opacity: 0;
}
}
</style>
</head>
<body>
<div class="success-container">
<div class="success-icon">
<span class="checkmark">L</span>
</div>
<h1>Order Placed Successfully!</h1>
<p>Thank you for your purchase. Your order has been received and is being processed.</p>
<div class="order-details">
<p><strong>Order Number:</strong> <span id="orderNumber">ORD-2025-04-16-7892</span></p>
<p><strong>Date:</strong> <span id="orderDate">April 16, 2025</span></p>
<p><strong>Estimated Delivery:</strong> <span id="deliveryDate">April 20-23, 2025</span></p>
</div>
<p>We've sent a confirmation email with all the details to your registered email address.</p>
<div class="buttons">
<a href="cart.html" class="btn btn-outline">Back to Cart</a>
<a href="index.html" class="btn btn-primary">Continue Shopping</a>
</div>
</div>
<script>
// Create and animate confetti
function createConfetti() {
const colors = ['#ff0000', '#00ff00', '#0000ff', '#ffff00', '#ff00ff', '#00ffff'];
const confettiCount = 150;
for (let i = 0; i < confettiCount; i++) {
const confetti = document.createElement('div');
confetti.className = 'confetti';
// Random position
const left = Math.random() * 100;
// Random color
const colorIndex = Math.floor(Math.random() * colors.length);
// Random size
const size = Math.random() * 8 + 6;
// Random shape
const shapes = ['circle', 'square', 'triangle'];
const shapeIndex = Math.floor(Math.random() * shapes.length);
confetti.style.left = `${left}%`;
confetti.style.backgroundColor = colors[colorIndex];
confetti.style.width = `${size}px`;
confetti.style.height = `${size}px`;
confetti.style.animationDelay = `${Math.random() * 3}s`;
// Set shape
if (shapes[shapeIndex] === 'circle') {
confetti.style.borderRadius = '50%';
} else if (shapes[shapeIndex] === 'triangle') {
confetti.style.width = '0';
confetti.style.height = '0';
confetti.style.backgroundColor = 'transparent';
confetti.style.borderLeft = `${size/2}px solid transparent`;
confetti.style.borderRight = `${size/2}px solid transparent`;
confetti.style.borderBottom = `${size}px solid ${colors[colorIndex]}`;
}
document.body.appendChild(confetti);
// Remove confetti after animation ends
setTimeout(() => {
confetti.remove();
}, 4000);
}
}
// Generate a random order number based on current date
function generateOrderNumber() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const random = Math.floor(Math.random() * 10000);
return `ORD-${year}-${month}-${day}-${random}`;
}
// Generate delivery date (3-5 days from now)
function generateDeliveryDate() {
const now = new Date();
const minDays = 3;
const maxDays = 5;
const startDate = new Date(now);
startDate.setDate(now.getDate() + minDays);
const endDate = new Date(now);
endDate.setDate(now.getDate() + maxDays);
const options = { month: 'long', day: 'numeric', year: 'numeric' };
return `${startDate.toLocaleDateString('en-US', options)} - ${endDate.toLocaleDateString('en-US', options)}`;
}
// Set order details when page loads
window.onload = function() {
// Set order number
document.getElementById('orderNumber').textContent = generateOrderNumber();
// Set order date (today)
const today = new Date();
const options = { month: 'long', day: 'numeric', year: 'numeric' };
document.getElementById('orderDate').textContent = today.toLocaleDateString('en-US', options);
// Set estimated delivery date
document.getElementById('deliveryDate').textContent = generateDeliveryDate();
// Create confetti after a short delay
setTimeout(createConfetti, 1000);
// Create more confetti every few seconds
setInterval(function() {
createConfetti();
}, 4000);
};
</script>
</body>
</html>