index.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Biergarten Klein</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <!-- Fuentes + Tailwind -->
  8. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  9. <link rel="stylesheet" as="style" onload="this.rel='stylesheet'"
  10. href="https://fonts.googleapis.com/css2?display=swap&family=Noto+Sans:wght@400;500;700;900&family=Spline+Sans:wght@400;500;700">
  11. <script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
  12. <!-- Markdown -->
  13. <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  14. <!-- Lógica principal -->
  15. <script src="js/app.js" type="module"></script>
  16. <link rel="stylesheet" href="styles.css">
  17. <style>
  18. @keyframes slideIn {from {transform:translateY(-8px); opacity:0;} to {transform:translateY(0); opacity:1;}}
  19. @keyframes slideOut {from {transform:translateY(0); opacity:1;} to {transform:translateY(-8px); opacity:0;}}
  20. </style>
  21. </head>
  22. <body class="min-h-screen flex flex-col bg-gray-50 overflow-x-hidden"
  23. style='font-family:"Spline Sans","Noto Sans",sans-serif;'>
  24. <!-- ---------- HEADER ---------- -->
  25. <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">
  26. <h1 class="text-lg font-bold text-[#101419] tracking-tight">
  27. Biergarten Klein
  28. </h1>
  29. </header>
  30. <!-- ---------- MAIN ---------- -->
  31. <main class="flex-1 pt-16 pb-20">
  32. <!-- ===== MENÚ tab ===== -->
  33. <section id="menuTab" data-tab>
  34. <div class="px-4 pt-4 pb-3">
  35. <h2 class="text-[22px] font-bold text-[#101419] tracking-tight">
  36. Nuestra Selección de Cervezas
  37. </h2>
  38. </div>
  39. <div class="px-4">
  40. <ul id="productList" class="space-y-6"></ul>
  41. </div>
  42. <template id="product-card-template">
  43. <li class="flex items-stretch justify-between gap-4 rounded-xl">
  44. <div class="flex flex-[2_2_0px] flex-col gap-4">
  45. <div class="flex flex-col gap-1">
  46. <p class="product-type text-[#58728d] text-sm"></p>
  47. <p class="product-name text-[#101419] text-base font-bold leading-tight"></p>
  48. <p class="product-description text-[#58728d] text-sm"></p>
  49. </div>
  50. <!-- Botón Añadir -->
  51. <div class="flex items-center gap-3">
  52. <button class="add-to-cart-btn flex items-center gap-1 w-fit h-8 px-3
  53. rounded-full bg-[#101419] hover:bg-[#37404a] text-white text-sm font-medium">
  54. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
  55. <path d="M12 5v14m7-7H5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  56. </svg>
  57. Añadir
  58. </button>
  59. <!-- Precio -->
  60. <span class="product-price text-sm font-semibold text-[#101419]"></span>
  61. </div>
  62. </div>
  63. <div class="product-image flex-1 aspect-video bg-cover bg-center rounded-xl"></div>
  64. </li>
  65. </template>
  66. </section>
  67. <!-- ===== CHAT ===== -->
  68. <section id="chatTab" data-tab class="hidden flex flex-col h-full">
  69. <div id="chatMessages" class="flex-1 overflow-y-auto p-4 space-y-3 text-sm leading-relaxed"></div>
  70. <div id="aiLoadingIndicator" class="hidden px-4 py-2 text-center text-xs text-gray-500">Pensando…</div>
  71. <form class="flex gap-2 p-3 border-t border-gray-200" onsubmit="event.preventDefault();">
  72. <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"
  73. placeholder="Escribe tu mensaje...">
  74. <button id="sendChatButton"
  75. class="bg-[#101419] hover:bg-[#37404a] text-white px-3 py-2 rounded-md text-sm">
  76. Enviar
  77. </button>
  78. </form>
  79. </section>
  80. <!-- ===== CARRITO ===== -->
  81. <section id="cartTab" data-tab class="hidden flex flex-col h-full">
  82. <header class="p-4 border-b border-gray-200">
  83. <h3 class="text-lg font-bold text-[#101419]">Tu pedido</h3>
  84. </header>
  85. <div id="cartItems" class="flex-1 overflow-y-auto p-4 space-y-2"></div>
  86. <p id="emptyCartText" class="hidden text-center text-gray-400 mt-4">Tu carrito está vacío.</p>
  87. <footer class="p-4 border-t border-gray-200 space-y-3">
  88. <div class="flex justify-between text-base">
  89. <span>Total:</span>
  90. <span id="cartTotal">$0</span>
  91. </div>
  92. <button id="checkoutButton"
  93. class="w-full bg-[#101419] hover:bg-[#37404a] disabled:opacity-50 text-white py-2 rounded-md"
  94. disabled>
  95. Finalizar Pedido
  96. </button>
  97. </footer>
  98. </section>
  99. </main>
  100. <!-- ---------- NAVBAR ---------- -->
  101. <footer class="fixed bottom-0 inset-x-0 z-10 border-t border-gray-200 bg-gray-50 px-4 py-2">
  102. <nav class="flex gap-2">
  103. <button data-target="chatTab" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  104. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
  105. viewBox="0 0 256 256" class="h-8">
  106. <path
  107. 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" />
  108. </svg>
  109. <span class="text-xs font-medium">Chat</span>
  110. </button>
  111. <button data-target="menuTab" class="tab-btn flex-1 flex flex-col items-center text-[#101419]">
  112. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
  113. viewBox="0 0 256 256" class="h-8">
  114. <path
  115. 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" />
  116. </svg>
  117. <span class="text-xs font-medium">Menú</span>
  118. </button>
  119. <button data-target="cartTab" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  120. <div id="cartIcon">
  121. <span id="cartCount">0</span>
  122. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
  123. viewBox="0 0 256 256" class="h-8">
  124. <path
  125. 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" />
  126. </svg>
  127. </div>
  128. <span class="text-xs font-medium">Carrito</span>
  129. </button>
  130. </nav>
  131. </footer>
  132. <!-- ---------- TOAST ---------- -->
  133. <div id="toastCart"
  134. class="fixed top-4 left-1/2 -translate-x-1/2 bg-[#101419] text-white text-sm
  135. rounded-md px-4 py-2 shadow-lg opacity-0 pointer-events-none z-50"></div>
  136. <!-- === MODAL INICIO DE SESIÓN === -->
  137. <div id="sessionModal"
  138. class="fixed inset-0 bg-black/70 flex items-center justify-center z-50">
  139. <div class="bg-white w-full max-w-sm p-6 rounded-lg space-y-4 text-center">
  140. <h2 class="text-xl font-bold">¡Bienvenido!</h2>
  141. <p class="text-sm text-gray-600">
  142. Ingresa tu número de mesa y tu código de cliente para comenzar.
  143. </p>
  144. <input id="tableInput"
  145. type="number" min="1"
  146. class="w-full border px-3 py-2 rounded-md"
  147. placeholder="Mesa #" />
  148. <input id="clientCodeInput"
  149. class="w-full border px-3 py-2 rounded-md"
  150. placeholder="Código de cliente" />
  151. <button id="sessionAcceptBtn"
  152. class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-2 rounded-md">
  153. Aceptar
  154. </button>
  155. </div>
  156. </div>
  157. <!-- ---------- JS: conmutar tabs + toast ---------- -->
  158. <script>
  159. // conmutar pestañas
  160. document.querySelectorAll('.tab-btn').forEach(btn => {
  161. btn.addEventListener('click', () => {
  162. const target = btn.dataset.target;
  163. document.querySelectorAll('[data-tab]').forEach(tab => {
  164. tab.classList.toggle('hidden', tab.id !== target);
  165. });
  166. });
  167. });
  168. // toast simple
  169. window.showToast = (msg) => {
  170. const toast = document.getElementById('toastCart');
  171. toast.textContent = msg;
  172. toast.style.animation = 'none'; // reset
  173. void toast.offsetWidth; // reflow
  174. toast.style.opacity = '1';
  175. toast.style.animation = 'slideIn 0.2s ease-out, slideOut 0.2s ease-in 0.8s forwards';
  176. };
  177. </script>
  178. </body>
  179. </html>