Re-add part3
This commit is contained in:
25
advanced/part3/src/Loading.elm
Normal file
25
advanced/part3/src/Loading.elm
Normal file
@@ -0,0 +1,25 @@
|
||||
module Loading exposing (error, icon, slowThreshold)
|
||||
|
||||
{-| A loading spinner icon.
|
||||
-}
|
||||
|
||||
import Asset
|
||||
import Html exposing (Attribute, Html)
|
||||
import Html.Attributes exposing (alt, height, src, width)
|
||||
import Process
|
||||
import Task exposing (Task)
|
||||
|
||||
|
||||
icon : Html msg
|
||||
icon =
|
||||
Html.img [ Asset.src Asset.loading, width 64, height 64, alt "Loading..." ] []
|
||||
|
||||
|
||||
error : String -> Html msg
|
||||
error str =
|
||||
Html.text ("Error loading " ++ str ++ ".")
|
||||
|
||||
|
||||
slowThreshold : Task x ()
|
||||
slowThreshold =
|
||||
Process.sleep 500
|
||||
Reference in New Issue
Block a user