2023-05-28 23:13:24 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { useThemeVars } from 'naive-ui';
|
|
|
|
import FavoriteButton from './FavoriteButton.vue';
|
|
|
|
import { useAppTheme } from '@/ui/theme/themes';
|
|
|
|
import type { Tool } from '@/tools/tools.types';
|
|
|
|
|
|
|
|
const props = defineProps<{ tool: Tool & { category: string } }>();
|
|
|
|
const { tool } = toRefs(props);
|
|
|
|
const theme = useThemeVars();
|
|
|
|
|
|
|
|
const appTheme = useAppTheme();
|
|
|
|
</script>
|
|
|
|
|
2022-04-05 23:23:08 +02:00
|
|
|
<template>
|
2022-04-15 23:10:47 +02:00
|
|
|
<router-link :to="tool.path">
|
2023-04-20 20:49:28 +02:00
|
|
|
<c-card class="tool-card">
|
2023-05-27 17:36:15 +02:00
|
|
|
<div flex items-center justify-between>
|
2022-06-01 23:52:21 +02:00
|
|
|
<n-icon class="icon" size="40" :component="tool.icon" />
|
2023-05-27 17:36:15 +02:00
|
|
|
<div flex items-center gap-8px>
|
2022-12-17 01:30:02 +01:00
|
|
|
<n-tag
|
|
|
|
v-if="tool.isNew"
|
|
|
|
size="small"
|
|
|
|
class="badge-new"
|
|
|
|
round
|
|
|
|
type="success"
|
|
|
|
:bordered="false"
|
|
|
|
:color="{ color: theme.primaryColor, textColor: theme.tagColor }"
|
|
|
|
>
|
2023-10-22 16:21:10 +08:00
|
|
|
{{ $t('toolCard.new') }}
|
2022-12-17 01:30:02 +01:00
|
|
|
</n-tag>
|
|
|
|
|
2023-05-28 23:13:24 +02:00
|
|
|
<FavoriteButton :tool="tool" />
|
2023-05-27 17:36:15 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-15 23:10:47 +02:00
|
|
|
<n-h3 class="title">
|
|
|
|
<n-ellipsis>{{ tool.name }}</n-ellipsis>
|
|
|
|
</n-h3>
|
2022-06-01 23:52:21 +02:00
|
|
|
|
2022-04-15 23:10:47 +02:00
|
|
|
<div class="description">
|
2023-02-10 22:13:08 +01:00
|
|
|
<n-ellipsis :line-clamp="2" :tooltip="false" style="min-height: 44.78px">
|
2022-04-15 23:10:47 +02:00
|
|
|
{{ tool.description }}
|
2023-05-28 23:13:24 +02:00
|
|
|
<br>
|
2022-04-15 23:10:47 +02:00
|
|
|
</n-ellipsis>
|
|
|
|
</div>
|
2023-04-20 20:49:28 +02:00
|
|
|
</c-card>
|
2022-04-15 23:10:47 +02:00
|
|
|
</router-link>
|
2022-04-05 23:23:08 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
a {
|
2022-04-22 23:31:40 +02:00
|
|
|
text-decoration: none;
|
2022-04-05 23:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.tool-card {
|
2023-04-20 20:49:28 +02:00
|
|
|
transition: border-color ease 0.5s;
|
|
|
|
border-width: 2px !important;
|
2023-05-01 13:44:30 +02:00
|
|
|
color: transparent;
|
2023-04-20 20:49:28 +02:00
|
|
|
|
2022-04-22 23:31:40 +02:00
|
|
|
&:hover {
|
2023-04-20 20:49:28 +02:00
|
|
|
border-color: v-bind('appTheme.primary.colorHover');
|
2022-04-22 23:31:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.icon {
|
2022-11-13 23:13:50 +01:00
|
|
|
opacity: 0.6;
|
2022-12-16 21:57:23 +01:00
|
|
|
color: v-bind('theme.textColorBase');
|
2022-04-22 23:31:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
margin: 5px 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.description {
|
2022-11-13 23:13:50 +01:00
|
|
|
opacity: 0.6;
|
2022-12-16 21:57:23 +01:00
|
|
|
color: v-bind('theme.textColorBase');
|
2022-04-22 23:31:40 +02:00
|
|
|
margin: 5px 0;
|
|
|
|
}
|
2022-04-05 23:23:08 +02:00
|
|
|
}
|
2022-04-22 23:31:40 +02:00
|
|
|
</style>
|