Restaurant Menu Html Css Codepen -
<div class="footer-note"> <span><i class="fas fa-leaf"></i> Locally sourced</span> <span><i class="fas fa-wine-bottle"></i> Wine pairing available</span> <span><i class="fas fa-clock"></i> Tue–Sun 5PM – 11PM</span> </div> </div>
/* main container */ .menu-container max-width: 1280px; margin: 2rem auto; padding: 2rem 1.5rem 3rem; background: #fffdf9; border-radius: 32px; box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08); restaurant menu html css codepen
// attach event listeners document.querySelectorAll('.filter-btn').forEach(btn => btn.addEventListener('click', (e) => const filterValue = btn.getAttribute('data-filter'); if (filterValue === 'all') activeCategory = null; else activeCategory = filterValue; renderFilters(); // re-render to update active class renderMenuItems(); // render filtered menu ); ); i class="fas fa-leaf">
// State: currently active filter category (null = show all) let activeCategory = null; // null means "All" i class="fas fa-wine-bottle">
// Helper: render filter buttons function renderFilters() let buttonsHtml = `<button class="filter-btn $activeCategory === null ? 'active' : ''" data-filter="all"><i class="fas fa-utensils"></i> All</button>`; uniqueCategories.forEach(cat => buttonsHtml += `<button class="filter-btn $activeCategory === cat ? 'active' : ''" data-filter="$cat"><i class="fas fa-tag"></i> $cat</button>`; ); filterContainer.innerHTML = buttonsHtml;
<!-- Dynamic category filters (JS powered) --> <div class="filter-tabs" id="filterTabs"> <!-- will be populated from js --> </div>