From 5dc7f029a68d90908f69031f00122bf67de01dec Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Mon, 11 Mar 2024 12:12:27 -0400 Subject: [PATCH] Fixes #602 - minor - SVG icon swap minor + adds svg icons for rod-of-asclepius + changes CON icon to RoA + added some basic documentation to relevant functions --- resources/public/image/black/rod-of-asclepius.svg | 1 + resources/public/image/rod-of-asclepius.svg | 1 + src/cljc/orcpub/dnd/e5/template.cljc | 12 ++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 resources/public/image/black/rod-of-asclepius.svg create mode 100644 resources/public/image/rod-of-asclepius.svg diff --git a/resources/public/image/black/rod-of-asclepius.svg b/resources/public/image/black/rod-of-asclepius.svg new file mode 100644 index 000000000..e88075973 --- /dev/null +++ b/resources/public/image/black/rod-of-asclepius.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/public/image/rod-of-asclepius.svg b/resources/public/image/rod-of-asclepius.svg new file mode 100644 index 000000000..6c7a8d300 --- /dev/null +++ b/resources/public/image/rod-of-asclepius.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/cljc/orcpub/dnd/e5/template.cljc b/src/cljc/orcpub/dnd/e5/template.cljc index de8c957cb..a6f6493fb 100644 --- a/src/cljc/orcpub/dnd/e5/template.cljc +++ b/src/cljc/orcpub/dnd/e5/template.cljc @@ -49,14 +49,22 @@ (assoc a k other-v other-k v)))))) (def ability-icons + "Icons / names are provided by https://game-icons.net/" {::char5e/str "strong" - ::char5e/con "caduceus" + ::char5e/con "rod-of-asclepius" ::char5e/dex "body-balance" ::char5e/int "read" ::char5e/wis "meditation" ::char5e/cha "aura"}) -(defn ability-icon [k size theme] +;; REVIEW: use generic function for all icons instead? +(defn ability-icon + "Takes [k size theme] to generate css class name based on the size and theme. + `k` is the icon name/key in image set, + `size` sets both h and w, + `theme` sets light/dark color and opacity. + Only used for `ability-icons` -- see body of function below." + [k size theme] (let [light-theme? (= "light-theme" theme)] [:img {:class-name (str "h-" size " w-" size (if light-theme? " opacity-7")) :src (str (if light-theme? "/image/black/" "/image/") (ability-icons k) ".svg")}]))