2022-04-05 23:23:08 +02:00
|
|
|
<template>
|
2022-04-15 23:10:47 +02:00
|
|
|
<router-link :to="tool.path">
|
|
|
|
<n-card class="tool-card">
|
2022-06-01 23:52:21 +02:00
|
|
|
<n-space justify="space-between" align="center">
|
|
|
|
<n-icon class="icon" size="40" :component="tool.icon" />
|
|
|
|
<n-tag
|
|
|
|
v-if="tool.isNew"
|
|
|
|
size="small"
|
|
|
|
class="badge-new"
|
|
|
|
round
|
|
|
|
type="success"
|
|
|
|
:bordered="false"
|
|
|
|
:color="{ color: theme.primaryColor, textColor: theme.tagColor }"
|
|
|
|
>
|
|
|
|
New
|
|
|
|
</n-tag>
|
|
|
|
</n-space>
|
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">
|
2022-04-22 23:31:40 +02:00
|
|
|
<n-ellipsis :line-clamp="2" :tooltip="false">
|
2022-04-15 23:10:47 +02:00
|
|
|
{{ tool.description }}
|
|
|
|
</n-ellipsis>
|
|
|
|
</div>
|
|
|
|
</n-card>
|
|
|
|
</router-link>
|
2022-04-05 23:23:08 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-06-01 23:52:21 +02:00
|
|
|
import type { ITool } from '@/tools/tool';
|
|
|
|
import { useThemeVars } from 'naive-ui';
|
2022-05-24 00:07:24 +02:00
|
|
|
import { toRefs } from 'vue';
|
2022-04-05 23:23:08 +02:00
|
|
|
|
2022-04-22 23:31:40 +02:00
|
|
|
const props = defineProps<{ tool: ITool & { category: string } }>();
|
|
|
|
const { tool } = toRefs(props);
|
2022-06-01 23:52:21 +02:00
|
|
|
const theme = useThemeVars();
|
2022-04-05 23:23:08 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<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 {
|
2022-04-22 23:31:40 +02:00
|
|
|
&:hover {
|
|
|
|
border-color: var(--n-color-target);
|
|
|
|
}
|
|
|
|
|
|
|
|
.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>
|