-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
274 lines (249 loc) · 9.86 KB
/
index.html
File metadata and controls
274 lines (249 loc) · 9.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mộc Garden - Menu & Quản Lý</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
/* Palette phong cách Fantasy Hand-painted */
--bg-deep: #2c3e41; /* Teal xám mờ */
--card-bg: #3a4f52;
--accent-warm: #e9c46a; /* Vàng ấm */
--soft-green: #84a59d;
--text-light: #d1d9d9;
--rim-light: rgba(233, 196, 106, 0.3);
}
body {
font-family: 'Segoe UI', sans-serif;
background-color: var(--bg-deep);
color: var(--text-light);
margin: 0;
scroll-behavior: smooth;
}
/* Header & Navigation */
header {
background: linear-gradient(to bottom, rgba(44,62,65,0.9), rgba(44,62,65,1)), url('https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?auto=format&fit=crop&w=1200&q=80');
background-size: cover;
padding: 60px 20px;
text-align: center;
border-bottom: 3px solid var(--soft-green);
}
.logo-area h1 {
font-size: 3.5rem;
color: var(--accent-warm);
margin: 0;
text-shadow: 0 0 15px var(--rim-light);
letter-spacing: 5px;
}
nav {
background: var(--card-bg);
padding: 15px;
position: sticky;
top: 0;
z-index: 100;
display: flex;
justify-content: center;
gap: 20px;
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
nav button {
background: transparent;
border: 1px solid var(--soft-green);
color: var(--text-light);
padding: 8px 20px;
border-radius: 20px;
cursor: pointer;
transition: 0.3s;
}
nav button.active {
background: var(--soft-green);
color: var(--bg-deep);
}
/* Main Menu Grid */
.container { max-width: 1200px; margin: auto; padding: 20px; }
.menu-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 25px;
}
.food-card {
background: var(--card-bg);
border-radius: 15px;
overflow: hidden;
border: 1px solid rgba(132, 165, 157, 0.2);
transition: transform 0.3s;
}
.food-card:hover {
transform: translateY(-10px);
box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.food-img {
width: 100%;
height: 200px;
object-fit: cover;
filter: sepia(20%) contrast(90%); /* Tạo cảm giác hand-painted */
}
.food-info { padding: 15px; }
.food-info h3 { color: var(--accent-warm); margin: 0 0 10px 0; }
.price { color: var(--soft-green); font-weight: bold; font-size: 1.2rem; }
.btn-order {
width: 100%;
background: var(--accent-warm);
border: none;
padding: 10px;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
margin-top: 10px;
}
/* Quản lý Admin */
.admin-panel {
background: #fff;
color: #333;
padding: 30px;
border-radius: 15px;
margin-top: 50px;
}
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
th { background: #f4f4f4; }
.badge {
background: #27ae60;
color: white;
padding: 5px 10px;
border-radius: 10px;
font-size: 0.8rem;
}
/* Giỏ hàng Floating */
.cart-float {
position: fixed;
bottom: 20px;
right: 20px;
background: var(--accent-warm);
color: #333;
padding: 15px 25px;
border-radius: 50px;
font-weight: bold;
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
cursor: pointer;
}
</style>
</head>
<body>
<div id="app">
<div v-if="view === 'customer'">
<header>
<div class="logo-area">
<h1>MỘC GARDEN</h1>
<p>Ẩm thực tinh hoa giữa lòng Nam Dong</p>
</div>
</header>
<nav>
<button @click="view = 'customer'" class="active">Thực Đơn</button>
<button @click="view = 'admin'">Nhân Viên Quản Lý</button>
</nav>
<div class="container">
<h2 style="color: var(--soft-green); border-left: 5px solid var(--accent-warm); padding-left: 15px;">Món Ăn Nổi Bật</h2>
<div class="menu-grid">
<div class="food-card" v-for="item in menu" :key="item.id">
<img :src="item.img" class="food-img" :alt="item.name">
<div class="food-info">
<h3>{{ item.name }}</h3>
<p class="price">{{ item.price.toLocaleString() }}đ</p>
<button class="btn-order" @click="addToCart(item)">ĐẶT MÓN</button>
</div>
</div>
</div>
</div>
<div class="cart-float" v-if="cart.length > 0" @click="checkout">
<i class="fas fa-shopping-basket"></i> Đơn hàng: {{ cart.length }} món - {{ total.toLocaleString() }}đ
</div>
</div>
<div v-if="view === 'admin'" class="container">
<nav>
<button @click="view = 'customer'">Quay lại Menu</button>
<button class="active">Bảng Quản Lý Khách Hàng</button>
</nav>
<div class="admin-panel">
<h2><i class="fas fa-users-cog"></i> Quản lý Đơn hàng & Khách hàng</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Khách hàng</th>
<th>Món đã đặt</th>
<th>Tổng tiền</th>
<th>Trạng thái</th>
<th>Thao tác</th>
</tr>
</thead>
<tbody>
<tr v-for="order in orders" :key="order.id">
<td>#{{ order.id }}</td>
<td>{{ order.customerName }}</td>
<td>{{ order.items }}</td>
<td>{{ order.amount.toLocaleString() }}đ</td>
<td><span class="badge">{{ order.status }}</span></td>
<td><button @click="completeOrder(order.id)">Hoàn tất</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
view: 'customer',
cart: [],
menu: [
{ id: 1, name: 'Gà nướng cơm lam', price: 350000, img: 'https://images.unsplash.com/photo-1598515214211-89d3c73ae83b?auto=format&fit=crop&w=400&q=80' },
{ id: 2, name: 'Thỏ mẹt 7 món', price: 650000, img: 'https://images.unsplash.com/photo-1544025162-d76694265947?auto=format&fit=crop&w=400&q=80' },
{ id: 3, name: 'Ốc hương sốt me', price: 119000, img: 'https://images.unsplash.com/photo-1626074353765-517a681e40be?auto=format&fit=crop&w=400&q=80' },
{ id: 4, name: 'Bò lúc lắc khoai tây', price: 99000, img: 'https://images.unsplash.com/photo-1558030006-450675393462?auto=format&fit=crop&w=400&q=80' },
{ id: 5, name: 'Mực trứng hấp gừng', price: 119000, img: 'https://images.unsplash.com/photo-1534604973900-c43ab4c2e0ab?auto=format&fit=crop&w=400&q=80' },
{ id: 6, name: 'Lẩu riêu cua hải sản', price: 179000, img: 'https://images.unsplash.com/photo-1555126634-323283e090fa?auto=format&fit=crop&w=400&q=80' }
],
orders: [
{ id: 101, customerName: 'Anh Tuấn', items: 'Gà nướng, Lẩu riêu', amount: 529000, status: 'Đang nấu' },
{ id: 102, customerName: 'Chị Lan', items: 'Bò lúc lắc, Ốc hương', amount: 218000, status: 'Đang chờ' }
]
},
computed: {
total() {
return this.cart.reduce((sum, item) => sum + item.price, 0);
}
},
methods: {
addToCart(item) {
this.cart.push(item);
alert('Đã thêm ' + item.name + ' vào giỏ hàng!');
},
checkout() {
const name = prompt("Nhập tên của bạn để đặt món:");
if(name) {
const newOrder = {
id: Date.now(),
customerName: name,
items: this.cart.map(i => i.name).join(', '),
amount: this.total,
status: 'Mới'
};
this.orders.push(newOrder);
this.cart = [];
alert('Đặt món thành công! Nhân viên sẽ liên hệ bạn ngay.');
}
},
completeOrder(id) {
this.orders = this.orders.filter(o => o.id !== id);
alert('Đơn hàng đã hoàn thành và lưu vào lịch sử.');
}
}
});
</script>
</body>
</html>