Skip to content

Commit

Permalink
got poem working, and vertical slider
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaws committed Dec 12, 2016
1 parent fa72c77 commit c00ee1d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 13 deletions.
12 changes: 12 additions & 0 deletions TODO.org
Original file line number Diff line number Diff line change
Expand Up @@ -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




Expand Down
11 changes: 11 additions & 0 deletions resources/public/css/undead.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
17 changes: 7 additions & 10 deletions src/undead/cards/poem.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [])
Expand All @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
45 changes: 42 additions & 3 deletions src/undead/cards/thenvenn/day.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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])



Expand Down

0 comments on commit c00ee1d

Please sign in to comment.