Premium Addons for Elementor - Version 3.1.3

Version Description

  • New: Added Image Scroll widget.
  • Tweak: Added CSS Filters options group for posts` featured image in Blog widget.
  • Tweak: Added Text Shadow option for title in Counter widget.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 3.1.3
Comparing to
See all releases

Code changes from version 3.1.2 to 3.1.3

admin/assets/pa-elements-font/css/pafont.css CHANGED
@@ -11,7 +11,7 @@
11
  .toplevel_page_premium-addons > div.wp-menu-image::before {
12
  position: relative;
13
  top: 5px;
14
- content: "\e915";
15
  /* use !important to prevent issues with browser extensions that change fonts */
16
  font-family: 'pa-elements' !important;
17
  speak: none;
11
  .toplevel_page_premium-addons > div.wp-menu-image::before {
12
  position: relative;
13
  top: 5px;
14
+ content: "\e901";
15
  /* use !important to prevent issues with browser extensions that change fonts */
16
  font-family: 'pa-elements' !important;
17
  speak: none;
admin/includes/notices.php CHANGED
@@ -27,8 +27,9 @@ class Premium_Admin_Notices {
27
  * init required functions
28
  */
29
  public function init(){
30
- $this->handle_review_notice();
31
- $this->handle_pbg_notice();
 
32
  }
33
 
34
  /**
@@ -36,8 +37,9 @@ class Premium_Admin_Notices {
36
  */
37
  public function check_admin_notices() {
38
  $this->required_plugins_check();
39
- $this->get_review_notice();
40
- $this->get_pbg_notice();
 
41
  }
42
 
43
  /**
@@ -81,6 +83,27 @@ class Premium_Admin_Notices {
81
  exit;
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * Shows an admin notice when Elementor is missing.
86
  * @since 1.0.0
@@ -213,6 +236,35 @@ class Premium_Admin_Notices {
213
 
214
  }
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  /**
217
  * Returns the active theme slug
218
  */
27
  * init required functions
28
  */
29
  public function init(){
30
+ //$this->handle_review_notice();
31
+ //$this->handle_pbg_notice();
32
+ $this->handle_image_scroll_notice();
33
  }
34
 
35
  /**
37
  */
38
  public function check_admin_notices() {
39
  $this->required_plugins_check();
40
+ //$this->get_review_notice();
41
+ //$this->get_pbg_notice();
42
+ $this->get_image_scroll_notice();
43
  }
44
 
45
  /**
83
  exit;
84
  }
85
 
86
+ /**
87
+ * Checks if image scroll message is dismissed.
88
+ * @access public
89
+ * @return void
90
+ */
91
+ public function handle_image_scroll_notice() {
92
+ if ( ! isset( $_GET['image_scroll'] ) ) {
93
+ return;
94
+ }
95
+
96
+ if ( 'opt_out' === $_GET['image_scroll'] ) {
97
+ check_admin_referer( 'opt_out' );
98
+
99
+ update_option( 'image_scroll_notice', '1' );
100
+ }
101
+
102
+ wp_redirect( remove_query_arg( 'image_scroll' ) );
103
+ exit;
104
+ }
105
+
106
+
107
  /**
108
  * Shows an admin notice when Elementor is missing.
109
  * @since 1.0.0
236
 
237
  }
238
 
239
+ /**
240
+ * Shows an admin notice for Image Scroll.
241
+ * @since 3.1.3
242
+ * @return void
243
+ */
244
+ public function get_image_scroll_notice() {
245
+
246
+ $scroll_notice = get_option( 'image_scroll_notice' );
247
+
248
+ $theme = self::get_installed_theme();
249
+
250
+ $notice_url = sprintf( 'https://premiumaddons.com/elementor-image-scroll-widget?utm_source=imagescroll-notification&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme );
251
+
252
+ if ( '1' === $scroll_notice ) {
253
+ return;
254
+ } else if ( '1' !== $scroll_notice ) {
255
+ $optout_url = wp_nonce_url( add_query_arg( 'image_scroll', 'opt_out' ), 'opt_out' );
256
+
257
+ $scroll_message = sprintf( __('<p style="display: flex; align-items: center; padding:10px 10px 10px 0;"><img src="%s" style="margin-right: 0.8em; width: 40px;"><span>NEW!&nbsp</span><strong><span>Image Scroll Widget for Elementor&nbsp</strong>is Now Available in Premium Addons PRO.&nbsp</span><a href="%s" target="_blank" style="flex-grow: 2;"> Check it out now.</a>', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_URL .'admin/images/premium-addons-logo.png', $notice_url );
258
+
259
+ $scroll_message .= sprintf(__('<a href="%s" style="text-decoration: none; margin-left: 1em; float:right; "><span class="dashicons dashicons-dismiss"></span></a></p>', 'premium-addons-for-elementor'), $optout_url );
260
+
261
+ $this->render_admin_notices( $scroll_message );
262
+
263
+ }
264
+
265
+ }
266
+
267
+
268
  /**
269
  * Returns the active theme slug
270
  */
admin/settings/version-control.php CHANGED
@@ -79,7 +79,7 @@ class PA_Version_Control {
79
  <tr class="pa-roll-row">
80
  <th>Rollback Version</th>
81
  <td>
82
- <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.1.1</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
  </td>
85
  </tr>
79
  <tr class="pa-roll-row">
80
  <th>Rollback Version</th>
81
  <td>
82
+ <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.1.2</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
  </td>
85
  </tr>
assets/js/premium-addons.js CHANGED
@@ -504,15 +504,17 @@
504
  if ( direction == "vertical" ) {
505
  scrollVertical.addClass("premium-image-scroll-ver");
506
  } else {
507
- scrollOverlay.css( { "width": imageScroll.width(), "height": imageScroll.height() } );
 
 
508
  }
509
  } else {
510
  if ( reverse === 'yes' ) {
511
- setTimeout( function() {
512
  scrollElement.addClass("premium-container-scroll-instant");
513
  setTransform();
514
  startTransform();
515
- }, 100 );
516
  }
517
  if ( direction == "vertical" ) {
518
  scrollVertical.removeClass("premium-image-scroll-ver");
504
  if ( direction == "vertical" ) {
505
  scrollVertical.addClass("premium-image-scroll-ver");
506
  } else {
507
+ scrollElement.imagesLoaded(function() {
508
+ scrollOverlay.css( { "width": imageScroll.width(), "height": imageScroll.height() } );
509
+ });
510
  }
511
  } else {
512
  if ( reverse === 'yes' ) {
513
+ scrollElement.imagesLoaded(function() {
514
  scrollElement.addClass("premium-container-scroll-instant");
515
  setTransform();
516
  startTransform();
517
+ });
518
  }
519
  if ( direction == "vertical" ) {
520
  scrollVertical.removeClass("premium-image-scroll-ver");
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 3.1.2
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
@@ -11,24 +11,15 @@ Domain Path: /languages
11
  License: GNU General Public License v3.0
12
  */
13
 
14
-
15
- /**
16
- * Checking if WordPress is installed
17
- */
18
- if (! function_exists('add_action')) {
19
- die('WordPress not Installed'); // if WordPress not installed kill the page.
20
- }
21
-
22
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
 
24
-
25
  // Define Constants
26
- define('PREMIUM_ADDONS_VERSION', '3.1.2');
27
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
28
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
29
  define('PREMIUM_ADDONS_FILE', __FILE__);
30
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
31
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.1.1');
32
 
33
  if( ! class_exists('Premium_Addons_Elementor') ) {
34
  /*
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 3.1.3
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
11
  License: GNU General Public License v3.0
12
  */
13
 
 
 
 
 
 
 
 
 
14
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
 
 
16
  // Define Constants
17
+ define('PREMIUM_ADDONS_VERSION', '3.1.3');
18
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
  define('PREMIUM_ADDONS_FILE', __FILE__);
21
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
22
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.1.2');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
  /*
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: leap13
3
  Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder
4
  Donate link: http://premiumaddons.com
5
  Requires at least: 4.5
6
- Tested up to: 5.0.3
7
  Requires PHP: 5.4
8
- Stable tag: 3.1.2
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -23,7 +23,7 @@ Premium Addons for Elementor can be used only as a complement of Elementor page
23
 
24
  ### Features
25
 
26
- * 21+ Fully Customizable Elementor add-on widgets.
27
  * Options panel for enabling desired widgets only for faster performance.
28
  * Free Support through online forums and our Facebook group.
29
  * Fully Responsive and Cross Browser Compatible, Tested By [Browserstack](https://www.browserstack.com)
@@ -33,27 +33,28 @@ Premium Addons for Elementor can be used only as a complement of Elementor page
33
 
34
  ### Available Elements
35
 
36
- 1. [Vertical Scroll Elementor Widget](https://premiumaddons.com/vertical-scroll-widget-for-elementor-page-builder/) Allows you to create beautiful vertical scroll pages using Elementor.
37
- 2. [Grid Elementor Widget](https://premiumaddons.com/grid-widget-for-elementor-page-builder/) Highly customizable grid widget that can be used for creating attractive looking image galleries and portfolios.
38
- 3. [Carousel Elementor Widget](https://premiumaddons.com/carousel-widget-for-elementor-page-builder/) The best all purpose carousel widget for Elementor, It can be used to create testimonials carousel, client logos carousel, or any kind of content.
39
- 4. [Banner Elementor Widget](https://premiumaddons.com/banner-widget-for-elementor-page-builder/) Animated and interactive banner widget with multiple styles.
40
- 5. [Google Maps Elementor Widget](https://premiumaddons.com/google-maps-widget-for-elementor-page-builder/) Advanced Google Maps widget with multiple markers, custom styling and much more options.
41
- 6. [Pricing Table Elementor Widget](https://premiumaddons.com/pricing-table-widget-for-elementor-page-builder/) The most customizable Elementor Pricing Table Widget with tons of customization options.
42
- 7. [Image Separator Elementor Widget](https://premiumaddons.com/image-separator-widget-elementor-page-builder/) This element adds image separator between sections.
43
- 8. [Fancy Text Elementor Widget](https://premiumaddons.com/fancy-text-widget-for-elementor-page-builder/) Animated fancy text with many animation styles.
44
- 9. [Heading Elementor Widget](https://premiumaddons.com/heading-widget-for-elementor-page-builder/) This widget has many customizable ready made styles for headings.
45
- 10. [Dual Header Elementor Widget](https://premiumaddons.com/dual-header-widget-for-elementor-page-builder/) Create a header with 2 styles with numerous customization options.
46
- 11. [Testimonials Elementor Widget](https://premiumaddons.com/testimonials-widget-for-elementor-page-builder/) Modern testimonials widget with many customization options.
47
- 12. [Persons Elementor Widget](https://premiumaddons.com/persons-widget-for-elementor-page-builder/) Very good element for listing team members.
48
- 13. [Countdown Elementor Widget](https://premiumaddons.com/countdown-widget-for-elementor-page-builder/) Advanced countdown addon for elementor.
49
- 14. [Blog Elementor Widget](https://premiumaddons.com/blog-widget-for-elementor-page-builder/) Blog posts widget with modern style.
50
- 15. [Counter Elementor Widget](https://premiumaddons.com/counter-widget-for-elementor-page-builder/) Advanced counter elements with lots of options.
51
- 16. [Video Box Elementor Widget](https://premiumaddons.com/video-box-widget-for-elementor-page-builder/) Video box element with many customization features.
52
- 17. [Modal Box Elementor Widget](https://premiumaddons.com/modal-box-widget-for-elementor-page-builder/) All purpose Elementor modal box with many options.
53
- 18. [Progress Bar Elementor Widget](https://premiumaddons.com/progress-bar-widget-for-elementor-page-builder/) The most advanced progress bar available for Elementor.
54
- 19. [Button Elementor Widget](https://premiumaddons.com/button-widget-for-elementor-page-builder/) Advanced button with lots of interactive animation and styling options and onClick event option.
55
- 20. [Contact Form 7 Elementor Widget](https://premiumaddons.com/contact-form-7-widget-for-elementor-page-builder/) Elementor contact form 7 add-on with 2 readymade styles.
56
- 21. [Image Button Elementor Widget](https://premiumaddons.com/image-button-widget-for-elementor-page-builder/) A unique element that can be used for innovative call to action ideas.
 
57
 
58
  ### PRO addons & widgets [Click here](https://premiumaddons.com/pro/)
59
 
@@ -138,6 +139,12 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
141
  = 3.1.2 =
142
 
143
  - Tweak: Video Box layout changed to enhance page loading speed.
3
  Tags: Elementor, Elementor Page Builder, Elements, Elementor Addons, Add-ons, page builder
4
  Donate link: http://premiumaddons.com
5
  Requires at least: 4.5
6
+ Tested up to: 5.1
7
  Requires PHP: 5.4
8
+ Stable tag: 3.1.3
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
23
 
24
  ### Features
25
 
26
+ * 22+ Fully Customizable Elementor add-on widgets.
27
  * Options panel for enabling desired widgets only for faster performance.
28
  * Free Support through online forums and our Facebook group.
29
  * Fully Responsive and Cross Browser Compatible, Tested By [Browserstack](https://www.browserstack.com)
33
 
34
  ### Available Elements
35
 
36
+ 1. [Image Scroll Elementor Widget](https://premiumaddons.com/elementor-image-scroll-widget/) Allows you to represent your images in a brand new yet attractive way
37
+ 2. [Vertical Scroll Elementor Widget](https://premiumaddons.com/vertical-scroll-widget-for-elementor-page-builder/) Allows you to create beautiful vertical scroll pages using Elementor.
38
+ 3. [Grid Elementor Widget](https://premiumaddons.com/grid-widget-for-elementor-page-builder/) Highly customizable grid widget that can be used for creating attractive looking image galleries and portfolios.
39
+ 4. [Carousel Elementor Widget](https://premiumaddons.com/carousel-widget-for-elementor-page-builder/) The best all purpose carousel widget for Elementor, It can be used to create testimonials carousel, client logos carousel, or any kind of content.
40
+ 5. [Banner Elementor Widget](https://premiumaddons.com/banner-widget-for-elementor-page-builder/) Animated and interactive banner widget with multiple styles.
41
+ 6. [Google Maps Elementor Widget](https://premiumaddons.com/google-maps-widget-for-elementor-page-builder/) Advanced Google Maps widget with multiple markers, custom styling and much more options.
42
+ 7. [Pricing Table Elementor Widget](https://premiumaddons.com/pricing-table-widget-for-elementor-page-builder/) The most customizable Elementor Pricing Table Widget with tons of customization options.
43
+ 8. [Image Separator Elementor Widget](https://premiumaddons.com/image-separator-widget-elementor-page-builder/) This element adds image separator between sections.
44
+ 9. [Fancy Text Elementor Widget](https://premiumaddons.com/fancy-text-widget-for-elementor-page-builder/) Animated fancy text with many animation styles.
45
+ 10. [Heading Elementor Widget](https://premiumaddons.com/heading-widget-for-elementor-page-builder/) This widget has many customizable ready made styles for headings.
46
+ 11. [Dual Header Elementor Widget](https://premiumaddons.com/dual-header-widget-for-elementor-page-builder/) Create a header with 2 styles with numerous customization options.
47
+ 12. [Testimonials Elementor Widget](https://premiumaddons.com/testimonials-widget-for-elementor-page-builder/) Modern testimonials widget with many customization options.
48
+ 13. [Persons Elementor Widget](https://premiumaddons.com/persons-widget-for-elementor-page-builder/) Very good element for listing team members.
49
+ 14. [Countdown Elementor Widget](https://premiumaddons.com/countdown-widget-for-elementor-page-builder/) Advanced countdown addon for elementor.
50
+ 15. [Blog Elementor Widget](https://premiumaddons.com/blog-widget-for-elementor-page-builder/) Blog posts widget with modern style.
51
+ 16. [Counter Elementor Widget](https://premiumaddons.com/counter-widget-for-elementor-page-builder/) Advanced counter elements with lots of options.
52
+ 17. [Video Box Elementor Widget](https://premiumaddons.com/video-box-widget-for-elementor-page-builder/) Video box element with many customization features.
53
+ 18. [Modal Box Elementor Widget](https://premiumaddons.com/modal-box-widget-for-elementor-page-builder/) All purpose Elementor modal box with many options.
54
+ 19. [Progress Bar Elementor Widget](https://premiumaddons.com/progress-bar-widget-for-elementor-page-builder/) The most advanced progress bar available for Elementor.
55
+ 20. [Button Elementor Widget](https://premiumaddons.com/button-widget-for-elementor-page-builder/) Advanced button with lots of interactive animation and styling options and onClick event option.
56
+ 21. [Contact Form 7 Elementor Widget](https://premiumaddons.com/contact-form-7-widget-for-elementor-page-builder/) Elementor contact form 7 add-on with 2 readymade styles.
57
+ 22. [Image Button Elementor Widget](https://premiumaddons.com/image-button-widget-for-elementor-page-builder/) A unique element that can be used for innovative call to action ideas.
58
 
59
  ### PRO addons & widgets [Click here](https://premiumaddons.com/pro/)
60
 
139
 
140
  == Changelog ==
141
 
142
+ = 3.1.3 =
143
+
144
+ - New: Added Image Scroll widget.
145
+ - Tweak: Added `CSS Filters` options group for posts` featured image in Blog widget.
146
+ - Tweak: Added `Text Shadow` option for title in Counter widget.
147
+
148
  = 3.1.2 =
