* @copyright 2007-2022 Leotheme * @license http://leotheme.com - prestashop template provider */ namespace LeoElements; use LeoElements\Leo_Helper; if ( ! defined( '_PS_VERSION_' ) ) { exit; // Exit if accessed directly. } /** * Elementor text shadow control. * * A base control for creating text shadows control. Displays input fields for * horizontal shadow, vertical shadow, shadow blur and shadow color. * * @since 1.6.0 */ class Control_Text_Shadow extends Control_Base_Multiple { /** * Get text shadow control type. * * Retrieve the control type, in this case `text_shadow`. * * @since 1.6.0 * @access public * * @return string Control type. */ public function get_type() { return 'text_shadow'; } /** * Get text shadow control default values. * * Retrieve the default value of the text shadow control. Used to return the * default values while initializing the text shadow control. * * @since 1.6.0 * @access public * * @return array Control default value. */ public function get_default_value() { return [ 'horizontal' => 0, 'vertical' => 0, 'blur' => 10, 'color' => 'rgba(0,0,0,0.3)', ]; } /** * Get text shadow control sliders. * * Retrieve the sliders of the text shadow control. Sliders are used while * rendering the control output in the editor. * * @since 1.6.0 * @access public * * @return array Control sliders. */ public function get_sliders() { return [ 'blur' => [ 'label' => Leo_Helper::__( 'Blur', 'elementor' ), 'min' => 0, 'max' => 100, ], 'horizontal' => [ 'label' => Leo_Helper::__( 'Horizontal', 'elementor' ), 'min' => -100, 'max' => 100, ], 'vertical' => [ 'label' => Leo_Helper::__( 'Vertical', 'elementor' ), 'min' => -100, 'max' => 100, ], ]; } /** * Render text shadow control output in the editor. * * Used to generate the control HTML in the editor using Underscore JS * template. The variables for the class are available using `data` JS * object. * * @since 1.6.0 * @access public */ public function content_template() { ?> <# var defaultColorValue = ''; if ( data.default.color ) { defaultColorValue = ' data-default-color=' + data.default.color; // Quotes added automatically. } #>