Skip to content

Commit 8652e63

Browse files
committed
Put the Builders first and make the book and lecture one click away
- Builder section moves right under the hero with the team's numbers in one line and a 'next cohort Builder' button; the four number tiles are gone - All Builders show on phones (the grid was hidden under 600px) - Hero opens with the web book; the start-point quiz stays in the goal chips - Partner cards open Hanbit on click, say who translated and who teaches, and keep a small link to their place in the curriculum; no price chips - One name for the book and the lecture across hero, map and dialogs - Posts link the book and lecture they belong with; the book post links the store and the lecture; the article page has share tags - Builder pages list that Builder's book and lecture - Curriculum on phones shows two materials per level with a 'more' button - Repo star rank reads '★ n위' so it is not confused with Builder Top 3 - Writer card keeps one button; the post stamp waits for the end of the post - Game results lead to the web book
1 parent fa0e3dc commit 8652e63

11 files changed

Lines changed: 148 additions & 52 deletions

File tree

‎article.html‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com; font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com; img-src 'self' data: blob: https://github.com https://avatars.githubusercontent.com https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://api.github.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; object-src 'none'; base-uri 'self'; form-action 'self'">
66
<script src="assets/js/ga.js"></script>
77
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
8-
<title>읽을거리 | Causal Inference Hub</title>
9-
<meta name="description" content="가짜연구소 인과추론팀이 쓴 글과 독자를 위한 자료입니다.">
8+
<title>연재 | Causal Inference Hub</title>
9+
<meta name="description" content="가짜연구소 인과추론팀 팀원이 쓰는 인과추론 연재입니다.">
10+
<meta property="og:type" content="article">
11+
<meta property="og:site_name" content="Causal Inference Hub">
12+
<meta property="og:title" content="연재 | Causal Inference Hub">
13+
<meta property="og:description" content="가짜연구소 인과추론팀 팀원이 쓰는 인과추론 연재입니다.">
14+
<meta property="og:image" content="https://causalinferencelab.github.io/assets/img/og-hub.png">
15+
<meta name="twitter:card" content="summary_large_image">
1016
<link rel="icon" href="assets/img/team-mark.png">
1117
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css" integrity="sha384-/uC/GIvKJ/9RN6i1izHoBY9ubYo60OAsQRNQ3NRFiNsN+N/MVQJHD5OYcZz6wvwn" crossorigin="anonymous">
1218
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap">

