start taking in account feedbacks
All checks were successful
/ test_checkout (push) Successful in 1m50s
All checks were successful
/ test_checkout (push) Successful in 1m50s
This commit is contained in:
parent
0d50644ede
commit
de6359db3f
3 changed files with 354 additions and 192 deletions
|
|
@ -19,6 +19,8 @@ rgb("#E69426"),
|
|||
pirat-color.red,
|
||||
)
|
||||
|
||||
#let etal = [_et al._]
|
||||
|
||||
#let highlight-block(body) = {
|
||||
set text(fill: white)
|
||||
block(
|
||||
|
|
@ -73,22 +75,8 @@ pirat-color.red,
|
|||
}
|
||||
*/
|
||||
|
||||
#let ghost(
|
||||
img, x: 0pt,
|
||||
y: 0pt,
|
||||
mirror: false,
|
||||
rot: 0deg,
|
||||
height: 100pt
|
||||
) = context {
|
||||
let img = image(img, height: height)
|
||||
if mirror {
|
||||
img = scale(x: -100%, img)
|
||||
}
|
||||
if rot != 0deg {
|
||||
img = rotate(rot, img)
|
||||
}
|
||||
|
||||
let s = measure(img)
|
||||
#let place-fg(x: 0pt, y: 0pt, body) = context {
|
||||
let s = measure(body)
|
||||
let hx = s.width / 2
|
||||
let hy = s.height / 2
|
||||
|
||||
|
|
@ -96,10 +84,27 @@ pirat-color.red,
|
|||
bottom + left,
|
||||
dx: x - hx,
|
||||
dy: -y + hy,
|
||||
img
|
||||
body
|
||||
)
|
||||
}
|
||||
|
||||
#let ghost(
|
||||
img, x: 0pt,
|
||||
y: 0pt,
|
||||
mirror: false,
|
||||
rot: 0deg,
|
||||
height: 100pt
|
||||
) = {
|
||||
let img = image(img, height: height)
|
||||
if mirror {
|
||||
img = scale(x: -100%, img)
|
||||
}
|
||||
if rot != 0deg {
|
||||
img = rotate(rot, img)
|
||||
}
|
||||
place-fg(x: x, y: y, img)
|
||||
}
|
||||
|
||||
#let ghost-1 = ghost.with("imgs/ghosts/ghost-1.png")
|
||||
#let ghost-2 = ghost.with("imgs/ghosts/ghost-2.png")
|
||||
#let ghost-3 = ghost.with("imgs/ghosts/ghost-3.png")
|
||||
|
|
@ -111,3 +116,30 @@ pirat-color.red,
|
|||
#let eye-2 = ghost.with("imgs/ghosts/eye-2.png")
|
||||
#let eye-3 = ghost.with("imgs/ghosts/eye-3.png")
|
||||
#let eye-4 = ghost.with("imgs/ghosts/eye-4.png")
|
||||
|
||||
#let arrow(start, end, strk: 3pt + black) = {
|
||||
let strk = stroke(strk)
|
||||
start.at(1) = -start.at(1)
|
||||
end.at(1) = -end.at(1)
|
||||
let (xe, ye) = end
|
||||
let (xs, ys) = start
|
||||
let w = xe.pt() - xs.pt()
|
||||
let h = ye.pt() - ys.pt()
|
||||
let len = if w == 0pt and h == 0pt {
|
||||
1pt
|
||||
} else {
|
||||
calc.sqrt(w*w + h*h)
|
||||
}
|
||||
let cos = w / len
|
||||
let sin = h / len
|
||||
|
||||
place(bottom + left, line(start: start, end: end, stroke: strk))
|
||||
place(bottom + left, polygon(
|
||||
fill: strk.paint,
|
||||
stroke: strk,
|
||||
end,
|
||||
(xe + strk.thickness * (sin - cos), ye - strk.thickness * (sin + cos )),
|
||||
(xe - strk.thickness * (sin + cos), ye - strk.thickness * (sin - cos )),
|
||||
))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue