|
21 | 21 |
|
22 | 22 | const esc = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c])); |
23 | 23 | const fmt = (n) => Number(n).toLocaleString("ko-KR"); |
| 24 | + /* the address printed on share cards: the live hub's host (track.js sets hubSite) */ |
| 25 | + const siteHost = () => { try { return new URL(window.hubSite).host; } catch (e) { return "causalinferencelab.github.io"; } }; |
24 | 26 | const $ = (sel, root = document) => root.querySelector(sel); |
25 | 27 | const dot = (d) => esc(String(d ?? "").replace(/-/g, ".")); |
26 | 28 | /* Data files come from pull requests: links must be http(s) or a site path, ids plain tokens, |
|
647 | 649 | <p class="fc-tier">${esc(lv.tier || lv.name)}</p> |
648 | 650 | ${interest ? `<p class="fc-in"><span>관심</span>${esc(interest)}</p>` : ""} |
649 | 651 | <label class="fc-name"><span>이름이나 닉네임 (선택, 저장하지 않음)</span><input type="text" maxlength="16" autocomplete="nickname" placeholder="예: 진수"></label> |
650 | | - <p class="fc-foot">인과추론 Hub에서 3분 진단 · causalinferencelab.github.io</p> |
| 652 | + <p class="fc-foot">인과추론 Hub에서 3분 진단 · ${esc(siteHost())}</p> |
651 | 653 | </div> |
652 | 654 | <p class="lt-sub">같은 레벨이나 같은 관심 분야인 사람과 이야기를 시작해 보세요. 화면을 켜 둔 채 보여 주면 됩니다.</p></div> |
653 | 655 | <div class="sh-foot"><button type="button" class="btn ghost" data-forum-back>결과로 돌아가기</button><button type="button" class="btn" data-goto-level="${lv.id}" data-test-go>${LV(lv.id)} 코스로 이동</button></div>`; |
|
1628 | 1630 | if (name) { c.fillStyle = "#fff"; c.font = font(700, 34); c.fillText(name, 80, H - 104); } |
1629 | 1631 | c.fillStyle = "rgba(255,255,255,.7)"; c.font = font(500, 24); |
1630 | 1632 | const d = new Date(), date = `${d.getFullYear()}.${pad2(d.getMonth() + 1)}.${pad2(d.getDate())}`; |
1631 | | - c.fillText(`${date} · causalinferencelab.github.io`, 80, H - 60); |
| 1633 | + c.fillText(`${date} · ${siteHost()}`, 80, H - 60); |
1632 | 1634 | const mark = $(".banner-mark"); |
1633 | 1635 | if (mark && mark.complete && mark.naturalWidth) c.drawImage(mark, W - 300, 70, 210, 210); |
1634 | 1636 | } |
|
1672 | 1674 | c.fillStyle = "#fff"; c.font = font(700, 24); c.fillText(m.name, x + 56, y + 9); |
1673 | 1675 | }); |
1674 | 1676 | c.fillStyle = "rgba(255,255,255,.7)"; c.font = font(500, 22); |
1675 | | - c.fillText(`causalinferencelab.github.io/builders/${info.slug || ""}`, 80, H - 56); |
| 1677 | + c.fillText(`${siteHost()}/builders/${info.slug || ""}`, 80, H - 56); |
1676 | 1678 | drawMedal(c, 930, 330, 150, t, p.cohorts.length); |
1677 | 1679 | } |
1678 | 1680 | async function openMedalCard(name) { |
|
0 commit comments