💄 美化未知类型样式

This commit is contained in:
BTMuli
2023-10-11 18:25:40 +08:00
parent e32988f663
commit adc96b7649
2 changed files with 19 additions and 17 deletions

View File

@@ -123,17 +123,6 @@
gap: 10px;
}
:deep(.mys-post-unknown) {
width: 800px;
padding: 10px;
border: 2px solid #485466;
border-radius: 10px;
margin: 10px auto;
background: #5b738f;
color: #faf7e8;
font-family: Consolas, monospace;
}
:deep(.mys-post-link-card-cover) {
width: auto;
height: 180px;
@@ -188,3 +177,19 @@
height: 45px;
margin: 0 5px;
}
/* 未知类型 */
:deep(.mys-post-unknown) {
width: 800px;
padding: 10px;
border: 1px solid var(--common-shadow-2);
border-radius: 10px;
background: var(--box-bg-1);
color: var(--common-text-content);
}
:deep(.mys-post-unknown-code) {
font-family: var(--font-text);
white-space: pre-wrap;
word-break: break-all;
}

View File

@@ -147,20 +147,17 @@ function transferParser(
/**
* @description 解析未知数据
* @since Alpha v0.1.1
* @since Beta v0.3.3
* @param {TGApp.Plugins.Mys.Post.StructuredContent} data Mys数据
* @returns {HTMLDivElement} 解析后的未知数据
*/
function parseUnknown(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivElement {
// 创建 div
const div = document.createElement("div");
div.classList.add("mys-post-unknown");
// 创建 code将数据放入 code
const code = document.createElement("code");
code.innerText = JSON.stringify(data);
// 插入 code
code.innerText = JSON.stringify(data, null, 2);
code.classList.add("mys-post-unknown-code");
div.appendChild(code);
// 返回 div
return div;
}