From ac1be0e3ef0ff822649d106d43a8a28342ddb3d9 Mon Sep 17 00:00:00 2001 From: Correl Date: Wed, 11 Jan 2023 17:26:34 -0500 Subject: [PATCH] Display symbols in card text --- www/src/Pages/Collection.elm | 2 +- www/src/Symbol.elm | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/www/src/Pages/Collection.elm b/www/src/Pages/Collection.elm index 3033b75..a5bd9f2 100644 --- a/www/src/Pages/Collection.elm +++ b/www/src/Pages/Collection.elm @@ -394,7 +394,7 @@ viewCardBrowser model = (viewCard { width = 192, height = 272 } copy) :: (E.row [ E.spacing 5, E.centerX ] <| List.map UI.priceBadge (prices copy.card)) :: E.paragraph [ Font.heavy, Font.size 24, Font.center, Font.color UI.colors.title ] [ E.text copy.card.name ] - :: List.map (\text -> E.paragraph [ Font.size 16 ] [ E.text text ]) + :: List.map (Symbol.text model.symbols 16) (String.lines copy.card.oracleText) details = diff --git a/www/src/Symbol.elm b/www/src/Symbol.elm index 1e8f94f..782fdc5 100644 --- a/www/src/Symbol.elm +++ b/www/src/Symbol.elm @@ -78,12 +78,6 @@ symbolTextParser available = toElement : Int -> Text -> E.Element msg toElement size symbolText = let - padding = - size // 6 - - fontSize = - size - padding - symbol : Symbol -> E.Element msg symbol s = E.image @@ -96,7 +90,7 @@ toElement size symbolText = in case symbolText of Text s -> - E.el [ Font.size size, E.height <| E.px size ] <| E.text s + E.text s Inline s -> symbol s @@ -104,6 +98,6 @@ toElement size symbolText = text : Dict String Symbol -> Int -> String -> E.Element msg text available size string = - E.row [ E.spacing (size // 10) ] <| + E.paragraph [ E.spacing (size // 10), Font.size size ] <| List.map (toElement size) <| (P.run (symbolTextParser available) string |> Result.withDefault [])