mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-07-09 02:02:48 +08:00
feat(phoneimage): 三列布局重构 - 添加渲染预览区并改造渲染管线
- 增加中间渲染预览列(540px),三列布局:编辑器 | 预览 | 缩略图 - CSS作用域迁移:排版样式从#editor-text-area迁移到#render-preview - 编辑器恢复干净默认样式,消除表格/图片间隙和溢出问题 - 新增syncPreview()实时同步编辑器内容到预览区(300ms防抖) - captureEditorBlocks()改为从预览区DOM测高,不再克隆编辑器DOM - render()改为从预览区读取已预处理HTML,所见即所得
This commit is contained in:
@@ -747,7 +747,17 @@ body > .page-header-right .layui-btn:not(.layui-btn-primary):not(.layui-btn-norm
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Editor Content - Basic Readability
|
||||
编辑器容器仅保留基础可读性样式
|
||||
============================================ */
|
||||
|
||||
/* Editor container - basic readability only */
|
||||
#editor-text-area {
|
||||
font-family: var(--pi-font-family);
|
||||
font-size: var(--pi-font-size-base);
|
||||
line-height: var(--pi-line-height);
|
||||
color: var(--pi-color-text);
|
||||
width: 540px;
|
||||
min-height: 300px;
|
||||
padding: 10px;
|
||||
@@ -755,93 +765,95 @@ body > .page-header-right .layui-btn:not(.layui-btn-primary):not(.layui-btn-norm
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Keep images constrained in editor */
|
||||
#editor-text-area img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Editor Content Typography (编辑器内排版样式)
|
||||
与截图输出区域(staging)的视觉保持一致
|
||||
作用域: #editor-text-area 内部元素
|
||||
Render Preview Area (渲染预览区排版样式)
|
||||
中间预览列的完整排版样式
|
||||
============================================ */
|
||||
|
||||
#editor-text-area {
|
||||
#render-preview {
|
||||
font-family: var(--pi-font-family);
|
||||
font-size: var(--pi-font-size-base);
|
||||
line-height: var(--pi-line-height);
|
||||
color: var(--pi-color-text);
|
||||
}
|
||||
|
||||
/* 编辑区标题字号 — 与 .page-content h2~h6 对齐 */
|
||||
#editor-text-area h1 {
|
||||
/* 预览区标题字号 */
|
||||
#render-preview h1 {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
letter-spacing: 1px;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 12px;
|
||||
color: var(--pi-color-text);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
#editor-text-area h2 {
|
||||
#render-preview h2 {
|
||||
font-weight: normal;
|
||||
font-size: 18px;
|
||||
letter-spacing: 1px;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 12px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
#editor-text-area h3 {
|
||||
#render-preview h3 {
|
||||
font-weight: normal;
|
||||
font-size: 16px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#editor-text-area h4 {
|
||||
#render-preview h4 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-top: var(--pi-spacing-sm);
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#editor-text-area h5 {
|
||||
#render-preview h5 {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
margin-top: var(--pi-spacing-sm);
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#editor-text-area h6 {
|
||||
#render-preview h6 {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-top: var(--pi-spacing-sm);
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
color: var(--pi-color-text-light);
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 编辑区段落 */
|
||||
#editor-text-area p {
|
||||
/* 预览区段落 */
|
||||
#render-preview p {
|
||||
text-indent: 2em;
|
||||
margin-bottom: 16px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 编辑区图片 */
|
||||
#editor-text-area img {
|
||||
/* 预览区图片 */
|
||||
#render-preview img {
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
/* 编辑区表格 */
|
||||
#editor-text-area table {
|
||||
/* 预览区表格 */
|
||||
#render-preview table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 10px 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#editor-text-area th {
|
||||
#render-preview th {
|
||||
background-color: #f0f0f0;
|
||||
font-weight: bold;
|
||||
padding: 8px 10px;
|
||||
@@ -849,17 +861,17 @@ body > .page-header-right .layui-btn:not(.layui-btn-primary):not(.layui-btn-norm
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#editor-text-area td {
|
||||
#render-preview td {
|
||||
padding: 8px 10px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#editor-text-area tr:nth-child(even) td {
|
||||
#render-preview tr:nth-child(even) td {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
/* 编辑区代码块 */
|
||||
#editor-text-area pre {
|
||||
/* 预览区代码块 */
|
||||
#render-preview pre {
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 4px;
|
||||
@@ -870,34 +882,34 @@ body > .page-header-right .layui-btn:not(.layui-btn-primary):not(.layui-btn-norm
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
#editor-text-area code {
|
||||
#render-preview code {
|
||||
font-family: 'Courier New', Consolas, monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#editor-text-area pre code {
|
||||
#render-preview pre code {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* 编辑区引用 */
|
||||
#editor-text-area blockquote {
|
||||
/* 预览区引用 */
|
||||
#render-preview blockquote {
|
||||
border-left: 1px solid #ccc;
|
||||
font-style: normal;
|
||||
color: #888;
|
||||
padding-left: 15px;
|
||||
margin: var(--pi-spacing-sm) 0;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
/* 编辑区列表 */
|
||||
#editor-text-area ul,
|
||||
#editor-text-area ol {
|
||||
padding-left: var(--pi-spacing);
|
||||
margin-bottom: var(--pi-spacing-sm);
|
||||
/* 预览区列表 */
|
||||
#render-preview ul,
|
||||
#render-preview ol {
|
||||
padding-left: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#editor-text-area li {
|
||||
#render-preview li {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user