Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/UI touchups #57

Merged
merged 48 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
99cd949
Init media bridge
rtshkmr Feb 28, 2024
be6e8de
[Attempt] parent-child comms
rtshkmr Feb 28, 2024
7953c03
Its the phx-update=ignore clause
Feb 28, 2024
ad73483
Decouple mediabridge (abs media play) & aud player
rtshkmr Feb 28, 2024
875d91a
Some syntax fixes
Feb 29, 2024
ae70f73
Use the correct hook, handle event emits properly
rtshkmr Feb 29, 2024
f9dcb60
Include video & assoc w voice in existing seeders
rtshkmr Mar 2, 2024
aefee6d
Pass video_id prop as part of the :voice_ack
rtshkmr Mar 2, 2024
2ad6ea0
Define video player config from media_bridge
rtshkmr Mar 2, 2024
458d375
Sync audio and video, with issues
rtshkmr Mar 2, 2024
c3764e3
Support video-hiding via toggle icon
rtshkmr Mar 3, 2024
cfd6ae0
Use css utility & improve perf from css changes
rtshkmr Mar 3, 2024
e292bcf
CSS: use fixed inset to make media_bridge stick
rtshkmr Mar 3, 2024
fa8aec1
Add toggle b/w follow mode and non-follow-mode
rtshkmr Mar 3, 2024
d518e6d
Floater: init generic floater hook
rtshkmr Mar 3, 2024
91ee569
Set up potential style system
rtshkmr Mar 4, 2024
5515cb1
General-UI improvements
rtshkmr Mar 4, 2024
188685f
Add scroll padding, other UI udpates
rtshkmr Mar 4, 2024
e1cee03
Minor UI Padding
Mar 4, 2024
c53bfbc
Event Bus
Mar 5, 2024
e8e368c
Classic MIssing bridge
Mar 5, 2024
43a04cf
[WIP] Use seekTimeBridge for progress-bar seeking
rtshkmr Mar 6, 2024
07e527f
Use seekToEvent bridge for YouTubePlayer hook
rtshkmr Mar 6, 2024
1c4aa3f
Complete handling of the seekTime event bridge
rtshkmr Mar 7, 2024
26542b0
Make progress_bar sub to seekTime
rtshkmr Mar 7, 2024
6cf307d
Use PlayPauseBridge
rtshkmr Mar 7, 2024
67d30c6
Minor cleanups
rtshkmr Mar 7, 2024
9b62961
Minor changes
rtshkmr Mar 7, 2024
8b8ce7e
Let the heart beat
rtshkmr Mar 7, 2024
4a5bb85
Massive cleanups, let follow mode work magically
rtshkmr Mar 7, 2024
33d1769
More cleanups
rtshkmr Mar 7, 2024
59cb3b1
bless me
rtshkmr Mar 7, 2024
4b74180
bless me
rtshkmr Mar 7, 2024
3993d3b
bless u
Mar 7, 2024
cbedcbd
Merge pull request #49 from ve1ld/feature/video-sync
ks0m1c Mar 8, 2024
cc49283
Merge pull request #50 from ve1ld/patch/video-sync/progressbar
ks0m1c Mar 8, 2024
b1713f4
Merge branch 'feature/hanuman' into feature/media-bridge
ks0m1c Mar 8, 2024
9b3aa4c
[WIP] Add fallback component for floater to attach
rtshkmr Mar 8, 2024
e5821a9
Floating video player handling (incl. mobile view)
rtshkmr Mar 8, 2024
9b920d7
Minor text size updates
rtshkmr Mar 8, 2024
42d4326
Gimped assign-metas
rtshkmr Mar 8, 2024
c975982
Data Dump and Restore
Mar 8, 2024
fb2a21e
Merge pull request #54 from ve1ld/chore/UI-polishing-prior-to-soft-la…
ks0m1c Mar 8, 2024
b1f5e30
Humanise title displays
rtshkmr Mar 9, 2024
89d1915
Attempt bugfix for IOS devices.
rtshkmr Mar 10, 2024
6588176
String Utils
Mar 11, 2024
67f14d7
floater check on el
Mar 12, 2024
d7f273f
Merge branch 'feature/hanuman' into chore/UI-touchups
rtshkmr Mar 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion assets/js/hooks/floater.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function isElementOutOfViewport(el, offsets = {top: 0, bottom:0, left: 0, right:
if (!el) {
console.log("[floater] el is null", el)

}
} else {

const rect = el.getBoundingClientRect();
const { top, bottom, left, right } = offsets;
Expand All @@ -122,6 +122,8 @@ function isElementOutOfViewport(el, offsets = {top: 0, bottom:0, left: 0, right:
rect.bottom + bottom > (window.innerHeight || document.documentElement.clientHeight) ||
rect.right + right > (window.innerWidth || document.documentElement.clientWidth)
);

}
}

export default Floater;
9 changes: 8 additions & 1 deletion assets/js/utils/time_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
* hh:mm:ss e.g. 00:12:05
* */
export const formatDisplayTime = (seconds) => {
return new Date(1000 * seconds).toISOString().substring(11, 19)
let formatted = null
try {
formatted = new Date(1000 * seconds).toISOString().substring(11, 19)
} catch (e) {
console.warn("Errored out when doing time conversions.", e)
} finally {
return formatted
}
}

export const nowSeconds = () => Math.round(Date.now() / 1000)
3 changes: 2 additions & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ config :ex_aws, :retries,
config :vyasa, VyasaWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: System.get_env("PORT") || 4000],
# http: [ip: {127, 0, 0, 1}, port: System.get_env("PORT") || 4000],
http: [ip: {0, 0, 0, 0}, port: System.get_env("PORT") || 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
Expand Down
11 changes: 11 additions & 0 deletions lib/utils/string.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule Utils.String do
@moduledoc """
Contains functions useful for string operations, that need not be
web or server-specific.
"""
@doc """
Inflexor logic that humanises snake_case string then converts to title case.
"""
def to_title_case(value) when is_binary(value),
do: Recase.to_title(value)
end
3 changes: 2 additions & 1 deletion lib/vyasa_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ defmodule VyasaWeb do
# Core UI components and translation
import VyasaWeb.CoreComponents
import VyasaWeb.Gettext

#String Formating for Display
import Utils.String, only: [to_title_case: 1]
# Shortcut for generating JS commands
alias Phoenix.LiveView.JS

Expand Down
4 changes: 2 additions & 2 deletions lib/vyasa_web/live/source_live/chapter/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ defmodule VyasaWeb.SourceLive.Chapter.Index do

defp assign_meta(socket) do
socket
|> assign(:page_title, "#{socket.assigns.source_title} Chapter #{socket.assigns.chap.no} | #{socket.assigns.chap.title}")
|> assign(:page_title, "#{to_title_case(socket.assigns.source_title)} Chapter #{socket.assigns.chap.no} | #{socket.assigns.chap.title}")
|> assign(:meta, %{
title: "#{socket.assigns.source_title} Chapter #{socket.assigns.chap.no} | #{socket.assigns.chap.title}",
title: "#{to_title_case(socket.assigns.source_title)} Chapter #{socket.assigns.chap.no} | #{socket.assigns.chap.title}",
description: socket.assigns.chap.body,
type: "website",
image: url(~p"/images/the_vyasa_project_1.png"),
Expand Down
2 changes: 1 addition & 1 deletion lib/vyasa_web/live/source_live/chapter/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
</:item>
</.verse_display>

<.back navigate={~p"/explore/#{@source_title}"}>Back to <%= @source_title %> Chapters</.back>
<.back navigate={~p"/explore/#{@source_title}"}>Back to <%= to_title_case(@source_title)%> Chapters</.back>
</div>
1 change: 0 additions & 1 deletion lib/vyasa_web/live/source_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ defmodule VyasaWeb.SourceLive.Index do
socket
|> assign(:page_title, "Sources")
|> assign_meta()

end

defp assign_meta(socket) do
Expand Down
2 changes: 1 addition & 1 deletion lib/vyasa_web/live/source_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
>
<:col :let={{_id, source}} label="">
<div class="font-dn text-2xl">
<%= source.title %>
<%= to_title_case(source.title) %>
</div>
</:col>
</.table>
Expand Down
3 changes: 1 addition & 2 deletions lib/vyasa_web/live/source_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ defmodule VyasaWeb.SourceLive.Show do
socket
|> assign(:id, id)
|> assign(:title, title)
|> assign(:page_title, title)
# |> stream(:verses, verses)
|> assign(:page_title, to_title_case(title))
|> stream(:chapters, chapters |> Enum.sort_by(fn chap -> chap.no end))
|> assign_meta()
}
Expand Down
2 changes: 1 addition & 1 deletion lib/vyasa_web/live/source_live/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<.header >
<div class="font-dn text-4xl">
<%= @title%>
<%= to_title_case(@title)%>
</div>
</.header>

Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ defmodule Vyasa.MixProject do
{:ex_aws, "~> 2.0"},
{:ex_aws_s3, "~> 2.5"},
{:live_admin, "~> 0.11.4"},
{:req, "~> 0.4.0"}
{:req, "~> 0.4.0"},
{:recase, "~> 0.5"}
]
end

Expand Down
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"},
"postgrex": {:hex, :postgrex, "0.17.3", "c92cda8de2033a7585dae8c61b1d420a1a1322421df84da9a82a6764580c503d", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "946cf46935a4fdca7a81448be76ba3503cff082df42c6ec1ff16a4bdfbfb098d"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
"req": {:hex, :req, "0.4.8", "2b754a3925ddbf4ad78c56f30208ced6aefe111a7ea07fb56c23dccc13eb87ae", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.9", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "7146e51d52593bb7f20d00b5308a5d7d17d663d6e85cd071452b613a8277100c"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"sweet_xml": {:hex, :sweet_xml, "0.7.4", "a8b7e1ce7ecd775c7e8a65d501bc2cd933bff3a9c41ab763f5105688ef485d08", [:mix], [], "hexpm", "e7c4b0bdbf460c928234951def54fe87edf1a170f6896675443279e2dbeba167"},
Expand Down
Loading