| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Interactions; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly. |
| 7 |
} |
| 8 |
|
| 9 |
class Presets { |
| 10 |
const DEFAULT_DURATION = 600; |
| 11 |
const DEFAULT_DELAY = 0; |
| 12 |
const DEFAULT_SLIDE_DISTANCE = 100; |
| 13 |
const DEFAULT_SCALE_START = 0; |
| 14 |
const DEFAULT_RELATIVE_TO = 'viewport'; |
| 15 |
const DEFAULT_END = 15; |
| 16 |
const DEFAULT_START = 85; |
| 17 |
|
| 18 |
const BASE_TRIGGERS = [ 'load', 'scrollIn' ]; |
| 19 |
const ADDITIONAL_TRIGGERS = [ 'scrollOut', 'scrollOn', 'hover', 'click' ]; |
| 20 |
|
| 21 |
const DEFAULT_EASING = 'easeIn'; |
| 22 |
const BASE_EFFECTS = [ 'fade', 'slide', 'scale' ]; |
| 23 |
const ADDITIONAL_EFFECTS = [ 'custom' ]; |
| 24 |
|
| 25 |
const TYPES = [ 'in', 'out' ]; |
| 26 |
const DIRECTIONS = [ 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right', '' ]; |
| 27 |
|
| 28 |
const BASE_EASING = [ 'easeIn' ]; |
| 29 |
const ADDITIONAL_EASING = [ 'easeOut', 'easeInOut', 'backIn', 'backInOut', 'backOut', 'linear' ]; |
| 30 |
|
| 31 |
const DEFAULT_REPEAT = ''; |
| 32 |
const REPEAT_OPTIONS = [ 'loop', 'times', '' ]; |
| 33 |
|
| 34 |
public static function easing_options() { |
| 35 |
return array_merge( self::BASE_EASING, self::ADDITIONAL_EASING ); |
| 36 |
} |
| 37 |
|
| 38 |
public static function effects_options() { |
| 39 |
return array_merge( self::BASE_EFFECTS, self::ADDITIONAL_EFFECTS ); |
| 40 |
} |
| 41 |
|
| 42 |
public static function triggers_options() { |
| 43 |
return array_merge( self::BASE_TRIGGERS, self::ADDITIONAL_TRIGGERS ); |
| 44 |
} |
| 45 |
|
| 46 |
public function defaults() { |
| 47 |
return [ |
| 48 |
'defaultDuration' => self::DEFAULT_DURATION, |
| 49 |
'defaultDelay' => self::DEFAULT_DELAY, |
| 50 |
'slideDistance' => self::DEFAULT_SLIDE_DISTANCE, |
| 51 |
'scaleStart' => self::DEFAULT_SCALE_START, |
| 52 |
'defaultEasing' => self::DEFAULT_EASING, |
| 53 |
'relativeTo' => self::DEFAULT_RELATIVE_TO, |
| 54 |
'repeat' => self::DEFAULT_REPEAT, |
| 55 |
'start' => self::DEFAULT_START, |
| 56 |
'end' => self::DEFAULT_END, |
| 57 |
]; |
| 58 |
} |
| 59 |
} |
| 60 |
|