| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta charset="UTF-8" />
- <title>Biergarten Klein</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <!-- Fuentes + Tailwind -->
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link rel="stylesheet" as="style" onload="this.rel='stylesheet'"
- href="https://fonts.googleapis.com/css2?display=swap&family=Noto+Sans:wght@400;500;700;900&family=Spline+Sans:wght@400;500;700">
- <script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
- <!-- Markdown -->
- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
- <!-- Lógica principal -->
- <script src="js/app.js" type="module"></script>
- <link rel="stylesheet" href="styles.css">
- <style>
- @keyframes slideIn {from {transform:translateY(-8px); opacity:0;} to {transform:translateY(0); opacity:1;}}
- @keyframes slideOut {from {transform:translateY(0); opacity:1;} to {transform:translateY(-8px); opacity:0;}}
- </style>
- </head>
- <body class="min-h-screen flex flex-col bg-gray-50 overflow-x-hidden"
- style='font-family:"Spline Sans","Noto Sans",sans-serif;'>
- <!-- ---------- HEADER ---------- -->
- <header class="fixed top-0 inset-x-0 z-10 bg-gray-50 p-4 flex justify-center items-center border-b border-gray-200">
- <h1 class="text-lg font-bold text-[#101419] tracking-tight">
- Biergarten Klein
- </h1>
- </header>
- <!-- ---------- MAIN ---------- -->
- <main class="flex-1 pt-16 pb-20">
- <!-- ===== MENÚ tab ===== -->
- <section id="menuTab" data-tab>
- <div class="px-4 pt-4 pb-3">
- <h2 class="text-[22px] font-bold text-[#101419] tracking-tight">
- Nuestra Selección de Cervezas
- </h2>
- </div>
- <div class="px-4">
- <ul id="productList" class="space-y-6"></ul>
- </div>
- <template id="product-card-template">
- <li class="flex items-stretch justify-between gap-4 rounded-xl">
- <div class="flex flex-[2_2_0px] flex-col gap-4">
- <div class="flex flex-col gap-1">
- <p class="product-type text-[#58728d] text-sm"></p>
- <p class="product-name text-[#101419] text-base font-bold leading-tight"></p>
- <p class="product-description text-[#58728d] text-sm"></p>
- </div>
- <!-- Botón Añadir -->
- <div class="flex items-center gap-3">
- <button class="add-to-cart-btn flex items-center gap-1 w-fit h-8 px-3
- rounded-full bg-[#101419] hover:bg-[#37404a] text-white text-sm font-medium">
-
-
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
- <path d="M12 5v14m7-7H5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
- Añadir
- </button>
- <!-- Precio -->
- <span class="product-price text-sm font-semibold text-[#101419]"></span>
- </div>
- </div>
- <div class="product-image flex-1 aspect-video bg-cover bg-center rounded-xl"></div>
- </li>
- </template>
- </section>
- <!-- ===== CHAT ===== -->
- <section id="chatTab" data-tab class="hidden flex flex-col h-full">
- <div id="chatMessages" class="flex-1 overflow-y-auto p-4 space-y-3 text-sm leading-relaxed"></div>
- <div id="aiLoadingIndicator" class="hidden px-4 py-2 text-center text-xs text-gray-500">Pensando…</div>
- <form class="flex gap-2 p-3 border-t border-gray-200" onsubmit="event.preventDefault();">
- <input id="chatInput" class="flex-1 text-sm px-3 py-2 rounded-md border border-gray-300 focus:outline-none text-neutral-800" autocomplete="off"
- placeholder="Escribe tu mensaje...">
- <button id="sendChatButton"
- class="bg-[#101419] hover:bg-[#37404a] text-white px-3 py-2 rounded-md text-sm">
- Enviar
- </button>
- </form>
- </section>
- <!-- ===== CARRITO ===== -->
- <section id="cartTab" data-tab class="hidden flex flex-col h-full">
- <header class="p-4 border-b border-gray-200">
- <h3 class="text-lg font-bold text-[#101419]">Tu pedido</h3>
- </header>
- <div id="cartItems" class="flex-1 overflow-y-auto p-4 space-y-2"></div>
- <p id="emptyCartText" class="hidden text-center text-gray-400 mt-4">Tu carrito está vacío.</p>
- <footer class="p-4 border-t border-gray-200 space-y-3">
- <div class="flex justify-between text-base">
- <span>Total:</span>
- <span id="cartTotal">$0</span>
- </div>
- <button id="checkoutButton"
- class="w-full bg-[#101419] hover:bg-[#37404a] disabled:opacity-50 text-white py-2 rounded-md"
- disabled>
- Finalizar Pedido
- </button>
- </footer>
- </section>
- </main>
- <!-- ---------- NAVBAR ---------- -->
- <footer class="fixed bottom-0 inset-x-0 z-10 border-t border-gray-200 bg-gray-50 px-4 py-2">
- <nav class="flex gap-2">
- <button data-target="chatTab" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
- viewBox="0 0 256 256" class="h-8">
- <path
- d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM84,116a12,12,0,1,0,12,12A12,12,0,0,0,84,116Zm88,0a12,12,0,1,0,12,12A12,12,0,0,0,172,116Zm60,12A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z" />
- </svg>
- <span class="text-xs font-medium">Chat</span>
- </button>
- <button data-target="menuTab" class="tab-btn flex-1 flex flex-col items-center text-[#101419]">
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
- viewBox="0 0 256 256" class="h-8">
- <path
- d="M56,128a16,16,0,1,1-16-16A16,16,0,0,1,56,128ZM40,48A16,16,0,1,0,56,64,16,16,0,0,0,40,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,40,176Zm176-64H88a8,8,0,0,0-8,8v16a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V120A8,8,0,0,0,216,112Zm0-64H88a8,8,0,0,0-8,8V72a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V56A8,8,0,0,0,216,48Zm0,128H88a8,8,0,0,0-8,8v16a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V184A8,8,0,0,0,216,176Z" />
- </svg>
- <span class="text-xs font-medium">Menú</span>
- </button>
- <button data-target="cartTab" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
- <div id="cartIcon">
- <span id="cartCount">0</span>
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
- viewBox="0 0 256 256" class="h-8">
- <path
- d="M222.14,58.87A8,8,0,0,0,216,56H54.68L49.79,29.14A16,16,0,0,0,34.05,16H16a8,8,0,0,0,0,16h18L59.56,172.29a24,24,0,0,0,5.33,11.27,28,28,0,1,0,44.4,8.44h45.42A27.75,27.75,0,0,0,152,204a28,28,0,1,0,28-28H83.17a8,8,0,0,1-7.87-6.57L72.13,152h116a24,24,0,0,0,23.61-19.71l12.16-66.86A8,8,0,0,0,222.14,58.87ZM96,204a12,12,0,1,1-12-12A12,12,0,0,1,96,204Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,192,204Zm4-74.57A8,8,0,0,1,188.1,136H69.22L57.59,72H206.41Z" />
- </svg>
- </div>
- <span class="text-xs font-medium">Carrito</span>
- </button>
- </nav>
- </footer>
- <!-- ---------- TOAST ---------- -->
- <div id="toastCart"
- class="fixed top-4 left-1/2 -translate-x-1/2 bg-[#101419] text-white text-sm
- rounded-md px-4 py-2 shadow-lg opacity-0 pointer-events-none z-50"></div>
-
- <!-- === MODAL INICIO DE SESIÓN === -->
- <div id="sessionModal"
- class="fixed inset-0 bg-black/70 flex items-center justify-center z-50">
- <div class="bg-white w-full max-w-sm p-6 rounded-lg space-y-4 text-center">
- <h2 class="text-xl font-bold">¡Bienvenido!</h2>
- <p class="text-sm text-gray-600">
- Ingresa tu número de mesa y tu código de cliente para comenzar.
- </p>
- <input id="tableInput"
- type="number" min="1"
- class="w-full border px-3 py-2 rounded-md"
- placeholder="Mesa #" />
- <input id="clientCodeInput"
- class="w-full border px-3 py-2 rounded-md"
- placeholder="Código de cliente" />
- <button id="sessionAcceptBtn"
- class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-2 rounded-md">
- Aceptar
- </button>
- </div>
- </div>
- <!-- ---------- JS: conmutar tabs + toast ---------- -->
- <script>
- // conmutar pestañas
- document.querySelectorAll('.tab-btn').forEach(btn => {
- btn.addEventListener('click', () => {
- const target = btn.dataset.target;
- document.querySelectorAll('[data-tab]').forEach(tab => {
- tab.classList.toggle('hidden', tab.id !== target);
- });
- });
- });
- // toast simple
- window.showToast = (msg) => {
- const toast = document.getElementById('toastCart');
- toast.textContent = msg;
- toast.style.animation = 'none'; // reset
- void toast.offsetWidth; // reflow
- toast.style.opacity = '1';
- toast.style.animation = 'slideIn 0.2s ease-out, slideOut 0.2s ease-in 0.8s forwards';
- };
- </script>
- </body>
- </html>
|