diff --git a/frontend/src/Config/Helpers/Cards/Inner/StrengthBar.elm b/frontend/src/Config/Helpers/Cards/Inner/StrengthBar.elm index 9b5d21f..0152869 100755 --- a/frontend/src/Config/Helpers/Cards/Inner/StrengthBar.elm +++ b/frontend/src/Config/Helpers/Cards/Inner/StrengthBar.elm @@ -7,7 +7,10 @@ import Config.Helpers.Cards.Inner.ToolTip exposing (tooltip) import Config.Style.Colour.Helpers exposing (colourTheme) import Element as E exposing - ( Element + ( Device + , DeviceClass(..) + , Element + , Orientation(..) , alignLeft , column , el @@ -24,26 +27,41 @@ import Element.Border as D , rounded , width ) +import Shared exposing (Model) -barMaker : (Int -> String) -> Int -> Element msg -barMaker getTooltip num = +barMaker : Shared.Model -> (Int -> String) -> Int -> Element msg +barMaker shared getTooltip num = + let + strengthBarAttr = + [ height <| px 12 + , E.width fill + , D.rounded 10 + , D.color colourTheme.textDarkGrey + , D.width 2 + , B.gradient + { angle = 1.57 + , steps = + List.concat + [ List.repeat num colourTheme.barGreen + , List.repeat (10 - num) colourTheme.barRed + ] + } + ] + in el - [ height <| px 12 - , E.width fill - , D.rounded 10 - , D.color colourTheme.textDarkGrey - , D.width 2 - , B.gradient - { angle = 1.57 - , steps = - List.concat - [ List.repeat num colourTheme.barGreen - , List.repeat (10 - num) colourTheme.barRed - ] - } - , tooltip (getTooltip num) True - ] + (strengthBarAttr + ++ (case ( shared.device.class, shared.device.orientation ) of + ( Phone, Portrait ) -> + [] + + ( Tablet, Portrait ) -> + [] + + _ -> + [ tooltip (getTooltip num) True ] + ) + ) none diff --git a/frontend/src/Pages/Contact.elm b/frontend/src/Pages/Contact.elm index de3ecbc..9f41740 100755 --- a/frontend/src/Pages/Contact.elm +++ b/frontend/src/Pages/Contact.elm @@ -12,7 +12,6 @@ import Config.Helpers.Cards.Inner.Text , detailFormat , numberedListItem ) -import Config.Helpers.Cards.Inner.ToolTip exposing (tooltip) import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker) import Config.Helpers.Cards.Outer.Types as C exposing (Cardable(..)) import Config.Helpers.Headers.Helpers exposing (headerMaker) diff --git a/frontend/src/Pages/Debate/Arguments.elm b/frontend/src/Pages/Debate/Arguments.elm index 4ab8a36..f6f4172 100755 --- a/frontend/src/Pages/Debate/Arguments.elm +++ b/frontend/src/Pages/Debate/Arguments.elm @@ -302,7 +302,7 @@ contentList shared model isLinkClicked index argument = ] , detailFormat row [ strengthMaker shared - , barMaker getConfidenceTooltip argument.argumentCertainty + , barMaker shared getConfidenceTooltip argument.argumentCertainty ] ] ] @@ -372,14 +372,22 @@ copyButton shared model isLinkClicked index argument = strengthMaker : Shared.Model -> Element msg strengthMaker shared = el - (if not shared.isNavbarExpanded then - [ tooltip - "This represents how pleasant the host was to engage with." - True - ] + (case ( shared.device.class, shared.device.orientation ) of + ( Phone, Portrait ) -> + [] - else - [] + ( Tablet, Portrait ) -> + [] + + _ -> + if not shared.isNavbarExpanded then + [ tooltip + "This represents my confidence that the argument is sound." + True + ] + + else + [] ) <| detailTitleMaker TextLightOrange "Confidence:" diff --git a/frontend/src/Pages/Debate/Gibberish.elm b/frontend/src/Pages/Debate/Gibberish.elm index 2e45202..f5cdef8 100755 --- a/frontend/src/Pages/Debate/Gibberish.elm +++ b/frontend/src/Pages/Debate/Gibberish.elm @@ -377,14 +377,20 @@ intelligibilityBar shared terms = , E.width fill ] [ el - (if not shared.isNavbarExpanded then - [ tooltip - tooltipMessage - True - ] + (case ( shared.device.class, shared.device.orientation ) of + ( Phone, Portrait ) -> + [] - else - [] + ( Tablet, Portrait ) -> + [] + + _ -> + if not shared.isNavbarExpanded then + [ tooltip tooltipMessage True + ] + + else + [] ) <| (el @@ -401,7 +407,7 @@ intelligibilityBar shared terms = ] ] , barPadding - [ barMaker getIntelligibilityTooltip terms.strength ] + [ barMaker shared getIntelligibilityTooltip terms.strength ] ] diff --git a/frontend/src/Pages/Donate.elm b/frontend/src/Pages/Donate.elm index c1482d1..cee69b4 100755 --- a/frontend/src/Pages/Donate.elm +++ b/frontend/src/Pages/Donate.elm @@ -265,21 +265,29 @@ preferenceMaker : Shared.Model -> Donate -> Element msg preferenceMaker shared donate = detailFormat row [ el - (if not shared.isNavbarExpanded then - [ tooltip - "This represents how strongly I prefer a given platform relative to other platforms." - True - ] + (case ( shared.device.class, shared.device.orientation ) of + ( Phone, Portrait ) -> + [] - else - [] + ( Tablet, Portrait ) -> + [] + + _ -> + if not shared.isNavbarExpanded then + [ tooltip + "This represents how strongly I prefer a given platform relative to other platforms." + True + ] + + else + [] ) <| detailTitleMaker TextLightOrange "Preference:" , barPadding - [ barMaker getPreferenceTooltip donate.donatePreference ] + [ barMaker shared getPreferenceTooltip donate.donatePreference ] ] diff --git a/frontend/src/Pages/Interviews.elm b/frontend/src/Pages/Interviews.elm index aec52ac..c2ba8c1 100755 --- a/frontend/src/Pages/Interviews.elm +++ b/frontend/src/Pages/Interviews.elm @@ -268,19 +268,27 @@ experienceMaker : Shared.Model -> Appearance -> Element msg experienceMaker shared appearanceEntry = detailFormat row [ el - (if not shared.isNavbarExpanded then - [ tooltip - "This represents my confidence in the soundness of the argument." - True - ] + (case ( shared.device.class, shared.device.orientation ) of + ( Phone, Portrait ) -> + [] - else - [] + ( Tablet, Portrait ) -> + [] + + _ -> + if not shared.isNavbarExpanded then + [ tooltip + "This represents the pleasantness of the host." + True + ] + + else + [] ) <| detailTitleMaker TextLightGrey "Pleasantness:" , barPadding - [ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ] + [ barMaker shared getExperienceTooltip appearanceEntry.appearanceExperience ] ]