This commit is contained in:
2020-10-04 18:00:16 +02:00
parent 0a0202977e
commit 00381cfcd7
4 changed files with 30 additions and 9 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
module Colors exposing (blackFont, greyBackground, greyFont, primary, primaryOver, white)
module Colors exposing (blackFont, greyBackground, greyFont, primary, primaryOver, selected, white)
import Element
@@ -31,3 +31,8 @@ blackFont =
greyFont : Element.Color
greyFont =
Element.rgb255 128 128 128
selected : Element.Color
selected =
Element.rgb255 223 233 250
+23 -7
View File
@@ -232,12 +232,18 @@ videoMiniatureView zone playlist video =
videoInList : Time.Zone -> Twitch.Playlist -> Twitch.Video -> Twitch.Video -> Element Core.Msg
videoInList zone playlist activeVideo video =
let
msg =
( msg, attr ) =
if video == activeVideo then
Nothing
( Nothing
, [ Element.width Element.fill
, Background.color Colors.selected
, Border.color Colors.primary
, Border.width 2
]
)
else
Just (Core.VideoClicked playlist video)
( Just (Core.VideoClicked playlist video), [ Element.width Element.fill ] )
label =
Element.row [ Element.width Element.fill, Element.spacing 10 ]
@@ -247,8 +253,7 @@ videoInList zone playlist activeVideo video =
(videoDescription zone video)
]
in
Input.button [ Element.width Element.fill ]
{ label = label, onPress = msg }
Input.button attr { label = label, onPress = msg }
videoView : Time.Zone -> Twitch.Playlist -> Twitch.Video -> Element Core.Msg
@@ -256,14 +261,25 @@ videoView zone playlist video =
Element.row [ Element.padding 10, Element.width Element.fill, Element.spacing 10 ]
[ Element.column
[ Element.width (Element.fillPortion 2)
, Element.spacing 10
]
[ Keyed.el [ Element.width Element.fill ]
[ Keyed.el
[ Element.width Element.fill
, Element.height (Element.px 0)
, Element.htmlAttribute (Html.Attributes.style "padding-top" "56%")
, Element.htmlAttribute (Html.Attributes.style "position" "relative")
]
( video.url
, Element.html
(Html.video
[ Html.Attributes.id (Twitch.videoId video)
, Html.Attributes.class "video-js vjs-default-skin wf"
, Html.Attributes.class "video-js"
, Html.Attributes.class "vjs-default-skin"
, Html.Attributes.class "wf"
, Html.Attributes.property "data-setup" (Encode.string "{\"fluid\": true}")
, Html.Attributes.style "position" "absolute"
, Html.Attributes.style "top" "0"
, Html.Attributes.style "height" "100%"
, Html.Attributes.controls True
, Html.Attributes.autoplay True
]