diff --git a/assets/css/contact.scss b/assets/css/contact.scss index afc46403..8c0495df 100644 --- a/assets/css/contact.scss +++ b/assets/css/contact.scss @@ -2,9 +2,38 @@ display: flex; align-items: center; justify-content: center; + max-width: 100vw; margin-bottom: 40px; padding: 80px 120px; + .contact-message { + display: flex; + flex-direction: column; + justify-content: center; + width: 50%; + + h2 { + margin-bottom: 20px; + } + + .text-black-80 { + margin-bottom: 20px; + } + + .return-button { + display: flex; + align-items: center; + justify-content: center; + background: #0064C8; + border-radius: 4px; + gap: 8px; + padding: 16px 24px; + width: 267px; + cursor: pointer; + } + + } + .contact-form { width: 50%; .form-inputs { @@ -51,4 +80,24 @@ } } } +} + +@media (min-width: 769px) and (max-width: 1024px) { + .contact-area { + margin: 20px 40px; + } +} + +@media (min-width: 360px) and (max-width: 768px) { + .contact-area { + display: flex; + padding: 10px 5px; + flex-direction: column; + text-align: center; + gap: 40px; + + .contact-message { + align-items: center; + } + } } \ No newline at end of file diff --git a/lib/pescarte_web/controllers/contact_controller.ex b/lib/pescarte_web/controllers/contact_controller.ex index 7c5697eb..91e49159 100644 --- a/lib/pescarte_web/controllers/contact_controller.ex +++ b/lib/pescarte_web/controllers/contact_controller.ex @@ -6,6 +6,16 @@ defmodule PescarteWeb.ContactController do @sender_email Application.compile_env!(:pescarte, [PescarteWeb, :sender_email]) @receiver_email Application.compile_env!(:pescarte, [PescarteWeb, :receiver_email]) + def success(conn, _params) do + current_path = conn.request_path + render(conn, :success, current_path: current_path, error_message: nil) + end + + def failed(conn, _params) do + current_path = conn.request_path + render(conn, :failed, current_path: current_path, error_message: nil) + end + def show(conn, _params) do changeset = ContactForm.changeset(%{}) current_path = conn.request_path @@ -21,7 +31,7 @@ defmodule PescarteWeb.ContactController do {:ok, _} <- send_confirmation_email(client, contact_form) do conn |> put_flash(:info, "Email enviado com sucesso!") - |> redirect(to: ~p"/") + |> redirect(to: ~p"/contato/success") else {:error, reason} -> Logger.error(""" @@ -32,13 +42,13 @@ defmodule PescarteWeb.ContactController do conn |> put_flash(:error, "Erro ao enviar email.") - |> redirect(to: ~p"/") + |> redirect(to: ~p"/contato/failed") end {:error, _changeset} -> conn |> put_flash(:error, "Erro na validação do formulário.") - |> redirect(to: ~p"/") + |> redirect(to: ~p"/contato/failed") end end diff --git a/lib/pescarte_web/router.ex b/lib/pescarte_web/router.ex index 1cefe2b2..68dfb3ec 100644 --- a/lib/pescarte_web/router.ex +++ b/lib/pescarte_web/router.ex @@ -64,6 +64,8 @@ defmodule PescarteWeb.Router do scope "/contato" do get "/", ContactController, :show + get "/success", ContactController, :success + get "/failed", ContactController, :failed post "/", ContactController, :send_email end end diff --git a/lib/pescarte_web/templates/contact_html/failed.html.heex b/lib/pescarte_web/templates/contact_html/failed.html.heex new file mode 100644 index 00000000..5d84f426 --- /dev/null +++ b/lib/pescarte_web/templates/contact_html/failed.html.heex @@ -0,0 +1,24 @@ +
+
+
+ <.text size="h2" color="text-blue-100"> + Ops! Algo deu errado... + + <.text size="lg" color="text-black-80"> + Não pudemos receber sua mensagem por conta de um erro. Mas não se preocupe, você pode tentar novamente mais tarde! + + + +
+ + <.text size="base" color="text-white-100"> + Voltar para a homepage + +
+
+
+ +
+ + +
diff --git a/lib/pescarte_web/templates/contact_html/success.html.heex b/lib/pescarte_web/templates/contact_html/success.html.heex new file mode 100644 index 00000000..3282c73d --- /dev/null +++ b/lib/pescarte_web/templates/contact_html/success.html.heex @@ -0,0 +1,24 @@ +
+
+
+ <.text size="h2" color="text-blue-100"> + Recebemos sua mensagem! + + <.text size="lg" color="text-black-80"> + Agradecemos seu contato. Em breve, um membro da nossa equipe irá lhe retornar. Enquanto isso, fique à vontade para conferir mais conteúdos no nosso site. + + + +
+ + <.text size="base" color="text-white-100"> + Voltar para a homepage + +
+
+
+ +
+ + +
diff --git a/priv/static/images/contato/fish.png b/priv/static/images/contato/fish.png new file mode 100644 index 00000000..8dea61ea Binary files /dev/null and b/priv/static/images/contato/fish.png differ diff --git a/priv/static/images/contato/fishing2.svg b/priv/static/images/contato/fishing2.svg new file mode 100644 index 00000000..f1ac37ef --- /dev/null +++ b/priv/static/images/contato/fishing2.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +