nagasurendra commited on
Commit
0df40b7
·
verified ·
1 Parent(s): 5f089bf

Update templates/reward_status.html

Browse files
Files changed (1) hide show
  1. templates/reward_status.html +48 -25
templates/reward_status.html CHANGED
@@ -11,69 +11,92 @@
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;
@@ -117,24 +140,25 @@
117
  </div>
118
 
119
  <div class="reward-status">
 
 
 
 
 
 
 
 
 
 
120
  <div class="item-section">
121
- {% for item in order_items %}
122
- <img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
123
- <div class="item-info">
124
- <h3>{{ item.name }}</h3>
125
- <p>Price: ${{ "%.2f"|format(item.price) }}</p>
126
- </div>
127
-
128
- <!-- Ingredients -->
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
- {% endfor %}
138
  </div>
139
  </div>
140
  </div>
@@ -157,7 +181,6 @@
157
  </div>
158
 
159
  <script>
160
- // JavaScript for showing ingredient details in modal
161
  function showIngredientDetails(name, image, healthBenefits, funFacts) {
162
  const healthBenefitsList = healthBenefits.split(',');
163
  const funFactsList = funFacts.split(',');
 
11
  margin: 0;
12
  padding: 0;
13
  }
14
+
15
  .container {
16
  width: 90%;
17
  margin: auto;
18
  padding-top: 20px;
19
  }
20
+
21
  .order-confirmed {
22
  background-color: #fff;
23
  padding: 20px;
24
  border-radius: 10px;
25
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
26
  text-align: center;
27
+ margin-bottom: 20px;
28
  }
29
+
30
  .order-confirmed h1 {
31
  font-size: 2em;
32
  color: #ff6f00;
33
  }
34
+
35
  .reward-status {
36
+ display: flex;
37
+ justify-content: space-between;
38
+ flex-wrap: wrap; /* This allows the layout to adjust on smaller screens */
39
  background-color: #fff;
40
  padding: 20px;
41
  border-radius: 10px;
42
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
43
+ height: auto;
44
+ max-height: 800px; /* Control the maximum height */
45
+ overflow: hidden; /* Prevents overflow if content gets too large */
46
  }
47
+
48
  .item-section {
49
+ width: 100%; /* Default to 100% width for smaller screens */
50
+ height: auto;
51
  display: flex;
52
  flex-direction: column;
53
  justify-content: space-between;
54
  padding: 10px;
55
  }
56
+
57
+ @media (min-width: 768px) {
58
+ .item-section {
59
+ width: 48%; /* When on larger screens, use 48% to create side-by-side layout */
60
+ }
61
+ }
62
+
63
  .item-image {
64
  width: 100%;
65
+ height: 250px;
66
  object-fit: cover;
67
  border-radius: 8px;
68
  }
69
+
70
  .item-info {
71
  text-align: center;
72
  }
73
+
74
  .item-info h3 {
75
  font-size: 1.5em;
76
  margin-top: 10px;
77
  }
78
+
79
  .ingredient-card {
80
  display: flex;
81
  justify-content: space-between;
82
  padding-top: 10px;
83
+ flex-wrap: wrap; /* Ensures proper alignment in small screens */
84
  }
85
+
86
  .ingredient {
87
  width: 48%;
88
  text-align: center;
89
  cursor: pointer;
90
+ margin-top: 10px;
91
  }
92
+
93
  .ingredient img {
94
  width: 100%;
95
  height: 100px;
96
  object-fit: cover;
97
  border-radius: 8px;
98
  }
99
+
100
  /* Modal Styling */
101
  .modal {
102
  display: none;
 
140
  </div>
141
 
142
  <div class="reward-status">
143
+ <!-- First section: Item info -->
144
+ <div class="item-section">
145
+ <img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
146
+ <div class="item-info">
147
+ <h3>{{ item.name }}</h3>
148
+ <p>Price: ${{ "%.2f"|format(item.price) }}</p>
149
+ </div>
150
+ </div>
151
+
152
+ <!-- Second section: Ingredients -->
153
  <div class="item-section">
154
+ <div class="ingredient-card">
155
+ {% for ingredient in item.ingredients %}
156
+ <div class="ingredient" onclick="showIngredientDetails('{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
157
+ <img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
158
+ <p>{{ ingredient.name }}</p>
159
+ </div>
160
+ {% endfor %}
161
+ </div>
 
 
 
 
 
 
 
 
 
162
  </div>
163
  </div>
164
  </div>
 
181
  </div>
182
 
183
  <script>
 
184
  function showIngredientDetails(name, image, healthBenefits, funFacts) {
185
  const healthBenefitsList = healthBenefits.split(',');
186
  const funFactsList = funFacts.split(',');