-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common): improve online slide over
- Loading branch information
1 parent
bcab50a
commit b2772a7
Showing
8 changed files
with
101 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<video style="height: 100vh; width: 100%; background-color: black;" id="video" poster={@poster} controlsList="nodownload" controls autoplay> | ||
<video id="video" poster={@poster} controlsList="nodownload" controls autoplay> | ||
<source src={@stream_url} type="video/mp4"> | ||
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1 @@ | ||
<div> | ||
<header class="z-10 sticky top-0 w-full"> | ||
<div class="relative flex-shrink-0 h-16 bg-white border-b border-gray-200 shadow-sm flex"> | ||
|
||
<div class="flex-1 flex justify-between px-4 sm:px-6"> | ||
|
||
<div class="flex-1 flex"> | ||
<div class="-my-px flex space-x-8"> | ||
|
||
<%= live_redirect "Home", to: Routes.home_index_path(@socket, :index), class: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" %> | ||
</div> | ||
</div> | ||
|
||
<div class="-my-px ml-6 flex space-x-8"> | ||
|
||
<button type="button" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> | ||
<span class="inline-block relative"> | ||
<span>Online</span> | ||
<span class="inline-block h-2.5 w-2.5 mx-1 bg-green-400 rounded-full"></span> | ||
</span> | ||
</button> | ||
|
||
<%= link "Log out", to: Routes.user_session_path(@socket, :delete), method: :delete, class: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" %> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<div> | ||
|
||
<%= @inner_content %> | ||
|
||
</div> | ||
</div> | ||
<%= @inner_content %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,8 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<%= csrf_meta_tag() %> | ||
<%= live_title_tag assigns[:page_title] %> | ||
<%= if Phoenix.Controller.current_url(@conn) !== Routes.watch_show_path(@conn, :show, :id) do %> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
<link href="https://unpkg.com/@tailwindcss/[email protected]/dist/forms.min.css" rel="stylesheet"> | ||
<% end %> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
<%= if @current_user do %> | ||
<script> | ||
window.userId = "<%= assigns[:current_user].id %>"; | ||
|
@@ -21,6 +19,61 @@ | |
</head> | ||
<body> | ||
<%= if @current_user do %> | ||
<header class="z-10 sticky top-0 w-full"> | ||
<div class="relative flex-shrink-0 h-16 bg-white border-b border-gray-200 shadow-sm flex"> | ||
|
||
<div class="flex-1 flex justify-between px-4 sm:px-6"> | ||
|
||
<div class="flex-1 flex"> | ||
<div class="-my-px flex space-x-8"> | ||
|
||
<%= link "Home", to: Routes.home_index_path(@conn, :index), class: "border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" %> | ||
</div> | ||
</div> | ||
|
||
<div class="-my-px ml-6 flex space-x-8 self-center"> | ||
<div> | ||
<button phx-click={JS.toggle(to: "#online-slide-over")} type="button" class="border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> | ||
<span class="inline-block relative"> | ||
<span>Online</span> | ||
<span class="inline-block h-2.5 w-2.5 mx-1 bg-green-400 rounded-full"></span> | ||
</span> | ||
</button> | ||
|
||
<div id="online-slide-over" class="hidden fixed inset-0 overflow-hidden" role="dialog" aria-modal="true"> | ||
<div class="absolute inset-0 overflow-hidden"> | ||
|
||
<div class="absolute inset-0 bg-gray-900 bg-opacity-75 transition-opacity" aria-hidden="true"></div> | ||
<div class="fixed inset-y-0 right-0 pl-10 max-w-full flex"> | ||
<div class="relative w-96"> | ||
<div class="absolute top-0 left-0 -ml-8 pt-6 pr-2 flex sm:-ml-10 sm:pr-4"> | ||
|
||
<button phx-click={JS.toggle(to: "#online-slide-over")} type="button" class="rounded-md text-gray-300 hover:text-white focus:outline-none focus:ring-2 focus:ring-white"> | ||
<span class="sr-only">Close panel</span> | ||
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> | ||
</svg> | ||
</button> | ||
</div> | ||
|
||
<div class="h-full bg-white py-6 overflow-y-auto"> | ||
<h2 class="px-4 text-lg font-medium text-gray-900"> | ||
Online | ||
</h2> | ||
|
||
<ul phx-update="ignore" id="online-users" role="list" class="flex-1 divide-y divide-gray-200 overflow-y-auto"></ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete, class: "border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" %> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<%= @inner_content %> | ||
<% else %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
<%= @inner_content %> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<%= csrf_meta_tag() %> | ||
<%= live_title_tag assigns[:page_title] %> | ||
<style> | ||
body { | ||
margin: unset; | ||
} | ||
video { | ||
height: 100vh; | ||
width: 100%; | ||
background-color: black; | ||
} | ||
</style> | ||
<%= if @current_user do %> | ||
<script> | ||
window.userId = "<%= assigns[:current_user].id %>"; | ||
window.userEmail = "<%= assigns[:current_user].email %>"; | ||
window.userName = "<%= assigns[:current_user].name %>"; | ||
</script> | ||
<script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js?id=10")}></script> | ||
<% end %> | ||
</head> | ||
<body> | ||
<%= @inner_content %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters