File: /home/todorterziev/public_html/wp-content/plugins/prysm-core/elementor/widgets/law/law-fanfact.php
<?php
class law_fanfact extends \Elementor\Widget_Base {
public function get_name() {
return 'law_fanfact';
}
public function get_title() {
return __( 'Law Fanfact', 'prysm' );
}
public function get_icon() {
return 'eicon-counter';
}
public function get_categories() {
return ['prysm-category'];
}
protected function register_controls() {
$this->start_controls_section(
'fanfact_contetn',
[
'label' => __( 'Fanfact Content', 'prysm' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'number', [
'label' => esc_html__( 'Number', 'prysm' ),
'type' => \Elementor\Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'symbole', [
'label' => esc_html__( 'Symbole', 'prysm' ),
'type' => \Elementor\Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'prysm' ),
'type' => \Elementor\Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'fanfacts',
[
'label' => __( 'Add Item', 'prysm' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
]
);
$this->end_controls_section();
$this->start_controls_section(
'fnf_style',
[
'label' => esc_html__( 'Fanfact Style', 'prysm' ),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'fnf_number_style',
[
'type' => \Elementor\Controls_Manager::HEADING,
'label' => esc_html__( 'Number Style', 'prysm' ),
'separator' => 'before',
]
);
$this->add_control(
'number_color',
[
'label' => esc_html__( 'Number Color', 'prysm' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fact-counter-seven .column .inner .count-outer' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'number__typography',
'label' => esc_html__( 'Typography', 'prysm' ),
'selector' => '{{WRAPPER}} .fact-counter-seven .column .inner .count-outer',
'fields_options' => [
'font_family' => [
'default' => 'Inter',
],
'font_weight' => [
'default' => '700',
],
'font_size' => [
'default' => [
'size' => '48',
],
],
],
]
);
$this->add_control(
'title_style',
[
'type' => \Elementor\Controls_Manager::HEADING,
'label' => esc_html__( 'Title Style', 'prysm' ),
'separator' => 'before',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'prysm' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .fact-counter-seven .column .inner .counter-title' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'desc__typography',
'label' => esc_html__( 'Typography', 'prysm' ),
'selector' => '{{WRAPPER}} .fact-counter-seven .column .inner .counter-title',
'fields_options' => [
'font_family' => [
'default' => 'Lato',
],
'font_weight' => [
'default' => '700',
],
'font_size' => [
'default' => [
'size' => '18',
],
],
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$fanfacts = $settings['fanfacts'];
?>
<!-- Counter Section Five -->
<section class="counter-section-five">
<div class="auto-container">
<div class="content-box">
<!-- Fact Counter Seven -->
<div class="fact-counter-seven">
<div class="row clearfix">
<?php foreach($fanfacts as $item):?>
<!-- Column -->
<div class="column counter-column col-xl-4 col-lg-4 col-md-4 col-sm-12">
<div class="inner wow fadeInLeft" data-wow-delay="0ms" data-wow-duration="1500ms">
<div class="count-outer count-box">
<span class="count-text counter" data-speed="3500"><?php echo esc_html($item['number']);?></span><?php echo esc_html($item['symbole']);?>
</div>
<div class="counter-title"><?php echo esc_html($item['title']);?></div>
</div>
</div>
<?php endforeach;?>
</div>
</div>
</div>
</div>
</section>
<!-- End Counter Section Five -->
<?php
}
}