| Cỡ chữ:   
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> </head> <body> <!-- ===================== HEADER ===================== --> <div class="restaurant-name"> <img id="logo" src="" /> <br>Vietpersie's Restaurant<br> <span id="table-badge" class="table-badge" onclick="showTablePopup()"></span> </div> <!-- ===================== MENU ===================== --> <div class="cat">Side Dishes</div> <div class="menu"> <div class="item"> <img src="https://lazi.vn/files/large/eaec0d5e27ce184" alt="side1"> <h3>Dragon Pass in Ocean</h3> <p>Crispy slices of seasoned russet potatoes, air-fried to perfection. Served with zesty sour cream for a delightful twist on a classic favorite.</p> <p><span>$10.99</span><span class="rightspan">Order</span></p> </div> <div class="item"> <img src="https://cdn.nguyenkimmall.com/images/companies/_1/Content/tin-tuc/gia-dung/top-10-mon-an-mua-dong-am-ap-kich-thich-vi-giac-h8.jpg" alt="Salad"> <h3>Warm Winter Day</h3> <p>Crisp cucumber and vibrant radishes, tossed in a tangy vinaigrette for a refreshing crunch.</p> <p><span>$5.99</span><span class="rightspan">Order</span></p> </div> </div> <div class="cat">Entreé</div> <div class="menu"> <div class="item"> <img src="https://assets.tmecosys.com/image/upload/t_web767x639/img/recipe/ras/Assets/102cf51c-9220-4278-8b63-2b9611ad275e/Derivates/3831dbe2-352e-4409-a2e2-fc87d11cab0a.jpg" alt="Burger"> <h3>Deluxe Burger</h3> <p>A juicy beef burger with lettuce, tomato, cheese, and special sauce.</p> <p><span>$10.99</span><span class="rightspan">Order</span></p> </div> <div class="item"> <img src="https://www.sidechef.com/recipe/48bc47bb-38ec-47e2-9e78-7bbed7552986.jpeg?d=1408x1120" alt="Pizza"> <h3>Pepperoni Pizza</h3> <p>Classic pizza topped with pepperoni, mozzarella cheese, and tomato sauce.</p> <p><span>$12.99</span><span class="rightspan">Order</span></p> </div> </div> <div class="cat">Desserts</div> <div class="menu"> <div class="item"> <img src="https://th.bing.com/th/id/OIP.21XG1xTLOPD5KUE5jbEtUQHaGU?pid=ImgDet&rs=1" alt="cheesecake"> <h3>Cheese Cake</h3> <p>Indulge in the timeless delight of our classic cheesecake. Creamy, rich, and velvety-smooth.</p> <p><span>$3.99</span><span class="rightspan">Order</span></p> </div> <div class="item"> <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSHC8yibxnjm0sNDbtQKm7IsfyPSt0fhBqiHg&s" alt="icecream"> <h3>Fried Ice Cream</h3> <p>A hot and crispy surprise that reveals a cold, sweet secret.</p> <p><span>$4.99</span><span class="rightspan">Order</span></p> </div> </div> <!-- ===================== POPUP NHẬP SỐ BÀN ===================== --> <div id="table-overlay" class="overlay"> <div class="popup-box"> <img class="popup-icon" src="uploads/4-20260429143810.png"> <h2 class="popup-title">Vietpersie's Restaurant</h2> <p class="popup-subtitle">Vui lòng nhập số bàn của bạn</p> <input id="table-input" class="table-input" type="number" min="1" max="50" placeholder="Số bàn (VD: 5)"> <button class="btn-dark btn-full" onclick="confirmTable()">Xác nhận</button> <p id="table-error" class="error-msg">Vui lòng nhập số bàn từ 1 đến 50!</p> </div> </div> <!-- ===================== NÚT GIỎ HÀNG NỔI ===================== --> <div id="cart-btn" class="cart-btn" onclick="toggleCart()"><img class="popup-icon" src="uploads/4-20260429143810.png"></div> <div id="cart-count" class="cart-count"></div> <!-- ===================== PANEL GIỎ HÀNG ===================== --> <div id="cart-panel" class="cart-panel"> <div class="cart-header"> <h3> Giỏ hàng của bạn</h3> <span onclick="toggleCart()" class="close-btn">×</span> </div> <div id="cart-items" class="cart-items"> <p class="empty-msg">Giỏ hàng trống️<br><small>Hãy chọn món bạn thích!</small></p> </div> <div id="cart-footer" class="cart-footer"> <div class="cart-total-row"> <span>Tổng cộng:</span> <span id="cart-total" class="price-red">$0.00</span> </div> <button class="btn-red btn-full" onclick="showOrderConfirm()"> Xác nhận & Gọi món</button> </div> </div> <!-- ===================== POPUP XÁC NHẬN ORDER ===================== --> <div id="confirm-overlay" class="overlay hidden"> <div class="popup-box popup-wide"> <h2 class="popup-title-left">Xác nhận đơn hàng</h2> <p id="confirm-table" class="text-muted"></p> <div id="confirm-items" class="confirm-items"></div> <div class="total-row"> <span>Tổng cộng:</span> <span id="confirm-total" class="price-red"></span> </div> <label class="note-label">Ghi chú đặc biệt (không bắt buộc):</label> <textarea id="order-note" class="note-input" placeholder="VD: Ít cay, không hành..."></textarea> <div class="btn-row"> <button class="btn-gray" onclick="document.getElementById('confirm-overlay').style.display='none'">Quay lại</button> <button class="btn-red btn-grow" onclick="sendOrder()">Gọi nhân viên & Đặt món</button> </div> </div> </div> <!-- ===================== POPUP ĐẶT THÀNH CÔNG ===================== --> <div id="success-overlay" class="overlay hidden"> <div class="popup-box"> <img class="popup-icon" src="uploads/4-20260429143810.png"> <h2 class="popup-title">Đặt món thành công!</h2> <p class="popup-subtitle">Nhân viên đã nhận được đơn của bạn</p> <div class="success-info"> <div class="info-row"> <span class="text-muted">Bàn số</span> <span class="text-bold" id="success-table"></span> </div> <div class="info-row"> <span class="text-muted">Số món</span> <span class="text-bold" id="success-items"></span> </div> </div> <button class="btn-dark btn-full" onclick="document.getElementById('success-overlay').style.display='none'">OK, tôi sẽ đợi!</button> </div> </div> <!-- ===================== TOAST THÔNG BÁO ===================== --> <div id="toast" class="toast"> <span id="toast-msg"></span> </div> <script src="script.js"></script> <script src="script.js"></script> </body> </html>
/* ============================================= VIETPERSIE'S RESTAURANT - style.css ============================================= */ /* ===================== BASE ===================== */ body { font-family: 'Rubik', sans-serif; margin: 0; padding: 0; background-color: #f4f4f4; } /* ===================== HEADER ===================== */ .restaurant-name { font-family: 'Roboto Condensed', sans-serif; text-align: center; padding: 20px; background-color: darkslategrey; color: #fff; font-size: 2.5rem; } #logo { height: 35px; } .table-badge { display: none; background: #e74c3c; color: #fff; font-size: 0.9rem; padding: 6px 14px; border-radius: 20px; font-family: 'Rubik', sans-serif; cursor: pointer; } /* ===================== MENU ===================== */ .cat { font-family: 'Rubik', sans-serif; font-weight: bold; width: 180px; text-align: center; color: #ffffff; font-size: 25px; padding: 5px; border-radius: 25px; margin: 10px auto; background-color: #e74c3c; } .menu { display: flex; justify-content: center; align-items: flex-start; padding: 20px; } .item { width: 45%; background-color: #fff; margin: 10px; padding: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .item img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; } .item h3 { margin-top: 10px; font-size: 1.9rem; } .item p { margin-top: 5px; font-size: 1rem; } .item span { font-weight: bold; font-size: 36px; color: #e74c3c; } .rightspan { float: right; background-color: darkslategrey; border-radius: 25px; font-size: 20px ; padding: 10px ; color: #ffffff ; cursor: pointer; } .rightspan:hover { background-color: #e74c3c; color: #ffffff ; } /* ===================== OVERLAY & POPUP ===================== */ .overlay { display: flex; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); align-items: center; justify-content: center; z-index: 9999; } .hidden { display: none; } .popup-box { background: #fff; border-radius: 16px; padding: 40px; text-align: center; max-width: 360px; width: 90%; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); } .popup-wide { max-width: 400px; max-height: 90vh; overflow-y: auto; text-align: left; } .popup-icon { font-size: 48px; margin-bottom: 12px; width: 80px; height: 100px; } .popup-title { font-family: 'Roboto Condensed', sans-serif; font-size: 1.8rem; color: #2f4f4f; margin-bottom: 8px; } .popup-title-left { font-family: 'Roboto Condensed', sans-serif; font-size: 1.6rem; color: #2f4f4f; margin-bottom: 4px; } .popup-subtitle { color: #666; margin-bottom: 24px; } /* ===================== POPUP NHẬP BÀN ===================== */ .table-input { width: 100%; padding: 12px 16px; font-size: 1.2rem; border: 2px solid #ddd; border-radius: 8px; text-align: center; margin-bottom: 16px; outline: none; box-sizing: border-box; } .error-msg { color: #e74c3c; margin-top: 10px; display: none; } /* ===================== BUTTONS ===================== */ .btn-dark { background: #2f4f4f; color: #fff; border: none; border-radius: 8px; font-size: 1.1rem; padding: 14px; cursor: pointer; font-family: 'Rubik', sans-serif; } .btn-dark:hover { background: #e74c3c; } .btn-red { background: #e74c3c; color: #fff; border: none; border-radius: 8px; font-size: 1rem; padding: 14px; cursor: pointer; font-family: 'Rubik', sans-serif; font-weight: bold; } .btn-red:hover { background: #c0392b; } .btn-gray { flex: 1; padding: 12px; border: 1px solid #ddd; background: #f5f5f5; border-radius: 8px; cursor: pointer; font-family: 'Rubik', sans-serif; font-size: 0.95rem; } .btn-full { width: 100%; } .btn-grow { flex: 2; padding: 12px; } .btn-row { display: flex; gap: 10px; } /* ===================== NÚT GIỎ HÀNG NỔI ===================== */ .cart-btn { position: fixed; bottom: 30px; right: 30px; background: #2f4f4f; color: #fff; border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1000; font-size: 26px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); } .cart-btn:hover { background: #e74c3c; } .cart-count { position: fixed; bottom: 62px; right: 22px; background: #e74c3c; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; font-weight: bold; display: none; align-items: center; justify-content: center; z-index: 1001; } /* ===================== PANEL GIỎ HÀNG ===================== */ .cart-panel { position: fixed; right: -400px; top: 0; bottom: 0; width: 360px; background: #fff; box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15); z-index: 2000; display: flex; flex-direction: column; transition: right 0.3s ease; font-family: 'Rubik', sans-serif; } .cart-header { background: #2f4f4f; color: #fff; padding: 20px; display: flex; justify-content: space-between; align-items: center; } .cart-header h3 { margin: 0; font-size: 1.2rem; } .close-btn { cursor: pointer; font-size: 22px; } .cart-items { flex: 1; overflow-y: auto; padding: 16px; } .empty-msg { text-align: center; color: #999; margin-top: 40px; } .cart-footer { padding: 16px; border-top: 1px solid #eee; display: none; } .cart-total-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 1.1rem; font-weight: bold; } /* ===================== POPUP XÁC NHẬN ===================== */ .confirm-items { margin-bottom: 16px; } .total-row { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.1rem; margin-bottom: 20px; padding-top: 8px; } .note-label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: #555; } .note-input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; min-height: 80px; resize: none; font-family: 'Rubik', sans-serif; margin-bottom: 16px; box-sizing: border-box; } /* ===================== POPUP THÀNH CÔNG ===================== */ .success-info { background: #f9f9f9; border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: left; } .info-row { display: flex; justify-content: space-between; margin-bottom: 8px; } /* ===================== TOAST ===================== */ .toast { display: none; position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: #2f4f4f; color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 0.9rem; z-index: 9999; } /* ===================== UTILITY ===================== */ .price-red { color: #e74c3c; } .text-muted { color: #999; font-size: 0.9rem; margin-bottom: 16px; } .text-bold { font-weight: bold; }
let cart = []; // mang luu cac mon an trong gio hang let tableNumber = 0; //so ban // ============================================= // 1. HIỂN THỊ POPUP NHẬP SỐ BÀN // ============================================= function showTablePopup() { let overlay = document.getElementById("table-overlay"); overlay.style.display = "flex"; document.getElementById("table-input").value = ""; document.getElementById("table-error").style.display = "none"; } function confirmTable() { let input = document.getElementById("table-input"); let val = parseInt(input.value); if (val < 1 || val > 50 || isNaN(val)) { document.getElementById("table-error").style.display = "block"; return; } tableNumber = val; document.getElementById("table-overlay").style.display = "none"; document.getElementById("table-badge").innerHTML = "Số bàn " + tableNumber; document.getElementById("table-badge").style.display = "block"; }