A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add foundation for sources

+100 -15
+1 -1
Makefile
··· 51 51 52 52 server: 53 53 @echo "> Booting up web server on port 5000" 54 - @devd --port 5000 --all --crossdomain --quiet $(BUILD_DIR) 54 + @devd --port 5000 --all --crossdomain --quiet --notfound=index.html $(BUILD_DIR) 55 55 56 56 57 57 watch: build
+26 -6
src/Applications/UI.elm
··· 6 6 import Browser.Navigation as Nav 7 7 import Chunky exposing (..) 8 8 import Color 9 - import Html exposing (Html, div, section) 9 + import Html exposing (Html, div, section, text) 10 10 import Html.Attributes exposing (style) 11 11 import Html.Events 12 + import Html.Lazy 12 13 import Json.Encode 13 14 import Replying exposing (return) 14 15 import Return2 15 16 import Return3 17 + import Sources 16 18 import Svg.Elements 17 19 import Tachyons.Classes as T 18 20 import UI.Authentication ··· 23 25 import UI.Page as Page 24 26 import UI.Ports as Ports 25 27 import UI.Reply as Reply exposing (Reply(..)) 28 + import UI.Sources 26 29 import Url exposing (Url) 27 30 28 31 ··· 233 236 234 237 defaultScreen : Model -> List (Html Msg) 235 238 defaultScreen model = 236 - [ UI.Navigation.global 237 - [ ( Page.Index, "Tracks" ) 238 - ] 239 + [ Html.Lazy.lazy 240 + (UI.Navigation.global 241 + [ ( Page.Index, "Tracks" ) 242 + , ( Page.Sources Sources.Index, "Sources" ) 243 + ] 244 + ) 239 245 model.page 240 246 247 + ----------------------------------------- 241 248 -- Main 242 - -- TODO 249 + ----------------------------------------- 243 250 , chunk 244 251 [ T.bg_white 245 252 , T.br1 246 253 , T.flex_grow_1 247 254 , T.pa3 248 255 ] 249 - [] 256 + [ case model.page of 257 + Page.Index -> 258 + -- TODO: Tracks 259 + empty 260 + 261 + Page.NotFound -> 262 + -- TODO 263 + text "Page not found." 264 + 265 + Page.Sources subPage -> 266 + UI.Sources.view model subPage 267 + ] 250 268 269 + ----------------------------------------- 251 270 -- Controls 271 + ----------------------------------------- 252 272 -- TODO 253 273 , chunk 254 274 [ T.h4 ]
+9 -7
src/Applications/UI/Navigation.elm
··· 25 25 , T.tracked 26 26 , T.ttu 27 27 ] 28 - (List.map (globalItem activePage) items) 28 + (List.indexedMap (globalItem activePage <| List.length items) items) 29 29 30 30 31 - globalItem : Page -> ( Page, String ) -> Html Msg 32 - globalItem activePage ( page, label ) = 31 + globalItem : Page -> Int -> Int -> ( Page, String ) -> Html Msg 32 + globalItem activePage totalItems idx ( page, label ) = 33 33 let 34 34 isActivePage = 35 35 page == activePage 36 + 37 + isLastItem = 38 + idx + 1 == totalItems 36 39 in 37 40 slab 38 41 Html.a ··· 47 50 , T.lh_copy 48 51 , T.no_underline 49 52 , T.pt2 53 + 54 + -- 55 + , ifThenElse isLastItem T.mr0 T.mr4 50 56 ] 51 57 [ text label ] 52 58 ··· 63 69 64 70 globalBorderColor = 65 71 "rgba(65, 50, 63, 0.125)" 66 - 67 - 68 - 69 - -- Page
+12
src/Applications/UI/Page.elm
··· 1 1 module UI.Page exposing (Page(..), fromUrl, toString) 2 2 3 + import Sources 3 4 import Url exposing (Url) 4 5 import Url.Parser exposing (..) 5 6 ··· 10 11 11 12 type Page 12 13 = Index 14 + | Sources Sources.Page 13 15 -- 14 16 | NotFound 15 17 ··· 34 36 NotFound -> 35 37 "/404" 36 38 39 + ----------------------------------------- 40 + -- Sources 41 + ----------------------------------------- 42 + Sources Sources.Index -> 43 + "/sources" 44 + 37 45 38 46 39 47 -- ⚗️ ··· 43 51 route = 44 52 oneOf 45 53 [ map Index top 54 + , map NotFound (s "404") 55 + 56 + -- Sources 57 + , map (Sources Sources.Index) (s "sources") 46 58 ]
+15
src/Applications/UI/Sources.elm
··· 1 + module UI.Sources exposing (view) 2 + 3 + import Chunky exposing (..) 4 + import Html exposing (Html, text) 5 + import Sources 6 + import UI.Core 7 + 8 + 9 + 10 + -- 🗺 11 + 12 + 13 + view : UI.Core.Model -> Sources.Page -> Html UI.Core.Msg 14 + view model page = 15 + text "Sources"
+36
src/Library/Sources.elm
··· 1 + module Sources exposing (Page(..), Service(..), Source, SourceData) 2 + 3 + import Dict exposing (Dict) 4 + 5 + 6 + 7 + -- 🌳 8 + 9 + 10 + type alias Source = 11 + { id : String 12 + , data : SourceData 13 + , directoryPlaylists : Bool 14 + , enabled : Bool 15 + , service : Service 16 + } 17 + 18 + 19 + 20 + -- PIECES 21 + 22 + 23 + type alias SourceData = 24 + Dict String String 25 + 26 + 27 + type Service 28 + = AmazonS3 29 + 30 + 31 + 32 + -- PAGE 33 + 34 + 35 + type Page 36 + = Index
+1 -1
src/Library/Track.elm src/Library/Tracks.elm
··· 1 - module Track exposing (Collection, Favourite, IdentifiedTrack, Identifiers, Tags, Track, emptyCollection, emptyIdentifiedTrack, emptyTags, emptyTrack, missingId) 1 + module Tracks exposing (Collection, Favourite, IdentifiedTrack, Identifiers, Tags, Track, emptyCollection, emptyIdentifiedTrack, emptyTags, emptyTrack, missingId) 2 2 3 3 -- 🌳 4 4