defmodule ReflectOS.ConsoleWeb.LayoutComponents do use ReflectOS.ConsoleWeb, :html def navbar(assigns) do ~H""" """ end def sidebar(assigns) do ~H"""
""" end def show_sidebar(js \\ %JS{}) do js |> JS.show( to: "#sidebar", time: 150, transition: {"transition-all transform ease-out duration-150", "-translate-x-full", "transform-none"} ) |> JS.show( to: "#sidebar-backdrop", time: 150, transition: {"transition-all transform ease-out duration-150", "opacity-0", "opacity-100"} ) |> JS.toggle_class("overflow-hidden", to: "body") end def hide_sidebar(js \\ %JS{}) do js |> JS.hide( to: "#sidebar-backdrop", time: 150, transition: {"transition-all transform ease-in duration-150", "opacity-100", "opacity-0"} ) |> JS.hide( to: "#sidebar", time: 150, transition: {"transition-all transform ease-in duration-150", "transform-none", "-translate-x-full"} ) |> JS.toggle_class("overflow-hidden", to: "body") end end