-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathAnimationEffect.php
More file actions
157 lines (142 loc) · 2.97 KB
/
AnimationEffect.php
File metadata and controls
157 lines (142 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
namespace ChromeDevtoolsProtocol\Model\Animation;
/**
* AnimationEffect instance
*
* @generated This file has been auto-generated, do not edit.
*
* @author Jakub Kulhan <jakub.kulhan@gmail.com>
*/
final class AnimationEffect implements \JsonSerializable
{
/**
* `AnimationEffect`'s delay.
*
* @var int|float
*/
public $delay;
/**
* `AnimationEffect`'s end delay.
*
* @var int|float
*/
public $endDelay;
/**
* `AnimationEffect`'s iteration start.
*
* @var int|float
*/
public $iterationStart;
/**
* `AnimationEffect`'s iterations.
*
* @var int|float
*/
public $iterations;
/**
* `AnimationEffect`'s iteration duration.
*
* @var int|float
*/
public $duration;
/**
* `AnimationEffect`'s playback direction.
*
* @var string
*/
public $direction;
/**
* `AnimationEffect`'s fill mode.
*
* @var string
*/
public $fill;
/**
* `AnimationEffect`'s target node.
*
* @var int
*/
public $backendNodeId;
/**
* `AnimationEffect`'s keyframes.
*
* @var KeyframesRule|null
*/
public $keyframesRule;
/**
* `AnimationEffect`'s timing function.
*
* @var string
*/
public $easing;
public static function fromJson($data)
{
$instance = new static();
if (isset($data->delay)) {
$instance->delay = $data->delay;
}
if (isset($data->endDelay)) {
$instance->endDelay = $data->endDelay;
}
if (isset($data->iterationStart)) {
$instance->iterationStart = $data->iterationStart;
}
if (isset($data->iterations)) {
$instance->iterations = $data->iterations;
}
if (isset($data->duration)) {
$instance->duration = $data->duration;
}
if (isset($data->direction)) {
$instance->direction = (string)$data->direction;
}
if (isset($data->fill)) {
$instance->fill = (string)$data->fill;
}
if (isset($data->backendNodeId)) {
$instance->backendNodeId = (int)$data->backendNodeId;
}
if (isset($data->keyframesRule)) {
$instance->keyframesRule = KeyframesRule::fromJson($data->keyframesRule);
}
if (isset($data->easing)) {
$instance->easing = (string)$data->easing;
}
return $instance;
}
public function jsonSerialize(): mixed
{
$data = new \stdClass();
if ($this->delay !== null) {
$data->delay = $this->delay;
}
if ($this->endDelay !== null) {
$data->endDelay = $this->endDelay;
}
if ($this->iterationStart !== null) {
$data->iterationStart = $this->iterationStart;
}
if ($this->iterations !== null) {
$data->iterations = $this->iterations;
}
if ($this->duration !== null) {
$data->duration = $this->duration;
}
if ($this->direction !== null) {
$data->direction = $this->direction;
}
if ($this->fill !== null) {
$data->fill = $this->fill;
}
if ($this->backendNodeId !== null) {
$data->backendNodeId = $this->backendNodeId;
}
if ($this->keyframesRule !== null) {
$data->keyframesRule = $this->keyframesRule->jsonSerialize();
}
if ($this->easing !== null) {
$data->easing = $this->easing;
}
return $data;
}
}