Rename part5 to part8

This commit is contained in:
Richard Feldman
2018-08-13 06:09:31 -04:00
parent 91438546ba
commit 7ac13cb8f5
52 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
module Asset exposing (Image, defaultAvatar, error, loading, src)
{-| Assets, such as images, videos, and audio. (We only have images for now.)
We should never expose asset URLs directly; this module should be in charge of
all of them. One source of truth!
-}
import Html exposing (Attribute, Html)
import Html.Attributes as Attr
type Image
= Image String
-- IMAGES
error : Image
error =
image "error.jpg"
loading : Image
loading =
image "loading.svg"
defaultAvatar : Image
defaultAvatar =
image "smiley-cyrus.jpg"
image : String -> Image
image filename =
Image ("/assets/images/" ++ filename)
-- USING IMAGES
src : Image -> Attribute msg
src (Image url) =
Attr.src url