Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace FilixCore\Widgets;
- use Elementor\Widget_Base;
- use Elementor\Controls_Manager;
- use Elementor\Scheme_Color;
- use Elementor\Scheme_Typography;
- use Elementor\Group_Control_Typography;
- // Exit if accessed directly
- if ( ! defined( 'ABSPATH' ) ) {
- exit;
- }
- /**
- * Text Typing Effect
- *
- * Elementor widget for text typing effect.
- *
- * @since 1.7.0
- */
- class Filix_hero extends Widget_Base {
- public function get_name() {
- return 'filix_hero_portfolio';
- }
- public function get_title() {
- return esc_html__( 'Hero', 'filix-core' );
- }
- public function get_icon() {
- return 'eicon-device-desktop';
- }
- public function get_keywords() {
- return [ 'headline', 'hero' ];
- }
- public function get_categories() {
- return [ 'filix-elements' ];
- }
- public function get_style_depends() {
- return ['animated-headline'];
- }
- public function get_script_depends() {
- return ['animated-headline'];
- }
- protected function _register_controls() {
- // ---------------------------------------- Title Section ------------------------------------//
- $this->start_controls_section(
- 'title_sec',
- [
- 'label' => esc_html__( 'Title', 'filix-core' ),
- ]
- );
- $this->add_control(
- 'title_text',
- [
- 'label' => esc_html__( 'Title Text', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'label_block' => true,
- 'default' => 'Filix Studio',
- ]
- );
- $this->end_controls_section();
- /// --------------------------------------- Words Section ----------------------------------///
- $this->start_controls_section(
- 'content_list',
- [
- 'label' => esc_html__( 'Attribute Words', 'filix-core' ),
- ]
- );
- $repeater = new \Elementor\Repeater();
- $repeater->add_control(
- 'title', [
- 'label' => esc_html__( 'Title', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'label_block' => true,
- 'default' => 'Website'
- ]
- );
- // repeater field
- $this->add_control(
- 'words', [
- 'label' => esc_html__( 'Attributes', 'filix-core' ),
- 'type' => Controls_Manager::REPEATER,
- 'title_field' => '{{{ title }}}',
- 'fields' => $repeater->get_controls(),
- ]
- );
- $this->end_controls_section();
- /// ------------------------------------ Social Links ----------------------------------///
- $this->start_controls_section(
- 'social_portfolio_links',
- [
- 'label' => esc_html__( 'Socail Profile Links', 'filix-core' ),
- ]
- );
- $this->add_control(
- 'f_link',
- [
- 'label' => esc_html__( 'Facebook Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 't_link',
- [
- 'label' => esc_html__( 'Twitter Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'in_link',
- [
- 'label' => esc_html__( 'Instagram Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'linkedin_link',
- [
- 'label' => esc_html__( 'LinkedIn Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'be_link',
- [
- 'label' => esc_html__( 'Behance Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'git_link',
- [
- 'label' => esc_html__( 'GitHub Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'd_link',
- [
- 'label' => esc_html__( 'Dribble Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'pin_link',
- [
- 'label' => esc_html__( 'Pinterest Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'qq_link',
- [
- 'label' => esc_html__( 'QQ Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->add_control(
- 'y_link',
- [
- 'label' => esc_html__( 'YouTube Link', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( 'https://', 'filix-core' ),
- 'show_external' => true,
- ]
- );
- $this->end_controls_section();
- /// --------------------------------------- Arrow Link ----------------------------------///
- $this->start_controls_section(
- 'scroll_arrow_link',
- [
- 'label' => esc_html__( 'Scroll Link', 'filix-core' ),
- ]
- );
- $this->add_control(
- 'scroll_title_text',
- [
- 'label' => esc_html__( 'Title Text', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'label_block' => true,
- 'default' => 'Scroll Down',
- ]
- );
- $this->add_control(
- 'scroll_link',
- [
- 'label' => __( 'Link To', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'placeholder' => __( '#section ID', 'filix-core' ),
- 'show_label' => true,
- ]
- );
- $this->end_controls_section();
- /**
- * Style Tab
- * ------------------------------ Style Title ------------------------------
- */
- $this->start_controls_section(
- 'style_title', [
- 'label' => esc_html__( 'Style Title', 'filix-core' ),
- 'tab' => Controls_Manager::TAB_STYLE,
- ]
- );
- $this->add_control(
- 'color_title', [
- 'label' => esc_html__( 'Text Color', 'filix-core' ),
- 'type' => Controls_Manager::COLOR,
- 'selectors' => [
- '{{WRAPPER}} .hero_warp .banner_content .banner_title' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_group_control(
- Group_Control_Typography::get_type(), [
- 'name' => 'typography_title',
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
- 'selector' => '{{WRAPPER}} .hero_warp .banner_content .banner_title',
- ]
- );
- $this->end_controls_section();
- //------------------------------ Gradient Color ------------------------------
- $this->start_controls_section(
- 'style_background',
- [
- 'label' => esc_html__( 'Background', 'filix-core' ),
- 'tab' => Controls_Manager::TAB_STYLE
- ]
- );
- // Gradient Color
- $this->add_control(
- 'bg_color', [
- 'label' => esc_html__( 'Background Color', 'filix-core' ),
- 'type' => Controls_Manager::COLOR,
- 'scheme' => [
- 'type' => Scheme_Color::get_type(),
- 'value' => Scheme_Color::COLOR_1,
- ],
- 'selectors' => [
- '{{WRAPPER}} .hero_warp' => 'background-color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'bg_image', [
- 'label' => esc_html__( 'Background Image', 'filix-core' ),
- 'type' => Controls_Manager::MEDIA,
- 'default' => [
- 'url' => \Elementor\Utils::get_placeholder_image_src(),
- ],
- 'selectors' => [
- '{{WRAPPER}} .hero_warp' => 'background-image: url( {{url}} );',
- ],
- ]
- );
- $this->end_controls_section();
- }
- protected function render() {
- $settings = $this->get_settings();
- ?>
- <section class="hero_warp">
- <div class="container">
- <div class="row d-flex align-items-center height_vh">
- <div class="col-md-12 col-12">
- <div class="banner_content">
- <?php if (!empty($settings['title_text'])) : ?>
- <h1 class="banner_title"> <?php echo wp_kses_post(nl2br($settings['title_text'])) ?> </h1>
- <?php endif; ?>
- <ul class="exp_list">
- <?php
- if(!empty($settings['words'])) {
- foreach ($settings['words'] as $i => $word) {
- $i = $i + 1;
- ?>
- <li class=" wow fadeInUp" data-wow-duration='<?php echo $i; ?>s'> <?php echo esc_html( $word['title'] ) ?> </li>
- <?php
- }
- }
- ?>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <ul class="social_link">
- <?php if(!empty($settings['f_link'])) { ?>
- <li>
- <a href="<?php echo esc_url($settings['f_link']); ?> target='_blank' ">
- <i class="fa fa-facebook" aria-hidden="true"></i>
- <i class="fa fa-facebook" aria-hidden="true"></i>
- </a>
- </li>
- <?php } ?>
- </ul>
- <div class="scroll_down">
- <a href="<?php echo esc_html( $settings['scroll_link'] ) ?>"><?php echo esc_html( $settings['scroll_title_text'] ) ?></a>
- </div>
- </section>
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement