This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
abstractions.typ
82 lines (73 loc) · 1.85 KB
/
abstractions.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#import "colors.typ" : *
#let cell = rect.with(
height: 25pt,
inset: 12pt,
width: 130%,
stroke: none,
)
#let column_width = (5%, 5%, 35%, 15%, 25%)
#let row_header_content(_text, size:1.3em) = {
cell(
fill: none,
text(weight: "semibold", size:size, fill: black)[#_text],
)
}
#let pick_color(tier: "") = {
let c = black
if (tier == "b") {c = AC_BRONZE}
if (tier == "s") {c = AC_SILVER}
if (tier == "g") {c = AC_GOLD}
if (tier == "p") {c = AC_PLATINUM}
if (tier == "d") {c = AC_DIAMOND}
if (tier == "r") {c = AC_RUBY}
return c
}
#let row_content(_text, tier: "", mono: false) = {
let c = pick_color(tier: tier)
let w = "regular"
if (tier != "") {w = "bold"}
cell(
if (mono == true) {text(font: "Pretendard", size: 15pt, fill: c)[#_text]}
else {text(weight: w, size: 15pt, fill: c)[#_text]}
)
}
#let row_header(args) = {
align(center)[
#grid(
columns: column_width,
row_header_content("🦆", size:2.5em),
row_header_content("🪿", size:2.5em),
row_header_content("문제"),
row_header_content("의도한 난이도"),
row_header_content("출제자")
)
]
line(length: 100%)
v(1em)
}
#let row_contents(problem) = {
align(center)[
#grid(
columns: column_width,
row_content(problem.d2),
row_content(problem.d1),
align(left)[#row_content(problem.title)],
align(left)[#row_content(problem.difftext, tier: problem.diff)],
align(left)[#row_content(h(2em) + problem.setter.map(setter => {
setter.at(0)
}).join(", "), mono: true)],
)
]
}
#let abstract_page(problems: ()) = {
align(horizon)[
#grid(
columns: (100%),
row_header(("🪿", "🦆", "문제", "의도한 난이도", "출제자")),
..problems.map(problem => {
row_contents(problem)
})
)
]
pagebreak(weak: true)
}