More animations

This commit is contained in:
Thomas Forgione 2021-06-15 15:50:26 +02:00
parent 22fa6899cd
commit ce9048d779
2 changed files with 39 additions and 2 deletions

View File

@ -110,3 +110,19 @@ volumeX =
, Svg.line [ x1 "23", y1 "9", x2 "17", y2 "15" ] []
, Svg.line [ x1 "17", y1 "9", x2 "23", y2 "15" ] []
]
rewind : Bool -> Element msg
rewind =
svgFeatherIcon "rewind"
[ Svg.polygon [ points "11 19 2 12 11 5 11 19" ] []
, Svg.polygon [ points "22 19 13 12 22 5 22 19" ] []
]
fastForward : Bool -> Element msg
fastForward =
svgFeatherIcon "fast-forward"
[ Svg.polygon [ points "13 19 22 12 13 5 13 19" ] []
, Svg.polygon [ points "2 19 11 12 2 5 2 19" ] []
]

View File

@ -135,7 +135,16 @@ update msg model =
)
Seek time ->
( model, seek time )
( { model
| showIconRequested =
if time > model.position then
Just (Icons.fastForward True)
else
Just (Icons.rewind True)
}
, seek time
)
SetPlaybackRate rate ->
( { model | showSettings = False, settings = All }, setPlaybackRate rate )
@ -159,7 +168,19 @@ update msg model =
( { model | showSettings = False, settings = All }, setSubtitleTrack t )
SetVolume v m ->
( model, setVolume { volume = v, muted = m } )
( { model
| showIconRequested =
if m then
Just (Icons.volumeX True)
else if v >= model.volume then
Just (Icons.volume2 True)
else
Just (Icons.volume1 True)
}
, setVolume { volume = v, muted = m }
)
AnimationFrameDelta delta ->
let