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 Element as E
exposing
( Element
( Device
, DeviceClass(..)
, Element
, Orientation(..)
, alignLeft
, column
, el
@ -24,11 +27,13 @@ import Element.Border as D
, rounded
, width
)
import Shared exposing (Model)
barMaker : (Int -> String) -> Int -> Element msg
barMaker getTooltip num =
el
barMaker : Shared.Model -> (Int -> String) -> Int -> Element msg
barMaker shared getTooltip num =
let
strengthBarAttr =
[ height <| px 12
, E.width fill
, D.rounded 10
@ -42,8 +47,21 @@ barMaker getTooltip num =
, 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

View file

@ -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)

View file

@ -302,7 +302,7 @@ contentList shared model isLinkClicked index argument =
]
, detailFormat row
[ 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 =
el
(if not shared.isNavbarExpanded then
(case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip
"This represents how pleasant the host was to engage with."
"This represents my confidence that the argument is sound."
True
]

View file

@ -377,10 +377,16 @@ 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 ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip tooltipMessage True
]
else
@ -401,7 +407,7 @@ intelligibilityBar shared terms =
]
]
, 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 =
detailFormat row
[ el
(if not shared.isNavbarExpanded then
(case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip
"This represents how strongly I prefer a given platform relative to other platforms."
True
@ -279,7 +287,7 @@ preferenceMaker shared donate =
TextLightOrange
"Preference:"
, 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 =
detailFormat row
[ el
(if not shared.isNavbarExpanded then
(case ( shared.device.class, shared.device.orientation ) of
( Phone, Portrait ) ->
[]
( Tablet, Portrait ) ->
[]
_ ->
if not shared.isNavbarExpanded then
[ tooltip
"This represents my confidence in the soundness of the argument."
"This represents the pleasantness of the host."
True
]
@ -280,7 +288,7 @@ experienceMaker shared appearanceEntry =
<|
detailTitleMaker TextLightGrey "Pleasantness:"
, barPadding
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ]
[ barMaker shared getExperienceTooltip appearanceEntry.appearanceExperience ]
]