index.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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. <link rel="stylesheet" href="express/animations.css">
  13. <!--Tailwind-->
  14. <script>
  15. tailwind.config = {
  16. theme: {
  17. extend: {
  18. colors: {
  19. 'custom-dark': '#101419',
  20. 'custom-dark-hover': '#37404a',
  21. 'gray-50': '#f9fafb',
  22. 'gray-100': '#f3f4f6',
  23. }
  24. }
  25. }
  26. }
  27. </script>
  28. <!-- Markdown -->
  29. <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  30. <script src="express/js/app.js" type="module"></script>
  31. <link rel="stylesheet" href="express/styles.css">
  32. </head>
  33. <body class="h-[100dvh] max-h-[100dvh] flex flex-col bg-gray-50 overflow-x-hidden"
  34. style='font-family:"Spline Sans","Noto Sans",sans-serif;'>
  35. <!-- ---------- HEADER ---------- -->
  36. <header class="flex-col top-0 inset-x-0 z-10 bg-gray-50 p-2 flex justify-center items-center border-b border-gray-200">
  37. <h1 id="mainTitle" class="text-[26px] font-bold text-[#101419] tracking-tight">
  38. Biergarten Klein
  39. </h1>
  40. </header>
  41. <!-- ---------- MAIN ---------- -->
  42. <main class="relative flex-1 flex flex-col min-h-0 overflow-x-hidden">
  43. <!-- ===== MENÚ tab ===== -->
  44. <section id="menuTab" data-index="0" class="min-h-0 overflow-y-auto h-full" data-tab>
  45. <div class="pt-4 pb-3">
  46. <!-- Barra de progreso para cerveza gratis -->
  47. <div class="mx-4 mb-6 p-4 bg-gradient-to-r from-amber-50 to-orange-50 rounded-xl border border-amber-200">
  48. <div class="flex items-center justify-between mb-2">
  49. <div class="flex items-center gap-2">
  50. <span class="text-lg">🍺</span>
  51. <span class="text-sm font-semibold text-amber-800">¡Cerveza gratis al 100%!</span>
  52. </div>
  53. <span id="progressText" class="text-sm font-bold text-amber-700">100%</span>
  54. </div>
  55. <div class="relative w-full h-3 bg-amber-100 rounded-full overflow-hidden shadow-inner">
  56. <!-- Barra de progreso animada -->
  57. <div id="progressBar" class="h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all duration-500 ease-out shadow-sm relative overflow-hidden" style="width: 100%">
  58. <!-- Efecto de brillo -->
  59. <div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/30 to-transparent skew-x-12 animate-pulse"></div>
  60. </div>
  61. <!-- Indicador de meta -->
  62. <div class="absolute right-1 top-1/2 transform -translate-y-1/2">
  63. <div class="w-2 h-2 bg-amber-600 rounded-full border border-white shadow-sm"></div>
  64. </div>
  65. </div>
  66. <div class="flex items-center justify-between mt-2">
  67. <span class="text-xs text-amber-700">Cada compra suma puntos</span>
  68. <button id="rewardBtn" class="text-xs bg-amber-500 hover:bg-amber-600 text-white px-3 py-1 rounded-full font-medium transition-colors duration-200 opacity-50 cursor-not-allowed" disabled>
  69. 🎉 ¡Reclamar!
  70. </button>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="px-4 overflow-y-auto">
  75. <form>
  76. <input type="text" id="searchInput" placeholder="Buscar..." class="w-full px-4 py-2 mb-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#101419]">
  77. </form>
  78. <ul id="productList" class="space-y-6">
  79. </ul>
  80. </div>
  81. <template id="product-card-template">
  82. <li class="flex items-stretch justify-between gap-4 rounded-xl">
  83. <div class="flex flex-[2_2_0px] flex-col gap-4">
  84. <div class="flex flex-col gap-1">
  85. <p class="product-type text-[#58728d] text-sm"></p>
  86. <p class="product-name text-[#101419] text-base font-bold leading-tight"></p>
  87. <p class="product-description text-[#58728d] text-sm"></p>
  88. </div>
  89. <div class="flex items-center gap-3">
  90. <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">
  91. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
  92. <path d="M12 5v14m7-7H5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  93. </svg>
  94. Añadir
  95. </button>
  96. <span class="product-price text-sm font-semibold text-[#101419]"></span>
  97. </div>
  98. </div>
  99. <div class="product-image flex-1 aspect-video bg-cover bg-center rounded-xl"></div>
  100. </li>
  101. </template>
  102. </section>
  103. <!-- ===== CHAT ===== -->
  104. <section id="chatTab" data-index="2" data-tab class="flex hidden flex-col flex-1 min-h-0">
  105. <!-- Contenedor de mensajes que puede crecer y hacer scroll -->
  106. <div id="chatMessages" class="flex-1 overflow-y-auto px-5 md:px-8 py-4 flex flex-col gap-4">
  107. <!-- Sugerencias y Bajada -->
  108. <div class="text-center text-gray-600 px-5 text-sm leading-relaxed max-w-full">
  109. <h2 class="text-md text-gray-500 mt-5">Conversa con nuestro asistente IA: descubre nuestras cervezas 🍻 y sugiere mejoras para nuestra app ✨<span class="mx-0.5">🍻</span></h2>
  110. <!-- Ideas de mensajes -->
  111. <div id="chatSuggestions" class="grid grid-cols-1 gap-3 max-w-2xl mx-auto mt-5">
  112. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  113. <div class="text-lg mb-1">🍺</div>
  114. <div class="chat-suggestion text-gray-400 font-medium text-xs">¿Que me puedes contar de la burlesque?</div>
  115. </div>
  116. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  117. <div class="text-lg mb-1">⁉️</div>
  118. <div class="chat-suggestion text-gray-400 font-medium text-xs">Mi sugerencia para la aplicacion es...</div>
  119. </div>
  120. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  121. <div class="text-lg mb-1">🍕</div>
  122. <div class="chat-suggestion text-gray-400 font-medium text-xs">¿Qué pizza queda bien con la hoppy mosh?</div>
  123. </div>
  124. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  125. <div class="text-lg mb-1">📱</div>
  126. <div class="chat-suggestion text-gray-400 font-medium text-xs">La orden no se envio bien</div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <!-- Indicador de carga - FIJO arriba del input -->
  132. <div id="aiLoadingIndicator" class="hidden flex px-5 py-3 text-left text-sm text-gray-500 italic flex-shrink-0">
  133. Pensando
  134. </div>
  135. <!-- Input del chat - FIJO en la parte inferior -->
  136. <div class="px-4 py-4 md:px-5 md:py-5 bg-white border-t border-gray-200 flex-shrink-0">
  137. <form id="chatForm" class="flex items-center bg-gray-50 border border-gray-300 rounded-3xl px-5 py-1 transition-colors focus-within:border-gray-400">
  138. <input
  139. id="chatInput"
  140. class="flex-1 sticky flex-shrink-0 bg-transparent border-none outline-none text-gray-900 text-sm py-3 placeholder-gray-500"
  141. autocomplete="off"
  142. placeholder="Pregunta lo que quieras"
  143. maxlength="2000"
  144. >
  145. <button id="sendChatButton" type="submit" class="bg-custom-dark hover:bg-custom-dark-hover text-white border-none rounded-2xl px-4 py-2.5 text-sm transition-colors ml-2 disabled:bg-gray-400 disabled:cursor-not-allowed">
  146. Enviar
  147. </button>
  148. </form>
  149. </div>
  150. </section>
  151. <!-- ===== CARRITO ===== -->
  152. <section id="cartTab" data-tab data-index="1" class="flex flex-col hidden flex-1 min-h-0">
  153. <header class="p-4 border-b border-gray-200">
  154. <h3 class="text-lg font-bold text-[#101419]">Tu pedido</h3>
  155. </header>
  156. <div id="cartItems" class="flex-1 overflow-y-auto p-4 space-y-2"></div>
  157. <p id="emptyCartText" class="hidden text-center text-gray-400 mt-4">Tu carrito está vacío.</p>
  158. <footer class="p-4 border-t border-gray-200 space-y-3">
  159. <div class="flex justify-between text-base">
  160. <span>Total:</span>
  161. <span id="cartTotal">$0</span>
  162. </div>
  163. <button id="checkoutButton"
  164. class="w-full bg-[#101419] hover:bg-[#37404a] disabled:opacity-50 text-white py-2 rounded-md"
  165. disabled>
  166. Envia tu orden
  167. </button>
  168. </footer>
  169. <div class="max-w-4xl mx-auto bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
  170. <!-- Header con nombre de usuario -->
  171. <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
  172. <h2 id="usernameTable" class="text-[19px] font-bold text-[#101419]">Pedido de Juan Pérez</h2>
  173. </div>
  174. <div class="overflow-x-auto max-h-[33vh]">
  175. <table id="historyTable" class="w-full">
  176. <thead class="bg-gray-50 border-b border-gray-200">
  177. <tr>
  178. <th class="px-6 py-3 text-left text-sm font-bold text-[#101419]">Cantidad</th>
  179. <th class="px-6 py-3 text-left text-sm font-bold text-[#101419]">Producto</th>
  180. <th class="px-6 py-3 text-right text-sm font-bold text-[#101419]">Precio</th>
  181. </tr>
  182. </thead>
  183. <tbody class="divide-y divide-gray-200">
  184. <template id="historyRowTemplate">
  185. <tr class="hover:bg-gray-50 transition-colors">
  186. <td class="list-element-quantity px-6 py-4 text-sm text-[#58728d]">1</td>
  187. <td class="px-6 py-4">
  188. <div class="flex flex-col">
  189. <span class="list-element-name text-sm font-medium text-[#101419]">Klein Lager</span>
  190. </div>
  191. </td>
  192. <td class="list-element-price px-6 py-4 text-sm font-semibold text-[#101419] text-right">$6.000</td>
  193. </tr>
  194. </template>
  195. </tbody>
  196. <!-- Total -->
  197. <tfoot class="bg-gray-50 border-t border-gray-200">
  198. <tr>
  199. <td colspan="2" class="px-6 py-4 text-base font-bold text-[#101419] text-right">
  200. Total General:
  201. </td>
  202. <td id="cartHistoryTotal" class="px-6 py-4 text-lg font-bold text-[#101419] text-right">
  203. $0
  204. </td>
  205. </tr>
  206. </tfoot>
  207. </table>
  208. </div>
  209. </div>
  210. </section>
  211. </main>
  212. <!-- ---------- NAVBAR ---------- -->
  213. <footer class="inset-x-0 z-10 border-t border-gray-200 bg-gray-50 px-4 py-2">
  214. <nav class="flex gap-2">
  215. <button data-target="menuTab" data-title="Biergarten Klein" class="active tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  216. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-8"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l-2 0l9 -9l9 9l-2 0" /><path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" /><path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" /></svg><span class="text-xs font-medium">Inicio</span>
  217. </button>
  218. <button data-target="cartTab" data-title="Carrito Klein" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  219. <div id="cartIcon">
  220. <span id="cartCount">0</span>
  221. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
  222. viewBox="0 0 256 256" class="h-8">
  223. <path
  224. 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" />
  225. </svg>
  226. </div>
  227. <span class="text-xs font-medium">Carrito</span>
  228. </button>
  229. <button data-target="chatTab" data-title="KleinBot" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  230. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-8"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 9h8" /><path d="M8 13h6" /><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z" /></svg>
  231. <span class="text-xs font-medium">Chat IA</span>
  232. </button>
  233. </nav>
  234. </footer>
  235. <!-- ---------- TOAST ---------- -->
  236. <div id="toastCart"
  237. class="fixed top-4 left-1/2 -translate-x-1/2 bg-[#101419] text-white text-sm
  238. rounded-md px-4 py-2 shadow-lg opacity-0 pointer-events-none z-50
  239. origin-left">
  240. </div>
  241. <!-- MODALS -->
  242. <!-- === MODAL INICIO DE SESIÓN === -->
  243. <div id="sessionModal"
  244. class="fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  245. <form id="loginForm" class="bg-white w-full max-w-md p-8 rounded-xl shadow-xl space-y-6">
  246. <div class="text-center">
  247. <h2 class="text-2xl font-bold text-gray-900">¡Bienvenido!</h2>
  248. <p id="loginMessage" class="text-sm text-gray-600 mt-2">
  249. Ingresa tus datos para comenzar tu pedido
  250. </p>
  251. </div>
  252. <div class="space-y-4">
  253. <div>
  254. <label for="emailInput" class="block text-sm font-medium text-gray-700 mb-2">
  255. Correo electrónico
  256. </label>
  257. <input id="emailInput"
  258. name="email"
  259. type="email"
  260. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  261. placeholder="tu@email.com"
  262. required />
  263. </div>
  264. <div>
  265. <label for="pinInput" class="block text-sm font-medium text-gray-700 mb-2">
  266. PIN de 4 dígitos
  267. </label>
  268. <input id="pinInput"
  269. name="pin"
  270. type="password"
  271. maxlength="4"
  272. pattern="[0-9]{4}"
  273. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  274. placeholder="••••"
  275. required />
  276. </div>
  277. <div>
  278. <label for="tableInput" class="block text-sm font-medium text-gray-700 mb-2">
  279. Número de mesa
  280. </label>
  281. <input id="tableInput"
  282. name="table"
  283. type="number"
  284. min="1"
  285. max="99"
  286. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  287. placeholder="Ej: 5"
  288. required />
  289. </div>
  290. </div>
  291. <span id="ErrorLogin" class="hidden text-red-500 text-sm">Todo cago, perdon</span>
  292. <button id="sessionAcceptBtn"
  293. type="submit"
  294. class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-3 rounded-lg font-medium transition-colors duration-200 focus:ring-2 focus:ring-offset-2 focus:ring-[#101419]">
  295. Comenzar pedido
  296. </button>
  297. </form>
  298. </div>
  299. <!-- Modal de Términos y Condiciones del Regalo -->
  300. <div id="rewardModal" class="fixed hidden inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  301. <div class="bg-white w-full max-w-lg max-h-[90vh] rounded-xl shadow-xl overflow-hidden">
  302. <!-- Header -->
  303. <div class="bg-gradient-to-r from-amber-500 to-orange-500 px-6 py-4 text-white">
  304. <div class="flex items-center justify-between">
  305. <div class="flex items-center gap-3">
  306. <span class="text-2xl">🍺</span>
  307. <h2 class="text-xl font-bold">¡Cerveza Gratis!</h2>
  308. </div>
  309. <button id="closeRewardModal" class="text-white/80 hover:text-white text-2xl font-bold transition-colors">
  310. ×
  311. </button>
  312. </div>
  313. </div>
  314. <!-- Content -->
  315. <div class="overflow-y-auto max-h-[60vh] px-6 py-4">
  316. <div class="space-y-4">
  317. <!-- Descripción del premio -->
  318. <div class="bg-amber-50 border border-amber-200 rounded-lg p-4">
  319. <h3 class="font-semibold text-amber-800 mb-2">🎉 ¡Felicitaciones!</h3>
  320. <p class="text-amber-700 text-sm">
  321. Has alcanzado el 100% de progreso y puedes reclamar una cerveza gratis de tu elección.
  322. </p>
  323. </div>
  324. <!-- Términos y Condiciones -->
  325. <div class="space-y-3">
  326. <h4 class="font-bold text-gray-800 text-base">Términos y Condiciones:</h4>
  327. <div class="text-sm text-gray-600 space-y-2">
  328. <div class="flex items-start gap-2">
  329. <span class="text-amber-500 font-bold">•</span>
  330. <p>Válido únicamente en Biergarten Klein para consumo en el local.</p>
  331. </div>
  332. <div class="flex items-start gap-2">
  333. <span class="text-amber-500 font-bold">•</span>
  334. <p>La cerveza gratis debe ser reclamada el mismo día que se alcanza el 100%.</p>
  335. </div>
  336. <div class="flex items-start gap-2">
  337. <span class="text-amber-500 font-bold">•</span>
  338. <p>Aplica para cervezas de barril regulares (no incluye cervezas premium o importadas).</p>
  339. </div>
  340. <div class="flex items-start gap-2">
  341. <span class="text-amber-500 font-bold">•</span>
  342. <p>No acumulable con otras promociones o descuentos.</p>
  343. </div>
  344. <div class="flex items-start gap-2">
  345. <span class="text-amber-500 font-bold">•</span>
  346. <p>El premio no tiene valor en efectivo y no es transferible.</p>
  347. </div>
  348. <div class="flex items-start gap-2">
  349. <span class="text-amber-500 font-bold">•</span>
  350. <p>Biergarten Klein se reserva el derecho de modificar o cancelar esta promoción sin previo aviso.</p>
  351. </div>
  352. <div class="flex items-start gap-2">
  353. <span class="text-amber-500 font-bold">•</span>
  354. <p>Debes ser mayor de 18 años para reclamar bebidas alcohólicas.</p>
  355. </div>
  356. </div>
  357. </div>
  358. <!-- Instrucciones -->
  359. <div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
  360. <h4 class="font-semibold text-blue-800 mb-2">📋 Instrucciones:</h4>
  361. <p class="text-blue-700 text-sm">
  362. Una vez aceptes los términos, se generará un código que deberás mostrar al mesero junto con tu identificación para reclamar tu cerveza gratis.
  363. </p>
  364. </div>
  365. </div>
  366. </div>
  367. <!-- Footer con checkbox y botones -->
  368. <div class="border-t border-gray-200 px-6 py-4 space-y-4">
  369. <!-- Checkbox de aceptación -->
  370. <label class="flex items-start gap-3 cursor-pointer">
  371. <input id="acceptTermsCheckbox" type="checkbox" class="mt-1 w-4 h-4 text-amber-600 bg-gray-100 border-gray-300 rounded focus:ring-amber-500 focus:ring-2">
  372. <span class="text-sm text-gray-700">
  373. He leído y acepto los términos y condiciones para reclamar mi cerveza gratis.
  374. </span>
  375. </label>
  376. <!-- Botones -->
  377. <div class="flex gap-3">
  378. <button id="cancelRewardBtn" class="flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-3 rounded-lg font-medium transition-colors duration-200">
  379. Cancelar
  380. </button>
  381. <button id="claimRewardBtn" class="flex-1 bg-amber-500 hover:bg-amber-600 text-white py-3 rounded-lg font-medium transition-colors duration-200 opacity-50 cursor-not-allowed" disabled>
  382. 🎉 Reclamar Premio
  383. </button>
  384. </div>
  385. </div>
  386. </div>
  387. </div>
  388. <div id="successRewardModal" class="fixed hidden inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  389. <div class="bg-white w-full max-w-md rounded-xl shadow-xl overflow-hidden">
  390. <!-- Header -->
  391. <div class="bg-[#101419] px-6 py-8 text-white text-center relative">
  392. <!-- Elementos decorativos sutiles -->
  393. <div class="absolute top-3 left-4 text-amber-300 text-lg">✨</div>
  394. <div class="absolute top-4 right-6 text-amber-300 text-sm">🎉</div>
  395. <div class="absolute bottom-3 right-4 text-amber-300 text-sm">💫</div>
  396. <!-- Icono principal -->
  397. <div class="text-6xl mb-3">🍺</div>
  398. <!-- Título -->
  399. <h2 class="text-2xl font-bold mb-2">¡FELICIDADES!</h2>
  400. <div class="bg-white/20 rounded-full px-3 py-1 inline-block">
  401. <p class="text-gray-100 text-sm font-medium">🎁 Premio Reclamado</p>
  402. </div>
  403. </div>
  404. <!-- Content -->
  405. <div class="px-6 py-6 space-y-4">
  406. <!-- Mensaje de bienvenida -->
  407. <div class="text-center">
  408. <div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
  409. <h3 class="text-lg font-bold text-[#101419] mb-1">🍻 ¡Tu cerveza gratis te espera!</h3>
  410. <p class="text-[#58728d] text-sm">Sigue estos pasos para reclamar tu premio</p>
  411. </div>
  412. </div>
  413. <!-- Instrucciones -->
  414. <div class="space-y-3">
  415. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  416. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">1</div>
  417. <div class="text-sm">
  418. <div class="font-bold text-[#101419] mb-1">👨‍💼 Espera al mesero</div>
  419. <div class="text-[#58728d]">Este se acercará con tu comprobante de premio</div>
  420. </div>
  421. </div>
  422. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  423. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">2</div>
  424. <div class="text-sm">
  425. <div class="font-bold text-[#101419] mb-1">🍺 Elige tu cerveza favorita</div>
  426. <div class="text-[#58728d]">Selecciona cualquier cerveza hasta <span class="font-semibold">$5,000</span></div>
  427. </div>
  428. </div>
  429. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  430. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">3</div>
  431. <div class="text-sm">
  432. <div class="font-bold text-[#101419] mb-1">🎉 ¡Disfruta al máximo!</div>
  433. <div class="text-[#58728d]">Tu cerveza gratis está lista para disfrutar 🥳</div>
  434. </div>
  435. </div>
  436. </div>
  437. <!-- Nota importante -->
  438. <div class="bg-amber-50 border border-amber-200 rounded-lg p-3">
  439. <div class="flex items-center gap-2 mb-1">
  440. <span class="text-base">⏰</span>
  441. <h4 class="font-semibold text-amber-800 text-sm">Importante</h4>
  442. </div>
  443. <p class="text-amber-700 text-sm">Este premio es válido solo para el día de hoy. ¡No pierdas esta oportunidad!</p>
  444. </div>
  445. </div>
  446. <!-- Footer -->
  447. <div class="px-6 py-4 bg-gray-50 border-t border-gray-200">
  448. <button id="closeSuccessRewardModal" class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-3 rounded-lg font-medium transition-colors duration-200">
  449. <span class="flex items-center justify-center gap-2">
  450. <span>🎊</span>
  451. Aceptar
  452. <span>🍻</span>
  453. </span>
  454. </button>
  455. </div>
  456. </div>
  457. </div>
  458. <!-- ---------- JS: conmutar tabs + toast ---------- -->
  459. <script>
  460. const animation_time = 200
  461. let transitioning = false;
  462. // conmutar pestañas
  463. const buttons = document.querySelectorAll('.tab-btn')
  464. buttons.forEach(btn => {
  465. btn.addEventListener('click', () => {
  466. const target = btn.dataset.target;
  467. const active = document.querySelector(':not(.hidden)[data-tab]');
  468. const activeIndex = active.dataset.index;
  469. const to = document.querySelector(`#${target}[data-tab]`);
  470. const toIndex = to.dataset.index;
  471. const height = to.offsetHeight;
  472. if (activeIndex === toIndex || transitioning) return;
  473. buttons.forEach(button => {
  474. button.classList.remove('active')
  475. })
  476. btn.classList.add('active')
  477. active.style.height = "100%";
  478. active.style.width = "100vw"
  479. to.style.height = "100%";
  480. to.style.width = "100vw"
  481. to.style.zIndex = "1";
  482. active.style.zIndex = "0";
  483. transitioning = true;
  484. const otherTabs = document.querySelectorAll('[data-tab]');
  485. otherTabs.forEach(tab => {
  486. if (tab !== active && tab !== to) {
  487. tab.classList.add('hidden');
  488. tab.classList.remove(`animate-[slideLeft_${animation_time}ms_ease-out]`, `animate-[slideRight_${animation_time}ms_ease-out]`);
  489. tab.classList.remove(`animate-[slideLeftIn_${animation_time}ms_ease-out]`, `animate-[slideRightIn_${animation_time}ms_ease-out]`);
  490. }
  491. });
  492. to.classList.remove('hidden');
  493. // Animate tab transition
  494. if (activeIndex < toIndex) {
  495. // Slide left
  496. active.classList.add(`animate-[slideLeft_${animation_time}ms_ease-out]`);
  497. to.classList.add(`animate-[slideRightIn_${animation_time}ms_ease-out]`);
  498. } else if (activeIndex > toIndex) {
  499. // Slide right
  500. active.classList.add(`animate-[slideRight_${animation_time}ms_ease-out]`);
  501. to.classList.add(`animate-[slideLeftIn_${animation_time}ms_ease-out]`);
  502. }
  503. setTimeout(() => {
  504. active.classList.remove(`animate-[slideLeft_${animation_time}ms_ease-out]`, `animate-[slideRight_${animation_time}ms_ease-out]`);
  505. active.classList.add('hidden');
  506. to.classList.remove(`animate-[slideLeftIn_${animation_time}ms_ease-out]`, `animate-[slideRightIn_${animation_time}ms_ease-out]`);
  507. transitioning = false;
  508. }, animation_time);
  509. // Update header title if needed
  510. const title = btn.dataset.title;
  511. if (title) {
  512. document.getElementById('mainTitle').textContent = title;
  513. }
  514. });
  515. });
  516. // toast simple
  517. window.showToast = (msg) => {
  518. const toast = document.getElementById('toastCart');
  519. toast.textContent = msg;
  520. toast.style.animation = 'none'; // reset
  521. void toast.offsetWidth; // reflow
  522. toast.style.opacity = '1';
  523. toast.style.animation = 'popup 1s ease-out';
  524. toast.addEventListener('animationend', () => {
  525. toast.style.animation = 'none';
  526. toast.style.opacity = '0';
  527. });
  528. };
  529. </script>
  530. </body>
  531. </html>