bar responsive cards

This commit is contained in:
ImAlpha 2024-01-08 23:18:50 -08:00
parent 930648e6cf
commit b3e2672e98
7 changed files with 75 additions and 64 deletions

View File

@ -7,7 +7,7 @@ import Footer from "@/components/Footer/footer";
import localFont from 'next/font/local';
import './layout.css'
const inter = Inter({ subsets: ["latin"] });
// const inter = Inter({ subsets: ["latin"] });
const robleAlt = localFont({
src: './RobleAlt.woff',
display: 'swap',

Binary file not shown.

View File

@ -38,5 +38,13 @@
"price": 13,
"size": "24oz",
"description": "Corona with tamarindo."
},
{
"id": 6,
"name": "Cheesy Mac & Cheese With a Fruit Cup",
"photo": "Bar/Michelada.jpeg",
"price": 13,
"size": "24oz",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
}
]

View File

@ -1,21 +1,26 @@
"use client";
import * as React from "react";
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import Menu from "./items.json";
import Image from "next/image";
import localFont from 'next/font/local';
const interBold = localFont({
src: './Inter-Bold.woff',
display: 'swap',
})
const Bar = () => {
let pic = "cover";
return (
<main>
{/* Mapping out the menu
<div className=" flex flex-wrap gap-8 pt-6 justify-between w-full">
<div className="flex flex-wrap gap-8">
{Menu.map((menu_item) => {
return (
<div
key={menu_item.id}
className="flex flex-col flex-grow h-[452px] w-[325px] rounded-lg shadow-xl drop-shadow-xl"
>
<div className="h-[55%] relative w-full overflow-hidden">
<Card key={menu_item.id} className="flex flex-grow flex-col w-[325px] h-[452px]">
<div className="w-full h-[55%]">
<div className="h-full relative w-full">
<Image
src={`/${menu_item.photo}`}
alt="chili pepper spice"
@ -25,49 +30,43 @@ const Bar = () => {
className="rounded-t-lg"
/>
</div>
<h4 className="">
</div>
<div className="m-[8px] space-y-[4px]">
{/* title and description of item */}
<div className="w-full font-sans">
{/* title and photo */}
<div className="inline-block">
<h4 className={`pt-2 float-left ${interBold.className}`}>
<strong>{menu_item.name}</strong>
</h4>
<p className="max-w-[75ch]">
Description: {menu_item.description}
</p>
<div className="flex flex-row justify-evenly">
<div className=" flex flex-row">
<span>{`$${menu_item.price}`}</span>
</div>
<div className="flex w-1/2 relative">
<div className="flex w-3 h-full items-end justify-end">
<div className=""></div>
</div>
</div>
</div>
</div>
);
})}
{/* <div className="bg-red-300 float-right relative w-[25px] h-[25px]">
<Image
src="/red-chili-pepper.svg"
alt="chili pepper spice"
fill
style={{
objectFit: "contain",
}}
quality={100}
className=""
/>
</div> */}
<div>
{Menu.map((menu_item) => {
return (
<Card key={menu_item.id} className="flex flex-wrap gap-8 pt-6 justify-evenly w-[325px] h-[452px]">
<CardHeader className="h-full relative w-full overflow-hidden">
<Image
src={`/${menu_item.photo}`}
alt="chili pepper spice"
fill
style={{ objectFit: "cover", objectPosition: "center" }}
quality={100}
className="rounded-t-lg"
/>
</CardHeader>
<h4 className="">
<strong>{menu_item.name}</strong>
</h4>
<p className="max-w-[75ch]">
</div>
{/* paragraph text */}
<div className="inline-block text-left">
{/* <p className="max-w-[75ch]">
Description: {menu_item.description}
</p> */}
{/* 16px line height */}
<p className="leading-4 text-[#8F8F8F]">
{menu_item.description}
</p>
<div className="flex flex-row justify-evenly">
</div>
</div>
{/* cart addon */}
<div className="flex flex-row">
<span>{`$${menu_item.price}`}</span>
<div className=" flex flex-row">
<strong>{`$${menu_item.price}`}</strong>
</div>
<div className="flex w-1/2 relative">
<div className="flex w-3 h-full items-end justify-end">
@ -75,6 +74,7 @@ const Bar = () => {
</div>
</div>
</div>
</div>
</Card>
);
})}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 5.1 MiB

View File

@ -1,4 +1,7 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: [