sozday-sayt-dlya-restorana-k/script.js

201 lines
8.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const menuData = {
main: [
{
title: "Бешбармак классический",
desc: "Традиционное блюдо из отборной конины с домашней лапшой и луковым соусом",
ingredients: "Конина, мука, лук, бульон, специи",
price: "4 200 ₸",
weight: "450 г",
image: "https://images.unsplash.com/photo-1628268997860-5e7c6e6a8d1e?w=400&h=300&fit=crop"
},
{
title: "Бауырсаки с каймаком",
desc: "Свежие воздушные бауырсаки с густым каймаком и медом",
ingredients: "Мука, молоко, дрожжи, каймак, мёд",
price: "1 800 ₸",
weight: "300 г",
image: "https://images.unsplash.com/photo-1606491956689-2ea866880c84?w=400&h=300&fit=crop"
},
{
title: "Казы-карта",
desc: "Деликатес из конины традиционного приготовления",
ingredients: "Конина (казы), карта, специи, соль",
price: "5 600 ₸",
weight: "400 г",
image: "https://images.unsplash.com/photo-1544025162-d76a78989c27?w=400&h=300&fit=crop"
},
{
title: "Плов по-казахски",
desc: "Рассыпчатый рис с бараниной, морковью и курдючным жиром",
ingredients: "Рис, баранина, морковь, курдючный жир, зира",
price: "3 400 ₸",
weight: "400 г",
image: "https://images.unsplash.com/photo-1563379926898-05f4575a45d8?w=400&h=300&fit=crop"
},
{
title: "Куырдак",
desc: "Жареное мясо с картофелем и луком по старинному рецепту",
ingredients: "Баранина, картофель, лук, курдючный жир, специи",
price: "3 800 ₸",
weight: "450 г",
image: "https://images.unsplash.com/photo-1604152135912-04a022e23696?w=400&h=300&fit=crop"
},
{
title: "Тандыр нан",
desc: "Свежий хлеб из тандыра с кунжутом",
ingredients: "Мука, дрожжи, молоко, кунжут, соль",
price: "600 ₸",
weight: "200 г",
image: "https://images.unsplash.com/photo-1589367920969-ab8e050bbb04?w=400&h=300&fit=crop"
}
],
soups: [
{
title: "Сорпа",
desc: "Наваристый бульон из баранины с зеленью и специями",
ingredients: "Баранина на кости, лук, зелень, чёрный перец, соль",
price: "2 200 ₸",
weight: "400 г",
image: "https://images.unsplash.com/photo-1547592166-23acbe346499?w=400&h=300&fit=crop"
},
{
title: "Кеспе",
desc: "Домашняя лапша на мясном бульоне",
ingredients: "Мука, яйца, баранина, лук, зелень",
price: "2 400 ₸",
weight: "450 г",
image: "https://images.unsplash.com/photo-1551892374-ecf8754cf8b0?w=400&h=300&fit=crop"
},
{
title: "Шорпо",
desc: "Традиционный суп из баранины с овощами",
ingredients: "Баранина, картофель, морковь, лук, помидоры, зелень",
price: "2 600 ₸",
weight: "500 г",
image: "https://images.unsplash.com/photo-1547496502-ffa789e360a8?w=400&h=300&fit=crop"
}
],
appetizers: [
{
title: "Ассорти мясное",
desc: "Казы, шужык, жал-жая в национальной нарезке",
ingredients: "Казы, шужык, жал, жая, хрен",
price: "6 800 ₸",
weight: "500 г",
image: "https://images.unsplash.com/photo-1574484284008-86d47dc7b905?w=400&h=300&fit=crop"
},
{
title: "Курт с майской",
desc: "Традиционный кисломолочный продукт со свежей зеленью",
ingredients: "Курт, мята, укроп, петрушка",
price: "1 400 ₸",
weight: "200 г",
image: "https://images.unsplash.com/photo-1626132647523-66f5bf380027?w=400&h=300&fit=crop"
},
{
title: "Иримшик",
desc: "Творожные шарики с изюмом",
ingredients: "Творог, изюм, сахар, ваниль",
price: "1 600 ₸",
weight: "200 г",
image: "https://images.unsplash.com/photo-1563805042-7684c019e1cb?w=400&h=300&fit=crop"
},
{
title: "Салат «Дастархан»",
desc: "Овощи с бараниной и кунжутной заправкой",
ingredients: "Баранина, огурцы, помидоры, перец, кунжут, соевый соус",
price: "2 800 ₸",
weight: "250 г",
image: "https://images.unsplash.com/photo-1512621776951-a57141f2eefd?w=400&h=300&fit=crop"
}
],
drinks: [
{
title: "Кумыс",
desc: "Натуральный кобылий кумыс",
ingredients: "Кобылье молоко, закваска",
price: "1 200 ₸",
weight: "300 мл",
image: "https://images.unsplash.com/photo-1550951428-18c97187e75c?w=400&h=300&fit=crop"
},
{
title: "Шубат",
desc: "Верблюжье молоко традиционного заквашивания",
ingredients: "Верблюжье молоко, закваска",
price: "1 400 ₸",
weight: "300 мл",
image: "https://images.unsplash.com/photo-1550583724-b2692b85b150?w=400&h=300&fit=crop"
},
{
title: "Айран",
desc: "Освежающий кисломолочный напиток с мятой",
ingredients: "Катык, вода, мята, соль",
price: "800 ₸",
weight: "300 мл",
image: "https://images.unsplash.com/photo-1576092768241-dec231844f74?w=400&h=300&fit=crop"
},
{
title: "Чай с молоком",
desc: "Крепкий чай с молоком и солью по-казахски",
ingredients: "Чёрный чай, молоко, соль",
price: "600 ₸",
weight: "250 мл",
image: "https://images.unsplash.com/photo-1576092768241-dec231844f74?w=400&h=300&fit=crop"
},
{
title: "Компот из сухофруктов",
desc: "Домашний компот по традиционному рецепту",
ingredients: "Курага, изюм, яблоки, груши, сахар",
price: "700 ₸",
weight: "300 мл",
image: "https://images.unsplash.com/photo-1546173159-315724a31696?w=400&h=300&fit=crop"
}
]
};
function renderMenu(category) {
const grid = document.getElementById('menu-grid');
const items = menuData[category] || [];
grid.innerHTML = items.map(item => `
<div class="menu-item">
<div class="menu-item-ornament"></div>
<div class="menu-item-content">
<h3 class="menu-item-title">${item.title}</h3>
<p class="menu-item-desc">${item.desc}</p>
<p class="menu-item-ingredients"><strong>Состав:</strong> ${item.ingredients}</p>
<div class="menu-item-footer">
<span class="menu-item-price">${item.price}</span>
<span class="menu-item-weight">${item.weight}</span>
</div>
</div>
</div>
`).join('');
}
document.querySelectorAll('.category-btn').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.category-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
renderMenu(btn.dataset.category);
});
});
document.getElementById('booking-form').addEventListener('submit', (e) => {
e.preventDefault();
alert('Спасибо! Ваша заявка на бронирование принята!');
e.target.reset();
});
renderMenu('main');
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});
});