-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
box.typ
163 lines (146 loc) · 2.99 KB
/
box.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#import "data.typ": *
#import "@preview/boxr:0.1.0": *
#let a_size(exponent) = {
let a0_size = (841mm, 1189mm)
for i in range(exponent) {
let last_a_size = a0_size
a0_size = (last_a_size.at(1) / 2, last_a_size.at(0))
}
return a0_size
}
#let calculate_smallest_a_size(width, height) = {
let current_a_size = 0
let current_size = a_size(current_a_size)
while (width < current_size.at(1) and height < current_size.at(0)) {
current_a_size = current_a_size + 1
current_size = a_size(current_a_size)
}
return current_a_size - 1
}
#let card_amount = card_count
#let card_thickness = 1mm
#let structure_args = (
width: card_thickness * card_amount,
height: card_height + 5mm,
depth: card_width + 5mm,
lid-size: card_height * 0.4,
tab-size: 25pt,
)
#let size = get-structure-size(
json("box_lid.json"),
..structure_args
)
#let total_width = size.at(0)
#let total_height = size.at(1)
#let next_biggest_a_size = str(calculate_smallest_a_size(total_width, total_height))
#set page(
fill: gray,
"a" + next_biggest_a_size,
flipped: true,
margin: 0%,
)
#set text(font: "Inter Tight", fill: white, size: 4em)
#place(top + center, dx: 5mm, dy: 5mm)[
#set text(size: 0.5em, fill: black)
Print on A#next_biggest_a_size paper for correct scaling
]
#set align(center + horizon)
#render-structure(
json("box_lid.json"),
..structure_args,
color: black,
cut-stroke: (thickness: 1pt, paint: white, dash: "dashed"),
fold-stroke: 0.3pt + gray,
[
//front
#rotate(180deg)[
#v(card_height * 0.4)
#set text(size: 0.15em)
#logo(banner: true)
]
],
[
//top
#rotate(180deg)[
#set text(size: 0.15em)
#logo()
]
],
[
//left
#set text(size: 0.1em)
#place(
center + horizon,
dy: -8em,
)[
#logo()
]
#place(
center + bottom,
dy: -23mm,
)[
#box(width: 100%, height: 6.3em, fill: gradient.linear(white, black))
]
],
[
//right
#set text(size: 0.1em)
#place(
center + horizon,
dy: -8em,
)[
#logo()
]
#place(
center + bottom,
dy: -23mm,
)[
#box(width: 100%, height: 6.3em, fill: gradient.linear(black, white))
]
],
[
//back
#set text(
size: 0.18em,
fill: white
)
#set align(left + top)
#box(
height: 45%,
inset: (
top: 3em,
left: 3em,
right: 3em
)
)[
#set par(justify: true)
#columns(2, gutter: 3em)[
#text(size: 1.2em)[
#outline_text
]
]
]
#v(1fr)
#box(
inset: (
left: 3em,
right: 3em
)
)[
3-#player_count players#h(1fr)Ages: 12+#h(1fr)Playtime: 30-60 min.#h(1fr)Contains: #card_amount cards
]
#v(1fr)
#set text(size: 0.8em)
#set align(center)
#icon_banner
#v(23mm)
#place(
center + bottom,
dy: -10mm,
[
Game of Intrigue - Version #version\
Lyx Rothböck 2024\
]
)
]
)