... | ... |
@@ -359,6 +359,11 @@ |
359 | 359 |
#(weight % :unit "lb" :no-quantity true)] |
360 | 360 |
[listing-license-notice items]]) |
361 | 361 |
|
362 |
+(defn dice-roll [{:keys [rolls]}] |
|
363 |
+ [:article {:class (styles/dice-roll)} |
|
364 |
+ [:span (str rolls)] |
|
365 |
+ [:span (reduce + rolls)]]) |
|
366 |
+ |
|
362 | 367 |
(defn error-message |
363 | 368 |
[{e :err}] |
364 | 369 |
[:div {:class (styles/error-message)} e]) |
... | ... |
@@ -366,6 +371,7 @@ |
366 | 371 |
(defn input [x] |
367 | 372 |
[:div.input x]) |
368 | 373 |
|
374 |
+(def is-dice-roll? :rolls) |
|
369 | 375 |
(def is-license? :license-name) |
370 | 376 |
(def is-spell? #(some-> % :url (string/starts-with? "/api/spells"))) |
371 | 377 |
(def is-spell-list? #(some-> % first is-spell?)) |
... | ... |
@@ -378,6 +384,7 @@ |
378 | 384 |
(defn output [x] |
379 | 385 |
[:div.output |
380 | 386 |
(cond |
387 |
+ (is-dice-roll? x) [dice-roll x] |
|
381 | 388 |
(is-license? x) [license-panel x] |
382 | 389 |
(is-equipment-list? x) [equipment-list-panel x] |
383 | 390 |
(is-spell-list? x) [spell-list-panel x] |