nagasurendra commited on
Commit
3d03d8d
·
verified ·
1 Parent(s): 6a82ae2

Update templates/reward_status.html

Browse files
Files changed (1) hide show
  1. templates/reward_status.html +142 -16
templates/reward_status.html CHANGED
@@ -54,6 +54,7 @@
54
  color: #888;
55
  margin-bottom: 20px;
56
  }
 
57
  .points-bar {
58
  width: 100%;
59
  height: 20px;
@@ -73,19 +74,80 @@
73
  font-size: 0.9em;
74
  color: #333;
75
  }
76
- .points {
77
- font-size: 1.1em;
78
- font-weight: bold;
 
 
 
 
79
  }
80
- .next-tier {
81
- font-size: 1.1em;
82
- font-weight: bold;
 
 
 
83
  }
84
- .points-bar-info {
 
85
  display: flex;
86
  justify-content: space-between;
87
- font-size: 0.9em;
88
- color: #333;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
  </style>
91
  </head>
@@ -100,16 +162,11 @@
100
  <div class="reward-status">
101
  <div class="badge">{{ current_tier }} Status</div>
102
  <div class="valid-through">Valid through December 2024</div>
103
-
104
  <div class="points-info">
105
  <div class="points">You have <strong>{{ user_points }}</strong> points</div>
106
  </div>
107
 
108
- <div class="points-bar-info">
109
- <div>{{ start_point }}</div> <!-- Start of the range -->
110
- <div>{{ end_point }}</div> <!-- End of the range -->
111
- </div>
112
-
113
  <div class="points-bar">
114
  <div class="progress"></div>
115
  </div>
@@ -118,8 +175,77 @@
118
  <div class="points">You need <strong>{{ points_needed_for_next_tier }}</strong> more points</div>
119
  <div class="next-tier">Next tier: {{ next_tier }}</div>
120
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  </div>
122
  </div>
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  </body>
125
- </html>
 
54
  color: #888;
55
  margin-bottom: 20px;
56
  }
57
+ /* Reward progress bar styling */
58
  .points-bar {
59
  width: 100%;
60
  height: 20px;
 
74
  font-size: 0.9em;
75
  color: #333;
76
  }
77
+
78
+ /* Card layout for item and ingredients */
79
+ .reward-item-card {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: space-between;
83
+ margin-top: 20px;
84
  }
85
+
86
+ .item-image {
87
+ width: 150px;
88
+ height: 150px;
89
+ object-fit: cover;
90
+ border-radius: 8px;
91
  }
92
+
93
+ .ingredient-card {
94
  display: flex;
95
  justify-content: space-between;
96
+ margin-top: 10px;
97
+ }
98
+
99
+ .ingredient {
100
+ text-align: center;
101
+ cursor: pointer;
102
+ }
103
+
104
+ .ingredient img {
105
+ width: 100px;
106
+ height: 100px;
107
+ object-fit: cover;
108
+ border-radius: 8px;
109
+ }
110
+
111
+ /* Modal styling for ingredient details */
112
+ .modal {
113
+ display: none;
114
+ position: fixed;
115
+ z-index: 1;
116
+ left: 0;
117
+ top: 0;
118
+ width: 100%;
119
+ height: 100%;
120
+ background-color: rgba(0, 0, 0, 0.5);
121
+ overflow: auto;
122
+ padding-top: 60px;
123
+ }
124
+
125
+ .modal-content {
126
+ background-color: #fff;
127
+ margin: 5% auto;
128
+ padding: 20px;
129
+ border: 1px solid #888;
130
+ width: 50%;
131
+ border-radius: 8px;
132
+ }
133
+
134
+ .modal-header {
135
+ font-size: 1.5em;
136
+ margin-bottom: 15px;
137
+ }
138
+
139
+ .modal-body p {
140
+ font-size: 1em;
141
+ margin: 10px 0;
142
+ }
143
+
144
+ .close {
145
+ color: #aaa;
146
+ font-size: 1.5em;
147
+ position: absolute;
148
+ right: 10px;
149
+ top: 10px;
150
+ cursor: pointer;
151
  }
