     (swap! state assoc :position [x ny])
     (lock-piece!)))
 
+(defn change-theme!
+  "Changes the boards theme"
+  [theme year platform event]
+  (.preventDefault event)
+  (swap! state assoc :theme theme)
+  (.html ($ "#theme") year)
+  (.html ($ "#theme-details") platform)
+  (aset js/localStorage "theme" theme))
+
+(defn load-theme!
+  "Loads a theme if theres one saved in localStorage"
+  []
+  (if-let [theme (aget js/localStorage "theme")]
+    (swap! state assoc :theme theme)
+    ""))
+
 (defn add-key-events
   "Add all the key inputs."
   []

(defn init []

  (init-state!)

  (size-canvas! "game-canvas" empty-board cell-size rows-cutoff)
  (size-canvas! "next-canvas" (next-piece-board) cell-size)


        key-name #(-> % .-keyCode key-names)
        key-down (fn [e]
                   (case (key-name e)
                     :one   (change-theme! 0 "1984" "Electronika 60" e)
                     :two   (change-theme! 1 "1986" "MS DOS" e)
                     :three (change-theme! 2 "1986" "Tengen/Atari Arcade" e)
                     :four  (change-theme! 3 "1989" "Gameboy" e)
                     :five  (change-theme! 4 "1989" "NES" e)
                     :six   (change-theme! 5 "1989" "Sega Genesis" e)
                     :seven (change-theme! 6 "1998" "Gameboy color" e)
                     :eight (change-theme! 7 "2000" "TI-83" e)
                     :nine  (change-theme! 8 "2002" "Flash" e)
                     :zero  (change-theme! 9 "2012" "Facebook" e)
                     nil)
                   (if (:piece @state)
                     (case (key-name e)
