summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-09-12 17:49:43 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-09-12 17:49:43 +0200 |
commit | 512d266bc7da3bfcd55d23fdb6de7e4ba5293165 (patch) | |
tree | 83366e4c66e72789fed818682a860759178c519d | |
parent | 18bd70b35597a0581cfe59f07927e03492a8be81 (diff) |
Experimenting with icons
-rw-r--r-- | src/css/src/shared/omnimod-icons.scss | 5 | ||||
-rw-r--r-- | src/shared/battle/Battle/View/Attribute.elm | 90 | ||||
-rw-r--r-- | src/shared/battle/Battle/View/DamageType.elm | 68 |
3 files changed, 56 insertions, 107 deletions
diff --git a/src/css/src/shared/omnimod-icons.scss b/src/css/src/shared/omnimod-icons.scss index 32835dc..1c80411 100644 --- a/src/css/src/shared/omnimod-icons.scss +++ b/src/css/src/shared/omnimod-icons.scss @@ -1,12 +1,13 @@ .omnimod-icon { display: inline-block; - min-height: 1.5em; - min-width: 1.5em; + min-height: 3em; + min-width: 3em; background-size: 1.5em; background-repeat: no-repeat; vertical-align: middle; background-position: center; + text-align: center; } .omnimod-icon-dmg, diff --git a/src/shared/battle/Battle/View/Attribute.elm b/src/shared/battle/Battle/View/Attribute.elm index 9b2a8c7..5c53b4c 100644 --- a/src/shared/battle/Battle/View/Attribute.elm +++ b/src/shared/battle/Battle/View/Attribute.elm @@ -41,6 +41,13 @@ get_html attribute value = (Struct.HelpRequest.Attribute attribute) ) ), + (Html.Attributes.class "omnimod-icon"), + (Html.Attributes.class + ( + "omnimod-icon-" + ++ (Battle.Struct.Attributes.encode_category attribute) + ) + ), (Html.Attributes.class ( if (value < 0) @@ -53,32 +60,12 @@ get_html attribute value = ) ] [ - (Html.div - [ - (Html.Attributes.class "omnimod-icon"), - (Html.Attributes.class - ( - "omnimod-icon-" - ++ (Battle.Struct.Attributes.encode_category attribute) - ) - ) - ] - [ - ] - ), - (Html.div - [ - (Html.Attributes.class "omnimod-value") - ] - [ - (Html.text - ( - if (Battle.Struct.Attributes.is_percent attribute) - then ((String.fromInt value) ++ "%") - else (String.fromInt value) - ) - ) - ] + (Html.text + ( + if (Battle.Struct.Attributes.is_percent attribute) + then ((String.fromInt value) ++ "%") + else (String.fromInt value) + ) ) ] ) @@ -96,6 +83,13 @@ get_signed_html attribute value = then (Html.Attributes.class "omnimod-negative") else (Html.Attributes.class "omnimod-positive") ), + (Html.Attributes.class "omnimod-icon"), + (Html.Attributes.class + ( + "omnimod-icon-" + ++ (Battle.Struct.Attributes.encode_category attribute) + ) + ), (Html.Events.onClick (Struct.Event.RequestedHelp (Struct.HelpRequest.Attribute attribute) @@ -103,40 +97,20 @@ get_signed_html attribute value = ) ] [ - (Html.div - [ - (Html.Attributes.class "omnimod-icon"), - (Html.Attributes.class - ( - "omnimod-icon-" - ++ (Battle.Struct.Attributes.encode_category attribute) - ) + (Html.text + ( + ( + if (value > 0) + then ("+" ++ (String.fromInt value)) + else (String.fromInt value) ) - ] - [ - ] - ), - (Html.div - [ - (Html.Attributes.class "omnimod-value") - ] - [ - (Html.text - ( - ( - if (value > 0) - then ("+" ++ (String.fromInt value)) - else (String.fromInt value) - ) - ++ - ( - if (Battle.Struct.Attributes.is_percent attribute) - then "%" - else "" - ) - ) + ++ + ( + if (Battle.Struct.Attributes.is_percent attribute) + then "%" + else "" ) - ] + ) ) ] ) diff --git a/src/shared/battle/Battle/View/DamageType.elm b/src/shared/battle/Battle/View/DamageType.elm index eee2838..4f74133 100644 --- a/src/shared/battle/Battle/View/DamageType.elm +++ b/src/shared/battle/Battle/View/DamageType.elm @@ -33,6 +33,13 @@ get_html : ( get_html damage_type value = (Html.div [ + (Html.Attributes.class "omnimod-icon"), + (Html.Attributes.class + ( + "omnimod-icon-" + ++ (Battle.Struct.DamageType.encode damage_type) + ) + ), (Html.Events.onClick (Struct.Event.RequestedHelp (Struct.HelpRequest.DamageType damage_type) @@ -40,27 +47,7 @@ get_html damage_type value = ) ] [ - (Html.div - [ - (Html.Attributes.class "omnimod-icon"), - (Html.Attributes.class - ( - "omnimod-icon-" - ++ (Battle.Struct.DamageType.encode damage_type) - ) - ) - ] - [ - ] - ), - (Html.div - [ - (Html.Attributes.class "omnimod-value") - ] - [ - (Html.text (String.fromInt value)) - ] - ) + (Html.text (String.fromInt value)) ] ) @@ -77,6 +64,13 @@ get_signed_html damage_type value = then (Html.Attributes.class "omnimod-negative") else (Html.Attributes.class "omnimod-positive") ), + (Html.Attributes.class "omnimod-icon"), + (Html.Attributes.class + ( + "omnimod-icon-" + ++ (Battle.Struct.DamageType.encode damage_type) + ) + ), (Html.Events.onClick (Struct.Event.RequestedHelp (Struct.HelpRequest.DamageType damage_type) @@ -84,32 +78,12 @@ get_signed_html damage_type value = ) ] [ - (Html.div - [ - (Html.Attributes.class "omnimod-icon"), - (Html.Attributes.class - ( - "omnimod-icon-" - ++ (Battle.Struct.DamageType.encode damage_type) - ) - ) - ] - [ - ] - ), - (Html.div - [ - (Html.Attributes.class "omnimod-value") - ] - [ - (Html.text - ( - if (value > 0) - then ("+" ++ (String.fromInt value)) - else (String.fromInt value) - ) - ) - ] + (Html.text + ( + if (value > 0) + then ("+" ++ (String.fromInt value)) + else (String.fromInt value) + ) ) ] ) |