diff options
Diffstat (limited to 'src/frontend/tubo/views.cljs')
-rw-r--r-- | src/frontend/tubo/views.cljs | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/frontend/tubo/views.cljs b/src/frontend/tubo/views.cljs index 736a60d..8f052ca 100644 --- a/src/frontend/tubo/views.cljs +++ b/src/frontend/tubo/views.cljs @@ -13,20 +13,23 @@ (defonce kiosks (rf/dispatch [::events/get-kiosks 0])) (defn mobile-nav - [show-mobile-nav? service-id services available-kiosks] + [show-mobile-nav? service-id service-color services available-kiosks] [:<> - [:div.w-full.fixed.min-h-screen.right-0.top-0 + [:div.w-full.fixed.min-h-screen.right-0.top-0.transition-all.delay-75.ease-in-out {:class "bg-black/50" - :style {:visibility (when-not show-mobile-nav? "hidden")} + :style {:visibility (when-not show-mobile-nav? "hidden") + :opacity (if show-mobile-nav? "1" "0")} :on-click #(rf/dispatch [::events/toggle-mobile-nav])}] [:div.items-center.fixed.overflow-x-hidden.min-h-screen.w-60.top-0.ease-in-out.delay-75.bg-white.dark:bg-neutral-900 {:class (str "transition-[right] " (if show-mobile-nav? "right-0" "right-[-245px]"))} - [:div.flex.justify-center.py-8.items-center - [:img.mb-1 {:src "/images/tubo.png" :style {:maxHeight "25px" :maxWidth "40px"} - :title "Tubo"}] - [:h3.text-3xl.font-bold.px-4 "Tubo"]] - [:div.relative.flex.flex-col.items-center-justify-center - [:div.w-full.box-border.z-10.ml:text-white + [:div.flex.justify-center.py-8.items-center.text-white {:style {:background service-color}} + [:img.mb-1 + {:src "/images/tubo.png" + :style {:maxHeight "25px" :maxWidth "40px"} + :title "Tubo"}] + [:h3.text-3xl.font-bold.px-4.font-roboto "Tubo"]] + [:div.relative.flex.flex-col.items-center-justify-center.text-white {:style {:background service-color}} + [:div.w-full.box-border.z-10 [:select.border-none.focus:ring-transparent.bg-blend-color-dodge.font-bold.font-nunito.px-5.w-full {:on-change #(rf/dispatch [::events/change-service-kiosk (js/parseInt (.. % -target -value))]) :value service-id @@ -38,19 +41,25 @@ (-> service :info :name)]))]] [:div.flex.absolute.min-h-full.top-0.right-6.items-center.justify-end.z-0 [:i.fa-solid.fa-caret-down]]] - [:div.relative.pb-4 + [:div.relative.py-4 [:ul.flex.font-roboto.flex-col (for [kiosk available-kiosks] [:li.px-5.py-2 {:key kiosk} [:a {:href (rfe/href ::routes/kiosk nil {:serviceId service-id :kioskId kiosk})} - kiosk]])]] + [:i.fa-solid.fa-fire.text-neutral-600.dark:text-neutral-300] + [:span.ml-7 kiosk]]])]] [:div.relative.dark:border-neutral-800.border-gray-300.pt-4 {:class "border-t-[1px]"} [:ul.flex.font-roboto [:li.px-5.py-2 [:a {:href (rfe/href ::routes/settings)} - "Settings"]]]]]]) + [:i.fa-solid.fa-cog.text-neutral-600.dark:text-neutral-300] + [:span.ml-7 "Settings"]]] + [:li.px-5.py-2 + [:a {:href "https://github.com/migalmoreno/tubo" :target "_blank"} + [:i.fa-brands.fa-github] + [:span.ml-7 "Source"]]]]]]]) (defn navbar [{{:keys [serviceId]} :query-params}] @@ -82,14 +91,14 @@ :params {} :query {:q search-query :serviceId service-id}}])))} [:div.relative - [:input.bg-transparent.text-white.border-none.rounded.py-2.pr-6.mx-2.focus:ring-transparent.placeholder-white.box-border.w-40.xs:w-auto + [:input.bg-transparent.text-white.border-none.py-2.pr-6.mx-2.focus:ring-transparent.placeholder-white.w-40.xs:w-auto {:type "text" :ref #(reset! !input %) :default-value @!query :on-change #(let [input (.. % -target -value)] (when-not (empty? input) (rf/dispatch [::events/change-search-query input])) (reset! !query input)) - :placeholder "Search for something"}] + :placeholder "Search"}] [:button.mx-2.text-xs.text-white.absolute.right-0.top-3 {:type "button" :on-click #(when @!input @@ -98,7 +107,7 @@ (.focus @!input)) :class (when (empty? @!query) "invisible")} [:i.fa-solid.fa-circle-xmark]]] - [:div.flex.items-center.px-2.text-white + [:div.flex.items-center.text-white [:button.mx-2 {:type "submit"} [:i.fa-solid.fa-search]] @@ -108,7 +117,7 @@ [:div.cursor-pointer.px-2.ml:hidden.text-white {:on-click #(rf/dispatch [::events/toggle-mobile-nav])} [:i.fa-solid.fa-bars]] - [mobile-nav show-mobile-nav? service-id services available-kiosks] + [mobile-nav show-mobile-nav? service-id service-color services available-kiosks] [:div.hidden.ml:flex.w-full [:div.relative.flex.flex-col.items-center.justify-center.ml:flex-row [:div.w-full.box-border.z-10.ml:text-white @@ -126,7 +135,7 @@ [:div.relative.flex-auto.ml:pl-4 [:ul.flex.font-roboto.flex-col.ml:flex-row.ml:text-white (for [kiosk available-kiosks] - [:li.px-4.py-2 {:key kiosk} + [:li.px-3.py-2 {:key kiosk} [:a {:href (rfe/href ::routes/kiosk nil {:serviceId service-id :kioskId kiosk})} kiosk]])]]]]])))) |