feat: removed tooltips on mobile

This commit is contained in:
Nick 2025-01-03 18:29:59 -06:00
parent ad3a7eac94
commit 86430b122c
6 changed files with 98 additions and 51 deletions

View file

@ -7,7 +7,10 @@ import Config.Helpers.Cards.Inner.ToolTip exposing (tooltip)
import Config.Style.Colour.Helpers exposing (colourTheme) import Config.Style.Colour.Helpers exposing (colourTheme)
import Element as E import Element as E
exposing exposing
( Element ( Device
, DeviceClass(..)
, Element
, Orientation(..)
, alignLeft , alignLeft
, column , column
, el , el
@ -24,11 +27,13 @@ import Element.Border as D
, rounded , rounded
, width , width
) )
import Shared exposing (Model)
barMaker : (Int -> String) -> Int -> Element msg barMaker : Shared.Model -> (Int -> String) -> Int -> Element msg
barMaker getTooltip num = barMaker shared getTooltip num =
el let
strengthBarAttr =
[ height <| px 12 [ height <| px 12
, E.width fill , E.width fill
, D.rounded 10 , D.rounded 10
@ -42,8 +47,21 @@ barMaker getTooltip num =
, List.repeat (10 - num) colourTheme.barRed , List.repeat (10 - num) colourTheme.barRed
] ]
} }
, tooltip (getTooltip num) True
] ]
in
el
(strengthBarAttr
++ (case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
[ tooltip (getTooltip num) True ]
)
)
none none

View file

@ -12,7 +12,6 @@ import Config.Helpers.Cards.Inner.Text
, detailFormat , detailFormat
, numberedListItem , numberedListItem
) )
import Config.Helpers.Cards.Inner.ToolTip exposing (tooltip)
import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker) import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker)
import Config.Helpers.Cards.Outer.Types as C exposing (Cardable(..)) import Config.Helpers.Cards.Outer.Types as C exposing (Cardable(..))
import Config.Helpers.Headers.Helpers exposing (headerMaker) import Config.Helpers.Headers.Helpers exposing (headerMaker)

View file

@ -302,7 +302,7 @@ contentList shared model isLinkClicked index argument =
] ]
, detailFormat row , detailFormat row
[ strengthMaker shared [ strengthMaker shared
, barMaker getConfidenceTooltip argument.argumentCertainty , barMaker shared getConfidenceTooltip argument.argumentCertainty
] ]
] ]
] ]
@ -372,9 +372,17 @@ copyButton shared model isLinkClicked index argument =
strengthMaker : Shared.Model -> Element msg strengthMaker : Shared.Model -> Element msg
strengthMaker shared = strengthMaker shared =
el el
(if not shared.isNavbarExpanded then (case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip [ tooltip
"This represents how pleasant the host was to engage with." "This represents my confidence that the argument is sound."
True True
] ]

View file

@ -377,10 +377,16 @@ intelligibilityBar shared terms =
, E.width fill , E.width fill
] ]
[ el [ el
(if not shared.isNavbarExpanded then (case ( shared.device.class, shared.device.orientation ) of
[ tooltip ( Phone, Portrait ) ->
tooltipMessage []
True
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip tooltipMessage True
] ]
else else
@ -401,7 +407,7 @@ intelligibilityBar shared terms =
] ]
] ]
, barPadding , barPadding
[ barMaker getIntelligibilityTooltip terms.strength ] [ barMaker shared getIntelligibilityTooltip terms.strength ]
] ]

View file

@ -265,7 +265,15 @@ preferenceMaker : Shared.Model -> Donate -> Element msg
preferenceMaker shared donate = preferenceMaker shared donate =
detailFormat row detailFormat row
[ el [ el
(if not shared.isNavbarExpanded then (case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip [ tooltip
"This represents how strongly I prefer a given platform relative to other platforms." "This represents how strongly I prefer a given platform relative to other platforms."
True True
@ -279,7 +287,7 @@ preferenceMaker shared donate =
TextLightOrange TextLightOrange
"Preference:" "Preference:"
, barPadding , barPadding
[ barMaker getPreferenceTooltip donate.donatePreference ] [ barMaker shared getPreferenceTooltip donate.donatePreference ]
] ]

View file

@ -268,9 +268,17 @@ experienceMaker : Shared.Model -> Appearance -> Element msg
experienceMaker shared appearanceEntry = experienceMaker shared appearanceEntry =
detailFormat row detailFormat row
[ el [ el
(if not shared.isNavbarExpanded then (case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip [ tooltip
"This represents my confidence in the soundness of the argument." "This represents the pleasantness of the host."
True True
] ]
@ -280,7 +288,7 @@ experienceMaker shared appearanceEntry =
<| <|
detailTitleMaker TextLightGrey "Pleasantness:" detailTitleMaker TextLightGrey "Pleasantness:"
, barPadding , barPadding
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ] [ barMaker shared getExperienceTooltip appearanceEntry.appearanceExperience ]
] ]