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.

Closes #236

+46 -34
+24 -12
src/Applications/UI/Notifications.elm
··· 1 1 module UI.Notifications exposing (Model, dismiss, show, showWithModel, view) 2 2 3 3 import Chunky exposing (..) 4 + import Color exposing (Color) 5 + import Color.Manipulate 4 6 import Conditional exposing (ifThenElse) 5 7 import Css.Classes as C 6 8 import Html exposing (Html, text) 7 - import Html.Attributes exposing (class, rel) 9 + import Html.Attributes exposing (class, rel, style) 8 10 import Html.Ext exposing (onDoubleTap, onTap) 9 11 import Html.Lazy 12 + import Maybe.Extra as Maybe 10 13 import Notifications exposing (..) 11 14 import Process 12 15 import Task ··· 77 80 -- 🗺 78 81 79 82 80 - view : Model -> Html Msg 81 - view collection = 83 + view : Maybe Color -> Model -> Html Msg 84 + view extractedBackdropColor collection = 85 + let 86 + manipulatedColor = 87 + Maybe.map 88 + (Color.Manipulate.darken 0.125) 89 + extractedBackdropColor 90 + in 82 91 collection 83 92 |> List.reverse 84 - |> List.map (Html.Lazy.lazy notificationView) 93 + |> List.map (Html.Lazy.lazy2 notificationView manipulatedColor) 85 94 |> Html.div 86 95 [ class "notifications" 87 96 ··· 92 101 , C.flex_col 93 102 , C.items_end 94 103 , C.leading_snug 95 - , C.mb_3 104 + , C.mb_4 96 105 , C.mr_3 97 106 , C.right_0 98 107 , C.text_sm ··· 100 109 ] 101 110 102 111 103 - notificationView : Notification Msg -> Html Msg 104 - notificationView notification = 112 + notificationView : Maybe Color -> Notification Msg -> Html Msg 113 + notificationView extractedBackdropColor notification = 105 114 let 106 115 kind = 107 116 Notifications.kind notification ··· 139 148 140 149 -- 141 150 , case kind of 151 + Casual -> 152 + Maybe.unwrap 153 + C.bg_white_20 154 + (style "background-color" << Color.toCssString) 155 + extractedBackdropColor 156 + 142 157 Error -> 143 158 C.bg_base08 144 159 145 160 Success -> 146 161 C.bg_base0b 147 - 148 - Warning -> 149 - C.bg_white_20 150 162 151 163 -- 152 164 , if options.wasDismissed then 153 165 C.transition 154 166 155 167 else 156 - C.transition_none 168 + C.transition_colors 157 169 158 170 -- 159 171 , if options.wasDismissed then ··· 167 179 [ contents notification ] 168 180 169 181 -- 170 - , if options.sticky && kind /= Warning then 182 + , if options.sticky && kind /= Casual then 171 183 Html.div 172 184 [ C.cursor_pointer 173 185 , C.italic
+1 -1
src/Applications/UI/Other/State.elm
··· 62 62 syncHypaethralData : Manager 63 63 syncHypaethralData model = 64 64 model 65 - |> Common.showNotification (Notifications.warning "Syncing") 65 + |> Common.showNotification (Notifications.casual "Syncing") 66 66 |> Return.command (Ports.toBrain <| Alien.trigger Alien.SyncHypaethralData)
+4 -4
src/Applications/UI/Queue/State.elm
··· 304 304 case tracks of 305 305 [ t ] -> 306 306 ("__" ++ t.tags.title ++ "__ will be played next") 307 - |> Notifications.success 307 + |> Notifications.casual 308 308 309 309 list -> 310 310 list 311 311 |> List.length 312 312 |> String.fromInt 313 313 |> (\s -> "__" ++ s ++ " tracks__ will be played next") 314 - |> Notifications.success 314 + |> Notifications.casual 315 315 in 316 316 { model | playingNext = items ++ cleanedFuture } 317 317 |> (if showNotification then ··· 362 362 case tracks of 363 363 [ t ] -> 364 364 ("__" ++ t.tags.title ++ "__ was added to the queue") 365 - |> Notifications.success 365 + |> Notifications.casual 366 366 367 367 list -> 368 368 list 369 369 |> List.length 370 370 |> String.fromInt 371 371 |> (\s -> "__" ++ s ++ " tracks__ were added to the queue") 372 - |> Notifications.success 372 + |> Notifications.casual 373 373 in 374 374 { model | playingNext = newFuture } 375 375 |> (if showNotification then
+1 -1
src/Applications/UI/Sources/State.elm
··· 189 189 processSpecific toProcess model = 190 190 let 191 191 notification = 192 - Notifications.stickyWarning "Processing sources ..." 192 + Notifications.stickyCasual "Processing sources ..." 193 193 194 194 notificationId = 195 195 Notifications.id notification
+4 -4
src/Applications/UI/Tracks/State.elm
··· 218 218 |> andThen User.saveEnclosedUserData 219 219 |> andThen 220 220 ("Tracks cache was cleared" 221 - |> Notifications.warning 221 + |> Notifications.casual 222 222 |> Common.showNotification 223 223 ) 224 224 ··· 239 239 download zipName tracks model = 240 240 let 241 241 notification = 242 - Notifications.stickyWarning "Downloading tracks ..." 242 + Notifications.stickyCasual "Downloading tracks ..." 243 243 244 244 downloading = 245 245 Just { notificationId = Notifications.id notification } ··· 675 675 case tracks of 676 676 [ t ] -> 677 677 ("__" ++ t.tags.title ++ "__ will be stored in the cache") 678 - |> Notifications.success 678 + |> Notifications.casual 679 679 680 680 list -> 681 681 list 682 682 |> List.length 683 683 |> String.fromInt 684 684 |> (\s -> "__" ++ s ++ " tracks__ will be stored in the cache") 685 - |> Notifications.success 685 + |> Notifications.casual 686 686 in 687 687 tracks 688 688 |> Json.Encode.list
+1 -1
src/Applications/UI/User/State/Import.elm
··· 77 77 I'll try to import data from Diffuse version one. 78 78 If this was successful, you'll get a notification. 79 79 """ 80 - |> Notifications.warning 80 + |> Notifications.casual 81 81 |> Common.showNotification 82 82 ) 83 83
+1 -1
src/Applications/UI/View.elm
··· 108 108 ----------------------------------------- 109 109 -- Notifications 110 110 ----------------------------------------- 111 - , Lazy.lazy UI.Notifications.view model.notifications 111 + , Lazy.lazy2 UI.Notifications.view model.extractedBackdropColor model.notifications 112 112 113 113 ----------------------------------------- 114 114 -- Overlay
+10 -10
src/Library/Notifications.elm
··· 1 - module Notifications exposing (Action, Kind(..), Notification, Options, contents, dismiss, error, errorWithCode, id, kind, options, stickyError, stickySuccess, stickyWarning, success, warning) 1 + module Notifications exposing (Action, Kind(..), Notification, Options, casual, contents, dismiss, error, errorWithCode, id, kind, options, stickyCasual, stickyError, stickySuccess, success) 2 2 3 3 import Chunky exposing (..) 4 4 import Css.Classes as C ··· 24 24 25 25 26 26 type Kind 27 - = Error 27 + = Casual 28 + | Error 28 29 | Success 29 - | Warning 30 30 31 31 32 32 ··· 149 149 150 150 151 151 152 - -- ⚠️ 152 + -- 🦉 153 153 154 154 155 - warning : String -> Notification msg 156 - warning content = 155 + casual : String -> Notification msg 156 + casual content = 157 157 Notification 158 - Warning 158 + Casual 159 159 (hashString 0 content) 160 160 { sticky = False 161 161 , wasDismissed = False ··· 163 163 (render content) 164 164 165 165 166 - stickyWarning : String -> Notification msg 167 - stickyWarning content = 166 + stickyCasual : String -> Notification msg 167 + stickyCasual content = 168 168 Notification 169 - Warning 169 + Casual 170 170 (hashString 0 content) 171 171 { sticky = True 172 172 , wasDismissed = False