aboutsummaryrefslogtreecommitdiff
path: root/src/server/Design/LoggedIn/Home/Add.hs
diff options
context:
space:
mode:
authorJoris2016-04-05 23:52:13 +0200
committerJoris2016-04-05 23:52:13 +0200
commitfe50c4042848681833d15fab27466d1d2d4bda45 (patch)
tree9a1eda4adb22c0d84815e20e8e021968815d7c50 /src/server/Design/LoggedIn/Home/Add.hs
parent466f77394885cb74d01451c4733cafc9b61f4bba (diff)
downloadbudget-fe50c4042848681833d15fab27466d1d2d4bda45.tar.gz
budget-fe50c4042848681833d15fab27466d1d2d4bda45.tar.bz2
budget-fe50c4042848681833d15fab27466d1d2d4bda45.zip
Ameliore design in income page and stat page
Diffstat (limited to 'src/server/Design/LoggedIn/Home/Add.hs')
-rw-r--r--src/server/Design/LoggedIn/Home/Add.hs87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/server/Design/LoggedIn/Home/Add.hs b/src/server/Design/LoggedIn/Home/Add.hs
new file mode 100644
index 0000000..7613ba3
--- /dev/null
+++ b/src/server/Design/LoggedIn/Home/Add.hs
@@ -0,0 +1,87 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Design.LoggedIn.Home.Add
+ ( design
+ ) where
+
+import Data.Monoid ((<>))
+
+import Clay
+
+import Design.Color as C
+import Design.Helper
+import Design.Constants
+
+design :: Css
+design = do
+ centeredWithMargin
+ marginBottom blockMarginBottom
+ display flex
+ "justify-content" -: "center"
+
+ ".name" <> ".cost" ? do
+ position relative
+ display flex
+ marginRight (pct blockPercentMargin)
+ label ? do
+ fontWeight bold
+ display inlineBlock
+ width (px 50)
+ 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
+ "width" -: "calc(100% - 40px)"
+ "input:focus + label" ? backgroundColor C.grey
+ hover & do
+ input ? borderColor C.grey
+ label ? backgroundColor C.grey
+
+ ".name" ? minWidth (px 150)
+
+ button # ".frequency" ? do
+ fontSize (pct 90)
+ marginRight (pct blockPercentMargin)
+
+ (".punctual" <> ".monthly") ? do
+ defaultButton C.lightGrey C.darkGrey (px $ inputHeight `Prelude.div` 2) focusLighten
+ paddingLeft (px 15)
+ paddingRight (px 15)
+ ".selected" & do
+ backgroundColor C.blue
+ color C.white
+
+ hover & (".punctual" <> ".monthly") ?
+ ".selected" & backgroundColor (focusLighten C.blue)
+
+ focus & (".punctual" <> ".monthly") ?
+ ".selected" & backgroundColor (focusLighten C.blue)
+
+ ".punctual" ? borderRadius radius radius 0 0
+ ".monthly" ? borderRadius 0 0 radius radius
+
+ button # ".add" ? do
+ defaultButton C.red C.white (px inputHeight) focusLighten
+ paddingLeft (px 15)
+ paddingRight (px 15)
+ i ? marginLeft (px 10)
+ ".waitingServer" & ("cursor" -: "not-allowed")
+
+ ".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)