From c00ee1dae2673b9f500b5d153bef1a49fba7b53f Mon Sep 17 00:00:00 2001 From: Conor White-Sullivan Date: Thu, 3 Nov 2016 17:58:14 -0400 Subject: [PATCH] got poem working, and vertical slider --- TODO.org | 12 ++++++++ resources/public/css/undead.css | 11 ++++++++ src/undead/cards/poem.cljs | 17 +++++------ src/undead/cards/thenvenn/day.cljs | 45 ++++++++++++++++++++++++++++-- 4 files changed, 72 insertions(+), 13 deletions(-) diff --git a/TODO.org b/TODO.org index 44ff6b5..c1efb4b 100644 --- a/TODO.org +++ b/TODO.org @@ -787,6 +787,18 @@ another short break, then used find-or-create to create new themes and culture w ** Dulles Airport +*** 16:39:10 +got a full faceted input working + +now need to style it + +** flight 16:39:45 + +*** next stage on poem stuff would be to refactor so can have variable # of facets + +*** 16:42:28 +for now, will jump to vennthenn + diff --git a/resources/public/css/undead.css b/resources/public/css/undead.css index a012456..dddc790 100644 --- a/resources/public/css/undead.css +++ b/resources/public/css/undead.css @@ -562,4 +562,15 @@ ul.todo-list {background-color: blue; background-color: #1c1c1c; color: grey; border: 1px solid grey; +} + +#bso .y { + background-color: blue; + overflow: none; + border: 2px solid black; + height: 50px; + width: 150px; + margin: 50px 0px; + padding: 50px; + transform: rotate(-90deg); } \ No newline at end of file diff --git a/src/undead/cards/poem.cljs b/src/undead/cards/poem.cljs index b402265..50b4eb2 100644 --- a/src/undead/cards/poem.cljs +++ b/src/undead/cards/poem.cljs @@ -948,7 +948,6 @@ Be the dust at the Wise One's door, and speak!" }]) - (defn multis [hidden] (let [poem-id (:db/id (find-by @poem-conn :set/title "Poem")) culture-selections (r/atom []) @@ -958,8 +957,7 @@ Be the dust at the Wise One's door, and speak!" }]) author-selections (r/atom []) author-options (title-subset-q poem-conn "Author") text-body (r/atom "") - text-title (r/atom "") - ] + text-title (r/atom "")] (fn [hidden] (if @hidden [:button {:on-click #(reset! hidden false)} "Show the modal"] @@ -1023,13 +1021,12 @@ Be the dust at the Wise One's door, and speak!" }]) ) (reset! text-title "") (reset! text-body "") - (reset! hidden true) - ) - - )} - "Save Poem" - ] - ]])))) + (reset! hidden true)))} + "Save Poem"]]])))) + + + + (deftest concat-test diff --git a/src/undead/cards/thenvenn/day.cljs b/src/undead/cards/thenvenn/day.cljs index 7b18462..bbb63d5 100644 --- a/src/undead/cards/thenvenn/day.cljs +++ b/src/undead/cards/thenvenn/day.cljs @@ -2,6 +2,7 @@ (:require [goog.i18n.DateTimeFormat :as dtf] [posh.core :as posh :refer [posh!]] + [re-com.core :as rc] [cljs-time.core :as time :refer [now]] [keybind.core :as keys] [cljs.pprint :refer [pprint]] @@ -180,13 +181,51 @@ or a formatting string like \"dd MMMM yyyy\"" (is (= [10 25 2016] ((juxt time/month time/day time/year) (time/today)))))) +#_(defn slider [attr conn id] + (let [itm (pull conn '[*] id)] + (fn [attr conn id] + [:div + [:input {:type "range" + :style {:display "flex"} + :name "start" + :value (get @itm attr 0) + :min 0 + :max 100 + :step 1 + :on-change (fn [e] + (do #_(js/alert + (js/parseInt (-> e .-target .-value))) + (d/transact! conn [{:db/id id attr + (js/parseInt (-> e .-target .-value))}])))}]]))) + +(defn block-input [] + (let [block-number (r/atom 1)] + (fn [] + [:div#bso.flex + [:div.y.flex + [:input {:type "range" + :style {:display "flex"} + :name "start" + :value @block-number + :min 0 + :max 100 + :step 1 + :on-change (fn [e] + (reset! block-number + (js/parseInt (-> e .-target .-value))))}]] + [:div + [:div (for [i (partition-all 10 (range @block-number))] + ^{:key i}[:div (for [x i] + ^{:key x}[:button x])])]] + ]) + ) + ) - - - +(defcard-rg bblockk + [block-input])