|
1 | 1 | <script setup lang="ts">
|
2 | 2 | import { useThemeVars } from 'naive-ui';
|
3 | 3 | import FavoriteButton from './FavoriteButton.vue';
|
4 |
| -import { useAppTheme } from '@/ui/theme/themes'; |
5 | 4 | import type { Tool } from '@/tools/tools.types';
|
6 | 5 |
|
7 | 6 | const props = defineProps<{ tool: Tool & { category: string } }>();
|
8 | 7 | const { tool } = toRefs(props);
|
9 | 8 | const theme = useThemeVars();
|
10 |
| -
|
11 |
| -const appTheme = useAppTheme(); |
12 | 9 | </script>
|
13 | 10 |
|
14 | 11 | <template>
|
15 |
| - <router-link :to="tool.path"> |
16 |
| - <c-card class="tool-card"> |
| 12 | + <router-link :to="tool.path" class="decoration-none"> |
| 13 | + <c-card class="h-full transition transition-duration-0.5s !border-2px !hover:border-primary"> |
17 | 14 | <div flex items-center justify-between>
|
18 |
| - <n-icon class="icon" size="40" :component="tool.icon" /> |
| 15 | + <n-icon class="text-neutral-400 dark:text-neutral-600" size="40" :component="tool.icon" /> |
| 16 | + |
19 | 17 | <div flex items-center gap-8px>
|
20 |
| - <n-tag |
| 18 | + <div |
21 | 19 | v-if="tool.isNew"
|
22 |
| - size="small" |
23 |
| - class="badge-new" |
24 |
| - round |
25 |
| - type="success" |
26 |
| - :bordered="false" |
27 |
| - :color="{ color: theme.primaryColor, textColor: theme.tagColor }" |
| 20 | + class="rounded-full px-8px py-3px text-xs text-white dark:text-neutral-800" |
| 21 | + :style="{ |
| 22 | + 'background-color': theme.primaryColor, |
| 23 | + }" |
28 | 24 | >
|
29 | 25 | {{ $t('toolCard.new') }}
|
30 |
| - </n-tag> |
| 26 | + </div> |
31 | 27 |
|
32 | 28 | <FavoriteButton :tool="tool" />
|
33 | 29 | </div>
|
34 | 30 | </div>
|
35 |
| - <n-h3 class="title"> |
36 |
| - <n-ellipsis>{{ tool.name }}</n-ellipsis> |
37 |
| - </n-h3> |
38 | 31 |
|
39 |
| - <div class="description"> |
40 |
| - <n-ellipsis :line-clamp="2" :tooltip="false" style="min-height: 44.78px"> |
41 |
| - {{ tool.description }} |
42 |
| - <br> |
43 |
| - </n-ellipsis> |
| 32 | + <div class="truncat my-5px text-lg text-black dark:text-white"> |
| 33 | + {{ tool.name }} |
| 34 | + </div> |
| 35 | + |
| 36 | + <div class="line-clamp-2 text-neutral-500 dark:text-neutral-400"> |
| 37 | + {{ tool.description }} |
44 | 38 | </div>
|
45 | 39 | </c-card>
|
46 | 40 | </router-link>
|
47 | 41 | </template>
|
48 |
| - |
49 |
| -<style lang="less" scoped> |
50 |
| -a { |
51 |
| - text-decoration: none; |
52 |
| -} |
53 |
| -
|
54 |
| -.tool-card { |
55 |
| - transition: border-color ease 0.5s; |
56 |
| - border-width: 2px !important; |
57 |
| - color: transparent; |
58 |
| -
|
59 |
| - &:hover { |
60 |
| - border-color: v-bind('appTheme.primary.colorHover'); |
61 |
| - } |
62 |
| -
|
63 |
| - .icon { |
64 |
| - opacity: 0.6; |
65 |
| - color: v-bind('theme.textColorBase'); |
66 |
| - } |
67 |
| -
|
68 |
| - .title { |
69 |
| - margin: 5px 0; |
70 |
| - } |
71 |
| -
|
72 |
| - .description { |
73 |
| - opacity: 0.6; |
74 |
| - color: v-bind('theme.textColorBase'); |
75 |
| - margin: 5px 0; |
76 |
| - } |
77 |
| -} |
78 |
| -</style> |
0 commit comments