Commit f51a30c8 by James Yuan

fix: 大屏左右业务栏固定为 350px

避免随视口百分比缩放导致侧栏过宽或过窄,保持布局稳定。

Co-authored-by: Cursor <cursoragent@cursor.com>
parent aa90aa3c
......@@ -924,7 +924,7 @@ onBeforeUnmount(() => {
position: absolute;
z-index: 8;
/* 贴在右侧业务面板内侧,对应原 screen-nav--side 占位 */
right: calc(var(--screen-side-w, 24vw) + 16px);
right: calc(var(--screen-side-w, 350px) + 16px);
top: 50%;
transform: translateY(-50%);
display: flex;
......@@ -981,7 +981,7 @@ onBeforeUnmount(() => {
flex-direction: row;
align-items: center;
gap: 4px;
max-width: calc(100vw - 2 * var(--screen-side-w, clamp(280px, 24vw, 480px)) - 36px);
max-width: calc(100vw - 2 * var(--screen-side-w, 350px) - 36px);
overflow-x: auto;
pointer-events: auto;
}
......
......@@ -17,9 +17,8 @@ export function useStageScale() {
function fit() {
const w = window.innerWidth
// 窄屏收窄侧栏,宽屏不超过 480
const side = Math.round(Math.min(480, Math.max(280, w * 0.24)))
document.documentElement.style.setProperty('--screen-side-w', `${side}px`)
// 左右面板固定 350px
document.documentElement.style.setProperty('--screen-side-w', '350px')
document.documentElement.style.setProperty('--screen-vw', `${w}px`)
document.documentElement.style.setProperty('--screen-vh', `${window.innerHeight}px`)
}
......
......@@ -233,7 +233,7 @@ function goAdmin() {
left: 0;
top: 0;
bottom: 0;
width: calc(var(--screen-side-w, 24vw) + 40px);
width: calc(var(--screen-side-w, 350px) + 40px);
background: linear-gradient(
90deg,
rgba(0, 8, 22, 0.82) 0%,
......@@ -245,7 +245,7 @@ function goAdmin() {
right: 0;
top: 0;
bottom: 0;
width: calc(var(--screen-side-w, 24vw) + 40px);
width: calc(var(--screen-side-w, 350px) + 40px);
background: linear-gradient(
270deg,
rgba(0, 8, 22, 0.82) 0%,
......@@ -286,7 +286,7 @@ function goAdmin() {
/* 避开顶栏 + 中间翻牌器;贴在右侧面板内侧 */
top: clamp(200px, 26vh, 280px);
bottom: clamp(56px, 8vh, 88px);
right: calc(var(--screen-side-w, 24vw) + 28px);
right: calc(var(--screen-side-w, 350px) + 28px);
width: clamp(88px, 6vw, 108px);
height: auto !important;
flex: none !important;
......
......@@ -12,8 +12,8 @@
background: #00060f;
color: var(--text);
font-family: var(--body-font);
/* 左右业务栏宽度,随视口由 useStageScale 更新 */
--screen-side-w: clamp(280px, 24vw, 480px);
/* 左右业务栏宽度(固定 350px) */
--screen-side-w: 350px;
}
.stage::before {
content: none;
......
......@@ -374,10 +374,7 @@ const energyDigits = computed(() => digits.value)
height: 100%;
min-height: 0;
display: grid;
grid-template-columns: var(--screen-side-w, clamp(280px, 24vw, 480px)) minmax(0, 1fr) var(
--screen-side-w,
clamp(280px, 24vw, 480px)
);
grid-template-columns: var(--screen-side-w, 350px) minmax(0, 1fr) var(--screen-side-w, 350px);
grid-template-rows: auto 1fr;
gap: 10px 12px;
pointer-events: none;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment