Skip to content

Instantly share code, notes, and snippets.

@zk
Last active December 31, 2015 11:49
Show Gist options
  • Save zk/7981902 to your computer and use it in GitHub Desktop.
Save zk/7981902 to your computer and use it in GitHub Desktop.
inky test
(ns first
"Let's start with something short."
(:require [dommy.core :as dom]
[inky.sketch :as sketch])
(:use-macros [dommy.macros :only (node)]))
(sketch/page-style!
[:div.box {:position "absolute"
:top "48%"
:bottom "48%"
:right "50px"
:left "50px"
:background-color "#c0392b"
:transition ["top 0.2s"
"bottom 0.2s"
"border-radius 0.2s"
"background-color 0.2s"]}
:div.over {:top "20%"
:bottom "20%"
:background-color "#27ae60"}])
(def box (node [:div.box]))
(dom/listen! box :mouseover #(dom/add-class! box :over))
(dom/listen! box :mouseout #(dom/remove-class! box :over))
(sketch/content! box)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment