feat(project): 모든 말풍선을 아사나식 공용 말풍선으로 통일

- 브라우저 기본 title 말풍선도 마우스를 올리는 순간 data-tip 으로 옮겨
  공용 말풍선(.pj-hovertip)으로 표시 → 기존·신규 모든 title= 이 같은 모양.
- 화면 끝 보정(말풍선은 안쪽, 꼬리는 커서 쪽), 위 공간 부족 시 아래로 뒤집기,
  누르기·스크롤 시 숨김, 짧은 페이드인.
- 대시보드 막대 툴팁도 같은 색·꼬리.
- 규칙 문서화(PROJECT_MODULE.md 3절, CLAUDE.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 00:20:37 +09:00
parent 067d9c5083
commit d050158492
7 changed files with 70 additions and 24 deletions
+24 -10
View File
@@ -332,21 +332,29 @@
.pj-th-resize { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; }
.pj-th-resize:hover { background: linear-gradient(90deg, transparent 40%, #c9d4ea 40%, #c9d4ea 60%, transparent 60%); }
/* 마우스를 따라다니는 작은 툴팁 — 제목 옆 멤버 아이콘의 이름 표시용. */
/* ── 공용 말풍선(아사나식) — 프로젝트 화면의 모든 말풍선은 이 모양 하나.
data-tip 또는 title 을 단 요소에 마우스를 올리면 initHoverTips 가 커서
바로 위에 띄운다(가로 가운데 = 커서, 아래 꼬리가 커서를 가리킴).
새 기능도 title= / data-tip= 만 달면 된다 — 별도 툴팁 구현 금지. */
.pj-hovertip {
position: fixed; z-index: 1400; pointer-events: none;
background: #1e1f21; color: #fff; font-size: 12.5px; font-weight: 600;
position: fixed; z-index: 3000; pointer-events: none;
background: #1e1f21; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.35;
padding: 6px 10px; border-radius: 6px; white-space: nowrap;
/* left/top 은 커서 좌표 그대로 — 말풍선 아래-가운데를 그 점에 맞춰
커서 바로 위, 가로로는 커서 중앙에 오게 한다. */
box-shadow: 0 2px 8px rgba(0,0,0,.18);
transform: translate(-50%, calc(-100% - 6px));
animation: pj-tip-in .12s ease-out;
}
/* 아사나 말풍선처럼 아래쪽 가운데 꼬리 */
/* 아래쪽 가운데 꼬리 — 가장자리 보정으로 말풍선이 밀리면 꼬리는 커서 쪽으로 */
.pj-hovertip::after {
content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
content: ""; position: absolute; top: 100%;
left: calc(50% + var(--pj-tip-shift, 0px)); transform: translateX(-50%);
border: 5px solid transparent; border-top-color: #1e1f21;
}
/* 위 공간이 모자라면 커서 아래로 뒤집고 꼬리는 위로 */
.pj-hovertip.is-below { transform: translate(-50%, 0); }
.pj-hovertip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #1e1f21; }
.pj-hovertip[hidden] { display: none; }
@keyframes pj-tip-in { from { opacity: 0; } to { opacity: 1; } }
/* ── 달력 (휴가 모듈과 동일한 월간 그리드 룩) ── */
.pj-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
@@ -1029,12 +1037,18 @@ label.pj-desc-fmtbtn { line-height: 26px; }
.pj-dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
/* 막대/세그먼트 호버 툴팁 — 값이 크게, 라벨은 보조(값 우선 원칙) */
/* 공용 말풍선(.pj-hovertip)과 같은 모양 — 막대 위에 붙고 아래 꼬리 */
.pj-dash-tooltip {
position: absolute; z-index: 2150; transform: translate(-50%, -100%);
background: var(--pj-ink); color: #fff; padding: 6px 10px; border-radius: 8px;
position: absolute; z-index: 2150; transform: translate(-50%, calc(-100% - 6px));
background: #1e1f21; color: #fff; padding: 6px 10px; border-radius: 6px;
font-size: 12px; white-space: nowrap; pointer-events: none;
box-shadow: var(--pj-card-shadow-hover);
box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.pj-dash-tooltip::after {
content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
border: 5px solid transparent; border-top-color: #1e1f21;
}
.pj-dash-tooltip[hidden] { display: none; }
.pj-dash-tooltip b { font-size: 13.5px; margin-right: 6px; }
.pj-dash-tooltip span { color: #cfd3da; }
+33 -7
View File
@@ -5032,8 +5032,16 @@
// ── 마우스를 따라다니는 작은 툴팁 — [data-tip] 달린 요소 아무데나 공용.
// 지금은 제목 옆 프로젝트 멤버 아이콘(이름 표시)에 쓴다. 나중에 그려지는
// 요소에도 붙도록 이벤트 위임 방식이다.
// ── 공용 말풍선(아사나식: 어두운 배경 + 아래 꼬리, 커서 바로 위) ──
// 프로젝트 화면의 "모든" 말풍선은 이것 하나로 통일한다(앞으로 추가하는 기능도).
// · data-tip="문구" 를 달면 이 말풍선이 뜬다.
// · 브라우저 기본 title 말풍선도 자동으로 이걸로 바뀐다 — 마우스를 올리는
// 순간 title 을 data-tip 으로 옮기고 title 은 지운다(기본 말풍선 억제).
// 그래서 새 코드에서 title= 을 써도 같은 모양이 된다.
// 이벤트 위임이라 나중에 그려지는 요소도 따로 배선할 필요가 없다.
function initHoverTips() {
let tipEl = null;
let shown = false;
function show(text, x, y) {
if (!tipEl) {
tipEl = document.createElement("div");
@@ -5041,20 +5049,38 @@
document.body.appendChild(tipEl);
}
tipEl.textContent = text;
tipEl.style.left = x + "px";
tipEl.style.top = (y - 10) + "px";
tipEl.hidden = false;
// 화면 가장자리 보정 — 좌우로 넘치면 말풍선만 안쪽으로 밀고 꼬리는
// 커서를 계속 가리키게(--pj-tip-shift). 위가 모자라면 커서 아래로 뒤집는다.
const w = tipEl.offsetWidth, h = tipEl.offsetHeight;
const vw = document.documentElement.clientWidth;
const cx = Math.min(Math.max(x, 8 + w / 2), vw - 8 - w / 2);
const below = y - 16 - h < 4;
tipEl.classList.toggle("is-below", below);
tipEl.style.setProperty("--pj-tip-shift", (x - cx) + "px");
tipEl.style.left = cx + "px";
tipEl.style.top = (below ? y + 22 : y - 10) + "px";
}
function hide() { if (tipEl) tipEl.hidden = true; }
// 이벤트 위임 — 멤버 아이콘(renderMemberList)처럼 나중에 그려지는
// 요소에도 따로 배선하지 않고 그대로 동작한다.
let shown = false;
function hide() { shown = false; if (tipEl) tipEl.hidden = true; }
document.addEventListener("mouseover", function (e) {
const el = e.target.closest ? e.target.closest("[title]") : null;
if (!el) return;
const t = el.getAttribute("title");
if (t) el.dataset.tip = t; // 코드가 title 을 새로 바꿨으면 최신 값으로
el.removeAttribute("title");
}, true);
document.addEventListener("mousemove", function (e) {
const target = e.target.closest ? e.target.closest("[data-tip]") : null;
if (!target) { if (shown) { shown = false; hide(); } return; }
if (!target || !target.dataset.tip) { if (shown) hide(); return; }
shown = true;
show(target.dataset.tip, e.clientX, e.clientY);
});
// 누르거나 스크롤하면 숨긴다 — 클릭으로 요소가 다시 그려지면 말풍선만
// 허공에 남는 일이 없게.
document.addEventListener("mousedown", hide, true);
window.addEventListener("scroll", hide, true);
window.addEventListener("blur", hide);
document.addEventListener("mouseleave", hide);
}
document.addEventListener("DOMContentLoaded", function () {