| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-03-17 00:55:26 +0100 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-03-17 00:55:26 +0100 | 
| commit | b6fa3b730fe0c4249e714545ca88d2729c815a9b (patch) | |
| tree | b14c8e4952a22f8d2943283ca9870a05ccf086e0 /src/shared/battle/Battle/View/Gauge.elm | |
| parent | a3c380b2813c9928a2ee600c276295c7803e9e66 (diff) | |
...
Diffstat (limited to 'src/shared/battle/Battle/View/Gauge.elm')
| -rw-r--r-- | src/shared/battle/Battle/View/Gauge.elm | 75 | 
1 files changed, 75 insertions, 0 deletions
| diff --git a/src/shared/battle/Battle/View/Gauge.elm b/src/shared/battle/Battle/View/Gauge.elm new file mode 100644 index 0000000..29a97a0 --- /dev/null +++ b/src/shared/battle/Battle/View/Gauge.elm @@ -0,0 +1,75 @@ +module Battle.View.Gauge exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes + +-- Local Module ---------------------------------------------------------------- +import Struct.Event + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_text_div : ( +      String -> +      List (Html.Attribute Struct.Event.Type) -> +      (Html.Html Struct.Event.Type) +   ) +get_text_div text extra_txt_attr = +   (Html.div +      ( +         [(Html.Attributes.class "gauge-text")] +         ++ extra_txt_attr +      ) +      [ +         (Html.text text) +      ] +   ) + +get_bar_div : ( +      Float -> +      List (Html.Attribute Struct.Event.Type) -> +      (Html.Html Struct.Event.Type) +   ) +get_bar_div percent extra_bar_attr = +   (Html.div +      ( +         [ +            (Html.Attributes.style +               "width" +               ((String.fromFloat percent) ++ "%") +            ), +            (Html.Attributes.class +               "gauge-bar" +            ) +         ] +         ++ +         extra_bar_attr +      ) +      [ +      ] +   ) + + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : ( +      String -> +      Float -> +      List (Html.Attribute Struct.Event.Type) -> +      List (Html.Attribute Struct.Event.Type) -> +      List (Html.Attribute Struct.Event.Type) -> +      (Html.Html Struct.Event.Type) +   ) +get_html text percent extra_div_attr extra_bar_attr extra_txt_attr = +   (Html.div +      ( +         [(Html.Attributes.class "gauge")] +         ++ extra_div_attr +      ) +      [ +         (get_text_div text extra_txt_attr), +         (get_bar_div percent extra_bar_attr) +      ] +   ) | 


