From 05ea4501c05097e3c401c24f8c38d0d0db002e00 Mon Sep 17 00:00:00 2001 From: Joel Stålnacke Date: Sun, 3 Aug 2025 16:07:43 +0300 Subject: Add a base path /tj Fix deployment --- Aamukampa.Core/Aamukampa.Core.fsproj | 1 + Aamukampa.Core/Config.fs | 4 ++++ Aamukampa.Core/Views.fs | 29 +++++++++++++++++------------ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 Aamukampa.Core/Config.fs (limited to 'Aamukampa.Core') diff --git a/Aamukampa.Core/Aamukampa.Core.fsproj b/Aamukampa.Core/Aamukampa.Core.fsproj index bc6029f..c0afaae 100644 --- a/Aamukampa.Core/Aamukampa.Core.fsproj +++ b/Aamukampa.Core/Aamukampa.Core.fsproj @@ -7,6 +7,7 @@ + diff --git a/Aamukampa.Core/Config.fs b/Aamukampa.Core/Config.fs new file mode 100644 index 0000000..f960fb2 --- /dev/null +++ b/Aamukampa.Core/Config.fs @@ -0,0 +1,4 @@ +module Aamukampa.Core.Config + +[] +let pathBase = "/tj/" diff --git a/Aamukampa.Core/Views.fs b/Aamukampa.Core/Views.fs index 09bc236..a447688 100644 --- a/Aamukampa.Core/Views.fs +++ b/Aamukampa.Core/Views.fs @@ -1,10 +1,12 @@ -namespace TJLaskuri.Core.Views +namespace Aamukampa.Core.Views open System +open System.IO open Falco.Markup open Elem open Attr open Text +open Aamukampa.Core module Document = let view documentBody = @@ -13,8 +15,8 @@ module Document = meta [ charset "utf-8" ] meta [ name "viewport"; content "width=device-width" ] Elem.title [] [ raw "Aamukampa" ] - script [ type' "module"; src "/js/app.js" ] [] - link [ rel "stylesheet"; href "/styles.css" ] + script [ type' "module"; src (Path.Combine(Config.pathBase, "js/app.js")) ] [] + link [ rel "stylesheet"; href (Path.Combine(Config.pathBase, "styles.css")) ] ] body [] [ documentBody @@ -37,7 +39,7 @@ module Main = enc (string <| Math.Ceiling model.TimeLeft.TotalDays) ] Elem.span [ class' "counter_mornings" ] [ - raw " aamua" + raw "aamua" ] ] @@ -45,20 +47,23 @@ module Main = let p = 100.0 * (1.0 - model.TimeLeft / (model.TimeLeft + model.TimeCompleted)) let cssWidth = sprintf "%s%%" (p.ToString("F2")) - div [ - class' "progress-bar_value" - style <| - sprintf "background-color: green; width: %s" - cssWidth - ] [ - span <| sprintf "%s %%" (p.ToString("F2")) + Elem.span [ class' "progress-bar_label" ] [ + raw <| sprintf "%s %%" (p.ToString("F2")) + ] + div [ class' "progress-bar_bar" ] [ + div [ + class' "progress-bar_value" + style <| + sprintf "width: %s" + cssWidth + ] [] ] ] Elem.p [ style "text-align: center; font-size: 1.5rem;" ] [ - enc "2/25 347" + enc "2/25 255" ] // div [] [ -- cgit v1.2.3