diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
commit | c3b4e2d87a2031c3499e49f47c39c7119adeb170 (patch) | |
tree | 0c0348410a6fd3afe8a6c5e479e5660c030a0a60 /src/frontend/tau/components/player.cljs | |
parent | 45694468ccea8219c47dfc470e9e5ef885f671bd (diff) |
feat(frontend): Add basic global player
Diffstat (limited to 'src/frontend/tau/components/player.cljs')
-rw-r--r-- | src/frontend/tau/components/player.cljs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/frontend/tau/components/player.cljs b/src/frontend/tau/components/player.cljs new file mode 100644 index 0000000..b7ba099 --- /dev/null +++ b/src/frontend/tau/components/player.cljs @@ -0,0 +1,21 @@ +(ns tau.components.player + (:require + [re-frame.core :as rf] + [reitit.frontend.easy :as rfe] + [tau.events :as events])) + +(defn global-player + [] + (let [{:keys [uploader-name uploader-url name stream url service-color]} @(rf/subscribe [:global-stream]) + show-global-player? @(rf/subscribe [:show-global-player])] + (when show-global-player? + [:div.sticky.bottom-0.z-50.bg-neutral-900.p-5.absolute + {:style {:borderColor service-color :borderTopWidth "2px" :borderStyle "solid"}} + [:div.flex.items-center.justify-between + [:div.flex.flex-col + [:a.text-xs + {:href (rfe/href :tau.router/stream nil {:url url})} name] + [:a.text-xs.text-gray-300 + {:href (rfe/href :tau.router/channel nil {:url uploader-url})} uploader-name]] + [:audio {:src stream :controls true}] + [:i.fa-solid.fa-close.cursor-pointer {:on-click #(rf/dispatch [::events/toggle-global-player])}]]]))) |