149
 
150
  - Tweak: Video Box layout changed to enhance page loading speed.
widgets/premium-blog.php CHANGED
@@ -623,6 +623,14 @@ class Premium_Blog extends Widget_Base {
623
  ]
624
  );
625
 
 
 
 
 
 
 
 
 
626
  $this->end_controls_section();
627
 
628
  $this->start_controls_section('premium_blog_title_style_section',
623
  ]
624
  );
625
 
626
+ $this->add_group_control(
627
+ Group_Control_Css_Filter::get_type(),
628
+ [
629
+ 'name' => 'css_filters',
630
+ 'selector' => '{{WRAPPER}} .premium-blog-thumbnail-container img',
631
+ ]
632
+ );
633
+
634
  $this->end_controls_section();
635
 
636
  $this->start_controls_section('premium_blog_title_style_section',
widgets/premium-counter.php CHANGED
@@ -394,10 +394,17 @@ class Premium_Counter extends Widget_Base {
394
  'name' => 'premium_counter_title_typho',
395
  'scheme' => Scheme_Typography::TYPOGRAPHY_1,
396
  'selector' => '{{WRAPPER}} .premium-counter-area .premium-counter-title',
397
- 'separator' => 'after'
398
  ]
399
  );
400
 
 
 
 
 
 
 
 
 
