Skip to content

Commit a663da9

Browse files
committed
Lead with the curriculum and keep the Builder block to the top contributors
- Curriculum comes right after the hero: the five steps in one row (question, how many materials, who built them), the chosen step's materials below, and a 'next step' button; routes still show numbered stops - Today's question leaves the home page; the game and lab stay linked from the footer - Builder block after the curriculum: the top three, then everyone else as one row of names, the 'next cohort' button, and the folded medals and history - Card text no longer inherits a heavy weight; top-three cards are shorter on phones
1 parent 8652e63 commit a663da9

3 files changed

Lines changed: 132 additions & 58 deletions

File tree

‎assets/css/hub.css‎

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,13 +1356,6 @@ button.btn.sm { font-size: 14px; }
13561356
.pt-goto:hover { background: rgba(255, 255, 255, .1); color: #fff; }
13571357
.pt-goto:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
13581358

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-
}
13661359
/* related book and lecture on posts and Builder pages */
13671360
.post-related { padding: 16px 18px; border-radius: 16px; background: var(--surface); }
13681361
.post-related .k { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
@@ -1374,3 +1367,66 @@ button.btn.sm { font-size: 14px; }
13741367
.post-related b, .post-related-list b { font-size: 15px; }
13751368
.post-related a > span > span, .post-related-list a > span > span { font-size: 13px; color: var(--muted); }
13761369
.p-timeline li { grid-template-columns: 78px minmax(0, 1fr); }
1370+
1371+
/* ==========================================================================
1372+
Curriculum at a glance: the five steps in one row, the chosen one below
1373+
========================================================================== */
1374+
.path-wrap { margin: 4px 0 14px; }
1375+
.path-k { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
1376+
.path-k span:last-child { padding-left: 4px; }
1377+
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; counter-reset: step; }
1378+
.step { position: relative; }
1379+
.step:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 8px; height: 8px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: translate(0, -50%) rotate(45deg); opacity: .5; z-index: 1; }
1380+
.step button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 3px; width: 100%; height: 100%; padding: 16px; border-radius: 18px; background: var(--surface); color: var(--ink); transition: box-shadow .15s ease, background .15s ease; }
1381+
.step button:hover { box-shadow: 0 6px 20px rgba(20, 22, 43, .08); }
1382+
.step button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1383+
.step button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
1384+
.st-id { font-family: var(--f-display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -.02em; color: var(--accent); }
1385+
.step.build .st-id { color: var(--l-ai); }
1386+
.step button[aria-pressed="true"] .st-id { color: #FFD54A; }
1387+
.st-name { font-size: 15px; font-weight: 800; margin-top: 6px; }
1388+
.st-q { font-size: 13.5px; color: var(--muted); }
1389+
.st-meta { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 8px; }
1390+
.step button[aria-pressed="true"] .st-q, .step button[aria-pressed="true"] .st-meta { color: rgba(255, 255, 255, .78); }
1391+
.st-makers { display: flex; margin-top: 6px; }
1392+
.st-makers .avatar.sm { width: 22px; height: 22px; font-size: 10px; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
1393+
.st-makers .avatar.sm:first-child { margin-left: 0; }
1394+
.step button[aria-pressed="true"] .st-makers .avatar.sm { box-shadow: 0 0 0 2px var(--ink); }
1395+
.lv-next { all: unset; box-sizing: border-box; cursor: pointer; display: block; margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); font-size: 14.5px; font-weight: 700; text-align: center; }
1396+
.lv-next:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
1397+
.lv-next:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1398+
.lv .lv-head { grid-template-columns: auto minmax(0, 1fr); }
1399+
@media (max-width: 860px) {
1400+
.path-k { display: none; }
1401+
.path { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 46%); overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding: 2px var(--gutter-r) 6px var(--gutter-l); scroll-snap-type: x proximity; }
1402+
.path::-webkit-scrollbar { display: none; }
1403+
.step { scroll-snap-align: start; }
1404+
.step::after { display: none; }
1405+
.st-q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
1406+
}
1407+
1408+
/* Builder: the top three, then everyone else as one row of names */
1409+
.crew-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 4px 0 12px; padding: 16px 20px; border-radius: 20px; background: var(--surface); }
1410+
.crew-row .people-rail { margin: 0; flex: 1 1 520px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
1411+
.crew-k { font-size: 13.5px; font-weight: 800; color: var(--muted); }
1412+
.crew { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
1413+
.crew button { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 700; }
1414+
.crew button:hover { background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface-2)); }
1415+
.crew button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
1416+
.crew .avatar.sm { width: 26px; height: 26px; font-size: 12px; }
1417+
.crew li.is-picked button { box-shadow: 0 0 0 2px var(--c); }
1418+
.crew-row .contrib-cta { margin: 0; }
1419+
@media (max-width: 600px) { .crew-row { padding: 14px; } .crew-row .contrib-cta { width: 100%; } .crew-row .contrib-cta .btn { width: 100%; justify-content: center; } }
1420+
/* card text was inheriting a heavy weight */
1421+
#shelf .ep > button, .lv-t p { font-weight: 400; }
1422+
#shelf .ep h4 { font-weight: 700; }
1423+
#shelf .who .nm, .ep-end .star { font-weight: 700; }
1424+
@media (max-width: 600px) {
1425+
.top3 { gap: 8px; }
1426+
.tcard > button { padding: 16px; gap: 10px; }
1427+
.tcard .t-recent { display: none; }
1428+
.tcard .t-rank { font-size: 34px; }
1429+
}
1430+
/* the chosen step keeps the brand colour in both themes */
1431+
.step button[aria-pressed="true"] { background: #23276A; color: #fff; }
1432+
.step button[aria-pressed="true"] .st-makers .avatar.sm { box-shadow: 0 0 0 2px #23276A; }

‎assets/js/hub.js‎

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -371,45 +371,57 @@
371371
</li>`;
372372
}
373373

374+
function renderPath() {
375+
const box = $("#path");
376+
if (!box) return;
377+
const route = currentRoute();
378+
const onRoute = route ? new Set(route.stops.map((id) => (state.repos.get(id) || {}).level)) : null;
379+
box.innerHTML = state.levels.map((lv) => {
380+
const items = levelItems(lv.id), free = items.filter((r) => !r.kind).length;
381+
const makers = [...new Set(items.flatMap((r) => r.builders || []))];
382+
const done = items.filter((r) => state.ridden.has(r.repo)).length;
383+
const on = route ? onRoute.has(lv.id) : state.level === lv.id;
384+
return `<li class="step${lv.layer === "build" ? " build" : ""}"><button type="button" data-step="${lv.id}" aria-pressed="${on}">
385+
<span class="st-id">${lv.id}</span><span class="st-name">${esc(lv.name)}</span><span class="st-q">${esc(lv.question)}</span>
386+
<span class="st-meta">자료 ${free}개${items.length > free ? " · 책·강의" : ""}${done ? ` · 완료 ${done}` : ""}</span>
387+
${makers.length ? `<span class="st-makers">${makers.slice(0, 4).map((n) => avatarHTML(n, "sm")).join("")}</span>` : ""}</button></li>`;
388+
}).join("");
389+
wireAvatars(box);
390+
}
374391
function renderShelf() {
375392
const top = topRepos();
376393
const route = currentRoute();
377394
const shelf = $("#shelf");
395+
state.level = state.level || "L0";
378396
shelf.classList.toggle("routing", !!route);
379397
if (route) {
380398
const items = route.stops.map((id) => state.repos.get(id)).filter(Boolean);
381399
shelf.innerHTML = `<li class="lv route"><ol class="lv-items">${items.map((r, i) => episodeHTML(r, r.level || "", i, top, i + 1)).join("")}</ol></li>`;
382-
$("#chapters").innerHTML = items.map((r, i) => `<button type="button" data-chapter="${esc(r.repo)}" aria-current="false"><b>${pad2(i + 1)}</b> <span class="nm">${esc(r.title)}</span></button>`).join("");
383400
renderRouteNote();
384401
} else {
385-
/* one block per level: what it answers, who built it, and its materials */
386-
shelf.innerHTML = state.levels.map((lv) => {
387-
const items = levelItems(lv.id);
388-
const makers = [...new Set(items.flatMap((r) => r.builders || []))];
389-
const free = items.filter((r) => !r.kind).length;
390-
return `<li class="lv${lv.layer === "build" ? " build" : ""}" data-chap="${lv.id}">
402+
const lv = state.levels.find((x) => x.id === state.level) || state.levels[0];
403+
const items = levelItems(lv.id);
404+
const i = state.levels.indexOf(lv), next = state.levels[i + 1];
405+
shelf.innerHTML = `<li class="lv${lv.layer === "build" ? " build" : ""}" data-chap="${lv.id}">
391406
<div class="lv-head">
392407
<span class="lv-id">${lv.id}</span>
393408
<div class="lv-t"><h3>${esc(lv.name)}<span>${esc(lv.question)}</span></h3><p>${esc(lv.goal)}</p></div>
394-
<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>
395409
</div>
396410
<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>` : ""}
411+
${next ? `<button type="button" class="lv-next" data-step="${next.id}">다음 단계 · ${next.id} ${esc(next.name)} ›</button>` : ""}
398412
</li>`;
399-
}).join("");
400-
$("#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("");
401413
$("#route-note").textContent = "";
402414
}
415+
renderPath();
403416
wireAvatars(shelf);
404417

405418
const repos = [...state.repos.values()].filter((r) => !r.kind && r.status !== "depot");
406419
const depot = [...state.repos.values()].filter((r) => r.status === "depot");
407420
const learnable = repos.filter((r) => (r.lines || []).length);
408421
const done = learnable.filter((r) => state.ridden.has(r.repo)).length;
409-
$("#curriculum-sub").textContent = `L0부터 L4까지, 팀이 만든 레포 ${repos.length}개를 순서대로 엮었습니다. L0–L2는 무료 자료만으로도 끝까지 갈 수 있고, 책과 강의는 더 깊게 보고 싶을 때 고르면 됩니다.`;
422+
$("#curriculum-sub").textContent = `인과추론을 어디서 시작해 어디까지 가면 되는지, 팀이 만든 레포 ${repos.length}개를 다섯 단계로 엮었습니다. L0–L2는 무료 자료만으로도 끝까지 갈 수 있습니다.`;
410423
$("#n-course").textContent = repos.length; $("#n-course").title = `레포 ${repos.length}개`;
411424
$("#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(", ")}`;
412-
shelfSpy();
413425
}
414426

