fix preview background

This commit is contained in:
Gavin McDonald
2025-08-24 11:24:33 -04:00
parent a981cf98d7
commit e36720c011
3 changed files with 15 additions and 10 deletions

View File

@@ -8,6 +8,10 @@ defmodule LabelmakerWeb.Home do
assigns =
Constants.defaults()
|> Map.merge(Constants.preview())
|> Map.put(
:preview_background,
Tools.process_preview_background(Constants.preview().preview_background)
)
|> Enum.to_list()
{
@@ -32,15 +36,7 @@ defmodule LabelmakerWeb.Home do
end
def handle_event("update_preview", %{"bg" => bg}, socket) do
preview_background =
case bg do
"r" -> "bg-[linear-gradient(to_right,_black_33%,_white_67%)]"
"b" -> "bg-[linear-gradient(to_bottom,_black_33%,_white_67%)]"
"c" -> ""
_ -> "bg-[linear-gradient(to_right,_black_33%,_white_67%)]"
end
{:noreply, assign(socket, :preview_background, preview_background)}
{:noreply, assign(socket, :preview_background, Tools.process_preview_background(bg))}
end
def handle_event("update_alignment", %{"option" => option}, socket) do