Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/bopea-function/block//mobile-menu.php
<?php
namespace bopeaElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Typography;
use Elementor\Schemes\Color;
use Elementor\Schemes\Typography;
use Elementor\Utils;
use Elementor\Control_Media;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Icons_Manager;
defined('ABSPATH') || die();
class bopea_section_mobile_menu extends Widget_Base {
public function get_name() {
return 'bopea-mobile-menu';
}
public function get_title() {
return esc_html__( 'Jelly Mobile Menu', 'bopea-function' );
}
public function get_icon() {
return 'eicon-menu-bar jl-icons';
}
public function get_categories() {
return [ 'bopea-elements-head' ];
}
protected function register_controls() {
$this->start_controls_section(
'text_elements',
[
'label' => __( 'Menu Icon', 'bopea-function' ),
]
);
$this->add_control(
'jl_btn_icons',
[
'label' =>esc_html__( 'Icon', 'bopea-function' ),
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'jl_btn_icon',
'label_block' => true,
'default' => [
'value' => '',
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style_marker',
[
'label' => __( 'Mobile Menu Style', 'bopea-function' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'icon_menu_height',
[
'label' => __( 'Height', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 500,
],
],
'default' => [
'size' => '90',
'unit' => 'px'
],
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons' => 'height: {{SIZE}}px',
]
]
);
$this->add_responsive_control(
'icons_margin',
[
'label' => __( 'Margin', 'bopea-function' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%'],
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
]
]
);
$this->add_responsive_control(
'icons_padding',
[
'label' => __( 'Padding', 'bopea-function' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%'],
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
]
]
);
$this->add_responsive_control(
'icon_line_space',
[
'label' => __( 'Hamburger menu height', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 200,
],
],
'selectors' => [
'{{WRAPPER}} .jlm_w' => 'min-height: {{SIZE}}px !important',
],
'condition' => [
'jl_btn_icons[value]' => ''
]
]
);
$this->add_responsive_control(
'icon_line_height',
[
'label' => __( 'Hamburger line height', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 200,
'step' => 0.5,
],
],
'selectors' => [
'{{WRAPPER}} .jlm_w span' => 'height: {{SIZE}}px !important',
],
'condition' => [
'jl_btn_icons[value]' => ''
]
]
);
$this->add_responsive_control(
'icon_size',
[
'label' => __( 'Icons Font Size', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 200,
],
],
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons i' => 'font-size: {{SIZE}}px !important',
'{{WRAPPER}} .menu_mobile_icons svg' => 'width: {{SIZE}}px !important; height:auto !important;',
'{{WRAPPER}} .jlm_w' => 'width: {{SIZE}}px !important',
]
]
);
$this->add_control(
'jl_btn_mobile_color',
[
'label' =>esc_html__( 'Color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'default' => '#000',
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons i' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .menu_mobile_icons svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}} !important;',
'{{WRAPPER}} .menu_mobile_icons .jlm_w span' => 'background: {{VALUE}} !important;',
],
]
);
$this->add_control(
'jl_btn_mobile_color_dark',
[
'label' =>esc_html__( 'Color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFF',
'selectors' => [
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons i' => 'color: {{VALUE}} !important;',
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}} !important;',
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons .jlm_w span' => 'background: {{VALUE}} !important;',
],
]
);
$this->add_control(
'jl_mobile_color_hover',
[
'label' =>esc_html__( 'Color Hover', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'default' => '#000',
'selectors' => [
'{{WRAPPER}} .menu_mobile_icons i:hover' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .menu_mobile_icons svg:hover path' => 'stroke: {{VALUE}}; fill: {{VALUE}} !important;',
'{{WRAPPER}} .menu_mobile_icons:hover .jlm_w span' => 'background: {{VALUE}} !important;',
],
]
);
$this->add_control(
'jl_mobile_color_hover_dark',
[
'label' =>esc_html__( 'Color hover dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFF',
'selectors' => [
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons i:hover' => 'color: {{VALUE}} !important;',
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons svg:hover path' => 'stroke: {{VALUE}}; fill: {{VALUE}} !important;',
'.options_dark_skin {{WRAPPER}} .menu_mobile_icons:hover .jlm_w span' => 'background: {{VALUE}} !important;',
],
]
);
$this->end_controls_section();
}
protected function render( ) {
$settings = $this->get_settings_for_display();
?>
<div class="menu_mobile_icons_wrap">
<div class="menu_mobile_icons">
<?php
if (empty($settings['jl_btn_icons']['value'])) {?>
<div class="jlm_w"><span class="jlma"></span><span class="jlmb"></span><span class="jlmc"></span></div>
<?php }else{
$migrated = isset( $settings['__fa4_migrated']['jl_btn_icons'] );
$is_new = empty( $settings['jl_btn_icon'] );
if ( $is_new || $migrated ) {
Icons_Manager::render_icon( $settings['jl_btn_icons'], [ 'aria-hidden' => 'true' ] );
}else{
?>
<i class="<?php echo esc_attr($settings['jl_btn_icon']); ?>" aria-hidden="true"></i>
<?php
}
}?>
</div>
</div>
<?php
}
}