Skip to content

Commit aee1353

Browse files
committed
fix: better link style
1 parent aa90b72 commit aee1353

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ declare module '@vue/runtime-core' {
132132
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
133133
NDivider: typeof import('naive-ui')['NDivider']
134134
NEllipsis: typeof import('naive-ui')['NEllipsis']
135+
NForm: typeof import('naive-ui')['NForm']
135136
NFormItem: typeof import('naive-ui')['NFormItem']
136137
NGi: typeof import('naive-ui')['NGi']
137138
NGrid: typeof import('naive-ui')['NGrid']

src/layouts/tool.layout.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import VueMarkdown from 'vue-markdown-render';
77
import BaseLayout from './base.layout.vue';
88
import FavoriteButton from '@/components/FavoriteButton.vue';
99
import type { Tool } from '@/tools/tools.types';
10+
import { useTheme } from '@/ui/c-link/c-link.theme';
11+
import { useThemeVars } from 'naive-ui';
1012
1113
const route = useRoute();
1214
@@ -33,7 +35,10 @@ const toolFooter = computed<string>(() => {
3335
const createLink = (linkText: string, url: string) => {
3436
return `[${linkText.replace('[', '\\[').replace(']', '\\]')}](${url.replace('(', '%28').replace(')', '%29')})`;
3537
};
36-
const footer = t(`tools.${i18nKey.value}.footer`, String(route.meta.footer));
38+
let footer = t(`tools.${i18nKey.value}.footer`, String(route.meta.footer));
39+
if (footer === 'undefined') {
40+
footer = '';
41+
}
3742
const npmPackages = (route.meta.npmPackages as string[] || [])
3843
.map(
3944
packageName => createLink(
@@ -42,6 +47,7 @@ const toolFooter = computed<string>(() => {
4247
);
4348
return ((npmPackages.length > 0 ? `Made with ${npmPackages.join(', ')}\n` : '') + footer).trim();
4449
});
50+
const themeVars = useThemeVars();
4551
</script>
4652

4753
<template>
@@ -124,9 +130,15 @@ const toolFooter = computed<string>(() => {
124130
opacity: 0.7;
125131
}
126132
}
127-
.tool-footer {
133+
}
134+
.tool-footer {
128135
opacity: 0.7;
129136
font-size: 12px;
137+
text-align: center;
138+
139+
::v-deep(a) {
140+
color: v-bind('themeVars.textColor1');
141+
font-style: italic;
142+
}
130143
}
131-
}
132144
</style>

0 commit comments

Comments
 (0)