Update templates/menu.html
Browse files- templates/menu.html +109 -114
templates/menu.html
CHANGED
@@ -149,10 +149,7 @@
|
|
149 |
right: 10px;
|
150 |
top: 50%;
|
151 |
transform: translateY(-50%);
|
152 |
-
|
153 |
-
align-items: center;
|
154 |
-
justify-content: center;
|
155 |
-
z-index: 1100; /* Ensure it’s above other elements */
|
156 |
}
|
157 |
.avatar-icon {
|
158 |
width: 40px;
|
@@ -172,48 +169,44 @@
|
|
172 |
transform: scale(1.1);
|
173 |
}
|
174 |
.dropdown-menu {
|
175 |
-
position: absolute;
|
176 |
-
top: 100%; /* Position directly below the avatar */
|
177 |
-
right: 0;
|
178 |
-
background-color: #fff8f0;
|
179 |
-
border-radius: 8px;
|
180 |
-
width: 240px; /* Slightly wider for better readability */
|
181 |
-
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
|
182 |
-
border: 1px solid #ffd8b1;
|
183 |
display: none;
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
190 |
}
|
191 |
.dropdown-menu.show {
|
192 |
-
display:
|
193 |
-
opacity: 1;
|
194 |
-
transform: translateY(0);
|
195 |
}
|
196 |
-
.dropdown-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
|
|
201 |
display: flex;
|
202 |
align-items: center;
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
.dropdown-menu .dropdown-item i {
|
207 |
-
margin-right: 10px; /* Space between icon and text */
|
208 |
font-size: 16px;
|
209 |
-
|
210 |
}
|
211 |
-
.dropdown-
|
212 |
-
|
213 |
}
|
214 |
-
.dropdown-
|
215 |
-
|
216 |
-
|
|
|
217 |
}
|
218 |
.fixed-top-bar {
|
219 |
position: relative;
|
@@ -893,19 +886,19 @@
|
|
893 |
white-space: nowrap;
|
894 |
}
|
895 |
.bottom-action-bar .btn-order-history {
|
896 |
-
background:
|
897 |
-
border-color:
|
898 |
-
color: #000000;
|
899 |
}
|
900 |
.bottom-action-bar .btn-order-history:hover {
|
901 |
-
background:
|
902 |
-
border-color:
|
903 |
-
color: #000000;
|
904 |
}
|
905 |
.bottom-action-bar .btn-view-cart {
|
906 |
background-color: #0FAA39;
|
907 |
border-color: #0FAA39;
|
908 |
-
color:
|
909 |
}
|
910 |
.bottom-action-bar .btn-view-cart:hover {
|
911 |
background-color: #0D9232;
|
@@ -957,18 +950,16 @@
|
|
957 |
height: 40px;
|
958 |
font-size: 20px;
|
959 |
}
|
960 |
-
.dropdown-
|
961 |
-
width:
|
962 |
-
max-
|
963 |
-
border-radius: 6px;
|
964 |
}
|
965 |
-
.dropdown-
|
966 |
-
padding: 10px
|
967 |
font-size: 14px;
|
968 |
}
|
969 |
-
.dropdown-
|
970 |
-
font-size:
|
971 |
-
margin-right: 8px;
|
972 |
}
|
973 |
.modal-dialog {
|
974 |
max-width: 90%;
|
@@ -1232,10 +1223,12 @@
|
|
1232 |
<span>{{ first_letter }}</span>
|
1233 |
</div>
|
1234 |
<div class="dropdown-menu">
|
1235 |
-
<
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
|
|
|
|
1239 |
</div>
|
1240 |
</div>
|
1241 |
<div class="search-bar-container">
|
@@ -1857,7 +1850,7 @@
|
|
1857 |
dropdownMenu.classList.toggle('show');
|
1858 |
});
|
1859 |
document.addEventListener('click', function (event) {
|
1860 |
-
if (!avatarContainer.contains(event.target)) {
|
1861 |
dropdownMenu.classList.remove('show');
|
1862 |
}
|
1863 |
});
|
@@ -1876,82 +1869,83 @@
|
|
1876 |
try {
|
1877 |
const { name, section } = JSON.parse(selectedItem);
|
1878 |
const menuCards = document.querySelectorAll('.menu-card');
|
1879 |
-
let
|
|
|
1880 |
menuCards.forEach(card => {
|
1881 |
-
|
1882 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1883 |
}
|
1884 |
});
|
1885 |
-
if (
|
1886 |
-
const
|
1887 |
-
const
|
1888 |
-
const
|
1889 |
-
const
|
1890 |
-
const
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
|
|
1899 |
}
|
1900 |
-
localStorage.removeItem('selectedItem');
|
1901 |
} catch (e) {
|
1902 |
console.error('Error parsing selectedItem:', e);
|
|
|
1903 |
localStorage.removeItem('selectedItem');
|
1904 |
}
|
1905 |
}
|
1906 |
-
document.querySelectorAll('.
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
});
|
1911 |
-
video.addEventListener('error', () => {
|
1912 |
-
video.classList.remove('active');
|
1913 |
-
video.previousElementSibling.classList.remove('hidden');
|
1914 |
-
});
|
1915 |
-
});
|
1916 |
-
document.querySelectorAll('.media-wrapper').forEach(wrapper => {
|
1917 |
wrapper.addEventListener('mouseenter', () => {
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
}
|
1922 |
});
|
1923 |
wrapper.addEventListener('mouseleave', () => {
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
}
|
1929 |
});
|
1930 |
wrapper.addEventListener('touchstart', () => {
|
1931 |
wrapper.classList.add('touched');
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
}
|
1936 |
});
|
1937 |
wrapper.addEventListener('touchend', () => {
|
1938 |
setTimeout(() => {
|
1939 |
wrapper.classList.remove('touched');
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
}, 1000);
|
1946 |
});
|
1947 |
});
|
1948 |
-
document.querySelectorAll('.toggle-details')
|
1949 |
-
|
1950 |
-
|
1951 |
-
const
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
|
|
1955 |
}
|
1956 |
});
|
1957 |
});
|
@@ -2105,4 +2099,5 @@
|
|
2105 |
});
|
2106 |
</script>
|
2107 |
</body>
|
2108 |
-
</html>
|
|
|
|
149 |
right: 10px;
|
150 |
top: 50%;
|
151 |
transform: translateY(-50%);
|
152 |
+
z-index: 1100;
|
|
|
|
|
|
|
153 |
}
|
154 |
.avatar-icon {
|
155 |
width: 40px;
|
|
|
169 |
transform: scale(1.1);
|
170 |
}
|
171 |
.dropdown-menu {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
display: none;
|
173 |
+
position: fixed;
|
174 |
+
top: 0;
|
175 |
+
left: 0;
|
176 |
+
width: 100%;
|
177 |
+
height: 100%;
|
178 |
+
background: rgba(0, 0, 0, 0.5);
|
179 |
+
z-index: 1050;
|
180 |
+
justify-content: center;
|
181 |
+
align-items: center;
|
182 |
}
|
183 |
.dropdown-menu.show {
|
184 |
+
display: flex;
|
|
|
|
|
185 |
}
|
186 |
+
.dropdown-content {
|
187 |
+
background-color: #fff;
|
188 |
+
border-radius: 10px;
|
189 |
+
width: 90%;
|
190 |
+
max-width: 300px;
|
191 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
192 |
+
padding: 10px 0;
|
193 |
+
}
|
194 |
+
.dropdown-item {
|
195 |
display: flex;
|
196 |
align-items: center;
|
197 |
+
padding: 12px 20px;
|
198 |
+
text-decoration: none;
|
199 |
+
color: #333;
|
|
|
|
|
200 |
font-size: 16px;
|
201 |
+
transition: background-color 0.2s ease;
|
202 |
}
|
203 |
+
.dropdown-item:hover {
|
204 |
+
background-color: #f8f9fa;
|
205 |
}
|
206 |
+
.dropdown-item i {
|
207 |
+
margin-right: 10px;
|
208 |
+
font-size: 18px;
|
209 |
+
color: #0FAA39;
|
210 |
}
|
211 |
.fixed-top-bar {
|
212 |
position: relative;
|
|
|
886 |
white-space: nowrap;
|
887 |
}
|
888 |
.bottom-action-bar .btn-order-history {
|
889 |
+
background-color: #e9ecef;
|
890 |
+
border-color: #e9ecef;
|
891 |
+
color: #000000;
|
892 |
}
|
893 |
.bottom-action-bar .btn-order-history:hover {
|
894 |
+
background-color: #d1d4d7;
|
895 |
+
border-color: #d1d4d7;
|
896 |
+
color: #000000;
|
897 |
}
|
898 |
.bottom-action-bar .btn-view-cart {
|
899 |
background-color: #0FAA39;
|
900 |
border-color: #0FAA39;
|
901 |
+
color: #ffffff;
|
902 |
}
|
903 |
.bottom-action-bar .btn-view-cart:hover {
|
904 |
background-color: #0D9232;
|
|
|
950 |
height: 40px;
|
951 |
font-size: 20px;
|
952 |
}
|
953 |
+
.dropdown-content {
|
954 |
+
width: 90%;
|
955 |
+
max-width: 280px;
|
|
|
956 |
}
|
957 |
+
.dropdown-item {
|
958 |
+
padding: 10px 15px;
|
959 |
font-size: 14px;
|
960 |
}
|
961 |
+
.dropdown-item i {
|
962 |
+
font-size: 16px;
|
|
|
963 |
}
|
964 |
.modal-dialog {
|
965 |
max-width: 90%;
|
|
|
1223 |
<span>{{ first_letter }}</span>
|
1224 |
</div>
|
1225 |
<div class="dropdown-menu">
|
1226 |
+
<div class="dropdown-content">
|
1227 |
+
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item"><i class="bi bi-person"></i>View Profile</a>
|
1228 |
+
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item"><i class="bi bi-clock-history"></i>Order History</a>
|
1229 |
+
<a href="{{ url_for('combined_summary.combined_summary') }}" class="dropdown-item"><i class="bi bi-file-text"></i>MY Summary</a>
|
1230 |
+
<a href="{{ url_for('logout') }}" class="dropdown-item"><i class="bi bi-box-arrow-right"></i>Logout</a>
|
1231 |
+
</div>
|
1232 |
</div>
|
1233 |
</div>
|
1234 |
<div class="search-bar-container">
|
|
|
1850 |
dropdownMenu.classList.toggle('show');
|
1851 |
});
|
1852 |
document.addEventListener('click', function (event) {
|
1853 |
+
if (!avatarContainer.contains(event.target) && !dropdownMenu.contains(event.target)) {
|
1854 |
dropdownMenu.classList.remove('show');
|
1855 |
}
|
1856 |
});
|
|
|
1869 |
try {
|
1870 |
const { name, section } = JSON.parse(selectedItem);
|
1871 |
const menuCards = document.querySelectorAll('.menu-card');
|
1872 |
+
let targetCard = null;
|
1873 |
+
let buttonContainer = null;
|
1874 |
menuCards.forEach(card => {
|
1875 |
+
const itemName = card.getAttribute('data-item-name');
|
1876 |
+
const itemSection = card.getAttribute('data-item-section');
|
1877 |
+
if (itemName === name && itemSection === section) {
|
1878 |
+
targetCard = card;
|
1879 |
+
buttonContainer = card.querySelector('.button-container');
|
1880 |
+
card.classList.add('highlighted');
|
1881 |
+
card.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
1882 |
+
const toggleLink = card.querySelector('.toggle-details');
|
1883 |
+
if (toggleLink) {
|
1884 |
+
toggleLink.click();
|
1885 |
+
}
|
1886 |
}
|
1887 |
});
|
1888 |
+
if (targetCard && buttonContainer) {
|
1889 |
+
const name = buttonContainer.getAttribute('data-item-name');
|
1890 |
+
const price = buttonContainer.getAttribute('data-item-price');
|
1891 |
+
const image = buttonContainer.getAttribute('data-item-image2');
|
1892 |
+
const description = buttonContainer.getAttribute('data-item-description');
|
1893 |
+
const category = buttonContainer.getAttribute('data-item-category');
|
1894 |
+
setTimeout(() => {
|
1895 |
+
if (section === 'Soft Drinks') {
|
1896 |
+
showSoftDrinkModal(buttonContainer.querySelector('.add-to-cart-btn'));
|
1897 |
+
} else {
|
1898 |
+
showItemDetails(name, price, image, description, section, category);
|
1899 |
+
const modal = new bootstrap.Modal(document.getElementById('itemModal'));
|
1900 |
+
modal.show();
|
1901 |
+
}
|
1902 |
+
}, 1000);
|
1903 |
}
|
|
|
1904 |
} catch (e) {
|
1905 |
console.error('Error parsing selectedItem:', e);
|
1906 |
+
} finally {
|
1907 |
localStorage.removeItem('selectedItem');
|
1908 |
}
|
1909 |
}
|
1910 |
+
const mediaWrappers = document.querySelectorAll('.media-wrapper');
|
1911 |
+
mediaWrappers.forEach(wrapper => {
|
1912 |
+
const video = wrapper.querySelector('.menu-video');
|
1913 |
+
const image = wrapper.querySelector('.menu-image');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1914 |
wrapper.addEventListener('mouseenter', () => {
|
1915 |
+
image.classList.add('hidden');
|
1916 |
+
video.classList.add('active');
|
1917 |
+
video.play().catch(err => console.error('Video play error:', err));
|
|
|
1918 |
});
|
1919 |
wrapper.addEventListener('mouseleave', () => {
|
1920 |
+
video.classList.remove('active');
|
1921 |
+
image.classList.remove('.hidden');
|
1922 |
+
video.pause();
|
1923 |
+
video.currentTime = 0;
|
|
|
1924 |
});
|
1925 |
wrapper.addEventListener('touchstart', () => {
|
1926 |
wrapper.classList.add('touched');
|
1927 |
+
image.classList.add('hidden');
|
1928 |
+
video.classList.add('active');
|
1929 |
+
video.play().catch(err => console.error('Video play error:', err));
|
|
|
1930 |
});
|
1931 |
wrapper.addEventListener('touchend', () => {
|
1932 |
setTimeout(() => {
|
1933 |
wrapper.classList.remove('touched');
|
1934 |
+
video.classList.remove('active');
|
1935 |
+
image.classList.remove('hidden');
|
1936 |
+
video.pause();
|
1937 |
+
video.currentTime = 0;
|
1938 |
+
}, 500);
|
|
|
1939 |
});
|
1940 |
});
|
1941 |
+
const toggleDetailsLinks = document.querySelectorAll('.toggle-details');
|
1942 |
+
toggleDetailsLinks.forEach(link => {
|
1943 |
+
link.addEventListener('click', function () {
|
1944 |
+
const itemName = this.getAttribute('data-item-name').replace(/\s+/g, '-');
|
1945 |
+
const detailsDiv = document.getElementById(`details-${itemName}`);
|
1946 |
+
if (detailsDiv) {
|
1947 |
+
detailsDiv.classList.toggle('show');
|
1948 |
+
this.textContent = detailsDiv.classList.contains('show') ? 'Hide Details' : 'Show Details';
|
1949 |
}
|
1950 |
});
|
1951 |
});
|
|
|
2099 |
});
|
2100 |
</script>
|
2101 |
</body>
|
2102 |
+
</html>
|
2103 |
+
</xaiArtifact>
|