forked from shibao/cannery
		
	style modal component
This commit is contained in:
		| @@ -28,42 +28,6 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts"; | |||||||
|   pointer-events: none; |   pointer-events: none; | ||||||
| } | } | ||||||
|  |  | ||||||
| .phx-modal { |  | ||||||
|   opacity: 1!important; |  | ||||||
|   position: fixed; |  | ||||||
|   z-index: 1; |  | ||||||
|   left: 0; |  | ||||||
|   top: 0; |  | ||||||
|   width: 100%; |  | ||||||
|   height: 100%; |  | ||||||
|   overflow: auto; |  | ||||||
|   background-color: rgb(0,0,0); |  | ||||||
|   background-color: rgba(0,0,0,0.4); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .phx-modal-content { |  | ||||||
|   background-color: #fefefe; |  | ||||||
|   margin: 15% auto; |  | ||||||
|   padding: 20px; |  | ||||||
|   border: 1px solid #888; |  | ||||||
|   width: 80%; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .phx-modal-close { |  | ||||||
|   color: #aaa; |  | ||||||
|   float: right; |  | ||||||
|   font-size: 28px; |  | ||||||
|   font-weight: bold; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .phx-modal-close:hover, |  | ||||||
| .phx-modal-close:focus { |  | ||||||
|   color: black; |  | ||||||
|   text-decoration: none; |  | ||||||
|   cursor: pointer; |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| /* Alerts and form errors */ | /* Alerts and form errors */ | ||||||
| .alert { | .alert { | ||||||
|   padding: 15px; |   padding: 15px; | ||||||
|   | |||||||
| @@ -4,16 +4,30 @@ defmodule CanneryWeb.ModalComponent do | |||||||
|   @impl true |   @impl true | ||||||
|   def render(assigns) do |   def render(assigns) do | ||||||
|     ~L""" |     ~L""" | ||||||
|     <div id="<%= @id %>" class="phx-modal" |     <div id="<%= @id %>" class="fixed z-10 left-0 top-0 | ||||||
|  |       w-full h-full overflow-hidden | ||||||
|  |       p-8 flex flex-col justify-center items-center" | ||||||
|  |       style="opacity: 1 !important; background-color: rgba(0,0,0,0.4);" | ||||||
|       phx-capture-click="close" |       phx-capture-click="close" | ||||||
|       phx-window-keydown="close" |       phx-window-keydown="close" | ||||||
|       phx-key="escape" |       phx-key="escape" | ||||||
|       phx-target="#<%= @id %>" |       phx-target="#<%= @id %>" | ||||||
|       phx-page-loading> |       phx-page-loading> | ||||||
|  |  | ||||||
|       <div class="phx-modal-content"> |       <div class="w-full max-w-4xl relative | ||||||
|         <%= live_patch raw("×"), to: @return_to, class: "phx-modal-close" %> |         p-8 flex flex-col justify-start items-center | ||||||
|         <%= live_component @socket, @component, @opts %> |         bg-white border-2 rounded-lg"> | ||||||
|  |         <%# close button %> | ||||||
|  |         <%= live_patch to: @return_to, | ||||||
|  |           class: "absolute top-8 right-10 text-gray-500 hover:text-gray-800 | ||||||
|  |             transition-all duration-500 ease-in-out" do %> | ||||||
|  |           <i class="fa-fw fa-lg fas fa-times"></i> | ||||||
|  |         <% end %> | ||||||
|  |  | ||||||
|  |         <%# modal content %> | ||||||
|  |         <div class="flex flex-col space-y-4 justify-center items-center"> | ||||||
|  |           <%= live_component @socket, @component, @opts %> | ||||||
|  |         </div> | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     """ |     """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user