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