From 3fd7c9d99825544e983ba7390b61968d20ff3a9f Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Thu, 9 Aug 2018 14:27:14 +0200 Subject: Working on the appearance of the login page... --- src/login/src/ElmModule/View.elm | 5 +++ src/login/src/View/Header.elm.m4 | 76 +++++++++++++++++++++++++++++++++++++ src/login/src/View/MainMenu.elm | 82 ++++++++++++++++++++++++++++++++++++++++ src/login/www/index.html | 1 - 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 src/login/src/View/Header.elm.m4 create mode 100644 src/login/src/View/MainMenu.elm (limited to 'src/login') diff --git a/src/login/src/ElmModule/View.elm b/src/login/src/ElmModule/View.elm index 558decd..55e720f 100644 --- a/src/login/src/ElmModule/View.elm +++ b/src/login/src/ElmModule/View.elm @@ -9,6 +9,9 @@ import Html.Attributes import Struct.Event import Struct.Model +import View.Header +import View.MainMenu + -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -23,5 +26,7 @@ view model = (Html.Attributes.class "fullscreen-module") ] [ + (View.Header.get_html), + (View.MainMenu.get_html) ] ) diff --git a/src/login/src/View/Header.elm.m4 b/src/login/src/View/Header.elm.m4 new file mode 100644 index 0000000..81ac132 --- /dev/null +++ b/src/login/src/View/Header.elm.m4 @@ -0,0 +1,76 @@ +module View.Header exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes +import Html.Events + +-- Map ------------------------------------------------------------------- +import Struct.Event +import Struct.UI + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +link_html : String -> String -> Bool -> (Html.Html Struct.Event.Type) +link_html src label is_active = + (Html.a + [ + (Html.Attributes.src src) + ] + [ + ( + if (is_active) + then (Html.text label) + else (Html.s [] [(Html.text label)]) + ) + ] + ) + +navigation_html : (Html.Html Struct.Event.Type) +navigation_html = + (Html.nav + [] + [ + (link_html "/login/" "Play" False), + (link_html "/news/" "News" False), + (link_html "/community/" "Community" False), + (link_html "/about/" "About" False), + (link_html "/battle/?id=0" "[D] Battle" True), + (link_html "/map-editor/?id=0" "[D] Map Editor" True) + ] + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : (Html.Html Struct.Event.Type) +get_html = + (Html.header + [] + [ + (Html.div + [ + (Html.Attributes.class "main-server-logo") + ] + [ + (Html.img + [ + (Html.Attributes.src "__CONF_SERVER_LOGO") + ] + [ + ] + ) + ] + ), + (Html.div + [ + (Html.Attributes.class "main-server-version") + ] + [ + (Html.text "__CONF_VERSION") + ] + ), + (navigation_html) + ] + ) diff --git a/src/login/src/View/MainMenu.elm b/src/login/src/View/MainMenu.elm new file mode 100644 index 0000000..018b9ba --- /dev/null +++ b/src/login/src/View/MainMenu.elm @@ -0,0 +1,82 @@ +module View.MainMenu exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes +import Html.Events + +-- Map ------------------------------------------------------------------- +import Struct.Event +import Struct.UI + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +link_html : String -> Bool -> (Html.Html Struct.Event.Type) +link_html label is_active = + (Html.a + [ + (Html.Attributes.class + ( + if (is_active) + then "active" + else "inactive" + ) + ) + ] + [ + (Html.text label) + ] + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : (Html.Html Struct.Event.Type) +get_html = + (Html.main_ + [ + ] + [ + (Html.nav + [] + [ + (link_html "Login" True), + (link_html "Create Account" False), + (link_html "Recover Account" False) + ] + ), + (Html.article + [] + [ + (Html.div + [ + (Html.Attributes.class "user-input") + ] + [ + (Html.h1 [] [(Html.text "Username")]), + (Html.input [] []) + ] + ), + (Html.div + [ + (Html.Attributes.class "user-input") + ] + [ + (Html.h1 [] [(Html.text "Password")]), + (Html.input + [ + (Html.Attributes.type_ "password") + ] + [] + ) + ] + ), + (Html.button + [] + [ (Html.text "Send") ] + ) + ] + ) + ] + ) diff --git a/src/login/www/index.html b/src/login/www/index.html index d2e13fd..459c550 100644 --- a/src/login/www/index.html +++ b/src/login/www/index.html @@ -2,7 +2,6 @@ - -- cgit v1.2.3-70-g09d2