-
-
Save proProbe/8e6f5ba0b23e3c8f2813ac1ea305a5c9 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
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Lazy exposing (..) | |
view model = | |
let | |
html = | |
case model of | |
True -> | |
lazyVideoHtml model | |
False -> | |
div [] [ text "no iframes" ] | |
in | |
div [] | |
[ button [ onClick Toggle ] [ text "Toggle view" ] | |
, html | |
] | |
type Msg | |
= Toggle | |
update msg model = | |
case msg of | |
Toggle -> | |
not model | |
main = | |
beginnerProgram { model = False, view = view, update = update } | |
-- Helpers | |
lazyVideoHtml = | |
lazy videoHtml | |
videoHtml model = | |
div [] | |
[ text "should show tons of videos" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
, videoContainer "https://www.youtube.com/embed/pmWtTUjRxig" | |
] | |
videoContainer : String -> Html msg | |
videoContainer videoSrc = | |
div [ class "video-container" ] | |
[ iframe | |
[ type' "text/html" | |
, src <| videoSrc ++ "?showinfo=0&autohide=1&?wmode=opaque" | |
, attribute "frameborder" "0" | |
, attribute "allowfullscreen" "True" | |
] | |
[] | |
] | |
(=>) = | |
(,) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment