added badge in progress

This commit is contained in:
Louis Heredero 2024-12-03 11:09:25 +01:00
parent 95981a219a
commit 66f04ed889
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
4 changed files with 36 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -10,4 +10,10 @@
}
return p
})
#make-progress(links: false)
#make-progress(
links: false,
badge: (
name: "LordBaryhobal",
img: image("res/me.jpg", width: 3em)
)
)

BIN
res/me.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB

View File

@ -122,7 +122,30 @@
)
}
#let make-progress(links: true) = context {
#let make-badge(name, img) = {
let img = scale(3em, img, reflow: true)
box(
grid(
columns: 2,
align: center + horizon,
column-gutter: 0.4em,
[*#name*],
box(
img,
radius: 1.5em,
clip: true
)
),
fill: green.lighten(50%),
inset: (left: 0.8em),
radius: 1.5em
)
}
#let make-progress(
links: true,
badge: none
) = context {
let stars = star-state.final()
let star-cnt = stars.values().sum(default: 0)
let first-weekday = datetime(
@ -149,7 +172,11 @@
cells.push(cell)
}
[*Stars: #star-cnt / 50*]
let badge = if badge != none {
make-badge(badge.name, badge.img)
}
[*Stars: #star-cnt / 50*#h(1fr)#badge]
table(
columns: (1fr,)*7,
inset: 0.8em,