lokeshloki143 commited on
Commit
5aa951d
·
verified ·
1 Parent(s): 582d62f

Update templates/combined_summary.html

Browse files
Files changed (1) hide show
  1. templates/combined_summary.html +83 -25
templates/combined_summary.html CHANGED
@@ -398,7 +398,7 @@
398
  border-color: #10B981;
399
  }
400
  /* Green border when section is visible */
401
- .ingredients выполнение-section:not(.hidden) .ingredient-image {
402
  border: 2px solid #10B981;
403
  }
404
  /* Ensure ingredient section is smooth */
@@ -435,7 +435,7 @@
435
  .order-confirmed::before {
436
  content: '✔';
437
  position: absolute;
438
- top: 50%;
439
  left: 50%;
440
  transform: translate(-50%, -50%);
441
  font-size: 120px;
@@ -447,6 +447,20 @@
447
  z-index: 1;
448
  position: relative;
449
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  /* Tier details animation */
451
  .tier-details {
452
  overflow: hidden;
@@ -568,6 +582,9 @@
568
  .grid {
569
  grid-template-columns: repeat(2, 1fr);
570
  }
 
 
 
571
  }
572
  @media (min-width: 768px) {
573
  .grid {
@@ -588,7 +605,10 @@
588
  <!-- Order Confirmation -->
589
  <div class="section bg-white shadow-sm rounded-xl p-6 mb-6 order-confirmed" role="alert">
590
  <h1 class="text-center text-2xl font-bold text-orange-500">Order Confirmed!</h1>
591
- <p class="text-center text-gray-600 mt-2">Estimated delivery time: {{ delivery_time }} minutes</p>
 
 
 
592
  </div>
593
 
594
  <!-- Reward Status Section -->
@@ -989,9 +1009,40 @@
989
  }
990
  }
991
 
992
- // Set progress bar color based on points
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
993
  document.addEventListener('DOMContentLoaded', () => {
994
  try {
 
995
  const progressBar = document.getElementById('progressBar');
996
  const pointsDisplay = document.getElementById('pointsDisplay');
997
  const points = parseInt(pointsDisplay.textContent, 10) || 0;
@@ -1003,29 +1054,36 @@
1003
  } else {
1004
  progressBar.classList.add('range-200-plus');
1005
  }
1006
- } catch (e) {
1007
- console.error('Error setting progress bar color:', e);
1008
- }
1009
 
1010
- // Lazy load images with IntersectionObserver
1011
- const images = document.querySelectorAll('img.lazyload');
1012
- if ('IntersectionObserver' in window) {
1013
- const observer = new IntersectionObserver((entries, observer) => {
1014
- entries.forEach(entry => {
1015
- if (entry.isIntersecting) {
1016
- const img = entry.target;
1017
- img.src = img.src || '/static/placeholder.jpg';
1018
- img.classList.remove('lazyload');
1019
- observer.unobserve(img);
1020
- }
 
 
 
 
 
 
 
 
1021
  });
1022
- });
1023
- images.forEach(img => observer.observe(img));
1024
- } else {
1025
- images.forEach(img => {
1026
- img.src = img.src || '/static/placeholder.jpg';
1027
- img.classList.remove('lazyload');
1028
- });
 
 
1029
  }
1030
  });
1031
 
 
398
  border-color: #10B981;
399
  }
400
  /* Green border when section is visible */
401
+ .ingredients-section:not(.hidden) .ingredient-image {
402
  border: 2px solid #10B981;
403
  }
404
  /* Ensure ingredient section is smooth */
 
435
  .order-confirmed::before {
436
  content: '✔';
437
  position: absolute;
438
+ top: 50;
439
  left: 50%;
440
  transform: translate(-50%, -50%);
441
  font-size: 120px;
 
447
  z-index: 1;
448
  position: relative;
449
  }
450
+ /* Success message styling */
451
+ .success-message {
452
+ text-align: center;
453
+ color: #10B981;
454
+ font-size: 1.5rem;
455
+ font-weight: 600;
456
+ margin-top: 1rem;
457
+ animation: fadeIn 0.5s ease-in-out;
458
+ }
459
+ /* Timer styling */
460
+ .delivery-timer {
461
+ color: #F59E0B;
462
+ font-weight: 600;
463
+ }
464
  /* Tier details animation */
