diff options
| author | Joel Stålnacke <joel@saker.fi> | 2025-09-28 15:27:46 +0300 |
|---|---|---|
| committer | Joel Stålnacke <joel@saker.fi> | 2025-09-28 15:27:46 +0300 |
| commit | 2fada39cb389ae8f6c2797c33daa9b4a8e584ca6 (patch) | |
| tree | 5cb4aa743a5209da2fcf84cab8e86df5cd3847dc | |
| parent | 29c2b9089e70ef9b729e1a6a191848ca58fb470e (diff) | |
Vendor fonts
Fonts load faster
| -rw-r--r-- | Aamukampa.Web/Program.fs | 4 | ||||
| -rw-r--r-- | Aamukampa.Web/Views.fs | 17 | ||||
| -rw-r--r-- | Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.otf | bin | 0 -> 138088 bytes | |||
| -rw-r--r-- | Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.ttf | bin | 0 -> 80388 bytes | |||
| -rw-r--r-- | Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff | bin | 0 -> 65136 bytes | |||
| -rw-r--r-- | Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff2 | bin | 0 -> 25148 bytes | |||
| -rw-r--r-- | Aamukampa.Web/wwwroot/styles.css | 13 |
7 files changed, 18 insertions, 16 deletions
diff --git a/Aamukampa.Web/Program.fs b/Aamukampa.Web/Program.fs index 81ed098..bf8d72b 100644 --- a/Aamukampa.Web/Program.fs +++ b/Aamukampa.Web/Program.fs @@ -14,11 +14,11 @@ let main args = let builder = WebApplication.CreateBuilder(args) let app = builder.Build() - app.MapStaticAssets() |> ignore - if (Config.pathBase.TrimEnd('/')) <> "" then app.UsePathBase(Config.pathBase) |> ignore + app.MapStaticAssets() |> ignore + app .UseRouting() .UseFalco(endpoints) diff --git a/Aamukampa.Web/Views.fs b/Aamukampa.Web/Views.fs index 94392eb..021ea7e 100644 --- a/Aamukampa.Web/Views.fs +++ b/Aamukampa.Web/Views.fs @@ -14,9 +14,24 @@ module Document = 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 ] diff --git a/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.otf b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.otf Binary files differnew file mode 100644 index 0000000..3de597e --- /dev/null +++ b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.otf diff --git a/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.ttf b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.ttf Binary files differnew file mode 100644 index 0000000..79e7048 --- /dev/null +++ b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.ttf diff --git a/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff Binary files differnew file mode 100644 index 0000000..de9d925 --- /dev/null +++ b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff diff --git a/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff2 b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff2 Binary files differnew file mode 100644 index 0000000..b519250 --- /dev/null +++ b/Aamukampa.Web/wwwroot/fonts/CooperBlack-Regular.woff2 diff --git a/Aamukampa.Web/wwwroot/styles.css b/Aamukampa.Web/wwwroot/styles.css index d492bd1..e587881 100644 --- a/Aamukampa.Web/wwwroot/styles.css +++ b/Aamukampa.Web/wwwroot/styles.css @@ -6,19 +6,6 @@ html { font-size: 100%; } -@font-face { - font-family: 'Cooper Black'; - font-weight: normal; - font-style: normal; - font-display: swap; - src: - local('Cooper Black'), - url('https://cdn.jsdelivr.net/npm/fonts-archive-cooper-black/CooperBlack-Regular.woff2') format('woff2'), - url('https://cdn.jsdelivr.net/npm/fonts-archive-cooper-black/CooperBlack-Regular.woff') format('woff'), - url('https://cdn.jsdelivr.net/npm/fonts-archive-cooper-black/CooperBlack-Regular.otf') format('opentype'), - url('https://cdn.jsdelivr.net/npm/fonts-archive-cooper-black/CooperBlack-Regular.ttf') format('truetype'); -} - body { font-family: "Cooper Black", serif; font-weight: bold; |
