module Config.Style.Transitions exposing (..)

import Config.Style.Colour.Helpers exposing (..)
import Config.Style.Glow exposing (..)
import Element
    exposing
        ( Attribute
        , htmlAttribute
        , mouseOver
        )
import Element.Background as B exposing (color)
import Element.Border as D exposing (color)
import Element.Font as F exposing (color)
import Html.Attributes as H exposing (style)
import Shared


slowTime : String
slowTime =
    "0.5s"


fastTime : String
fastTime =
    "0.1s"


transition : String -> Attribute msg
transition time =
    htmlAttribute <| style "transition" ("all " ++ time ++ " ease-in-out")



-- Specific transition functions for separating fast and slow properties


cardTransitions : Attribute msg
cardTransitions =
    htmlAttribute <|
        style "transition"
            ("background-color "
                ++ slowTime
                ++ " ease-in-out, "
                ++ "color "
                ++ slowTime
                ++ " ease-in-out, "
                ++ "border-color "
                ++ slowTime
                ++ " ease-in-out, "
                ++ "box-shadow "
                ++ fastTime
                ++ " ease-in-out, "
                ++ "transform "
                ++ fastTime
                ++ " ease-in-out"
            )


hoverButton : Shared.Model -> Attribute msg
hoverButton shared =
    mouseOver
        [ B.color (getScheme shared).secondary
        , F.color (getScheme shared).primary
        ]


imageFadeTransition : String -> Attribute msg
imageFadeTransition time =
    htmlAttribute <| style "transition" ("opacity " ++ time ++ " ease-in-out")
