Copyright | (c) 2023 Ruslan Gadeev Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Shake animation widget. Wraps a child widget whose content will be animated.
Messages:
- Accepts a
AnimationMsg
, used to control the state of the animation.
Synopsis
- data ShakeCfg s e
- shakeH :: ShakeCfg s e
- shakeV :: ShakeCfg s e
- shakeR :: ShakeCfg s e
- shakeS :: ShakeCfg s e
- shakeAmplitude :: Double -> ShakeCfg s e
- shakeFrequency :: Int -> ShakeCfg s e
- animShake :: WidgetEvent e => WidgetNode s e -> WidgetNode s e
- animShake_ :: WidgetEvent e => [ShakeCfg s e] -> WidgetNode s e -> WidgetNode s e
Configuration
Configuration options for shake:
autoStart
: whether the first time the widget is added, animation should run.duration
: how long the animation lasts in ms.onFinished
: event to raise when animation is complete.onFinishedReq
:WidgetRequest
to generate when animation is complete.shakeAmplitude
: amplitude of the animation. Defaults to 0.1.shakeFrequency
: frequency of the animation. Defaults to 2.- Individual combinators for direction.
Instances
Monoid (ShakeCfg s e) Source # | |
Semigroup (ShakeCfg s e) Source # | |
Show (ShakeCfg s e) Source # | |
Default (ShakeCfg s e) Source # | |
Defined in Monomer.Widgets.Animation.Shake | |
Eq e => Eq (ShakeCfg s e) Source # | |
CmbAutoStart (ShakeCfg s e) Source # | |
Defined in Monomer.Widgets.Animation.Shake | |
CmbDuration (ShakeCfg s e) Millisecond Source # | |
Defined in Monomer.Widgets.Animation.Shake duration :: Millisecond -> ShakeCfg s e Source # | |
WidgetEvent e => CmbOnFinished (ShakeCfg s e) e Source # | |
Defined in Monomer.Widgets.Animation.Shake onFinished :: e -> ShakeCfg s e Source # | |
CmbOnFinishedReq (ShakeCfg s e) s e Source # | |
Defined in Monomer.Widgets.Animation.Shake onFinishedReq :: WidgetRequest s e -> ShakeCfg s e Source # |
shakeAmplitude :: Double -> ShakeCfg s e Source #
Amplitude of the animation. Defaults to 1.
shakeFrequency :: Int -> ShakeCfg s e Source #
Frequency of the animation. Defaults to 2.
Constructors
:: WidgetEvent e | |
=> WidgetNode s e | The child node. |
-> WidgetNode s e | The created animation container. |
Shakes a widget.
:: WidgetEvent e | |
=> [ShakeCfg s e] | The config options. |
-> WidgetNode s e | The child node. |
-> WidgetNode s e | The created animation container. |
Shakes a widget. Accepts config.