Skip to content

Commit 213ffdd

Browse files
committed
Bring back the team numbers, show the next event under the hero, and make the track map easy to read
- The four number tiles return under the hero; the event tile links to the events - A strip under the numbers shows the next Data Forum with a day count - Events come before posts; the next forum card says what the forum is and how many have come, and past forums show their turnout as bars - The map tab says what it is ('트랙 지도로 보기'), a note under the tabs explains steps versus tracks, and the map opens with a short how-to-read - Track names under the map are buttons: pick one to keep only that line and see what the track covers
1 parent a663da9 commit 213ffdd

3 files changed

Lines changed: 124 additions & 17 deletions

File tree

‎assets/css/hub.css‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,3 +1430,62 @@ button.btn.sm { font-size: 14px; }
14301430
/* the chosen step keeps the brand colour in both themes */
14311431
.step button[aria-pressed="true"] { background: #23276A; color: #fff; }
14321432
.step button[aria-pressed="true"] .st-makers .avatar.sm { box-shadow: 0 0 0 2px #23276A; }
1433+
1434+
/* ==========================================================================
1435+
Final pass: the next event under the hero, a readable track map, livelier events
1436+
========================================================================== */
1437+
.tile-link { position: absolute; inset: 0; border-radius: inherit; }
1438+
.tile-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1439+
.tile[data-key="events"]:hover { box-shadow: 0 6px 20px rgba(20, 22, 43, .08); }
1440+
.next-event { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 20px; border-radius: 18px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: inset 4px 0 0 var(--l-exp); }
1441+
.next-event:hover { box-shadow: inset 4px 0 0 var(--l-exp), 0 6px 20px rgba(20, 22, 43, .08); }
1442+
.next-event:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1443+
.ne-k { font-size: 12.5px; font-weight: 800; color: var(--surface); background: var(--l-exp); padding: 3px 10px; border-radius: 999px; flex-shrink: 0; }
1444+
.ne-d { font-family: var(--f-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--l-exp); flex-shrink: 0; font-variant-numeric: tabular-nums; }
1445+
.ne-t { display: flex; flex-direction: column; min-width: 0; }
1446+
.ne-t b { font-size: 15.5px; }
1447+
.ne-t span { font-size: 13.5px; color: var(--muted); }
1448+
.ne-go { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--muted); }
1449+
@media (max-width: 600px) { .next-event { flex-wrap: wrap; gap: 6px 10px; padding: 14px 16px; } .ne-t { flex-basis: 100%; } .ne-go { display: none; } }
1450+
1451+
/* tabs and the hint that says what the map is for */
1452+
.tab-lines { display: inline-flex; flex-direction: column; gap: 2px; margin-right: 6px; vertical-align: middle; }
1453+
.tab-lines i { display: block; width: 14px; height: 2.5px; border-radius: 2px; background: var(--l-main); }
1454+
.tab-lines i:nth-child(2) { background: var(--l-ml); width: 11px; }
1455+
.tab-lines i:nth-child(3) { background: var(--l-research); width: 8px; }
1456+
.tabs.big button[aria-selected="true"] .tab-lines i { background: currentColor; }
1457+
.tab-note { font-size: 13.5px; color: var(--muted); margin: -6px 0 14px; }
1458+
.link-btn { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
1459+
.link-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
1460+
1461+
/* how to read the map */
1462+
.map-how { margin: 4px 16px 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
1463+
.mh-t { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
1464+
.map-how ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
1465+
.map-how li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
1466+
.map-how li svg { flex-shrink: 0; }
1467+
.map-how li b { color: var(--ink); }
1468+
.mh-tip { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
1469+
@media (max-width: 1000px) { .map-how ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
1470+
@media (max-width: 520px) { .map-how ul { grid-template-columns: minmax(0, 1fr); } }
1471+
1472+
/* track legend as filters */
1473+
.line-legend { gap: 6px; }
1474+
.ll { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 700; color: var(--ink); }
1475+
.ll:hover { background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
1476+
.ll[aria-pressed="true"] { background: var(--c); color: var(--on-line); }
1477+
.ll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1478+
.ll-n { font-size: 12px; font-weight: 700; opacity: .7; }
1479+
.line-desc { margin: 8px 16px 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
1480+
.line-desc b { color: var(--ink); }
1481+
#metro .faded { opacity: .12; transition: opacity .2s ease; }
1482+
#metro.focusing .st:not(.faded) .label { font-weight: 800; }
1483+
.vline.faded { opacity: .3; }
1484+
1485+
/* events */
1486+
.ev-about { font-size: 15px; color: var(--muted); max-width: 34em; }
1487+
.event.next .soon-tag { font-size: 13px; padding: 3px 12px; }
1488+
.ev-n { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
1489+
.ev-bar { display: block; width: 90px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
1490+
.ev-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
1491+
.ev-num { white-space: nowrap; }

‎assets/js/hub.js‎

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@
284284
: t.key === "stars" ? topStarsHTML() : `<p class="spark-empty">${esc(t.empty || "")}</p>`}
285285
</li>`;
286286
}).join("");
287+
const ev = box.querySelector('.tile[data-key="events"]');
288+
if (ev) ev.insertAdjacentHTML("beforeend", `<a class="tile-link" href="#events" aria-label="행사 보기"></a>`);
287289
box.querySelectorAll(".tile").forEach((el, i) => {
288290
const t = growthTiles[i];
289291
if (t.series.length > 1) drawSpark(el, t);
@@ -711,9 +713,24 @@
711713
}).join("");
712714
}
713715

716+
/* the legend doubles as a filter: pick a track to keep only its line */
714717
function renderLegend() {
715-
$("#line-legend").innerHTML = state.lineList.map((l) => `<li data-line="${l.id}"><span class="num" aria-hidden="true"></span>${esc(l.name)}</li>`).join("") +
718+
const count = (id) => [...state.repos.values()].filter((r) => (r.lines || []).includes(id)).length;
719+
$("#line-legend").innerHTML = state.lineList.map((l) => `<li data-line="${l.id}"><button type="button" class="ll" data-focus-line="${l.id}" aria-pressed="false" title="${esc(l.description || "")}"><span class="num" aria-hidden="true"></span>${esc(l.name)}<span class="ll-n">${count(l.id)}</span></button></li>`).join("") +
716720
`<li><svg width="28" height="6" aria-hidden="true"><path d="M2 3H26" stroke="var(--l-main)" stroke-width="3" stroke-dasharray="5 6" stroke-linecap="round"/></svg>도서·강의 (유료)</li>`;
721+
if (!$("#line-desc")) $("#line-legend").insertAdjacentHTML("afterend", `<p class="line-desc" id="line-desc" aria-live="polite"></p>`);
722+
}
723+
function focusLine(id) {
724+
const root = $("#metro"), on = id && state.focusLine !== id ? id : null;
725+
state.focusLine = on;
726+
root.classList.toggle("focusing", !!on);
727+
root.querySelectorAll(".track, .badge").forEach((el) => el.classList.toggle("faded", !!on && el.dataset.line !== on));
728+
root.querySelectorAll(".st").forEach((el) => el.classList.toggle("faded", !!on && !(el.dataset.lines || "").split(" ").includes(on)));
729+
document.querySelectorAll("[data-focus-line]").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.focusLine === on)));
730+
document.querySelectorAll(".vline").forEach((v) => v.classList.toggle("faded", !!on && v.dataset.line !== on));
731+
const l = on && state.lines.get(on);
732+
$("#line-desc").innerHTML = l ? `<b>${esc(l.name)}</b>: ${esc(l.description || l.tagline || "")} <button type="button" class="link-btn" data-focus-line="${on}">전체 노선 보기</button>` : "";
733+
if (on) track("select_track", { track: on });
717734
}
718735

719736
/* ---------- tabs ---------- */
@@ -811,23 +828,35 @@
811828
}
812829
}
813830

831+
const daysTo = (iso) => Math.ceil((Date.parse(`${iso}T00:00:00+09:00`) - Date.now()) / DAY);
832+
function renderNextEvent() {
833+
const el = $("#next-event"), next = state.events.find((e) => e.upcoming && e.date);
834+
if (!el || !next) return;
835+
const d = daysTo(next.date);
836+
if (d < 0) return;
837+
el.hidden = false;
838+
el.innerHTML = `<span class="ne-k">다음 행사</span><span class="ne-d">${d === 0 ? "오늘" : `D-${d}`}</span><span class="ne-t"><b>${dot(next.date)} · ${esc(next.name)}</b><span>${next.link ? "참가 신청을 받고 있습니다" : "신청 링크는 곧 열립니다"} · 지난 ${state.events.filter((e) => !e.upcoming).length}회에 ${fmt(state.events.reduce((s, e) => s + (e.participants || 0), 0))}명이 함께했습니다</span></span><span class="ne-go" aria-hidden="true">›</span>`;
839+
}
814840
/* the next Data Forum gets the space; past ones are one line each */
815841
function renderEvents() {
816842
const list = [...state.events].sort((a, b) => b.order - a.order);
817843
const next = list.find((e) => e.upcoming), past = list.filter((e) => !e.upcoming);
818844
const when = (e) => (e.date ? dot(e.date) : `${e.year}년`);
819845
const total = past.reduce((s, e) => s + (e.participants || 0), 0);
846+
const maxP = Math.max(1, ...past.map((e) => e.participants || 0));
847+
const dd = next && next.date ? daysTo(next.date) : null;
820848
const nextHTML = next ? `<li class="event next">
821-
<span class="soon-tag">다음 행사</span>
849+
<span class="soon-tag">다음 행사${dd != null && dd >= 0 ? ` · ${dd === 0 ? "오늘" : `D-${dd}`}` : ""}</span>
822850
<span class="ord">${next.order}회</span>
823851
<h3>${next.link ? `<a href="${esc(next.link)}" target="_blank" rel="noopener">${esc(next.name)}</a>` : esc(next.name)}</h3>
824852
<span class="when">${when(next)}</span>
853+
<p class="ev-about">현업과 학계가 만나 인과추론과 실험, 데이터 의사결정을 이야기하는 자리입니다. 지난 ${past.length}회에 ${fmt(total)}명이 함께했습니다.</p>
825854
${next.link ? `<a class="btn sm" href="${esc(next.link)}" target="_blank" rel="noopener">참가 신청하기</a>` : `<span class="ppl">신청 링크는 곧 열립니다.</span>`}
826855
</li>` : "";
827856
const pastHTML = past.map((e) => `<li class="event past">
828857
<span class="ord">${e.order}회</span>
829858
<span class="ev-name">${e.link ? `<a href="${esc(e.link)}" target="_blank" rel="noopener">${esc(e.name)}</a>` : esc(e.name)}<span class="when">${when(e)}</span></span>
830-
<span class="ev-n">${e.participants ? `<b>${fmt(e.participants)}</b>명` : ""}</span>
859+
<span class="ev-n">${e.participants ? `<span class="ev-num"><b>${fmt(e.participants)}</b>명</span><i class="ev-bar" aria-hidden="true"><i style="width:${Math.round((e.participants / maxP) * 100)}%"></i></i>` : ""}</span>
831860
</li>`).join("");
832861
$("#event-list").innerHTML = nextHTML + (past.length ? `<li class="event-past"><p class="ev-sum">지난 Data Forum ${past.length}회 · 참가 ${fmt(total)}명</p><ol>${pastHTML}</ol></li>` : "");
833862
}
@@ -842,7 +871,7 @@
842871
}
843872

844873
function stationGroup(parent, id, r, cls) {
845-
const g = svg("g", { class: "st" + cls, "data-line": primaryLine(r), "data-st": id, tabindex: 0, role: "button", "aria-label": `${r.title} 열기` }, parent);
874+
const g = svg("g", { class: "st" + cls, "data-line": primaryLine(r), "data-lines": (r.lines || []).join(" "), "data-st": id, tabindex: 0, role: "button", "aria-label": `${r.title} 열기` }, parent);
846875
g.addEventListener("click", () => openStation(id, "map"));
847876
g.addEventListener("keydown", (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); openStation(id, "map"); } });
848877
return g;
@@ -1374,6 +1403,10 @@
13741403
if (nl) { closeStation(); gotoLevel(nl.dataset.nextLevel); return; }
13751404
const ext = e.target.closest("a[data-post][target=_blank]");
13761405
if (ext) stamp("post");
1406+
const fl = e.target.closest("[data-focus-line]");
1407+
if (fl) { focusLine(fl.dataset.focusLine); return; }
1408+
const tg = e.target.closest("[data-tab-go]");
1409+
if (tg) { selectTab(tg.dataset.tabGo); $("#tab-map").scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "start" }); track("open_map", { source: "tab_note" }); return; }
13771410
const stepBtn = e.target.closest("[data-step]");
13781411
if (stepBtn) {
13791412
state.level = stepBtn.dataset.step;
@@ -1457,7 +1490,7 @@
14571490
const setHeader = () => { if (header) document.documentElement.style.setProperty("--header-h", `${header.offsetHeight}px`); };
14581491
setHeader(); window.addEventListener("resize", setHeader);
14591492
renderLegend(); renderMap(); wireTabs();
1460-
renderFeatured(); renderPartner(); renderEvents(); renderStages(); renderArticles(); renderDaily(); watchMapScroll();
1493+
renderFeatured(); renderPartner(); renderEvents(); renderNextEvent(); renderStages(); renderArticles(); renderDaily(); watchMapScroll();
14611494
/* sections fill in after the data loads, so jump again once they have their height */
14621495
if (/^#(contrib|events|reading|join)$/.test(location.hash)) requestAnimationFrame(() => { const el = $(location.hash); if (el) el.scrollIntoView(); });
14631496
openFromHash();

‎index.html‎

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<nav class="site-nav" aria-label="주요 메뉴">
3131
<a href="#curriculum">커리큘럼</a>
3232
<a href="#contrib">Builder</a>
33-
<a href="#posts">연재</a>
3433
<a href="#events">행사</a>
34+
<a href="#posts">연재</a>
3535
<a href="#join">참여하기</a>
3636
</nav>
3737
<button type="button" class="pass-btn" data-passport aria-label="활동 여권 열기">여권 <b data-passport-count>0/9</b></button>
@@ -61,6 +61,10 @@ <h1 id="hero-title">Causal Inference Hub</h1>
6161
<ul class="featured" id="featured" aria-label="대표 사이트"></ul>
6262
</div>
6363
</div>
64+
<div class="hero-grid">
65+
<ul class="growth" id="growth" aria-label="팀의 성장 지표"></ul>
66+
</div>
67+
<a class="next-event" id="next-event" href="#events" hidden></a>
6468
</div>
6569
</section>
6670

@@ -76,12 +80,23 @@ <h2 id="curriculum-title">커리큘럼</h2>
7680
</div>
7781
<p class="route-note" id="route-note" aria-live="polite"></p>
7882
<div class="tabs big" role="tablist" aria-label="보기 방식">
79-
<button type="button" role="tab" id="tab-course" aria-controls="panel-course" aria-selected="true">단계별로 보기<span class="tab-n" id="n-course"></span></button>
80-
<button type="button" role="tab" id="tab-map" aria-controls="panel-map" aria-selected="false" tabindex="-1">트랙 지도</button>
83+
<button type="button" role="tab" id="tab-course" aria-controls="panel-course" aria-selected="true">단계로 보기<span class="tab-n" id="n-course"></span></button>
84+
<button type="button" role="tab" id="tab-map" aria-controls="panel-map" aria-selected="false" tabindex="-1"><span class="tab-lines" aria-hidden="true"><i></i><i></i><i></i></span>트랙 지도로 보기</button>
8185
</div>
86+
<p class="tab-note" id="tab-note">단계는 배우는 순서이고, 트랙은 주제입니다. 같은 주제를 L0부터 L4까지 이어 보려면 <button type="button" class="link-btn" data-tab-go="tab-map">트랙 지도</button>를 여세요.</p>
8287

8388
<div id="panel-map" role="tabpanel" aria-labelledby="tab-map" hidden>
8489
<div class="map-card">
90+
<div class="map-how" aria-label="트랙 지도 읽는 법">
91+
<p class="mh-t">트랙 지도 읽는 법</p>
92+
<ul>
93+
<li><svg width="30" height="10" aria-hidden="true"><path d="M2 5H28" stroke="var(--l-main)" stroke-width="5" stroke-linecap="round"/></svg><span><b>노선</b>은 주제 트랙입니다. 색마다 하나씩, 6개입니다.</span></li>
94+
<li><svg width="22" height="22" aria-hidden="true"><circle cx="11" cy="11" r="7" fill="var(--surface)" stroke="var(--l-main)" stroke-width="3.5"/></svg><span><b>역</b>은 자료입니다. 누르면 설명과 링크가 열립니다.</span></li>
95+
<li><svg width="16" height="26" aria-hidden="true"><rect x="2" y="2" width="12" height="22" rx="6" fill="var(--surface)" stroke="var(--ink)" stroke-width="3"/></svg><span><b>환승역</b>은 여러 트랙이 만나는 자료입니다.</span></li>
96+
<li><svg width="30" height="10" aria-hidden="true"><path d="M2 5H28" stroke="var(--l-main)" stroke-width="2.5" stroke-dasharray="5 5" stroke-linecap="round"/></svg><span><b>점선</b>은 책과 강의(유료)입니다.</span></li>
97+
</ul>
98+
<p class="mh-tip">아래 트랙 이름을 누르면 그 노선만 남겨서 볼 수 있습니다.</p>
99+
</div>
85100
<p class="map-hint" id="map-hint" hidden>지도가 화면보다 넓습니다. 옆으로 밀면 L3·L4까지 보입니다.</p>
86101
<div class="map-scroll" id="map-scroll">
87102
<svg id="metro" role="group" aria-labelledby="metro-title"><title id="metro-title">인과추론 트랙 지도: L0부터 L4까지 6개 트랙</title></svg>
@@ -131,24 +146,24 @@ <h2 id="contrib-title">가장 많이 기여한 사람들</h2>
131146
</div>
132147
</section>
133148

134-
<section class="band" id="posts" aria-labelledby="posts-title">
149+
<section class="band" id="events" aria-labelledby="events-title">
135150
<div class="wrap">
136151
<div class="section-head">
137-
<h2 id="posts-title">연재</h2>
138-
<p>팀원이 쓰는 인과추론 이야기입니다. 이번 주 포스트는 월요일마다 바뀝니다.</p>
152+
<h2 id="events-title">행사</h2>
153+
<p>현업과 학계가 만나는 Data Forum을 열고, 학회 행사에 협력합니다.</p>
139154
</div>
140-
<div id="post-box"></div>
155+
<ol class="events" id="event-list"></ol>
156+
<section class="stage" id="stage" aria-labelledby="stage-title"></section>
141157
</div>
142158
</section>
143159

144-
<section class="band" id="events" aria-labelledby="events-title">
160+
<section class="band" id="posts" aria-labelledby="posts-title">
145161
<div class="wrap">
146162
<div class="section-head">
147-
<h2 id="events-title">행사</h2>
148-
<p>현업과 학계가 만나는 Data Forum을 열고, 학회 행사에 협력합니다.</p>
163+
<h2 id="posts-title">연재</h2>
164+
<p>팀원이 쓰는 인과추론 이야기입니다. 이번 주 포스트는 월요일마다 바뀝니다.</p>
149165
</div>
150-
<ol class="events" id="event-list"></ol>
151-
<section class="stage" id="stage" aria-labelledby="stage-title"></section>
166+
<div id="post-box"></div>
152167
</div>
153168
</section>
154169

0 commit comments

Comments
 (0)