fix(ai-gen): 页面自适应锁定视口高度,消除整页滚动条
- gen-root 固定 calc(100vh - 196px)(顶栏59+工具头93+容器偏移44) - 示例与宽高比并排一行,左列 420→560 宽 - 提示词 150→96、间距全面紧凑化,桌面一屏放下 - 三列 min-height:0 + 列内滚动兜底,极端小窗不出页面滚动条 - 窄屏(≤900)恢复纵向堆叠与常规页面滚动
This commit is contained in:
1 parent
4016d754df
commit
6557d1fe7b
1 file changed
+60
-29
+60
-29
@@ -285,28 +285,29 @@ async function generate() {
|
||||
<div class="gen-count">{{ prompt.length }}/1000</div>
|
||||
</div>
|
||||
|
||||
<!-- 示例 -->
|
||||
<div class="gen-sec">
|
||||
<div class="gen-h">尝试这些示例</div>
|
||||
<div class="gen-examples">
|
||||
<button v-for="ex in EXAMPLES" :key="ex.n" class="gen-example" @click="prompt = ex.p">{{ ex.n }}</button>
|
||||
<!-- 示例 + 宽高比 并排(压缩纵向高度,自适应一屏) -->
|
||||
<div class="gen-row">
|
||||
<div class="gen-sec">
|
||||
<div class="gen-h">尝试这些示例</div>
|
||||
<div class="gen-examples">
|
||||
<button v-for="ex in EXAMPLES" :key="ex.n" class="gen-example" @click="prompt = ex.p">{{ ex.n }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 宽高比 -->
|
||||
<div class="gen-sec">
|
||||
<div class="gen-h">宽高比</div>
|
||||
<div class="gen-ratios">
|
||||
<button
|
||||
v-for="r in RATIOS"
|
||||
:key="r.label"
|
||||
class="gen-ratio"
|
||||
:class="{ on: ratio === r.label }"
|
||||
@click="ratio = r.label"
|
||||
>
|
||||
<span class="gen-rshape" :style="{ width: r.sw + 'px', height: r.sh + 'px' }" />
|
||||
<span class="gen-rl">{{ r.label }}</span>
|
||||
</button>
|
||||
<div class="gen-sec">
|
||||
<div class="gen-h">宽高比</div>
|
||||
<div class="gen-ratios">
|
||||
<button
|
||||
v-for="r in RATIOS"
|
||||
:key="r.label"
|
||||
class="gen-ratio"
|
||||
:class="{ on: ratio === r.label }"
|
||||
@click="ratio = r.label"
|
||||
>
|
||||
<span class="gen-rshape" :style="{ width: r.sw + 'px', height: r.sh + 'px' }" />
|
||||
<span class="gen-rl">{{ r.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -355,37 +356,67 @@ async function generate() {
|
||||
.gen-root {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// 锁定为视口内可用高度:页面级(n-scrollbar)不再出现滚动条
|
||||
// 196 = 顶栏 59 + 工具头 93 + 内容容器偏移 44(四档窗口实测恒定)
|
||||
height: calc(100vh - 196px);
|
||||
|
||||
@media (max-width: 900px) {
|
||||
// 窄屏纵向堆叠,恢复常规页面滚动
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 占满屏幕:控制面板 + 结果区填满可视高度 + 右侧历史列
|
||||
.gen-body {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
gap: 10px;
|
||||
align-items: stretch;
|
||||
min-height: calc(100vh - 170px);
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
flex-direction: column;
|
||||
flex: none;
|
||||
min-height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.gen-ctrl {
|
||||
width: 420px;
|
||||
width: 560px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
gap: 10px;
|
||||
// 超高时列内滚动兜底(正常窗口一屏放得下,不出滚动条)
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
width: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
// 示例与宽高比并排一行,省一截纵向空间
|
||||
.gen-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
||||
.gen-sec {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.gen-sec {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.gen-grow {
|
||||
@@ -606,7 +637,7 @@ async function generate() {
|
||||
.gen-prompt {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
min-height: 150px;
|
||||
min-height: 96px;
|
||||
resize: vertical;
|
||||
padding: 12px 14px;
|
||||
border: 1px solid rgba(128, 128, 128, 0.3);
|
||||
@@ -634,7 +665,7 @@ async function generate() {
|
||||
gap: 6px;
|
||||
|
||||
.gen-example {
|
||||
padding: 7px 13px;
|
||||
padding: 6px 11px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(128, 128, 128, 0.28);
|
||||
background: #fff;
|
||||
@@ -659,7 +690,7 @@ async function generate() {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 10px 4px;
|
||||
padding: 7px 3px;
|
||||
border: 1px solid rgba(128, 128, 128, 0.28);
|
||||
border-radius: 9px;
|
||||
background: #fff;
|
||||
@@ -685,7 +716,7 @@ async function generate() {
|
||||
}
|
||||
|
||||
.gen-go {
|
||||
padding: 14px;
|
||||
padding: 11px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(48deg, #0e9384, #14b8a6);
|
||||
|
||||
Reference in new issue
Block a user