1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use dioxus_core::Event;

pub type AnimationEvent = Event<AnimationData>;

#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct AnimationData {
    pub animation_name: String,
    pub pseudo_element: String,
    pub elapsed_time: f32,
}

impl_event! [
    AnimationData;

    /// onanimationstart
    onanimationstart

    /// onanimationend
    onanimationend

    /// onanimationiteration
    onanimationiteration
];