‎articles/book-release.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
- [인과추론팀 블로그](https://causalinferencelab.github.io/)
4343
- [신진수 블로그](https://jinsooshin.tistory.com/)
4444

45+
책은 [한빛미디어](https://www.hanbit.co.kr/store/books/look.php?p_code=B6208936856)에서 볼 수 있고, 책의 내용을 실무로 잇는 온라인 강의 「[데이터 실무자의 사고력 강화: AI 인과추론 실무](https://www.hanbit.co.kr/product/C0781073345)」도 열려 있습니다.
46+
4547
참고로 가짜연구소 인과추론팀은 해당 번역서를 기반으로 다양한 프로젝트를 진행하고 있습니다. 해당 프로젝트에 대한 청강은 [가짜연구소 Discord](https://discord.gg/HeHbFAvmSZ)를 확인해주세요.
4648

4749
## Conclusion

‎assets/css/hub.css‎

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-a
440440
.ro-total span { font-size: 12px; color: var(--muted); white-space: nowrap; }
441441
.roster-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
442442
.roster-legend li { display: flex; align-items: center; gap: 6px; }
443-
@media (max-width: 600px) { .rail-head, .people-rail { display: none; } }
443+
444444
@media (max-width: 760px) {
445445
.ro-head { display: none; }
446446
.ro { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 16px; }
@@ -1332,3 +1332,45 @@ button.btn.sm { font-size: 14px; }
13321332
.pp-go:focus-visible, .pp-claim:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
13331333
@media (max-width: 520px) { .pp-list li { grid-template-columns: auto minmax(0, 1fr); } .pp-act { grid-column: 1 / -1; justify-content: flex-start; } }
13341334
#shelf .ep-track { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
1335+
1336+
/* ==========================================================================
1337+
People first: Builder section under the hero; partner cards go to Hanbit
1338+
========================================================================== */
1339+
.builders-band { padding-block: 40px 56px; }
1340+
.builders-band .section-head h2 { font-size: clamp(26px, 3vw, 34px); }
1341+
.contrib-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 14.5px; color: var(--muted); }
1342+
.contrib-stats b { font-family: var(--f-display); font-size: 17px; font-weight: 800; color: var(--ink); margin-right: 1px; font-variant-numeric: tabular-nums; }
1343+
.contrib-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
1344+
.contrib-cta .btn { margin-top: 0; }
1345+
@media (max-width: 600px) {
1346+
.people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
1347+
.people-grid .pcard > button { padding: 12px; gap: 8px; }
1348+
.people-grid .pcard .avatar.lg { width: 36px; height: 36px; font-size: 15px; }
1349+
.people-grid .pc-latest, .people-grid .pc-stats { display: none; }
1350+
.contrib-cta .btn { flex: 1 1 auto; justify-content: center; }
1351+
}
1352+
/* partner cards: the whole card opens Hanbit, a small link shows where it sits in the curriculum */
1353+
.pt-main { text-decoration: none; border-radius: 12px; }
1354+
.pt-arrow { width: 13px; height: 13px; margin-left: auto; flex-shrink: 0; opacity: .8; }
1355+
.pt-goto { font: inherit; font-size: 12px; font-weight: 700; flex-shrink: 0; padding: 0 12px; border: 0; border-left: 1px solid rgba(255, 255, 255, .14); background: none; color: rgba(255, 255, 255, .78); cursor: pointer; border-radius: 0 12px 12px 0; white-space: nowrap; }
1356+
.pt-goto:hover { background: rgba(255, 255, 255, .1); color: #fff; }
1357+
.pt-goto:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
1358+
1359+
/* curriculum on phones: two materials per level, the rest one tap away */
1360+
.lv-more { display: none; }
1361+
@media (max-width: 720px) {
1362+
.lv:not(.route):not(.open) .lv-items > li:nth-child(n+3) { display: none; }
1363+
.lv:not(.route):not(.open) .lv-more { display: block; }
1364+
.lv-more { width: 100%; margin-top: 10px; font: inherit; font-size: 14px; font-weight: 700; min-height: 44px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); cursor: pointer; }
1365+
}
1366+
/* related book and lecture on posts and Builder pages */
1367+
.post-related { padding: 16px 18px; border-radius: 16px; background: var(--surface); }
1368+
.post-related .k { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
1369+
.post-related ul, .post-related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
1370+
.post-related a, .post-related-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
1371+
.post-related a:hover, .post-related-list a:hover { box-shadow: 0 6px 20px rgba(20, 22, 43, .08); }
1372+
.post-related img, .post-related-list img { height: 40px; width: auto; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
1373+
.post-related a > span, .post-related-list a > span { display: flex; flex-direction: column; min-width: 0; }
1374+
.post-related b, .post-related-list b { font-size: 15px; }
1375+
.post-related a > span > span, .post-related-list a > span > span { font-size: 13px; color: var(--muted); }
1376+
.p-timeline li { grid-template-columns: 78px minmax(0, 1fr); }

‎assets/js/article.js‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const body = document.getElementById("article-body");
77
const more = document.getElementById("article-more");
88
const after = document.getElementById("article-after");
9-
let articles = [], builders = [];
9+
let articles = [], builders = [], paid = [];
1010

1111
function notFound() {
1212
title.textContent = "글을 찾을 수 없습니다";
@@ -28,7 +28,10 @@
2828
const slugOk = b && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(b.slug || "");
2929
const series = a.series ? articles.filter((x) => x.series === a.series && !x.url).sort((x, y) => (x.episode || 0) - (y.episode || 0)) : [];
3030
const i = series.indexOf(a), prev = series[i - 1], next = series[i + 1];
31-
after.innerHTML = `<div class="writer"><span class="k">글쓴이</span><b>${esc(a.author)}</b>${slugOk ? `<a href="builders/${esc(b.slug)}.html">Builder 페이지</a>` : ""}</div>
31+
/* the book and lecture this post belongs with, one click to Hanbit */
32+
const rel = (a.related || []).map((id) => paid.find((p) => p.id === id)).filter(Boolean);
33+
const relHTML = rel.length ? `<div class="post-related"><p class="k">이 글과 이어지는 책·강의</p><ul>${rel.map((p) => { const out = (p.links || [])[0]; const url = out && /^https:\/\//.test(out.url) ? out.url : ""; return url ? `<li><a href="${esc(url)}" target="_blank" rel="noopener" data-event="click_partner" data-event-params='${esc(JSON.stringify({ item: p.id, action: "out", source: "article" }))}'><img src="${esc(p.cover)}" alt="" width="${p.type === "도서" ? 30 : 52}" height="40"><span><b>${esc(p.shortTitle || p.title)}</b><span>${esc(p.type)} · ${esc(p.type === "도서" ? "인과추론팀 옮김" : `강사 ${p.credit || ""}`)} · 한빛미디어</span></span></a></li>` : ""; }).join("")}</ul></div>` : "";
34+
after.innerHTML = relHTML + `<div class="writer"><span class="k">글쓴이</span><b>${esc(a.author)}</b>${slugOk ? `<a href="builders/${esc(b.slug)}.html">Builder 페이지</a>` : ""}</div>
3235
${prev || next ? `<nav class="series-nav" aria-label="연재 이동">${prev ? `<a href="#${esc(prev.slug)}"><span>이전 편</span>${esc(prev.title)}</a>` : "<span></span>"}${next ? `<a class="next" href="#${esc(next.slug)}"><span>다음 편</span>${esc(next.title)}</a>` : ""}</nav>` : ""}`;
3336
try {
3437
const res = await fetch(`articles/${a.slug}.md`, { cache: "no-cache" });
@@ -46,17 +49,22 @@
4649
});
4750
body.querySelectorAll('a[href^="http"]').forEach((l) => { l.target = "_blank"; l.rel = "noopener"; });
4851
window.scrollTo(0, 0);
49-
if (window.hubStamp) window.hubStamp("post");
52+
/* the post stamp is for reading to the end, and so it does not cover the text on arrival */
53+
if (window.hubStamp && "IntersectionObserver" in window) {
54+
const io = new IntersectionObserver((es) => { if (es.some((x) => x.isIntersecting)) { io.disconnect(); window.hubStamp("post"); } });
55+
io.observe(after);
56+
}
5057
} catch (e) {
5158
body.innerHTML = "<p>본문을 불러오지 못했습니다. 잠시 후 다시 열어 주세요.</p>";
5259
}
5360
}
5461

5562
Promise.all([
5663
fetch("data/articles.json", { cache: "no-cache" }).then((r) => r.json()),
57-
fetch("data/builders.json", { cache: "no-cache" }).then((r) => r.json()).catch(() => [])
64+
fetch("data/builders.json", { cache: "no-cache" }).then((r) => r.json()).catch(() => []),
65+
fetch("data/map.json", { cache: "no-cache" }).then((r) => r.json()).then((m) => m.paid || []).catch(() => [])
5866
])
59-
.then(([list, people]) => { articles = list; builders = people; show(); })
67+
.then(([list, people, books]) => { articles = list; builders = people; paid = books; show(); })
6068
.catch(notFound);
6169
window.addEventListener("hashchange", show);
6270
})();

‎assets/js/game.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
<p class="gm-lede">${t.html ? t.body : esc(t.body)}</p>
7373
${chapters.length ? `<div class="gm-review"><h3>다시 볼 장</h3><ul>${chapters.map((c) => `<li><a href="${esc(c.url)}" target="_blank" rel="noopener" data-event="read_chapter" data-event-params='${esc(JSON.stringify({ source: "game_review", chapter: c.url.split("/").pop().slice(0, 2) }))}'>${esc(c.title)}</a></li>`).join("")}</ul></div>` : ""}
7474
<div class="gm-cta">
75-
<a class="btn" href="./?quiz=1">3문항으로 내 시작점 찾기</a>
75+
<a class="btn" href="https://causalinferencelab.github.io/Causal-Inference-with-Python/">웹북에서 이어 읽기</a>
76+
<a class="btn ghost" href="./?quiz=1">3문항으로 내 시작점 찾기</a>
7677
<button type="button" class="btn ghost" data-share-game>${navigator.share ? "공유하기" : "결과와 링크 복사"}</button>
7778
<button type="button" class="btn ghost" data-restart>다시 하기</button>
7879
</div>`;

‎assets/js/hub.js‎

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,19 @@
259259
}
260260

261261
let growthTiles = [];
262+
/* the team's numbers, said once, next to the people who made them */
263+
function renderContribStats() {
264+
const el = $("#contrib-stats");
265+
if (!el || !growthTiles.length) return;
266+
const v = Object.fromEntries(growthTiles.map((t) => [t.key, t]));
267+
const part = (t, label) => (t ? `<span><b>${fmt(t.value)}</b>${label}</span>` : "");
268+
el.innerHTML = [part(v.runners, "명이 러너로 참여"), part(v.projects, "개 프로젝트"), part(v.stars, " GitHub 스타"), part(v.events, "명 행사 참가")].join("");
269+
}
262270
function renderGrowth(animate = true) {
263271
growthTiles = growthSeries();
264272
const box = $("#growth");
273+
renderContribStats();
274+
if (!box) return;
265275
box.innerHTML = growthTiles.map((t) => {
266276
const has = t.series.length > 1;
267277
const first = has ? t.series[0] : null, last = has ? t.series[t.series.length - 1] : null;
@@ -340,7 +350,7 @@
340350
const line = primaryLine(r);
341351
const rank = top.indexOf(id);
342352
const badges = [
343-
rank >= 0 ? `<span class="b top">TOP ${rank + 1}</span>` : "",
353+
rank >= 0 ? `<span class="b top">★ ${rank + 1}위</span>` : "",
344354
r.status === "running" ? `<span class="b live">진행 중</span>` : "",
345355
r.status !== "running" && ageDays(r.pushed) != null && ageDays(r.pushed) <= 14 ? `<span class="b new">새 업데이트</span>` : "",
346356
r.kind === "paid" ? `<span class="b paid">${esc(r.type || "")} · 유료</span>` : "",
@@ -384,6 +394,7 @@
384394
<div class="lv-side"><span class="lv-n">자료 ${free}개${items.length > free ? ` · 도서·강의 ${items.length - free}` : ""}</span>${makers.length ? `<span class="lv-makers" title="${esc(makers.join(", "))}">${makers.slice(0, 4).map((n) => avatarHTML(n, "sm")).join("")}<span>${makers.length}명이 만들었습니다</span></span>` : ""}</div>
385395
</div>
386396
<ol class="lv-items">${items.map((r, k) => episodeHTML(r, lv.id, k, top)).join("")}</ol>
397+
${items.length > 2 ? `<button type="button" class="lv-more" data-lv-more>${lv.id} 자료 ${items.length - 2}개 더 보기</button>` : ""}
387398
</li>`;
388399
}).join("");
389400
$("#chapters").innerHTML = state.levels.map((lv) => `<button type="button" data-chapter="${lv.id}" aria-current="false"><b>${lv.id}</b> <span class="nm">${esc(lv.name)}</span></button>`).join("");
@@ -395,7 +406,7 @@
395406
const depot = [...state.repos.values()].filter((r) => r.status === "depot");
396407
const learnable = repos.filter((r) => (r.lines || []).length);
397408
const done = learnable.filter((r) => state.ridden.has(r.repo)).length;
398-
$("#curriculum-sub").textContent = `L0부터 L4까지, 팀이 만든 레포 ${repos.length}개를 순서대로 엮었습니다. L0–L2는 무료 자료만으로 끝까지 갈 수 있습니다.`;
409+
$("#curriculum-sub").textContent = `L0부터 L4까지, 팀이 만든 레포 ${repos.length}개를 순서대로 엮었습니다. L0–L2는 무료 자료만으로도 끝까지 갈 수 있고, 책과 강의는 더 깊게 보고 싶을 때 고르면 됩니다.`;
399410
$("#n-course").textContent = repos.length; $("#n-course").title = `레포 ${repos.length}개`;
400411
$("#shelf-foot").innerHTML = `${done ? `<span class="done-n">학습 완료 ${done} / ${learnable.length}</span> ` : ""}카드를 누르면 자세한 정보와 링크가 열립니다. 운영·보관 레포: ${depot.map((r) => `<a href="${esc(repoUrl(r))}" target="_blank" rel="noopener">${esc(r.title)}</a>`).join(", ")}`;
401412
shelfSpy();
@@ -730,6 +741,7 @@
730741
if (state.route !== "all") setRoute("all");
731742
const el = $(`#shelf .ep[data-id="${CSS.escape(id)}"]`);
732743
if (!el) return;
744+
const block = el.closest(".lv"); if (block) block.classList.add("open");
733745
document.querySelectorAll("#shelf .ep.picked").forEach((x) => x.classList.remove("picked", "flash"));
734746
el.classList.add("picked");
735747
el.scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "center" });
@@ -738,20 +750,24 @@
738750
}
739751

