From e706447e42cedf9137f306634f67e67cff60928f Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 22 Jun 2021 09:21:37 +0200 Subject: [PATCH] Fix miniatures --- src/Core.elm | 2 +- src/Views.elm | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Core.elm b/src/Core.elm index 4759974..90ea68d 100644 --- a/src/Core.elm +++ b/src/Core.elm @@ -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 ) diff --git a/src/Views.elm b/src/Views.elm index 4455b57..30cda3a 100644 --- a/src/Views.elm +++ b/src/Views.elm @@ -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