415427
function scrollShelfTo(el, smooth = true) {
@@ -584,7 +596,8 @@
584596
<span class="pc-stats">프로젝트 <b>${p.projects}</b> · 러너 <b>${fmt(p.runners)}</b></span>
585597
${latest ? `<span class="pc-latest">최근 · ${esc(latest.name)}</span>` : ""}</span></button></li>`;
586598
};
587-
$("#people-rail").innerHTML = rest.length ? `<ul class="people-grid">${rest.map((p) => card(p, false)).join("")}</ul>` : "";
599+
/* everyone else: one row of names, each opening that person's history */
600+
$("#people-rail").innerHTML = rest.length ? `<span class="crew-k">함께한 Builder ${rest.length}명</span><ul class="crew">${rest.map((p) => `<li data-line="${p.line}" data-person-row="${esc(p.name)}"><button type="button" data-person="${esc(p.name)}" title="${esc(`${tenure(p)} · 프로젝트 ${p.projects}개`)}">${avatarHTML(p.name, "sm")}<span>${esc(p.name)}</span></button></li>`).join("")}</ul>` : "";
588601

589602
const head = `<div class="ro-head" aria-hidden="true"><span>Builder</span><span>참여한 기수</span><span>최근 프로젝트</span><span class="tot">합계</span></div>`;
590603
$("#roster").innerHTML = head + `<ol class="ro-list">${list.map((p) => `<li class="ro" data-line="${p.line}" data-person-row="${esc(p.name)}">
@@ -596,7 +609,7 @@
596609
wireAvatars($("#top3")); wireAvatars($("#people-rail")); wireAvatars($("#roster"));
597610

598611
const contributors = state.stats.totals && state.stats.totals.contributors;
599-
$("#contrib-sub").textContent = `프로젝트를 여는 사람을 Builder라고 부릅니다. ${list.length}명이 ${cohorts.length}개 기수 동안 프로젝트 ${state.projects.length}개를 열었습니다.${contributors ? ` GitHub 기여자는 ${fmt(contributors)}명입니다.` : ""}`;
612+
$("#contrib-sub").textContent = `프로젝트를 연 사람(Builder) ${list.length}명 가운데 연 프로젝트 수, 그다음 함께한 러너 수가 많은 순입니다. 지금까지 ${cohorts.length}개 기수 동안 프로젝트 ${state.projects.length}개가 열렸습니다.`;
600613
$("#roster-legend").innerHTML = `<li><span class="cc b" data-line="main"><b>8기</b>러너 6</span>Builder로 연 기수와 함께한 러너 수</li><li><span class="cc r" data-line="main"><b>7기</b>러너</span>러너로 참여한 기수</li><li><span class="cc b live" data-line="main"><b>13기</b>진행 중</span>지금 진행 중</li>`;
601614
renderMedalLadder(list);
602615
}
@@ -729,19 +742,20 @@
729742

730743
function gotoLevel(levelId) {
731744
selectTab("tab-course");
732-
if (state.route !== "all") setRoute("all");
733-
$("#curriculum").scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "start" });
734-
scrollShelfTo($(`#shelf [data-chap="${levelId}"]`), false);
745+
state.level = levelId;
746+
if (state.route !== "all") setRoute("all"); else renderShelf();
747+
$("#path").scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "start" });
735748
}
736749