465
  .tier-details {
466
  overflow: hidden;
 
582
  .grid {
583
  grid-template-columns: repeat(2, 1fr);
584
  }
585
+ .success-message {
586
+ font-size: 1.25rem;
587
+ }
588
  }
589
  @media (min-width: 768px) {
590
  .grid {
 
605
  <!-- Order Confirmation -->
606
  <div class="section bg-white shadow-sm rounded-xl p-6 mb-6 order-confirmed" role="alert">
607
  <h1 class="text-center text-2xl font-bold text-orange-500">Order Confirmed!</h1>
608
+ <p class="text-center text-gray-600 mt-2">
609
+ Estimated delivery time: <span id="deliveryTimer" class="delivery-timer">{{ delivery_time }}:00</span>
610
+ </p>
611
+ <p id="successMessage" class="success-message hidden">Successfully Delivered!</p>
612
  </div>
613
 
614
  <!-- Reward Status Section -->
 
1009
  }
1010
  }
1011
 
1012
+ // Delivery timer function
1013
+ function startDeliveryTimer(minutes) {
1014
+ try {
1015
+ const timerElement = document.getElementById('deliveryTimer');
1016
+ const successMessage = document.getElementById('successMessage');
1017
+ const deliveryText = document.querySelector('.order-confirmed p.text-center.text-gray-600');
1018
+
1019
+ let totalSeconds = minutes * 60;
1020
+
1021
+ const updateTimer = () => {
1022
+ if (totalSeconds <= 0) {
1023
+ clearInterval(timerInterval);
1024
+ deliveryText.classList.add('hidden');
1025
+ successMessage.classList.remove('hidden');
1026
+ return;
1027
+ }
1028
+
1029
+ const mins = Math.floor(totalSeconds / 60);
1030
+ const secs = totalSeconds % 60;
1031
+ timerElement.textContent = `${mins}:${secs < 10 ? '0' : ''}${secs}`;
1032
+ totalSeconds--;
1033
+ };
1034
+
1035
+ updateTimer(); // Initial call
1036
+ const timerInterval = setInterval(updateTimer, 1000);
1037
+ } catch (e) {
1038
+ console.error('Error in delivery timer:', e);
1039
+ }
1040
+ }
1041
+
1042
+ // Set progress bar color based on points and start delivery timer
1043
  document.addEventListener('DOMContentLoaded', () => {
1044
  try {
1045
+ // Progress bar color
1046
  const progressBar = document.getElementById('progressBar');
1047
  const pointsDisplay = document.getElementById('pointsDisplay');
1048
  const points = parseInt(pointsDisplay.textContent, 10) || 0;
 
1054
  } else {
1055
  progressBar.classList.add('range-200-plus');
1056
  }
 
 
 
1057
 
1058
+ // Start delivery timer
1059
+ const deliveryTimeElement = document.getElementById('deliveryTimer');
1060
+ const deliveryTime = parseInt(deliveryTimeElement.textContent.split(':')[0], 10) || 0;
1061
+ if (deliveryTime > 0) {
1062
+ startDeliveryTimer(deliveryTime);
1063
+ }
1064
+
1065
+ // Lazy load images with IntersectionObserver
1066
+ const images = document.querySelectorAll('img.lazyload');
1067
+ if ('IntersectionObserver' in window) {
1068
+ const observer = new IntersectionObserver((entries, observer) => {
1069
+ entries.forEach(entry => {
1070
+ if (entry.isIntersecting) {
1071
+ const img = entry.target;
1072
+ img.src = img.src || '/static/placeholder.jpg';
1073
+ img.classList.remove('lazyload');
1074
+ observer.unobserve(img);
1075
+ }
1076
+ });
1077
  });
1078
+ images.forEach(img => observer.observe(img));
1079
+ } else {
1080
+ images.forEach(img => {
1081
+ img.src = img.src || '/static/placeholder.jpg';
1082
+ img.classList.remove('lazyload');
1083
+ });
1084
+ }
1085
+ } catch (e) {
1086
+ console.error('Error in DOMContentLoaded:', e);
1087
  }
1088
  });
1089