optional font and accesibility
This commit is contained in:
parent
acebe8903a
commit
a8b26c1661
2 changed files with 88 additions and 88 deletions
170
src/Render.hs
170
src/Render.hs
|
|
@ -14,18 +14,19 @@ import Text.Printf (printf)
|
|||
renderHead :: Html ()
|
||||
renderHead = do
|
||||
doctype_
|
||||
head_ $ do
|
||||
meta_ [charset_ "UTF-8"]
|
||||
meta_
|
||||
[ name_ "viewport",
|
||||
content_ "width=device-width, initial-scale=1.0"
|
||||
]
|
||||
meta_
|
||||
[ name_ "description",
|
||||
content_ "Chipburners home page"
|
||||
]
|
||||
title_ "Chipburners"
|
||||
link_ [rel_ "stylesheet", href_ "/style.css"]
|
||||
html_ [lang_ "es"] $ do
|
||||
head_ $ do
|
||||
meta_ [charset_ "UTF-8"]
|
||||
meta_
|
||||
[ name_ "viewport",
|
||||
content_ "width=device-width, initial-scale=1.0"
|
||||
]
|
||||
meta_
|
||||
[ name_ "description",
|
||||
content_ "Chipburners home page"
|
||||
]
|
||||
title_ "Chipburners"
|
||||
link_ [rel_ "stylesheet", href_ "/style.css"]
|
||||
|
||||
renderHeader :: Int -> Html ()
|
||||
renderHeader active =
|
||||
|
|
@ -77,38 +78,36 @@ renderEventList events = mapM_ renderDayGroup (groupEvents events)
|
|||
|
||||
renderFrontpage :: [Event] -> Html ()
|
||||
renderFrontpage events = do
|
||||
doctype_
|
||||
html_ [lang_ "es"] $ do
|
||||
renderHead
|
||||
body_ $ do
|
||||
renderHeader 0
|
||||
div_ [class_ "wrapper"] $ do
|
||||
div_ [class_ "layout"] $ do
|
||||
main_ [id_ "main-content", class_ "content"] $ do
|
||||
section_ [class_ "intro"] $ do
|
||||
h1_ "Chipburners_"
|
||||
p_ [class_ "lead"] $
|
||||
"Frase motivadora aqui"
|
||||
p_ $ do
|
||||
"Buenos dias, "
|
||||
br_ []
|
||||
"Somos un grupo d personas y entidades interesados en infromatica y \
|
||||
\las technologias relacionadas. "
|
||||
br_ []
|
||||
"Este hackerspace ha sido creado como manera d juntar gente con intereses \
|
||||
\similares y compartir conocimientos. "
|
||||
br_ []
|
||||
"Contactanos en "
|
||||
a_ [href_ "/contact"] "signal"
|
||||
"!"
|
||||
renderHead
|
||||
body_ $ do
|
||||
renderHeader 0
|
||||
div_ [class_ "wrapper"] $ do
|
||||
div_ [class_ "layout"] $ do
|
||||
main_ [id_ "main-content", class_ "content"] $ do
|
||||
section_ [class_ "intro"] $ do
|
||||
h1_ "Chipburners_"
|
||||
p_ [class_ "lead"] $
|
||||
"Frase motivadora aqui"
|
||||
p_ $ do
|
||||
"Buenos dias, "
|
||||
br_ []
|
||||
"Somos un grupo d personas y entidades interesados en infromatica y \
|
||||
\las technologias relacionadas. "
|
||||
br_ []
|
||||
"Este hackerspace ha sido creado como manera d juntar gente con intereses \
|
||||
\similares y compartir conocimientos. "
|
||||
br_ []
|
||||
"Contactanos en "
|
||||
a_ [href_ "/contact"] "signal"
|
||||
"!"
|
||||
|
||||
section_ [class_ "image-gallery"] $ do
|
||||
renderImage "example.com" "Imagen sobre algo" "Imagen interesante"
|
||||
section_ [class_ "image-gallery"] $ do
|
||||
renderImage "example.com" "Imagen sobre algo" "Imagen interesante"
|
||||
|
||||
aside_ [class_ "sidebar"] $ do
|
||||
section_ [class_ "events-panel"] $ do
|
||||
h2_ "Eventos"
|
||||
renderEventList events
|
||||
aside_ [class_ "sidebar"] $ do
|
||||
section_ [class_ "events-panel"] $ do
|
||||
h2_ "Eventos"
|
||||
renderEventList events
|
||||
|
||||
chunksOf :: Int -> [a] -> [[a]]
|
||||
chunksOf _ [] = []
|
||||
|
|
@ -171,54 +170,55 @@ renderMonthview (year, month) today groupedEvents = do
|
|||
label
|
||||
|
||||
renderHead
|
||||
renderHeader 1
|
||||
div_ [class_ "calendar-wrapper"] $ do
|
||||
header_ [class_ "calendar-header"] $ do
|
||||
h1_ [class_ "view-title"] "Vista mensual"
|
||||
body_ $ do
|
||||
renderHeader 1
|
||||
div_ [class_ "calendar-wrapper"] $ do
|
||||
header_ [class_ "calendar-header"] $ do
|
||||
h1_ [class_ "view-title"] "Vista mensual"
|
||||
|
||||
nav_ [class_ "calendar-nav"] $ do
|
||||
mkLink py pm "« Mes pasado"
|
||||
mkLink cy cm "Este mes"
|
||||
mkLink ny nm "Mes siguiente »"
|
||||
nav_ [class_ "calendar-nav"] $ do
|
||||
mkLink py pm "« Mes pasado"
|
||||
mkLink cy cm "Este mes"
|
||||
mkLink ny nm "Mes siguiente »"
|
||||
|
||||
h2_ [class_ "month-name"] $
|
||||
toHtml $
|
||||
formatTime defaultTimeLocale "%B %Y" $
|
||||
fromGregorian year month 1
|
||||
h2_ [class_ "month-name"] $
|
||||
toHtml $
|
||||
formatTime defaultTimeLocale "%B %Y" $
|
||||
fromGregorian year month 1
|
||||
|
||||
table_ [class_ "calendar-table"] $ do
|
||||
thead_ $ do
|
||||
tr_ $ do
|
||||
th_ "Lunes"
|
||||
th_ "Martes"
|
||||
th_ "Miercoles"
|
||||
th_ "Jueves"
|
||||
th_ "Viernes"
|
||||
th_ "Sabado"
|
||||
th_ "Domingo"
|
||||
|
||||
tbody_ $ do
|
||||
forM_ weeks $ \week -> do
|
||||
table_ [class_ "calendar-table"] $ do
|
||||
thead_ $ do
|
||||
tr_ $ do
|
||||
forM_ week $ \d -> do
|
||||
let (_, dM, dD) = toGregorian d
|
||||
isCurrentMonth = dM == month
|
||||
isToday = d == today
|
||||
th_ "Lunes"
|
||||
th_ "Martes"
|
||||
th_ "Miercoles"
|
||||
th_ "Jueves"
|
||||
th_ "Viernes"
|
||||
th_ "Sabado"
|
||||
th_ "Domingo"
|
||||
|
||||
baseClasses = []
|
||||
monthClass = if isCurrentMonth then [] else ["other-month"]
|
||||
todayClass = if isToday then ["current-day"] else []
|
||||
finalClass = T.intercalate " " (baseClasses ++ monthClass ++ todayClass)
|
||||
tbody_ $ do
|
||||
forM_ weeks $ \week -> do
|
||||
tr_ $ do
|
||||
forM_ week $ \d -> do
|
||||
let (_, dM, dD) = toGregorian d
|
||||
isCurrentMonth = dM == month
|
||||
isToday = d == today
|
||||
|
||||
-- TODO: lookup very slow :(
|
||||
dayEvents = fromMaybe [] (lookup d groupedEvents)
|
||||
baseClasses = []
|
||||
monthClass = if isCurrentMonth then [] else ["other-month"]
|
||||
todayClass = if isToday then ["current-day"] else []
|
||||
finalClass = T.intercalate " " (baseClasses ++ monthClass ++ todayClass)
|
||||
|
||||
-- cool
|
||||
td_ ([class_ finalClass | not (T.null finalClass)]) $ do
|
||||
span_ [class_ "day-number"] (toHtml $ show dD)
|
||||
-- TODO: lookup very slow :(
|
||||
dayEvents = fromMaybe [] (lookup d groupedEvents)
|
||||
|
||||
if null dayEvents
|
||||
then return ()
|
||||
else ul_ [class_ "event-list"] $ do
|
||||
forM_ dayEvents $ \e ->
|
||||
renderCalendarEvent e
|
||||
-- cool
|
||||
td_ ([class_ finalClass | not (T.null finalClass)]) $ do
|
||||
span_ [class_ "day-number"] (toHtml $ show dD)
|
||||
|
||||
if null dayEvents
|
||||
then return ()
|
||||
else ul_ [class_ "event-list"] $ do
|
||||
forM_ dayEvents $ \e ->
|
||||
renderCalendarEvent e
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@
|
|||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Geo;
|
||||
src: url("/Geo-Regular.woff2");
|
||||
/* url of the font */
|
||||
font-family: Geo;
|
||||
font-display: optional;
|
||||
}
|
||||
|
||||
/* idk this is good? */
|
||||
|
|
@ -182,7 +182,7 @@ figure {
|
|||
|
||||
figcaption {
|
||||
font-size: 0.9rem;
|
||||
color: var(--grey-muted);
|
||||
color: var(--ui-blue);
|
||||
margin-top: 5px;
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue