Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches: [main]
schedule:
# stats once a week (Monday), the activity feed every day
- cron: "17 0 * * 1"
# stars, contributors and the activity feed every day
- cron: "17 21 * * *"
workflow_dispatch:

Expand All @@ -25,19 +24,12 @@ jobs:
with:
persist-credentials: false

# main is protected, so the bot cannot commit the stats back. They are refreshed into this build on
# every deploy instead; the data/stats.json in the repository is only the fallback.
- name: Refresh GitHub stats
if: github.event_name == 'workflow_dispatch' || github.event.schedule == '17 0 * * 1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 scripts/update_stats.py data/stats.json
if ! git diff --quiet data/stats.json; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add data/stats.json
git commit -m "Update GitHub stats"
git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main
fi
run: python3 scripts/update_stats.py data/stats.json

- name: Build the activity feed
env:
Expand Down
116 changes: 99 additions & 17 deletions assets/css/hub.css
Original file line number Diff line number Diff line change
Expand Up @@ -2798,36 +2798,118 @@ body.has-helper .site-footer { padding-bottom: calc(96px + env(safe-area-inset-b
.hero .banner-side { order: 1; margin-top: 18px; }
.hero .lv-card { order: 2; margin: 14px 0 4px; }
.hero .banner-main > .hero-search { order: 3; }
.hero .banner-main > .partner { order: 4; }
.hero .banner-main > .partner { order: 5; }
.lv-card-t { font-size: 21px; }
}

/* hero materials: a labelled list under the level test, one row per material, icon · what it is · kind */
/* hero materials: a labelled list under the level test, one row per material: icon, what it teaches, where */
.side-k { margin: 6px 4px 2px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .72); }
.hero .banner-side { padding: 14px 10px 10px; gap: 4px; align-items: stretch; }
.hero .featured { gap: 2px; }
.hero .featured a { display: grid; grid-template-columns: 26px minmax(0, 1fr) 14px; align-items: center; column-gap: 12px; padding: 10px 12px; border-radius: 12px; }
.hero .featured .fi { width: 22px; height: 22px; border-radius: 5px; }
.hero .featured .tx { order: 0; gap: 2px; }
.hero .featured .t { font-size: 15.5px; white-space: normal; line-height: 1.3; }
.hero .featured .d { display: block; font-size: 12.5px; white-space: normal; line-height: 1.4; color: rgba(255, 255, 255, .72); }
.hero .featured .tag { display: none; }
.hero .featured .out { order: 0; }
.hero .hero-search { margin-top: 22px; }
.starts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.starts a { display: grid; grid-template-columns: 26px minmax(0, 1fr) 14px; align-items: center; column-gap: 12px; padding: 10px 12px; border-radius: 12px; color: #fff; text-decoration: none; }
.starts a:hover { background: rgba(255, 255, 255, .12); }
.starts a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.starts .fi { width: 22px; height: 22px; border-radius: 5px; }
.starts .tx { display: grid; gap: 2px; min-width: 0; }
.starts .t { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.starts .d { font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .72); }
.starts .out { width: 14px; height: 14px; opacity: .8; }
/* the team's open source in the left column: compact tiles with kind and stars */
.oss { margin-top: 26px; }
.oss-k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 10px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.oss-k b { font-size: 14px; color: #fff; }
.hero .oss .featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.hero .oss .featured a { display: grid; gap: 6px; height: 100%; padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.hero .oss .featured a:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); }
.hero .oss .featured .t { font-size: 14.5px; font-weight: 700; line-height: 1.3; white-space: normal; }
.hero .oss .featured .m { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero .oss .featured .tag { width: auto; padding: 0; background: none; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .7); text-align: left; }
.hero .oss .featured .st { font-size: 12.5px; }
.hero .partner { margin-top: 24px; }
@media (max-width: 860px) {
.hero .banner-side { padding: 12px 6px 6px; }
.hero .featured a { grid-template-columns: 24px minmax(0, 1fr) 14px; padding: 9px 10px; }
.hero .featured .tag { display: none; }
.starts a { grid-template-columns: 24px minmax(0, 1fr) 14px; padding: 9px 10px; }
.hero .banner-main > .oss { order: 4; margin-top: 24px; }
.hero .oss .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* popular topics under the search: words a first-time visitor can start from */
.hs-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; max-width: 560px; }
.hs-pop span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); margin-right: 4px; }
.hs-pop a { font-size: 13.5px; font-weight: 600; color: #fff; text-decoration: none; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .06); }
.hs-pop a:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); }
.hs-pop a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* desktop: the left column runs the full height, the Hanbit block sits at its foot level with the materials */
@media (max-width: 860px) { .hero .banner-main > .hs-pop { order: 3; } }

