style(라이브): 달력 보기를 풀HD 한 화면에 맞춤

오른쪽 달력을 80%(240px)로 줄이고 표 글자·칸 높이·카드를 줄인다.
넓은 화면에서는 페이지 세로 스크롤을 없애고 표 상자가 남은 높이를 쓰게 한다.
풀HD 브라우저 세로 880px 에서 9개 시간 칸과 합계 줄이 표 안 스크롤 없이 들어간다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 19:09:44 +09:00
parent fd37e367a1
commit ece5b06f7a
7 changed files with 82 additions and 45 deletions
+22 -10
View File
@@ -50,7 +50,7 @@ function check(name, cond, extra) {
const s = document.getElementById("lv-side-cal").getBoundingClientRect(), l = document.querySelector(".lv").getBoundingClientRect();
return { left: l.left - page.left, right: page.right - s.right };
});
check("좌우 여백 16px", edges.left <= 17 && edges.right <= 34, edges); // 오른쪽 = 여백 + 스크롤 막대
check("좌우 여백 12px", edges.left <= 13 && edges.right <= 13, edges);
await p.setViewportSize({ width: 2400, height: 900 });
await p.waitForTimeout(100);
const wide = await p.evaluate(function () {
@@ -58,16 +58,28 @@ function check(name, cond, extra) {
return { pageRight: page.right, shell: document.documentElement.clientWidth };
});
check("넓은 화면도 전체 너비(최대 폭 해제)", Math.abs(wide.pageRight - wide.shell) < 2, wide);
await p.setViewportSize({ width: 1600, height: 500 });
// 풀HD 브라우저 — 페이지 세로 스크롤 없음, 모든 시간 칸에 카드가 있어도 표 안 스크롤도 없음
const fit = function () {
return p.evaluate(function () {
const pg = document.querySelector(".erp-page"), w = document.getElementById("lv-cal-wrap");
return { page: pg.scrollHeight - pg.clientHeight, table: w.scrollHeight - w.clientHeight, wrapH: w.clientHeight, row: document.querySelector(".lv-cal tbody tr").getBoundingClientRect().height };
});
};
for (const h of [937, 880]) {
await p.setViewportSize({ width: 1920, height: h });
await p.waitForTimeout(100);
const f = await fit();
check("1920×" + h + ": 페이지·표 세로 스크롤 없음", f.page <= 0 && f.table <= 0, f);
if (h === 880) await p.screenshot({ path: path.join(__dirname, ".out", "live_fit_880.png") });
}
await p.setViewportSize({ width: 1600, height: 600 });
await p.waitForTimeout(100);
await p.evaluate(function () { document.querySelector(".erp-page").scrollTop = 200; });
await p.waitForTimeout(100);
const scrolled = await p.evaluate(function () {
const pg = document.querySelector(".erp-page");
return { moved: pg.scrollTop, top: document.getElementById("lv-side-cal").getBoundingClientRect().top - pg.getBoundingClientRect().top };
});
check("스크롤해도 달력이 위에 고정", scrolled.moved > 0 && Math.abs(scrolled.top - 16) < 2, scrolled);
await p.evaluate(function () { document.querySelector(".erp-page").scrollTop = 0; });
const small = await fit();
check("더 낮은 창: 페이지는 안 움직이고 표 안에서 스크롤", small.page <= 0 && small.table > 0, small);
const miniW = (await p.locator("#lv-side-cal").boundingBox()).width;
check("오른쪽 달력 = 240px(300px × 80%)", Math.round(miniW) === 240, miniW);
const miniDay = await day("2026-11-17").evaluate(function (el) { const c = getComputedStyle(el); return c.height + "|" + c.fontSize; });
check("달력 칸·글자도 80%", miniDay === "27px|10.8px", miniDay);
await p.setViewportSize({ width: 1600, height: 900 });
await p.waitForTimeout(100);
check("디파발리 = 빨강·이름·말풍선", (await day("2026-11-08").getAttribute("class")).includes("has-hol") && (await day("2026-11-08").getAttribute("title")) === "디파발리");
+5 -2
View File
@@ -34,8 +34,11 @@ class Fake:
def list_broadcasts(self, start, end):
if start.month != 11:
return []
return [{"id": 1, "host_id": 1, "host_name": "Nabella", "tiktok_handle": "MainAccount", "broadcast_date": date(2026, 11, 5), "start_time": time(8),
"end_time": time(10), "venue": "", "sales_amount": Decimal("500"), "images": []}]
# 운영 화면처럼 — 6·8·16시 칸에 카드(세 줄 모두 카드가 있으면 그 줄이 가장 높다), 모든 시간 칸을 채워 높이 최악으로
return [{"id": h, "host_id": 1, "host_name": "Nabella", "tiktok_handle": "MainAccount", "broadcast_date": date(2026, 11, 5), "start_time": time(h),
"end_time": time(h + 2), "venue": "", "sales_amount": Decimal("500"), "images": []} for h in range(6, 24, 2) if h < 22] + \
[{"id": 22, "host_id": 1, "host_name": "Nabella", "tiktok_handle": "MainAccount", "broadcast_date": date(2026, 11, 5), "start_time": time(22),
"end_time": time(23, 30), "venue": "", "sales_amount": Decimal("500"), "images": []}]
def ad_spends(self, start, end):
return {}