nagasurendra commited on
Commit
9dfe58f
·
verified ·
1 Parent(s): d8b180b

Update templates/redirect_page.html

Browse files
Files changed (1) hide show
  1. templates/redirect_page.html +187 -16
templates/redirect_page.html CHANGED
@@ -3,23 +3,194 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Logging Out...</title>
7
- <script type="text/javascript">
8
- // Get the table number from Flask (if needed)
9
- var tableNumber = "{{ table_number }}";
10
- window.onload = function() {
11
- // Construct the logout redirect URL with table number (optional)
12
- let redirectURL = "/login"; // Redirect to login page
13
- if (tableNumber) {
14
- redirectURL += "?table=" + encodeURIComponent(tableNumber);
15
- }
16
- // Optionally, redirect the current tab to the login page
17
- window.location.href = redirectURL;
18
- };
19
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </head>
21
  <body>
22
- <h1>Logging out...</h1>
23
- <p>Please wait while we log you out and redirect you to the login page.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </body>
25
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Reward Status</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background-color: #f9f9f9;
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+ .container {
15
+ width: 90%;
16
+ margin: auto;
17
+ padding-top: 20px;
18
+ }
19
+ .order-confirmed {
20
+ background-color: #fff;
21
+ padding: 20px;
22
+ border-radius: 10px;
23
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
24
+ text-align: center;
25
+ }
26
+ .order-confirmed h1 {
27
+ font-size: 2em;
28
+ color: #ff6f00;
29
+ }
30
+ .reward-status {
31
+ margin-top: 30px;
32
+ background-color: #fff;
33
+ padding: 20px;
34
+ border-radius: 10px;
35
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
36
+ display: flex;
37
+ justify-content: space-between;
38
+ height: 800px;
39
+ }
40
+ .item-section {
41
+ width: 50%;
42
+ height: 100%;
43
+ display: flex;
44
+ flex-direction: column;
45
+ justify-content: space-between;
46
+ padding: 10px;
47
+ }
48
+ .item-image {
49
+ width: 100%;
50
+ height: 200px;
51
+ object-fit: cover;
52
+ border-radius: 8px;
53
+ }
54
+ .item-info {
55
+ text-align: center;
56
+ }
57
+ .item-info h3 {
58
+ font-size: 1.5em;
59
+ margin-top: 10px;
60
+ }
61
+ .ingredient-card {
62
+ display: flex;
63
+ justify-content: space-between;
64
+ padding-top: 10px;
65
+ }
66
+ .ingredient {
67
+ width: 48%;
68
+ text-align: center;
69
+ cursor: pointer;
70
+ }
71
+ .ingredient img {
72
+ width: 100%;
73
+ height: 100px;
74
+ object-fit: cover;
75
+ border-radius: 8px;
76
+ }
77
+ /* Modal Styling */
78
+ .modal {
79
+ display: none;
80
+ position: fixed;
81
+ z-index: 1;
82
+ left: 0;
83
+ top: 0;
84
+ width: 100%;
85
+ height: 100%;
86
+ background-color: rgba(0, 0, 0, 0.5);
87
+ overflow: auto;
88
+ padding-top: 60px;
89
+ }
90
+
91
+ .modal-content {
92
+ background-color: #fff;
93
+ margin: 5% auto;
94
+ padding: 20px;
95
+ border: 1px solid #888;
96
+ width: 50%;
97
+ border-radius: 8px;
98
+ }
99
+
100
+ .close {
101
+ color: #aaa;
102
+ font-size: 2em;
103
+ font-weight: bold;
104
+ position: absolute;
105
+ right: 10px;
106
+ top: 10px;
107
+ cursor: pointer;
108
+ }
109
+ </style>
110
  </head>
111
  <body>
112
+
113
+ <div class="container">
114
+ <div class="order-confirmed">
115
+ <h1>Order Confirmed!</h1>
116
+ <p class="delivery-time">Estimated delivery time: 35 minutes</p>
117
+ </div>
118
+
119
+ <div class="reward-status">
120
+ <div class="item-section">
121
+ <img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
122
+ <div class="item-info">
123
+ <h3>{{ item.name }}</h3>
124
+ <p>Price: ${{ "%.2f"|format(item.price) }}</p>
125
+ </div>
126
+ </div>
127
+
128
+ <div class="item-section">
129
+ <div class="ingredient-card">
130
+ {% for ingredient in item.ingredients %}
131
+ <div class="ingredient" onclick="showIngredientDetails('{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
132
+ <img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
133
+ <p>{{ ingredient.name }}</p>
134
+ </div>
135
+ {% endfor %}
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ <!-- Ingredient Modal -->
142
+ <div id="ingredientModal" class="modal">
143
+ <div class="modal-content">
144
+ <span class="close" onclick="closeModal()">&times;</span>
145
+ <div class="modal-header">
146
+ <h2 id="ingredientName"></h2>
147
+ </div>
148
+ <div class="modal-body">
149
+ <img id="ingredientImage" src="" alt="" style="width: 150px; height: 150px; object-fit: cover; border-radius: 8px;">
150
+ <h3>Health Benefits:</h3>
151
+ <ul id="healthBenefits"></ul>
152
+ <h3>Fun Facts:</h3>
153
+ <ul id="funFacts"></ul>
154
+ </div>
155
+ </div>
156
+ </div>
157
+
158
+ <script>
159
+ function showIngredientDetails(name, image, healthBenefits, funFacts) {
160
+ // Split the health benefits and fun facts by commas
161
+ const healthBenefitsList = healthBenefits.split(',');
162
+ const funFactsList = funFacts.split(',');
163
+
164
+ // Set ingredient name and image
165
+ document.getElementById("ingredientName").textContent = name;
166
+ document.getElementById("ingredientImage").src = image;
167
+
168
+ // Clear the previous lists
169
+ document.getElementById("healthBenefits").innerHTML = '';
170
+ document.getElementById("funFacts").innerHTML = '';
171
+
172
+ // Add each health benefit as a list item
173
+ healthBenefitsList.forEach(function(item) {
174
+ const li = document.createElement("li");
175
+ li.textContent = item.trim();
176
+ document.getElementById("healthBenefits").appendChild(li);
177
+ });
178
+
179
+ // Add each fun fact as a list item
180
+ funFactsList.forEach(function(item) {
181
+ const li = document.createElement("li");
182
+ li.textContent = item.trim();
183
+ document.getElementById("funFacts").appendChild(li);
184
+ });
185
+
186
+ // Display the modal
187
+ document.getElementById("ingredientModal").style.display = "block";
188
+ }
189
+
190
+ function closeModal() {
191
+ document.getElementById("ingredientModal").style.display = "none";
192
+ }
193
+ </script>
194
+
195
  </body>
196
  </html>