- 횡단 판 왼쪽 빈 폭을 두 글판이 반씩(--b05-bottom-half) · 좁으면 줄바꿈 - 반 폭 200 px 아래면 잰 값 창을 상태 글판 위로 쌓음(is-narrow-bottom · --b05-info-h · logic bottomRowNarrow) - Chrome 관찰에 상태 글판 · 횡단 판 크기 더함 - 시험 test_408_4_bottom_row 새로 · 345_5c 폭 규칙 고쳐 씀 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
31 lines
1.6 KiB
TypeScript
31 lines
1.6 KiB
TypeScript
/* =============================================================================
|
|
* B05_Profile/logic/B05_Profile_RouteEdit_InfoLift.ts
|
|
* 평면 상태 · 범례 올림(408-2) — 뜬 종단 판이 지도 아래를 덮은 높이만큼 위로.
|
|
* 아래 줄 좁음(408-4) — 횡단 판 왼쪽 빈 폭의 반이 모자라면 잰 값 창을 상태 글판 위로 쌓음.
|
|
* 파이썬 짝 아님. 순수 계산 — 화면 · fetch · sessionStorage 없음. 부르는 쪽은 `_UI_RouteEdit_Chrome`.
|
|
* ========================================================================== */
|
|
|
|
/** 상태 글판이 이 높이(px)는 지도 위에 남게 — 판을 끝까지 올려도 지도 밖으로 안 나감. */
|
|
const KEEP_PX = 120;
|
|
|
|
/** 올릴 높이(px) — `profileTop` = 종단 판 윗변(없음 · 접힘 · 창 분할 = null) · 지도 칸 아래 · 높이. */
|
|
export function infoLiftPx(
|
|
mapBottom: number,
|
|
mapHeight: number,
|
|
profileTop: number | null,
|
|
): number {
|
|
if (profileTop === null) return 0;
|
|
const cover = Math.max(0, mapBottom - profileTop);
|
|
return Math.round(Math.min(cover, Math.max(0, mapHeight - KEEP_PX)));
|
|
}
|
|
|
|
/** 아래 줄 반 폭이 이보다 좁으면 나란히 두지 않고 쌓음(px). */
|
|
const HALF_MIN_PX = 200;
|
|
/** 지도 칸 가장자리 · 두 글판 사이 · 횡단 판 앞 간격(px) — CSS `--spacing-12`. */
|
|
const GAP_PX = 12;
|
|
|
|
/** 상태 글판 · 잰 값 창을 나란히 못 두나 — `mapWidth` = 지도 칸 폭 · `sideOpen` = 횡단 판이 덮는 폭. */
|
|
export function bottomRowNarrow(mapWidth: number, sideOpen: number): boolean {
|
|
return (mapWidth - 3 * GAP_PX - sideOpen) / 2 < HALF_MIN_PX;
|
|
}
|