Spaces:
Runtime error
Runtime error
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Menu</title> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet"> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
background-color: #fdf4e3; | |
margin: 0; | |
padding: 0; | |
display: flex; | |
flex-direction: column; | |
} | |
.container { | |
max-width: 900px; | |
} | |
.menu-card { | |
max-width: 350px; | |
border-radius: 15px; | |
overflow: hidden; | |
background-color: #fff; | |
margin: auto; | |
display: flex; | |
flex-direction: column; | |
} | |
.menu-image { | |
height: 200px; | |
width: 100%; | |
object-fit: fill; | |
border-radius: 15px 15px 0 0; | |
} | |
.card-title { | |
font-size: 1.2rem; | |
font-weight: bold; | |
margin: 10px 0; | |
} | |
.card-text { | |
font-size: 1rem; | |
color: #6c757d; | |
} | |
.btn-primary { | |
font-size: 13px; | |
font-weight: bold; | |
border-radius: 5px; | |
width: 100px; | |
background-color: #0FAA39; | |
border-color: #0FAA39; | |
} | |
.btn-primary:hover { | |
background-color: #0FAA39; | |
border-color: #0FAA39; | |
} | |
.btn-primary:active, | |
.btn-primary:focus { | |
background-color: #0FAA39; | |
border-color: #ffffff; | |
box-shadow: none; | |
} | |
.menu-section-container { | |
position: relative; | |
margin-bottom: 50px; | |
} | |
.menu-items-container { | |
max-height: 350px; | |
overflow-y: hidden; | |
display: flex; | |
flex-direction: column; | |
gap: 10px; | |
padding-right: 20px; | |
transition: transform 0.3s ease; | |
} | |
.menu-card { | |
background-color: #fff; | |
padding: 10px; | |
border-radius: 8px; | |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
text-align: center; | |
} | |
.menu-image { | |
width: 100%; | |
height: 200px; | |
object-fit: cover; | |
border-radius: 8px; | |
} | |
.scroll-buttons { | |
position: absolute; | |
top: 50%; | |
right: 10px; | |
transform: translateY(-50%); | |
display: flex; | |
flex-direction: column; | |
gap: 10px; | |
} | |
.scroll-buttons button { | |
background-color: #0FAA39; | |
color: white; | |
border: none; | |
padding: 10px; | |
cursor: pointer; | |
font-size: 20px; | |
border-radius: 50%; | |
} | |
.scroll-buttons button:hover { | |
background-color: #109835; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container mt-4"> | |
<h1 class="text-center">Menu</h1> | |
<div class="menu-section-container"> | |
<h3>Best Sellers</h3> | |
<div class="menu-items-container" id="menuItemsContainer"> | |
{% for item in ordered_menu['Best Sellers'] %} | |
<div class="menu-card"> | |
<img src="{{ item.Image1__c }}" class="menu-image" alt="{{ item.Name }}"> | |
<h5 class="card-title">{{ item.Name }}</h5> | |
<p class="card-price">${{ item.Price__c }}</p> | |
<button class="btn btn-primary">Add</button> | |
</div> | |
{% endfor %} | |
</div> | |
<div class="scroll-buttons"> | |
<button class="scroll-up" onclick="scrollUp()">↑</button> | |
<button class="scroll-down" onclick="scrollDown()">↓</button> | |
</div> | |
</div> | |
</div> | |
<script> | |
let scrollPosition = 0; | |
function scrollUp() { | |
const container = document.getElementById('menuItemsContainer'); | |
const itemHeight = container.children[0].offsetHeight + 10; | |
scrollPosition = Math.max(scrollPosition - itemHeight, 0); | |
container.style.transform = `translateY(-${scrollPosition}px)`; | |
} | |
function scrollDown() { | |
const container = document.getElementById('menuItemsContainer'); | |
const itemHeight = container.children[0].offsetHeight + 10; | |
scrollPosition = Math.min(scrollPosition + itemHeight, container.scrollHeight); | |
container.style.transform = `translateY(-${scrollPosition}px)`; | |
} | |
</script> | |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> | |
</body> | |
</html> | |