Update templates/reward_status.html
Browse files- templates/reward_status.html +103 -119
templates/reward_status.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>
|
7 |
<style>
|
8 |
body {
|
9 |
font-family: Arial, sans-serif;
|
@@ -11,35 +11,27 @@
|
|
11 |
margin: 0;
|
12 |
padding: 0;
|
13 |
}
|
|
|
14 |
.container {
|
15 |
width: 90%;
|
16 |
margin: auto;
|
17 |
padding-top: 20px;
|
18 |
}
|
19 |
-
|
20 |
-
.
|
21 |
background-color: #fff;
|
22 |
padding: 20px;
|
23 |
border-radius: 10px;
|
24 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
25 |
-
|
26 |
}
|
27 |
-
|
28 |
-
|
|
|
29 |
color: #ff6f00;
|
30 |
}
|
31 |
-
|
32 |
-
|
33 |
-
font-size: 1.2em;
|
34 |
-
color: #666;
|
35 |
-
}
|
36 |
-
.reward-status {
|
37 |
-
margin-top: 30px;
|
38 |
-
background-color: #fff;
|
39 |
-
padding: 20px;
|
40 |
-
border-radius: 10px;
|
41 |
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
42 |
-
}
|
43 |
.badge {
|
44 |
font-size: 1.2em;
|
45 |
font-weight: bold;
|
@@ -47,110 +39,97 @@
|
|
47 |
background-color: #fff3e0;
|
48 |
padding: 8px 15px;
|
49 |
border-radius: 5px;
|
50 |
-
margin: 10px 0;
|
51 |
display: inline-block;
|
|
|
|
|
52 |
}
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
57 |
}
|
|
|
58 |
.points-bar {
|
59 |
width: 100%;
|
60 |
height: 20px;
|
61 |
background-color: #e0e0e0;
|
62 |
border-radius: 10px;
|
63 |
margin: 20px 0;
|
|
|
64 |
}
|
|
|
65 |
.progress {
|
66 |
height: 100%;
|
67 |
background-color: #ffd700;
|
68 |
width: {{ progress_percentage }}%;
|
69 |
border-radius: 10px;
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
font-size: 0.9em;
|
75 |
-
color: #333;
|
76 |
-
}
|
77 |
-
.points {
|
78 |
-
font-size: 1.1em;
|
79 |
-
font-weight: bold;
|
80 |
-
}
|
81 |
-
.next-tier {
|
82 |
-
font-size: 1.1em;
|
83 |
-
font-weight: bold;
|
84 |
-
}
|
85 |
-
.points-bar-info {
|
86 |
-
display: flex;
|
87 |
-
justify-content: space-between;
|
88 |
-
font-size: 0.9em;
|
89 |
-
color: #333;
|
90 |
-
}
|
91 |
-
#ff6f00;
|
92 |
-
}
|
93 |
-
.reward-status2 {
|
94 |
display: flex;
|
95 |
-
justify-content: flex-start;
|
96 |
flex-wrap: wrap;
|
97 |
-
gap: 20px;
|
98 |
-
|
99 |
-
padding: 20px;
|
100 |
-
border-radius: 10px;
|
101 |
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
102 |
}
|
|
|
103 |
.item-section {
|
104 |
-
width: 100%;
|
105 |
-
height: auto; /* Ensure dynamic height */
|
106 |
display: flex;
|
107 |
flex-direction: column;
|
108 |
justify-content: space-between;
|
109 |
padding: 10px;
|
110 |
-
flex-grow: 1; /* Allow the container to grow as needed */
|
111 |
}
|
|
|
112 |
@media (min-width: 768px) {
|
113 |
.item-section {
|
114 |
-
width: 48%;
|
115 |
}
|
116 |
}
|
|
|
117 |
.item-image {
|
118 |
width: 100%;
|
119 |
height: 250px;
|
120 |
object-fit: cover;
|
121 |
border-radius: 8px;
|
122 |
}
|
|
|
123 |
.item-info {
|
124 |
text-align: center;
|
125 |
}
|
|
|
126 |
.item-info h3 {
|
127 |
font-size: 1.5em;
|
128 |
margin-top: 10px;
|
129 |
}
|
|
|
130 |
.ingredient-card {
|
131 |
display: flex;
|
132 |
-
justify-content: space-between;
|
133 |
-
padding-top: 10px;
|
134 |
flex-wrap: wrap;
|
135 |
-
|
|
|
136 |
}
|
|
|
137 |
.ingredient {
|
138 |
width: 48%;
|
139 |
text-align: center;
|
140 |
cursor: pointer;
|
141 |
-
|
142 |
-
transition: transform 0.3s ease; /* Added smooth hover effect */
|
143 |
}
|
|
|
144 |
.ingredient:hover {
|
145 |
-
transform: scale(1.05);
|
146 |
}
|
|
|
147 |
.ingredient img {
|
148 |
width: 100%;
|
149 |
height: 100px;
|
150 |
object-fit: cover;
|
151 |
border-radius: 8px;
|
152 |
}
|
153 |
-
|
|
|
154 |
.modal {
|
155 |
display: none;
|
156 |
position: fixed;
|
@@ -161,103 +140,108 @@
|
|
161 |
height: 100%;
|
162 |
background-color: rgba(0, 0, 0, 0.5);
|
163 |
overflow: auto;
|
164 |
-
padding-top: 60px;
|
165 |
}
|
|
|
166 |
.modal-content {
|
167 |
background-color: #fff;
|
168 |
margin: 5% auto;
|
169 |
padding: 20px;
|
170 |
border: 1px solid #888;
|
171 |
-
width: 80%;
|
172 |
border-radius: 8px;
|
173 |
position: relative;
|
174 |
}
|
|
|
175 |
.close {
|
176 |
color: #aaa;
|
177 |
font-size: 2em;
|
178 |
font-weight: bold;
|
179 |
position: absolute;
|
180 |
-
right: 20px;
|
181 |
-
top: 10px;
|
182 |
cursor: pointer;
|
183 |
}
|
|
|
|
|
|
|
|
|
184 |
</style>
|
185 |
</head>
|
186 |
<body>
|
187 |
|
188 |
<div class="container">
|
189 |
-
|
|
|
|
|
190 |
<h1>Order Confirmed!</h1>
|
191 |
-
<p class="
|
192 |
</div>
|
193 |
-
<div class="reward-status">
|
194 |
-
<div class="badge">{{ current_tier }} Status</div>
|
195 |
-
<div class="valid-through">Valid through December 2024</div>
|
196 |
-
|
197 |
-
<div class="points-info">
|
198 |
-
<div class="points">You have <strong>{{ user_points }}</strong> points</div>
|
199 |
-
</div>
|
200 |
-
|
201 |
-
<div class="points-bar-info">
|
202 |
-
<div>{{ start_point }}</div> <!-- Start of the range -->
|
203 |
-
<div>{{ end_point }}</div> <!-- End of the range -->
|
204 |
-
</div>
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
<div class="points-bar">
|
207 |
<div class="progress"></div>
|
208 |
</div>
|
209 |
-
|
210 |
<div class="points-info">
|
211 |
-
|
212 |
-
<div class="next-tier">Next tier: {{ next_tier }}</div>
|
213 |
</div>
|
214 |
</div>
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
217 |
{% for item in order_items %}
|
218 |
-
<
|
219 |
-
|
220 |
-
<
|
221 |
-
|
222 |
-
|
|
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
{%
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
</div>
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
251 |
</div>
|
252 |
</div>
|
253 |
</div>
|
254 |
{% endfor %}
|
255 |
</div>
|
256 |
</div>
|
|
|
257 |
</div>
|
258 |
|
|
|
259 |
<script>
|
260 |
-
// JavaScript for showing ingredient details in modal
|
261 |
function showIngredientDetails(index, name, image, healthBenefits, funFacts) {
|
262 |
const healthBenefitsList = healthBenefits.split(',');
|
263 |
const funFactsList = funFacts.split(',');
|
@@ -265,7 +249,7 @@
|
|
265 |
document.getElementById("ingredientImage" + index).src = image;
|
266 |
document.getElementById("healthBenefits" + index).innerHTML = '';
|
267 |
document.getElementById("funFacts" + index).innerHTML = '';
|
268 |
-
|
269 |
healthBenefitsList.forEach(function(item) {
|
270 |
const li = document.createElement("li");
|
271 |
li.textContent = item.trim();
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>My Summary</title>
|
7 |
<style>
|
8 |
body {
|
9 |
font-family: Arial, sans-serif;
|
|
|
11 |
margin: 0;
|
12 |
padding: 0;
|
13 |
}
|
14 |
+
|
15 |
.container {
|
16 |
width: 90%;
|
17 |
margin: auto;
|
18 |
padding-top: 20px;
|
19 |
}
|
20 |
+
|
21 |
+
.section {
|
22 |
background-color: #fff;
|
23 |
padding: 20px;
|
24 |
border-radius: 10px;
|
25 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
26 |
+
margin-bottom: 20px;
|
27 |
}
|
28 |
+
|
29 |
+
.section h1, .section h2 {
|
30 |
+
text-align: center;
|
31 |
color: #ff6f00;
|
32 |
}
|
33 |
+
|
34 |
+
/* --- Reward Status --- */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
.badge {
|
36 |
font-size: 1.2em;
|
37 |
font-weight: bold;
|
|
|
39 |
background-color: #fff3e0;
|
40 |
padding: 8px 15px;
|
41 |
border-radius: 5px;
|
|
|
42 |
display: inline-block;
|
43 |
+
margin: 0 auto;
|
44 |
+
text-align: center;
|
45 |
}
|
46 |
+
|
47 |
+
.valid-through, .points-info, .points-bar-info, .next-tier {
|
48 |
+
text-align: center;
|
49 |
+
color: #555;
|
50 |
+
margin-top: 10px;
|
51 |
}
|
52 |
+
|
53 |
.points-bar {
|
54 |
width: 100%;
|
55 |
height: 20px;
|
56 |
background-color: #e0e0e0;
|
57 |
border-radius: 10px;
|
58 |
margin: 20px 0;
|
59 |
+
position: relative;
|
60 |
}
|
61 |
+
|
62 |
.progress {
|
63 |
height: 100%;
|
64 |
background-color: #ffd700;
|
65 |
width: {{ progress_percentage }}%;
|
66 |
border-radius: 10px;
|
67 |
}
|
68 |
+
|
69 |
+
/* --- Order Summary Cards --- */
|
70 |
+
.reward-status {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
display: flex;
|
|
|
72 |
flex-wrap: wrap;
|
73 |
+
gap: 20px;
|
74 |
+
justify-content: flex-start;
|
|
|
|
|
|
|
75 |
}
|
76 |
+
|
77 |
.item-section {
|
78 |
+
width: 100%;
|
|
|
79 |
display: flex;
|
80 |
flex-direction: column;
|
81 |
justify-content: space-between;
|
82 |
padding: 10px;
|
|
|
83 |
}
|
84 |
+
|
85 |
@media (min-width: 768px) {
|
86 |
.item-section {
|
87 |
+
width: 48%;
|
88 |
}
|
89 |
}
|
90 |
+
|
91 |
.item-image {
|
92 |
width: 100%;
|
93 |
height: 250px;
|
94 |
object-fit: cover;
|
95 |
border-radius: 8px;
|
96 |
}
|
97 |
+
|
98 |
.item-info {
|
99 |
text-align: center;
|
100 |
}
|
101 |
+
|
102 |
.item-info h3 {
|
103 |
font-size: 1.5em;
|
104 |
margin-top: 10px;
|
105 |
}
|
106 |
+
|
107 |
.ingredient-card {
|
108 |
display: flex;
|
|
|
|
|
109 |
flex-wrap: wrap;
|
110 |
+
justify-content: space-between;
|
111 |
+
gap: 10px;
|
112 |
}
|
113 |
+
|
114 |
.ingredient {
|
115 |
width: 48%;
|
116 |
text-align: center;
|
117 |
cursor: pointer;
|
118 |
+
transition: transform 0.3s ease;
|
|
|
119 |
}
|
120 |
+
|
121 |
.ingredient:hover {
|
122 |
+
transform: scale(1.05);
|
123 |
}
|
124 |
+
|
125 |
.ingredient img {
|
126 |
width: 100%;
|
127 |
height: 100px;
|
128 |
object-fit: cover;
|
129 |
border-radius: 8px;
|
130 |
}
|
131 |
+
|
132 |
+
/* --- Modal --- */
|
133 |
.modal {
|
134 |
display: none;
|
135 |
position: fixed;
|
|
|
140 |
height: 100%;
|
141 |
background-color: rgba(0, 0, 0, 0.5);
|
142 |
overflow: auto;
|
143 |
+
padding-top: 60px;
|
144 |
}
|
145 |
+
|
146 |
.modal-content {
|
147 |
background-color: #fff;
|
148 |
margin: 5% auto;
|
149 |
padding: 20px;
|
150 |
border: 1px solid #888;
|
151 |
+
width: 80%;
|
152 |
border-radius: 8px;
|
153 |
position: relative;
|
154 |
}
|
155 |
+
|
156 |
.close {
|
157 |
color: #aaa;
|
158 |
font-size: 2em;
|
159 |
font-weight: bold;
|
160 |
position: absolute;
|
161 |
+
right: 20px;
|
162 |
+
top: 10px;
|
163 |
cursor: pointer;
|
164 |
}
|
165 |
+
|
166 |
+
ul {
|
167 |
+
text-align: left;
|
168 |
+
}
|
169 |
</style>
|
170 |
</head>
|
171 |
<body>
|
172 |
|
173 |
<div class="container">
|
174 |
+
|
175 |
+
<!-- ✅ Order Confirmation -->
|
176 |
+
<div class="section">
|
177 |
<h1>Order Confirmed!</h1>
|
178 |
+
<p class="valid-through">Estimated delivery time: 35 minutes</p>
|
179 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
+
<!-- 🌟 Reward Status -->
|
182 |
+
<div class="section">
|
183 |
+
<div class="badge">{{ current_tier }} Tier</div>
|
184 |
+
<div class="valid-through">Valid through December 2024</div>
|
185 |
+
<div class="points-info">You have <strong>{{ user_points }}</strong> points</div>
|
186 |
+
<div class="points-bar-info">{{ start_point }} – {{ end_point }}</div>
|
187 |
<div class="points-bar">
|
188 |
<div class="progress"></div>
|
189 |
</div>
|
|
|
190 |
<div class="points-info">
|
191 |
+
You need <strong>{{ points_needed_for_next_tier }}</strong> more points to reach <strong>{{ next_tier }}</strong>
|
|
|
192 |
</div>
|
193 |
</div>
|
194 |
+
|
195 |
+
<!-- 🧾 Order Summary -->
|
196 |
+
<div class="section">
|
197 |
+
<h2>Your Order Summary</h2>
|
198 |
+
<div class="reward-status">
|
199 |
{% for item in order_items %}
|
200 |
+
<div class="item-section">
|
201 |
+
<img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
|
202 |
+
<div class="item-info">
|
203 |
+
<h3>{{ item.name }}</h3>
|
204 |
+
<p>Price: ${{ "%.2f"|format(item.price) }}</p>
|
205 |
+
</div>
|
206 |
|
207 |
+
<div class="ingredient-card">
|
208 |
+
{% if item.ingredients %}
|
209 |
+
{% for ingredient in item.ingredients %}
|
210 |
+
<div class="ingredient" onclick="showIngredientDetails('{{ loop.index }}', '{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
|
211 |
+
<img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
|
212 |
+
<p>{{ ingredient.name }}</p>
|
213 |
+
</div>
|
214 |
+
{% endfor %}
|
215 |
+
{% else %}
|
216 |
+
<p>No ingredients found for {{ item.name }}</p>
|
217 |
+
{% endif %}
|
218 |
+
</div>
|
|
|
219 |
|
220 |
+
<!-- Modal -->
|
221 |
+
<div id="ingredientModal{{ loop.index }}" class="modal">
|
222 |
+
<div class="modal-content">
|
223 |
+
<span class="close" onclick="closeModal({{ loop.index }})">×</span>
|
224 |
+
<div class="modal-header">
|
225 |
+
<h2 id="ingredientName{{ loop.index }}"></h2>
|
226 |
+
</div>
|
227 |
+
<div class="modal-body">
|
228 |
+
<img id="ingredientImage{{ loop.index }}" src="" alt="" style="width: 150px; height: 150px; object-fit: cover; border-radius: 8px;">
|
229 |
+
<h3>Health Benefits:</h3>
|
230 |
+
<ul id="healthBenefits{{ loop.index }}"></ul>
|
231 |
+
<h3>Fun Facts:</h3>
|
232 |
+
<ul id="funFacts{{ loop.index }}"></ul>
|
233 |
+
</div>
|
234 |
</div>
|
235 |
</div>
|
236 |
</div>
|
237 |
{% endfor %}
|
238 |
</div>
|
239 |
</div>
|
240 |
+
|
241 |
</div>
|
242 |
|
243 |
+
<!-- Modal Script -->
|
244 |
<script>
|
|
|
245 |
function showIngredientDetails(index, name, image, healthBenefits, funFacts) {
|
246 |
const healthBenefitsList = healthBenefits.split(',');
|
247 |
const funFactsList = funFacts.split(',');
|
|
|
249 |
document.getElementById("ingredientImage" + index).src = image;
|
250 |
document.getElementById("healthBenefits" + index).innerHTML = '';
|
251 |
document.getElementById("funFacts" + index).innerHTML = '';
|
252 |
+
|
253 |
healthBenefitsList.forEach(function(item) {
|
254 |
const li = document.createElement("li");
|
255 |
li.textContent = item.trim();
|