diff options
author | David Barksdale <amatus@amatus.name> | 2016-12-03 14:23:02 -0600 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2016-12-03 14:23:02 -0600 |
commit | 99e916beaf6afe5b2300bd95e73267550767bf7a (patch) | |
tree | 2b22c71fbdbf507735635c834de2276450b6372a /src/index.cljs.hl | |
parent | 53284a2f5d22d15cd7851fd0f06a53ea1df0c280 (diff) |
Add Semantic-UI and get blockly working
Diffstat (limited to 'src/index.cljs.hl')
-rw-r--r-- | src/index.cljs.hl | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/index.cljs.hl b/src/index.cljs.hl index c8be06d..2472649 100644 --- a/src/index.cljs.hl +++ b/src/index.cljs.hl @@ -1,10 +1,36 @@ (page "index.html" - (:require [app.rpc :as rpc])) + (:require [app.rpc :as rpc] + [Blockly])) + +(def toolbox + "<xml> + <block type=\"controls_if\"></block> + <block type=\"logic_compare\"></block> + <block type=\"controls_repeat_ext\"></block> + <block type=\"math_number\"></block> + <block type=\"math_arithmetic\"></block> + <block type=\"text\"></block> + <block type=\"text_print\"></block> + </xml>") + +(defelem blockly-workspace + [{:keys [options] :as attr} kids] + (let [elem (div (dissoc attr :options) kids)] + (with-init! + (set! (.-workspace elem) + (.inject js/Blockly elem (clj->js options)))) + elem)) + (html (head + (link :rel "stylesheet" :type "text/css" :href "css/semantic.min.css") + (script :src "blocks_compressed.js") + (script :src "en.js") (title "Tankputer")) (body - (h1 "Tankputer"))) + (h1 "Tankputer") + (blockly-workspace :css {:height "480px" :width "600px"} + :options {:media "media/" :toolbox toolbox}))) ;; vim: set expandtab ts=2 sw=2 filetype=clojure : |