🐛 修复状态渐变只能渐变第一个

This commit is contained in:
yeyang
2024-06-24 17:10:02 +08:00
parent 0ed1053a97
commit 5b695dd6a6
3 changed files with 41 additions and 54 deletions

View File

@@ -1,11 +1,12 @@
/* eslint-disable import/no-unresolved */
import { common } from "../model/index.js"
import { Plugin_Name } from "../components/index.js"
let Update = null
try {
Update = (await import("../../other/update.js").catch(e => null))?.update
Update ||= (await import("../../system/apps/update.ts")).update
} catch (e) {
logger.error("[yenai-plugin]未获取到更新js #椰奶更新 将无法使用")
logger.error(`[Yenai-Plugin]未获取到更新js ${logger.yellow("#椰奶更新")} 将无法使用`)
}
export class YenaiUpdate extends plugin {
@@ -18,6 +19,10 @@ export class YenaiUpdate extends plugin {
{
reg: "^#*椰奶(插件)?(强制)?更新$",
fnc: "update"
},
{
reg: "^#?椰奶(插件)?更新日志$",
fnc: "update_log"
}
]
})
@@ -31,4 +36,16 @@ export class YenaiUpdate extends plugin {
up.e = e
return up.update()
}
async update_log() {
// eslint-disable-next-line new-cap
let Update_Plugin = new Update()
Update_Plugin.e = this.e
Update_Plugin.reply = this.reply
if (Update_Plugin.getPlugin(Plugin_Name)) {
this.e.reply(await Update_Plugin.getLog(Plugin_Name))
}
return true
}
}

View File

@@ -1,13 +1,6 @@
/* eslint-disable import/no-unresolved */
import { Version, Plugin_Name } from "../components/index.js"
import { Version } from "../components/index.js"
import { puppeteer } from "../model/index.js"
let update = null
try {
update = (await import("../../other/update.js").catch(e => null))?.update
update ||= (await import("../../system/apps/update.ts")).update
} catch (e) {
// logger.error("[yenai-plugin]未获取到更新js #椰奶更新 将无法使用")
}
export class NewVersion extends plugin {
constructor() {
super({
@@ -18,45 +11,20 @@ export class NewVersion extends plugin {
{
reg: "^#?椰奶(插件)?版本$",
fnc: "plugin_version"
},
{
reg: "^#?椰奶(插件)?更新日志$",
fnc: "update_log"
}
]
})
this.key = "yenai:restart"
}
async plugin_version() {
return versionInfo(this.e)
}
async update_log() {
// eslint-disable-next-line new-cap
let Update_Plugin = new update()
Update_Plugin.e = this.e
Update_Plugin.reply = this.reply
if (Update_Plugin.getPlugin(Plugin_Name)) {
this.e.reply(await Update_Plugin.getLog(Plugin_Name))
}
return true
async plugin_version(e) {
return await puppeteer.render(
"help/version-info",
{
currentVersion: Version.ver,
changelogs: Version.logs,
elem: "cryo"
},
{ e, scale: 1.4 }
)
}
}
/**
*
* @param e
*/
async function versionInfo(e) {
return await puppeteer.render(
"help/version-info",
{
currentVersion: Version.ver,
changelogs: Version.logs,
elem: "cryo"
},
{ e, scale: 1.4 }
)
}

View File

@@ -5,15 +5,17 @@ const {
lowColor
} = Config
// 修改BotNameColor
const BotNameElement = document.querySelector(".header h1")
if (BotNameColorGradient && BotNameColorGradient !== "none") {
BotNameElement.style.backgroundImage = `linear-gradient(${BotNameColorGradient})`
BotNameElement.style.color = "transparent"
BotNameElement.style.backgroundClip = "text"
} else if (BotNameColor && BotNameColor !== "none") {
BotNameElement.style.color = BotNameColor
BotNameElement.style.backgroundImage = "none"
}
const botNameElements = document.querySelectorAll(".header h1")
botNameElements.forEach(BotNameElement => {
if (BotNameColorGradient && BotNameColorGradient !== "none") {
BotNameElement.style.backgroundImage = `linear-gradient(${BotNameColorGradient})`
BotNameElement.style.color = "transparent"
BotNameElement.style.backgroundClip = "text"
} else if (BotNameColor && BotNameColor !== "none") {
BotNameElement.style.color = BotNameColor
BotNameElement.style.backgroundImage = "none"
}
})
// 进度条颜色
const documentElement = document.documentElement
documentElement.style.setProperty("--high-color", highColor)