740752
/* ---------- book and lecture (hero) ---------- */
753+
/* the book the team translated and the lecture built on it: one click to Hanbit */
741754
function renderPartner() {
742755
const items = (state.map.paid || []).filter((p) => p.cover);
743756
$("#partner-list").innerHTML = items.map((p) => {
744757
const out = (p.links || [])[0];
758+
const who = p.type === "도서" ? "인과추론팀 옮김" : `강사 ${p.credit || ""}`;
745759
return `<li class="pt-card">
746-
<button type="button" class="pt-main" data-goto="${esc(p.id)}" aria-label="${esc(`${p.type} ${p.title}, 커리큘럼 ${p.level}에서 보기`)}">
760+
<a class="pt-main" href="${esc(out ? out.url : "#curriculum")}" target="_blank" rel="noopener" data-event="click_partner" data-event-params='${esc(JSON.stringify({ item: p.id, action: "out" }))}' aria-label="${esc(`${p.type} ${p.title}, 한빛미디어에서 보기`)}">
747761
<img class="pt-img ${p.type === "도서" ? "book" : "wide"}" src="${esc(p.cover)}" alt="" width="${p.type === "도서" ? 26 : 48}" height="34">
748-
<span class="pt-text"><b>${esc(p.shortTitle || p.title)}</b><span class="pt-lv"><span class="pt-type">${esc(p.type)}</span><span class="pt-paid">유료</span>커리큘럼 ${esc(p.level)}에서 보기</span></span>
749-
</button>
750-
${out ? `<a class="pt-out" href="${esc(out.url)}" target="_blank" rel="noopener" title="한빛미디어에서 보기" aria-label="${esc(`${p.title} 한빛미디어에서 보기`)}"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4h6v6M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></a>` : ""}
762+
<span class="pt-text"><b>${esc(p.shortTitle || p.title)}</b><span class="pt-lv"><span class="pt-type">${esc(p.type)}</span>${esc(who)}</span></span>
763+
<svg class="pt-arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4h6v6M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
764+
</a>
765+
<button type="button" class="pt-goto" data-goto="${esc(p.id)}">커리큘럼 ${esc(p.level)}</button>
751766
</li>`;
752767
}).join("");
753768
}
754769

