Skip to content

Instantly share code, notes, and snippets.

@mason-stewart
Forked from zk/inkyfirst.cljs
Last active January 1, 2016 16:49
Show Gist options
  • Save mason-stewart/8173455 to your computer and use it in GitHub Desktop.
Save mason-stewart/8173455 to your computer and use it in GitHub Desktop.
(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