This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
A container for HTML that maintains its aspect ratio.
version 1.0.0
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-07-06 23:38:23 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1
elm-community/ratio 1.1.0 <= v < 2.0.0 1.1.0

Modules

README

elm-aspect-ratio

A container for HTML that maintains its aspect ratio.

AspectRatio.view : Ratio.Rational -> Html a -> Html a
AspectRatio.img : Ratio.Rational -> String -> Html a

example

import Ratio
import AspectRatio
import Html exposing (Html, div)
import Html.Attributes exposing (style)

cinematic : Ratio.Rational
cinematic = Ratio.over 9 16

redRectangle =
    div [ style [ ( "background-color", "red" )
                , ( "width", "100%" )
                , ( "height", "100%" )
                ] ] []

cinematicImage : String -> Html a
cinematicImage src =
    AspectRatio.view cinematic redRectangle