Skip to content

Commit

Permalink
Merge branch '602-fix-icon-asclepius-svg' into tinkan-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
codeGlaze committed Mar 11, 2024
2 parents 98573d8 + 5dc7f02 commit 9f41415
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions resources/public/image/black/rod-of-asclepius.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/public/image/rod-of-asclepius.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/cljc/orcpub/dnd/e5/template.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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")}]))
Expand Down

0 comments on commit 9f41415

Please sign in to comment.