Current section

Files

Jump to
mbta_metro lib mbta_metro components js.ex
Raw

lib/mbta_metro/components/js.ex

defmodule MbtaMetro.Components.JS do
@moduledoc """
TODO: Add module documentation
"""
def show(js \\ %Phoenix.LiveView.JS{}, selector) do
Phoenix.LiveView.JS.show(js,
to: selector,
transition:
{"transition-all transform ease-out duration-300",
"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
"opacity-100 translate-y-0 sm:scale-100"}
)
end
def hide(js \\ %Phoenix.LiveView.JS{}, selector) do
Phoenix.LiveView.JS.hide(js,
to: selector,
time: 200,
transition:
{"transition-all transform ease-in duration-200",
"opacity-100 translate-y-0 sm:scale-100",
"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}
)
end
end