401
  $this->end_controls_section();
402
 
403
  $this->start_controls_section('premium_counter_value_style',
394
  'name' => 'premium_counter_title_typho',
395
  'scheme' => Scheme_Typography::TYPOGRAPHY_1,
396
  'selector' => '{{WRAPPER}} .premium-counter-area .premium-counter-title',
 
397
  ]
398
  );
399
 
400
+ $this->add_group_control(
401
+ Group_Control_Text_Shadow::get_type(),
402
+ [
403
+ 'name' => 'premium_counter_title_shadow',
404
+ 'selector' => '{{WRAPPER}} .premium-counter-area .premium-counter-title',
405
+ ]
406
+ );
407
+
408
  $this->end_controls_section();
409
 
410
  $this->start_controls_section('premium_counter_value_style',
widgets/premium-image-scroll.php ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class: Premium_Image_Scroll
5
+ * Name: Image Scroll
6
+ * Slug: premium-image-scroll
7
+ */
8
+
9
+ namespace Elementor;
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) exit;
12
+
13
+ class Premium_Image_Scroll extends Widget_Base {
14
+
15
+ public function getTemplateInstance() {
16
+ return $this->templateInstance = premium_Template_Tags::getInstance();
17
+ }
18
+
19
+ public function get_name() {
20
+ return 'premium-image-scroll';
21
+ }
22
+
23
+ public function get_title() {
24
+ return \PremiumAddons\Helper_Functions::get_prefix() . ' Image Scroll';
25
+ }
26
+
27
+ public function is_reload_preview_required() {
28
+ return true;
29
+ }
30
+
31
+ public function get_icon() {
32
+ return 'pa-image-scroll';
33
+ }
34
+
35
+ public function get_categories() {
36
+ return [ 'premium-elements' ];
37
+ }
38
+
39
+ public function get_script_depends() {
40
+ return [
41
+ 'imagesloaded',
42
+ 'premium-addons-js'
43
+ ];
44
+ }
45
+
46
+ protected function _register_controls() {
47
+
48
+ $this->start_controls_section('general_settings',
49
+ [
50
+ 'label' => __('Image Settings', 'premium-addons-for-elementor')
51
+ ]
52
+ );
53
+
54
+ $this->add_control('image',
55
+ [
56
+ 'label' => __('Image', 'premium-addons-for-elementor'),
57
+ 'type' => Controls_Manager::MEDIA,
58
+ 'dynamic' => [ 'active' => true ],
59
+ 'default' => [
60
+ 'url' => Utils::get_placeholder_image_src(),
61
+ ],
62
+ 'description' => __('Choose the scroll image', 'premium-addons-for-elementor' ),
63
+ 'label_block' => true
64
+ ]
65
+ );
66
+
67
+ $this->add_responsive_control('image_height',
68
+ [
69
+ 'label' => __('Image Height', 'premium-addons-for-elementor'),
70
+ 'type' => Controls_Manager::SLIDER,
71
+ 'size_units' => ['px', 'em', 'vh'],
72
+ 'default' => [
73
+ 'unit' => 'px',
74
+ 'size' => 300,
75
+ ],
76
+ 'range' => [
77
+ 'px' => [
78
+ 'min' => 200,
79
+ 'max' => 800,
80
+ ],
81
+ 'em' => [
82
+ 'min' => 1,
83
+ 'max' => 50,
84
+ ],
85
+ ],
86
+ 'selectors' => [
87
+ '{{WRAPPER}} .premium-image-scroll-container' => 'height: {{SIZE}}{{UNIT}};',
88
+ ]
89
+ ]
90
+ );
91
+
92
+ $this->add_control('link_switcher',
93
+ [
94
+ 'label' => __('Link', 'premium-addons-for-elementor'),
95
+ 'type' => Controls_Manager::SWITCHER,
96
+ 'description' => __('Add a custom link or select an existing page link','premium-addons-for-elementor'),
97
+ ]
98
+ );
99
+
100
+ $this->add_control('link_type',
101
+ [
102
+ 'label' => __('Link/URL', 'premium-addons-for-elementor'),
103
+ 'type' => Controls_Manager::SELECT,
104
+ 'options' => [
105
+ 'url' => __('URL', 'premium-addons-for-elementor'),
106
+ 'link' => __('Existing Page', 'premium-addons-for-elementor'),
107
+ ],
108
+ 'default' => 'url',
109
+ 'condition' => [
110
+ 'link_switcher' => 'yes',
111
+ ],
112
+ 'label_block' => true,
113
+ ]
114
+ );
115
+
116
+ $this->add_control('link',
117
+ [
118
+ 'label' => __('URL', 'premium-addons-for-elementor'),
119
+ 'type' => Controls_Manager::URL,
120
+ 'placeholder' => 'https://premiumaddons.com/',
121
+ 'label_block' => true,
122
+ 'condition' => [
123
+ 'link_switcher' => 'yes',
124
+ 'link_type' => 'url'
125
+ ]
126
+ ]
127
+ );
128
+
129
+ $this->add_control('existing_page',
130
+ [
131
+ 'label' => __('Existing Page', 'premium-addons-for-elementor'),
132
+ 'type' => Controls_Manager::SELECT2,
133
+ 'options' => $this->getTemplateInstance()->get_all_post(),
134
+ 'condition' => [
135
+ 'link_switcher' => 'yes',
136
+ 'link_type' => 'link',
137
+ ],
138
+ 'label_block' => true,
139
+ ]
140
+ );
141
+
142
+ $this->add_control('link_text',
143
+ [
144
+ 'label' => __('Link Title', 'premium-addons-for-elementor'),
145
+ 'type' => Controls_Manager::TEXT,
146
+ 'condition' => [
147
+ 'link_switcher' => 'yes',
148
+ ],
149
+ 'label_block' => true
150
+ ]
151
+ );
152
+
153
+ $this->end_controls_section();
154
+
155
+ $this->start_controls_section('advanced_settings',
156
+ [
157
+ 'label' => __( 'Advanced Settings' , 'premium-addons-for-elementor' )
158
+ ]
159
+ );
160
+
161
+ $this->add_control('direction_type',
162
+ [
163
+ 'label' => __( 'Direction', 'premium-addons-for-elementor' ),
164
+ 'description' => __( 'Select Scroll Direction', 'premium-addons-for-elementor' ),
165
+ 'type' => Controls_Manager::SELECT,
166
+ 'options' => [
167
+ 'horizontal' => __( 'Horizontal', 'premium-addons-for-elementor' ),
168
+ 'vertical' => __( 'Vertical', 'premium-addons-for-elementor' )
169
+ ],
170
+ 'default' => 'vertical'
171
+ ]
172
+ );
173
+
174
+ $this->add_control('reverse',
175
+ [
176
+ 'label' => __( 'Reverse Direction', 'premium-addons-for-elementor' ),
177
+ 'type' => Controls_Manager::SWITCHER,
178
+ 'condition' => [
179
+ 'trigger_type' => 'hover',
180
+ ]
181
+ ]
182
+ );
183
+
184
+ $this->add_control('trigger_type',
185
+ [
186
+ 'label' => __('Trigger', 'premium-addons-for-elementor'),
187
+ 'type' => Controls_Manager::SELECT,
188
+ 'options' => [
189
+ 'hover' => __('Hover', 'premium-addons-for-elementor'),
190
+ 'scroll' => __('Mouse Scroll', 'premium-addons-for-elementor'),
191
+ ],
192
+ 'default' => 'hover',
193
+ ]
194
+ );
195
+
196
+ $this->add_control('duration_speed',
197
+ [
198
+ 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
199
+ 'description' => __( 'Set the scroll speed value. The value will be counted in seconds (s)', 'premium-addons-for-elementor' ),
200
+ 'type' => Controls_Manager::NUMBER,
201
+ 'default' => 3,
202
+ 'condition' => [
203
+ 'trigger_type' => 'hover',
204
+ ],
205
+ 'selectors' => [
206
+ '{{WRAPPER}} .premium-image-scroll-container .premium-image-scroll-image' => 'transition: all {{Value}}s; -webkit-transition: all {{Value}}s;',
207
+ ]
208
+ ]
209
+ );
210
+
211
+ $this->add_control('icon_switcher',
212
+ [
213
+ 'label' => __('Icon', 'premium-addons-for-elementor'),
214
+ 'type' => Controls_Manager::SWITCHER,
215
+ ]
216
+ );
217
+
218
+ $this->add_control('icon_size',
219
+ [
220
+ 'label' => __('Icon Size', 'premium-addons-for-elementor'),
221
+ 'type' => Controls_Manager::SLIDER,
222
+ 'size_units' => ['px','em'],
223
+ 'default' => [
224
+ 'size' => 30,
225
+ ],
226
+ 'range' => [
227
+ 'px' => [
228
+ 'min' => 5,
229
+ 'max' => 100
230
+ ],
231
+ ],
232
+ 'selectors' => [
233
+ '{{WRAPPER}} .premium-image-scroll-icon' => 'font-size: {{SIZE}}{{UNIT}};',
234
+ ],
235
+ 'condition' => [
236
+ 'icon_switcher' => 'yes'
237
+ ]
238
+ ]
239
+ );
240
+
241
+ $this->add_control('overlay',
242
+ [
243
+ 'label' => __('Overlay','premium-addons-for-elementor'),
244
+ 'type' => Controls_Manager::SWITCHER,
245
+ 'label_on' => __('Show','premium-addons-for-elementor'),
246
+ 'label_off' => __('Hide','premium-addons-for-elementor'),
247
+
248
+ ]
249
+ );
250
+
251
+ $this->end_controls_section();
252
+
253
+ $this->start_controls_section('image_style',
254
+ [
255
+ 'label' => __('Image', 'premium-addons-for-elementor'),
256
+ 'tab' => Controls_Manager::TAB_STYLE,
257
+ ]
258
+ );
259
+
260
+ $this->add_control('icon_color',
261
+ [
262
+ 'label' => __('Icon Color', 'premium-addons-for-elementor'),
263
+ 'type' => Controls_Manager::COLOR,
264
+ 'selectors' => [
265
+ '{{WRAPPER}} .premium-image-scroll-icon' => 'color: {{VALUE}};'
266
+ ],
267
+ 'condition' => [
268
+ 'icon_switcher' => 'yes'
269
+ ]
270
+ ]
271
+ );
272
+
273
+ $this->add_control('overlay_background',
274
+ [
275
+ 'label' => __('Overlay Color', 'premium-addons-for-elementor'),
276
+ 'type' => Controls_Manager::COLOR,
277
+ 'selectors' => [
278
+ '{{WRAPPER}} .premium-image-scroll-overlay' => 'background: {{VALUE}};'
279
+ ],
280
+ 'condition' => [
281
+ 'overlay' => 'yes'
282
+ ]
283
+ ]
284
+ );
285
+
286
+ $this->start_controls_tabs('image_style_tabs');
287
+
288
+ $this->start_controls_tab('image_style_tab_normal',
289
+ [
290
+ 'label' => __('Normal', 'premium-addons-for-elementor'),
291
+ ]
292
+ );
293
+
294
+ $this->add_group_control(
295
+ Group_Control_Css_Filter::get_type(),
296
+ [
297
+ 'name' => 'css_filters',
298
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-container .premium-image-scroll-image',
299
+ ]
300
+ );
301
+
302
+ $this->end_controls_tab();
303
+
304
+ $this->start_controls_tab('image_style_tab_hover',
305
+ [
306
+ 'label' => __('Hover', 'premium-addons-for-elementor'),
307
+ ]
308
+ );
309
+
310
+ $this->add_group_control(
311
+ Group_Control_Css_Filter::get_type(),
312
+ [
313
+ 'name' => 'css_filters_hover',
314
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-container .premium-image-scroll-image:hover',
315
+ ]
316
+ );
317
+
318
+ $this->end_controls_tab();
319
+
320
+ $this->end_controls_tabs();
321
+
322
+ $this->end_controls_section();
323
+
324
+ $this->start_controls_section('container_style',
325
+ [
326
+ 'label' => __('Container','premium-addons-for-elementor'),
327
+ 'tab' => Controls_Manager::TAB_STYLE,
328
+ ]
329
+ );
330
+
331
+ $this->start_controls_tabs('container_style_tabs');
332
+
333
+ $this->start_controls_tab('container_style_normal',
334
+ [
335
+ 'label' => __('Normal', 'premium-addons-for-elementor'),
336
+ ]
337
+ );
338
+
339
+ $this->add_group_control(
340
+ Group_Control_Border::get_type(),
341
+ [
342
+ 'name' => 'container_border',
343
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-section',
344
+ ]
345
+ );
346
+
347
+ $this->add_control('container_border_radius',
348
+ [
349
+ 'label' => __('Border Radius', 'premium-addons-for-elementor'),
350
+ 'type' => Controls_Manager::SLIDER,
351
+ 'size_units' => ['px', '%', 'em'],
352
+ 'selectors' => [
353
+ '{{WRAPPER}} .premium-image-scroll-section, {{WRAPPER}} .premium-container-scroll' => 'border-radius: {{SIZE}}{{UNIT}}'
354
+ ]
355
+ ]
356
+ );
357
+
358
+ $this->add_group_control(
359
+ Group_Control_Box_Shadow::get_type(),
360
+ [
361
+ 'name' => 'container_box_shadow',
362
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-section',
363
+ ]
364
+ );
365
+
366
+ $this->end_controls_tab();
367
+
368
+ $this->start_controls_tab('container_style_hover',
369
+ [
370
+ 'label' => __('Hover', 'premium-addons-for-elementor'),
371
+ ]
372
+ );
373
+
374
+ $this->add_group_control(
375
+ Group_Control_Border::get_type(),
376
+ [
377
+ 'name' => 'container_border_hover',
378
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-section:hover',
379
+ ]
380
+ );
381
+
382
+ $this->add_control('container_border_radius_hover',
383
+ [
384
+ 'label' => __('Border Radius', 'premium-addons-for-elementor'),
385
+ 'type' => Controls_Manager::SLIDER,
386
+ 'size_units' => ['px', '%', 'em'],
387
+ 'selectors' => [
388
+ '{{WRAPPER}} .premium-image-scroll-section:hover, {{WRAPPER}} .premium-container-scroll:hover' => 'border-radius: {{SIZE}}{{UNIT}}'
389
+ ]
390
+ ]
391
+ );
392
+
393
+ $this->add_group_control(
394
+ Group_Control_Box_Shadow::get_type(),
395
+ [
396
+ 'name' => 'container_box_shadow_hover',
397
+ 'selector' => '{{WRAPPER}} .premium-image-scroll-section:hover',
398
+ ]
399
+ );
400
+
401
+ $this->end_controls_tab();
402
+
403
+ $this->end_controls_tabs();
404
+
405
+ $this->end_controls_section();
406
+
407
+ }
408
+
409
+ protected function render() {
410
+
411
+ $settings = $this->get_settings_for_display();
412
+
413
+ $alt = esc_attr( Control_Media::get_image_alt( $settings['image'] ) );
414
+
415
+ $link_type = $settings['link_type'];
416
+
417
+ $link_url = ( 'url' == $link_type ) ? $settings['link']['url'] : get_permalink( $settings['existing_page'] );
418
+
419
+ if ( $settings['link_switcher'] == 'yes' ) {
420
+ $this->add_render_attribute( 'link', 'class', 'premium-image-scroll-link' );
421
+
422
+ if( ! empty( $settings['link']['is_external'] ) ) {
423
+ $this->add_render_attribute( 'link', 'target', "_blank" );
424
+ }
425
+
426
+ if( ! empty( $settings['link']['nofollow'] ) ) {
427
+ $this->add_render_attribute( 'link', 'rel', "nofollow" );
428
+ }
429
+
430
+ if( ! empty( $settings['link_text'] ) ) {
431
+ $this->add_render_attribute( 'link', 'title', $settings['link_text'] );
432
+ }
433
+
434
+ if( ! empty( $settings['link']['url'] ) || ! empty( $settings['existing_page'] ) ) {
435
+ $this->add_render_attribute( 'link', 'href', $link_url );
436
+ }
437
+ }
438
+
439
+ if ( $settings['icon_switcher'] ) {
440
+ $icon_type = sprintf('pa-%s-mouse-scroll', $settings['direction_type'] );
441
+ }
442
+
443
+
444
+ $image_scroll = [
445
+ 'trigger' => $settings['trigger_type'] ,
446
+ 'direction' => $settings['direction_type'],
447
+ 'reverse' => $settings['reverse']
448
+ ];
449
+
450
+ $this->add_render_attribute( 'container', 'class', 'premium-image-scroll-container' );
451
+
452
+ $this->add_render_attribute( 'container', 'data-settings', wp_json_encode( $image_scroll ) );
453
+
454
+ $this->add_render_attribute( 'direction_type', 'class', 'premium-image-scroll-'.$settings['direction_type'] );
455
+
456
+ $this->add_render_attribute( 'image', 'class', 'premium-image-scroll-image' );
457
+
458
+ $this->add_render_attribute( 'image', 'src', $settings['image']['url'] );
459
+
460
+ $this->add_render_attribute( 'image', 'alt', $alt );
461
+
462
+ ?>
463
+ <div class="premium-image-scroll-section">
464
+ <div <?php echo $this->get_render_attribute_string('container'); ?>>
465
+ <?php if( 'yes' == $settings['icon_switcher'] ) : ?>
466
+ <div class="premium-image-scroll-content">
467
+ <i class="premium-image-scroll-icon <?php echo $icon_type ?>"></i>
468
+ </div>
469
+ <?php endif; ?>
470
+ <div <?php echo $this->get_render_attribute_string('direction_type'); ?>>
471
+ <?php if($settings['overlay'] == 'yes') : ?>
472
+ <div class="premium-image-scroll-overlay">
473
+ <?php endif;
474
+ if ( $settings['link_switcher'] == 'yes' && ! empty( $link_url ) ) : ?>
475
+ <a <?php echo $this->get_render_attribute_string('link'); ?>></a>
476
+ <?php endif;
477
+ if( $settings['overlay'] == 'yes' ) : ?>
478
+ </div>
479
+ <?php endif; ?>
480
+ <img <?php echo $this->get_render_attribute_string('image'); ?>>
481
+ </div>
482
+ </div>
483
+ </div>
484
+ <?php
485
+
486
+ }
487
+
488
+ protected function _content_template() {
489
+ ?>
490
+ <#
491
+
492
+ var linkType = settings.link_type,
493
+ trigger = settings.trigger_type,
494
+ direction = settings.direction_type,
495
+ reverse = settings.reverse,
496
+ url;
497
+
498
+ var scrollSettings = {};
499
+
500
+ scrollSettings.trigger = trigger;
501
+ scrollSettings.direction = direction,
502
+ scrollSettings.reverse = reverse;
503
+
504
+ if ( 'yes' == settings.icon_switcher ) {
505
+
506
+ var iconClass = 'pa-' + direction + '-mouse-scroll';
507
+
508
+ }
509
+
510
+
511
+ if ( 'yes' == settings.link_switcher ) {
512
+ view.addRenderAttribute( 'link', 'class', 'premium-image-scroll-link' );
513
+ url = 'url' == linkType ? settings.link.url : settings.existing_page;
514
+ view.addRenderAttribute( 'link', 'href', url );
515
+
516
+ if ( 'yes' == settings.link_switcher ) {
517
+ view.addRenderAttribute( 'link', 'title', settings.link_text );
518
+ }
519
+ }
520
+
521
+ view.addRenderAttribute( 'container', 'class', 'premium-image-scroll-container' );
522
+
523
+ view.addRenderAttribute( 'container', 'data-settings', JSON.stringify(scrollSettings) );
524
+
525
+ view.addRenderAttribute( 'direction_type', 'class', 'premium-image-scroll-' + direction );
526
+
527
+ view.addRenderAttribute( 'image', 'class', 'premium-image-scroll-image' );
528
+
529
+ view.addRenderAttribute( 'image', 'src', settings.image.url );
530
+
531
+ #>
532
+
533
+ <div class="premium-image-scroll-section">
534
+ <div {{{ view.getRenderAttributeString('container') }}}>
535
+ <# if ( 'yes' == settings.icon_switcher ) { #>
536
+ <div class="premium-image-scroll-content">
537
+ <i class="premium-image-scroll-icon {{ iconClass }}"></i>
538
+ </div>
539
+ <# } #>
540
+ <div {{{ view.getRenderAttributeString('direction_type') }}}>
541
+ <# if( 'yes' == settings.overlay ) { #>
542
+ <div class="premium-image-scroll-overlay">
543
+ <# }
544
+ if ( 'yes' == settings.link_switcher && '' != url ) { #>
545
+ <a {{{ view.getRenderAttributeString('link') }}}></a>
546
+ <# }
547
+ if( 'yes' == settings.overlay ) { #>
548
+ </div>
549
+ <# } #>
550
+ <img {{{ view.getRenderAttributeString('image') }}}>
551
+ </div>
552
+ </div>
553
+ </div>
554
+
555
+ <?php
556
+ }
557
+
558
+ }