diff --git a/html/ProgressHeader.html b/html/ProgressHeader.html index 8d6b85a..d8d931b 100644 --- a/html/ProgressHeader.html +++ b/html/ProgressHeader.html @@ -16,6 +16,7 @@ h3 { margin: 0; } table { border-spacing: 0; } + a.cell { text-decoration: none; } .cell { display: flex; flex-direction: column; diff --git a/scripts/build-table b/scripts/build-table index fbe3e70..2e42dd4 100755 --- a/scripts/build-table +++ b/scripts/build-table @@ -34,13 +34,14 @@ let interpColor = {|p| let viz = { |k, n, cell| let ratio = $k / $n let percent = $ratio * 100 | math round --precision 1 - let color = if $n == 0 { "gray" } else { do $interpColor $ratio } - let textColor = if $k == $n { "gold" } else { "white" } + let bgColorOpacity = if $k == 0 { 50 } else { 100 } + let bgColor = if ($n == 0 or $k == 0) { "gray" } else { $"color-mix\(in srgb, (do $interpColor $ratio) ($bgColorOpacity)%, transparent\)" } + let textColor = if $k == $n { "gold" } else if $k == 0 { "lightgray" } else { "white" } let isExercise = $cell.0.section == "Exercise" let percentStr = $"($percent)%" $"
($k) / ($n) @@ -57,15 +58,16 @@ let vizCh = { |n, table| let percent = ($ratio * 100 | math round --precision 1) let color = if $n == 0 { "gray" } else { do $interpColor $ratio } let textColor = if $completed == $total { "gold" } else { "white" } + let url = $"https://git.mzhang.io/school/type-theory/issues/($chapters | get $n)" - $"
+ \" href=\"($url)\" target=\"_blank\">

($n)

($completed) / ($total) ($percent)% -
" | str replace -a "\n" "" + " | str replace -a "\n" "" } let vizChapter = { |n|