summaryrefslogtreecommitdiffhomepage
path: root/setoka.typ
blob: 5dffea89e5c23da9a2de500f39373417b71c3173 (plain)
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
#import "@preview/touying:0.6.1": *

#let slide(..args) = touying-slide-wrapper(self => {
  let header(self) = {
    set align(top)
    set text(size: 0.3em)
    place(
      left + top,
      dx: 0.7em,
      dy: 0.7em,
      image("./assets/deco.svg", width: 2em, height: 2em),
    )
    place(
      left + top,
      dx: 3em,
      dy: 0.7em,
      image("./assets/deco.svg", width: 1em, height: 1em),
    )
  }
  let footer(self) = {
    set align(bottom)
    set text(fill: self.colors.neutral-darkest, size: 0.3em)
    pad(x: 0.7em, y: 0.7em, {
      h(1fr)
      context utils.slide-counter.display() + " / " + utils.last-slide-number
    })
  }
  self = utils.merge-dicts(
    self,
    config-page(
      header: header,
      footer: footer,
    ),
  )
  touying-slide(self: self, ..args)
})

#let title-slide(..args) = touying-slide-wrapper(self => {
  let info = self.info + args.named()
  let body = {
    set align(center)
    components.cell(
      fill: self.colors.neutral-darkest,
      width: 100%,
      height: 50%,
      inset: 0.5em,
      components.cell(
        width: 80%,
        height: 100%,
        {
          set align(bottom)
          set text(size: 1em, fill: self.colors.neutral-lightest, weight: "bold")
          info.title
        },
      ),
    )
    components.cell(
      width: 100%,
      height: 50%,
      {
        set align(horizon)
        set text(fill: self.colors.neutral-darkest, size: 0.5em)
        if info.author != none {
          block(info.author)
        }
        block()
        if info.subtitle != none {
          block(info.subtitle)
        }
        if info.date != none {
          block(utils.display-info-date(self))
        }
      },
    )
  }
  self = utils.merge-dicts(
    self,
    config-page(
      margin: 0pt,
    ),
  )
  touying-slide(self: self, body)
})

#let about-slide(..args) = slide({
  set align(center + horizon)
  [
    #text(size: 0.4em)[いまむら] \
    #text(size: 0.9em)[nsfisis] \
  ]
  image("./assets/me.svg", width: 2em, height: 2em)
})

#let setoka-theme(
  aspect-ratio: "16-9",
  footer: none,
  ..args,
  body,
) = {
  set text(size: 48pt)

  show: touying-slides.with(
    config-page(
      paper: "presentation-" + aspect-ratio,
      margin: 2em,
    ),
    config-common(
      slide-fn: slide,
      slide-level: 0,
    ),
    config-colors(
      primary: rgb("#ffa500"),
      neutral-lightest: white,
      neutral-darkest: black,
    ),
    ..args,
  )

  body
}