mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-11 09:08:14 +08:00
⚡️ 优化公告详情在深色模式下的表现
This commit is contained in:
@@ -98,7 +98,7 @@ watch(loadShare, (value) => {
|
||||
});
|
||||
|
||||
function createAnnoJson(annoId: number) {
|
||||
const jsonPath = `/anno_detail/${annoId}`;
|
||||
const jsonPath = `/anno_detail_json/${annoId}`;
|
||||
const jsonTitle = `Anno_${annoId}_JSON`;
|
||||
createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @file web utils parseAnno.ts
|
||||
* @file web/utils/parseAnno.ts
|
||||
* @description 解析游戏内公告数据
|
||||
* @todo 需要完善
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
* @since Beta v0.4.0
|
||||
*/
|
||||
|
||||
import { decodeRegExp } from "./tools";
|
||||
import { saveImgLocal } from "../../utils/TGShare";
|
||||
import { isColorSimilar } from "../../utils/toolFunc";
|
||||
|
||||
/**
|
||||
* @description 解析游戏内公告数据
|
||||
* @since Alpha v0.2.0
|
||||
* @since Beta v0.4.0
|
||||
* @todo 需要完善
|
||||
* @param {string} data 游戏内公告数据
|
||||
* @returns {Promise<string>} 解析后的数据
|
||||
*/
|
||||
@@ -21,6 +21,12 @@ export async function parseAnnoContent(data: string): Promise<string> {
|
||||
if (span.style.fontSize) {
|
||||
span.style.fontSize = "";
|
||||
}
|
||||
// 获取color
|
||||
if (span.style.color) {
|
||||
if (isColorSimilar("#000000", span.style.color)) {
|
||||
span.style.color = "var(--app-page-content)";
|
||||
}
|
||||
}
|
||||
if (span.children.length === 0) {
|
||||
return (span.innerHTML = decodeRegExp(span.innerHTML));
|
||||
} else {
|
||||
@@ -65,7 +71,10 @@ export async function parseAnnoContent(data: string): Promise<string> {
|
||||
}
|
||||
});
|
||||
htmlBase.querySelectorAll("table").forEach((table) => {
|
||||
table.style.borderColor = "#546d8b";
|
||||
table.style.borderColor = "var(--common-shadow-2)";
|
||||
table.querySelectorAll("td").forEach((td) => {
|
||||
if (td.style.backgroundColor) td.style.backgroundColor = "var(--box-bg-1)";
|
||||
});
|
||||
});
|
||||
return htmlBase.body.innerHTML;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user