Compare commits

..

2 Commits

Author SHA1 Message Date
1d1ac0bccf Reorganize 2024-09-18 14:35:23 +02:00
e817ec064f Slides attempt 2024-09-18 14:26:11 +02:00
11 changed files with 89 additions and 0 deletions

View File

@ -17,6 +17,7 @@ git clone <https://url.of/repo.git> ~/.local/share/typst/packages/y-sec
## Templates:
- [Slides](slides)
- [Test écrit](exam) ([exemple](exam/demo.typ), [pdf](exam/demo.pdf))
- [Laboratoire](lab)

81
slides/0.1.0/lib.typ Normal file
View File

@ -0,0 +1,81 @@
#import "@preview/touying:0.5.2": *
#import themes.university: university-theme
#let heig-red = rgb("#e1251b")
#let heig-logo = block(
inset: 10pt,
image("assets/logo.svg", alt: "HEIG-VD", fit: "contain", width: 40%)
)
#let codeframe(title: none, body) = {
let stroke = black + 1pt
let radius = 0.5em
let fill = gray.lighten(90%)
box(stroke: stroke, radius: radius, fill: fill)[
#if title != none {
block(
stroke: stroke,
inset: 0.5em,
below: 0em,
radius: (top-left: radius, bottom-right: radius),
title,
)
}
#block(
width: 100%,
inset: (rest: 0.7em),
body,
)
]
}
#let heig-theme(..args, body) = {
set text(font: "Carlito")
set list(marker: ( text(fill: heig-red, [▪]), [‣], []))
set table(inset: 10pt)
show raw.where(block: true): codeframe
show raw.where(block: false): b => {
set text(fill: heig-red)
h(0.2em) + box(b, outset: (x: 0.2em, y: 0.3em), radius: 0.3em, fill: gray.lighten(70%)) + h(0.2em)
}
show link: lnk => { set text(fill: blue); underline(lnk) }
university-theme(
footer-c: self => {
set text(fill: black)
h(1fr)
utils.display-info-date(self)
h(1fr)
context utils.slide-counter.display() + " / " + utils.last-slide-number
h(1fr)
},
config-colors(
primary: heig-red,
secondary: rgb("#444444"),
tertiary: rgb("#eeeeee")
),
..args,
body
)}
#let note(color: gray, contents) = align(center + horizon, block(radius: 0.7em, fill: color.lighten(30%), inset: 0.5em, contents))
#let danger-sign = polygon.regular(
fill: red.darken(40%),
size: 2.5em,
vertices: 3,
) + place(center, dy: -1em, text(fill: red.lighten(30%), "!") )
#let danger(contents) = note(color: red, grid(columns: (auto, auto), gutter: 0.5em, danger-sign, contents))
#let qmark = circle(text(size: 1.5em, fill: blue.lighten(30%), "?"), fill: blue.darken(50%))
#let question(contents) = note(color: blue, grid(columns: (auto, auto), gutter: 0.5em, qmark, contents))

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

7
slides/0.1.0/typst.toml Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "slides"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["Maxime Augier <max@xolus.net>"]
license = "MIT"
description = "Touying theme based off University"