From b73d5f2d9bf70af4c0748be5313317aa2b4d61be Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sat, 15 Aug 2026 12:08:10 +0200 Subject: [PATCH] Adds themes --- chapters/schools/heavy_weapon_specialist.typ | 28 +- setup/model.typ | 1 - setup/school_model.typ | 414 +++++++++---------- setup/setup.typ | 4 +- setup/themes.typ | 53 +++ 5 files changed, 267 insertions(+), 233 deletions(-) create mode 100644 setup/themes.typ diff --git a/chapters/schools/heavy_weapon_specialist.typ b/chapters/schools/heavy_weapon_specialist.typ index b009f1a..7e31556 100644 --- a/chapters/schools/heavy_weapon_specialist.typ +++ b/chapters/schools/heavy_weapon_specialist.typ @@ -1,24 +1,8 @@ -#import "../../setup/setup.typ": school_techniques, school_presentation -#school_presentation(( - title: "Spécialiste des Armes Lourdes", - illustration: "../images/schools/specialiste_armes_lourdes.jpg", - radar: "../images/icons/nodata.png", +#import "../../setup/setup.typ": school_presentation +#school_presentation((title: "Spécialiste des Armes Lourdes", illustration: "../images/schools/specialiste_armes_lourdes.jpg", radar: "../images/icons/nodata.png", description: [ + Excelle à infliger de lourds dégâts et à incapaciter ses cibles. - description: [ - Excelle à infliger de lourds dégâts et à incapaciter ses cibles. + Le Spécialiste des Armes Lourdes souffre d'importants problèmes de manœuvrabilité et de défense, qu'il compense par ses grandes capacités de contrôle. - Le Spécialiste des Armes Lourdes souffre d'importants problèmes de manœuvrabilité et de défense, qu'il compense par ses grandes capacités de contrôle. - - Capable de manier les armes les plus imposantes comme les plus saugrenues, le Spécialiste des Armes Lourdes n'est jamais vraiment désarmé. - ], - - mechanic: [Delicate Destruction], - difficulty: 1.5, -)) - -#pagebreak() - - -=== Techniques - -#school_techniques("../data/src/schools/heavy_weapon_specialist.tsv") + Capable de manier les armes les plus imposantes comme les plus saugrenues, le Spécialiste des Armes Lourdes n'est jamais vraiment désarmé. +], mechanic: [Delicate Destruction], difficulty: 1, techniques: "../data/src/schools/heavy_weapon_specialist.tsv")) diff --git a/setup/model.typ b/setup/model.typ index 75a2836..2ecd2c7 100644 --- a/setup/model.typ +++ b/setup/model.typ @@ -6,7 +6,6 @@ #import "school_model.typ" as model // Re-export models -#let school_techniques = model.techniques #let school_presentation = model.school_presentation #let model( diff --git a/setup/school_model.typ b/setup/school_model.typ index 4a78116..52bf0f8 100644 --- a/setup/school_model.typ +++ b/setup/school_model.typ @@ -1,21 +1,14 @@ +#import "themes.typ": make-theme // ----------------------------------------------------------------------------- // Class presentation — Fantasy Codex // ----------------------------------------------------------------------------- - -#let ink = rgb("#302c26") -#let muted-ink = rgb("#716957") -#let gold = rgb("#9b8050") -#let dark-gold = rgb("#70582f") -#let parchment = rgb("#f7f3e9") -#let parchment-dark = rgb("#ece4d2") -#let parchment-light = rgb("#fbf9f3") -#let border = rgb("#c9bda4") +#let theme = make-theme(name: "warm") #let fantasy-label(body) = { text( size: 7.5pt, weight: "bold", - fill: dark-gold, + fill: theme.dark-gold, tracking: 0.12em, )[ #body ] } @@ -23,7 +16,7 @@ #let fantasy-rule() = { line( length: 100%, - stroke: 0.65pt + border, + stroke: 0.65pt + theme.border, ) } @@ -33,186 +26,6 @@ body } -#let school_presentation(class_info) = { - set text( - font: "Libertinus Serif", - fill: ink, - ) - - // --------------------------------------------------------------------------- - // Header - // --------------------------------------------------------------------------- - - align(center)[ - #text( - size: 20pt, - weight: "bold", - fill: ink, - )[ - - - == #class_info.title - - ] - - #v(0.35em) - - // Ornamental divider - #grid( - columns: (1fr, auto, 1fr), - column-gutter: 0.55em, - align: horizon, - )[ - #line( - length: 100%, - stroke: 0.7pt + border, - ) - ][ - #text( - size: 10pt, - fill: gold, - )[◆] - ][ - #line( - length: 100%, - stroke: 0.7pt + border, - ) - ] - ] - - v(1em) - - // --------------------------------------------------------------------------- - // Illustration + introduction - // --------------------------------------------------------------------------- - - grid( - columns: (1.05fr, 1.7fr), - column-gutter: 1.3em, - align: top, - // Illustration - [ - #block( - fill: parchment-dark, - stroke: 0.8pt + border, - inset: 0.3em, - )[ - #block( - clip: true, - stroke: 0.5pt + rgb("#b6a98e"), - )[ - #image( - class_info.illustration, - width: 100%, - ) - ] - ] - ], // Description - [ - #fantasy-section("PRÉSENTATION")[ - #text( - size: 10.2pt, - // leading: 1.35em, - )[ - #class_info.description - ] - ] - ], - ) - - v(1em) - - // --------------------------------------------------------------------------- - // Class profile - // --------------------------------------------------------------------------- - - fantasy-rule() - - v(0.7em) - - grid( - columns: (1fr, 1.35fr), - column-gutter: 1.2em, - align: top, - // ------------------------------------------------------------------------- - // Profile / radar - // ------------------------------------------------------------------------- - [ - #block( - fill: parchment, - stroke: 0.7pt + border, - inset: 0.65em, - )[ - #align(center)[ - #fantasy-section("PROFIL")[ - #image( - class_info.radar, - width: 82%, - ) - ] - ] - ] - ], // ------------------------------------------------------------------------- - // Mechanics - // ------------------------------------------------------------------------- - [ // Exclusive mechanic - #block( - fill: parchment-dark, - stroke: 0.8pt + gold, - inset: (x: 0.8em, y: 0.65em), - )[ - #grid( - columns: (auto, 1fr), - column-gutter: 0.5em, - align: horizon, - )[ - #text( - size: 10pt, - fill: gold, - )[◆] - ][ - #fantasy-label("MÉCANIQUE EXCLUSIVE") - ] - - #v(0.4em) - - #text( - size: 13pt, - weight: "bold", - fill: ink, - )[ - #class_info.mechanic - ] - ] - - #v(0.7em) - - #grid( - columns: (1fr, auto), - align: horizon, - )[ - #fantasy-label("DIFFICULTÉ") - ][ - #grid( - // columns: repeat(5, 0.7em), - column-gutter: 0.25em, - )[ - #for i in range(5) { - if class_info.difficulty >= i + 1 { - text(size: 9pt, fill: dark-gold)[●] - } else if class_info.difficulty >= i + 0.5 { - text(size: 9pt, fill: dark-gold)[◐] - } else { - text(size: 9pt, fill: border)[○] - } - } - ] - ]] - ) - - v(1em) -} - // ============================================================================= // Technique TSV importer // @@ -432,7 +245,7 @@ fill: white, stroke: ( top: 0pt, - bottom: 0.6pt + border, + bottom: 0.6pt + theme.border, ), inset: ( x: 5pt, @@ -447,13 +260,13 @@ #text( size: 7.5pt, weight: "bold", - fill: gold, + fill: theme.gold, )[◆] ][ #text( size: 8.5pt, weight: "bold", - fill: dark-gold, + fill: theme.dark-gold, tracking: 0.08em, )[ TIER #tier @@ -466,7 +279,7 @@ // ------------------------------------------------------------------------- table.header( table.cell( - fill: dark-gold, + fill: theme.dark-gold, inset: ( x: 4pt, y: 2pt, @@ -475,13 +288,13 @@ #text( size: 7.2pt, weight: "bold", - fill: parchment-light, + fill: theme.parchment-light, )[Technique] ], ), table.cell( - fill: dark-gold, + fill: theme.dark-gold, inset: ( x: 2pt, y: 2pt, @@ -490,13 +303,13 @@ #text( size: 7.2pt, weight: "bold", - fill: parchment-light, + fill: theme.parchment-light, )[Niv] ], ), table.cell( - fill: dark-gold, + fill: theme.dark-gold, inset: ( x: 4pt, y: 2pt, @@ -505,13 +318,13 @@ #text( size: 7.2pt, weight: "bold", - fill: parchment-light, + fill: theme.parchment-light, )[Type] ], ), table.cell( - fill: dark-gold, + fill: theme.dark-gold, inset: ( x: 2pt, y: 2pt, @@ -520,13 +333,13 @@ #text( size: 7.2pt, weight: "bold", - fill: parchment-light, + fill: theme.parchment-light, )[Coût] ], ), table.cell( - fill: dark-gold, + fill: theme.dark-gold, inset: ( x: 4pt, y: 2pt, @@ -535,7 +348,7 @@ #text( size: 7.2pt, weight: "bold", - fill: parchment-light, + fill: theme.parchment-light, )[Effet] ], ), @@ -547,9 +360,9 @@ let cells = technique-row(row) let fill = if calc.even(index) { - parchment-light + theme.parchment-light } else { - parchment + theme.parchment } cells.enumerate().map(((column, content)) => { @@ -557,7 +370,7 @@ fill: fill, stroke: ( - bottom: 0.3pt + border, + bottom: 0.3pt + theme.border, ), inset: ( @@ -573,7 +386,7 @@ // TODO: EXTRACT THIS MAGIC VALUE #text( size: 10pt, - fill: ink, + fill: theme.ink, )[ #content ] @@ -678,3 +491,188 @@ } } } + +#let school_presentation(class_info) = { + set text( + font: "Libertinus Serif", + fill: theme.ink, + ) + + // --------------------------------------------------------------------------- + // Header + // --------------------------------------------------------------------------- + + align(center)[ + #text( + size: 20pt, + weight: "bold", + fill: theme.ink, + )[ + + + == #class_info.title + + ] + + #v(0.35em) + + // Ornamental divider + #grid( + columns: (1fr, auto, 1fr), + column-gutter: 0.55em, + align: horizon, + )[ + #line( + length: 100%, + stroke: 0.7pt + theme.border, + ) + ][ + #text( + size: 10pt, + fill: theme.gold, + )[◆] + ][ + #line( + length: 100%, + stroke: 0.7pt + theme.border, + ) + ] + ] + + v(1em) + + // --------------------------------------------------------------------------- + // Illustration + introduction + // --------------------------------------------------------------------------- + + grid( + columns: (1.05fr, 1.7fr), + column-gutter: 1.3em, + align: top, + // Illustration + [ + #block( + fill: theme.parchment-dark, + stroke: 0.8pt + theme.border, + inset: 0.3em, + )[ + #block( + clip: true, + stroke: 0.5pt + rgb("#b6a98e"), + )[ + #image( + class_info.illustration, + width: 100%, + ) + ] + ] + ], // Description + [ + #fantasy-section("PRÉSENTATION")[ + #text( + size: 10.2pt, + // leading: 1.35em, + )[ + #class_info.description + ] + ] + ], + ) + + v(1em) + + // --------------------------------------------------------------------------- + // Class profile + // --------------------------------------------------------------------------- + + fantasy-rule() + + v(0.7em) + + grid( + columns: (1fr, 1.35fr), + column-gutter: 1.2em, + align: top, + // ------------------------------------------------------------------------- + // Profile / radar + // ------------------------------------------------------------------------- + [ + #block( + fill: theme.parchment, + stroke: 0.7pt + theme.border, + inset: 0.65em, + )[ + #align(center)[ + #fantasy-section("PROFIL")[ + #image( + class_info.radar, + width: 82%, + ) + ] + ] + ] + ], // ------------------------------------------------------------------------- + // Mechanics + // ------------------------------------------------------------------------- + [ // Exclusive mechanic + #block( + fill: theme.parchment-dark, + stroke: 0.8pt + theme.gold, + inset: (x: 0.8em, y: 0.65em), + )[ + #grid( + columns: (auto, 1fr), + column-gutter: 0.5em, + align: horizon, + )[ + #text( + size: 10pt, + fill: theme.gold, + )[◆] + ][ + #fantasy-label("MÉCANIQUE EXCLUSIVE") + ] + + #v(0.4em) + + #text( + size: 13pt, + weight: "bold", + fill: theme.ink, + )[ + #class_info.mechanic + ] + ] + + #v(0.7em) + + #grid( + columns: (1fr, auto), + align: horizon, + )[ + #fantasy-label("DIFFICULTÉ") + ][ + #grid( + // columns: repeat(5, 0.7em), + column-gutter: 0.25em, + )[ + #for i in range(5) { + if class_info.difficulty >= i + 1 { + text(size: 9pt, fill: theme.dark-gold)[●] + } else if class_info.difficulty >= i + 0.5 { + text(size: 9pt, fill: theme.dark-gold)[◐] + } else { + text(size: 9pt, fill: theme.border)[○] + } + } + ] + ]] + ) + + v(1em) + pagebreak() + + [=== Techniques] + + techniques(class_info.techniques) +} diff --git a/setup/setup.typ b/setup/setup.typ index baa4088..7784000 100644 --- a/setup/setup.typ +++ b/setup/setup.typ @@ -1,17 +1,17 @@ // Project variables #import "variables.typ": ravenous, colors #import "../data/gen/build_info.typ": build_info -// #import "class_model.typ": class_model #import "model.typ" as model +#import "themes.typ": make-theme // Re exposing internals #let ravenous = ravenous #let colors = colors +#let theme = make-theme(name: "warm") #let build_info = build_info // Template for classes #let school_presentation = model.school_presentation -#let school_techniques = model.school_techniques // // Document setup // #import "./config.typ": conf diff --git a/setup/themes.typ b/setup/themes.typ new file mode 100644 index 0000000..2a5dabe --- /dev/null +++ b/setup/themes.typ @@ -0,0 +1,53 @@ +// ----------------------------------------------------------------------------- +// Color themes +// ----------------------------------------------------------------------------- + +#let themes = ( + warm: ( + ink: rgb("#302c26"), + muted-ink: rgb("#716957"), + gold: rgb("#9b8050"), + dark-gold: rgb("#70582f"), + parchment: rgb("#f7f3e9"), + parchment-dark: rgb("#ece4d2"), + parchment-light: rgb("#fbf9f3"), + border: rgb("#c9bda4"), + ), + + steel: ( + ink: rgb("#292b32"), + muted-ink: rgb("#626873"), + gold: rgb("#7187a0"), + dark-gold: rgb("#465a72"), + parchment: rgb("#eef1f3"), + parchment-dark: rgb("#dce2e7"), + parchment-light: rgb("#f7f9fa"), + border: rgb("#b8c2cc"), + ), + + sage: ( + ink: rgb("#29302a"), + muted-ink: rgb("#687064"), + gold: rgb("#7f8f62"), + dark-gold: rgb("#53603d"), + parchment: rgb("#f1f2e8"), + parchment-dark: rgb("#e1e4d5"), + parchment-light: rgb("#fafbf5"), + border: rgb("#bdc3ae"), + ), + + bw: ( + ink: rgb("#202020"), + muted-ink: rgb("#666666"), + gold: rgb("#777777"), + dark-gold: rgb("#484848"), + parchment: rgb("#eeeeee"), + parchment-dark: rgb("#dddddd"), + parchment-light: rgb("#fafafa"), + border: rgb("#b5b5b5"), + ), +) + +#let make-theme(name: "warm") = { + themes.at(name) +}