aboutsummaryrefslogtreecommitdiff
path: root/Aamukampa.Web/Views.fs
blob: 021ea7e8d4bee7005f853e67640b0de57f8adee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace Aamukampa.Web.Views

open System
open Falco.Markup
open Elem
open Attr
open Text
open Aamukampa.Core

module Document =
    let view documentBody =
        html [ lang "fi" ] [
            head [] [ 
                meta [ charset "utf-8" ]
                meta [ name "viewport"; content "width=device-width" ]
                Elem.title [] [ raw "Aamukampa" ]
                let fontFile format = sprintf "%sfonts/CooperBlack-Regular.%s" Config.pathBase format
                Elem.style [] [ raw <| sprintf """@font-face {
    font-family: 'Cooper Black';
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    src:
         local('Cooper Black'),
         url('%s') format('woff2'),
         url('%s') format('woff'),
         url('%s') format('opentype'),
         url('%s') format('truetype');
}
"""  (fontFile "woff2") (fontFile "woff") (fontFile "otf") (fontFile "ttf")
                ]
                link [ rel "stylesheet"; href (sprintf "%s%s" Config.pathBase "styles.css") ]
                script [ type' "module"; src (sprintf "%s%s" Config.pathBase "app.js") ] [] 
            ]
            body [] [
                documentBody
            ]
        ]