check_icon_draw() ? array( 'pa-fontawesome-all', 'pa-tweenmax', 'pa-motionpath', ) : array(); return array_merge( $draw_scripts, array( 'pa-slick', 'pa-slimscroll', 'lottie-js', 'premium-addons', ) ); } /** * Retrieve Widget Support URL. * * @access public * * @return string support URL. */ public function get_custom_help_url() { return 'https://premiumaddons.com/support/'; } /** * Register Smart Post Listing controls. * * @since 1.0.0 * @access protected */ protected function register_controls() { $this->options = apply_filters( 'pa_weather_options', array( 'source' => array( 'name' => __( 'City Name', 'premium-addons-for-elementor' ), 'coords' => __( 'City Coordinates (Pro)', 'premium-addons-for-elementor' ), ), 'layouts' => array( 'layout-1' => __( 'Layout 1', 'premium-addons-for-elementor' ), 'layout-2' => __( 'Layout 2', 'premium-addons-for-elementor' ), 'layout-3' => __( 'Layout 3 (Pro)', 'premium-addons-for-elementor' ), ), 'source_condition' => array( 'coords' ), 'dailyf_condition' => array( 'enable_forecast' => 'yes', ), 'custom_icons_condition' => array( 'enable_custom_icon' => 'yes', ), ) ); $this->register_content_tab_controls(); $this->register_style_tab_controls(); } /** * Adds content tab controls. * * @access private * @since 4.9.37 */ private function register_content_tab_controls() { $this->add_general_section_controls(); $this->add_display_options_section(); $this->add_hourly_forecast_section(); $this->add_daily_forecast_section(); $this->add_custom_icons_section(); $this->add_helpful_info_section(); } /** * Adds style tab controls. * * @access private * @since 4.9.37 */ private function register_style_tab_controls() { $this->add_city_style(); $this->add_current_weather_style(); $this->add_hourly_style(); $this->add_forecast_style(); $this->add_tabs_style(); $this->add_navigation_style(); $this->add_outer_container_style(); } /** * Adds General controls. * * @access private * @since 4.9.37 */ private function add_general_section_controls() { $papro_activated = apply_filters( 'papro_activated', false ); $this->start_controls_section( 'pa_weather_general_section', array( 'label' => __( 'General Settings', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'api_key', array( 'label' => __( 'API Key', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'description' => 'Get your OpenWeatherMap API Key by signing up here', ) ); $this->add_control( 'location_type', array( 'label' => __( 'Location', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'render_type' => 'template', 'label_block' => true, 'options' => array( 'current' => __( 'Current Location', 'premium-addons-for-elementor' ), 'custom' => __( 'Custom Location', 'premium-addons-for-elementor' ), ), 'default' => 'custom', ) ); $this->add_control( 'custom_location_type', array( 'label' => __( 'Get By:', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'render_type' => 'template', 'label_block' => true, 'options' => $this->options['source'], 'default' => 'name', 'condition' => array( 'location_type' => 'custom', ), ) ); $this->add_control( 'city_name', array( 'label' => __( 'City Name', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => array( 'active' => true ), 'label_block' => true, 'default' => 'London', 'condition' => array( 'location_type' => 'custom', 'custom_location_type' => 'name', ), ) ); if ( ! $papro_activated ) { $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'editor-page', 'wp-editor', 'get-pro' ); $this->add_control( 'weather_notice', array( 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '', 'content_classes' => 'papro-upgrade-notice', 'condition' => array( 'custom_location_type' => $this->options['source_condition'], ), ) ); } else { do_action( 'pa_weather_source_controls', $this ); } $this->add_control( 'unit', array( 'label' => __( 'Unit', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'render_type' => 'template', 'label_block' => true, 'options' => array( 'metric' => __( 'Metric', 'premium-addons-for-elementor' ), 'imperial' => __( 'Imperial', 'premium-addons-for-elementor' ), ), 'default' => 'metric', ) ); $this->add_control( 'lang', array( 'label' => __( 'Language', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'description' => __( 'Please note that this affects only the city name and weather description', 'premium-addons-for-elementor' ), 'render_type' => 'template', 'label_block' => true, 'options' => array( 'af' => __( 'Afrikaans', 'premium-addons-for-elementor' ), 'al' => __( 'Albanian', 'premium-addons-for-elementor' ), 'ar' => __( 'Arabic', 'premium-addons-for-elementor' ), 'az' => __( 'Azerbaijani', 'premium-addons-for-elementor' ), 'bg' => __( 'Bulgarian', 'premium-addons-for-elementor' ), 'ca' => __( 'Catalan', 'premium-addons-for-elementor' ), 'cz' => __( 'Czech', 'premium-addons-for-elementor' ), 'da' => __( 'Danish', 'premium-addons-for-elementor' ), 'de' => __( 'German', 'premium-addons-for-elementor' ), 'el' => __( 'Greek', 'premium-addons-for-elementor' ), 'en' => __( 'English', 'premium-addons-for-elementor' ), 'eu' => __( 'Basque', 'premium-addons-for-elementor' ), 'fa' => __( 'Persian (Farsi)', 'premium-addons-for-elementor' ), 'fi' => __( 'Finnish', 'premium-addons-for-elementor' ), 'fr' => __( 'French', 'premium-addons-for-elementor' ), 'gl' => __( 'Galician', 'premium-addons-for-elementor' ), 'he' => __( 'Hebrew', 'premium-addons-for-elementor' ), 'hi' => __( 'Hindi', 'premium-addons-for-elementor' ), 'hr' => __( 'Croatian', 'premium-addons-for-elementor' ), 'hu' => __( 'Hungarian', 'premium-addons-for-elementor' ), 'id' => __( 'Indonesian', 'premium-addons-for-elementor' ), 'it' => __( 'Italian', 'premium-addons-for-elementor' ), 'ja' => __( 'Japanese', 'premium-addons-for-elementor' ), 'kr' => __( 'Korean', 'premium-addons-for-elementor' ), 'la' => __( 'Latvian', 'premium-addons-for-elementor' ), 'lt' => __( 'Lithuanian', 'premium-addons-for-elementor' ), 'mk' => __( 'Macedonian', 'premium-addons-for-elementor' ), 'no' => __( 'Norwegian', 'premium-addons-for-elementor' ), 'nl' => __( 'Dutch', 'premium-addons-for-elementor' ), 'pl' => __( 'Polish', 'premium-addons-for-elementor' ), 'pt' => __( 'Portuguese', 'premium-addons-for-elementor' ), 'pt' => __( 'br Português Brasil', 'premium-addons-for-elementor' ), 'ro' => __( 'Romanian', 'premium-addons-for-elementor' ), 'ru' => __( 'Russian', 'premium-addons-for-elementor' ), 'se' => __( 'Swedish', 'premium-addons-for-elementor' ), 'sk' => __( 'Slovak', 'premium-addons-for-elementor' ), 'sl' => __( 'Slovenian', 'premium-addons-for-elementor' ), 'es' => __( 'Spanish', 'premium-addons-for-elementor' ), 'sr' => __( 'Serbian', 'premium-addons-for-elementor' ), 'th' => __( 'Thai', 'premium-addons-for-elementor' ), 'tr' => __( 'Turkish', 'premium-addons-for-elementor' ), 'uk' => __( 'Ukrainian', 'premium-addons-for-elementor' ), 'vi' => __( 'Vietnamese', 'premium-addons-for-elementor' ), 'zh_cn' => __( 'cn Chinese Simplified', 'premium-addons-for-elementor' ), 'zh_tw' => __( 'Chinese Traditional', 'premium-addons-for-elementor' ), 'zu' => __( 'Zulu', 'premium-addons-for-elementor' ), ), 'default' => 'en', ) ); $this->add_control( 'reload', array( 'label' => __( 'Reload Data Once Every', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'separator' => 'before', 'options' => array( 1 => __( 'Hour', 'premium-addons-for-elementor' ), 3 => __( '3 Hours', 'premium-addons-for-elementor' ), 6 => __( '6 Hours', 'premium-addons-for-elementor' ), 12 => __( '12 Hours', 'premium-addons-for-elementor' ), 24 => __( 'Day', 'premium-addons-for-elementor' ), ), 'default' => 6, 'condition' => array( 'location_type' => 'custom', ), ) ); $this->end_controls_section(); } private function add_display_options_section() { $this->start_controls_section( 'pa_weather_display_section', array( 'label' => __( 'Current Weather', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'layout', array( 'label' => __( 'Choose Layout', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'prefix_class' => 'premium-weather__', 'render_type' => 'template', 'label_block' => true, 'options' => $this->options['layouts'], 'default' => 'layout-1', ) ); $this->add_control( 'show_temp_icon', array( 'label' => __( 'Show Temperature Icon', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'current_weather_heading', array( 'label' => esc_html__( 'Current Weather', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'show_current_weather', array( 'label' => __( 'Current Weather', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), 'default' => 'yes', ) ); $this->add_control( 'show_curr_weather_desc', array( 'label' => __( 'Weather State', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), 'default' => 'yes', 'condition' => array( 'show_current_weather' => 'yes', ), ) ); $this->add_control( 'show_city', array( 'label' => __( 'Title', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), 'default' => 'yes', 'condition' => array( 'show_current_weather' => 'yes', ), ) ); $this->add_control( 'title', array( 'label' => __( 'Title', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::TEXT, 'description' => __( 'Use this option to add a title of your choice, and use the {{city_name}} placeholder to add your city name.', 'premium-addons-for-elementor' ), 'label_block' => true, 'dynamic' => array( 'active' => true ), 'default' => '{{city_name}}', 'condition' => array( 'show_city' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->add_control( 'display_options_heading', array( 'label' => esc_html__( 'Display Options', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, 'condition' => array( 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'current_weather_display', array( 'label' => __( 'Current Weather Display', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'prefix_class' => 'premium-cw%s-', 'options' => array( 'inline' => array( 'title' => __( 'Inline', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-h', ), 'block' => array( 'title' => __( 'Block', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-v', ), ), 'default' => 'block', 'toggle' => false, 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'current_align', array( 'label' => __( 'Current Weather Alignment', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => array( 'flex-start' => array( 'title' => __( 'Left', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-left', ), 'center' => array( 'title' => __( 'Center', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-center', ), 'flex-end' => array( 'title' => __( 'Right', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-right', ), ), 'default' => 'center', 'toggle' => false, 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather' => 'justify-content: {{VALUE}}', ), 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'city_align', array( 'label' => __( 'Title Alignment', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'description' => __( 'Note: this options works only if the "Current Weather Alignment" is set to block', 'premium-addons-for-elementor' ), 'options' => array( 'left' => array( 'title' => __( 'Left', 'premium-addons-for-elementor' ), 'icon' => 'eicon-text-align-left', ), 'center' => array( 'title' => __( 'Center', 'premium-addons-for-elementor' ), 'icon' => 'eicon-text-align-center', ), 'right' => array( 'title' => __( 'Right', 'premium-addons-for-elementor' ), 'icon' => 'eicon-text-align-right', ), ), 'default' => 'center', 'toggle' => false, 'conditions' => array( 'terms' => array( array( 'name' => 'show_current_weather', 'value' => 'yes', ), array( 'name' => 'show_city', 'value' => 'yes', ), array( 'name' => 'layout', 'operator' => '!==', 'value' => 'layout-3', ), ), ), 'selectors' => array( '{{WRAPPER}} .premium-weather__city-wrapper' => 'text-align: {{VALUE}};', ), ) ); $this->add_responsive_control( 'cur_weather_sec_display', array( 'label' => __( 'Container Display', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'prefix_class' => 'premium-cw-sec%s-', 'options' => array( 'inline' => array( 'title' => __( 'Inline', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-h', ), 'block' => array( 'title' => __( 'Block', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-v', ), ), 'default' => 'block', 'toggle' => false, 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', 'show_extra_info' => 'yes', ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => '{{VALUE}}', ), ) ); $this->add_responsive_control( 'cur_weather_sec_align', array( 'label' => __( 'Container Alignment', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => true, 'options' => array( 'flex-start' => array( 'title' => __( 'Left', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-left', ), 'center' => array( 'title' => __( 'Center', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-center', ), 'flex-end' => array( 'title' => __( 'Right', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-right', ), 'space-between' => array( 'title' => __( 'Strech', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-stretch', ), ), 'default' => 'space-between', 'toggle' => false, 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => 'justify-content: {{VALUE}}', ), 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', 'show_extra_info' => 'yes', 'cur_weather_sec_display' => 'inline', ), ) ); $this->add_control( 'cur_weather_sec_order', array( 'label' => __( 'Extra Weather Order', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'toggle' => false, 'options' => array( '0' => array( 'title' => __( 'First', 'premium-addons-for-elementor' ), 'icon' => 'eicon-order-start', ), '2' => array( 'title' => __( 'Last', 'premium-addons-for-elementor' ), 'icon' => 'eicon-order-end', ), ), 'default' => '0', 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', 'show_extra_info' => 'yes', 'cur_weather_sec_display' => 'inline', ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather .premium-weather__extra-weather' => 'order: {{VALUE}}', ), ) ); $this->add_responsive_control( 'cur_weather_sec_spacing', array( 'label' => __( 'Section Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em' ), 'condition' => array( 'layout' => 'layout-1', 'show_current_weather' => 'yes', 'show_extra_info' => 'yes', 'cur_weather_sec_display' => 'inline', ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => 'column-gap: {{SIZE}}{{UNIT}}', ), ) ); $this->add_control( 'show_extra_info', array( 'label' => __( 'Additional Weather Info', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'before', 'condition' => array( 'show_current_weather' => 'yes', ), ) ); $this->add_control( 'pa_extra_weather', array( 'label' => __( 'Weather Data', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT2, 'options' => array( 'wind' => __( 'Wind Speed', 'premium-addons-for-elementor' ), 'pressure' => __( 'Pressure', 'premium-addons-for-elementor' ), 'humidity' => __( 'Humidity', 'premium-addons-for-elementor' ), 'rain' => __( 'Rain', 'premium-addons-for-elementor' ), 'snow' => __( 'Snow', 'premium-addons-for-elementor' ), ), 'default' => array( 'wind', 'pressure', 'humidity' ), 'multiple' => true, 'label_block' => true, 'description' => __( 'Please note that if you do not see some of the parameters displayed, it means that these weather phenomena have just not happened for the time of measurement for the city or location chosen', 'premium-addons-for-elementor' ), 'condition' => array( 'show_extra_info' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'extra_weather_display', array( 'label' => __( 'Display', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => array( 'row' => array( 'title' => __( 'Inline', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-h', ), 'column' => array( 'title' => __( 'Block', 'premium-addons-for-elementor' ), 'icon' => 'eicon-ellipsis-v', ), ), 'default' => 'column', 'toggle' => false, 'selectors' => array( '{{WRAPPER}}.premium-weather__layout-2:not(.premium-weather__hourly-yes) .premium-weather__extra-weather' => 'flex-direction: {{VALUE}}', ), 'condition' => array( 'show_extra_info' => 'yes', 'enable_hourly!' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'extra_weather_alignment', array( 'label' => __( 'ًWeather Alignment', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => array( 'flex-start' => array( 'title' => __( 'Left', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-left', ), 'center' => array( 'title' => __( 'Center', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-center', ), 'flex-end' => array( 'title' => __( 'Right', 'premium-addons-for-elementor' ), 'icon' => 'eicon-h-align-right', ), ), 'default' => 'center', 'toggle' => false, 'selectors' => array( '{{WRAPPER}}.premium-weather__layout-1 .premium-weather__extra-weather,{{WRAPPER}}.premium-weather__layout-2:not(.premium-weather__hourly-yes) .premium-weather__extra-outer-wrapper' => 'justify-content: {{VALUE}}', ), 'condition' => array( 'show_extra_info' => 'yes', 'layout!' => 'layout-3', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'extra_weather_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather i' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .premium-weather__extra-weather svg' => 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};', ), 'condition' => array( 'show_extra_info' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'extra_weather_icon_spacing', array( 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather > div' => 'gap: {{SIZE}}{{UNIT}}', ), 'condition' => array( 'show_extra_info' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->add_responsive_control( 'extra_weather_spacing', array( 'label' => __( 'Spacing Between', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather' => 'gap: {{SIZE}}{{UNIT}}', ), 'condition' => array( 'show_extra_info' => 'yes', 'show_current_weather' => 'yes', ), ) ); $this->end_controls_section(); } private function add_daily_forecast_section() { $papro_activated = apply_filters( 'papro_activated', false ); $this->start_controls_section( 'pa_daily_forecast_section', array( 'label' => __( 'Daily Forecast', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'enable_forecast', array( 'label' => __( 'Daily Forecast', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), 'description' => __( 'This option allows you to add daily forecast up to 7 days', 'premium-addons-for-elementor' ), ) ); if ( ! $papro_activated ) { $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'editor-page', 'wp-editor', 'get-pro' ); $this->add_control( 'weather_notice2', array( 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '', 'content_classes' => 'papro-upgrade-notice', 'condition' => $this->options['dailyf_condition'], ) ); } else { do_action( 'pa_weather_daily_forecast_controls', $this ); } $this->end_controls_section(); } private function add_hourly_forecast_section() { $this->start_controls_section( 'pa_hourly_forecast_section', array( 'label' => __( 'Hourly Forecast', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'enable_hourly', array( 'label' => __( 'Hourly Forecast', 'premium-addons-for-elementor' ), 'prefix_class' => 'premium-weather__hourly-', 'render_type' => 'template', 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'premium-addons-for-elementor' ), 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ), 'description' => __( 'This option allows you to add hourly weather condition.', 'premium-addons-for-elementor' ), 'default' => 'yes', ) ); $this->add_control( 'hourly_layout', array( 'label' => __( 'Choose Layout', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT, 'prefix_class' => 'premium-hours-', 'render_type' => 'template', 'label_block' => true, 'options' => array( 'default' => __( 'Layout 1', 'premium-addons-for-elementor' ), 'vertical' => __( 'Layout 2', 'premium-addons-for-elementor' ), ), 'default' => 'default', 'condition' => array( 'enable_hourly' => 'yes', 'layout!' => 'layout-2', ), ) ); $this->add_control( 'hourly_max', array( 'label' => __( 'Max Number of Hours', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => __( 'Set a maximum number of hours to display', 'premium-addons-for-elementor' ), 'default' => 12, 'max' => 24, 'min' => 1, 'condition' => array( 'enable_hourly' => 'yes', ), ) ); $this->add_responsive_control( 'slides_to_show', array( 'label' => __( 'Hours To Show', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::NUMBER, 'devices' => array( 'desktop', 'tablet', 'mobile' ), 'default' => 8, 'max' => 24, 'min' => 1, 'condition' => array( 'enable_hourly' => 'yes', ), ) ); $this->add_responsive_control( 'slides_to_scroll', array( 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::NUMBER, 'devices' => array( 'desktop', 'tablet', 'mobile' ), 'default' => 2, 'max' => 24, 'condition' => array( 'enable_hourly' => 'yes', 'hourly_layout' => 'default', ), ) ); $this->add_control( 'show_arrows_on_hover', array( 'label' => __( 'Display Arrows On Hover', 'premium-addons-for-elementor' ), 'prefix_class' => 'premium-weather-hidden-arrows-', 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => array( 'enable_hourly' => 'yes', ), ) ); $this->add_control( 'hourly_ele_min_width', array( 'label' => __( 'Element Minimum Width', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}}.premium-hours-vertical .premium-weather__hourly-data > *' => 'min-width: {{SIZE}}px;', ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'condition' => array( 'enable_hourly' => 'yes', 'hourly_layout' => 'vertical', ), ) ); $this->add_control( 'hourly_weather_data', array( 'label' => __( 'Weather Data', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SELECT2, 'label_block' => true, 'options' => array( 'temp' => __( 'Temperature', 'premium-addons-for-elementor' ), 'desc' => __( 'Description', 'premium-addons-for-elementor' ), 'desc_icon' => __( 'Weather Icon', 'premium-addons-for-elementor' ), 'wind' => __( 'Wind Speed', 'premium-addons-for-elementor' ), 'pressure' => __( 'Pressure', 'premium-addons-for-elementor' ), 'humidity' => __( 'Humidity', 'premium-addons-for-elementor' ), ), 'default' => array( 'desc_icon', 'temp', 'pressure', 'humidity', 'wind' ), 'multiple' => true, 'condition' => array( 'enable_hourly' => 'yes', 'hourly_layout' => 'vertical', 'layout!' => 'layout-2', ), ) ); $this->end_controls_section(); } private function add_custom_icons_section() { $papro_activated = apply_filters( 'papro_activated', false ); $this->start_controls_section( 'pa_custom_icon_section', array( 'label' => __( 'Custom Icons', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'enable_custom_icon', array( 'label' => __( 'Use Custom Icons', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, ) ); if ( ! $papro_activated ) { $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'editor-page', 'wp-editor', 'get-pro' ); $this->add_control( 'weather_notice3', array( 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '', 'content_classes' => 'papro-upgrade-notice', 'condition' => $this->options['custom_icons_condition'], ) ); } else { do_action( 'pa_weather_custom_icons_controls', $this ); $draw_icon = $this->check_icon_draw(); $this->add_control( 'draw_svg', array( 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SWITCHER, 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . 'tutorial', 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled', 'description' => __( 'Use this option to draw your Font Awesome Custom Icons.', 'premium-addons-for-elementor' ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'custom', ), ) ); if ( $draw_icon ) { $this->add_control( 'path_width', array( 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 50, 'step' => 0.1, ), ), 'condition' => array( 'draw_svg' => 'yes', 'enable_custom_icon' => 'yes', 'icons_source' => 'custom', ), 'selectors' => array( '{{WRAPPER}} .premium-drawable-icon *' => 'stroke-width: {{SIZE}};', ), ) ); $this->add_control( 'stroke_color', array( 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'global' => array( 'default' => Global_Colors::COLOR_ACCENT, ), 'condition' => array( 'draw_svg' => 'yes', 'enable_custom_icon' => 'yes', 'icons_source' => 'custom', ), 'selectors' => array( '{{WRAPPER}} .premium-drawable-icon *' => 'stroke: {{VALUE}};', ), ) ); $this->add_control( 'svg_color', array( 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'global' => false, 'separator' => 'after', 'condition' => array( 'draw_svg' => 'yes', 'enable_custom_icon' => 'yes', 'icons_source' => 'custom', ), ) ); } else { Helper_Functions::get_draw_svg_notice( $this, 'weather', array( 'enable_custom_icon' => 'yes', 'icons_source' => 'custom', ) ); } } $this->end_controls_section(); } private function add_helpful_info_section() { $this->start_controls_section( 'section_pa_docs', array( 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ), ) ); $docs = array( 'https://premiumaddons.com/docs/elementor-weather-widget/' => __( 'Getting started »', 'premium-addons-for-elementor' ), 'https://premiumaddons.com/docs/how-to-get-api-key-for-elementor-weather-forecast-widget/' => __( 'How to Get an API Key for Weather widget »', 'premium-addons-for-elementor' ), ); $doc_index = 1; foreach ( $docs as $url => $title ) { $doc_url = Helper_Functions::get_campaign_link( $url, 'editor-page', 'wp-editor', 'get-support' ); $this->add_control( 'doc_' . $doc_index, array( 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( '%s', $doc_url, $title ), 'content_classes' => 'editor-pa-doc', ) ); ++$doc_index; } $this->end_controls_section(); } /** Style Controls.*/ /** * Adds posts title style controls. * * @access private * @since 4.9.37 */ private function add_outer_container_style() { $this->start_controls_section( 'pa_weather_outer', array( 'label' => __( 'Container', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'outer_shadow', 'selector' => '{{WRAPPER}} .premium-weather__outer-wrapper', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'outer_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__outer-wrapper', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'outer_border', 'selector' => '{{WRAPPER}} .premium-weather__outer-wrapper', ) ); $this->add_control( 'outer_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__outer-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};;', ), ) ); $this->add_responsive_control( 'outer_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__outer-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_city_style() { $this->start_controls_section( 'pa_weather_city_style', array( 'label' => __( 'Title', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'show_city' => 'yes', 'title!' => '', 'show_current_weather' => 'yes', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'city_name', 'selector' => '{{WRAPPER}} .premium-weather__city-name', ) ); $this->add_control( 'city_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'global' => array( 'default' => Global_Colors::COLOR_SECONDARY, ), 'selectors' => array( '{{WRAPPER}} .premium-weather__city-name' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), array( 'name' => 'city_shadow', 'selector' => '{{WRAPPER}} .premium-weather__city-name', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'city_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__city-name', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'city_border', 'selector' => '{{WRAPPER}} .premium-weather__city-name', ) ); $this->add_control( 'city_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__city-name' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'city_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__city-name' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'city_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__city-name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_current_weather_style() { $this->start_controls_section( 'pa_weather_current', array( 'label' => __( 'Current Weather', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'show_current_weather' => 'yes', ), ) ); $this->start_controls_tabs( 'current_weather_tabs' ); $this->start_controls_tab( 'pa_current_tab', array( 'label' => __( 'Current', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_current_temp', array( 'label' => esc_html__( 'Temperature', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'temp', 'fields_options' => array( 'font_family' => array( 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper *, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper *' => 'font-family:"{{VALUE}}", Sans-serif;', ), ), ), 'selector' => '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper .premium-weather__temp-val, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper .premium-weather__temp-val', ) ); $this->add_control( 'temp_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'global' => array( 'default' => Global_Colors::COLOR_SECONDARY, ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'current_temp_icon_color', array( 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper > svg *, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper > svg *' => 'fill: {{VALUE}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_responsive_control( 'current_temp_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper > svg, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper > svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_responsive_control( 'current_temp_margin', array( 'label' => __( 'Icon Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__basic-weather .premium-weather__temp-wrapper > svg, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__extra-outer-wrapper .premium-weather__temp-wrapper > svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_control( 'pa_current_temp_unit', array( 'label' => esc_html__( 'Temperature Unit', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_responsive_control( 'temp_unit_typo', array( 'label' => __( 'Font Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__temp-unit' => 'font-size: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'temp_unit_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__temp-unit' => 'top: {{TOP}}{{UNIT}}; right: {{RIGHT}}{{UNIT}}; bottom: {{BOTTOM}}{{UNIT}}; left:{{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_current_desc', array( 'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'desc_typo', 'selector' => '{{WRAPPER}} .premium-weather__desc', ) ); $this->add_control( 'desc_color', array( 'label' => __( 'Description Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__desc' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'desc_feels_typo', 'label' => __( 'Feels Like Typography', 'premium-addons-for-elementor' ), 'selector' => '{{WRAPPER}} .premium-weather__feels-like', ) ); $this->add_control( 'desc_feels_color', array( 'label' => __( 'Feels Like Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'global' => array( 'default' => Global_Colors::COLOR_SECONDARY, ), 'selectors' => array( '{{WRAPPER}} .premium-weather__feels-like' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'temp_icon_color', array( 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper > svg *' => 'fill: {{VALUE}};', '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper' => 'color: {{VALUE}}', ), ) ); $this->add_responsive_control( 'temp_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper .premium-lottie-animation, {{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper img' => 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};', '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};', ), ) ); $papro_activated = apply_filters( 'papro_activated', false ); if ( $papro_activated ) { $this->add_control( 'temp_icon_stroke', array( 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke: {{VALUE}} !important', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); $this->add_responsive_control( 'temp_stork_width', array( 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke-width: {{SIZE}}{{UNIT}} !important;', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); } $this->add_responsive_control( 'temp_icon_margin', array( 'label' => __( 'Icon Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__basic-weather .premium-weather__icon-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'desc_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-3) .premium-weather__desc-wrapper, {{WRAPPER}}.premium-weather__layout-3 .premium-weather__feels-like' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'pa_extra_tab', array( 'label' => __( 'Extra Weather', 'premium-addons-for-elementor' ), 'condition' => array( 'show_extra_info' => 'yes', ), ) ); $this->add_extra_weather_style(); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'pa_current_conatainer', array( 'label' => esc_html__( 'Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'current_shadow', 'selector' => '{{WRAPPER}} .premium-weather__current-weather', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'current_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__current-weather', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'current_border', 'selector' => '{{WRAPPER}} .premium-weather__current-weather', ) ); $this->add_control( 'current_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'current_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'current_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__current-weather' => 'Margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_extra_weather_style() { $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'extra_weather_name', 'selector' => '{{WRAPPER}} .premium-weather__extra-weather span', ) ); $this->add_control( 'extra_weather_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather span' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'extra_weather_icon_color', array( 'label' => __( 'Icons Colors', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather i' => 'color: {{VALUE}};', '{{WRAPPER}} .premium-weather__extra-weather svg, {{WRAPPER}} .premium-weather__extra-weather svg path' => 'fill: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'extra_weather_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__extra-weather > div', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'extra_weather_border', 'selector' => '{{WRAPPER}} .premium-weather__extra-weather > div', ) ); $this->add_control( 'extra_weather_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather > div' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'extra_weather_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather > div' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'extra_weather_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-weather > div' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); } private function add_forecast_style() { $this->start_controls_section( 'pa_weather_forecast_style', array( 'label' => __( 'Daily Forecast', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'conditions' => array( 'terms' => array( array( 'name' => 'enable_forecast', 'value' => 'yes', ), array( 'relation' => 'or', 'terms' => array( array( 'name' => 'forecast_tabs', 'operator' => '!==', 'value' => 'yes', ), array( 'terms' => array( array( 'name' => 'forecast_tabs', 'value' => 'yes', ), array( 'name' => 'forecast_days', 'operator' => 'in', 'value' => array( '1', '6', '7', '8' ), ), ), ), ), ), ), ), ) ); $this->add_control( 'pa_forecast_date', array( 'label' => esc_html__( 'Date', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'forecast_date', 'selector' => '{{WRAPPER}} .premium-weather__forecast-item-date', ) ); $this->add_control( 'forecast_date_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-date' => 'color: {{VALUE}};', ), ) ); $this->add_responsive_control( 'forecast_date_margin', array( 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-date' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'layout' => 'layout-1', ), ) ); $this->add_control( 'pa_forecast_temp_max', array( 'label' => esc_html__( 'Max Temperatrue', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'pa_forecast_temp_max_typo', 'selector' => '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__temp-max', ) ); $this->add_control( 'pa_forecast_temp_max_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__temp-max' => 'color: {{VALUE}};', ), ) ); $this->add_responsive_control( 'max_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__temp-max' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_forecast_temp_min', array( 'label' => esc_html__( 'Min Temepratrue', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'pa_forecast_temp_min_typo', 'selector' => '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__temp-min', ) ); $this->add_control( 'pa_forecast_temp_min_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__temp-min' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'paa_forecast_temp_icon_color', array( 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-data > span > svg, {{WRAPPER}} .premium-weather__forecast-item-data > span > svg *' => 'fill: {{VALUE}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_responsive_control( 'pa_forecast_temp_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-data > span > svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_responsive_control( 'pa_forecast_temp_margin', array( 'label' => __( 'Icon Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-data > span > svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'show_temp_icon' => 'yes', ), ) ); $this->add_control( 'forecast_icon', array( 'label' => esc_html__( 'Weather Icon', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, 'condition' => array( 'show_forecast_icon' => 'yes', ), ) ); $this->add_control( 'forecast_icon_color', array( 'label' => __( 'Icons Colors', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper > svg *' => 'fill: {{VALUE}};', '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper' => 'color: {{VALUE}};', ), 'condition' => array( 'show_forecast_icon' => 'yes', ), ) ); $papro_activated = apply_filters( 'papro_activated', false ); if ( $papro_activated ) { $this->add_control( 'forecast_icon_stroke', array( 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke: {{VALUE}} !important', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); $this->add_responsive_control( 'forecast_stork_width', array( 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke-width: {{SIZE}}{{UNIT}} !important;', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); } $this->add_responsive_control( 'forecast_icon_size', array( 'label' => __( 'Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper .premium-lottie-animation, {{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper img' => 'width:{{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};', '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper i' => 'font-size:{{SIZE}}px', ), 'condition' => array( 'show_forecast_icon' => 'yes', ), ) ); $this->add_responsive_control( 'icon_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'layout' => 'layout-1', 'show_forecast_icon' => 'yes', ), ) ); $this->add_responsive_control( 'icon_b_spacing', array( 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item .premium-weather__icon-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'layout' => 'layout-3', 'show_forecast_icon' => 'yes', ), ) ); $this->add_control( 'pa_forecast_cont', array( 'label' => esc_html__( 'Item Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'pa_forecast_cont_shadow', 'selector' => '{{WRAPPER}} .premium-weather__forecast-item', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'forecast_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__forecast-item', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'forecast_border', 'selector' => '{{WRAPPER}} .premium-weather__forecast-item', ) ); $this->add_control( 'forecast_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'forecast_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'forecast_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_forecast_cont_outer', array( 'label' => esc_html__( 'Outer Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'pa_forecast_cont_outer_shadow', 'selector' => '{{WRAPPER}} .premium-weather__forecast', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'outer_forecast_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__forecast', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'forecast__outer_border', 'selector' => '{{WRAPPER}} .premium-weather__forecast', ) ); $this->add_control( 'forecast_border_outer_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'forecast_outer_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'forecast_outer_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_hourly_style() { $this->start_controls_section( 'pa_weather_hourly_style', array( 'label' => __( 'Hourly Forecast', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'enable_hourly' => 'yes', ), ) ); $this->add_control( 'pa_hourly_date', array( 'label' => esc_html__( 'Hours', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'hourly_date', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item-date', ) ); $this->add_control( 'hourly_date_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item-date' => 'color: {{VALUE}};', ), ) ); $this->add_responsive_control( 'hourly_date_margin', array( 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item-date' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'hourly_layout' => 'default', ), ) ); $this->add_control( 'pa_hourly_temp_max', array( 'label' => esc_html__( 'Weather Details', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'pa_hourly_temp_max_typo', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) > span, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper > span', ) ); $this->add_control( 'pa_hourly_temp_max_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) > span, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper > span' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_hourly_temp_icon_color', array( 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) svg, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper svg, {{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) svg *, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper svg *' => 'fill: {{VALUE}};', '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data i' => 'color: {{VALUE}};', ), ) ); $this->add_responsive_control( 'pa_hourly_temp_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) svg, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data i' => 'font-size: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_hourly_temp_margin', array( 'label' => __( 'Icon Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data > *:not(.premium-weather__icon-wrapper) svg, {{WRAPPER}} .premium-weather__hourly-item .premium-weather__hourly-data i, {{WRAPPER}}:not(.premium-hours-vertical) .premium-weather__hourly-item .premium-weather__temp-wrapper svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'hourly_icon', array( 'label' => esc_html__( 'Weather Icon', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'hourly_icon_color', array( 'label' => __( 'Icons Colors', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper > svg *' => 'fill: {{VALUE}};', '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper' => 'color: {{VALUE}}', ), ) ); $papro_activated = apply_filters( 'papro_activated', false ); if ( $papro_activated ) { $this->add_control( 'hourly_icon_stroke', array( 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke: {{VALUE}} !important', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); $this->add_responsive_control( 'hourly_stork_width', array( 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper .premium-lottie-animation svg *' => 'stroke-width: {{SIZE}}{{UNIT}} !important;', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); } $this->add_responsive_control( 'hourly_icon_size', array( 'label' => __( 'Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper .premium-lottie-animation, {{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper img' => 'width:{{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};', '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper i' => 'font-size: {{SIZE}}px', ), ) ); $this->add_responsive_control( 'hourly_icon_margin', array( 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item .premium-weather__icon-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'hourly_layout' => 'default', ), ) ); $this->add_control( 'pa_hourly_cont', array( 'label' => esc_html__( 'Item Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'pa_hourly_cont_shadow', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'hourly_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'hourly_border', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather', ) ); $this->add_control( 'hourly_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'hourly_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'hourly_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-weather' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_hourly_cont_outer', array( 'label' => esc_html__( 'Outer Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'pa_hourly_cont_outer_shadow', 'selector' => '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'outer_hourly_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'hourly__outer_border', 'selector' => '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper', ) ); $this->add_control( 'hourly_border_outer_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'hourly_outer_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'hourly_outer_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}}:not(.premium-weather__layout-2) .premium-weather__hourly-forecast-wrapper, {{WRAPPER}}.premium-weather__layout-2 .premium-weather__extra-outer-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_navigation_style() { $this->start_controls_section( 'pa_nav_style', array( 'label' => __( 'Carousel Arrows', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'conditions' => array( 'relation' => 'or', 'terms' => array( array( 'name' => 'enable_hourly', 'value' => 'yes', ), array( 'terms' => array( array( 'name' => 'enable_forecast', 'value' => 'yes', ), array( 'name' => 'forecast_carousel_sw', 'value' => 'yes', ), array( 'name' => 'forecast_layouts', 'operator' => '!==', 'value' => 'style-4', ), ), ), ), ), ) ); $this->add_responsive_control( 'nav_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .carousel-arrow i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .carousel-arrow svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'nav_arrow_height', array( 'label' => __( 'Arrow Height', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .carousel-arrow' => 'height: {{SIZE}}{{UNIT}};', ), 'condition' => array( 'relation' => 'or', 'terms' => array( array( 'name' => 'layout', 'value' => 'layout-2', ), array( 'terms' => array( array( 'name' => 'layout', 'operator' => '!==', 'value' => 'layout-2', ), array( 'name' => 'hourly_layout', 'value' => 'default', ), ), ), ), ), ) ); $this->add_responsive_control( 'nav_arrow_pos', array( 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .carousel-arrow' => 'top: {{SIZE}}px;', ), 'condition' => array( 'relation' => 'or', 'terms' => array( array( 'name' => 'layout', 'value' => 'layout-2', ), array( 'terms' => array( array( 'name' => 'layout', 'operator' => '!==', 'value' => 'layout-2', ), array( 'name' => 'hourly_layout', 'value' => 'default', ), ), ), ), ), ) ); $this->start_controls_tabs( 'nav_colors' ); $this->start_controls_tab( 'pa_nav_nomral', array( 'label' => __( 'Normal', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_hourly_arrows_heading', array( 'label' => esc_html__( 'Hourly Forecast Arrows', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'pa_nav_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#171717', 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_nav_bg', array( 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#F0F0F0', 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_nav_border', 'selector' => '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow', ) ); $this->add_control( 'pa_nav_border_radius', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-prev.carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-prev.carousel-arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-next.carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-next.carousel-arrow ' => 'border-radius: {{RIGHT}}{{UNIT}} {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}};', ), ) ); $this->add_control( 'pa_daily_arrows_heading', array( 'label' => esc_html__( 'Daily Forecast Arrows', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'pa_daily_nav_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#171717', 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-arrow' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_daily_nav_bg', array( 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#F0F0F0', 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-arrow' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_daily_nav_border', 'selector' => '{{WRAPPER}} .premium-weather__forecast .carousel-arrow', ) ); $this->add_control( 'pa_daily_nav_border_radius', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-prev.carousel-arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .premium-weather__forecast .carousel-next.carousel-arrow' => 'border-radius: {{RIGHT}}{{UNIT}} {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'pa_nav_hover', array( 'label' => __( 'Hover', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_arrows_heading_hov', array( 'label' => esc_html__( 'Hourly Forecast Arrows', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'pa_nav_color_hov', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow:hover, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow:hover' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_nav_bg_hov', array( 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow:hover, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow:hover' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_nav_border_hov', 'selector' => '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow:hover, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow:hover', ) ); $this->add_control( 'pa_nav_border_radius_hov', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-prev.carousel-arrow:hover, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-prev.carousel-arrow:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-next.carousel-arrow:hover, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-next.carousel-arrow:hover' => 'border-radius: {{RIGHT}}{{UNIT}} {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}};', ), ) ); $this->add_control( 'pa_daily_arrows_heading_hov', array( 'label' => esc_html__( 'Daily Forecast Arrows', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'pa_daily_nav_color_hov', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-arrow:hover' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_daily_nav_bg_hov', array( 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-arrow:hover' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_daily_nav_border_hov', 'selector' => '{{WRAPPER}} .premium-weather__forecast .carousel-arrow:hover', ) ); $this->add_control( 'pa_daily_nav_border_radius_hov', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-prev.carousel-arrow:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .premium-weather__forecast .carousel-next.carousel-arrow:hover' => 'border-radius: {{RIGHT}}{{UNIT}} {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'pa_nav_padding', array( 'label' => __( 'Hourly Arrows Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .premium-weather__extra-outer-wrapper .carousel-arrow, {{WRAPPER}} .premium-weather__hourly-forecast-wrapper .carousel-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_daily_nav_padding', array( 'label' => __( 'Daily Arrows Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast .carousel-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } private function add_tabs_style() { $this->start_controls_section( 'pa_weather_tabs_style_section', array( 'label' => __( 'Forecast Tabs', 'premium-addons-for-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'enable_forecast' => 'yes', 'forecast_tabs' => 'yes', 'forecast_days!' => array( '1', '6', '7', '8' ), ), ) ); $this->add_control( 'pa_weather_tabs', array( 'label' => esc_html__( 'Tabs', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'pa_weather_tabs_typo', 'selector' => '{{WRAPPER}} .premium-weather__tab-header', ) ); $this->start_controls_tabs( 'pa_weather_tabs_style' ); $this->start_controls_tab( 'pa_weather_tabs_style_normal', array( 'label' => __( 'Normal', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_weather_tabs_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__tab-header', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_border', 'selector' => '{{WRAPPER}} .premium-weather__tab-header', ) ); $this->add_control( 'pa_weather_tabs_border_radius', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'pa_weather_tabs_style_hover', array( 'label' => __( 'Hover', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_weather_tabs_color_hov', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header:hover' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_bg_hov', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__tab-header:hover', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_border_hov', 'selector' => '{{WRAPPER}} .premium-weather__tab-header:hover', ) ); $this->add_control( 'pa_weather_tabs_border_radius_hov', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header:hover' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'pa_weather_tabs_style_active', array( 'label' => __( 'Active', 'premium-addons-for-elementor' ), ) ); $this->add_control( 'pa_weather_tabs_color_active', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header.current' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_bg_active', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__tab-header.current', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_border_active', 'selector' => '{{WRAPPER}} .premium-weather__tab-header.current', ) ); $this->add_control( 'pa_weather_tabs_border_radius_active', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%', 'em' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header.current' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'pa_weather_tabs_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_weather_tabs_icons', array( 'label' => esc_html__( 'Icons Row', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'pa_weather_tabs_icon_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__weather-indicator i' => 'color: {{VALUE}};', '{{WRAPPER}} .premium-weather__weather-indicator svg, {{WRAPPER}} .premium-weather__weather-indicator > svg *' => 'fill: {{VALUE}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_icon_size', array( 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => array( '{{WRAPPER}} .premium-weather__weather-indicator i' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .premium-weather__weather-indicator svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_icon_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__weather-indicators', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_icon_border', 'selector' => '{{WRAPPER}} .premium-weather__weather-indicators', ) ); $this->add_responsive_control( 'pa_weather_tabs_icon_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__weather-indicators' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_icon_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__weather-indicators' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'pa_weather_tabs_date', array( 'label' => esc_html__( 'Hours', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'tabs_date', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item-date', ) ); $this->add_control( 'tabs_date_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item-date' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_weather_tabs_details', array( 'label' => esc_html__( 'Weather Details', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'pa_weather_tabs_details_typo', 'selector' => '{{WRAPPER}} .premium-weather__tab-content .premium-weather__hourly-item > *:not(.premium-weather__hourly-item-date):not(.premium-weather__icon-wrapper)', ) ); $this->add_control( 'pa_weather_tabs_details_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-content .premium-weather__hourly-item > *:not(.premium-weather__hourly-item-date):not(.premium-weather__icon-wrapper)' => 'color: {{VALUE}};', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_details_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__hourly-item', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_details_border', 'selector' => '{{WRAPPER}} .premium-weather__hourly-item', ) ); $this->add_control( 'pa_weather_tabs_details_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_details_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_details_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__hourly-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'tabs_forecast_icon', array( 'label' => esc_html__( 'Weather Icon', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'tabs_forecast_icon_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper svg, {{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper svg *' => 'fill: {{VALUE}};', '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper' => 'color: {{VALUE}};', ), ) ); $papro_activated = apply_filters( 'papro_activated', false ); if ( $papro_activated ) { $this->add_control( 'tabs_forecast_icon_stroke', array( 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper svg *' => 'stroke: {{VALUE}} !important', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); $this->add_responsive_control( 'tabs_forecast_icon_stroke_width', array( 'label' => __( 'Stroke Width', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper svg *' => 'stroke-width: {{SIZE}}{{UNIT}} !important;', ), 'condition' => array( 'enable_custom_icon' => 'yes', 'icons_source' => 'default', 'lottie_type' => 'outlined', ), ) ); } $this->add_responsive_control( 'tabs_forecast_icon_size', array( 'label' => __( 'Size', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 1000, ), ), 'selectors' => array( '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper > svg, {{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper .premium-lottie-animation, {{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper img' => 'width:{{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};', '{{WRAPPER}} .premium-weather__tab-content .premium-weather__icon-wrapper i' => 'font-size:{{SIZE}}px', ), ) ); $this->add_control( 'pa_weather_tabs_notice', array( 'label' => esc_html__( 'Notice', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_control( 'notice_color', array( 'label' => __( 'Color', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-item-date' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'pa_weather_tabs_cont', array( 'label' => esc_html__( 'Container', 'premium-addons-for-elementor' ), 'separator' => 'before', 'type' => Controls_Manager::HEADING, ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'pa_weather_tabs_cont_shadow', 'selector' => '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper', ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'pa_weather_tabs_cont_bg', 'types' => array( 'classic', 'gradient' ), 'selector' => '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'pa_weather_tabs_cont_border', 'selector' => '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper', ) ); $this->add_control( 'pa_weather_tabs_cont_border_rad', array( 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_cont_padding', array( 'label' => __( 'Padding', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'pa_weather_tabs_cont_margin', array( 'label' => __( 'Margin', 'premium-addons-for-elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} .premium-weather__forecast-tabs-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); } /** * Render weather widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $papro_activated = apply_filters( 'papro_activated', false ); if ( ! $papro_activated ) { $settings['forecast_carousel_sw'] = false; $settings['forecast_days'] = false; $settings['forecast_tabs'] = false; if ( 'yes' === $settings['enable_custom_icon'] || 'yes' === $settings['enable_forecast'] || 'layout-3' === $settings['layout'] || 'coords' === $settings['custom_location_type'] ) { ?>