diff --git a/frontend/src/Config/Colour.elm b/frontend/src/Config/Colour.elm new file mode 100644 index 0000000..661b3eb --- /dev/null +++ b/frontend/src/Config/Colour.elm @@ -0,0 +1,27 @@ +module Config.Colour exposing (..) + +import Element exposing (..) +import Element.Background as B +import Element.Font as F +import Html.Attributes as H exposing (style) + + +type alias Theme = + { nonHighlightedText : Color + , nonHighlightedDarkText : Color + , highlightText : Color + , highlightTextHover : Color + , backgroundColour : Color + , debugColour : Color + } + + +colourTheme : Theme +colourTheme = + { nonHighlightedText = rgb255 212 212 212 + , nonHighlightedDarkText = rgb255 126 126 126 + , highlightText = rgb255 204 102 0 + , highlightTextHover = rgb255 120 60 0 + , backgroundColour = rgb255 40 40 40 + , debugColour = rgb255 227 28 121 + } diff --git a/frontend/src/Config/Theme.elm b/frontend/src/Config/Format.elm similarity index 81% rename from frontend/src/Config/Theme.elm rename to frontend/src/Config/Format.elm index ab4954e..2b15700 100755 --- a/frontend/src/Config/Theme.elm +++ b/frontend/src/Config/Format.elm @@ -1,5 +1,6 @@ -module Config.Theme exposing (..) +module Config.Format exposing (..) +import Config.Colour exposing (..) import Element exposing (..) import Element.Background as B import Element.Font as F @@ -25,27 +26,6 @@ pageList = ] -type alias Theme = - { nonHighlightedText : Color - , nonHighlightedDarkText : Color - , highlightText : Color - , highlightTextHover : Color - , backgroundColour : Color - , debugColour : Color - } - - -colourTheme : Theme -colourTheme = - { nonHighlightedText = rgb255 212 212 212 - , nonHighlightedDarkText = rgb255 126 126 126 - , highlightText = rgb255 204 102 0 - , highlightTextHover = rgb255 120 60 0 - , backgroundColour = rgb255 40 40 40 - , debugColour = rgb255 227 28 121 - } - - transitionStyle : Attribute msg transitionStyle = htmlAttribute <| style "transition" "all .2s" @@ -119,10 +99,24 @@ paragraphLinkFormat = ] +paragraphSpacing : Attribute msg +paragraphSpacing = + spacing 8 + + paragraphText : List (Attr () msg) paragraphText = [ F.color colourTheme.nonHighlightedText - , spacing 8 + , paragraphSpacing + , paragraphFontSize + ] + + +paragraphHightlightedBoldText : List (Attr () msg) +paragraphHightlightedBoldText = + [ F.color colourTheme.highlightText + , F.bold + , paragraphSpacing , paragraphFontSize ] @@ -149,6 +143,11 @@ paragraphAlignLeft = [ alignLeft, paragraphWidth ] ++ paragraphText +paragraphAlignCenter : List (Attr () msg) +paragraphAlignCenter = + [ centerX, paragraphWidth ] + ++ paragraphText + paragraphColumnFormat : List (Attribute msg) paragraphColumnFormat = diff --git a/frontend/src/Config/Identity.elm b/frontend/src/Config/Identity.elm index 41ea362..cf1c690 100755 --- a/frontend/src/Config/Identity.elm +++ b/frontend/src/Config/Identity.elm @@ -1,7 +1,5 @@ module Config.Identity exposing (..) -import Element exposing (..) - type alias PageInput = { pageHome : String diff --git a/frontend/src/Layouts/Navbar.elm b/frontend/src/Layouts/Navbar.elm index 21fc448..d56d3ea 100755 --- a/frontend/src/Layouts/Navbar.elm +++ b/frontend/src/Layouts/Navbar.elm @@ -1,7 +1,8 @@ module Layouts.Navbar exposing (Model, Msg, Props, layout) -import Config.Identity as ID exposing (..) -import Config.Theme as T exposing (..) +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) import Effect exposing (Effect) import Element exposing (..) import Element.Background as B diff --git a/frontend/src/Pages/Dodgers.elm b/frontend/src/Pages/Dodgers.elm index 4d5927d..4b6fa9c 100755 --- a/frontend/src/Pages/Dodgers.elm +++ b/frontend/src/Pages/Dodgers.elm @@ -1,7 +1,8 @@ module Pages.Dodgers exposing (Model, Msg, page) -import Config.Identity exposing (dodgersName) -import Config.Theme as T exposing (..) +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) import Effect exposing (Effect) import Element exposing (..) import Element.Font as F diff --git a/frontend/src/Pages/Home_.elm b/frontend/src/Pages/Home_.elm index 147eb0b..30e356f 100755 --- a/frontend/src/Pages/Home_.elm +++ b/frontend/src/Pages/Home_.elm @@ -1,7 +1,8 @@ module Pages.Home_ exposing (Model, Msg, page) -import Config.Identity as ID exposing (..) -import Config.Theme as T exposing (..) +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) import Effect exposing (Effect) import Element exposing (..) import Html.Attributes as H exposing (style) diff --git a/frontend/src/Pages/Platforms.elm b/frontend/src/Pages/Platforms.elm index 767e331..0fd3e8c 100755 --- a/frontend/src/Pages/Platforms.elm +++ b/frontend/src/Pages/Platforms.elm @@ -1,7 +1,8 @@ module Pages.Platforms exposing (Model, Msg, page) -import Config.Identity as ID exposing (..) -import Config.Theme as T exposing (..) +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) import Effect exposing (Effect) import Element exposing (..) import Element.Font as F diff --git a/frontend/src/Pages/Propositions.elm b/frontend/src/Pages/Propositions.elm new file mode 100644 index 0000000..d3c686a --- /dev/null +++ b/frontend/src/Pages/Propositions.elm @@ -0,0 +1,200 @@ +module Pages.Propositions exposing (Model, Msg, page) + +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) +import Effect exposing (Effect) +import Element exposing (..) +import Element.Font as F +import Html +import Html.Attributes as H exposing (style) +import Layouts +import Page exposing (Page) +import Route exposing (Route) +import Shared +import View exposing (View) + + +page : Shared.Model -> Route () -> Page Model Msg +page shared route = + Page.new + { init = init + , update = update + , subscriptions = subscriptions + , view = view + } + |> Page.withLayout toLayout + + +toLayout : Model -> Layouts.Layout Msg +toLayout model = + Layouts.Navbar {} + + + +-- INIT + + +type alias Model = + {} + + +init : () -> ( Model, Effect Msg ) +init () = + ( {} + , Effect.none + ) + + + +-- UPDATE + + +type Msg + = NoOp + + +update : Msg -> Model -> ( Model, Effect Msg ) +update msg model = + case msg of + NoOp -> + ( model + , Effect.none + ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + Sub.none + + + +-- VIEW + + +view : Model -> View Msg +view model = + { title = propositionsName + , attributes = [] + , element = propositionsContainer + } + + +propositionsContainer : Element msg +propositionsContainer = + topLevelContainer propositionsList + + +propositionsList : Element msg +propositionsList = + column + pageList + propositions + + +type alias MakeRowInput = + { propositionTitle : String + , propositionSummary : String + , definitionTable : List Definition + , argumentFormalization : List ArgumentEntry + } + + +type alias ArgumentEntry = + { premises : List String + , conclusion : String + } + + +type alias Definition = + { definiendum : String + , definiens : String + } + + +makeRow : MakeRowInput -> Element msg +makeRow makeRowInput = + let + argRows : List (Element msg) + argRows = + List.indexedMap + (\index argumentEntry -> + column paragraphFormat + (List.indexedMap + (\premiseIndex premise -> + row paragraphHightlightedBoldText + [ text ("P" ++ String.fromInt (premiseIndex + 1) ++ ")") + , text premise |> el [ F.color colourTheme.nonHighlightedText, F.regular ] + ] + ) + argumentEntry.premises + ++ [ row paragraphHightlightedBoldText + [ text ("C" ++ String.fromInt (index + 1) ++ ")") + , text argumentEntry.conclusion |> el [ F.color colourTheme.nonHighlightedText, F.regular ] + ] + ] + ) + ) + makeRowInput.argumentFormalization + in + column + [ paragraphWidth, alignLeft, spacing 8 ] + [ row paragraphBoldFormat + [ text "Proposition:" |> el [ F.color colourTheme.highlightText ] + , text makeRowInput.propositionTitle |> el [ F.color colourTheme.nonHighlightedText, F.regular ] + ] + , row paragraphBoldFormat + [ text "Summary:" |> el [ F.color colourTheme.highlightText ] + , text makeRowInput.propositionSummary |> el [ F.color colourTheme.nonHighlightedText, F.regular ] + ] + , row (paragraphBoldFormat ++ [ alignLeft ]) + [ Element.table [ spacing 8 ] + { data = makeRowInput.definitionTable + , columns = + [ { header = el [ F.bold ] (text "Definiendum" |> el [ F.color colourTheme.highlightText ]) + , width = fill + , view = + \definition -> + text definition.definiendum |> el [ F.color colourTheme.nonHighlightedText, F.regular] + } + , { header = el [ F.bold ] (text "Definiens" |> el [ F.color colourTheme.highlightText ]) + , width = fill + , view = + \definition -> + text definition.definiens |> el [ F.color colourTheme.nonHighlightedText, F.regular] + } + ] + } + ] + , column [ centerX, paragraphSpacing ] argRows + ] + + +propositions = + List.map makeRow + [ { propositionTitle = "String" + , propositionSummary = "String" + , definitionTable = + [ { definiendum = "Term 1" + , definiens = "Definition 1" + } + , { definiendum = "Term 2" + , definiens = "Definition 2" + } + ] + , argumentFormalization = + [ { premises = + [ "First premise" + , "Second premise" + , "Third premise" + , "Fourth premise" + ] + , conclusion = "Conclusion" + } + ] + } + ] diff --git a/frontend/src/Pages/Services.elm b/frontend/src/Pages/Services.elm index 6c55788..68c6e85 100755 --- a/frontend/src/Pages/Services.elm +++ b/frontend/src/Pages/Services.elm @@ -1,7 +1,8 @@ module Pages.Services exposing (Model, Msg, page) -import Config.Identity as ID exposing (..) -import Config.Theme as T exposing (..) +import Config.Colour as T exposing (..) +import Config.Format as O exposing (..) +import Config.Identity as I exposing (..) import Effect exposing (Effect) import Element exposing (..) import Element.Font as F