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,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

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,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:"

View file

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

View file

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

View file

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