From c957ccba00e38a36afb905bd2916074714d76ab7 Mon Sep 17 00:00:00 2001 From: etienne Date: Sat, 8 Jul 2023 01:52:35 +0200 Subject: [PATCH] Minimal Footer Added a very simple and quite ugly footer, will have to do some more designing but it is functional for now. --- etienne-moqueur.cabal | 3 +++ src/Kit/Atoms/Flex.hs | 20 ++++++++++++++++++++ src/Kit/Atoms/Footer.hs | 17 +++++++++++++++++ src/Kit/Organisms/DefaultFooter.hs | 20 ++++++++++++++++++++ src/Kit/Templates/Index.hs | 12 +++++++----- 5 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 src/Kit/Atoms/Flex.hs create mode 100644 src/Kit/Atoms/Footer.hs create mode 100644 src/Kit/Organisms/DefaultFooter.hs diff --git a/etienne-moqueur.cabal b/etienne-moqueur.cabal index 9d940dd..e709cfb 100644 --- a/etienne-moqueur.cabal +++ b/etienne-moqueur.cabal @@ -30,7 +30,9 @@ library Kit.Atoms.Button Kit.Atoms.ButtonLink Kit.Atoms.Container + Kit.Atoms.Flex Kit.Atoms.Fonts + Kit.Atoms.Footer Kit.Atoms.FullScreenModal Kit.Atoms.Hamburger Kit.Atoms.Header @@ -56,6 +58,7 @@ library Kit.Molecules.SmallProfilePic Kit.Molecules.Tag Kit.Organisms.Card + Kit.Organisms.DefaultFooter Kit.Organisms.Head Kit.Organisms.ProfileHeader Kit.Organisms.TopMenu diff --git a/src/Kit/Atoms/Flex.hs b/src/Kit/Atoms/Flex.hs new file mode 100644 index 0000000..9facf1e --- /dev/null +++ b/src/Kit/Atoms/Flex.hs @@ -0,0 +1,20 @@ +module Kit.Atoms.Flex + ( flex' + ) where + +import Clay as C +import Components +import Kit.Atoms.BreakpointQueries +import Text.Blaze.Html5 as H +import Text.Blaze.Html5.Attributes as A + +flex' :: Component (Html -> Html) +flex' = do + addCss css + return $ H.div H.! class_ "responsive-flex" + where + css = C.div # byClass "responsive-flex" ? do + display flex + flexDirection column + justifyContent spaceBetween + breakpointM $ flexDirection row diff --git a/src/Kit/Atoms/Footer.hs b/src/Kit/Atoms/Footer.hs new file mode 100644 index 0000000..5240955 --- /dev/null +++ b/src/Kit/Atoms/Footer.hs @@ -0,0 +1,17 @@ +module Kit.Atoms.Footer + ( footer' + ) where + +import Clay as C +import Components +import Kit.Constants.Colors +import Text.Blaze.Html5 as H + +footer' :: Component (Html -> Html) +footer' = do + addCss css + return H.footer + where + css = C.footer ? do + backgroundColor $ secondary @ 25 + color $ grays @ 90 diff --git a/src/Kit/Organisms/DefaultFooter.hs b/src/Kit/Organisms/DefaultFooter.hs new file mode 100644 index 0000000..119f321 --- /dev/null +++ b/src/Kit/Organisms/DefaultFooter.hs @@ -0,0 +1,20 @@ +module Kit.Organisms.DefaultFooter + ( defaultFooter + ) where + +import Components +import Kit.Atoms.Container +import Kit.Atoms.Flex +import Kit.Atoms.Footer +import Kit.Atoms.Link +import Text.Blaze.Html5 as H + +defaultFooter :: Component Html +defaultFooter = footer' <.> container <.> flex' <*> mconcat + [ pure $ p "Copyright Etienne Werly 2023" + , H.p + <$> ( a' "https://git.moqueur.chat/etienne/etienne-moqueur" + <*> pure "Source Code" + ) + , pure $ p "A flat file CMS written in Haskell" + ] diff --git a/src/Kit/Templates/Index.hs b/src/Kit/Templates/Index.hs index 46ed492..e6385ad 100644 --- a/src/Kit/Templates/Index.hs +++ b/src/Kit/Templates/Index.hs @@ -10,6 +10,7 @@ import Kit.Atoms.Section import Kit.Molecules.Bricklayer import Kit.Molecules.Tag import Kit.Organisms.Card +import Kit.Organisms.DefaultFooter import Kit.Organisms.Head import Kit.Organisms.ProfileHeader import Routes @@ -26,11 +27,12 @@ dummy = PostProp { postRoute = "$url$" } indexBody :: Component Html -indexBody = - profileHeader - <> (section' <.> bricklayer <*> mconcat - [pure "$for(pages)$", blogCard dummy, pure "$endfor$"] - ) +indexBody = mconcat + [ profileHeader + , section' <.> bricklayer <*> mconcat + [pure "$for(pages)$", blogCard dummy, pure "$endfor$"] + , defaultFooter + ] indexCtx :: Tags -> [Item String] -> Context String indexCtx tags pages = listField