mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-11 05:17:24 +08:00
📝 商店新增anti-dislink插件和tag展示
This commit is contained in:
parent
aa2d182840
commit
71476560e4
@ -2,6 +2,9 @@
|
||||
<div class="item-card">
|
||||
<div class="item-name">{{ props.item.name }}</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">
|
||||
<!-- 三个可点击svg,一个github,一个下载,一个可点击"https://github.com/{{ username }}.png?size=80"个人头像配上id-->
|
||||
<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>
|
||||
@ -123,4 +141,12 @@ button {
|
||||
justify-content: space-between;
|
||||
color: #00000055;
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
margin-right: 5px;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
@ -3,12 +3,12 @@
|
||||
"module_name": "liteyukibot-plugin-nonebot",
|
||||
"project_link": "liteyukibot-plugin-nonebot",
|
||||
"name": "NoneBot插件",
|
||||
"desc": "在轻雪中使用NoneBot,为NoneBot开发者提供了更多便捷功能(已内置)",
|
||||
"desc": "在轻雪中使用NoneBot,内置轻雪--NoneBot会话控制器插件,为NoneBot开发者提供了更多便捷功能(已内置)",
|
||||
"author": "snowykami",
|
||||
"homepage": "https://github.com/LiteyukiStudio/liteyukibot-plugin-nonebot",
|
||||
"tags": [
|
||||
{
|
||||
"label": "server",
|
||||
"label": "app",
|
||||
"color": "#aeeaa8"
|
||||
}
|
||||
],
|
||||
@ -16,5 +16,27 @@
|
||||
"type": "application",
|
||||
"valid": true,
|
||||
"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"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user