770+
755771
/* ---------- featured sites (hero) ---------- */
756772
function renderFeatured() {
757773
$("#featured").innerHTML = (state.featured || []).map((f) => {
@@ -931,7 +947,7 @@
931947
<div class="au-head">${avatarHTML(pick.author, "lg")}<div><b class="au-name">${esc(pick.author)}</b>${tier ? `<span class="au-tier">${tierMedal(person, 18)}${esc(tier.name)}</span>` : ""}</div></div>
932948
<p class="au-about">${esc(about)}</p>
933949
${series.length > 1 ? `<ol class="au-series">${series.map((a) => `<li${a === pick ? ' aria-current="true"' : ""}>${postLink(a, "series", `<span class="n">${a.episode || ""}편</span><span class="t">${esc(a.title)}</span>`)}</li>`).join("")}</ol>` : ""}
934-
<p class="au-links">${person ? `<button type="button" class="btn ghost sm" data-person="${esc(person.name)}">Builder 이력</button>` : ""}${info.slug ? `<a class="btn ghost sm" href="builders/${esc(info.slug)}.html">Builder 페이지</a>` : ""}</p>
950+
<p class="au-links">${person ? `<button type="button" class="btn ghost sm" data-person="${esc(person.name)}">${esc(pick.author)}의 Builder 이력</button>` : ""}</p>
935951
</aside>
936952
</div>
937953
${others.length ? `<ul class="post-list">${others.map((a) => `<li>${postLink(a, "list", `<span class="pl-t">${esc(a.title)}</span><span class="pl-m">${esc(a.author)}${a.series ? ` · ${esc(a.series)}` : ""} · ${dot(a.date)}</span>`)}</li>`).join("")}</ul>` : ""}
@@ -1344,6 +1360,8 @@
13441360
if (nl) { closeStation(); gotoLevel(nl.dataset.nextLevel); return; }
13451361
const ext = e.target.closest("a[data-post][target=_blank]");
13461362
if (ext) stamp("post");
1363+
const more = e.target.closest("[data-lv-more]");
1364+
if (more) { more.closest(".lv").classList.add("open"); return; }
13471365
const mc = e.target.closest("[data-medal-card]");
13481366
if (mc) { openMedalCard(mc.dataset.medalCard); return; }
13491367
const dl = e.target.closest("[data-card-save]");

0 commit comments

Comments
 (0)