68 lines
1.7 KiB
PHP
68 lines
1.7 KiB
PHP
<?php
|
|
use Elementor\Controls_Manager;
|
|
use Elementor\Utils;
|
|
use Elementor\Icons_Manager;
|
|
// use Elementor\Group_Control_Text_Shadow;
|
|
// use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
|
|
// use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
|
// use Elementor\Group_Control_Text_Stroke;
|
|
// use Elementor\Group_Control_Typography;
|
|
class Elementor_Scroll_Up extends \Elementor\Widget_Base {
|
|
|
|
public function get_name() {
|
|
return 'scroll_up';
|
|
}
|
|
|
|
public function get_title() {
|
|
return esc_html__( 'Scroll up', 'elementor-addon' );
|
|
}
|
|
|
|
public function get_icon() {
|
|
return 'eicon-code';
|
|
}
|
|
|
|
public function get_categories() {
|
|
return [ 'basic' ];
|
|
}
|
|
|
|
public function get_keywords() {
|
|
return [ 'scroll', 'up',];
|
|
}
|
|
|
|
protected function register_controls() {
|
|
$this->start_controls_section(
|
|
'section_icon',
|
|
[
|
|
'label' => esc_html__( 'Icon Box', 'elementor' ),
|
|
]
|
|
);
|
|
|
|
$this->add_control(
|
|
'selected_icon',
|
|
[
|
|
'label' => esc_html__( 'Icon', 'elementor' ),
|
|
'type' => Controls_Manager::ICONS,
|
|
'fa4compatibility' => 'icon',
|
|
'default' => [
|
|
'value' => 'fas fa-star',
|
|
'library' => 'fa-solid',
|
|
],
|
|
]
|
|
);
|
|
$this->end_controls_section();
|
|
}
|
|
|
|
protected function render() {
|
|
$settings = $this->get_settings_for_display();
|
|
$has_icon = ! empty( $settings['selected_icon']['value'] );
|
|
?>
|
|
<div id="scroll-up-box">
|
|
<div class="scroll-up-box--wrapper">
|
|
<?php if ( $has_icon ) : ?>
|
|
<?php Icons_Manager::render_icon( $settings['selected_icon'], [ 'aria-hidden' => 'true' ] ); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
}
|