📝 商店新增anti-dislink插件和tag展示

This commit is contained in:
远野千束 2024-08-22 10:41:41 +08:00
parent aa2d182840
commit 71476560e4
2 changed files with 50 additions and 2 deletions

View File

@ -2,6 +2,9 @@
<div class="item-card"> <div class="item-card">
<div class="item-name">{{ props.item.name }}</div> <div class="item-name">{{ props.item.name }}</div>
<div class="item-description">{{ props.item.desc }}</div> <div class="item-description">{{ props.item.desc }}</div>
<div class="tags">
<span class="tag" v-for="tag in props.item.tags" :key="tag" :style=getTagStyle(tag.color)>{{ tag.label }}</span>
</div>
<div class="item-bar"> <div class="item-bar">
<!-- 三个可点击svg一个github一个下载一个可点击"https://github.com/{{ username }}.png?size=80"个人头像配上id--> <!-- 三个可点击svg一个github一个下载一个可点击"https://github.com/{{ username }}.png?size=80"个人头像配上id-->
<a :href=props.item.homepage class="btn"> <a :href=props.item.homepage class="btn">
@ -45,6 +48,21 @@ const copyToClipboard = () => {
}) })
} }
const getTagStyle = (backgroundColor: string) => {
// RGB
const rgb = backgroundColor.replace(/^#/, '');
const [r, g, b] = rgb.match(/.{2}/g).map(x => parseInt(x, 16));
//
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
//
return {
backgroundColor: backgroundColor,
color: brightness > 128 ? '#000' : '#fff'
};
};
// //
</script> </script>
@ -123,4 +141,12 @@ button {
justify-content: space-between; justify-content: space-between;
color: #00000055; color: #00000055;
} }
.tag {
display: inline-block;
padding: 2px 5px;
margin-right: 5px;
border-radius: 5px;
font-size: 12px;
}
</style> </style>

View File

@ -3,12 +3,12 @@
"module_name": "liteyukibot-plugin-nonebot", "module_name": "liteyukibot-plugin-nonebot",
"project_link": "liteyukibot-plugin-nonebot", "project_link": "liteyukibot-plugin-nonebot",
"name": "NoneBot插件", "name": "NoneBot插件",
"desc": "在轻雪中使用NoneBot为NoneBot开发者提供了更多便捷功能(已内置)", "desc": "在轻雪中使用NoneBot内置轻雪--NoneBot会话控制器插件为NoneBot开发者提供了更多便捷功能(已内置)",
"author": "snowykami", "author": "snowykami",
"homepage": "https://github.com/LiteyukiStudio/liteyukibot-plugin-nonebot", "homepage": "https://github.com/LiteyukiStudio/liteyukibot-plugin-nonebot",
"tags": [ "tags": [
{ {
"label": "server", "label": "app",
"color": "#aeeaa8" "color": "#aeeaa8"
} }
], ],
@ -16,5 +16,27 @@
"type": "application", "type": "application",
"valid": true, "valid": true,
"version": "rolling" "version": "rolling"
},
{
"module_name": "liteyukibot-plugin-antidislink",
"project_link": "liteyukibot-plugin-antidislink",
"name": "防断联插件",
"desc": "防止你的群友断联化",
"author": "snowykami",
"homepage": "https://github.com/snowykami/liteyukibot-plugin-antidislink",
"tags": [
{
"label": "app",
"color": "#aeeaa8"
},
{
"label": "dislink",
"color": "#d0e9ff"
}
],
"is_official": true,
"type": "application",
"valid": true,
"version": "rolling"
} }
] ]