| Server IP : 104.21.50.82 / Your IP : 216.73.217.175 Web Server : nginx/1.26.1 System : Linux HE9229 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/pinoygo_com_ph/wp-content/plugins/elementor/modules/interactions/ |
Upload File : |
<?php
namespace Elementor\Modules\Interactions;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Presets {
const DEFAULT_DURATION = 300;
const DEFAULT_DELAY = 0;
const DEFAULT_SLIDE_DISTANCE = 100;
const DEFAULT_SCALE_START = 0;
const DEFAULT_EASING = 'linear';
const TRIGGERS = [ 'load', 'scrollIn', 'scrollOn' ]; // 'scrollOut' is not supported yet.
const EFFECTS = [ 'fade', 'slide', 'scale' ];
const TYPES = [ 'in', 'out' ];
const DIRECTIONS = [ 'left', 'right', 'top', 'bottom' ];
const DURATIONS = [ 0, 100, 200, 300, 400, 500, 750, 1000, 1250, 1500 ];
const DELAYS = [ 0, 100, 200, 300, 400, 500, 750, 1000, 1250, 1500 ];
public function list() {
return $this->generate_animation_options();
}
public function defaults() {
return [
'defaultDuration' => self::DEFAULT_DURATION,
'defaultDelay' => self::DEFAULT_DELAY,
'slideDistance' => self::DEFAULT_SLIDE_DISTANCE,
'scaleStart' => self::DEFAULT_SCALE_START,
'easing' => self::DEFAULT_EASING,
];
}
private function get_label( $key, $value ) {
$special_labels = [
'trigger' => [
'load' => __( 'On page load', 'elementor' ),
'scrollIn' => __( 'Scroll into view', 'elementor' ),
'scrollOut' => __( 'Scroll out of view', 'elementor' ),
],
];
if ( isset( $special_labels[ $key ][ $value ] ) ) {
return $special_labels[ $key ][ $value ];
}
$label = ucwords( str_replace( '-', ' ', $value ) );
return esc_html( $label );
}
private function generate_animation_options() {
$options = [];
foreach ( self::TRIGGERS as $trigger ) {
foreach ( self::EFFECTS as $effect ) {
foreach ( self::TYPES as $type ) {
foreach ( self::DIRECTIONS as $direction ) {
foreach ( self::DURATIONS as $duration ) {
foreach ( self::DELAYS as $delay ) {
$value = "{$trigger}-{$effect}-{$type}-{$direction}-{$duration}-{$delay}";
$label = sprintf(
'%s: %s %s',
$this->get_label( 'trigger', $trigger ),
$this->get_label( 'effect', $effect ),
$this->get_label( 'type', $type ),
);
$options[] = [
'value' => $value,
'label' => $label,
];
}
}
}
foreach ( self::DURATIONS as $duration ) {
foreach ( self::DELAYS as $delay ) {
$value = "{$trigger}-{$effect}-{$type}--{$duration}-{$delay}";
$label = sprintf(
'%s: %s %s',
$this->get_label( 'trigger', $trigger ),
$this->get_label( 'effect', $effect ),
$this->get_label( 'type', $type ),
);
$options[] = [
'value' => $value,
'label' => $label,
];
}
}
}
}
}
return $options;
}
}