flaunt-web/src/components/ToolCard.vue

194 lines
4.3 KiB
Vue

<template>
<div v-if="type === 'large'" class="feature-card" @click="$emit('itemClick')">
<div class="row-top">
<img class="feature-img" :src="icon" />
<div class="text-col">
<span class="feature-title"> {{ title }} </span>
<span class="feature-desc"> {{ desc }} </span>
</div>
</div>
<div class="btn-box">
<span class="btn"> 开始模拟 </span>
</div>
</div>
<div v-else class="tool-card" @click="$emit('itemClick')">
<img class="tool-img" :src="icon" />
<div class="tool-text">
<span class="tool-title"> {{ title }} </span>
<span class="tool-desc"> {{ desc }} </span>
</div>
</div>
</template>
<script setup>
defineProps({
icon: {
type: String,
required: true
},
title: {
type: String,
required: true
},
desc: {
type: String,
required: true
},
type: {
type: String,
default: 'small'
}
})
defineEmits(['itemClick'])
</script>
<style lang="scss" scoped>
/* Large Card */
.feature-card {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 72px 35px 28px 44px;
position: relative;
width: 550px;
height: 300px;
border-radius: 19px;
background-color: #ffffff;
transition: box-shadow 0.3s ease;
cursor: pointer;
&:hover {
box-shadow: 0px 0px 25px 0px rgba(0, 0, 0, 0.2);
}
.row-top {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
}
.feature-img {
width: 154px;
height: 154px;
border-radius: 20px;
margin-right: 12px;
}
.text-col {
display: flex;
flex-direction: column;
}
.feature-title {
font-weight: 700;
font-size: 30px;
color: #1A1A1A;
line-height: 30px;
margin-bottom: 30px;
font-family: Source Han Sans, Source Han Sans;
}
.feature-desc {
font-family: Source Han Sans, Source Han Sans;
font-weight: 400;
font-size: 24px;
color: #767676;
line-height: 24px;
}
.btn-box {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-end;
margin-top: auto;
.btn {
width: 120px;
height: 36px;
line-height: 36px;
text-align: center;
font-size: 18px;
color: #fff;
font-weight: 700;
background: linear-gradient(215deg, #A679F4 7.14%, #778CF5 100%);
border-radius: 10px;
}
}
}
/* Small Card */
.tool-card {
position: relative;
width: 370px;
height: 200px;
border-radius: 15px;
background-color: #f7f8ff;
display: flex;
flex-direction: row;
align-items: flex-start;
isolation: isolate;
margin-top: 0;
cursor: pointer;
&:hover {
background: #FFFFFF;
box-shadow: 0px 0px 20px 0px #E7E8F3;
}
.tool-img {
width: 100px;
height: 100px;
border-radius: 15px;
object-fit: cover;
z-index: 1;
position: relative;
margin-left: 35px;
margin-top: 50px;
}
.tool-text {
position: relative;
display: flex;
width: 198px;
height: 200px;
flex-direction: column;
align-items: flex-start;
z-index: 0;
margin-left: 12px;
margin-top: 0;
.tool-title {
width: 127px;
height: 36px;
position: relative;
font-size: 24px;
white-space: pre;
margin-top: 63px;
margin-bottom: -4.5px;
margin-left: calc(50% - 99px);
margin-right: auto;
font-weight: 700;
color: #1A1A1A;
line-height: 24px;
}
.tool-desc {
width: 100%;
height: 30px;
position: relative;
white-space: pre;
margin-top: 23px;
margin-bottom: -4px;
margin-left: auto;
margin-right: auto;
font-size: 20px;
color: #767676;
line-height: 20px;
}
}
}
</style>