Total Complexity | 5 |
Total Lines | 77 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class Animation extends BaseComponent { |
||
13 | |||
14 | public function __construct($duration = 400, $easing = "swing", $queue = false) { |
||
15 | $this->setDuration($duration); |
||
16 | $this->setEasing($easing); |
||
17 | $this->setQueue($queue); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * An int determining how long the animation will run (in milliseconds). |
||
22 | * |
||
23 | * @param int $value |
||
24 | * default : 400 |
||
25 | */ |
||
26 | public function setDuration($value) { |
||
27 | $this->setParamCtrl("duration", $value, "is_int"); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * A string indicating which easing function to use for the transition. |
||
32 | * |
||
33 | * @param string $value |
||
34 | * default : swing |
||
35 | */ |
||
36 | public function setEasing($value) { |
||
37 | $this->setParamCtrl("easing", $value, array( |
||
38 | "linear", |
||
39 | "swing", |
||
40 | "easeInQuad", |
||
41 | "easeOutQuad", |
||
42 | "easeInOutQuad", |
||
43 | "easeInCubic", |
||
44 | "easeOutCubic", |
||
45 | "easeInOutCubic", |
||
46 | "easeInQuart", |
||
47 | "easeOutQuart", |
||
48 | "easeInOutQuart", |
||
49 | "easeInQuint", |
||
50 | "easeOutQuint", |
||
51 | "easeInOutQuint", |
||
52 | "easeInExpo", |
||
53 | "easeOutExpo", |
||
54 | "easeInOutExpo", |
||
55 | "easeInSine", |
||
56 | "easeOutSine", |
||
57 | "easeInOutSine", |
||
58 | "easeInCirc", |
||
59 | "easeOutCirc", |
||
60 | "easeInOutCirc", |
||
61 | "easeInElastic", |
||
62 | "easeOutElastic", |
||
63 | "easeInOutElastic", |
||
64 | "easeInBack", |
||
65 | "easeOutBack", |
||
66 | "easeInOutBack", |
||
67 | "easeInBounce", |
||
68 | "easeOutBounce", |
||
69 | "easeInOutBounce" |
||
70 | )); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * A Boolean indicating whether to place the animation in the effects queue. |
||
75 | * If false, the animation will begin immediately. |
||
76 | * |
||
77 | * @param Boolean $value |
||
78 | * default : true |
||
79 | */ |
||
80 | public function setQueue($value) { |
||
81 | $this->setParamCtrl("queue", $value, "is_bool"); |
||
82 | } |
||
83 | |||
84 | /* |
||
85 | * (non-PHPdoc) |
||
86 | * @see \Ajax\common\BaseComponent::getScript() |
||
87 | */ |
||
88 | public function getScript() {} |
||
89 | } |
||
90 |