|
|
@@ -1,117 +1,197 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="es">
|
|
|
<head>
|
|
|
- <meta charset="UTF-8">
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <title>Biergarten Klein - Pedidos</title>
|
|
|
- <script src="https://cdn.tailwindcss.com"></script>
|
|
|
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
|
- <link rel="stylesheet" href="styles.css">
|
|
|
- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
|
- <script type="module" src="js/app.js"></script>
|
|
|
+ <meta charset="UTF-8" />
|
|
|
+ <title>Biergarten Klein</title>
|
|
|
+
|
|
|
+ <!-- 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 text-base leading-relaxed">
|
|
|
-
|
|
|
- <div id="welcomeModal" class="modal" style="display: flex;">
|
|
|
- <div class="modal-content text-center">
|
|
|
- <h3 class="text-2xl font-semibold mb-4 accent-red">Bienvenido a Biergarten Klein</h3>
|
|
|
- <p class="text-gray-400 mb-6">Para comenzar, por favor ingresa tu nombre y número de mesa.</p>
|
|
|
- <div class="space-y-4">
|
|
|
- <input type="text" id="userNameInput" class="w-full p-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-accent-red focus:border-transparent outline-none text-white" placeholder="Tu Nombre">
|
|
|
- <input type="number" id="userTableInput" class="w-full p-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-accent-red focus:border-transparent outline-none text-white" placeholder="Número de Mesa">
|
|
|
+
|
|
|
+<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>
|
|
|
- <button id="startOrderButton" class="w-full mt-6 bg-accent-red hover:bg-red-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300 ease-in-out transform hover:scale-105">
|
|
|
- Comenzar Pedido
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- <header class="bg-black shadow-lg py-4">
|
|
|
- <div class="container mx-auto px-4 text-center">
|
|
|
- <h1 class="text-3xl font-bold accent-red tracking-tight">Biergarten <span class="text-white">Klein</span></h1>
|
|
|
- <p class="text-gray-400 text-md mt-1">¡El sabor de la buena compañía!</p>
|
|
|
- </div>
|
|
|
- </header>
|
|
|
-
|
|
|
- <main class="container mx-auto px-4 py-8 flex-grow grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
|
-
|
|
|
- <aside class="lg:col-span-1">
|
|
|
- <div id="chat-container" class="sticky top-8 chat-panel-embedded">
|
|
|
- <div class="chat-header">
|
|
|
- <h3 class="text-xl font-semibold accent-red">Chef IA <span class="text-sm text-gray-400">(Asistente Virtual)</span></h3>
|
|
|
- </div>
|
|
|
- <div class="chat-content-area">
|
|
|
- <div id="chatMessages" class="scrollable-chat">
|
|
|
- <div class="chat-bubble chat-bubble-ai">¡Hola! Soy tu asistente en Biergarten Klein. ¿Te gustaría una recomendación de nuestras cervezas artesanales?</div>
|
|
|
- </div>
|
|
|
- <div id="aiLoadingIndicator" class="hidden my-2">
|
|
|
- <div class="loading-spinner"></div>
|
|
|
- <p class="text-center text-sm text-gray-400 mt-1">Chef IA está pensando...</p>
|
|
|
- </div>
|
|
|
- <div class="chat-input-container">
|
|
|
- <input type="text" id="chatInput" class="w-full p-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-accent-red focus:border-transparent outline-none text-white" placeholder="Escribe tu mensaje...">
|
|
|
- <button id="sendChatButton" class="bg-accent-red hover:bg-red-700 text-white font-bold py-2 px-4 rounded-lg transition duration-300">
|
|
|
- Enviar
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </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>
|
|
|
- </aside>
|
|
|
-
|
|
|
- <div class="lg:col-span-2 space-y-8">
|
|
|
- <section id="productListSection">
|
|
|
- <h2 class="category-title text-3xl font-semibold mb-4 pb-2">Nuestras Cervezas</h2>
|
|
|
- <div id="productList" class="space-y-6">
|
|
|
- </div>
|
|
|
- </section>
|
|
|
-
|
|
|
- <aside id="cartAside">
|
|
|
- <div class="sticky top-8">
|
|
|
- <h2 class="text-3xl font-semibold mb-4 border-b-2 border-accent-red pb-2">Tu Pedido</h2>
|
|
|
- <div id="cartItems" class="space-y-4 mb-6 product-card p-6 rounded-lg shadow-xl min-h-[150px]">
|
|
|
- <p id="emptyCartText" class="text-gray-400">Tu carrito está vacío.</p>
|
|
|
- </div>
|
|
|
- <div class="product-card p-6 rounded-lg shadow-xl">
|
|
|
- <div class="flex justify-between items-center text-xl font-semibold mb-4">
|
|
|
- <span>Total:</span>
|
|
|
- <span id="cartTotal" class="accent-red">$0</span>
|
|
|
- </div>
|
|
|
- <button id="checkoutButton" class="w-full bg-accent-red hover:bg-red-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300 ease-in-out transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
|
|
|
- Finalizar Pedido
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </aside>
|
|
|
- </div>
|
|
|
- </main>
|
|
|
-
|
|
|
- <div id="orderConfirmationModal" class="modal">
|
|
|
- <div class="modal-content text-center">
|
|
|
- <span id="closeConfirmationModalButton" class="close-button absolute top-3 right-4">×</span>
|
|
|
- <h3 class="text-2xl font-semibold mb-4 accent-red">¡Pedido Realizado!</h3>
|
|
|
- <p class="text-lg mb-2">Gracias por tu compra en Biergarten Klein.</p>
|
|
|
- <p class="text-gray-400 mb-6">Tu pedido está siendo preparado y llegará pronto.</p>
|
|
|
- <svg class="w-16 h-16 text-green-500 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
|
|
- <button id="newOrderButton" class="bg-accent-red hover:bg-red-700 text-white font-bold py-2 px-4 rounded-lg">
|
|
|
- Hacer un Nuevo Pedido
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div id="orderErrorModal" class="modal">
|
|
|
- <div class="modal-content text-center">
|
|
|
- <span id="closeOrderErrorModalButton" class="close-button absolute top-3 right-4">×</span>
|
|
|
- <h3 class="text-2xl font-semibold mb-4 accent-red">¡Error al enviar el pedido!</h3>
|
|
|
- <p class="text-lg mb-2">Hubo un problema al enviar tu pedido. Por favor, inténtalo de nuevo.</p>
|
|
|
- <svg class="w-16 h-16 text-red-500 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 9.172L14.828 14.828M14.828 9.172L9.172 14.828M12 2a10 10 0 110 20 10 10 0 010-20z"></path></svg>
|
|
|
- <button id="retryButton" class="bg-accent-red hover:bg-red-700 text-white font-bold py-2 px-4 rounded-lg">Reintentar</button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- <footer class="bg-black py-6 mt-auto border-t border-gray-800">
|
|
|
- <div class="container mx-auto px-4 text-center text-gray-500">
|
|
|
- <p>© <span id="currentYear"></span> Biergarten Klein. Todos los derechos reservados.</p>
|
|
|
- <p>Diseñado con <span class="accent-red">♥</span> para los amantes de la buena cerveza.</p>
|
|
|
+ </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>
|
|
|
- </footer>
|
|
|
+ <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]">
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+</html>
|