Something went wrong. Try again.
A music player that connects to your cloud/distributed storage. forked from tokono.ma/diffuse
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114module UI.Theme exposing (..)
import Chunky exposing (..)import Dict exposing (Dict)import Html exposing (Html)import Theme exposing (Theme)import Themes.Sunrise.Theme as Sunriseimport Themes.Sunrise.Tracks.Scene.Coversimport Themes.Sunrise.Tracks.Scene.Listimport Tracks exposing (IdentifiedTrack, Scene)import UI.Svg.Elementsimport UI.Types exposing (Model, Msg)
-- 🔮
list : List (Theme Msg Model)list = [ Sunrise.theme ]
default : Theme Msg Modeldefault = Sunrise.theme
-- 🚧
dict : Dict String (Theme Msg Model)dict = list |> List.map (\theme -> ( theme.id, theme ) ) |> Dict.fromList
view : Model -> Html Msgview model = if model.isLoading then loadingAnimation
else case model.theme of Just { id } -> case Dict.get id dict of Just theme -> theme.view model
Nothing -> default.view model
Nothing -> default.view model
loadingAnimation = chunk [ "flex" , "flex-col" , "items-center" , "justify-center" , "screen-height" , "w-screen" ] [ loadingAnimationSvg , chunk [ "italic" , "mt-5" , "text-white" , "text-opacity-30" ] [ Html.text "Transmitting particles" ] ]
loadingAnimationSvg = Html.map never UI.Svg.Elements.loading
-- TODO
scrollTracksToTop : Scene -> Cmd MsgscrollTracksToTop scene = case scene of Tracks.Covers -> Themes.Sunrise.Tracks.Scene.List.scrollToTop
Tracks.List -> Themes.Sunrise.Tracks.Scene.Covers.scrollToTop
scrollToNowPlaying : Scene -> IdentifiedTrack -> Model -> Cmd MsgscrollToNowPlaying scene ( identifiers, track ) model = case scene of Tracks.Covers -> Themes.Sunrise.Tracks.Scene.Covers.scrollToNowPlaying model.viewport.width model.covers.harvested ( identifiers, track )
Tracks.List -> Themes.Sunrise.Tracks.Scene.List.scrollToNowPlaying model.tracks.harvested ( identifiers, track )