PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.12.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.12.0
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / controls / gsap-animation.php

gsap-animation.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.12.0, at includes/controls/gsap-animation.php

98 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ABlocks\Controls;
3
4 use ABlocks\Classes\ControlBaseAbstract;
5
6 class GsapAnimation extends ControlBaseAbstract {
7 public static function get_attribute_default_value( $is_responsive = false ) {
8 if ( $is_responsive ) {
9 return [
10 'animationType' => 'none',
11 'duration' => 1,
12 'delay' => 0,
13 'triggerType' => 'scroll',
14 // from method values
15 'ease' => 'none',
16 'x' => 0,
17 'y' => 0,
18 'rotation' => 0,
19 'rotationY' => 0,
20 'opacity' => 1,
21 // to method values
22 'xTo' => 0,
23 'yTo' => 0,
24 'rotationTo' => 0,
25 'rotationYTo' => 0,
26 'opacityTo' => 1,
27 'easeTo' => 'none',
28 // repeat/loops
29 'loops' => false,
30 'numberOfRepeat' => 0, // if -1 then infinite loops
31 'isSmooth' => true, // yoyo
32 // if animation type 'scroll' then these will work
33 'startPoint' => 80, // top ${this.attribute?.startPoint ?? 80}%
34 'endPoint' => 10
35 ];
36
37 }//end if
38 return [
39 'animationType' => 'none',
40 'duration' => 1,
41 'delay' => 0,
42 'triggerType' => 'scroll',
43 // from method values
44 'ease' => 'none',
45 'x' => 0,
46 'y' => 0,
47 'rotation' => 0,
48 'rotationY' => 0,
49 'opacity' => 1,
50 // to method values
51 'xTo' => 0,
52 'yTo' => 0,
53 'rotationTo' => 0,
54 'rotationYTo' => 0,
55 'opacityTo' => 1,
56 'easeTo' => 'none',
57 // repeat/loops
58 'loops' => false,
59 'numberOfRepeat' => 0, // if -1 then infinite loops
60 'isSmooth' => true, // yoyo
61 // if animation type 'scroll' then these will work
62 'startPoint' => 80, // top ${this.attribute?.startPoint ?? 80}%
63 'endPoint' => 10
64 ];
65 }
66
67 public static function get_attribute( $attributeName, $isResponsive = false ) {
68 return [
69 $attributeName => [
70 'type' => 'object',
71 'default' => self::get_attribute_default_value( $isResponsive ),
72 ]
73 ];
74 }
75
76 /**
77 * GSAP animations are driven entirely by the frontend script (see the
78 * gsap view scripts) — this control contributes no CSS.
79 *
80 * The body used to compile a mask-image rule from `mask*` members and then
81 * throw the result away with an unconditional `return []`. Since the control
82 * declares no mask members at all, every one of those reads was an
83 * "Undefined array key" notice on any page carrying a GSAP animation. Dead
84 * code that could only emit warnings, so it is gone; masking lives in the
85 * Mask control.
86 *
87 * @param mixed $attribute_value Stored control value.
88 * @param string $property Unused.
89 * @param string $device Unused.
90 * @return array Always empty.
91 */
92 public static function get_css( $attribute_value, $property = '', $device = '' ) {
93 return [];
94 }
95
96
97 }
98