Files

100 lines
2.2 KiB
Typst

#import "@preview/touying:0.6.2": *
#import "@preview/touying-unistra-pristine:1.4.3": *
// Redefine to allow extra-body
#let title-slide(
title: "",
subtitle: "",
logo: "",
logos: (),
hide: (),
extra-body: [],
..args,
) = touying-slide-wrapper(self => {
let info = self.info + args.named()
let nb-logos = logos.len()
if logo != "" and nb-logos > 0 {
panic("'logo' and 'logos' cannot be set at the same time.")
}
let logo-body = none
if nb-logos == 0 {
logo-body = logo
} else {
logo-body = grid(
columns: if nb-logos > 0 {
nb-logos
} else {
1
},
..(logos).map(logo => logo),
)
}
let body = {
set text(fill: white)
set block(inset: 0mm, outset: 0mm, spacing: 0em)
set align(top + left)
_gradientize(
self,
block(
fill: none,
width: 100%,
height: 100%,
inset: (left: 2em, top: 1em),
grid(
columns: 1fr,
rows: (6em, 6em, 4em, 4em),
logo-body,
_cell([
#text(size: 2em, weight: "bold", if (title != "") {
title
} else {
info.title
})
#linebreak()
#text(size: 1.7em, weight: "regular", if (subtitle != "") {
subtitle
} else {
info.subtitle
})
]),
_cell([
#if ((none, "").all(x => x != info.subtitle)) {
linebreak()
}
#set text(size: 1.5em, fill: self.colors.white)
#text(weight: "bold", info.author)
#if "email" in info {
linebreak()
text(info.email, size: 0.8em)
}
]),
if "date" not in hide {
_cell([
#set text(fill: self.colors.white.transparentize(25%))
#utils.display-info-date(self)
])
},
),
),
c1: self.colors.nblue.E,
c2: self.colors.cyan.E,
)
}
self = utils.merge-dicts(
self,
config-common(freeze-slide-counter: true),
config-page(margin: 0em),
config-common(subslide-preamble: none),
)
touying-slide(
self: self,
body + extra-body,
)
})