<template>
    <div class="hello">
        <header>
            <h1>Coffee Menu</h1>
            <div class="menu2">
                <h2>咖啡菜单</h2>
                <div class="divider-container">
                    <div class="divider-pink">
                    </div>
                    <div class="divider-green">
                    </div>
                    <div class="divider-orange">
                    </div>
                </div>
            </div>

        </header>
        <div class="card-container">
            <div v-for="item in cardData" :key="item.productName" class="card">
                <div class="card-image">
                    <img src="../assets/coffee1.png" alt="Coffee" /> <!-- 替换为实际图片路径 -->
                </div>
                <div class="divider-vertical-container">
                    <div class="divider-vertical-pink"></div>
                    <div class="divider-vertical-green"></div>
                    <!-- <div class="divider-vertical-orange"></div> -->
                </div>
                <div class="card-content">
                    <p>{{ item.productName }}</p>
                    <p>温度: {{ item.temperature }}</p>
                    <p>特点: {{ item.special }}</p>
                    <p>容量: {{ item.capacity }}</p>
                    <p>价格: {{ item.price }}</p>
                </div>
            </div>
        </div>
        <!-- <div class="menu-container">
            <li v-for="item in coffeeList" :key="item.productName" class="coffee-li">
                <div class="menu-item">
                    <img src="../assets/coffee1.png" alt="Golden Iced Coffee">
                    <div class="menu-item-content">
                        <h3 class="menu-item-title">{{ item.productName }}</h3>
                        <p class="menu-item-details">{{ item.temperature }}</p>
                        <p class="menu-item-details">{{ item.capacity }}</p>
                        <p class="menu-item-price">{{ item.price }}</p>
                    </div>
                </div>
            </li>
        </div> -->
    </div>
</template>

<script setup>
import { onMounted } from 'vue';
// import { useRouter } from 'vue-router';
onMounted(() => {
    // useRouter().push('/hello');
    console.log('Coffee menu mounted');
});
const cardData = [
    {
        productName: "澳白",
        temperature: "热",
        special: "本店力荐，配专供咖啡杯",
        capacity: "260ml",
        price: "21￥",
    },
    {
        productName: "拿铁",
        temperature: "冷",
        special: "浓香奶泡，经典选择",
        capacity: "300ml",
        price: "25￥",
    },
    {
        productName: "摩卡",
        temperature: "热",
        special: "巧克力与咖啡的完美融合",
        capacity: "300ml",
        price: "28￥",
    },
    {
        productName: "卡布奇诺",
        temperature: "热",
        special: "浓郁咖啡香，柔滑奶泡",
        capacity: "300ml",
        price: "25￥",
    },
    {
        productName: "美式",
        temperature: "热",
        special: "经典咖啡，清新口感",
        capacity: "300ml",
        price: "20￥",
    },
    {
        productName: "馥芮白",
        temperature: "冷",
        special: "清新口感，柔滑奶泡",
        capacity: "300ml",
        price: "28￥",
    },
    {
        productName: "焦糖玛奇朵",
        temperature: "热",
        special: "焦糖风味，柔滑奶泡",
        capacity: "300ml",
        price: "28￥",
    },
    {
        productName: "抹茶拿铁",
        temperature: "热",
        special: "抹茶风味，浓郁奶香",
        capacity: "300ml",
        price: "28￥",
    },
    {
        productName: "冰美式",
        temperature: "冷",
        special: "清新口感，冰凉解暑",
        capacity: "300ml",
        price: "20￥",
    },
    {
        productName: "冰拿铁",
        temperature: "冷",
        special: "浓香奶泡，经典选择",
        capacity: "300ml",
        price: "25￥",
    },
    {
        productName: "冰摩卡",
        temperature: "冷",
        special: "巧克力与咖啡的完美融合",
        capacity: "300ml",
        price: "28￥",
    },
];
// const coffeeList = [
//     {
//         productName: "金典冷萃咖啡",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 33,
//     },
//     {
//         productName: "拿铁",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 30,
//     },
//     {
//         productName: "摩卡",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 35,
//     },
//     {
//         productName: "卡布奇诺",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 30,
//     },
//     {
//         productName: "美式",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 25,
//     },
//     {
//         productName: "馥芮白",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 35,
//     },
//     {
//         productName: "焦糖玛奇朵",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 35,
//     },
//     {
//         productName: "抹茶拿铁",
//         image: "path-to-image.jpg",
//         temperature: "热",
//         capacity: "400ml",
//         price: 35,
//     },
//     {
//         productName: "冰美式",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 25,
//     },
//     {
//         productName: "冰拿铁",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 30,
//     },
//     {
//         productName: "冰摩卡",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 35,
//     },
//     {
//         productName: "冰卡布奇诺",
//         image: "path-to-image.jpg",
//         temperature: "冷",
//         capacity: "400ml",
//         price: 30,
//     },
// ]
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    display: flex;  
    flex-direction: row;
    align-items: center;
    width: 270px;
    /* border: 1px solid #ddd; */
    border-radius: 8px;
    /* overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
    background-color: #E5E4E7;
}

.card-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    order: -1;
    /* 修改点：将图片调整为左侧 */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 5px;
    flex-grow: 1;
}

.card-content p {
    margin: 5px 0;
    text-align: left;
    font-size: 0.7rem;
}

.coffee-li {
    list-style-type: none;
}

.menu2 {
    display: flex;
    flex-wrap: nowrap;
}



.divider-vertical-container{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    margin-left: 10px;
}

.divider-vertical-pink{
    background-color: #e91e63;
}
.divider-vertical-green{

    background-color: #4caf50;
}
.divider-vertical-orange{
    background-color: #ff9800;
}
.divider-vertical-pink,.divider-vertical-green,.divider-vertical-orange{
    margin: 0px;
    padding-top: 1px;
    height: 50%;
    width: 5px;
}

.divider-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70%;
    margin-top: 10px;
    margin-left: 7px;
    padding: 0;
}

.divider-pink,
.divider-green,
.divider-orange {
    height: 13px;
    width: 33%;
    margin: 0px;
}
.divider-pink {
    background-color: #e91e63;
}

.divider-green {
    background-color: #4caf50;
}

.divider-orange {
    background-color: #ff9800;
}

.hello {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #E5E4E7;
    height: 100%;
    width: 100%;
}

header {
    
    text-align: left;
    background-color: #E5E4E7;
    padding: 20px;
    padding-left: 80px;
    /* border-bottom: 2px solid #ddd; */
}

header h1 {
    margin-left: 20px;
    margin-top: 0px;
    margin-bottom: 0px;
    font-size: 2.1rem;
}

header h2 {
    margin-left: 20px;
    margin-top: 0px;
    margin-bottom: 0px;
    font-size: 1.5rem;
    color: #777;
}

.menu-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.menu-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 15px;
    width: 280px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.menu-item img {
    width: 100%;
    height: auto;
}

.menu-item-content {
    padding: 15px;
}

.menu-item-title {
    font-size: 1.2rem;
    margin: 0;
    color: #333;
}

.menu-item-details {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #555;
}

.menu-item-price {
    font-size: 1rem;
    color: #e91e63;
    font-weight: bold;
}
</style>