start_controls_section( 'section_title', [ 'label' => __( 'Title Element', 'addonnest' ) ] ); $this->add_control( 'countdown_style', [ 'label' => __( 'CountDown Style', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'style1', 'options' => [ 'style1' => __( 'Style 1', 'addonnest' ), 'style2' => __( 'Style 2', 'addonnest' ), ], ] ); # Countdown intro $this->add_control( 'countdown_intro', [ 'label' => __( 'CountDown Intro', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'Enter intro text', 'addonnest' ), 'default' => __( 'Ends In', 'addonnest' ), ] ); # Date time $this->add_control( 'date_time', [ 'label' => __( 'Choose Date Time', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DATE_TIME, 'label_block' => true, 'placeholder' => __( 'Enter Date Time', 'addonnest' ), 'default' => gmdate( 'Y-m-d H:i:s' ), ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'addonnest' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html__( 'Left', 'addonnest' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'addonnest' ), 'icon' => 'eicon-text-align-center', ], 'flex-end' => [ 'title' => esc_html__( 'Right', 'addonnest' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .deal_countdown.style1' => 'justify-content: {{VALUE}};', '{{WRAPPER}} .countdown-wrap .style2 .deal_counter' => 'justify-content: {{VALUE}};', '{{WRAPPER}} .countdown-wrap .deal_countdown.style2 h2' => 'justify-content: {{VALUE}};', ], ] ); $this->end_controls_section(); # Option End $this->start_controls_section( 'section_countdown_title_style', [ 'label' => __( 'Countdown Title', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); /** * Intro Text */ $this->add_control( 'timeline_intro_section', [ 'label' => esc_html__( 'Intro Text Style', 'addonnest' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); # Title text color $this->add_control( 'intro_text_color', [ 'label' => __( 'Intro Text Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item .title' => 'color: {{VALUE}};', '{{WRAPPER}} .deal_countdown.style2 h2' => 'color: {{VALUE}};', ], ] ); # Title text typography $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Intro Text Typography', 'addonnest' ), 'name' => 'intro_typography', 'selector' => '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item .title', 'condition' => ['countdown_style' => 'style1'], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Intro Text Typography', 'addonnest' ), 'name' => 'intro_style2_typography', 'selector' => '{{WRAPPER}} .deal_countdown.style2 h2', 'condition' => ['countdown_style' => 'style2'], ] ); $this->add_responsive_control( 'intro_text_space', [ 'label' => esc_html__( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item .title' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .countdown-wrap .deal_countdown.style2 h2' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => __( 'CountDown Section', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); # Title text color $this->add_control( 'title_text_color', [ 'label' => __( 'Title Text Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item' => 'color: {{VALUE}};', '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item span.seperator' => 'color: {{VALUE}};', ], ] ); # Title text color $this->add_control( 'countdown_bg_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter.bgc-thm' => 'background-color: {{VALUE}};', ], 'condition' => ['countdown_style' => 'style1'], ] ); $this->add_control( 'countdown_bg2_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .countdown-wrap .style2 .deal_counter.bgc-thm .list-inline-item' => 'background-color: {{VALUE}};', ], 'condition' => ['countdown_style' => 'style2'], ] ); # Title text typography $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'CountDown Typography', 'addonnest' ), 'name' => 'countdown_typography', 'selector' => '{{WRAPPER}} .countdown-wrap .deal_counter .list-inline-item', 'condition' => ['countdown_style' => 'style1'], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Digit Typography', 'addonnest' ), 'name' => 'digit_typography', 'selector' => '{{WRAPPER}} .countdown-wrap .style2 .deal_counter .list-inline-item', 'condition' => ['countdown_style' => 'style2'], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'countdown_bg_border', 'selector' => '{{WRAPPER}} .countdown-wrap .deal_counter', 'separator' => 'before', 'condition' => ['countdown_style' => 'style1'], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'countdown_bg2_border', 'selector' => '{{WRAPPER}} .countdown-wrap .style2 .deal_counter .list-inline-item', 'separator' => 'before', 'condition' => ['countdown_style' => 'style2'], ] ); $this->add_responsive_control( 'countdown_border', [ 'label' => esc_html__( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .countdown-wrap .style2 .deal_counter .list-inline-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'countdown_space', [ 'label' => esc_html__( 'Digit and Text Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .style2 .deal_counter.bgc-thm .list-inline-item span' => 'margin-top: {{SIZE}}{{UNIT}};', ], 'condition' => ['countdown_style' => 'style2'], ] ); # Countdown text typo $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Countdown Text Typography', 'addonnest' ), 'name' => 'text_typography', 'selector' => '{{WRAPPER}} .countdown-wrap .style2 .deal_counter.bgc-thm .list-inline-item span', 'condition' => ['countdown_style' => 'style2'], ] ); # Padding $this->add_responsive_control( 'countdown_padding', [ 'label' => __( 'Padding', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .deal_counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', 'condition' => ['countdown_style' => 'style1'], ] ); $this->add_responsive_control( 'countdown_style2_padding', [ 'label' => __( 'Padding', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .style2 .deal_counter.bgc-thm .list-inline-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', 'condition' => ['countdown_style' => 'style2'], ] ); $this->add_responsive_control( 'countdown_space_gap', [ 'label' => esc_html__( 'Between Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'default' => [ 'size' => 20, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .countdown-wrap .style2 .deal_counter' => 'gap: {{SIZE}}{{UNIT}};', ], 'condition' => ['countdown_style' => 'style2'], ] ); $this->end_controls_section(); # Title Section end 1 } protected function render( ) { $settings = $this->get_settings(); $countdown_style = $settings['countdown_style']; $countdown_intro = $settings['countdown_intro']; $date_time = strtotime($settings['date_time']); $date = gmdate("d M Y G:i", strtotime($settings['date_time'])); ?>