Fix miniatures

This commit is contained in:
Thomas Forgione 2021-06-22 09:21:37 +02:00
parent a8cba787bc
commit e706447e42
2 changed files with 17 additions and 9 deletions

View File

@ -141,7 +141,7 @@ update msg model =
( { model | page = Playlist p (Just (Hover.hover hover model.time)) }, Cmd.none )
Video p v x Nothing ->
( { model | page = Video p v x (Just (Hover.hover v model.time)) }, Cmd.none )
( { model | page = Video p v x (Just (Hover.hover hover model.time)) }, Cmd.none )
_ ->
( model, Cmd.none )

View File

@ -295,8 +295,6 @@ videoMiniature currentDate time hover playlist video =
, Element.height (Element.px 0)
, Element.htmlAttribute (Html.Attributes.style "padding-top" "56.25%")
, Element.htmlAttribute (Html.Attributes.style "position" "relative")
, Events.onMouseEnter (Core.HoverVideo video)
, Events.onMouseLeave Core.Unhover
]
( key
, Element.image
@ -320,9 +318,14 @@ videoMiniatureView : Bool -> Time.Zone -> Time.Posix -> Time.Posix -> Maybe (Hov
videoMiniatureView darkMode zone currentDate time hover playlist video =
let
display =
Element.column [ Element.width Element.fill, Element.spacing 10 ]
Element.column
[ Element.width Element.fill
, Element.spacing 10
, Events.onMouseEnter (Core.HoverVideo video)
, Events.onMouseLeave Core.Unhover
]
[ videoMiniature currentDate time hover playlist video
, videoDescription darkMode zone video
, videoDate darkMode zone video
]
button =
@ -338,11 +341,16 @@ videoInList : Bool -> Time.Zone -> Time.Posix -> Time.Posix -> Maybe (Hover Twit
videoInList darkMode zone currentDate time hover playlist activeVideo video =
let
label =
Element.row [ Element.width Element.fill, Element.spacing 10 ]
Element.row
[ Element.width Element.fill
, Element.spacing 10
, Events.onMouseEnter (Core.HoverVideo video)
, Events.onMouseLeave Core.Unhover
]
[ Element.el [ Element.width (Element.fillPortion 2) ]
(videoMiniature currentDate time hover playlist video)
, Element.el [ Element.width (Element.fillPortion 3), Element.paddingXY 0 10, Element.alignTop ]
(videoDescription darkMode zone video)
(videoDate darkMode zone video)
]
in
if video == activeVideo then
@ -410,8 +418,8 @@ videoView darkMode device zone currentDate time hover playlist video v =
]
videoDescription : Bool -> Time.Zone -> Twitch.Video -> Element Core.Msg
videoDescription darkMode zone video =
videoDate : Bool -> Time.Zone -> Twitch.Video -> Element Core.Msg
videoDate darkMode zone video =
Element.column [ Element.spacing 10 ]
[ Element.paragraph
[ Font.bold