diff options
author | metamuffin <metamuffin@disroot.org> | 2024-11-18 18:21:32 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-11-18 18:22:17 +0100 |
commit | 9d9d4fa85f17c783c7460f61236e3e9e34f6411e (patch) | |
tree | f9eb2c15d30495cf4beaf72b105c1c78ce0baece /book/book.js | |
parent | b1abfaff30c50493befc7947980626557c857c8e (diff) | |
download | hurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar hurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar.bz2 hurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar.zst |
conditional document elements
Diffstat (limited to 'book/book.js')
-rw-r--r-- | book/book.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/book/book.js b/book/book.js index 094068c0..00c83426 100644 --- a/book/book.js +++ b/book/book.js @@ -40,17 +40,20 @@ const about = () => ({ t: "page", es: [ { t: "text", s: tr("b.about"), color: "#000000", size: 30, font: "FreeSans" }, par("b.about.name"), - { t: "text", s: tr("b.about.image_attrib"), color: "#000000", size: 20, font: "FreeSans" }, + { t: "conditional", cond: "image_attribution", value: true, e: { t: "text", s: tr("b.about.image_attrib"), color: "#000000", size: 20, font: "FreeSans" } }, { - t: "table", es: [ - [par("b.about.image_attrib.name", false, true), par("b.about.image_attrib.author", false, true)], - [par("b.nigiri"), par_raw(plain("Ahtziri Lagarde(unsplash)"))], - [par("b.icecream"), par_raw(plain("Markus Spiske(unsplash), adapted"))], - [par("b.curry"), par_raw(plain("Andy Hay(unsplash), adapted"))], - [par("b.mochi"), par_raw(plain("blackieshoot(unsplash)"))], - [par("b.burger"), par_raw(plain("Pablo Merchán Montes(unsplash), adapted"))], - [par("b.tomato_soup"), par_raw(plain("Julia Kicova(unsplash), adapted"))], - ] + t: "conditional", cond: "image_attribution", value: true, e: + { + t: "table", es: [ + [par("b.about.image_attrib.name", false, true), par("b.about.image_attrib.author", false, true)], + [par("b.nigiri"), par_raw(plain("Ahtziri Lagarde (unsplash)"))], + [par("b.icecream"), par_raw(plain("Markus Spiske (unsplash), adapted"))], + [par("b.curry"), par_raw(plain("Andy Hay (unsplash), adapted"))], + [par("b.mochi"), par_raw(plain("blackieshoot (unsplash)"))], + [par("b.burger"), par_raw(plain("Pablo Merchán Montes (unsplash), adapted"))], + [par("b.tomato_soup"), par_raw(plain("Julia Kicova (unsplash), adapted"))], + ] + } } ] }) @@ -58,9 +61,7 @@ const recipe = (n, i, th = false, extra = []) => ({ t: "page", background: n, es: [ h2(`b.${n}`, th), par(`b.${n}.desc`, th), - { - t: "list", es: i.map(e => emph(`b.ingred.${e}`, th)) - }, + { t: "list", es: i.map(e => emph(`b.ingred.${e}`, th)) }, par(`b.${n}.steps`, th), ...extra ] |