From 371449b0e312a03162b78797b83dee9d81706669 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 28 Jun 2020 10:37:08 +0200 Subject: Fix responsive header --- common/src/Common/Message/Translation.hs | 4 +- server/src/Design/View/Header.hs | 69 ++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/common/src/Common/Message/Translation.hs b/common/src/Common/Message/Translation.hs index 222e669..f1de3e1 100644 --- a/common/src/Common/Message/Translation.hs +++ b/common/src/Common/Message/Translation.hs @@ -592,12 +592,12 @@ m l (WeeklyReport_IncomeEdited count) = m l (WeeklyReport_PayedFor name amount for at) = case l of English -> T.concat [ name, " payed ", amount, " for “", for, "” at ", at ] - French -> T.concat [ name, " a payé ", amount, " concernant « ", for, " » le ", at ] + French -> T.concat [ name, " a payé ", amount, " de « ", for, " » le ", at ] m l (WeeklyReport_PayedForNot name amount for at) = case l of English -> T.concat [ name, " didn’t pay ", amount, " for “", for, "” at ", at ] - French -> T.concat [ name, " n’a pas payé ", amount, " concernant « ", for, " » le ", at ] + French -> T.concat [ name, " n’a pas payé ", amount, " de « ", for, " » le ", at ] m l (WeeklyReport_PayedFrom name amount for) = case l of diff --git a/server/src/Design/View/Header.hs b/server/src/Design/View/Header.hs index ca1c66e..2ad0455 100644 --- a/server/src/Design/View/Header.hs +++ b/server/src/Design/View/Header.hs @@ -9,29 +9,53 @@ import Clay import Design.Color as Color import qualified Design.Media as Media +desktopLineHeight :: Double +desktopLineHeight = 80 + +tabletLineHeight :: Double +tabletLineHeight = 60 + +mobileLineHeight :: Double +mobileLineHeight = 40 + design :: Css design = do - let headerPadding = "padding" -: "0 20px" display flex "flex-wrap" -: "wrap" - lineHeightMedia position relative backgroundColor Color.chestnutRose color Color.white - Media.desktop $ marginBottom (em 3) - Media.mobileTablet $ marginBottom (em 2) - Media.mobile $ marginBottom (em 1.5) - ".title" <> ".item" ? headerPadding + Media.desktop $ do + minHeight (px desktopLineHeight) + lineHeight (px desktopLineHeight) + marginBottom (em 3) + Media.tablet $ do + minHeight (px (tabletLineHeight * 2)) + lineHeight (px tabletLineHeight) + marginBottom (em 2) + Media.mobile $ do + minHeight (px (mobileLineHeight * 2)) + lineHeight (px mobileLineHeight) + marginBottom (em 1.5) + + ".title" <> ".item" ? do + Media.tabletDesktop $ sym2 padding (px 0) (px 20) + Media.mobile $ sym2 padding (px 0) (px 10) ".title" ? do textAlign (alignSide sideLeft) - Media.mobile $ fontSize (px 22) - Media.mobileTablet $ width (pct 100) - Media.tabletDesktop $ do - display inlineBlock + Media.desktop $ do fontSize (px 35) + display inlineBlock + Media.tablet $ do + fontSize (px 28) + display inlineBlock + width (pct 100) + Media.mobile $ do + fontSize (px 22) + width (pct 100) ".item" ? do display inlineBlock @@ -47,14 +71,17 @@ design = do ".nameSignOut" ? do display flex - heightMedia position absolute top (px 0) right (px 0) + Media.desktop $ height (px desktopLineHeight) + Media.tablet $ height (px tabletLineHeight) + Media.mobile $ height (px mobileLineHeight) + ".name" ? do Media.mobile $ display none - Media.tabletDesktop $ headerPadding + Media.tabletDesktop $ sym2 padding (px 0) (px 20) ".signOut" ? do display flex @@ -64,21 +91,3 @@ design = do Media.tabletDesktop $ width (px 30) Media.mobile $ width (px 20) "path" ? ("fill" -: "white") - -lineHeightMedia :: Css -lineHeightMedia = do - Media.desktop $ do - minHeight (px 80) - lineHeight (px 80) - Media.tablet $ do - minHeight (px 65) - lineHeight (px 65) - Media.mobile $ do - minHeight (px 50) - lineHeight (px 50) - -heightMedia :: Css -heightMedia = do - Media.desktop $ height (px 80) - Media.tablet $ height (px 65) - Media.mobile $ height (px 50) -- cgit v1.2.3