Created
November 7, 2021 20:07
-
-
Save mdgriffith/80ddf9eb5917a70b34d3c35f3a042fa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- in Ui.elm | |
image : | |
List (Attribute msg) | |
-> | |
{ source : String | |
, description : String | |
} | |
-> Element msg | |
-- in Ui.Image | |
module Ui.Image exposing (source, responsive, dynamic) | |
-- images where you have size information | |
-- and can suggest to the browser which to use | |
responsive : | |
List (Attribute msg) | |
-> | |
{ sources : | |
List Source | |
, description : String | |
} | |
-> Element msg | |
source : | |
{ src : String | |
, width : Int | |
, pixelDenstiy : Float | |
} | |
-> Source | |
-- for images that you dont already have info on | |
dynamic : | |
List (Attribute msg) | |
-> | |
{ source : String | |
, onLoad : | |
Maybe | |
({ width : Int | |
, height : Int | |
} | |
-> msg | |
) | |
, onError : Maybe msg | |
, fallback : | |
Maybe | |
{ source : String | |
} | |
, description : String | |
} | |
-> Element msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment