mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-15 20:15:12 -05:00
feat: removed tooltips on mobile
This commit is contained in:
parent
ad3a7eac94
commit
86430b122c
6 changed files with 98 additions and 51 deletions
|
@ -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,26 +27,41 @@ 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 =
|
||||||
|
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
|
el
|
||||||
[ height <| px 12
|
(strengthBarAttr
|
||||||
, E.width fill
|
++ (case ( shared.device.class, shared.device.orientation ) of
|
||||||
, D.rounded 10
|
( Phone, Portrait ) ->
|
||||||
, D.color colourTheme.textDarkGrey
|
[]
|
||||||
, D.width 2
|
|
||||||
, B.gradient
|
( Tablet, Portrait ) ->
|
||||||
{ angle = 1.57
|
[]
|
||||||
, steps =
|
|
||||||
List.concat
|
_ ->
|
||||||
[ List.repeat num colourTheme.barGreen
|
[ tooltip (getTooltip num) True ]
|
||||||
, List.repeat (10 - num) colourTheme.barRed
|
)
|
||||||
]
|
)
|
||||||
}
|
|
||||||
, tooltip (getTooltip num) True
|
|
||||||
]
|
|
||||||
none
|
none
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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,14 +372,22 @@ 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
|
||||||
[ tooltip
|
( Phone, Portrait ) ->
|
||||||
"This represents how pleasant the host was to engage with."
|
[]
|
||||||
True
|
|
||||||
]
|
|
||||||
|
|
||||||
else
|
( Tablet, Portrait ) ->
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
if not shared.isNavbarExpanded then
|
||||||
|
[ tooltip
|
||||||
|
"This represents my confidence that the argument is sound."
|
||||||
|
True
|
||||||
|
]
|
||||||
|
|
||||||
|
else
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
<|
|
<|
|
||||||
detailTitleMaker TextLightOrange "Confidence:"
|
detailTitleMaker TextLightOrange "Confidence:"
|
||||||
|
|
|
@ -377,14 +377,20 @@ 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
|
|
||||||
]
|
|
||||||
|
|
||||||
else
|
( Tablet, Portrait ) ->
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
if not shared.isNavbarExpanded then
|
||||||
|
[ tooltip tooltipMessage True
|
||||||
|
]
|
||||||
|
|
||||||
|
else
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
<|
|
<|
|
||||||
(el
|
(el
|
||||||
|
@ -401,7 +407,7 @@ intelligibilityBar shared terms =
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
, barPadding
|
, barPadding
|
||||||
[ barMaker getIntelligibilityTooltip terms.strength ]
|
[ barMaker shared getIntelligibilityTooltip terms.strength ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -265,21 +265,29 @@ 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
|
||||||
[ tooltip
|
( Phone, Portrait ) ->
|
||||||
"This represents how strongly I prefer a given platform relative to other platforms."
|
[]
|
||||||
True
|
|
||||||
]
|
|
||||||
|
|
||||||
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
|
detailTitleMaker
|
||||||
TextLightOrange
|
TextLightOrange
|
||||||
"Preference:"
|
"Preference:"
|
||||||
, barPadding
|
, barPadding
|
||||||
[ barMaker getPreferenceTooltip donate.donatePreference ]
|
[ barMaker shared getPreferenceTooltip donate.donatePreference ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -268,19 +268,27 @@ 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
|
||||||
[ tooltip
|
( Phone, Portrait ) ->
|
||||||
"This represents my confidence in the soundness of the argument."
|
[]
|
||||||
True
|
|
||||||
]
|
|
||||||
|
|
||||||
else
|
( Tablet, Portrait ) ->
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
if not shared.isNavbarExpanded then
|
||||||
|
[ tooltip
|
||||||
|
"This represents the pleasantness of the host."
|
||||||
|
True
|
||||||
|
]
|
||||||
|
|
||||||
|
else
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
<|
|
<|
|
||||||
detailTitleMaker TextLightGrey "Pleasantness:"
|
detailTitleMaker TextLightGrey "Pleasantness:"
|
||||||
, barPadding
|
, barPadding
|
||||||
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ]
|
[ barMaker shared getExperienceTooltip appearanceEntry.appearanceExperience ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue