feat: ui优化
Some checks failed
Test / test (macos-latest) (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
Test / test (windows-latest) (push) Has been cancelled

This commit is contained in:
hackrobot
2025-03-28 10:31:49 -05:00
parent e6110f8d69
commit 5140746d34

View File

@@ -42,12 +42,18 @@ import TextArea from 'antd/es/input/TextArea';
const createDecoratedTitleHTML = (text: any) => {
const padding = 2; // 内容左右两边的空格数
const lineChar = '─'; // 水平线字符
const edgeChar = ''; // 边框装饰字符
const cornerTopLeft = '╔';
const cornerTopRight = '╗';
const cornerBottomLeft = '╚';
const cornerBottomRight = '╝';
const edgeChar = ''; // 边框装饰字符
// const edgeChar = '━'; // 边框装饰字符
// const cornerTopLeft = '╔';
// const cornerTopRight = '╗';
// const cornerBottomLeft = '╚';
// const cornerBottomRight = '╝';
const cornerTopLeft = '╭'; // 顶部左角
const cornerTopRight = '╮'; // 顶部右角
const cornerBottomLeft = '╰'; // 底部左角
const cornerBottomRight = '╯'; // 底部右角
// 计算标题长度
const titleLength = text.length + padding * 2;
@@ -58,6 +64,8 @@ const createDecoratedTitleHTML = (text: any) => {
const topBorder = `${cornerTopLeft}${edgeLength}${cornerTopRight}`;
const bottomBorder = `${cornerBottomLeft}${edgeLength}${cornerBottomRight}`;
const middleLine = ` 📢 ${text}`;
// const middleLine = ` ⚡ ${text}`;
return `<div>${topBorder}<br/>${middleLine}<br/>${bottomBorder}</div>`;
// return `<div>${topBorder}<br/>${middleLine}<br/>${bottomBorder}</div><br/>`;
@@ -131,7 +139,7 @@ renderer.list = function (body, ordered, start) {
console.log('value--', value);
// 判断是否是任务
let task = false;
if (value.includes('🔸') || value.includes('🔸✅')) {
if (value.includes('🔸') || value.includes('🔸✅')) {
task = true;
}
return value.indexOf(listSinbal) !== -1
@@ -166,8 +174,8 @@ renderer.listitem = function (text, task, checked) {
// 任务列表
renderer.checkbox = function (checked) {
// ✅❌
return !!checked ? '✅' : '';
// ✅❌
return !!checked ? '✅' : '';
return (
'<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox">'
);
@@ -243,8 +251,8 @@ renderer.blockquote = function (quote) {
// &nbsp;
// return `<span style="white-space:pre;" class="blockquote">\t 👉${content}</span><br/> `
// return `<div style="white-space:pre;" class="blockquote">\t 📌${content}</div>\n`; //ok
// ├─
return `<div style="white-space:pre;" class="blockquote">&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;└─📌${content}</div>`;
// ├─
return `<div style="white-space:pre;" class="blockquote">&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;└─${content}</div>`;
};
renderer.table = function (header, body) {
@@ -285,7 +293,7 @@ renderer.link = function (href, title, text) {
return text;
}
href = cleanHref;
console.log('href-',href)
console.log('href-', href);
let out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"';
@@ -294,8 +302,7 @@ renderer.link = function (href, title, text) {
// out += ">" +`🔗`+ text + "</a>"+`(${href})`;
// console.log('out-',out)
return out+`: ${href}`;
return out + `: ${href}`;
};
renderer.paragraph = function (text) {
@@ -356,15 +363,16 @@ const Index = () => {
// │ 🆔 hackrobot
// ╰────────────────╯<br>💬 随时欢迎聊天`;
let contactMe = `<br><br>💬 欢迎交流<br>后台私信发送『关键词』: 加群`;
setmarkText(value);
// let contactMe = `<br><br>💬 欢迎交流<br>后台私信发送『关键词』: 加群`;
let contactMe = `<br><br>©️ 本文使用🔗『mdemoji.com』 编辑 `;
// setmarkText(value);
// setmarkText(value + contactMe);
// if (value?.length < 10) {
// setmarkText(value);
// } else {
// setmarkText(value + contactMe);
// }
if (value?.length < 10) {
setmarkText(value);
} else {
setmarkText(value + contactMe);
}
};
useEffect(() => {}, []);