BiryaniHubflaskSalesTeam10 / templates /combined_summary.html
Rammohan0504's picture
Update templates/combined_summary.html
fdcdb76 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Summary</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
margin: 0;
padding: 0;
}
.container {
width: 90%;
margin: auto;
padding-top: 20px;
}
.section {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.section h1, .section h2 {
text-align: center;
color: #ff6f00;
}
/* --- Reward Status --- */
.badge {
font-size: 1.2em;
font-weight: bold;
color: #ff6f00;
background-color: #fff3e0;
padding: 8px 15px;
border-radius: 5px;
display: inline-block;
margin: 0 auto;
text-align: center;
}
.valid-through, .points-info, .points-bar-info, .next-tier {
text-align: center;
color: #555;
margin-top: 10px;
}
.points-bar {
width: 100%;
height: 20px;
background-color: #e0e0e0;
border-radius: 10px;
margin: 20px 0;
position: relative;
}
.progress {
height: 100%;
background-color: #ffd700;
width: {{ progress_percentage }}%;
border-radius: 10px;
}
/* --- Order Summary Cards --- */
.reward-status {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center; /*flex-start;*/
}
.item-section {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 10px;
}
/* Mobile Optimization */
@media (max-width: 768px) {
.reward-status {
display: block; /* Make the items stack on top of each other */
text-align: center;
}
.item-section {
width: 100%;
display: flex;
flex-direction: column; /* Ensure items are stacked vertically */
align-items: center; /* Center the content */
justify-content: center;
margin-bottom: 20px;
}
.item-image {
width: 100%; /* Ensure it takes full width */
max-height: 400px; /* Limit max height */
object-fit: contain; /* Keep the aspect ratio intact */
}
.ingredient img {
width: 100%; /* Ensure it takes full width */
max-height: 200px; /* Limit max height */
object-fit: contain; /* Maintain aspect ratio */
border-radius: 15px 15px 0 0; /* Rounded top corners */
}
}
/* General Image Styles (Desktop and Mobile) */
.item-image {
width: 100%; /* Ensure image takes full container width */
height: auto; /* Let the height be calculated automatically */
max-height: 350px; /* Limit max height to avoid stretching */
object-fit: contain; /* Keep the aspect ratio intact */
border-radius: 8px;
}
@media (min-width: 768px) {
.item-section {
width: 48%;
}
}
.item-image {
width: 90%;
height: 350px;
object-fit: cover;
border-radius: 8px;
}
.item-info {
text-align: center;
}
.item-info h3 {
font-size: 1.5em;
margin-top: 10px;
}
.ingredient-card {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 10px;
}
.ingredient {
width: 48%;
text-align: center;
cursor: pointer;
transition: transform 0.3s ease;
}
.ingredient:hover {
transform: scale(1.05);
}
.ingredient img {
width: 100%;
height: 250px;
object-fit: cover;
border-radius: 8px;
}
/* --- Modal --- */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
overflow: auto;
padding-top: 60px;
}
.modal-content {
background-color: #fff;
margin: 5% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
border-radius: 8px;
position: relative;
}
.close {
color: #aaa;
font-size: 2em;
font-weight: bold;
position: absolute;
right: 20px;
top: 10px;
cursor: pointer;
}
ul {
text-align: left;
}
</style>
</head>
<body>
<div class="container">
<!-- ✅ Order Confirmation -->
<div class="section">
<h1>Order Confirmed!</h1>
<p class="valid-through">Estimated delivery time: 35 minutes</p>
</div>
<!-- 🌟 Reward Status -->
<div class="section">
<div class="badge">{{ current_tier }} Tier</div>
<div class="valid-through">Valid through December 2024</div>
<div class="points-info">You have <strong>{{ user_points }}</strong> points</div>
<div class="points-bar-info">{{ start_point }} – {{ end_point }}</div>
<div class="points-bar">
<div class="progress"></div>
</div>
<div class="points-info">
You need <strong>{{ points_needed_for_next_tier }}</strong> more points to reach <strong>{{ next_tier }}</strong>
</div>
</div>
<!-- 🧾 Order Summary -->
<div class="section">
<h2>Your Order Summary</h2>
<div class="reward-status">
{% for item in order_items %}
<div class="item-section">
<img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
<div class="item-info">
<h3>{{ item.name }}</h3>
<p>Price: ${{ "%.2f"|format(item.price) }}</p>
</div>
<div class="ingredient-card">
{% if item.ingredients %}
{% for ingredient in item.ingredients %}
<div class="ingredient" onclick="showIngredientDetails('{{ loop.index }}', '{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
<img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
<p>{{ ingredient.name }}</p>
</div>
{% endfor %}
{% else %}
<p>No ingredients found for {{ item.name }}</p>
{% endif %}
</div>
<!-- Modal -->
<div id="ingredientModal{{ loop.index }}" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal({{ loop.index }})">&times;</span>
<div class="modal-header">
<h2 id="ingredientName{{ loop.index }}"></h2>
</div>
<div class="modal-body">
<img id="ingredientImage{{ loop.index }}" src="" alt="" style="width: 150px; height: 150px; object-fit: cover; border-radius: 8px;">
<h3>Health Benefits:</h3>
<ul id="healthBenefits{{ loop.index }}"></ul>
<h3>Fun Facts:</h3>
<ul id="funFacts{{ loop.index }}"></ul>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Modal Script -->
<script>
function showIngredientDetails(index, name, image, healthBenefits, funFacts) {
const healthBenefitsList = healthBenefits.split(',');
const funFactsList = funFacts.split(',');
document.getElementById("ingredientName" + index).textContent = name;
document.getElementById("ingredientImage" + index).src = image;
document.getElementById("healthBenefits" + index).innerHTML = '';
document.getElementById("funFacts" + index).innerHTML = '';
healthBenefitsList.forEach(function(item) {
const li = document.createElement("li");
li.textContent = item.trim();
document.getElementById("healthBenefits" + index).appendChild(li);
});
funFactsList.forEach(function(item) {
const li = document.createElement("li");
li.textContent = item.trim();
document.getElementById("funFacts" + index).appendChild(li);
});
document.getElementById("ingredientModal" + index).style.display = "block";
}
function closeModal(index) {
document.getElementById("ingredientModal" + index).style.display = "none";
}
</script>
</body>
</html>