                (min (:height data) (:width data))
                0.03)})
 
+;;--------------------------------------------------------
+;;--REAGENT/REACT COMPONENTS AND HELPER FUNCTIONS TO THOSE
 (defn slider-view
   "adjusts the size of the board"
   [state]

    (filter #(not (out-of-board? %)) [[(+ row 2) col]])
    (filter #(not (out-of-board? %)) [[(- row 2) col]])))

(defn highlight-piece
  [[row col] color]
  (fn [state]
    (assoc-in state [:board row col :color] color)))

(defn highlight-possible-positions
  [positions color]
  (fn [state]
    (let [pos->str
          (map #(vector %1 %2)
               positions
               (map char
                    (range 97 123)))]
      (reduce
       (fn [hmap [[row col] char]]
         (assoc-in hmap [:board row col]
                   {:piece char :color color}))
       state
       pos->str))))

(defn handle-selection
  [pos turn]
  (comp
   (highlight-possible-positions
    (possible-placements pos turn) highlight-color)
   (highlight-piece pos highlight-color)))

(defn select-piece
  [state text-state [row col :as pos]]
  (swap! text-state
         assoc :move-to (vec (possible-placements pos (:turn state))))
  (swap! app-state (handle-selection pos (:turn state))))

(defn handle-text-input

#_(reset! app-state init-state)
#_(swap! app-state assoc :turn :black)

;;-------------
;;--DYNAMIC CSS
(defn board-style
  [data]
  {:border "1px solid black"
