Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
- }
- class Themeum_Slider_Two {
- public function get_name() {
- return 'themeum-slider-two';
- }
- public function get_title() {
- return 'Slider Two';
- }
- public function get_icon() {
- return 'wppb-font-full-slider';
- }
- public function get_category_name(){
- return __( 'Backnow Widgets', 'themeum-core' );
- }
- # Script ...
- public function get_enqueue_script(){
- return array( 'backnow-main', 'slick-js' );
- }
- public function get_settings() {
- $settings = array(
- 'slider_list' => array(
- 'title' => 'Slider Items',
- 'type' => 'repeatable',
- 'attr' => array(
- 'slider_title' => array(
- 'type' => 'text',
- 'title' => 'Title',
- 'std' => ''
- ),
- 'title_animation' => array(
- 'type' => 'select',
- 'title' => 'Title Animation',
- 'values' => array(
- 'bounce' => 'bounce',
- 'bounceIn' => 'bounceIn',
- 'bounceInDown' => 'bounceInDown',
- 'bounceInLeft' => 'bounceInLeft',
- 'bounceInRight' => 'bounceInRight',
- 'bounceInUp' => 'bounceInUp',
- 'fadeIn' => 'fadeIn',
- 'fadeInDown' => 'fadeInDown',
- 'fadeInDownBig' => 'fadeInDownBig',
- 'fadeInLeft' => 'fadeInLeft',
- 'fadeInLeftBig' => 'fadeInLeftBig',
- 'fadeInRight' => 'fadeInRight',
- 'fadeInRightBig'=> 'fadeInRightBig',
- 'fadeInUp' => 'fadeInUp',
- 'fadeInUpBig' => 'fadeInUpBig',
- 'slideInUp' => 'slideInUp',
- 'slideInDown' => 'slideInDown',
- 'slideInLeft' => 'slideInLeft',
- 'slideInRight' => 'slideInRight',
- 'zoomInDown' => 'zoomInDown',
- 'zoomInLeft' => 'zoomInLeft',
- 'zoomInRight' => 'zoomInRight',
- 'zoomInUp' => 'zoomInUp'
- ),
- ),
- 'title_speed' => array(
- 'type' => 'select',
- 'title' => 'Title Speed',
- 'values' => array(
- '1.25s' => '1.25s',
- '.25s' => '.25s',
- '.50s' => '.50s',
- '.75s' => '.75s',
- '1s' => '1s',
- '1.25s' => '1.25s',
- '1.50s' => '1.50s',
- '1.75s' => '1.75s',
- '2s' => '2s'
- ),
- ),
- 'slider_subtitle' => array(
- 'type' => 'text',
- 'title' => 'Sub Title',
- 'std' => ''
- ),
- 'subtitle_animation' => array(
- 'type' => 'select',
- 'title' => 'Sub Title Animation',
- 'values' => array(
- 'bounce' => 'bounce',
- 'bounceIn' => 'bounceIn',
- 'bounceInDown' => 'bounceInDown',
- 'bounceInLeft' => 'bounceInLeft',
- 'bounceInRight' => 'bounceInRight',
- 'bounceInUp' => 'bounceInUp',
- 'fadeIn' => 'fadeIn',
- 'fadeInDown' => 'fadeInDown',
- 'fadeInDownBig' => 'fadeInDownBig',
- 'fadeInLeft' => 'fadeInLeft',
- 'fadeInLeftBig' => 'fadeInLeftBig',
- 'fadeInRight' => 'fadeInRight',
- 'fadeInRightBig'=> 'fadeInRightBig',
- 'fadeInUp' => 'fadeInUp',
- 'fadeInUpBig' => 'fadeInUpBig',
- 'slideInUp' => 'slideInUp',
- 'slideInDown' => 'slideInDown',
- 'slideInLeft' => 'slideInLeft',
- 'slideInRight' => 'slideInRight',
- 'zoomInDown' => 'zoomInDown',
- 'zoomInLeft' => 'zoomInLeft',
- 'zoomInRight' => 'zoomInRight',
- 'zoomInUp' => 'zoomInUp'
- ),
- ),
- 'subtitle_speed' => array(
- 'type' => 'select',
- 'title' => 'Sub Title Speed',
- 'values' => array(
- '1.25s' => '1.25s',
- '.25s' => '.25s',
- '.50s' => '.50s',
- '.75s' => '.75s',
- '1s' => '1s',
- '1.25s' => '1.25s',
- '1.50s' => '1.50s',
- '1.75s' => '1.75s',
- '2s' => '2s'
- ),
- ),
- 'slider_content' => array(
- 'type' => 'textarea',
- 'title' => 'Sub Slider Content',
- 'std' => ''
- ),
- 'content_animation' => array(
- 'type' => 'select',
- 'title' => 'Content Animation',
- 'values' => array(
- 'bounce' => 'bounce',
- 'bounceIn' => 'bounceIn',
- 'bounceInDown' => 'bounceInDown',
- 'bounceInLeft' => 'bounceInLeft',
- 'bounceInRight' => 'bounceInRight',
- 'bounceInUp' => 'bounceInUp',
- 'fadeIn' => 'fadeIn',
- 'fadeInDown' => 'fadeInDown',
- 'fadeInDownBig' => 'fadeInDownBig',
- 'fadeInLeft' => 'fadeInLeft',
- 'fadeInLeftBig' => 'fadeInLeftBig',
- 'fadeInRight' => 'fadeInRight',
- 'fadeInRightBig'=> 'fadeInRightBig',
- 'fadeInUp' => 'fadeInUp',
- 'fadeInUpBig' => 'fadeInUpBig',
- 'slideInUp' => 'slideInUp',
- 'slideInDown' => 'slideInDown',
- 'slideInLeft' => 'slideInLeft',
- 'slideInRight' => 'slideInRight',
- 'zoomInDown' => 'zoomInDown',
- 'zoomInLeft' => 'zoomInLeft',
- 'zoomInRight' => 'zoomInRight',
- 'zoomInUp' => 'zoomInUp'
- ),
- ),
- 'content_speed' => array(
- 'type' => 'select',
- 'title' => 'Content Speed',
- 'values' => array(
- '1.25s' => '1.25s',
- '.25s' => '.25s',
- '.50s' => '.50s',
- '.75s' => '.75s',
- '1s' => '1s',
- '1.25s' => '1.25s',
- '1.50s' => '1.50s',
- '1.75s' => '1.75s',
- '2s' => '2s'
- ),
- ),
- 'slider_button_1' => array(
- 'type' => 'text',
- 'title' => 'Button Text 1',
- 'std' => 'Button Text'
- ),
- 'slider_button_link_1' => array(
- 'type' => 'text',
- 'title' => 'Button Link 1',
- 'std' => '#'
- ),
- 'button1_animation' => array(
- 'type' => 'select',
- 'title' => 'Button 1 Animation',
- 'values' => array(
- 'bounce' => 'bounce',
- 'bounceIn' => 'bounceIn',
- 'bounceInDown' => 'bounceInDown',
- 'bounceInLeft' => 'bounceInLeft',
- 'bounceInRight' => 'bounceInRight',
- 'bounceInUp' => 'bounceInUp',
- 'fadeIn' => 'fadeIn',
- 'fadeInDown' => 'fadeInDown',
- 'fadeInDownBig' => 'fadeInDownBig',
- 'fadeInLeft' => 'fadeInLeft',
- 'fadeInLeftBig' => 'fadeInLeftBig',
- 'fadeInRight' => 'fadeInRight',
- 'fadeInRightBig'=> 'fadeInRightBig',
- 'fadeInUp' => 'fadeInUp',
- 'fadeInUpBig' => 'fadeInUpBig',
- 'slideInUp' => 'slideInUp',
- 'slideInDown' => 'slideInDown',
- 'slideInLeft' => 'slideInLeft',
- 'slideInRight' => 'slideInRight',
- 'zoomInDown' => 'zoomInDown',
- 'zoomInLeft' => 'zoomInLeft',
- 'zoomInRight' => 'zoomInRight',
- 'zoomInUp' => 'zoomInUp'
- ),
- ),
- 'button1_speed' => array(
- 'type' => 'select',
- 'title' => 'Button 1 Speed',
- 'values' => array(
- '1.25s' => '1.25s',
- '.25s' => '.25s',
- '.50s' => '.50s',
- '.75s' => '.75s',
- '1s' => '1s',
- '1.25s' => '1.25s',
- '1.50s' => '1.50s',
- '1.75s' => '1.75s',
- '2s' => '2s'
- ),
- ),
- 'slider_button_2' => array(
- 'type' => 'text',
- 'title' => 'Button Text 2',
- 'std' => 'Button Text'
- ),
- 'slider_button_link_2' => array(
- 'type' => 'text',
- 'title' => 'Button Link 2',
- 'std' => '#'
- ),
- 'button2_animation' => array(
- 'type' => 'select',
- 'title' => 'Button 1 Animation',
- 'values' => array(
- 'bounce' => 'bounce',
- 'bounceIn' => 'bounceIn',
- 'bounceInDown' => 'bounceInDown',
- 'bounceInLeft' => 'bounceInLeft',
- 'bounceInRight' => 'bounceInRight',
- 'bounceInUp' => 'bounceInUp',
- 'fadeIn' => 'fadeIn',
- 'fadeInDown' => 'fadeInDown',
- 'fadeInDownBig' => 'fadeInDownBig',
- 'fadeInLeft' => 'fadeInLeft',
- 'fadeInLeftBig' => 'fadeInLeftBig',
- 'fadeInRight' => 'fadeInRight',
- 'fadeInRightBig'=> 'fadeInRightBig',
- 'fadeInUp' => 'fadeInUp',
- 'fadeInUpBig' => 'fadeInUpBig',
- 'slideInUp' => 'slideInUp',
- 'slideInDown' => 'slideInDown',
- 'slideInLeft' => 'slideInLeft',
- 'slideInRight' => 'slideInRight',
- 'zoomInDown' => 'zoomInDown',
- 'zoomInLeft' => 'zoomInLeft',
- 'zoomInRight' => 'zoomInRight',
- 'zoomInUp' => 'zoomInUp'
- ),
- ),
- 'button2_speed' => array(
- 'type' => 'select',
- 'title' => 'Button 1 Speed',
- 'values' => array(
- '1.25s' => '1.25s',
- '.25s' => '.25s',
- '.50s' => '.50s',
- '.75s' => '.75s',
- '1s' => '1s',
- '1.25s' => '1.25s',
- '1.50s' => '1.50s',
- '1.75s' => '1.75s',
- '2s' => '2s'
- ),
- ),
- 'background_image' => array(
- 'type' => 'media',
- 'title' => __('Background Image','backnow'),
- 'std' => '',
- ),
- 'align' => array(
- 'type' => 'select',
- 'title' => __('Select Order', 'themeum-core'),
- 'values' => array(
- 'left' => __( 'Align Left', 'themeum-core' ),
- 'right' => __( 'Align Right', 'themeum-core' ),
- 'center' => __( 'Align Center', 'themeum-core' ),
- ),
- 'std' => 'center',
- ),
- 'gradient_color_a' => array(
- 'type' => 'color2',
- 'title' => __('Gradient Color A','wp-pagebuilder'),
- 'tab' => 'style',
- 'clip' => true,
- 'selector' => '{{SELECTOR}} .wppb-addon-title'
- ),
- 'gradient_color_b' => array(
- 'type' => 'color2',
- 'title' => __('Gradient Color B','wp-pagebuilder'),
- 'tab' => 'style',
- 'clip' => true,
- 'selector' => '{{SELECTOR}} .wppb-addon-title'
- ),
- # Style..................................................
- ),
- 'std' => array(
- array(
- 'icon_list' => 'fa fa-twitch',
- 'social_url' => '#',
- ),
- array(
- 'icon_list' => 'fa fa-twitter',
- 'social_url' => '#',
- ),
- ),
- ),
- );
- return $settings;
- }
- // Alert Render HTML
- public function render($data = null){
- $settings = $data['settings'];
- $slider_list = $settings['slider_list'] ;
- ?>
- <div class="slider_content_wrapper">
- <?php foreach ( $settings['slider_list'] as $item ) : ?>
- <?php
- $bg = 'style="';
- $align = '';
- if( $item['background_image']['url'] ){
- $bg .= ' background-image: url('.$item["background_image"]["url"].') ';
- }
- // if( $item['gradient_color_a'] && $item['gradient_color_b'] ){
- // if( $item['background_image']['url'] ){
- // $bg .= ', linear-gradient( '.$item["gradient_color_a"].' , '.$item["gradient_color_b"].' );';
- // }else{
- // $bg .= 'background-image: linear-gradient( '.$item["gradient_color_a"].' 0%, '.$item["gradient_color_b"].' 100%);';
- // }
- // }else{
- // if( $item['gradient_color_a'] ){
- // $bg .= 'background-color: '.$item["gradient_color_a"].';';
- // }else{
- // $bg .= ';';
- // }
- // }
- $bg .= '"';
- $align = isset($item['align']) ? $item['align'] : array();
- if( $align ){ $align = 'text-'.$align; } ?>
- <div class="slider-single-wrapper d-flex align-items-center" <?php echo $bg; ?>>
- <div class="container">
- <div class="row">
- <div class="col-12 center_text <?php echo $align; ?>">
- <?php if( $item['slider_subtitle'] ): ?><div class="slider-subtitle animated" data-animation="<?php echo $item['subtitle_animation']; ?>" data-speed="<?php echo $item['subtitle_speed']; ?>"><?php echo $item['slider_subtitle']; ?></div><?php endif; ?>
- <?php if( $item['slider_title'] ): ?><div class="slider-title animated" data-animation="<?php echo $item['title_animation']; ?>" data-speed="<?php echo $item['title_speed']; ?>"><?php echo $item['slider_title']; ?></div><?php endif; ?>
- <?php if( $item['slider_content'] ): ?><div class="slider-content animated" data-animation="<?php echo $item['content_animation']; ?>" data-speed="<?php echo $item['content_speed']; ?>"><?php echo $item['slider_content']; ?></div><?php endif; ?>
- <?php if( $item['slider_button_1'] || $item['slider_button_2'] ): ?>
- <div class="slider-button">
- <?php if( isset($item['slider_button_1']) ): ?><a class="d-inline-block slider-button-1 animated" data-animation="<?php echo $item['button1_animation']; ?>" data-speed="<?php echo $item['button1_speed']; ?>" href="<?php echo $item['slider_button_link_1']; ?>"><?php echo $item['slider_button_1']; ?></a><?php endif; ?>
- <?php if( isset($item['slider_button_2']) ): ?>
- <a class="d-inline-block slider-button-2 animated" data-animation="<?php echo $item['button2_animation']; ?>" data-speed="<?php echo $item['button2_speed']; ?>" href="<?php echo $item['slider_button_link_2']; ?>">
- <?php echo $item['slider_button_2']; ?>
- </a>
- <?php endif; ?>
- </div>
- <?php endif; ?>
- </div>
- </div>
- </div>
- </div>
- <?php endforeach; ?>
- </div>
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement