feat(performance): 자동 업데이트 카드 — 시간·간격 칸 글자 너비, 아날로그 시계

- 시간(시·분)·간격 칸이 공용 .erp-input min-width 240px 로 늘어나던 것을 글자 너비만큼으로
- 시간 오른쪽에 12시간 아날로그 시계: 시작·끝 바늘, 그 사이(시계 방향)를 빨갛게, 12시간 넘는 부분은 진한 빨강.
  시간을 바꾸면 바로 다시 그림, 마우스를 올리면 "09:00 ~ 19:00 (10시간)"
- 브라우저 테스트: 실제 erp.css 로 칸 너비 확인, 시계 부채꼴·눈금·바늘·12시간 초과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 18:07:37 +09:00
parent 2bbc2320dc
commit c9e5a78115
6 changed files with 100 additions and 9 deletions
+13 -2
View File
@@ -394,8 +394,19 @@ td.is-link:hover { background: #eef2ff; text-decoration: underline; }
.perf-day.is-sun span { color: var(--perf-sun); }
.perf-day input:checked + span { background: #111; border-color: #111; color: #fff; }
.perf-day input:focus-visible + span { outline: 2px solid var(--perf-good); outline-offset: 1px; }
.perf-auto-time { width: auto; padding-right: 22px; }
.perf-auto-interval { width: 76px; }
/* 공용 .erp-input 은 min-width 240px — 이 카드는 글자 너비만큼 */
#perf-auto-sync .perf-auto-time { min-width: 0; width: auto; padding-right: 4px; }
#perf-auto-sync .perf-auto-interval { min-width: 0; width: calc(3ch + 40px); }
/* 시간 오른쪽 아날로그 시계 — 시작 ~ 끝 바늘 사이를 빨갛게(12시간 넘는 부분은 진하게 한 번 더) */
.perf-auto-clock { width: 64px; height: 64px; flex: 0 0 auto; margin-left: 6px; }
.perf-auto-clock .c-face { fill: #fff; stroke: #c9c9c9; stroke-width: 1.5; }
.perf-auto-clock .c-span { fill: var(--perf-down); fill-opacity: .78; }
.perf-auto-clock .c-span2 { fill: #8f1414; fill-opacity: .85; }
.perf-auto-clock .c-tick { stroke: #9a9a9a; stroke-width: 1.5; stroke-linecap: round; }
.perf-auto-clock .c-tick.is-major { stroke: #333; stroke-width: 2.5; }
.perf-auto-clock .c-hand { stroke: #111; stroke-width: 3; stroke-linecap: round; }
.perf-auto-clock .c-hand.is-end { stroke-width: 2.2; }
.perf-auto-clock .c-pin { fill: #111; }
.perf-auto-next { grid-column: 2; }
.perf-auto-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
#perf-auto-msg.is-ok { color: var(--perf-up); }
+36 -1
View File
@@ -1071,8 +1071,43 @@
return "";
}
function dirty() { msg.textContent = "바뀐 내용이 있습니다 — [저장]을 누르세요."; msg.classList.remove("is-ok"); }
// 아날로그 시계(12시간 문자판) — 시작 바늘 ~ 끝 바늘 사이(시계 방향)를 빨갛게, 12시간을 넘는 부분은 진한 빨강으로 한 번 더
function drawClock(row) {
const svg = row.querySelector(".perf-auto-clock");
if (!svg) return;
const s = read(row);
function mins(hhmm) { const p = hhmm.split(":"); return Number(p[0]) * 60 + Number(p[1]); }
const a = mins(s.start), b = mins(s.end), R = 44;
function pt(m, r) { const t = (m % 720) / 720 * 2 * Math.PI; return [(r * Math.sin(t)).toFixed(2), (-r * Math.cos(t)).toFixed(2)]; }
function sector(from, len, cls) {
if (len <= 0) return "";
if (len >= 720) return '<circle class="' + cls + '" r="' + R + '"/>';
const p0 = pt(from, R), p1 = pt(from + len, R);
return '<path class="' + cls + '" d="M0 0L' + p0[0] + " " + p0[1] + "A" + R + " " + R + " 0 " + (len > 360 ? 1 : 0) + " 1 " +
p1[0] + " " + p1[1] + 'Z"/>';
}
let g = '<circle class="c-face" r="47"/>' + sector(a, Math.min(b - a, 720), "c-span") + sector(a + 720, b - a - 720, "c-span2");
for (let h = 0; h < 12; h++) {
const major = h % 3 === 0, o = pt(h * 60, 46), i = pt(h * 60, major ? 36 : 40);
g += '<line class="c-tick' + (major ? " is-major" : "") + '" x1="' + i[0] + '" y1="' + i[1] + '" x2="' + o[0] + '" y2="' + o[1] + '"/>';
}
const hs = pt(a, 30), he = pt(b, 38);
g += '<line class="c-hand" x1="0" y1="0" x2="' + hs[0] + '" y2="' + hs[1] + '"/>' +
'<line class="c-hand is-end" x1="0" y1="0" x2="' + he[0] + '" y2="' + he[1] + '"/><circle class="c-pin" r="3.5"/>';
const span = b - a, hours = Math.floor(span / 60), rest = span % 60;
const title = s.start + " ~ " + s.end + " (" + (hours ? hours + "시간" : "") + (rest ? (hours ? " " : "") + rest + "분" : "") + (span ? "" : "한 번") + ")";
svg.innerHTML = "<title>" + title + "</title>" + g;
svg.setAttribute("aria-label", "자동 업데이트 시간대 " + title);
}
card.querySelectorAll(".perf-auto-row").forEach(function (row) {
row.addEventListener("change", function () { row.classList.toggle("is-off", !read(row).enabled); dirty(); });
const tf = row.querySelector('[data-t="end-m"]').closest(".perf-auto-field");
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute("class", "perf-auto-clock");
svg.setAttribute("viewBox", "-50 -50 100 100");
svg.setAttribute("role", "img");
tf.appendChild(svg);
drawClock(row);
row.addEventListener("change", function () { row.classList.toggle("is-off", !read(row).enabled); drawClock(row); dirty(); });
row.querySelectorAll("[data-days]").forEach(function (b) {
b.addEventListener("click", function () {
row.querySelectorAll("[data-day]").forEach(function (c) {