diff --git a/src/NoteHub/views/common.clj b/src/NoteHub/views/common.clj index 65aa197..d785279 100644 --- a/src/NoteHub/views/common.clj +++ b/src/NoteHub/views/common.clj @@ -5,38 +5,53 @@ (defn gen-comma-list [fonts] (apply str (interpose "," fonts))) -(def global-css (css - (rule ".centerized" - :text-align :center) - (rule ".helvetica-neue" - :font-weight 300 - :font-family (gen-comma-list ["'Helvetica Neue'" - "Helvetica" - "Arial" - "'Lucida Grande'" - "sans-serif"])) - (rule "button" - :margin :2em - :font-size :1.5em - :background :#0a2 - :color :white - :border :none - :border-radius :10px - :padding :10px) - (rule "html, body" - :color :#333 - :margin 0 - :padding 0) - (rule "#hero" - :padding-top :5em - :padding-bottom :5em - :border-bottom [:1px :solid :gray] - :text-align :center) - (rule "#body" - :margin-left "auto" - :margin-right "auto" - :width "1000px") - (rule "h1, h2, h3, h4" :font-family "'Noticia Text'"))) +(def global-css + (css + (rule ".centerized" + :text-align :center) + (rule ".helvetica-neue" + :font-weight 300 + :font-family (gen-comma-list ["'Helvetica Neue'" + "Helvetica" + "Arial" + "'Lucida Grande'" + "sans-serif"])) + (rule "button" + :cursor :hand + :box-shadow [0 :2px :5px :#aaa] + :margin-top :1em + :font-size :1.5em + :background :#0a2 + :color :white + :border :none + :border-radius :10px + :padding :10px) + (rule "html, body" + :color :#333 + :margin 0 + :padding 0) + (rule "#hero" + :padding-top :5em + :padding-bottom :5em + :text-align :center) + (rule ".article-font" + :font-family :Georgia + :font-size :1.3em) + (rule ".max-width" + :width "900px") + (rule "*:focus" + :outline [:0px :none :transparent]) + (rule "textarea" + :font-family :Courier + :font-size :1.3em + :border :none + :height :600px) + (rule ".central-body" + :margin-top :5em + :margin-bottom :5em + :margin-left "auto" + :margin-right "auto") + (rule "h1, h2, h3, h4" :font-family "'Noticia Text'"))) (defpartial layout [& content] (html5 @@ -46,5 +61,4 @@ :rel "stylesheet" :type "text/css"}] [:style {:type "text/css"} global-css]] - [:body - content])) + [:body content])) diff --git a/src/NoteHub/views/pages.clj b/src/NoteHub/views/pages.clj index caf6e75..2e61397 100644 --- a/src/NoteHub/views/pages.clj +++ b/src/NoteHub/views/pages.clj @@ -1,16 +1,18 @@ (ns NoteHub.views.pages (:require [NoteHub.views.common :as common]) (:use [noir.core :only [defpage]] - [hiccup.core :only [html]])) + [hiccup.core :only [html]] + [hiccup.form])) (defpage "/" [] (common/layout [:div#hero [:h1 "NoteHub"] [:h2.helvetica-neue "Free hosting for markdown pages."] - [:button.helvetica-neue "Create Page"]] - [:div#body - [:p.centerized.helvetica-neue - (interpose (repeat 10 " ") - ["About" "How to use" "Impressum"])]])) + [:button.helvetica-neue {:onclick "window.location='/new'"} "New Page"]])) + +(defpage "/new" [] + (common/layout + [:div.central-body.max-width + (text-area {:class "central-body max-width"} :article-write)]))