{-# LANGUAGE OverloadedStrings #-} module Design.Global ( globalDesign ) where import Data.Monoid ((<>)) import Clay import qualified Clay.Display as D import Data.Text.Lazy (Text) import Design.Color as C import Design.Media globalDesign :: Text globalDesign = renderWith compact [] global iconFontSize :: Integer iconFontSize = 32 radius :: Size Abs radius = px 3 global :: Css global = do body ? do position relative minWidth (px 550) header ? do let headerHeight = 150 h1 ? do fontSize (px 40) textAlign (alignSide sideCenter) color C.red lineHeight (px headerHeight) fontWeight bold button # ".signOut" ? do let iconHeight = 50 let sideMargin = ((headerHeight - iconHeight) `Prelude.div` 2) position absolute top (px sideMargin) right (pct 2) height (px iconHeight) lineHeight (px iconHeight) backgroundColor C.white color C.red borderWidth (px 0) fontSize (px iconFontSize) hover & transform (scale 1.2 1.2) ".payments" ? do ".exceedingPayers" ? do width (pct 95) margin (px 0) auto (px 45) auto padding (px 15) (px 15) (px 15) (px 15) backgroundColor C.green color C.white fontWeight bold borderRadius (px 5) (px 5) (px 5) (px 5) fontSize (pct 120) ".exceedingPayer" Clay.** ".userName" ? marginRight (px 10) form # ".add" ? do let inputHeight = 40 width (pct 95) marginLeft auto marginRight auto marginBottom (px 45) clearFix ".name" <> ".cost" ? do position relative width (pct 49) label ? do fontWeight bold display inlineBlock width (px 60) textAlign (alignSide sideCenter) backgroundColor C.darkGrey color C.white height (px inputHeight) lineHeight (px inputHeight) fontSize (px 22) verticalAlign middle cursor cursorText borderRadius (px 0) radius radius (px 0) input ? do defaultInput inputHeight borderRadius radius (px 0) (px 0) radius "input:focus + label" ? backgroundColor C.grey ".name" ? do float floatLeft width (pct 40) input ? width (pct 75) label ? width (pct 20) paddingRight (pct 5) ".cost" ? do float floatLeft width (pct 25) input ? width (pct 65) label ? width (pct 30) paddingRight (pct 5) ".frequency" ? do float floatLeft width (pct 15) marginRight (pct 5) (".punctual" <> ".monthly") ? do defaultButton C.lightGrey C.darkGrey (inputHeight `Prelude.div` 2) ".selected" & do backgroundColor C.blue color C.white ".punctual" ? borderRadius radius radius 0 0 ".monthly" ? borderRadius 0 0 radius radius button ? do defaultButton C.red C.white inputHeight float floatLeft width (pct 15) ".name.error" <> ".cost.error" ? do input ? borderColor C.redError label ? backgroundColor C.redError "input:focus + label" ? backgroundColor C.redError ".errorMessage" ? do position absolute color C.redError top (px (inputHeight + 10)) left (px 0) ".table" ? do display D.table width (pct 100) textAlign (alignSide (sideCenter)) "border-spacing" -: "10 px" ".header" <> ".row" ? display tableRow ".header" ? do fontWeight bold backgroundColor C.red color C.white fontSize (px iconFontSize) lineHeight (px 70) ".row" ? do fontSize (px 20) cursor pointer lineHeight (px 60) nthChild "odd" & backgroundColor C.lightGrey ".edition" & do backgroundColor C.paymentFocus ".remove" ? visibility visible ".cell" ? do display tableCell ".category" & width (pct 40) ".cost" & width (pct 20) ".user" & width (pct 20) ".date" & do width (pct 20) smallScreen $ do ".shortDate" ? display inline ".longDate" ? display none largeScreen $ do ".shortDate" ? display none ".longDate" ? display inline ".remove" & do width (px 10) height (px 10) textAlign (alignSide sideCenter) backgroundColor C.red color C.white visibility hidden ".pages" ? do padding (px 30) (px 30) (px 30) (px 30) textAlign (alignSide (sideCenter)) clearFix ".page" ? do display inlineBlock border solid (px 2) C.darkGrey color C.darkGrey borderRadius (px 2) (px 2) (px 2) (px 2) marginRight (px 10) let side = 50 width (px side) height (px side) lineHeight (px side) textAlign (alignSide (sideCenter)) fontWeight bold ":not(.current)" & cursor pointer ".current" & do borderColor C.red color C.red ".signIn" ? do form ? do let inputHeight = 50 width (px 500) marginTop (px 50) marginLeft auto marginRight auto input ? do defaultInput inputHeight display block width (pct 100) marginBottom (px 10) button ? do defaultButton C.red C.white inputHeight display block width (pct 100) ".result" ? do marginTop (px 40) textAlign (alignSide sideCenter) ".success" ? color C.greenSuccess ".error" ? color C.redError clearFix :: Css clearFix = after & do content (stringContent "") display D.table clear both defaultButton :: Color -> Color -> Integer -> Css defaultButton backgroundCol textCol pxHeight = do backgroundColor backgroundCol color textCol borderWidth (px 0) borderRadius radius radius radius radius verticalAlign middle cursor pointer height (px pxHeight) lineHeight (px pxHeight) textAlign (alignSide sideCenter) defaultInput :: Integer -> Css defaultInput inputHeight = do height (px inputHeight) padding (px 10) (px 10) (px 10) (px 10) borderRadius radius radius radius radius border solid (px 1) C.darkGrey focus & borderColor C.grey verticalAlign middle