737750
/* Jump to one card on the curriculum shelf and mark it briefly. */
738751
function gotoItem(id) {
739752
closeStation();
740753
selectTab("tab-course");
741754
if (state.route !== "all") setRoute("all");
755+
const r = state.repos.get(id);
756+
if (r && r.level && r.level !== state.level) { state.level = r.level; renderShelf(); }
742757
const el = $(`#shelf .ep[data-id="${CSS.escape(id)}"]`);
743758
if (!el) return;
744-
const block = el.closest(".lv"); if (block) block.classList.add("open");
745759
document.querySelectorAll("#shelf .ep.picked").forEach((x) => x.classList.remove("picked", "flash"));
746760
el.classList.add("picked");
747761
el.scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "center" });
@@ -1360,8 +1374,14 @@
13601374
if (nl) { closeStation(); gotoLevel(nl.dataset.nextLevel); return; }
13611375
const ext = e.target.closest("a[data-post][target=_blank]");
13621376
if (ext) stamp("post");
1363-
const more = e.target.closest("[data-lv-more]");
1364-
if (more) { more.closest(".lv").classList.add("open"); return; }
1377+
const stepBtn = e.target.closest("[data-step]");
1378+
if (stepBtn) {
1379+
state.level = stepBtn.dataset.step;
1380+
track("select_level", { level: state.level, source: stepBtn.classList.contains("lv-next") ? "next" : "path" });
1381+
if (state.route !== "all") setRoute("all"); else renderShelf();
1382+
if (stepBtn.classList.contains("lv-next") || $("#shelf").getBoundingClientRect().top > innerHeight * 0.7) $("#path").scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "start" });
1383+
return;
1384+
}
13651385
const mc = e.target.closest("[data-medal-card]");
13661386
if (mc) { openMedalCard(mc.dataset.medalCard); return; }
13671387
const dl = e.target.closest("[data-card-save]");

0 commit comments

Comments
 (0)