implement interactive restaurant menu page with category filtering and animations

This commit is contained in:
Alaguraj0361 2026-04-03 17:00:44 +05:30
parent 0c7ea3a103
commit 9efd6db977
2 changed files with 98 additions and 23 deletions

View File

@ -136,8 +136,8 @@ export default function MenuPage() {
whileHover={{ scale: 1.05 }} whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }} whileTap={{ scale: 0.95 }}
> >
<Image src="/images/home/Categories/All.jpg" alt="All" width={35} height={35} className={styles.tabImage} /> <Image src="/images/home/Categories/All.jpg" alt="All" width={80} height={80} className={styles.tabImage} />
All Menu <span className={styles.tabText}>All Menu</span>
</motion.button> </motion.button>
{/* Category Tabs */} {/* Category Tabs */}
@ -153,11 +153,11 @@ export default function MenuPage() {
<Image <Image
src={section.image} src={section.image}
alt={section.category} alt={section.category}
width={35} width={80}
height={35} height={80}
className={styles.tabImage} className={styles.tabImage}
/> />
{section.category} <span className={styles.tabText}>{section.category}</span>
</motion.button> </motion.button>
))} ))}
</motion.div> </motion.div>

View File

@ -89,41 +89,61 @@
.tabs { .tabs {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 1rem; gap: 1.5rem;
margin-bottom: 5rem; margin-bottom: 5rem;
flex-wrap: wrap; flex-wrap: wrap;
padding: 0 1rem;
} }
.tab { .tab {
background: transparent; background: transparent;
border: 2px solid #441109; border: none;
color: #441109; color: #441109;
padding: 8px 20px 8px 8px; padding: 10px;
font-size: 1rem; font-size: 0.95rem;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
font-family: var(--font-playfair); font-family: var(--font-playfair);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
font-weight: 600; font-weight: 700;
border-radius: 50px; display: flex;
display: inline-flex; flex-direction: column;
align-items: center; align-items: center;
gap: 10px; gap: 12px;
width: 100px;
} }
.tabImage { .tabImage {
width: 70px;
height: 70px;
border-radius: 50%; border-radius: 50%;
object-fit: cover; object-fit: cover;
border: 2px solid #fff; border: 3px solid #fff;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease;
} }
.tab:hover, .tabText {
.activeTab { text-align: center;
background-color: #441109; line-height: 1.2;
color: #f5e6d3; transition: color 0.3s ease;
transform: translateY(-2px); }
border: 2px solid #441109;
.tab:hover .tabImage,
.activeTab .tabImage {
transform: scale(1.1) translateY(-5px);
border-color: #c49c5c;
box-shadow: 0 8px 25px rgba(196, 156, 92, 0.4);
}
.tab:hover .tabText,
.activeTab .tabText {
color: #c49c5c;
}
.activeTab .tabImage {
border-width: 4px;
} }
.menuGrid { .menuGrid {
@ -341,16 +361,71 @@
@media (max-width: 968px) { @media (max-width: 968px) {
.menuGrid { .menuGrid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
gap: 4rem; gap: 3rem;
padding: 0 1rem;
} }
.menuCard { .menuCard {
margin-left: 50px; margin-left: 60px;
margin-right: 20px; margin-right: 20px;
} }
} }
@media (max-width: 768px) {
.tabs {
gap: 1rem;
margin-bottom: 2.5rem;
}
.tab {
width: 85px;
padding: 5px;
font-size: 0.8rem;
}
.tabImage {
width: 60px;
height: 60px;
}
.sectionHeading {
padding: 60px 15px 30px;
}
}
@media (max-width: 480px) { @media (max-width: 480px) {
.tabs {
gap: 0.8rem;
}
.tab {
width: 75px;
gap: 8px;
font-size: 0.75rem;
}
.tabImage {
width: 50px;
height: 50px;
border-width: 2px;
}
.activeTab .tabImage {
border-width: 3px;
}
.hero {
padding: 120px 0px;
}
.heroTitle {
font-size: 2.5rem;
}
.mainHeading {
font-size: 2rem;
}
.menuCard { .menuCard {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;