perf: 优化机器人回复

This commit is contained in:
kuaifan 2024-04-11 10:12:50 +08:00
parent 985c5ff54b
commit ae83fce524
3 changed files with 18 additions and 10 deletions

View File

@ -25,7 +25,7 @@ const MarkdownUtils = {
export function MarkdownConver(text) { export function MarkdownConver(text) {
if (text === '...') { if (text === '...') {
return '<p><span class="input-blink"></span>&nbsp;</p>' return '<div class="input-blink"></div>'
} }
if (MarkdownUtils.mdi === null) { if (MarkdownUtils.mdi === null) {
MarkdownUtils.mdi = new MarkdownIt({ MarkdownUtils.mdi = new MarkdownIt({

View File

@ -74,14 +74,19 @@ body {
} }
.input-blink { .input-blink {
position: absolute; width: 10px;
content: ''; height: 20px;
display: inline-block; position: relative;
width: 2px; &:before {
height: 16px; position: absolute;
top: 50%; content: '';
transform: translateY(-50%); display: inline-block;
animation: blink-animate 1.2s infinite steps(1, start); width: 2px;
height: 16px;
top: 50%;
transform: translateY(-50%);
animation: blink-animate 1.2s infinite steps(1, start);
}
} }
} }

View File

@ -578,7 +578,9 @@
} }
.item-leave { .item-leave {
pre, code { pre,
code,
.markdown-body {
visibility: hidden; visibility: hidden;
} }
} }
@ -774,6 +776,7 @@
} }
.markdown-body { .markdown-body {
min-height: 20px;
line-height: 20px; line-height: 20px;
} }