|
1 | | -#let cover(ctx: (:)) = {} |
| 1 | +#import "./colors.typ": * |
2 | 2 |
|
3 | | -#let frontmatter-entry(ctx: (:), body) = { |
| 3 | +#let entry-type-metadata = ( |
| 4 | + identify: ( |
| 5 | + color: red, |
| 6 | + text: "Identify", |
| 7 | + ), |
| 8 | + brainstorm: ( |
| 9 | + color: orange, |
| 10 | + text: "Brainstorm", |
| 11 | + ), |
| 12 | + decide: ( |
| 13 | + color: yellow, |
| 14 | + text: "Solution", |
| 15 | + ), |
| 16 | + build: ( |
| 17 | + color: green, |
| 18 | + text: "Build", |
| 19 | + ), |
| 20 | + program: ( |
| 21 | + color: blue, |
| 22 | + text: "Program", |
| 23 | + ), |
| 24 | + test: ( |
| 25 | + color: purple, |
| 26 | + text: "Test", |
| 27 | + ), |
| 28 | + reflection: ( |
| 29 | + color: pink, |
| 30 | + text: "Reflection", |
| 31 | + ), |
| 32 | + management: ( |
| 33 | + color: brown, |
| 34 | + text: "Management", |
| 35 | + ), |
| 36 | + strategy: ( |
| 37 | + color: gray, |
| 38 | + text: "Strategy", |
| 39 | + ), |
| 40 | +) |
| 41 | + |
| 42 | +#let heading-text-size = 14pt |
| 43 | + |
| 44 | +#let cover( |
| 45 | + ctx: (:), |
| 46 | +) = { } |
| 47 | + |
| 48 | +#let frontmatter-entry( |
| 49 | + ctx: (:), |
| 50 | + body, |
| 51 | +) = { |
4 | 52 | show: page.with( |
5 | | - margin: ( |
6 | | - top: 5em, |
7 | | - ), |
8 | | - header: { |
9 | | - place(top + right, dx: 100pt, box(width: 250%, height: 100%, fill: gray)) |
10 | | - set align(center + horizon) |
11 | | - box(radius: 0.3em, width: 200pt, outset: 9pt, fill: gray.darken(20%), [*#ctx.title*]) |
12 | | - } |
| 53 | + margin: ( |
| 54 | + top: 5em, |
| 55 | + ), |
| 56 | + header: { |
| 57 | + // background bar |
| 58 | + place( |
| 59 | + top + right, |
| 60 | + dx: 100pt, |
| 61 | + box( |
| 62 | + width: 250%, |
| 63 | + height: 100%, |
| 64 | + fill: surface-0, |
| 65 | + ), |
| 66 | + ) |
| 67 | + // the other thing |
| 68 | + set align(center + horizon) |
| 69 | + box( |
| 70 | + radius: 0.3em, |
| 71 | + width: 200pt, |
| 72 | + outset: 9pt, |
| 73 | + fill: surface-1, |
| 74 | + text( |
| 75 | + size: heading-text-size, |
| 76 | + weight: "bold", |
| 77 | + ctx.title, |
| 78 | + ), |
| 79 | + ) |
| 80 | + }, |
13 | 81 | ) |
14 | 82 |
|
15 | 83 | body |
16 | 84 | } |
17 | 85 |
|
18 | | -#let body-entry(ctx: (:), body) = { |
| 86 | +#let body-entry( |
| 87 | + ctx: (:), |
| 88 | + body, |
| 89 | +) = { |
| 90 | + let metadata = entry-type-metadata.at(ctx.type) |
19 | 91 | show: page.with( |
20 | | - header: [ = #ctx.title |
21 | | - #box(width: 1fr, line(length: 100%)) ], |
22 | | - footer: align(center, counter(page).display()), |
| 92 | + header: { |
| 93 | + // background bar |
| 94 | + place( |
| 95 | + top + left, |
| 96 | + dx: -100pt, |
| 97 | + box( |
| 98 | + width: 250%, |
| 99 | + height: 100%, |
| 100 | + fill: metadata.color.lighten(60%), |
| 101 | + ), |
| 102 | + ) |
| 103 | + // edp box |
| 104 | + place( |
| 105 | + horizon + left, |
| 106 | + box( |
| 107 | + radius: 0.3em, |
| 108 | + outset: 9pt, |
| 109 | + width: 90pt, |
| 110 | + fill: metadata.color, |
| 111 | + align( |
| 112 | + center, |
| 113 | + text( |
| 114 | + size: 14pt, |
| 115 | + weight: "bold", |
| 116 | + metadata.text, |
| 117 | + ), |
| 118 | + ), |
| 119 | + ), |
| 120 | + ) |
| 121 | + // title |
| 122 | + set align(center + horizon) |
| 123 | + text( |
| 124 | + weight: "bold", |
| 125 | + size: 14pt, |
| 126 | + ctx.title, |
| 127 | + ) |
| 128 | + }, |
| 129 | + footer: { |
| 130 | + place( |
| 131 | + dx: -50pt, |
| 132 | + box( |
| 133 | + fill: surface-0, |
| 134 | + width: 200%, |
| 135 | + height: 100%, |
| 136 | + ), |
| 137 | + ) |
| 138 | + set align(horizon + center) |
| 139 | + grid( |
| 140 | + columns: ( |
| 141 | + 1fr, |
| 142 | + 1fr, |
| 143 | + 1fr, |
| 144 | + ), |
| 145 | + [*Name* #h(5pt) #ctx.author], |
| 146 | + [*Date* #h(5pt) #ctx.date.display("[month]/[day]/[year]")], |
| 147 | + [*Page* #h(5pt) #context counter(page).display()], |
| 148 | + ) |
| 149 | + }, |
23 | 150 | ) |
24 | 151 |
|
25 | 152 | body |
26 | 153 | } |
27 | | -#let appendix-entry(ctx: (:), body) = { |
28 | | - show: page.with( |
29 | | - header: [ = #ctx.title |
30 | | - #box(width: 1fr, line(length: 100%)) ], |
31 | | - footer: align(center, counter(page).display()), |
32 | | - ) |
33 | 154 |
|
34 | | - body |
| 155 | +#let appendix-entry( |
| 156 | + ctx: (:), |
| 157 | + body, |
| 158 | +) = { |
| 159 | + frontmatter-entry( |
| 160 | + ctx: ctx, |
| 161 | + body, |
| 162 | + ) |
35 | 163 | } |
0 commit comments