module Config.Style.Images exposing (..)

import Config.Helpers.ImageFolders exposing (..)
import Config.Style.Colour.Helpers exposing (ThemeColor(..), colourTheme, getThemeColor)
import Element as E exposing (..)
import Element.Background as B exposing (color)
import Element.Border as D
    exposing
        ( color
        , rounded
        , width
        )


imageSquareMaker : Device -> String -> Bool -> String -> Element msg
imageSquareMaker device imagePath isLeft size =
    E.image
        [ D.rounded (roundingScaler size)
        , clip
        , E.width <| imageSizer size
        , E.height <| imageSizer size
        , if imagePath == imagePathMaker Donate "cardano" then
            B.color (rgb255 4 20 108)

          else
            B.color (getThemeColor BackgroundLightGrey)
        ]
        { src = imagePath
        , description = ""
        }


imageSizer : String -> Length
imageSizer size =
    case size of
        "Fill" ->
            fill

        "Fatty" ->
            px 128

        "Big" ->
            px 65

        "Small" ->
            px 28

        _ ->
            px 20


roundingScaler : String -> Int
roundingScaler size =
    case size of
        "Fill" ->
            32

        "Fatty" ->
            32

        -- 128px
        "Big" ->
            10

        -- 65px
        "Small" ->
            10

        -- 28px
        _ ->
            10



-- 20px default
