Repository navigation
Expand file tree
/
Copy pathtemplate.typ
More file actions
99 lines (83 loc) · 2.17 KB
/
Copy pathtemplate.typ
File metadata and controls
99 lines (83 loc) · 2.17 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#let colors = (
aircraft: rgb("205c92"),
checklist: rgb("54bcff"),
neutral: rgb("aaaaaa"),
preflight: rgb("e3a21e"),
engine: rgb("a16bcf"),
takeoff: rgb("3bc821"),
landing: rgb("245d90"),
parking: rgb("7fa5c2"),
emergency: rgb("e33e3c"),
)
#let emergency_state = state("emergency", false)
#let checklist(
aircraft: none,
emergency: false,
body,
) = {
set page("a5", margin: (x: 7mm, y: 7mm), columns: 2)
set columns(gutter: 4pt)
set text(font: "Inter", size: 8.5pt)
set par(spacing: 0pt)
emergency_state.update(emergency)
let checklist = if emergency { "Emergency" } else { "Checklist" }
let color1 = if emergency { colors.emergency } else { colors.aircraft }
let color2 = if emergency { colors.emergency } else { colors.checklist }
let header(aircraft) = {
place(
top + center,
scope: "parent",
float: true,
text(size: 1.9em, style: "italic", weight: "black", tracking: .3pt, [
#text(fill: color1, aircraft)
#text(fill: color2, checklist)
]),
)
}
header(aircraft)
body
}
#let section(title, color: none, line-height: 1.6em, body) = {
set par(leading: line-height - 1em)
let stroke = .5pt
let inset = (bottom: 5pt, rest: 4pt)
let color = if color != none {
color
} else {
colors.neutral
}
block(breakable: false)[
#block(width: 100%, stroke: stroke, inset: 4pt, fill: color, align(center)[
#text(fill: rgb("fff"), weight: "bold", tracking: 1pt, upper(title))
])
#block(width: 100%, stroke: stroke, inset: inset, body)
]
}
#let step(a, b) = {
context {
let color = if emergency_state.get() {
colors.emergency
} else {
colors.checklist
}
show emph: it => {
text(size: 0.9em, fill: color, it.body)
}
if a != "" {
text(weight: "light", a)
" "
}
box(width: 1fr, repeat[.])
if b != "" {
" "
text(weight: "medium", b)
}
linebreak()
}
}
#let comment(body) = {
context {
let color = if emergency_state.get() { colors.emergency } else { colors.checklist }
box(width: 100%, inset: (top: 2pt), align(center, text(size: 0.9em, fill: color, weight: "medium", body)))
}
}