/* hero, compact pass: shorter lead, a card with the button beside the text, one-line material rows,
one-line open-source tiles, tighter gaps, so the whole hero reads in one look */
.banner-kicker a { display: inline-block; border-radius: 6px; }
.banner-kicker a:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.banner-lede a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .45); text-underline-offset: 4px; }
.banner-lede a:hover { text-decoration-color: #fff; }
.hero .banner { padding: 30px 40px; row-gap: 14px; }
.hero .banner-kicker { margin-bottom: 6px; }
.hero .banner-lede { max-width: 40em; }
.hero .hero-search { margin-top: 18px; }
.hs-pop { margin-top: 10px; }
.lv-card { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k go" "t go" "s s"; column-gap: 14px; row-gap: 2px; padding: 16px 18px 16px 20px; }
.lv-card-k { grid-area: k; }
.lv-card-t { grid-area: t; font-size: 22px; }
.lv-card-s { grid-area: s; margin-top: 4px; font-size: 13.5px; }
.lv-card-go { grid-area: go; align-self: center; margin-top: 0; }
.hero .banner-side { padding: 10px 8px 8px; }
.side-k { margin: 4px 6px 2px; }
.starts a { padding: 8px 10px; }
.starts .tx { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; }
.starts .t { font-size: 15px; }
.starts .d { font-size: 12.5px; }
.oss { margin-top: 20px; }
.oss-k { margin-bottom: 8px; }
.hero .partner { margin-top: 20px; }
@media (max-width: 860px) {
.hero .banner { padding: 24px 20px; }
.lv-card-t { font-size: 20px; }
}
@media (max-width: 420px) { .lv-card { grid-template-areas: "k k" "t t" "s s" "go go"; } .lv-card-go { justify-self: start; margin-top: 8px; } }
.hero .oss .featured a { gap: 4px; padding: 9px 12px; }
.hero .oss .featured .t { font-size: 14px; }
/* materials rows: the main link, then the repository's stars as their own small link */
.starts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; border-radius: 12px; }
.starts li:hover { background: rgba(255, 255, 255, .1); }
.starts a.sm { grid-template-columns: 26px minmax(0, 1fr); }
.starts a.sm:hover { background: none; }
.starts .gh { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; padding: 4px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .9); text-decoration: none; background: rgba(255, 255, 255, .08); font-variant-numeric: tabular-nums; }
.starts .gh svg { width: 12px; height: 12px; color: #FFD54A; }
.starts .gh:hover { background: rgba(255, 255, 255, .2); }
.starts .gh:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hero .oss .featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .hero .oss .featured { grid-template-columns: minmax(0, 1fr); } }
/* tighter hero: the Hanbit label sits beside its cards, the level card and material rows lose spare padding */
@media (min-width: 861px) {
.hero .banner-main { display: flex; flex-direction: column; align-self: stretch; }
.hero .banner-main > .partner { margin-top: auto; padding-top: 22px; }
.hero .oss { margin-top: 20px; }
.hero .oss-k { margin-bottom: 8px; }
.hero .partner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 16px; max-width: none; }
.hero .partner-k { margin: 0; }
.lv-card { padding: 16px 20px; }
.starts a.sm { padding-top: 7px; padding-bottom: 7px; }
}
@media (max-width: 860px) { .hero .banner-main > .hs-pop { order: 3; } }
/* mobile: material rows show titles only and the level card is one row with its button, so the search box
is on the first screen */
@media (max-width: 860px) {
.starts a.sm { padding-top: 9px; padding-bottom: 9px; }
.starts .d { display: none; }
.hero .lv-card { margin: 12px 0 2px; padding: 14px 16px; grid-template-areas: "k go" "t go"; }
.hero .lv-card .lv-card-s { display: none; }
.hero .lv-card .lv-card-go { justify-self: end; margin-top: 0; }
.lv-card-t { font-size: 19px; }
}
/* topic progress: how many of a topic's materials this reader has opened (kept in this browser only) */
.lt-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.lt-p { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-p[hidden] { display: none; }
.lt-p b { font-weight: 750; color: var(--ink); }
.lt-bar { width: 56px; height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.lt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--l-main); }
.lt[data-shelf="exp"] .lt-bar i { background: var(--l-exp); }
.lt.on .lt-n { background: var(--l-main); border-color: var(--l-main); color: #fff; }
.lt[data-shelf="exp"].on .lt-n { background: var(--l-exp); border-color: var(--l-exp); }
.lt-started { font-weight: 700; color: var(--ink); }
Loading