Files
elm-0.19-workshop/part7/src/Views/Assets.elm
Richard Feldman 825dea437b Add part7
2018-05-05 04:54:47 -04:00

34 lines
507 B
Elm

module Views.Assets exposing (error, 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 "/assets/images/error.jpg"
-- USING IMAGES --
src : Image -> Attribute msg
src (Image url) =
Attr.src url