Skip to content

Commit

Permalink
docs: 更新 README
Browse files Browse the repository at this point in the history
  • Loading branch information
fxzer committed Jul 14, 2024
1 parent a3ba820 commit 335ac80
Show file tree
Hide file tree
Showing 4 changed files with 633 additions and 548 deletions.
46 changes: 23 additions & 23 deletions docs/.vitepress/theme/components/ToolItem.vue
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<template>
<a class="tool-item" :href="tool.url" target="blank">
<Loading class="tool-icon" v-show="!isLoaded" />
<img class="tool-icon" v-show="isLoaded" :alt="tool.name" :src="src" :onload="onLoad" :onError="onError">
<p class="tool-name">{{ tool.name }}</p>
</a>
</template>
<script setup lang='ts'>
const { tool } = defineProps({
tool: {
type: Object,
required: true,
}
},
})
const isLoaded = ref(false)
const src = computed(() => {
let { icon, iconType, url } = tool
return icon ? icon : (url + 'favicon.' + (iconType ? iconType : 'ico'))
const { icon, iconType, url } = tool
return icon || (`${url}favicon.${iconType || 'ico'}`)
})
const onError = (e: any) => {
e.target.src = 'https://zerdocs.oss-cn-shanghai.aliyuncs.com/202302062047848.svg'
const backupSrc = 'https://zerdocs.oss-cn-shanghai.aliyuncs.com/202302062047848.svg'
function onError(e) {
if (e.target.src !== backupSrc) {
e.target.src = backupSrc
}
else {
console.warn('备用图片也加载失败')
}
}
const onLoad = (e: any) => {
function onLoad(e) {
isLoaded.value = true
e.target.onerror = null
e.target.onload = null
}
</script>

<template>
<a class="tool-item" :href="tool.url" target="blank">
<Loading v-show="!isLoaded" class="tool-icon" />
<img v-show="isLoaded" class="tool-icon" :alt="tool.name" :src="src" :onload="onLoad" :onerror="onError">
<p class="tool-name">{{ tool.name }}</p>
</a>
</template>

<style scoped lang='scss'>
$hover-color: linear-gradient(135deg, #5fe687 10%, #04d1e7 100%);
$gradient-color: linear-gradient(120deg, #bd34fe, var(--vp-c-brand-light));
.dark {
.tool-item {
.tool-icon {
border: 1px solid #555;
}
}
}
.tool-item {
width: 90px;
height: 90px;
Expand All @@ -50,12 +50,12 @@ $gradient-color: linear-gradient(120deg, #bd34fe, var(--vp-c-brand-light));
width: 60px;
height: 60px;
margin: 0 15px 5px 15px;
border: 1px solid #eee;
border: 1px solid #a8a8a875;
border-radius: 8px;
transition: all 0.2s ease-in-out;
&:hover {
border: 1px solid var(--vp-c-green);
border: 1px solid var(--vp-c-brand-light);
}
}
Expand Down
22 changes: 21 additions & 1 deletion docs/.vitepress/theme/components/toolGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ interface Tool {
icon:'https://ng.ant.design/assets/img/logo.svg',
url: 'https://ant.design/index-cn/'
},
{
name: 'NaiveUI',
icon:'https://www.naiveui.com/assets/naivelogo-BdDVTUmz.svg',
url: 'https://www.naiveui.com/zh-CN/os-theme/docs/installation'
},
{
name: 'Arco Design',
icon:'https://unpkg.byted-static.com/latest/byted/arco-config/assets/favicon.ico',
Expand Down Expand Up @@ -107,7 +112,7 @@ interface Tool {
url: 'https://arco.design/palette/list'
},
{
name: 'ioDraw',
name: 'CoolHue',
icon: 'https://webkul.github.io/coolhue/images/coolhue-logo.png',
url: 'https://webkul.github.io/coolhue/'
},
Expand All @@ -130,11 +135,26 @@ interface Tool {
icon:'https://coolors.co/assets/img/favicon.png',
url: 'https://coolors.co/'
},
{
name: 'Realtime Colors',
icon:'https://www.realtimecolors.com/favicon.png',
url: 'https://www.realtimecolors.com/'
},
{
name: 'EvaDesign',
icon:'https://colors.eva.design/favicon.ico',
url: 'https://colors.eva.design/'
},
{
name: 'MyColor',
icon:'https://mycolor.space/img/color-space-logo.png',
url: 'https://mycolor.space/'
},
{
name: 'CoolBackground',
icon:'https://coolbackgrounds.io/images/favicon-fe5a0ff5.png',
url: 'https://coolbackgrounds.io/'
},
]

}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"vite-plugin-vitepress-auto-sidebar": "^1.6.5"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.3",
"@iconify/json": "^2.2.225",
"eslint": "^9.6.0",
"@antfu/eslint-config": "^2.22.2",
"@iconify/json": "^2.2.227",
"eslint": "^9.7.0",
"eslint-plugin-format": "^0.1.2",
"lint-staged": "^15.2.7",
"puppeteer": "^22.12.1",
"sass": "^1.77.6",
"puppeteer": "^22.13.0",
"sass": "^1.77.8",
"simple-git-hooks": "^2.11.1",
"unocss": "^0.61.2",
"unplugin-auto-import": "^0.17.6",
"unocss": "^0.61.3",
"unplugin-auto-import": "^0.18.0",
"unplugin-icons": "^0.19.0",
"unplugin-vue-components": "^0.27.2",
"vite": "^5.3.3",
Expand Down
Loading

0 comments on commit 335ac80

Please sign in to comment.