Skip to content

Commit a07806c

Browse files
authored
refactor(home): lightened tool cards (CorentinTh#882)
1 parent 10e56b3 commit a07806c

File tree

1 file changed

+16
-53
lines changed

1 file changed

+16
-53
lines changed

src/components/ToolCard.vue

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,41 @@
11
<script setup lang="ts">
22
import { useThemeVars } from 'naive-ui';
33
import FavoriteButton from './FavoriteButton.vue';
4-
import { useAppTheme } from '@/ui/theme/themes';
54
import type { Tool } from '@/tools/tools.types';
65
76
const props = defineProps<{ tool: Tool & { category: string } }>();
87
const { tool } = toRefs(props);
98
const theme = useThemeVars();
10-
11-
const appTheme = useAppTheme();
129
</script>
1310

1411
<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">
1714
<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+
1917
<div flex items-center gap-8px>
20-
<n-tag
18+
<div
2119
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+
}"
2824
>
2925
{{ $t('toolCard.new') }}
30-
</n-tag>
26+
</div>
3127

3228
<FavoriteButton :tool="tool" />
3329
</div>
3430
</div>
35-
<n-h3 class="title">
36-
<n-ellipsis>{{ tool.name }}</n-ellipsis>
37-
</n-h3>
3831

39-
<div class="description">
40-
<n-ellipsis :line-clamp="2" :tooltip="false" style="min-height: 44.78px">
41-
{{ tool.description }}
42-
<br>&nbsp;
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 }}
4438
</div>
4539
</c-card>
4640
</router-link>
4741
</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

Comments
 (0)