From 3cae4860f1ff3fba58597ac571448af295d5ab0b Mon Sep 17 00:00:00 2001 From: langxm Date: Wed, 14 Oct 2026 14:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(M7.8):=20=E8=BE=93=E5=85=A5=E5=BD=A2?= =?UTF-8?q?=E6=80=81=E5=90=88=E5=B9=B6=E2=80=94=E2=80=94=E5=8D=95Monaco+?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E5=8D=B3=E5=BD=A2=E6=80=81(Markdown=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=AF=B9=E8=AF=9D+LaTeX)=EF=BC=9B=E5=88=A0=E4=B8=89?= =?UTF-8?q?=E6=80=81=E6=A0=87=E7=AD=BE/=E5=85=AC=E5=BC=8F=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E6=8C=89=E9=92=AE=E6=9D=A1/=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=B5=81=E5=B0=8F=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=9BMarkdown?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E4=BF=9D=E7=95=99(=E5=AE=BD=E5=B1=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7/=E7=AA=84=E9=AB=98=E5=B1=8F=E4=B8=8B?= =?UTF-8?q?=E6=96=B9/=E6=89=8B=E6=9C=BA=E6=97=A0)=E5=B9=B6mdRender+MathJax?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=EF=BC=9B=E4=BB=A3=E7=A0=81=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=89=8D=E6=98=BE=E7=A4=BA=E6=B5=8B=E8=AF=84=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=9BMarkdown=E6=8F=90=E4=BA=A4=E8=B5=B0=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 252 +++++++++++++++++--------------------------- 1 file changed, 99 insertions(+), 153 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 0bf42ad..f41767d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -70,6 +70,8 @@ body{font-family:var(--sans);background:var(--bg);color:var(--text);font-size:14 .side{position:fixed;left:0;top:52px;bottom:0;z-index:60;width:224px;transform:translateX(-102%);transition:transform .2s ease;box-shadow:4px 0 18px rgba(20,28,40,.16)} .side.open{transform:translateX(0)} #sideToggle{display:inline-flex} + /* 手机:Markdown 预览不提供(录入不便),输入区占满 */ + .md-preview{display:none !important} /* 遮罩不默认显示:只在抽屉打开时由 toggleSide() 置 block,避免刷新即被灰层覆盖 */ } .chat-head{flex:none;padding:10px 16px;border-bottom:1px solid var(--line2);font-size:12px;color:var(--text2);display:flex;gap:10px;align-items:center} @@ -148,13 +150,31 @@ body{font-family:var(--sans);background:var(--bg);color:var(--text);font-size:14 .chat-input input:focus{border-color:var(--blue)} /* ===== 右:统一输入区 ===== */ .editor{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--card);min-height:0} -@media (max-width:859px), (min-height:1000px){ .editor{flex:4;min-height:180px} } +@media (max-width:859px), (min-height:1000px){ + .editor{flex:4;min-height:180px} + .editor-body{flex-direction:column} + .md-preview{width:100%;min-width:0;max-height:40%;flex:none} +} .editor-head{flex:none;display:flex;align-items:center;gap:10px;padding:9px 16px;border-bottom:1px solid var(--line2);background:var(--line2);font-size:12px;color:var(--text2)} .editor-head .morph{display:flex;gap:4px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:2px;font-size:11.5px} .editor-head .morph span{padding:3px 12px;border-radius:13px;color:var(--text3)} .editor-head .morph span.on{background:var(--blue);color:#fff;font-weight:600} .editor-head .morph b{font-weight:400} -.editor-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:12px 14px;gap:10px} +/* 统一输入区:宽屏左右分布(输入左、Markdown 预览右) */ +.editor-body{flex:1;display:flex;flex-direction:row;min-height:0;padding:12px 14px;gap:10px} +.md-editor{flex:1;min-width:0;display:flex;flex-direction:column} +#mdEditor .ide-wrap{flex:1;min-height:0;border:1.5px solid var(--line);border-radius:10px;overflow:hidden} +#mdEditor .ide-wrap .CodeMirror{height:100%;font-size:13.5px;line-height:1.65} +.md-preview{display:none;width:44%;min-width:300px;background:#fafbfc;border:1.5px solid var(--line);border-radius:10px;padding:12px;overflow:auto;font-size:13.5px;line-height:1.8} +.md-preview.on{display:block} +.md-preview .lg-course{margin-bottom:10px;padding-bottom:8px;border-bottom:1px dashed var(--line)} +.md-preview .lg-name{font-weight:600;font-size:13px;color:var(--blue);margin-bottom:4px} +.md-preview .lg-item{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;padding:3px 0;border-bottom:1px solid #eef1f4} +.md-preview .lg-item:last-child{border-bottom:none} +.md-preview .lg-tag{min-width:76px;font-size:11.5px;color:var(--text2);font-weight:600} +.md-preview .lg-math{font-size:14px;min-width:150px} +.md-preview .lg-desc{font-size:11px;color:var(--text3);flex:1;min-width:120px} +.md-preview .lg-md{background:#f3f6f9;border:1px solid var(--line);border-radius:8px;padding:8px 12px;margin-top:6px;font-size:12px} /* 形态面板 */ .morph-panel{display:none;flex:1;min-height:0;flex-direction:column} .morph-panel.on{display:flex} @@ -260,44 +280,28 @@ body{font-family:var(--sans);background:var(--bg);color:var(--text);font-size:14 AI 自适应
-
- - -
- 统一输入区 - - 对话代码LaTeX - - 点选切换形态 + 统一输入区 · 语言即形态:选代码语言写代码(可判题),选 Markdown 写文本/公式 - 预检自动执行,无需按钮 + 代码自动预检 · 内容自动保存
- -
- -
- -
+ +
- -
-
常用公式加载中…
-
LaTeX 实时渲染在上方,输入在下方(MathJax + mhchem)
-
-
+ +
- + Enter 发送并清空 @@ -307,7 +311,7 @@ body{font-family:var(--sans);background:var(--bg);color:var(--text);font-size:14
当前形态:对话 语言: 学习模式 @@ -362,7 +366,7 @@ window.MathJax = { window.addEventListener('load', function(){ setTimeout(function(){ if(!window.__mjReady){ - var p=document.getElementById('latexPreview'); + var p=document.getElementById('mdPreview'); if(p && p.innerHTML && p.innerHTML.indexOf('$$')>=0){ p.innerHTML+='
⚠ 公式渲染库未加载(CDN 不可达),预览暂时不可用。可继续输入,提交后教师端/AI 仍能正确渲染。
'; } @@ -372,7 +376,7 @@ window.addEventListener('load', function(){