2020-04-01 02:00:29 +03:00
|
|
|
module Examples.Fonts exposing (example, State, Msg)
|
2018-03-17 01:27:38 +03:00
|
|
|
|
|
|
|
{-|
|
|
|
|
|
2020-04-01 02:00:29 +03:00
|
|
|
@docs example, State, Msg
|
2018-03-17 01:27:38 +03:00
|
|
|
|
|
|
|
-}
|
|
|
|
|
2020-03-24 03:33:42 +03:00
|
|
|
import Category exposing (Category(..))
|
2021-11-05 22:44:23 +03:00
|
|
|
import Css exposing (Style)
|
2020-03-31 23:33:05 +03:00
|
|
|
import Example exposing (Example)
|
2021-11-05 22:44:23 +03:00
|
|
|
import Html.Styled as Html exposing (Html)
|
2018-03-17 01:27:38 +03:00
|
|
|
import Html.Styled.Attributes exposing (css)
|
|
|
|
import Nri.Ui.Fonts.V1 as Fonts
|
2019-07-23 17:58:23 +03:00
|
|
|
import Nri.Ui.Heading.V2 as Heading
|
2018-03-17 01:27:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
2020-04-01 02:00:29 +03:00
|
|
|
type alias State =
|
|
|
|
()
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
type alias Msg =
|
|
|
|
()
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
example : Example State Msg
|
2018-03-17 01:27:38 +03:00
|
|
|
example =
|
2020-09-09 21:43:10 +03:00
|
|
|
{ name = "Fonts"
|
|
|
|
, version = 1
|
2021-11-12 01:48:31 +03:00
|
|
|
, categories = [ Text, Atoms ]
|
2020-06-20 00:45:32 +03:00
|
|
|
, keyboardSupport = []
|
2020-03-31 23:33:05 +03:00
|
|
|
, state = ()
|
|
|
|
, update = \_ state -> ( state, Cmd.none )
|
|
|
|
, subscriptions = \_ -> Sub.none
|
2021-11-05 22:44:23 +03:00
|
|
|
, preview =
|
|
|
|
[ ( "baseFont", Fonts.baseFont )
|
|
|
|
, ( "quizFont", Fonts.quizFont )
|
|
|
|
, ( "ugFont", Fonts.ugFont )
|
|
|
|
]
|
|
|
|
|> List.map viewPreview
|
2020-03-31 23:33:05 +03:00
|
|
|
, view =
|
2022-03-29 20:19:32 +03:00
|
|
|
\ellieLinkConfig _ ->
|
2020-03-31 23:33:05 +03:00
|
|
|
[ Heading.h3 [] [ Html.text "baseFont" ]
|
|
|
|
, Html.p [ css [ Fonts.baseFont ] ]
|
|
|
|
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
|
|
|
|
, Heading.h3 [] [ Html.text "quizFont" ]
|
|
|
|
, Html.p [ css [ Fonts.quizFont ] ]
|
|
|
|
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
|
|
|
|
, Heading.h3 [] [ Html.text "ugFont" ]
|
|
|
|
, Html.p [ css [ Fonts.ugFont ] ]
|
|
|
|
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
|
|
|
|
]
|
2018-03-17 01:27:38 +03:00
|
|
|
}
|
2021-11-05 22:44:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
viewPreview : ( String, Style ) -> Html msg
|
|
|
|
viewPreview ( name, font ) =
|
|
|
|
Html.div
|
|
|
|
[ css
|
|
|
|
[ Css.displayFlex
|
|
|
|
, Css.justifyContent Css.spaceBetween
|
|
|
|
, font
|
|
|
|
, Css.fontSize (Css.px 14)
|
|
|
|
]
|
|
|
|
]
|
|
|
|
[ Html.p [ css [ Css.margin2 (Css.px 8) Css.zero ] ]
|
|
|
|
[ Html.text name ]
|
|
|
|
, Html.p [ css [ Css.margin2 (Css.px 8) Css.zero ] ]
|
|
|
|
[ Html.text "AaBbCc" ]
|
|
|
|
]
|