diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
commit | 81f03c0b449bec1fa60cf2936bfc3f66a5ad58c1 (patch) | |
tree | a2a7aa01f61dd71b511dd3729a9f4b28c35b531f /src/frontend/tau/views | |
parent | 5e995881dd0c431ae63b1a50c2d03e59962241f1 (diff) |
chore: Rename project
Diffstat (limited to 'src/frontend/tau/views')
-rw-r--r-- | src/frontend/tau/views/channel.cljs | 41 | ||||
-rw-r--r-- | src/frontend/tau/views/kiosk.cljs | 26 | ||||
-rw-r--r-- | src/frontend/tau/views/playlist.cljs | 40 | ||||
-rw-r--r-- | src/frontend/tau/views/search.cljs | 28 | ||||
-rw-r--r-- | src/frontend/tau/views/stream.cljs | 122 |
5 files changed, 0 insertions, 257 deletions
diff --git a/src/frontend/tau/views/channel.cljs b/src/frontend/tau/views/channel.cljs deleted file mode 100644 index 205474d..0000000 --- a/src/frontend/tau/views/channel.cljs +++ /dev/null @@ -1,41 +0,0 @@ -(ns tau.views.channel - (:require - [re-frame.core :as rf] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.components.navigation :as navigation] - [tau.events :as events])) - -(defn channel - [{{:keys [url]} :query-params}] - (let [{:keys [banner avatar name description subscriber-count - related-streams next-page]} @(rf/subscribe [:channel]) - next-page-url (:url next-page) - service-color @(rf/subscribe [:service-color]) - page-loading? @(rf/subscribe [:show-page-loading]) - pagination-loading? @(rf/subscribe [:show-pagination-loading]) - page-scroll @(rf/subscribe [:page-scroll]) - scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))] - (when scrolled-to-bottom? - (rf/dispatch [::events/channel-pagination url next-page-url])) - [:div.flex.flex-col.items-center.px-5.py-2.flex-auto - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.flex.flex-col.flex-auto {:class "ml:w-4/5 xl:w-3/5"} - [navigation/back-button service-color] - (when banner - [:div.flex.justify-center - [:img {:src banner}]]) - [:div.flex.items-center.my-4.mx-2 - (when avatar - [:div.relative.w-16.h-16 - [:img.rounded-full.object-cover.max-w-full.min-h-full {:src avatar :alt name}]]) - [:div.m-4 - [:h1.text-xl name] - (when subscriber-count - [:div.flex.my-2.items-center - [:i.fa-solid.fa-users.text-xs] - [:span.mx-2 (.toLocaleString subscriber-count)]])]] - [:div.my-2 - [:p description]] - [items/related-streams related-streams next-page-url]])])) diff --git a/src/frontend/tau/views/kiosk.cljs b/src/frontend/tau/views/kiosk.cljs deleted file mode 100644 index 824d85b..0000000 --- a/src/frontend/tau/views/kiosk.cljs +++ /dev/null @@ -1,26 +0,0 @@ -(ns tau.views.kiosk - (:require - [re-frame.core :as rf] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.components.navigation :as navigation] - [tau.events :as events])) - -(defn kiosk - [{{:keys [serviceId kioskId]} :query-params}] - (let [{:keys [id url related-streams next-page]} @(rf/subscribe [:kiosk]) - next-page-url (:url next-page) - service-color @(rf/subscribe [:service-color]) - page-loading? @(rf/subscribe [:show-page-loading]) - page-scroll @(rf/subscribe [:page-scroll]) - scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))] - (when scrolled-to-bottom? - (rf/dispatch [::events/kiosk-pagination serviceId id next-page-url])) - [:div.flex.flex-col.items-center.px-5.py-2.flex-auto - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.flex.flex-col.flex-auto.w-full {:class "lg:w-4/5"} - [:div.flex.justify-center.items-center.my-4.mx-2 - [:div.m-4 - [:h1.text-2xl id]]] - [items/related-streams related-streams next-page-url]])])) diff --git a/src/frontend/tau/views/playlist.cljs b/src/frontend/tau/views/playlist.cljs deleted file mode 100644 index 756846c..0000000 --- a/src/frontend/tau/views/playlist.cljs +++ /dev/null @@ -1,40 +0,0 @@ -(ns tau.views.playlist - (:require - [re-frame.core :as rf] - [reitit.frontend.easy :as rfe] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.components.navigation :as navigation] - [tau.events :as events])) - -(defn playlist - [{{:keys [url]} :query-params}] - (let [{:keys [id name playlist-type thumbnail-url banner-url - uploader-name uploader-url uploader-avatar stream-count - next-page related-streams]} @(rf/subscribe [:playlist]) - next-page-url (:url next-page) - service-color @(rf/subscribe [:service-color]) - page-loading? @(rf/subscribe [:show-page-loading]) - page-scroll @(rf/subscribe [:page-scroll]) - scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))] - (when scrolled-to-bottom? - (rf/dispatch [::events/playlist-pagination url next-page-url])) - [:div.flex.flex-col.items-center.px-5.pt-4.flex-auto - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.flex.flex-col.flex-auto.w-full {:class "ml:w-4/5"} - [navigation/back-button service-color] - (when banner-url - [:div - [:img {:src banner-url}]]) - [:div.flex.items-center.justify-center.my-4.mx-2 - [:div.flex.flex-col.justify-center.items-center - [:h1.text-2xl.font-bold name] - [:div.flex.items-center.pt-4 - [:span.mr-2 "By"] - [:div.flex.items-center.py-3.box-border.h-12 - [:div.w-12 - [:a {:href (rfe/href :tau.routes/channel nil {:url uploader-url}) :title uploader-name} - [:img.rounded-full.object-cover.min-h-full.min-w-full {:src uploader-avatar :alt uploader-name}]]]]] - [:p.pt-4 (str stream-count " streams")]]] - [items/related-streams related-streams next-page-url]])])) diff --git a/src/frontend/tau/views/search.cljs b/src/frontend/tau/views/search.cljs deleted file mode 100644 index bfb0b20..0000000 --- a/src/frontend/tau/views/search.cljs +++ /dev/null @@ -1,28 +0,0 @@ -(ns tau.views.search - (:require - [re-frame.core :as rf] - [reitit.frontend.easy :as rfe] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.events :as events])) - -(defn search - [{{:keys [q serviceId]} :query-params}] - (let [{:keys [items next-page] :as search-results} @(rf/subscribe [:search-results]) - next-page-url (:url next-page) - services @(rf/subscribe [:services]) - service-id @(rf/subscribe [:service-id]) - service-color @(rf/subscribe [:service-color]) - page-scroll @(rf/subscribe [:page-scroll]) - page-loading? @(rf/subscribe [:show-page-loading]) - scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))] - (when scrolled-to-bottom? - (rf/dispatch [::events/search-pagination q serviceId next-page-url])) - [:div.flex.flex-col.items-center.flex-auto - [:div.flex.flex-col.items-center.w-full.pt-4.flex-initial - [:h2 (str "Showing search results for: \"" q "\"")] - [:h1 (str "Number of search results: " (count items))]] - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.flex.flex-col.flex-auto.w-full {:class "lg:w-4/5"} - [items/related-streams items next-page-url]])])) diff --git a/src/frontend/tau/views/stream.cljs b/src/frontend/tau/views/stream.cljs deleted file mode 100644 index 3363d6a..0000000 --- a/src/frontend/tau/views/stream.cljs +++ /dev/null @@ -1,122 +0,0 @@ -(ns tau.views.stream - (:require - [re-frame.core :as rf] - [reitit.frontend.easy :as rfe] - [tau.events :as events] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.components.navigation :as navigation] - [tau.components.comments :as comments] - [tau.components.player :as player] - [tau.util :as util])) - -(defn stream - [match] - (let [{:keys [name url video-streams audio-streams view-count - subscriber-count like-count dislike-count - description uploader-avatar uploader-name - uploader-url upload-date related-streams - thumbnail-url show-comments-loading comments-page - show-comments service-id] :as stream} @(rf/subscribe [:stream]) - available-streams (apply conj audio-streams video-streams) - {:keys [content id] :as stream-format} @(rf/subscribe [:stream-format]) - page-loading? @(rf/subscribe [:show-page-loading]) - service-color @(rf/subscribe [:service-color])] - [:div.flex.flex-col.items-center.justify-center.text-white.flex-auto - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.w-full.pb-4.relative {:class "ml:w-4/5 xl:w-3/5"} - [navigation/back-button service-color] - [:div.flex.justify-center.relative - {:class "ml:h-[450px] lg:h-[600px]"} - (when stream-format - [player/stream-player {"sources" [{"src" content "type" "video/mp4"} - {"src" content "type" "video/webm"}] - "poster" thumbnail-url - "controls" true} - content])] - [:div.px-4.ml:p-0 - [:div.flex.flex.w-full.mt-3 - (when stream-format - [:div.relative.flex.bg-stone-800.flex-col.items-center.justify-center.z-10.mr-2.border.rounded.border-black - [:select.border-none.focus:ring-transparent.bg-blend-color-dodge.pl-4.pr-8.w-full - {:on-change #(rf/dispatch [::events/change-stream-format (.. % -target -value)]) - :value id - :style {:background "transparent"}} - (when available-streams - (for [[i {:keys [id format resolution averageBitrate]}] (map-indexed vector available-streams)] - [:option.bg-neutral-900.border-none {:value id :key i} - (str (or resolution "audio-only") " " format (when-not resolution (str " " averageBitrate "kbit/s")))]))] - [:div.flex.absolute.min-h-full.top-0.right-4.items-center.justify-end - {:style {:zIndex "-1"}} - [:i.fa-solid.fa-caret-down]]]) - [:button.border.rounded.border-black.px-3.py-1.bg-stone-800 - {:on-click #(rf/dispatch [::events/switch-to-global-player - {:uploader-name uploader-name :uploader-url uploader-url - :name name :url url :stream content :service-color service-color}])} - [:i.fa-solid.fa-headphones]] - [:button.border.rounded.border-black.px-3.py-1.bg-stone-800.mx-2 - [:a {:href url} - [:i.fa-solid.fa-external-link-alt]]]] - [:div.flex.flex-col.py-1.comments - [:div.min-w-full.py-3 - [:h1.text-2xl.font-extrabold.line-clamp-1 name]] - [:div.flex.justify-between.py-2 - [:div.flex.items-center.flex-auto - (when uploader-avatar - [:div.relative.w-16.h-16 - [:a {:href (rfe/href :tau.routes/channel nil {:url uploader-url}) :title uploader-name} - [:img.rounded-full.object-cover.max-w-full.min-h-full {:src uploader-avatar :alt uploader-name}]]]) - [:div.mx-2 - [:a {:href (rfe/href :tau.routes/channel nil {:url uploader-url})} uploader-name] - (when subscriber-count - [:div.flex.my-2.items-center - [:i.fa-solid.fa-users.text-xs] - [:p.mx-2 (util/format-quantity subscriber-count)]])]] - [:div.flex.flex-col.items-end - (when view-count - [:div - [:i.fa-solid.fa-eye.text-xs] - [:span.ml-2 (.toLocaleString view-count)]]) - [:div.flex - (when like-count - [:div.items-center - [:i.fa-solid.fa-thumbs-up.text-xs] - [:span.ml-2 (.toLocaleString like-count)]]) - (when dislike-count - [:div.ml-2.items-center - [:i.fa-solid.fa-thumbs-down.text-xs] - [:span.ml-2 dislike-count]])] - (when upload-date - [:div - [:i.fa-solid.fa-calendar.mx-2.text-xs] - [:span - (-> upload-date - js/Date.parse - js/Date. - .toDateString)]])]] - [:div.min-w-full.py-3 - [:h1 name] - [:div {:dangerouslySetInnerHTML {:__html description}}]] - [:div.py-6 - [:div.flex.items-center - [:i.fa-solid.fa-comments] - [:p.px-2.py-4 "Comments"] - (if show-comments - [:i.fa-solid.fa-chevron-up {:on-click #(rf/dispatch [::events/toggle-comments]) - :style {:cursor "pointer"}}] - [:i.fa-solid.fa-chevron-down {:on-click #(if (or show-comments comments-page) - (rf/dispatch [::events/toggle-comments]) - (rf/dispatch [::events/get-comments url])) - :style {:cursor "pointer"}}])] - [:div - (if show-comments-loading - [loading/loading-icon service-color "text-2xl"] - (when (and show-comments comments-page) - [comments/comments comments-page uploader-name uploader-avatar url]))]] - (when-not (empty? related-streams) - [:div.py-3 - [:div.flex.items-center - [:i.fa-solid.fa-list] - [:h1.px-2.text-lg.bold "Related Results"]] - [items/related-streams related-streams nil]])]]])])) |