![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /proc/thread-self/cwd/wp-content/plugins/uicore-animate/includes/ |
<?php namespace UiCoreAnimate; /** * Frontend Pages Handler */ class Frontend { private $style = ''; /** * Constructor function to initialize hooks * * @return void */ public function __construct() { //Handle animation style in UiCore Framework Global if is active if (!\class_exists('\UiCore\Helper')) { $style = Settings::get_option('uianim_style'); if (is_array($style)) { $this->style = $style['value'] ? $style['value'] : 'style1'; //fallback for default style } else { $this->style = 'style1'; } if ($this->style) { add_action('elementor/frontend/after_enqueue_scripts', function () { wp_deregister_style('e-animations'); wp_dequeue_style('e-animations'); }, 20); add_action('wp_enqueue_scripts', [$this, 'animation_style'], 60); } //scroll add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts'], 60); } else { //add the resources to global files in UiCore Framework add_filter('uicore_css_global_files', [$this, 'add_css_to_framework'], 10, 2); add_filter('uicore_js_global_files', [$this, 'add_js_to_framework'], 10, 2); } } /** * Enqueue animation style * */ public function animation_style() { wp_dequeue_style('elementor-animations'); wp_enqueue_style('uianim-style', UICORE_ANIMATE_ASSETS . '/css/' . $this->style . '.css'); } /** * Enqueue scroll * */ public function enqueue_scripts() { //scroll if (Settings::get_option('uianim_scroll') == 'true') { wp_enqueue_script('uianim-scroll', UICORE_ANIMATE_ASSETS . '/js/scroll.js', UICORE_ANIMATE_VERSION, true); } if (\class_exists('\UiCoreBlocks\Base')) { wp_enqueue_script('uianim-entrance-animation', UICORE_ANIMATE_ASSETS . '/js/entrance-animation.js', UICORE_ANIMATE_VERSION, true); } } public function add_css_to_framework($files, $settings) { if ($settings['performance_animations'] === 'true') { $style = $settings['uianim_style']; $style = (isset($style['value']) && $style['value']) ? $style['value'] : 'style1'; //fallback for default style $files[] = UICORE_ANIMATE_PATH . '/assets/css/' . $style . '.css'; } return $files; } public function add_js_to_framework($files, $settings) { if ($settings['performance_animations'] === 'true' && $settings['uianim_scroll'] == 'true') { $files[] = UICORE_ANIMATE_PATH . '/assets/js/scroll.js'; } if (\class_exists('\UiCoreBlocks\Base')) { $files[] = UICORE_ANIMATE_PATH . '/assets/js/entrance-animation.js'; } return $files; } }