optional font and accesibility

This commit is contained in:
Daniel Kauss Serna 2026-02-03 11:59:13 +01:00
parent acebe8903a
commit a8b26c1661
2 changed files with 88 additions and 88 deletions

View file

@ -14,18 +14,19 @@ import Text.Printf (printf)
renderHead :: Html () renderHead :: Html ()
renderHead = do renderHead = do
doctype_ doctype_
head_ $ do html_ [lang_ "es"] $ do
meta_ [charset_ "UTF-8"] head_ $ do
meta_ meta_ [charset_ "UTF-8"]
[ name_ "viewport", meta_
content_ "width=device-width, initial-scale=1.0" [ name_ "viewport",
] content_ "width=device-width, initial-scale=1.0"
meta_ ]
[ name_ "description", meta_
content_ "Chipburners home page" [ name_ "description",
] content_ "Chipburners home page"
title_ "Chipburners" ]
link_ [rel_ "stylesheet", href_ "/style.css"] title_ "Chipburners"
link_ [rel_ "stylesheet", href_ "/style.css"]
renderHeader :: Int -> Html () renderHeader :: Int -> Html ()
renderHeader active = renderHeader active =
@ -77,38 +78,36 @@ renderEventList events = mapM_ renderDayGroup (groupEvents events)
renderFrontpage :: [Event] -> Html () renderFrontpage :: [Event] -> Html ()
renderFrontpage events = do renderFrontpage events = do
doctype_ renderHead
html_ [lang_ "es"] $ do body_ $ do
renderHead renderHeader 0
body_ $ do div_ [class_ "wrapper"] $ do
renderHeader 0 div_ [class_ "layout"] $ do
div_ [class_ "wrapper"] $ do main_ [id_ "main-content", class_ "content"] $ do
div_ [class_ "layout"] $ do section_ [class_ "intro"] $ do
main_ [id_ "main-content", class_ "content"] $ do h1_ "Chipburners_"
section_ [class_ "intro"] $ do p_ [class_ "lead"] $
h1_ "Chipburners_" "Frase motivadora aqui"
p_ [class_ "lead"] $ p_ $ do
"Frase motivadora aqui" "Buenos dias, "
p_ $ do br_ []
"Buenos dias, " "Somos un grupo d personas y entidades interesados en infromatica y \
br_ [] \las technologias relacionadas. "
"Somos un grupo d personas y entidades interesados en infromatica y \ br_ []
\las technologias relacionadas. " "Este hackerspace ha sido creado como manera d juntar gente con intereses \
br_ [] \similares y compartir conocimientos. "
"Este hackerspace ha sido creado como manera d juntar gente con intereses \ br_ []
\similares y compartir conocimientos. " "Contactanos en "
br_ [] a_ [href_ "/contact"] "signal"
"Contactanos en " "!"
a_ [href_ "/contact"] "signal"
"!"
section_ [class_ "image-gallery"] $ do section_ [class_ "image-gallery"] $ do
renderImage "example.com" "Imagen sobre algo" "Imagen interesante" renderImage "example.com" "Imagen sobre algo" "Imagen interesante"
aside_ [class_ "sidebar"] $ do aside_ [class_ "sidebar"] $ do
section_ [class_ "events-panel"] $ do section_ [class_ "events-panel"] $ do
h2_ "Eventos" h2_ "Eventos"
renderEventList events renderEventList events
chunksOf :: Int -> [a] -> [[a]] chunksOf :: Int -> [a] -> [[a]]
chunksOf _ [] = [] chunksOf _ [] = []
@ -171,54 +170,55 @@ renderMonthview (year, month) today groupedEvents = do
label label
renderHead renderHead
renderHeader 1 body_ $ do
div_ [class_ "calendar-wrapper"] $ do renderHeader 1
header_ [class_ "calendar-header"] $ do div_ [class_ "calendar-wrapper"] $ do
h1_ [class_ "view-title"] "Vista mensual" header_ [class_ "calendar-header"] $ do
h1_ [class_ "view-title"] "Vista mensual"
nav_ [class_ "calendar-nav"] $ do nav_ [class_ "calendar-nav"] $ do
mkLink py pm "« Mes pasado" mkLink py pm "« Mes pasado"
mkLink cy cm "Este mes" mkLink cy cm "Este mes"
mkLink ny nm "Mes siguiente »" mkLink ny nm "Mes siguiente »"
h2_ [class_ "month-name"] $ h2_ [class_ "month-name"] $
toHtml $ toHtml $
formatTime defaultTimeLocale "%B %Y" $ formatTime defaultTimeLocale "%B %Y" $
fromGregorian year month 1 fromGregorian year month 1
table_ [class_ "calendar-table"] $ do table_ [class_ "calendar-table"] $ do
thead_ $ 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
tr_ $ do tr_ $ do
forM_ week $ \d -> do th_ "Lunes"
let (_, dM, dD) = toGregorian d th_ "Martes"
isCurrentMonth = dM == month th_ "Miercoles"
isToday = d == today th_ "Jueves"
th_ "Viernes"
th_ "Sabado"
th_ "Domingo"
baseClasses = [] tbody_ $ do
monthClass = if isCurrentMonth then [] else ["other-month"] forM_ weeks $ \week -> do
todayClass = if isToday then ["current-day"] else [] tr_ $ do
finalClass = T.intercalate " " (baseClasses ++ monthClass ++ todayClass) forM_ week $ \d -> do
let (_, dM, dD) = toGregorian d
isCurrentMonth = dM == month
isToday = d == today
-- TODO: lookup very slow :( baseClasses = []
dayEvents = fromMaybe [] (lookup d groupedEvents) monthClass = if isCurrentMonth then [] else ["other-month"]
todayClass = if isToday then ["current-day"] else []
finalClass = T.intercalate " " (baseClasses ++ monthClass ++ todayClass)
-- cool -- TODO: lookup very slow :(
td_ ([class_ finalClass | not (T.null finalClass)]) $ do dayEvents = fromMaybe [] (lookup d groupedEvents)
span_ [class_ "day-number"] (toHtml $ show dD)
if null dayEvents -- cool
then return () td_ ([class_ finalClass | not (T.null finalClass)]) $ do
else ul_ [class_ "event-list"] $ do span_ [class_ "day-number"] (toHtml $ show dD)
forM_ dayEvents $ \e ->
renderCalendarEvent e if null dayEvents
then return ()
else ul_ [class_ "event-list"] $ do
forM_ dayEvents $ \e ->
renderCalendarEvent e

View file

@ -47,9 +47,9 @@
} }
@font-face { @font-face {
font-family: Geo;
src: url("/Geo-Regular.woff2"); src: url("/Geo-Regular.woff2");
/* url of the font */ font-family: Geo;
font-display: optional;
} }
/* idk this is good? */ /* idk this is good? */
@ -182,7 +182,7 @@ figure {
figcaption { figcaption {
font-size: 0.9rem; font-size: 0.9rem;
color: var(--grey-muted); color: var(--ui-blue);
margin-top: 5px; margin-top: 5px;
text-align: right; text-align: right;
} }