From 6c71821c13ead9cf87dedccec9d202bb9875f61c Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 9 Jun 2021 15:07:15 +0200 Subject: [PATCH] Fix click issues --- src/Main.elm | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/Main.elm b/src/Main.elm index e5ec4a0..d8dfcf0 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -121,7 +121,12 @@ video model = Element.none loadedElement = - Element.row [ Element.width Element.fill, Element.height (Element.px 5), Element.centerY, Border.rounded 5 ] + Element.row + [ Element.width Element.fill + , Element.height (Element.px 5) + , Element.centerY + , Border.rounded 5 + ] (List.map showRange loadedToShow) remaining = @@ -136,22 +141,30 @@ video model = , Background.gradient { angle = 0, steps = [ Element.rgba 0 0 0 0.75, Element.rgba 0 0 0 0 ] } ] [ Element.row - (Element.width Element.fill - :: Element.height (Element.px 30) - :: Border.rounded 5 - :: Element.behindContent - (Element.el - [ Background.color (Element.rgba 0.4 0.4 0.4 0.75) - , Element.width Element.fill - , Element.height (Element.px 5) - , Element.centerY - , Border.rounded 5 - ] - Element.none + [ Element.width Element.fill + , Element.height (Element.px 30) + , Border.rounded 5 + , Element.behindContent + (Element.el + [ Background.color (Element.rgba 0.4 0.4 0.4 0.75) + , Element.width Element.fill + , Element.height (Element.px 5) + , Element.centerY + , Border.rounded 5 + ] + Element.none + ) + , Element.behindContent loadedElement + , Element.inFront + (Element.el + (Element.width Element.fill + :: Element.height Element.fill + :: Element.pointer + :: seekBarEvents ) - :: Element.behindContent loadedElement - :: seekBarEvents - ) + Element.none + ) + ] [ Element.el [ Background.color (Element.rgba 1 0 0 0.75) , Element.width (Element.fillPortion seen) @@ -233,7 +246,7 @@ decodeVolumeChange = decodeSeek : Decode.Decoder Msg decodeSeek = - Decode.map2 (\x y -> Seek (toFloat x / 980)) + Decode.map2 (\x y -> Seek (toFloat x / toFloat y)) (Decode.field "layerX" Decode.int) (Dom.target <| Decode.field "offsetWidth" Decode.int)