152
  </style>
153
  </head>
 
162
  <div class="reward-status">
163
  <div class="badge">{{ current_tier }} Status</div>
164
  <div class="valid-through">Valid through December 2024</div>
165
+
166
  <div class="points-info">
167
  <div class="points">You have <strong>{{ user_points }}</strong> points</div>
168
  </div>
169
 
 
 
 
 
 
170
  <div class="points-bar">
171
  <div class="progress"></div>
172
  </div>
 
175
  <div class="points">You need <strong>{{ points_needed_for_next_tier }}</strong> more points</div>
176
  <div class="next-tier">Next tier: {{ next_tier }}</div>
177
  </div>
178
+
179
+ <!-- Reward Item Display -->
180
+ <div class="reward-item-card">
181
+ <div>
182
+ <img class="item-image" src="{{ item_image_url }}" alt="{{ item_name }}">
183
+ <h3>{{ item_name }}</h3>
184
+ </div>
185
+ <div class="ingredient-card">
186
+ <div class="ingredient" onclick="showIngredientDetails('ingredient_1')">
187
+ <img src="{{ ingredient_1_image }}" alt="{{ ingredient_1_name }}">
188
+ <p>{{ ingredient_1_name }}</p>
189
+ </div>
190
+ <div class="ingredient" onclick="showIngredientDetails('ingredient_2')">
191
+ <img src="{{ ingredient_2_image }}" alt="{{ ingredient_2_name }}">
192
+ <p>{{ ingredient_2_name }}</p>
193
+ </div>
194
+ </div>
195
+ </div>
196
  </div>
197
  </div>
198
 
199
+ <!-- Ingredient Modal -->
200
+ <div id="ingredientModal" class="modal">
201
+ <div class="modal-content">
202
+ <span class="close" onclick="closeModal()">&times;</span>
203
+ <div class="modal-header">
204
+ <h2 id="ingredientName"></h2>
205
+ </div>
206
+ <div class="modal-body">
207
+ <img id="ingredientImage" src="" alt="" style="width: 150px; height: 150px; object-fit: cover; border-radius: 8px;">
208
+ <h3>Health Benefits:</h3>
209
+ <p id="healthBenefits"></p>
210
+ <h3>Fun Facts:</h3>
211
+ <p id="funFacts"></p>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <script>
217
+ function showIngredientDetails(ingredient) {
218
+ // Fetch data for the selected ingredient
219
+ let ingredientData = {
220
+ 'ingredient_1': {
221
+ name: "{{ ingredient_1_name }}",
222
+ image: "{{ ingredient_1_image }}",
223
+ health_benefits: "{{ ingredient_1_health_benefits }}",
224
+ fun_facts: "{{ ingredient_1_fun_facts }}"
225
+ },
226
+ 'ingredient_2': {
227
+ name: "{{ ingredient_2_name }}",
228
+ image: "{{ ingredient_2_image }}",
229
+ health_benefits: "{{ ingredient_2_health_benefits }}",
230
+ fun_facts: "{{ ingredient_2_fun_facts }}"
231
+ }
232
+ };
233
+
234
+ // Update modal content
235
+ document.getElementById("ingredientName").textContent = ingredientData[ingredient].name;
236
+ document.getElementById("ingredientImage").src = ingredientData[ingredient].image;
237
+ document.getElementById("healthBenefits").textContent = ingredientData[ingredient].health_benefits;
238
+ document.getElementById("funFacts").textContent = ingredientData[ingredient].fun_facts;
239
+
240
+ // Show the modal
241
+ document.getElementById("ingredientModal").style.display = "block";
242
+ }
243
+
244
+ function closeModal() {
245
+ // Hide the modal
246
+ document.getElementById("ingredientModal").style.display = "none";
247
+ }
248
+ </script>
249
+
250
  </body>
251
+ </html>