Skip to content

Commit

Permalink
themes: update university and dewdrop themes
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed Mar 25, 2024
1 parent a1fd214 commit 8a81348
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
3 changes: 2 additions & 1 deletion themes/dewdrop.typ
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
set text(fill: self.colors.neutral-darkest)
show heading: set text(fill: self.colors.primary)
show: args.named().at("setting", default: body => body)
if self.auto-heading and subsection != none {
if self.auto-heading-for-subsection and subsection != none {
heading(level: 1, subsection)
}
if self.auto-heading and title != none {
Expand Down Expand Up @@ -252,6 +252,7 @@
self.d-footer-right = footer-right
self.d-alpha = alpha
self.auto-heading = true
self.auto-heading-for-subsection = true
self.outline-title = [Outline]
// set page
let header(self) = {
Expand Down
59 changes: 36 additions & 23 deletions themes/university.typ
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,28 @@

#let slide(
self: none,
title: none,
subtitle: none,
header: none,
title: auto,
subtitle: auto,
header: auto,
footer: auto,
display-current-section: auto,
..args,
) = {
if title != auto {
self.uni-title = title
}
self.uni-header = self => {
if header != none {
header
} else if title != none {
block(inset: (x: .5em),
grid(
columns: 1,
gutter: .3em,
grid(
columns: (auto, 1fr, auto),
align(top + left, heading(level: 2, text(fill: self.colors.primary, title))),
[],
align(top + right, text(fill: self.colors.primary.lighten(65%), states.current-section-title))
),
text(fill: self.colors.primary.lighten(65%), size: .8em, subtitle)
)
)
}
if subtitle != auto {
self.uni-subtitle = subtitle
}
if header != auto {
self.uni-header = header
}
if footer != auto {
self.uni-footer = footer
}
if display-current-section != auto {
self.uni-display-current-section = display-current-section
}
(self.methods.touying-slide)(
..args.named(),
self: self,
Expand Down Expand Up @@ -182,6 +173,7 @@
self: s,
aspect-ratio: "16-9",
progress-bar: true,
display-current-section: true,
footer-columns: (25%, 1fr, 25%),
footer-a: self => self.info.author,
footer-b: self => if self.info.short-title == auto { self.info.title } else { self.info.short-title },
Expand Down Expand Up @@ -210,21 +202,42 @@
components.cell(fill: self.colors.tertiary)
)
})
self.uni-header = none
self.uni-display-current-section = display-current-section
self.uni-title = none
self.uni-subtitle = none
self.uni-footer = self => {
let cell(fill: none, it) = rect(
width: 100%, height: 100%, inset: 1mm, outset: 0mm, fill: fill, stroke: none,
align(horizon, text(fill: white, it))
)
show: block.with(width: 100%, height: auto, fill: self.colors.secondary)
grid(
columns: (25%, 1fr, 25%),
columns: footer-columns,
rows: (1.5em, auto),
cell(fill: self.colors.primary, utils.call-or-display(self, footer-a)),
cell(fill: self.colors.secondary, utils.call-or-display(self, footer-b)),
cell(fill: self.colors.tertiary, utils.call-or-display(self, footer-c)),
)
}
self.uni-header = self => {
if self.uni-title != none {
block(inset: (x: .5em),
grid(
columns: 1,
gutter: .3em,
grid(
columns: (auto, 1fr, auto),
align(top + left, heading(level: 2, text(fill: self.colors.primary, self.uni-title))),
[],
if self.uni-display-current-section {
align(top + right, text(fill: self.colors.primary.lighten(65%), states.current-section-title))
}
),
text(fill: self.colors.primary.lighten(65%), size: .8em, self.uni-subtitle)
)
)
}
}
// set page
let header(self) = {
set align(top)
Expand Down

0 comments on commit 8a81348

Please sign in to comment.