Royal Elementor Addons (Header Footer Builder, Mega Menu Builder, Popups, Post Grid, Woocommerce Product Grid, Slider, Parallax Image, Free Elementor Widgets & Elementor Templates. Elementor WooCommerce Builder) - Version 1.3.43

Version Description

Download this release

Release Info

Developer wproyal
Plugin Icon wp plugin Royal Elementor Addons (Header Footer Builder, Mega Menu Builder, Popups, Post Grid, Woocommerce Product Grid, Slider, Parallax Image, Free Elementor Widgets & Elementor Templates. Elementor WooCommerce Builder)
Version 1.3.43
Comparing to
See all releases

Code changes from version 1.3.42 to 1.3.43

Files changed (35) hide show
  1. admin/includes/wpr-templates-library.php +133 -133
  2. admin/templates-kit.php +567 -567
  3. admin/templates/views/royal/theme-header-royal.php +39 -39
  4. admin/templates/views/theme-header.php +34 -34
  5. admin/templates/wpr-templates-library-popups.php +108 -108
  6. admin/theme-builder.php +133 -133
  7. assets/css/admin/premade-blocks.css +436 -436
  8. assets/css/editor.css +760 -760
  9. assets/css/lib/animations/button-animations.css +1629 -1629
  10. assets/css/lib/animations/loading-animations.css +1063 -1063
  11. assets/css/lib/animations/wpr-animations.css +1132 -1132
  12. assets/css/lib/lightgallery/lightgallery.css +982 -982
  13. assets/js/admin/wp-color-picker-alpha.min.js +11 -11
  14. assets/js/lib/flipster/jquery.flipster.min.js +2 -2
  15. assets/js/lib/jarallax/jarallax.min.js +5 -5
  16. assets/js/lib/perfect-scrollbar/perfect-scrollbar.js +1324 -1324
  17. base/module-base.php +94 -94
  18. classes/rating-notice.php +188 -0
  19. classes/utilities.php +796 -796
  20. extensions/wpr-custom-css.php +82 -82
  21. extensions/wpr-parallax.php +437 -438
  22. extensions/wpr-reading-progress-bar.php +200 -200
  23. freemius/assets/css/admin/affiliation.css +11 -11
  24. freemius/assets/css/admin/checkout.css +1 -1
  25. freemius/assets/css/index.php +2 -2
  26. freemius/includes/class-fs-plugin-updater.php +1561 -1561
  27. freemius/includes/customizer/class-fs-customizer-upsell-control.php +160 -160
  28. freemius/includes/entities/class-fs-affiliate-terms.php +127 -127
  29. freemius/includes/entities/class-fs-payment.php +167 -167
  30. freemius/includes/entities/class-fs-user.php +61 -61
  31. freemius/includes/fs-essential-functions.php +499 -499
  32. freemius/includes/managers/class-fs-key-value-storage.php +391 -391
  33. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +13 -13
  34. freemius/includes/sdk/FreemiusWordPress.php +715 -715
  35. freemius/templates/account.php +527 -1097
admin/includes/wpr-templates-library.php CHANGED
@@ -1,134 +1,134 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly.
5
- }
6
-
7
- use WprAddons\Admin\Includes\WPR_Render_Templates;
8
- use WprAddons\Admin\Includes\WPR_Templates_Shortcode;
9
- use WprAddons\Admin\Includes\WPR_Templates_Modal_Popups;
10
- use WprAddons\Admin\Includes\WPR_Templates_Actions;
11
- use WprAddons\Admin\Templates\WPR_Templates_Library_Blocks;
12
- use WprAddons\Admin\Templates\WPR_Templates_Library_Popups;
13
- use WprAddons\Admin\Templates\WPR_Templates_Library_Pages;
14
- use WprAddons\Classes\Utilities;
15
-
16
- /**
17
- * WPR_Templates_Library setup
18
- *
19
- * @since 1.0
20
- */
21
- class WPR_Templates_Library {
22
-
23
- /**
24
- ** Constructor
25
- */
26
- public function __construct() {
27
-
28
- // Register CPTs
29
- add_action( 'init', [ $this, 'register_templates_library_cpt' ] );
30
- add_action( 'template_redirect', [ $this, 'block_template_frontend' ] );
31
- add_action( 'current_screen', [ $this, 'redirect_to_options_page' ] );
32
-
33
- // Templates Shortcode
34
- new WPR_Templates_Shortcode();
35
-
36
- // Init Popups
37
- new WPR_Templates_Modal_Popups();
38
-
39
- // Init Theme Builder
40
- new WPR_Render_Templates();
41
-
42
- // Template Actions
43
- new WPR_Templates_Actions();
44
-
45
- // Add Blocks to Library
46
- new WPR_Templates_Library_Blocks();
47
-
48
- // Add Popups to Library
49
- new WPR_Templates_Library_Popups();
50
-
51
- // Add Pages to Library
52
- // new WPR_Templates_Library_Pages();
53
-
54
- // Enable Elementor for 'wpr_templates'
55
- $this->add_elementor_cpt_support();
56
-
57
- }
58
-
59
- /**
60
- ** Register Templates Library
61
- */
62
- public function redirect_to_options_page() {
63
- if ( get_current_screen()->post_type == 'wpr_templates' && isset($_GET['action']) && $_GET['action'] == 'edit' ) {
64
- $elementor_template_type = isset($_GET['post']) ? sanitize_text_field(wp_unslash($_GET['post'])) : '';
65
-
66
- if ( 'wpr-popups' === Utilities::get_elementor_template_type( $elementor_template_type ) ) {
67
- wp_redirect('admin.php?page=wpr-popups');
68
- } else {
69
- wp_redirect('admin.php?page=wpr-theme-builder');
70
- }
71
- }
72
- }
73
-
74
- public function register_templates_library_cpt() {
75
-
76
- $args = array(
77
- 'label' => esc_html__( 'Royal Templates', 'wpr-addons' ),
78
- 'public' => true,
79
- 'rewrite' => false,
80
- 'show_ui' => true,
81
- 'show_in_menu' => false,
82
- 'show_in_nav_menus' => false,
83
- 'exclude_from_search' => true,
84
- 'capability_type' => 'post',
85
- 'hierarchical' => false,
86
- );
87
-
88
- register_post_type( 'wpr_templates', $args );
89
-
90
- $tax_args = [
91
- 'hierarchical' => true,
92
- 'show_ui' => true,
93
- 'show_in_nav_menus' => false,
94
- 'show_admin_column' => true,
95
- 'query_var' => is_admin(),
96
- 'rewrite' => false,
97
- 'public' => false,
98
- ];
99
-
100
- register_taxonomy( 'wpr_template_type', 'wpr_templates', $tax_args );
101
-
102
- }
103
-
104
- /**
105
- ** Don't display on the frontend for non edit_posts capable users
106
- */
107
- public function block_template_frontend() {
108
- if ( is_singular( 'wpr_templates' ) && ! current_user_can( 'edit_posts' ) ) {
109
- wp_redirect( site_url(), 301 );
110
- die;
111
- }
112
- }
113
-
114
- /**
115
- *** Add elementor support for wpr_templates.
116
- **/
117
- function add_elementor_cpt_support() {
118
- if ( ! is_admin() ) {
119
- return;
120
- }
121
-
122
- $cpt_support = get_option( 'elementor_cpt_support' );
123
-
124
- if ( ! $cpt_support ) {
125
- update_option( 'elementor_cpt_support', ['post', 'page', 'wpr_templates'] );
126
- } elseif ( ! in_array( 'wpr_templates', $cpt_support ) ) {
127
- $cpt_support[] = 'wpr_templates';
128
- update_option( 'elementor_cpt_support', $cpt_support );
129
- }
130
- }
131
-
132
- }
133
-
134
  new WPR_Templates_Library();
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
+ }
6
+
7
+ use WprAddons\Admin\Includes\WPR_Render_Templates;
8
+ use WprAddons\Admin\Includes\WPR_Templates_Shortcode;
9
+ use WprAddons\Admin\Includes\WPR_Templates_Modal_Popups;
10
+ use WprAddons\Admin\Includes\WPR_Templates_Actions;
11
+ use WprAddons\Admin\Templates\WPR_Templates_Library_Blocks;
12
+ use WprAddons\Admin\Templates\WPR_Templates_Library_Popups;
13
+ use WprAddons\Admin\Templates\WPR_Templates_Library_Pages;
14
+ use WprAddons\Classes\Utilities;
15
+
16
+ /**
17
+ * WPR_Templates_Library setup
18
+ *
19
+ * @since 1.0
20
+ */
21
+ class WPR_Templates_Library {
22
+
23
+ /**
24
+ ** Constructor
25
+ */
26
+ public function __construct() {
27
+
28
+ // Register CPTs
29
+ add_action( 'init', [ $this, 'register_templates_library_cpt' ] );
30
+ add_action( 'template_redirect', [ $this, 'block_template_frontend' ] );
31
+ add_action( 'current_screen', [ $this, 'redirect_to_options_page' ] );
32
+
33
+ // Templates Shortcode
34
+ new WPR_Templates_Shortcode();
35
+
36
+ // Init Popups
37
+ new WPR_Templates_Modal_Popups();
38
+
39
+ // Init Theme Builder
40
+ new WPR_Render_Templates();
41
+
42
+ // Template Actions
43
+ new WPR_Templates_Actions();
44
+
45
+ // Add Blocks to Library
46
+ new WPR_Templates_Library_Blocks();
47
+
48
+ // Add Popups to Library
49
+ new WPR_Templates_Library_Popups();
50
+
51
+ // Add Pages to Library
52
+ // new WPR_Templates_Library_Pages();
53
+
54
+ // Enable Elementor for 'wpr_templates'
55
+ $this->add_elementor_cpt_support();
56
+
57
+ }
58
+
59
+ /**
60
+ ** Register Templates Library
61
+ */
62
+ public function redirect_to_options_page() {
63
+ if ( get_current_screen()->post_type == 'wpr_templates' && isset($_GET['action']) && $_GET['action'] == 'edit' ) {
64
+ $elementor_template_type = isset($_GET['post']) ? sanitize_text_field(wp_unslash($_GET['post'])) : '';
65
+
66
+ if ( 'wpr-popups' === Utilities::get_elementor_template_type( $elementor_template_type ) ) {
67
+ wp_redirect('admin.php?page=wpr-popups');
68
+ } else {
69
+ wp_redirect('admin.php?page=wpr-theme-builder');
70
+ }
71
+ }
72
+ }
73
+
74
+ public function register_templates_library_cpt() {
75
+
76
+ $args = array(
77
+ 'label' => esc_html__( 'Royal Templates', 'wpr-addons' ),
78
+ 'public' => true,
79
+ 'rewrite' => false,
80
+ 'show_ui' => true,
81
+ 'show_in_menu' => false,
82
+ 'show_in_nav_menus' => false,
83
+ 'exclude_from_search' => true,
84
+ 'capability_type' => 'post',
85
+ 'hierarchical' => false,
86
+ );
87
+
88
+ register_post_type( 'wpr_templates', $args );
89
+
90
+ $tax_args = [
91
+ 'hierarchical' => true,
92
+ 'show_ui' => true,
93
+ 'show_in_nav_menus' => false,
94
+ 'show_admin_column' => true,
95
+ 'query_var' => is_admin(),
96
+ 'rewrite' => false,
97
+ 'public' => false,
98
+ ];
99
+
100
+ register_taxonomy( 'wpr_template_type', 'wpr_templates', $tax_args );
101
+
102
+ }
103
+
104
+ /**
105
+ ** Don't display on the frontend for non edit_posts capable users
106
+ */
107
+ public function block_template_frontend() {
108
+ if ( is_singular( 'wpr_templates' ) && ! current_user_can( 'edit_posts' ) ) {
109
+ wp_redirect( site_url(), 301 );
110
+ die;
111
+ }
112
+ }
113
+
114
+ /**
115
+ *** Add elementor support for wpr_templates.
116
+ **/
117
+ function add_elementor_cpt_support() {
118
+ if ( ! is_admin() ) {
119
+ return;
120
+ }
121
+
122
+ $cpt_support = get_option( 'elementor_cpt_support' );
123
+
124
+ if ( ! $cpt_support ) {
125
+ update_option( 'elementor_cpt_support', ['post', 'page', 'wpr_templates'] );
126
+ } elseif ( ! in_array( 'wpr_templates', $cpt_support ) ) {
127
+ $cpt_support[] = 'wpr_templates';
128
+ update_option( 'elementor_cpt_support', $cpt_support );
129
+ }
130
+ }
131
+
132
+ }
133
+
134
  new WPR_Templates_Library();
admin/templates-kit.php CHANGED
@@ -1,568 +1,568 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly.
5
- }
6
-
7
- use WprAddons\Admin\Templates\WPR_Templates_Data;
8
- use WprAddons\Classes\Utilities;
9
- use Elementor\Plugin;
10
-
11
- // Register Menus
12
- function wpr_addons_add_templates_kit_menu() {
13
- add_submenu_page( 'wpr-addons', 'Templates Kit', 'Templates Kit', 'manage_options', 'wpr-templates-kit', 'wpr_addons_templates_kit_page' );
14
- }
15
- add_action( 'admin_menu', 'wpr_addons_add_templates_kit_menu' );
16
-
17
- // Import Template Kit
18
- add_action( 'wp_ajax_wpr_install_reuired_plugins', 'wpr_install_reuired_plugins' );
19
- add_action( 'wp_ajax_wpr_activate_reuired_theme', 'wpr_activate_reuired_theme' );
20
- add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' );
21
- add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' );
22
- add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
23
-
24
-
25
- /**
26
- ** Render Templates Kit Page
27
- */
28
- function wpr_addons_templates_kit_page() {
29
-
30
- ?>
31
-
32
- <div class="wpr-templates-kit-page">
33
-
34
- <header>
35
- <div class="wpr-templates-kit-logo">
36
- <div><img src="<?php echo !empty(get_option('wpr_wl_plugin_logo')) ? esc_url(wp_get_attachment_image_src(get_option('wpr_wl_plugin_logo'), 'full')[0]) : esc_url(WPR_ADDONS_ASSETS_URL .'img/logo-40x40.png'); ?>"></div>
37
- <div class="back-btn"><?php printf( esc_html__('%s Back to Library', 'wpr-addons'), '<span class="dashicons dashicons-arrow-left-alt2"></span>'); ?></div>
38
- </div>
39
-
40
- <div class="wpr-templates-kit-search">
41
- <input type="text" autocomplete="off" placeholder="<?php esc_html_e('Search Templates Kit...', 'wpr-addons'); ?>">
42
- <span class="dashicons dashicons-search"></span>
43
- </div>
44
-
45
- <div class="wpr-templates-kit-price-filter">
46
- <span data-price="mixed"><?php esc_html_e('Price: Mixed', 'wpr-addons'); ?></span>
47
- <span class="dashicons dashicons-arrow-down-alt2"></span>
48
- <ul>
49
- <li><?php esc_html_e('Mixed', 'wpr-addons'); ?></li>
50
- <li><?php esc_html_e('Free', 'wpr-addons'); ?></li>
51
- <li><?php esc_html_e('Premium', 'wpr-addons'); ?></li>
52
- </ul>
53
- </div>
54
-
55
- <div class="wpr-templates-kit-filters">
56
- <div>Filter: All</div>
57
- <ul>
58
- <li data-filter="all">Blog</li>
59
- <li data-filter="blog">Blog</li>
60
- <li data-filter="business">Business</li>
61
- <li data-filter="ecommerce">eCommerce</li>
62
- <li data-filter="beauty">Beauty</li>
63
- </ul>
64
- </div>
65
- </header>
66
-
67
- <div class="wpr-templates-kit-page-title">
68
- <h1><?php esc_html_e('Royal Elementor Templates Kit', 'wpr-addons'); ?></h1>
69
- <p><?php esc_html_e('Import any Templates Kit with just a Single click', 'wpr-addons'); ?></p>
70
- </div>
71
-
72
- <div class="wpr-templates-kit-grid main-grid" data-theme-status="<?php echo esc_attr(get_theme_status()); ?>">
73
- <?php
74
- $kits = WPR_Templates_Data::get_available_kits();
75
- $sorted_kits = [];
76
-
77
- foreach ($kits as $slug => $kit) {
78
- foreach ($kit as $version => $data ) {
79
- $sorted_kits[$slug .'-'. $version] = $data;
80
- }
81
- }
82
-
83
- // Sort by Priority
84
- uasort($sorted_kits, function ($item1, $item2) {
85
- if ($item1['priority'] == $item2['priority']) return 0;
86
- return $item1['priority'] < $item2['priority'] ? -1 : 1;
87
- });
88
-
89
- // Loop
90
- foreach ($sorted_kits as $kit_id => $data) {
91
- echo '<div class="grid-item" data-kit-id="'. esc_attr($kit_id) .'" data-tags="'. esc_attr($data['tags']) .'" data-plugins="'. esc_attr($data['plugins']) .'" data-pages="'. esc_attr($data['pages']) .'" data-price="'. esc_attr($data['price']) .'">';
92
- echo '<div class="image-wrap">';
93
- echo '<img src="'. esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit_id .'/home.jpg') .'">';
94
- echo '<div class="image-overlay"><span class="dashicons dashicons-search"></span></div>';
95
- echo '</div>';
96
- echo '<footer>';
97
- echo '<h3>'. esc_html($data['name']) .'</h3>';
98
- echo esc_html($data['theme-builder']) ? '<span>'. esc_html__( 'Theme Builder', 'wpr-addons' ) .'</span>' : '';
99
- echo '</footer>';
100
- echo '</div>';
101
- }
102
-
103
- ?>
104
-
105
- </div>
106
-
107
- <div class="wpr-templates-kit-single">
108
- <div class="wpr-templates-kit-grid single-grid"></div>
109
-
110
- <footer class="action-buttons-wrap">
111
- <a href="https://royal-elementor-addons.com/" class="preview-demo button" target="_blank"><?php esc_html_e('Preview Demo', 'wpr-addons'); ?> <span class="dashicons dashicons-external"></span></a>
112
-
113
- <div class="import-template-buttons">
114
- <?php
115
- echo '<button class="import-kit button">'. esc_html__('Import Templates Kit', 'wpr-addons') .' <span class="dashicons dashicons-download"></span></button>';
116
- echo '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-templates-upgrade-pro#purchasepro" class="get-access button" target="_blank">'. esc_html__('Get Access', 'wpr-addons') .' <span class="dashicons dashicons-external"></span></a>';
117
- ?>
118
- <button class="import-template button"><?php printf( esc_html__( 'Import %s Template', 'wpr-addons' ), '<strong></strong>' ); ?></button>
119
-
120
- </div>
121
- </footer>
122
- </div>
123
-
124
- <div class="wpr-import-kit-popup-wrap">
125
- <div class="overlay"></div>
126
- <div class="wpr-import-kit-popup">
127
- <header>
128
- <h3><?php esc_html_e('Template Kit is being imported', 'wpr-addons'); ?><span>.</span></h3>
129
- <span class="dashicons dashicons-no-alt close-btn"></span>
130
- </header>
131
- <div class="content">
132
- <p><?php esc_html_e('The import process can take a few seconds depending on the size of the kit you are importing and speed of the connection.', 'wpr-addons'); ?></p>
133
- <p><?php esc_html_e('Please do NOT close this browser window until import is completed.', 'wpr-addons'); ?></p>
134
-
135
- <div class="progress-wrap">
136
- <div class="progress-bar"></div>
137
- <strong></strong>
138
- </div>
139
- </div>
140
- </div>
141
- </div>
142
-
143
- <div class="wpr-templates-kit-not-found">
144
- <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/not-found.png'); ?>">
145
- <h1><?php esc_html_e('No Search Results Found.', 'wpr-addons'); ?></h1>
146
- <p><?php esc_html_e('Cant find a Templates Kit you are looking for?', 'wpr-addons'); ?></p>
147
- <a href="https://royal-elementor-addons.com/library/request-new-kit-red.html" target="_blank"><?php esc_html_e('Request Templates Kit.', 'wpr-addons'); ?></a>
148
- </div>
149
-
150
- </div>
151
-
152
-
153
- <?php
154
-
155
- } // End wpr_addons_templates_kit_page()
156
-
157
- /**
158
- ** Get Theme Status
159
- */
160
- function get_theme_status() {
161
- $theme = wp_get_theme();
162
-
163
- // Theme installed and activate.
164
- if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
165
- return 'req-theme-active';
166
- }
167
-
168
- // Theme installed but not activate.
169
- foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
170
- if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
171
- return 'req-theme-inactive';
172
- }
173
- }
174
-
175
- return 'req-theme-not-installed';
176
- }
177
-
178
- /**
179
- ** Install/Activate Required Theme
180
- */
181
- function wpr_activate_reuired_theme() {
182
- // Get Current Theme
183
- $theme = get_option('stylesheet');
184
-
185
- // Activate Royal Elementor Kit Theme
186
- if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
187
- && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
188
- switch_theme( 'royal-elementor-kit' );
189
- set_transient( 'royal-elementor-kit_activation_notice', true );
190
- }
191
-
192
- // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
193
- }
194
-
195
- /**
196
- ** Install/Activate Required Plugins
197
- */
198
- function wpr_install_reuired_plugins() {
199
- // Get currently active plugins
200
- $active_plugins = (array) get_option( 'active_plugins', array() );
201
-
202
- // Add Required Plugins
203
- if ( isset($_POST['plugin']) ) {
204
- if ( 'contact-form-7' == $_POST['plugin'] ) {
205
- array_push( $active_plugins, 'contact-form-7/wp-contact-form-7.php' );
206
- } elseif ( 'media-library-assistant' == $_POST['plugin'] ) {
207
- array_push( $active_plugins, 'media-library-assistant/index.php' );
208
- }
209
- }
210
-
211
- // Set Active Plugins
212
- update_option( 'active_plugins', $active_plugins );
213
-
214
- // Get Current Theme
215
- $theme = get_option('stylesheet');
216
-
217
- // Activate Royal Elementor Kit Theme
218
- if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
219
- && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
220
- switch_theme( 'royal-elementor-kit' );
221
- set_transient( 'royal-elementor-kit_activation_notice', true );
222
- }
223
-
224
- // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
225
-
226
- }
227
-
228
- /**
229
- ** Import Template Kit
230
- */
231
- function wpr_import_templates_kit() {
232
-
233
- // Temp Define Importers
234
- if ( ! defined('WP_LOAD_IMPORTERS') ) {
235
- define('WP_LOAD_IMPORTERS', true);
236
- }
237
-
238
- // Include if Class Does NOT Exist
239
- if ( ! class_exists( 'WP_Import' ) ) {
240
- $class_wp_importer = WPR_ADDONS_PATH .'admin/import/class-wordpress-importer.php';
241
- if ( file_exists( $class_wp_importer ) ) {
242
- require $class_wp_importer;
243
- }
244
- }
245
-
246
- if ( class_exists( 'WP_Import' ) ) {
247
- $kit = isset($_POST['wpr_templates_kit']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit'])) : '';
248
- $file = isset($_POST['wpr_templates_kit_single']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit_single'])) : '';
249
-
250
- // Tmp
251
- update_option( 'wpr-import-kit-id', $kit );
252
-
253
- // Download Import File
254
- $local_file_path = download_template( $kit, $file );
255
-
256
- // Prepare for Import
257
- $wp_import = new WP_Import( $local_file_path, ['fetch_attachments' => true] );
258
-
259
- // Import
260
- ob_start();
261
- $wp_import->run();
262
- ob_end_clean();
263
-
264
- // Delete Import File
265
- unlink( $local_file_path );
266
-
267
- // Send to JS
268
- echo esc_html(serialize( $wp_import ));
269
- }
270
-
271
- }
272
-
273
- /**
274
- ** Download Template
275
- */
276
- function download_template( $kit, $file ) {
277
- $file = ! $file ? 'main' : $file;
278
-
279
- // Avoid Cache
280
- $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
281
-
282
- // Remote and Local Files
283
- $remote_file_url = 'https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
284
- $local_file_path = WPR_ADDONS_PATH .'admin/import/tmp.xml';
285
-
286
- // No Limit for Execution
287
- set_time_limit(0);
288
-
289
- // Copy File From Server
290
- copy( $remote_file_url, $local_file_path );
291
-
292
- return $local_file_path;
293
- }
294
-
295
- /**
296
- ** Import Elementor Site Settings
297
- */
298
- function import_elementor_site_settings( $kit ) {
299
- // Avoid Cache
300
- // $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
301
-
302
- // Get Remote File
303
- $site_settings = @file_get_contents('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/site-settings.json');
304
-
305
- if ( false !== $site_settings ) {
306
- $site_settings = json_decode($site_settings, true);
307
-
308
- if ( ! empty($site_settings['settings']) ) {
309
- $default_kit = \Elementor\Plugin::$instance->documents->get_doc_for_frontend( get_option( 'elementor_active_kit' ) );
310
-
311
- $kit_settings = $default_kit->get_settings();
312
- $new_settings = $site_settings['settings'];
313
- $settings = array_merge($kit_settings, $new_settings);
314
-
315
- $default_kit->save( [ 'settings' => $settings ] );
316
- }
317
- }
318
- }
319
-
320
- /**
321
- ** Setup WPR Templates
322
- */
323
- function setup_wpr_templates( $kit ) {
324
- $kit = isset($kit) ? sanitize_text_field(wp_unslash($kit)) : '';
325
-
326
- // Check if kit has Theme Builder templates
327
- $kit_name = substr($kit, 0, strripos($kit, '-v'));
328
- $kit_version = substr($kit, (strripos($kit, '-v') + 1), strlen($kit));
329
- $get_available_kits = WPR_Templates_Data::get_available_kits();
330
- $has_theme_builder = $get_available_kits[$kit_name][$kit_version]['theme-builder'];
331
-
332
- // Set Home & Blog Pages
333
- $home_page = get_page_by_path('home-'. $kit);
334
- $blog_page = get_page_by_path('blog-'. $kit);
335
-
336
- if ( $home_page ) {
337
- update_option( 'show_on_front', 'page' );
338
- update_option( 'page_on_front', $home_page->ID );
339
-
340
- if ( $blog_page ) {
341
- update_option( 'page_for_posts', $blog_page->ID );
342
- }
343
- }
344
-
345
- // Set Headers and Footers
346
- update_option('wpr_header_conditions', '{"user-header-'. $kit .'-header":["global"]}');
347
- update_post_meta( Utilities::get_template_id('user-header-'. $kit), 'wpr_header_show_on_canvas', 'true' );
348
- update_option('wpr_footer_conditions', '{"user-footer-'. $kit .'-footer":["global"]}');
349
- update_post_meta( Utilities::get_template_id('user-footer-'. $kit), 'wpr_footer_show_on_canvas', 'true' );
350
-
351
- // Theme Builder
352
- if ( $has_theme_builder ) {
353
- update_option('wpr_archive_conditions', '{"user-archive-'. $kit .'-blog":["archive/posts"],"user-archive-'. $kit .'-author":["archive/author"],"user-archive-'. $kit .'-date":["archive/date"],"user-archive-'. $kit .'-category-tag":["archive/categories/all","archive/tags/all"],"user-archive-'. $kit .'-search":["archive/search"]}');
354
- update_option('wpr_single_conditions', '{"user-single-'. $kit .'-404":["single/page_404"],"user-single-'. $kit .'-post":["single/posts/all"],"user-single-'. $kit .'-page":["single/pages/all"]}');
355
- }
356
-
357
- // Set Popup
358
- update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-popup":["global"]}');
359
- }
360
-
361
- /**
362
- ** Fix Elementor Images
363
- */
364
- function wpr_fix_elementor_images() {
365
- $args = array(
366
- 'post_type' => ['wpr_templates', 'page'],
367
- 'posts_per_page' => '-1',
368
- 'meta_key' => '_elementor_version'
369
- );
370
- $elementor_pages = new WP_Query ( $args );
371
-
372
- // Check that we have query results.
373
- if ( $elementor_pages->have_posts() ) {
374
-
375
- // Start looping over the query results.
376
- while ( $elementor_pages->have_posts() ) {
377
-
378
- $elementor_pages->the_post();
379
-
380
- // Replace Demo with Current
381
- $site_url = get_site_url();
382
- $site_url = str_replace( '/', '\/', $site_url );
383
- $demo_site_url = 'https://demosites.royal-elementor-addons.com/'. get_option('wpr-import-kit-id');
384
- $demo_site_url = str_replace( '/', '\/', $demo_site_url );
385
-
386
- // Elementor Data
387
- $data = get_post_meta( get_the_ID(), '_elementor_data', true );
388
-
389
- if ( ! empty( $data ) ) {
390
- $data = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $data);
391
- $data = str_replace( $demo_site_url, $site_url, $data );
392
- $data = json_decode( $data, true );
393
- }
394
-
395
- update_metadata( 'post', get_the_ID(), '_elementor_data', $data );
396
-
397
- // Elementor Page Settings
398
- $page_settings = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
399
- $page_settings = json_encode($page_settings);
400
-
401
- if ( ! empty( $page_settings ) ) {
402
- $page_settings = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $page_settings);
403
- $page_settings = str_replace( $demo_site_url, $site_url, $page_settings );
404
- $page_settings = json_decode( $page_settings, true );
405
- }
406
-
407
- update_metadata( 'post', get_the_ID(), '_elementor_page_settings', $page_settings );
408
-
409
- }
410
-
411
- }
412
-
413
- // Clear Elementor Cache
414
- Plugin::$instance->files_manager->clear_cache();
415
- }
416
-
417
- /**
418
- ** Fix Contact Form 7
419
- */
420
- function fix_contact_form_7() {
421
- if ( class_exists('WPCF7_ContactForm') ) {
422
- $new_contact_form = WPCF7_ContactForm::get_template(
423
- array(
424
- 'title' =>
425
- /* translators: title of your first contact form. %d: number fixed to '1' */
426
- sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ),
427
- )
428
- );
429
-
430
- // Get CF7s
431
- $contact_forms = get_posts(['post_type'=>'wpcf7_contact_form']);
432
-
433
- // Add new CF7
434
- if ( empty($contact_forms) ) {
435
- $new_contact_form->save();
436
- }
437
- }
438
- }
439
-
440
- /**
441
- ** Final Settings Setup
442
- */
443
- function wpr_final_settings_setup() {
444
- $kit = !empty(get_option('wpr-import-kit-id')) ? esc_html(get_option('wpr-import-kit-id')) : '';
445
-
446
- // Elementor Site Settings
447
- import_elementor_site_settings($kit);
448
-
449
- // Setup WPR Templates
450
- setup_wpr_templates($kit);
451
-
452
- // Fix Elementor Images
453
- wpr_fix_elementor_images();
454
-
455
- // Fix Contact Form 7
456
- fix_contact_form_7();
457
-
458
- // Track Kit
459
- wpr_track_imported_kit( $kit );
460
-
461
- // Clear DB
462
- delete_option('wpr-import-kit-id');
463
-
464
- // Delete Hello World Post
465
- $post = get_page_by_path('hello-world', OBJECT, 'post');
466
- if ( $post ) {
467
- wp_delete_post($post->ID,true);
468
- }
469
- }
470
-
471
- /**
472
- * Allow SVG Import - Add Mime Types
473
- */
474
- function wpr_svgs_upload_mimes( $mimes = array() ) {
475
-
476
- // allow SVG file upload
477
- $mimes['svg'] = 'image/svg+xml';
478
- $mimes['svgz'] = 'image/svg+xml';
479
-
480
- // allow JSON file upload
481
- $mimes['json'] = 'text/plain';
482
-
483
- return $mimes;
484
-
485
- }
486
- add_filter( 'upload_mimes', 'wpr_svgs_upload_mimes', 99 );
487
-
488
- /**
489
- * Check Mime Types
490
- */
491
- function wpr_svgs_upload_check( $checked, $file, $filename, $mimes ) {
492
-
493
- if ( ! $checked['type'] ) {
494
-
495
- $check_filetype = wp_check_filetype( $filename, $mimes );
496
- $ext = $check_filetype['ext'];
497
- $type = $check_filetype['type'];
498
- $proper_filename = $filename;
499
-
500
- if ( $type && 0 === strpos( $type, 'image/' ) && $ext !== 'svg' ) {
501
- $ext = $type = false;
502
- }
503
-
504
- $checked = compact( 'ext','type','proper_filename' );
505
- }
506
-
507
- return $checked;
508
-
509
- }
510
- add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_upload_check', 10, 4 );
511
-
512
- /**
513
- * Mime Check fix for WP 4.7.1 / 4.7.2
514
- *
515
- * Fixes uploads for these 2 version of WordPress.
516
- * Issue was fixed in 4.7.3 core.
517
- */
518
- function wpr_svgs_allow_svg_upload( $data, $file, $filename, $mimes ) {
519
-
520
- global $wp_version;
521
- if ( $wp_version !== '4.7.1' || $wp_version !== '4.7.2' ) {
522
- return $data;
523
- }
524
-
525
- $filetype = wp_check_filetype( $filename, $mimes );
526
-
527
- return [
528
- 'ext' => $filetype['ext'],
529
- 'type' => $filetype['type'],
530
- 'proper_filename' => $data['proper_filename']
531
- ];
532
-
533
- }
534
- add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_allow_svg_upload', 10, 4 );
535
-
536
- /**
537
- ** Search Query Results
538
- */
539
- function wpr_search_query_results() {
540
- // Freemius OptIn
541
- if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
542
- return;
543
- }
544
-
545
- $search_query = isset($_POST['search_query']) ? sanitize_text_field(wp_unslash($_POST['search_query'])) : '';
546
-
547
- wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-search/data', [
548
- 'body' => [
549
- 'search_query' => $search_query
550
- ]
551
- ] );
552
- }
553
-
554
- /**
555
- ** Search Query Results
556
- */
557
- function wpr_track_imported_kit( $kit ) {
558
- // Freemius OptIn
559
- if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
560
- return;
561
- }
562
-
563
- wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-import/data', [
564
- 'body' => [
565
- 'imported_kit' => $kit
566
- ]
567
- ] );
568
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
+ }
6
+
7
+ use WprAddons\Admin\Templates\WPR_Templates_Data;
8
+ use WprAddons\Classes\Utilities;
9
+ use Elementor\Plugin;
10
+
11
+ // Register Menus
12
+ function wpr_addons_add_templates_kit_menu() {
13
+ add_submenu_page( 'wpr-addons', 'Templates Kit', 'Templates Kit', 'manage_options', 'wpr-templates-kit', 'wpr_addons_templates_kit_page' );
14
+ }
15
+ add_action( 'admin_menu', 'wpr_addons_add_templates_kit_menu' );
16
+
17
+ // Import Template Kit
18
+ add_action( 'wp_ajax_wpr_install_reuired_plugins', 'wpr_install_reuired_plugins' );
19
+ add_action( 'wp_ajax_wpr_activate_reuired_theme', 'wpr_activate_reuired_theme' );
20
+ add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' );
21
+ add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' );
22
+ add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
23
+
24
+
25
+ /**
26
+ ** Render Templates Kit Page
27
+ */
28
+ function wpr_addons_templates_kit_page() {
29
+
30
+ ?>
31
+
32
+ <div class="wpr-templates-kit-page">
33
+
34
+ <header>
35
+ <div class="wpr-templates-kit-logo">
36
+ <div><img src="<?php echo !empty(get_option('wpr_wl_plugin_logo')) ? esc_url(wp_get_attachment_image_src(get_option('wpr_wl_plugin_logo'), 'full')[0]) : esc_url(WPR_ADDONS_ASSETS_URL .'img/logo-40x40.png'); ?>"></div>
37
+ <div class="back-btn"><?php printf( esc_html__('%s Back to Library', 'wpr-addons'), '<span class="dashicons dashicons-arrow-left-alt2"></span>'); ?></div>
38
+ </div>
39
+
40
+ <div class="wpr-templates-kit-search">
41
+ <input type="text" autocomplete="off" placeholder="<?php esc_html_e('Search Templates Kit...', 'wpr-addons'); ?>">
42
+ <span class="dashicons dashicons-search"></span>
43
+ </div>
44
+
45
+ <div class="wpr-templates-kit-price-filter">
46
+ <span data-price="mixed"><?php esc_html_e('Price: Mixed', 'wpr-addons'); ?></span>
47
+ <span class="dashicons dashicons-arrow-down-alt2"></span>
48
+ <ul>
49
+ <li><?php esc_html_e('Mixed', 'wpr-addons'); ?></li>
50
+ <li><?php esc_html_e('Free', 'wpr-addons'); ?></li>
51
+ <li><?php esc_html_e('Premium', 'wpr-addons'); ?></li>
52
+ </ul>
53
+ </div>
54
+
55
+ <div class="wpr-templates-kit-filters">
56
+ <div>Filter: All</div>
57
+ <ul>
58
+ <li data-filter="all">Blog</li>
59
+ <li data-filter="blog">Blog</li>
60
+ <li data-filter="business">Business</li>
61
+ <li data-filter="ecommerce">eCommerce</li>
62
+ <li data-filter="beauty">Beauty</li>
63
+ </ul>
64
+ </div>
65
+ </header>
66
+
67
+ <div class="wpr-templates-kit-page-title">
68
+ <h1><?php esc_html_e('Royal Elementor Templates Kit', 'wpr-addons'); ?></h1>
69
+ <p><?php esc_html_e('Import any Templates Kit with just a Single click', 'wpr-addons'); ?></p>
70
+ </div>
71
+
72
+ <div class="wpr-templates-kit-grid main-grid" data-theme-status="<?php echo esc_attr(get_theme_status()); ?>">
73
+ <?php
74
+ $kits = WPR_Templates_Data::get_available_kits();
75
+ $sorted_kits = [];
76
+
77
+ foreach ($kits as $slug => $kit) {
78
+ foreach ($kit as $version => $data ) {
79
+ $sorted_kits[$slug .'-'. $version] = $data;
80
+ }
81
+ }
82
+
83
+ // Sort by Priority
84
+ uasort($sorted_kits, function ($item1, $item2) {
85
+ if ($item1['priority'] == $item2['priority']) return 0;
86
+ return $item1['priority'] < $item2['priority'] ? -1 : 1;
87
+ });
88
+
89
+ // Loop
90
+ foreach ($sorted_kits as $kit_id => $data) {
91
+ echo '<div class="grid-item" data-kit-id="'. esc_attr($kit_id) .'" data-tags="'. esc_attr($data['tags']) .'" data-plugins="'. esc_attr($data['plugins']) .'" data-pages="'. esc_attr($data['pages']) .'" data-price="'. esc_attr($data['price']) .'">';
92
+ echo '<div class="image-wrap">';
93
+ echo '<img src="'. esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit_id .'/home.jpg') .'">';
94
+ echo '<div class="image-overlay"><span class="dashicons dashicons-search"></span></div>';
95
+ echo '</div>';
96
+ echo '<footer>';
97
+ echo '<h3>'. esc_html($data['name']) .'</h3>';
98
+ echo esc_html($data['theme-builder']) ? '<span>'. esc_html__( 'Theme Builder', 'wpr-addons' ) .'</span>' : '';
99
+ echo '</footer>';
100
+ echo '</div>';
101
+ }
102
+
103
+ ?>
104
+
105
+ </div>
106
+
107
+ <div class="wpr-templates-kit-single">
108
+ <div class="wpr-templates-kit-grid single-grid"></div>
109
+
110
+ <footer class="action-buttons-wrap">
111
+ <a href="https://royal-elementor-addons.com/" class="preview-demo button" target="_blank"><?php esc_html_e('Preview Demo', 'wpr-addons'); ?> <span class="dashicons dashicons-external"></span></a>
112
+
113
+ <div class="import-template-buttons">
114
+ <?php
115
+ echo '<button class="import-kit button">'. esc_html__('Import Templates Kit', 'wpr-addons') .' <span class="dashicons dashicons-download"></span></button>';
116
+ echo '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-templates-upgrade-pro#purchasepro" class="get-access button" target="_blank">'. esc_html__('Get Access', 'wpr-addons') .' <span class="dashicons dashicons-external"></span></a>';
117
+ ?>
118
+ <button class="import-template button"><?php printf( esc_html__( 'Import %s Template', 'wpr-addons' ), '<strong></strong>' ); ?></button>
119
+
120
+ </div>
121
+ </footer>
122
+ </div>
123
+
124
+ <div class="wpr-import-kit-popup-wrap">
125
+ <div class="overlay"></div>
126
+ <div class="wpr-import-kit-popup">
127
+ <header>
128
+ <h3><?php esc_html_e('Template Kit is being imported', 'wpr-addons'); ?><span>.</span></h3>
129
+ <span class="dashicons dashicons-no-alt close-btn"></span>
130
+ </header>
131
+ <div class="content">
132
+ <p><?php esc_html_e('The import process can take a few seconds depending on the size of the kit you are importing and speed of the connection.', 'wpr-addons'); ?></p>
133
+ <p><?php esc_html_e('Please do NOT close this browser window until import is completed.', 'wpr-addons'); ?></p>
134
+
135
+ <div class="progress-wrap">
136
+ <div class="progress-bar"></div>
137
+ <strong></strong>
138
+ </div>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <div class="wpr-templates-kit-not-found">
144
+ <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/not-found.png'); ?>">
145
+ <h1><?php esc_html_e('No Search Results Found.', 'wpr-addons'); ?></h1>
146
+ <p><?php esc_html_e('Cant find a Templates Kit you are looking for?', 'wpr-addons'); ?></p>
147
+ <a href="https://royal-elementor-addons.com/library/request-new-kit-red.html" target="_blank"><?php esc_html_e('Request Templates Kit.', 'wpr-addons'); ?></a>
148
+ </div>
149
+
150
+ </div>
151
+
152
+
153
+ <?php
154
+
155
+ } // End wpr_addons_templates_kit_page()
156
+
157
+ /**
158
+ ** Get Theme Status
159
+ */
160
+ function get_theme_status() {
161
+ $theme = wp_get_theme();
162
+
163
+ // Theme installed and activate.
164
+ if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
165
+ return 'req-theme-active';
166
+ }
167
+
168
+ // Theme installed but not activate.
169
+ foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
170
+ if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
171
+ return 'req-theme-inactive';
172
+ }
173
+ }
174
+
175
+ return 'req-theme-not-installed';
176
+ }
177
+
178
+ /**
179
+ ** Install/Activate Required Theme
180
+ */
181
+ function wpr_activate_reuired_theme() {
182
+ // Get Current Theme
183
+ $theme = get_option('stylesheet');
184
+
185
+ // Activate Royal Elementor Kit Theme
186
+ if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
187
+ && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
188
+ switch_theme( 'royal-elementor-kit' );
189
+ set_transient( 'royal-elementor-kit_activation_notice', true );
190
+ }
191
+
192
+ // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
193
+ }
194
+
195
+ /**
196
+ ** Install/Activate Required Plugins
197
+ */
198
+ function wpr_install_reuired_plugins() {
199
+ // Get currently active plugins
200
+ $active_plugins = (array) get_option( 'active_plugins', array() );
201
+
202
+ // Add Required Plugins
203
+ if ( isset($_POST['plugin']) ) {
204
+ if ( 'contact-form-7' == $_POST['plugin'] ) {
205
+ array_push( $active_plugins, 'contact-form-7/wp-contact-form-7.php' );
206
+ } elseif ( 'media-library-assistant' == $_POST['plugin'] ) {
207
+ array_push( $active_plugins, 'media-library-assistant/index.php' );
208
+ }
209
+ }
210
+
211
+ // Set Active Plugins
212
+ update_option( 'active_plugins', $active_plugins );
213
+
214
+ // Get Current Theme
215
+ $theme = get_option('stylesheet');
216
+
217
+ // Activate Royal Elementor Kit Theme
218
+ if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
219
+ && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
220
+ switch_theme( 'royal-elementor-kit' );
221
+ set_transient( 'royal-elementor-kit_activation_notice', true );
222
+ }
223
+
224
+ // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
225
+
226
+ }
227
+
228
+ /**
229
+ ** Import Template Kit
230
+ */
231
+ function wpr_import_templates_kit() {
232
+
233
+ // Temp Define Importers
234
+ if ( ! defined('WP_LOAD_IMPORTERS') ) {
235
+ define('WP_LOAD_IMPORTERS', true);
236
+ }
237
+
238
+ // Include if Class Does NOT Exist
239
+ if ( ! class_exists( 'WP_Import' ) ) {
240
+ $class_wp_importer = WPR_ADDONS_PATH .'admin/import/class-wordpress-importer.php';
241
+ if ( file_exists( $class_wp_importer ) ) {
242
+ require $class_wp_importer;
243
+ }
244
+ }
245
+
246
+ if ( class_exists( 'WP_Import' ) ) {
247
+ $kit = isset($_POST['wpr_templates_kit']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit'])) : '';
248
+ $file = isset($_POST['wpr_templates_kit_single']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit_single'])) : '';
249
+
250
+ // Tmp
251
+ update_option( 'wpr-import-kit-id', $kit );
252
+
253
+ // Download Import File
254
+ $local_file_path = download_template( $kit, $file );
255
+
256
+ // Prepare for Import
257
+ $wp_import = new WP_Import( $local_file_path, ['fetch_attachments' => true] );
258
+
259
+ // Import
260
+ ob_start();
261
+ $wp_import->run();
262
+ ob_end_clean();
263
+
264
+ // Delete Import File
265
+ unlink( $local_file_path );
266
+
267
+ // Send to JS
268
+ echo esc_html(serialize( $wp_import ));
269
+ }
270
+
271
+ }
272
+
273
+ /**
274
+ ** Download Template
275
+ */
276
+ function download_template( $kit, $file ) {
277
+ $file = ! $file ? 'main' : $file;
278
+
279
+ // Avoid Cache
280
+ $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
281
+
282
+ // Remote and Local Files
283
+ $remote_file_url = 'https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
284
+ $local_file_path = WPR_ADDONS_PATH .'admin/import/tmp.xml';
285
+
286
+ // No Limit for Execution
287
+ set_time_limit(0);
288
+
289
+ // Copy File From Server
290
+ copy( $remote_file_url, $local_file_path );
291
+
292
+ return $local_file_path;
293
+ }
294
+
295
+ /**
296
+ ** Import Elementor Site Settings
297
+ */
298
+ function import_elementor_site_settings( $kit ) {
299
+ // Avoid Cache
300
+ // $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
301
+
302
+ // Get Remote File
303
+ $site_settings = @file_get_contents('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/site-settings.json');
304
+
305
+ if ( false !== $site_settings ) {
306
+ $site_settings = json_decode($site_settings, true);
307
+
308
+ if ( ! empty($site_settings['settings']) ) {
309
+ $default_kit = \Elementor\Plugin::$instance->documents->get_doc_for_frontend( get_option( 'elementor_active_kit' ) );
310
+
311
+ $kit_settings = $default_kit->get_settings();
312
+ $new_settings = $site_settings['settings'];
313
+ $settings = array_merge($kit_settings, $new_settings);
314
+
315
+ $default_kit->save( [ 'settings' => $settings ] );
316
+ }
317
+ }
318
+ }
319
+
320
+ /**
321
+ ** Setup WPR Templates
322
+ */
323
+ function setup_wpr_templates( $kit ) {
324
+ $kit = isset($kit) ? sanitize_text_field(wp_unslash($kit)) : '';
325
+
326
+ // Check if kit has Theme Builder templates
327
+ $kit_name = substr($kit, 0, strripos($kit, '-v'));
328
+ $kit_version = substr($kit, (strripos($kit, '-v') + 1), strlen($kit));
329
+ $get_available_kits = WPR_Templates_Data::get_available_kits();
330
+ $has_theme_builder = $get_available_kits[$kit_name][$kit_version]['theme-builder'];
331
+
332
+ // Set Home & Blog Pages
333
+ $home_page = get_page_by_path('home-'. $kit);
334
+ $blog_page = get_page_by_path('blog-'. $kit);
335
+
336
+ if ( $home_page ) {
337
+ update_option( 'show_on_front', 'page' );
338
+ update_option( 'page_on_front', $home_page->ID );
339
+
340
+ if ( $blog_page ) {
341
+ update_option( 'page_for_posts', $blog_page->ID );
342
+ }
343
+ }
344
+
345
+ // Set Headers and Footers
346
+ update_option('wpr_header_conditions', '{"user-header-'. $kit .'-header":["global"]}');
347
+ update_post_meta( Utilities::get_template_id('user-header-'. $kit), 'wpr_header_show_on_canvas', 'true' );
348
+ update_option('wpr_footer_conditions', '{"user-footer-'. $kit .'-footer":["global"]}');
349
+ update_post_meta( Utilities::get_template_id('user-footer-'. $kit), 'wpr_footer_show_on_canvas', 'true' );
350
+
351
+ // Theme Builder
352
+ if ( $has_theme_builder ) {
353
+ update_option('wpr_archive_conditions', '{"user-archive-'. $kit .'-blog":["archive/posts"],"user-archive-'. $kit .'-author":["archive/author"],"user-archive-'. $kit .'-date":["archive/date"],"user-archive-'. $kit .'-category-tag":["archive/categories/all","archive/tags/all"],"user-archive-'. $kit .'-search":["archive/search"]}');
354
+ update_option('wpr_single_conditions', '{"user-single-'. $kit .'-404":["single/page_404"],"user-single-'. $kit .'-post":["single/posts/all"],"user-single-'. $kit .'-page":["single/pages/all"]}');
355
+ }
356
+
357
+ // Set Popup
358
+ update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-popup":["global"]}');
359
+ }
360
+
361
+ /**
362
+ ** Fix Elementor Images
363
+ */
364
+ function wpr_fix_elementor_images() {
365
+ $args = array(
366
+ 'post_type' => ['wpr_templates', 'page'],
367
+ 'posts_per_page' => '-1',
368
+ 'meta_key' => '_elementor_version'
369
+ );
370
+ $elementor_pages = new WP_Query ( $args );
371
+
372
+ // Check that we have query results.
373
+ if ( $elementor_pages->have_posts() ) {
374
+
375
+ // Start looping over the query results.
376
+ while ( $elementor_pages->have_posts() ) {
377
+
378
+ $elementor_pages->the_post();
379
+
380
+ // Replace Demo with Current
381
+ $site_url = get_site_url();
382
+ $site_url = str_replace( '/', '\/', $site_url );
383
+ $demo_site_url = 'https://demosites.royal-elementor-addons.com/'. get_option('wpr-import-kit-id');
384
+ $demo_site_url = str_replace( '/', '\/', $demo_site_url );
385
+
386
+ // Elementor Data
387
+ $data = get_post_meta( get_the_ID(), '_elementor_data', true );
388
+
389
+ if ( ! empty( $data ) ) {
390
+ $data = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $data);
391
+ $data = str_replace( $demo_site_url, $site_url, $data );
392
+ $data = json_decode( $data, true );
393
+ }
394
+
395
+ update_metadata( 'post', get_the_ID(), '_elementor_data', $data );
396
+
397
+ // Elementor Page Settings
398
+ $page_settings = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
399
+ $page_settings = json_encode($page_settings);
400
+
401
+ if ( ! empty( $page_settings ) ) {
402
+ $page_settings = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $page_settings);
403
+ $page_settings = str_replace( $demo_site_url, $site_url, $page_settings );
404
+ $page_settings = json_decode( $page_settings, true );
405
+ }
406
+
407
+ update_metadata( 'post', get_the_ID(), '_elementor_page_settings', $page_settings );
408
+
409
+ }
410
+
411
+ }
412
+
413
+ // Clear Elementor Cache
414
+ Plugin::$instance->files_manager->clear_cache();
415
+ }
416
+
417
+ /**
418
+ ** Fix Contact Form 7
419
+ */
420
+ function fix_contact_form_7() {
421
+ if ( class_exists('WPCF7_ContactForm') ) {
422
+ $new_contact_form = WPCF7_ContactForm::get_template(
423
+ array(
424
+ 'title' =>
425
+ /* translators: title of your first contact form. %d: number fixed to '1' */
426
+ sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ),
427
+ )
428
+ );
429
+
430
+ // Get CF7s
431
+ $contact_forms = get_posts(['post_type'=>'wpcf7_contact_form']);
432
+
433
+ // Add new CF7
434
+ if ( empty($contact_forms) ) {
435
+ $new_contact_form->save();
436
+ }
437
+ }
438
+ }
439
+
440
+ /**
441
+ ** Final Settings Setup
442
+ */
443
+ function wpr_final_settings_setup() {
444
+ $kit = !empty(get_option('wpr-import-kit-id')) ? esc_html(get_option('wpr-import-kit-id')) : '';
445
+
446
+ // Elementor Site Settings
447
+ import_elementor_site_settings($kit);
448
+
449
+ // Setup WPR Templates
450
+ setup_wpr_templates($kit);
451
+
452
+ // Fix Elementor Images
453
+ wpr_fix_elementor_images();
454
+
455
+ // Fix Contact Form 7
456
+ fix_contact_form_7();
457
+
458
+ // Track Kit
459
+ wpr_track_imported_kit( $kit );
460
+
461
+ // Clear DB
462
+ delete_option('wpr-import-kit-id');
463
+
464
+ // Delete Hello World Post
465
+ $post = get_page_by_path('hello-world', OBJECT, 'post');
466
+ if ( $post ) {
467
+ wp_delete_post($post->ID,true);
468
+ }
469
+ }
470
+
471
+ /**
472
+ * Allow SVG Import - Add Mime Types
473
+ */
474
+ function wpr_svgs_upload_mimes( $mimes = array() ) {
475
+
476
+ // allow SVG file upload
477
+ $mimes['svg'] = 'image/svg+xml';
478
+ $mimes['svgz'] = 'image/svg+xml';
479
+
480
+ // allow JSON file upload
481
+ $mimes['json'] = 'text/plain';
482
+
483
+ return $mimes;
484
+
485
+ }
486
+ add_filter( 'upload_mimes', 'wpr_svgs_upload_mimes', 99 );
487
+
488
+ /**
489
+ * Check Mime Types
490
+ */
491
+ function wpr_svgs_upload_check( $checked, $file, $filename, $mimes ) {
492
+
493
+ if ( ! $checked['type'] ) {
494
+
495
+ $check_filetype = wp_check_filetype( $filename, $mimes );
496
+ $ext = $check_filetype['ext'];
497
+ $type = $check_filetype['type'];
498
+ $proper_filename = $filename;
499
+
500
+ if ( $type && 0 === strpos( $type, 'image/' ) && $ext !== 'svg' ) {
501
+ $ext = $type = false;
502
+ }
503
+
504
+ $checked = compact( 'ext','type','proper_filename' );
505
+ }
506
+
507
+ return $checked;
508
+
509
+ }
510
+ add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_upload_check', 10, 4 );
511
+
512
+ /**
513
+ * Mime Check fix for WP 4.7.1 / 4.7.2
514
+ *
515
+ * Fixes uploads for these 2 version of WordPress.
516
+ * Issue was fixed in 4.7.3 core.
517
+ */
518
+ function wpr_svgs_allow_svg_upload( $data, $file, $filename, $mimes ) {
519
+
520
+ global $wp_version;
521
+ if ( $wp_version !== '4.7.1' || $wp_version !== '4.7.2' ) {
522
+ return $data;
523
+ }
524
+
525
+ $filetype = wp_check_filetype( $filename, $mimes );
526
+
527
+ return [
528
+ 'ext' => $filetype['ext'],
529
+ 'type' => $filetype['type'],
530
+ 'proper_filename' => $data['proper_filename']
531
+ ];
532
+
533
+ }
534
+ add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_allow_svg_upload', 10, 4 );
535
+
536
+ /**
537
+ ** Search Query Results
538
+ */
539
+ function wpr_search_query_results() {
540
+ // Freemius OptIn
541
+ if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
542
+ return;
543
+ }
544
+
545
+ $search_query = isset($_POST['search_query']) ? sanitize_text_field(wp_unslash($_POST['search_query'])) : '';
546
+
547
+ wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-search/data', [
548
+ 'body' => [
549
+ 'search_query' => $search_query
550
+ ]
551
+ ] );
552
+ }
553
+
554
+ /**
555
+ ** Search Query Results
556
+ */
557
+ function wpr_track_imported_kit( $kit ) {
558
+ // Freemius OptIn
559
+ if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
560
+ return;
561
+ }
562
+
563
+ wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-import/data', [
564
+ 'body' => [
565
+ 'imported_kit' => $kit
566
+ ]
567
+ ] );
568
  }
admin/templates/views/royal/theme-header-royal.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- use WprAddons\Admin\Includes\WPR_Conditions_Manager;
3
- use WprAddons\Classes\Utilities;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
10
- $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
11
-
12
- ?>
13
-
14
- <!DOCTYPE html>
15
- <html <?php language_attributes(); ?>>
16
- <head>
17
- <meta charset="<?php bloginfo( 'charset' ); ?>">
18
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
19
- <?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
20
- <title>
21
- <?php echo esc_html(wp_get_document_title()); ?>
22
- </title>
23
- <?php endif; ?>
24
- <?php wp_head(); ?>
25
- </head>
26
-
27
- <body <?php body_class(); ?>>
28
-
29
- <?php
30
-
31
- do_action( 'wp_body_open' );
32
-
33
- // Royal themes compatibility
34
- echo '<div id="page-wrap">';
35
-
36
- // Render WPR Header
37
- Utilities::render_elementor_template($template_slug);
38
-
39
- // Royal themes compatibility
40
  echo '<div class="page-content">';
1
+ <?php
2
+ use WprAddons\Admin\Includes\WPR_Conditions_Manager;
3
+ use WprAddons\Classes\Utilities;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
10
+ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
11
+
12
+ ?>
13
+
14
+ <!DOCTYPE html>
15
+ <html <?php language_attributes(); ?>>
16
+ <head>
17
+ <meta charset="<?php bloginfo( 'charset' ); ?>">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
19
+ <?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
20
+ <title>
21
+ <?php echo esc_html(wp_get_document_title()); ?>
22
+ </title>
23
+ <?php endif; ?>
24
+ <?php wp_head(); ?>
25
+ </head>
26
+
27
+ <body <?php body_class(); ?>>
28
+
29
+ <?php
30
+
31
+ do_action( 'wp_body_open' );
32
+
33
+ // Royal themes compatibility
34
+ echo '<div id="page-wrap">';
35
+
36
+ // Render WPR Header
37
+ Utilities::render_elementor_template($template_slug);
38
+
39
+ // Royal themes compatibility
40
  echo '<div class="page-content">';
admin/templates/views/theme-header.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- use WprAddons\Admin\Includes\WPR_Conditions_Manager;
3
- use WprAddons\Classes\Utilities;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
10
- $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
11
-
12
- ?>
13
-
14
- <!DOCTYPE html>
15
- <html <?php language_attributes(); ?>>
16
- <head>
17
- <meta charset="<?php bloginfo( 'charset' ); ?>">
18
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
19
- <?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
20
- <title>
21
- <?php echo esc_html(wp_get_document_title()); ?>
22
- </title>
23
- <?php endif; ?>
24
- <?php wp_head(); ?>
25
- </head>
26
-
27
- <body <?php body_class(); ?>>
28
-
29
- <?php
30
-
31
- do_action( 'wp_body_open' );
32
-
33
- // Render WPR Header
34
- Utilities::render_elementor_template($template_slug);
1
+ <?php
2
+ use WprAddons\Admin\Includes\WPR_Conditions_Manager;
3
+ use WprAddons\Classes\Utilities;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
10
+ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
11
+
12
+ ?>
13
+
14
+ <!DOCTYPE html>
15
+ <html <?php language_attributes(); ?>>
16
+ <head>
17
+ <meta charset="<?php bloginfo( 'charset' ); ?>">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
19
+ <?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
20
+ <title>
21
+ <?php echo esc_html(wp_get_document_title()); ?>
22
+ </title>
23
+ <?php endif; ?>
24
+ <?php wp_head(); ?>
25
+ </head>
26
+
27
+ <body <?php body_class(); ?>>
28
+
29
+ <?php
30
+
31
+ do_action( 'wp_body_open' );
32
+
33
+ // Render WPR Header
34
+ Utilities::render_elementor_template($template_slug);
admin/templates/wpr-templates-library-popups.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- namespace WprAddons\Admin\Templates;
3
- use WprAddons\Classes\Utilities;
4
- use WprAddons\Admin\Templates\WPR_Templates_Data;
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit; // Exit if accessed directly.
8
- }
9
-
10
- /**
11
- * WPR_Templates_Library_Popups setup
12
- *
13
- * @since 1.0
14
- */
15
- class WPR_Templates_Library_Popups {
16
-
17
- /**
18
- ** Constructor
19
- */
20
- public function __construct() {
21
-
22
- // Template Library Popup
23
- add_action( 'wp_ajax_render_library_templates_popups', [ $this, 'render_library_templates_popups' ] );
24
-
25
- }
26
-
27
- /**
28
- ** Template Library Popup
29
- */
30
- public function render_library_templates_popups() {
31
-
32
- ?>
33
-
34
- <div class="wpr-tplib-sidebar">
35
- <div class="wpr-tplib-search">
36
- <input type="text" placeholder="Search Template">
37
- <i class="eicon-search"></i>
38
- </div>
39
-
40
- <div class="wpr-tplib-filters-wrap">
41
- <div class="wpr-tplib-filters">
42
- <h3>
43
- <span><?php esc_html_e( 'Category', 'wpr-addons' ); ?></span>
44
- <i class="fas fa-angle-down"></i>
45
- </h3>
46
-
47
- <div class="wpr-tplib-filters-list">
48
- <ul>
49
- <li data-filter="all"><?php esc_html_e( 'All', 'wpr-addons' ) ?></li>
50
- <li data-filter="cookie"><?php esc_html_e( 'Cookie', 'wpr-addons' ) ?></li>
51
- <li data-filter="discount"><?php esc_html_e( 'Discount', 'wpr-addons' ) ?></li>
52
- <li data-filter="subscribe"><?php esc_html_e( 'Subscribe', 'wpr-addons' ) ?></li>
53
- <li data-filter="yesno"><?php esc_html_e( 'Yes/No', 'wpr-addons' ) ?></li>
54
- </ul>
55
- </div>
56
- </div>
57
- </div>
58
-
59
- </div>
60
-
61
- <div class="wpr-tplib-template-gird elementor-clearfix">
62
- <div class="wpr-tplib-template-gird-inner">
63
-
64
- <?php
65
-
66
- $popups = WPR_Templates_Data::get_available_popups();
67
-
68
- foreach ($popups as $type => $data) :
69
-
70
- for ( $i=0; $i < count($popups[$type]); $i++ ) :
71
-
72
- $template_slug = array_keys($popups[$type])[$i];
73
- $template_title = ucfirst($type) .' '. $template_slug;
74
- $preview_type = $popups[$type][$template_slug]['type'];
75
- $preview_url = $popups[$type][$template_slug]['url'];
76
- $template_class = ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) ? ' wpr-tplib-pro-wrap' : '';
77
-
78
- ?>
79
-
80
- <div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
81
- <div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($type); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
82
- <div class="wpr-tplib-template-media">
83
- <img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/popups/'. $type .'/'. $template_slug .'.jpg'); ?>">
84
- <div class="wpr-tplib-template-media-overlay">
85
- <i class="eicon-eye"></i>
86
- </div>
87
- </div>
88
- <div class="wpr-tplib-template-footer elementor-clearfix">
89
- <h3><?php echo esc_html(str_replace('-pro', ' Pro', $template_title)); ?></h3>
90
-
91
- <?php if ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) : ?>
92
- <span class="wpr-tplib-insert-template wpr-tplib-insert-pro"><i class="eicon-star"></i> <span><?php esc_html_e( 'Go Pro', 'wpr-addons' ); ?></span></span>
93
- <?php else : ?>
94
- <span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
95
- <?php endif; ?>
96
- </div>
97
- </div>
98
- </div>
99
-
100
- <?php endfor; ?>
101
- <?php endforeach; ?>
102
-
103
- </div>
104
- </div>
105
-
106
- <?php exit();
107
- }
108
-
109
  }
1
+ <?php
2
+ namespace WprAddons\Admin\Templates;
3
+ use WprAddons\Classes\Utilities;
4
+ use WprAddons\Admin\Templates\WPR_Templates_Data;
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+ /**
11
+ * WPR_Templates_Library_Popups setup
12
+ *
13
+ * @since 1.0
14
+ */
15
+ class WPR_Templates_Library_Popups {
16
+
17
+ /**
18
+ ** Constructor
19
+ */
20
+ public function __construct() {
21
+
22
+ // Template Library Popup
23
+ add_action( 'wp_ajax_render_library_templates_popups', [ $this, 'render_library_templates_popups' ] );
24
+
25
+ }
26
+
27
+ /**
28
+ ** Template Library Popup
29
+ */
30
+ public function render_library_templates_popups() {
31
+
32
+ ?>
33
+
34
+ <div class="wpr-tplib-sidebar">
35
+ <div class="wpr-tplib-search">
36
+ <input type="text" placeholder="Search Template">
37
+ <i class="eicon-search"></i>
38
+ </div>
39
+
40
+ <div class="wpr-tplib-filters-wrap">
41
+ <div class="wpr-tplib-filters">
42
+ <h3>
43
+ <span><?php esc_html_e( 'Category', 'wpr-addons' ); ?></span>
44
+ <i class="fas fa-angle-down"></i>
45
+ </h3>
46
+
47
+ <div class="wpr-tplib-filters-list">
48
+ <ul>
49
+ <li data-filter="all"><?php esc_html_e( 'All', 'wpr-addons' ) ?></li>
50
+ <li data-filter="cookie"><?php esc_html_e( 'Cookie', 'wpr-addons' ) ?></li>
51
+ <li data-filter="discount"><?php esc_html_e( 'Discount', 'wpr-addons' ) ?></li>
52
+ <li data-filter="subscribe"><?php esc_html_e( 'Subscribe', 'wpr-addons' ) ?></li>
53
+ <li data-filter="yesno"><?php esc_html_e( 'Yes/No', 'wpr-addons' ) ?></li>
54
+ </ul>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+ </div>
60
+
61
+ <div class="wpr-tplib-template-gird elementor-clearfix">
62
+ <div class="wpr-tplib-template-gird-inner">
63
+
64
+ <?php
65
+
66
+ $popups = WPR_Templates_Data::get_available_popups();
67
+
68
+ foreach ($popups as $type => $data) :
69
+
70
+ for ( $i=0; $i < count($popups[$type]); $i++ ) :
71
+
72
+ $template_slug = array_keys($popups[$type])[$i];
73
+ $template_title = ucfirst($type) .' '. $template_slug;
74
+ $preview_type = $popups[$type][$template_slug]['type'];
75
+ $preview_url = $popups[$type][$template_slug]['url'];
76
+ $template_class = ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) ? ' wpr-tplib-pro-wrap' : '';
77
+
78
+ ?>
79
+
80
+ <div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
81
+ <div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($type); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
82
+ <div class="wpr-tplib-template-media">
83
+ <img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/popups/'. $type .'/'. $template_slug .'.jpg'); ?>">
84
+ <div class="wpr-tplib-template-media-overlay">
85
+ <i class="eicon-eye"></i>
86
+ </div>
87
+ </div>
88
+ <div class="wpr-tplib-template-footer elementor-clearfix">
89
+ <h3><?php echo esc_html(str_replace('-pro', ' Pro', $template_title)); ?></h3>
90
+
91
+ <?php if ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) : ?>
92
+ <span class="wpr-tplib-insert-template wpr-tplib-insert-pro"><i class="eicon-star"></i> <span><?php esc_html_e( 'Go Pro', 'wpr-addons' ); ?></span></span>
93
+ <?php else : ?>
94
+ <span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
95
+ <?php endif; ?>
96
+ </div>
97
+ </div>
98
+ </div>
99
+
100
+ <?php endfor; ?>
101
+ <?php endforeach; ?>
102
+
103
+ </div>
104
+ </div>
105
+
106
+ <?php exit();
107
+ }
108
+
109
  }
admin/theme-builder.php CHANGED
@@ -1,134 +1,134 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly.
5
- }
6
-
7
- use WprAddons\Admin\Includes\WPR_Templates_Loop;
8
- use WprAddons\Classes\Utilities;
9
-
10
- // Register Menus
11
- function wpr_addons_add_theme_builder_menu() {
12
- add_submenu_page( 'wpr-addons', 'Theme Builder', 'Theme Builder', 'manage_options', 'wpr-theme-builder', 'wpr_addons_theme_builder_page' );
13
- }
14
- add_action( 'admin_menu', 'wpr_addons_add_theme_builder_menu' );
15
-
16
- function wpr_addons_theme_builder_page() {
17
-
18
- ?>
19
-
20
- <div class="wrap wpr-settings-page-wrap">
21
-
22
- <div class="wpr-settings-page-header">
23
- <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
24
- <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
25
-
26
- <!-- Custom Template -->
27
- <div class="wpr-preview-buttons">
28
- <div class="wpr-user-template">
29
- <span><?php esc_html_e( 'Create Template', 'wpr-addons' ); ?></span>
30
- <span class="plus-icon">+</span>
31
- </div>
32
-
33
- <a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
34
- <?php echo esc_html__( 'How to use Theme Builder', 'wpr-addons' ); ?>
35
- <span class="dashicons dashicons-video-alt3"></span>
36
- </a>
37
- </div>
38
- </div>
39
-
40
- <div class="wpr-settings-page">
41
- <form method="post" action="options.php">
42
- <?php
43
-
44
- // Active Tab
45
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
46
-
47
- ?>
48
-
49
- <!-- Template ID Holder -->
50
- <input type="hidden" name="wpr_template" id="wpr_template" value="">
51
-
52
- <!-- Conditions Popup -->
53
- <?php WPR_Templates_Loop::render_conditions_popup(true); ?>
54
-
55
- <!-- Create Templte Popup -->
56
- <?php WPR_Templates_Loop::render_create_template_popup(); ?>
57
-
58
- <!-- Tabs -->
59
- <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
60
- <a href="?page=wpr-theme-builder&tab=wpr_tab_header" data-title="Header" class="nav-tab <?php echo ($active_tab == 'wpr_tab_header') ? 'nav-tab-active' : ''; ?>">
61
- <?php esc_html_e( 'Header', 'wpr-addons' ); ?>
62
- </a>
63
- <a href="?page=wpr-theme-builder&tab=wpr_tab_footer" data-title="Footer" class="nav-tab <?php echo ($active_tab == 'wpr_tab_footer') ? 'nav-tab-active' : ''; ?>">
64
- <?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
65
- </a>
66
- <a href="?page=wpr-theme-builder&tab=wpr_tab_archive" data-title="Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_archive') ? 'nav-tab-active' : ''; ?>">
67
- <?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
68
- </a>
69
- <a href="?page=wpr-theme-builder&tab=wpr_tab_single" data-title="Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_single') ? 'nav-tab-active' : ''; ?>">
70
- <?php esc_html_e( 'Single', 'wpr-addons' ); ?>
71
- </a>
72
- <a href="?page=wpr-theme-builder&tab=wpr_tab_my_templates" data-title="My Templates" class="nav-tab <?php echo ($active_tab == 'wpr_tab_my_templates') ? 'nav-tab-active' : ''; ?>">
73
- <?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
74
- </a>
75
-
76
- <a href="?page=wpr-theme-builder&tab=wpr_tab_product_archive" data-title="Product Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_archive') ? 'nav-tab-active' : ''; ?>">
77
- <?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
78
- </a>
79
- <a href="?page=wpr-theme-builder&tab=wpr_tab_product_single" data-title="Product Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_single') ? 'nav-tab-active' : ''; ?>">
80
- <?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
81
- </a>
82
- </div>
83
-
84
- <?php if ( $active_tab == 'wpr_tab_header' ) : ?>
85
-
86
- <!-- Save Conditions -->
87
- <input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
88
-
89
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
90
-
91
- <?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
92
-
93
- <!-- Save Conditions -->
94
- <input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
95
-
96
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
97
-
98
- <?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
99
-
100
- <!-- Save Conditions -->
101
- <input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
102
-
103
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
104
-
105
- <?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
106
-
107
- <!-- Save Conditions -->
108
- <input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
109
-
110
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
111
-
112
- <?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
113
-
114
- <?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
115
-
116
- <?php elseif ( $active_tab == 'wpr_tab_product_archive' || $active_tab == 'wpr_tab_product_single' ) : ?>
117
- <div class="wpr-coming-soon">
118
- <div>
119
- <h3>WooCommerce is Comming Soon!</h3>
120
- <p><strong>WooCommerce Builder</strong> and <strong>Templates Kit</strong> (Premade Sites) will be available very soon. You will be able to style and modify any part of WooCommerce Pages with the most advanced options available on the market. </p>
121
- </div>
122
- <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/woo-coming-soon.jpg'); ?>" alt="">
123
- </div>
124
- <?php endif; ?>
125
-
126
- </form>
127
- </div>
128
-
129
- </div>
130
-
131
-
132
- <?php
133
-
134
  } // End wpr_addons_theme_builder_page()
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
+ }
6
+
7
+ use WprAddons\Admin\Includes\WPR_Templates_Loop;
8
+ use WprAddons\Classes\Utilities;
9
+
10
+ // Register Menus
11
+ function wpr_addons_add_theme_builder_menu() {
12
+ add_submenu_page( 'wpr-addons', 'Theme Builder', 'Theme Builder', 'manage_options', 'wpr-theme-builder', 'wpr_addons_theme_builder_page' );
13
+ }
14
+ add_action( 'admin_menu', 'wpr_addons_add_theme_builder_menu' );
15
+
16
+ function wpr_addons_theme_builder_page() {
17
+
18
+ ?>
19
+
20
+ <div class="wrap wpr-settings-page-wrap">
21
+
22
+ <div class="wpr-settings-page-header">
23
+ <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
24
+ <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
25
+
26
+ <!-- Custom Template -->
27
+ <div class="wpr-preview-buttons">
28
+ <div class="wpr-user-template">
29
+ <span><?php esc_html_e( 'Create Template', 'wpr-addons' ); ?></span>
30
+ <span class="plus-icon">+</span>
31
+ </div>
32
+
33
+ <a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
34
+ <?php echo esc_html__( 'How to use Theme Builder', 'wpr-addons' ); ?>
35
+ <span class="dashicons dashicons-video-alt3"></span>
36
+ </a>
37
+ </div>
38
+ </div>
39
+
40
+ <div class="wpr-settings-page">
41
+ <form method="post" action="options.php">
42
+ <?php
43
+
44
+ // Active Tab
45
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
46
+
47
+ ?>
48
+
49
+ <!-- Template ID Holder -->
50
+ <input type="hidden" name="wpr_template" id="wpr_template" value="">
51
+
52
+ <!-- Conditions Popup -->
53
+ <?php WPR_Templates_Loop::render_conditions_popup(true); ?>
54
+
55
+ <!-- Create Templte Popup -->
56
+ <?php WPR_Templates_Loop::render_create_template_popup(); ?>
57
+
58
+ <!-- Tabs -->
59
+ <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
60
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_header" data-title="Header" class="nav-tab <?php echo ($active_tab == 'wpr_tab_header') ? 'nav-tab-active' : ''; ?>">
61
+ <?php esc_html_e( 'Header', 'wpr-addons' ); ?>
62
+ </a>
63
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_footer" data-title="Footer" class="nav-tab <?php echo ($active_tab == 'wpr_tab_footer') ? 'nav-tab-active' : ''; ?>">
64
+ <?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
65
+ </a>
66
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_archive" data-title="Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_archive') ? 'nav-tab-active' : ''; ?>">
67
+ <?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
68
+ </a>
69
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_single" data-title="Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_single') ? 'nav-tab-active' : ''; ?>">
70
+ <?php esc_html_e( 'Single', 'wpr-addons' ); ?>
71
+ </a>
72
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_my_templates" data-title="My Templates" class="nav-tab <?php echo ($active_tab == 'wpr_tab_my_templates') ? 'nav-tab-active' : ''; ?>">
73
+ <?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
74
+ </a>
75
+
76
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_product_archive" data-title="Product Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_archive') ? 'nav-tab-active' : ''; ?>">
77
+ <?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
78
+ </a>
79
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_product_single" data-title="Product Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_single') ? 'nav-tab-active' : ''; ?>">
80
+ <?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
81
+ </a>
82
+ </div>
83
+
84
+ <?php if ( $active_tab == 'wpr_tab_header' ) : ?>
85
+
86
+ <!-- Save Conditions -->
87
+ <input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
88
+
89
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
90
+
91
+ <?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
92
+
93
+ <!-- Save Conditions -->
94
+ <input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
95
+
96
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
97
+
98
+ <?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
99
+
100
+ <!-- Save Conditions -->
101
+ <input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
102
+
103
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
104
+
105
+ <?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
106
+
107
+ <!-- Save Conditions -->
108
+ <input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
109
+
110
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
111
+
112
+ <?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
113
+
114
+ <?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
115
+
116
+ <?php elseif ( $active_tab == 'wpr_tab_product_archive' || $active_tab == 'wpr_tab_product_single' ) : ?>
117
+ <div class="wpr-coming-soon">
118
+ <div>
119
+ <h3>WooCommerce is Comming Soon!</h3>
120
+ <p><strong>WooCommerce Builder</strong> and <strong>Templates Kit</strong> (Premade Sites) will be available very soon. You will be able to style and modify any part of WooCommerce Pages with the most advanced options available on the market. </p>
121
+ </div>
122
+ <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/woo-coming-soon.jpg'); ?>" alt="">
123
+ </div>
124
+ <?php endif; ?>
125
+
126
+ </form>
127
+ </div>
128
+
129
+ </div>
130
+
131
+
132
+ <?php
133
+
134
  } // End wpr_addons_theme_builder_page()
assets/css/admin/premade-blocks.css CHANGED
@@ -1,437 +1,437 @@
1
- #wpcontent {
2
- padding: 0;
3
- }
4
-
5
- .wpr-settings-page-header {
6
- padding: 10px 30px 30px;
7
- }
8
-
9
- .wpr-settings-page-header h1 {
10
- font-size: 42px;
11
- }
12
-
13
- .wpr-settings-page-header p {
14
- margin-top: 5px;
15
- color: #5a5a5a;
16
- font-size: 16px;
17
- margin-bottom: 30px;
18
- }
19
-
20
- .wpr-premade-blocks-tutorial {
21
- display: inline-block;
22
- margin-left: 45px;
23
- padding: 9px 25px;
24
- border: 0;
25
- color: #fff;
26
- background: #6A4BFF;
27
- -webkit-box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
28
- box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
29
- font-size: 14px;
30
- text-decoration: none;
31
- border-radius: 3px;
32
- }
33
-
34
- .wpr-premade-blocks-tutorial:hover,
35
- .wpr-premade-blocks-tutorial:focus {
36
- color: #fff;
37
- background: #5a39fb;
38
- }
39
-
40
- .wpr-tplib-content-wrap {
41
- }
42
-
43
- .wpr-tplib-sidebar {
44
- padding: 30px;
45
- display: -webkit-box;
46
- display: -ms-flexbox;
47
- display: flex;
48
- }
49
-
50
- .wpr-tplib-sidebar .wpr-tplib-search {
51
- display: none;
52
- position: relative;
53
- margin: 30px 0;
54
- }
55
-
56
- .wpr-tplib-sidebar .wpr-tplib-search i {
57
- position: absolute;
58
- top: 50%;
59
- right: 10px;
60
- font-size: 12px;
61
- -webkit-transform: translateY(-50%);
62
- -ms-transform: translateY(-50%);
63
- transform: translateY(-50%);
64
- }
65
-
66
- .wpr-tplib-sidebar .wpr-tplib-search input {
67
- width: 100%;
68
- padding: 8px 10px;
69
- border: 0;
70
- border-bottom: 1px solid #efefef;
71
- }
72
-
73
- .wpr-tplib-sidebar .wpr-tplib-search input::-webkit-input-placeholder {
74
- color: #9a9a9a;
75
- }
76
-
77
- .wpr-tplib-sidebar .wpr-tplib-search input::-moz-placeholder {
78
- color: #9a9a9a;
79
- }
80
-
81
- .wpr-tplib-sidebar .wpr-tplib-search input:-ms-input-placeholder {
82
- color: #9a9a9a;
83
- }
84
-
85
- .wpr-tplib-sidebar .wpr-tplib-search input::-ms-input-placeholder {
86
- color: #9a9a9a;
87
- }
88
-
89
- .wpr-tplib-sidebar .wpr-tplib-search input::placeholder {
90
- color: #9a9a9a;
91
- }
92
-
93
- .wpr-tplib-filters-wrap {
94
- display: -webkit-box;
95
- display: -ms-flexbox;
96
- display: flex;
97
- }
98
-
99
- .wpr-tplib-sub-filters {
100
- display: none;
101
- margin-left: 20px;
102
- }
103
-
104
- .wpr-tplib-sub-filters ul {
105
- display: -webkit-box;
106
- display: -ms-flexbox;
107
- display: flex;
108
- }
109
-
110
- .wpr-tplib-sub-filters ul li {
111
- padding: 10px 25px;
112
- margin-right: 7px;
113
- line-height: 15px;
114
- font-size: 13px;
115
- font-weight: normal;
116
- background: #fff;
117
- -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
118
- box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
119
- cursor: pointer;
120
- border-radius: 3px;
121
- }
122
-
123
- .wpr-tplib-sub-filters ul li:hover,
124
- .wpr-tplib-sub-filters ul .wpr-tplib-activ-filter {
125
- background: #6A4BFF;
126
- color: #fff;
127
- }
128
-
129
- .wpr-tplib-filters {
130
- -webkit-box-sizing: border-box;
131
- box-sizing: border-box;
132
- display: -webkit-box;
133
- display: -ms-flexbox;
134
- display: flex;
135
- -webkit-box-orient: vertical;
136
- -webkit-box-direction: normal;
137
- -ms-flex-direction: column;
138
- flex-direction: column;
139
- -webkit-box-align: start;
140
- -ms-flex-align: start;
141
- align-items: flex-start;
142
- position: relative;
143
- width: 200px;
144
- font-size: 14px;
145
- font-weight: normal;
146
- font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
147
- color: #6d7882;
148
- }
149
-
150
- .wpr-tplib-filters h3 {
151
- display: -webkit-box;
152
- display: -ms-flexbox;
153
- display: flex;
154
- width: 100%;
155
- padding: 10px 15px;
156
- margin: 0;
157
- font-size: 13px;
158
- font-weight: normal;
159
- font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
160
- background: #fff;
161
- -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
162
- box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
163
- cursor: pointer;
164
- border-radius: 3px;
165
- }
166
-
167
- .wpr-tplib-filters h3 span {
168
- width: 100%;
169
- }
170
-
171
- .wpr-tplib-filters h3 i.fa-angle-down:before {
172
- content: "\f347";
173
- font-family: dashicons;
174
- line-height: 18px;
175
- font-weight: 400;
176
- font-style: normal;
177
- speak: never;
178
- text-decoration: inherit;
179
- text-transform: none;
180
- text-rendering: auto;
181
- -webkit-font-smoothing: antialiased;
182
- -moz-osx-font-smoothing: grayscale;
183
- font-size: 15px;
184
- vertical-align: top;
185
- text-align: center;
186
- }
187
-
188
- .wpr-tplib-filters-list {
189
- visibility: hidden;
190
- opacity: 0;
191
- position: absolute;
192
- top: 38px;
193
- z-index: 999;
194
- width: 700px;
195
- padding: 20px 30px;
196
- background: #fff;
197
- -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
198
- box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
199
- -webkit-transition: all 0.2s ease-in;
200
- -o-transition: all 0.2s ease-in;
201
- transition: all 0.2s ease-in;
202
- border-radius: 3px;
203
- }
204
-
205
- .wpr-tplib-filters-list ul {
206
- display: -webkit-box;
207
- display: -ms-flexbox;
208
- display: flex;
209
- -ms-flex-wrap: wrap;
210
- flex-wrap: wrap;
211
- margin-top: 0;
212
- }
213
-
214
- .wpr-tplib-filters-list ul li {
215
- -webkit-box-sizing: border-box;
216
- box-sizing: border-box;
217
- width: 25%;
218
- padding: 12px;
219
- color: #6d7882;
220
- background: #fff;
221
- font-size: 13px;
222
- line-height: 1;
223
- cursor: pointer;
224
- }
225
-
226
- .wpr-tplib-filters-list ul li:hover {
227
- background: #f9f9f9;
228
- color: #222;
229
- }
230
-
231
- .wpr-tplib-template-gird {
232
- overflow: auto;
233
- margin-left: -10px;
234
- padding: 0 30px;
235
- }
236
-
237
- .elementor-clearfix:after {
238
- content: '';
239
- display: block;
240
- clear: both;
241
- width: 0;
242
- height: 0;
243
- }
244
-
245
- .wpr-tplib-template-wrap {
246
- position: relative;
247
- float: left;
248
- overflow: hidden;
249
- width: 18.5%;
250
- margin: 10px;
251
- border-radius: 3px;
252
- -webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
253
- box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
254
- }
255
-
256
- .wpr-tplib-template-wrap:not(.wpr-tplib-pro-active):before {
257
- content: 'Free';
258
- display: block;
259
- position: absolute;
260
- top: 10px;
261
- right: 10px;
262
- z-index: 1;
263
- width: 45px;
264
- padding: 4px;
265
- font-size: 11px;
266
- font-weight: bold;
267
- letter-spacing: 0.3px;
268
- text-transform: uppercase;
269
- text-align: center;
270
- background: #555;
271
- color: #fff;
272
- -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
273
- box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
274
- border-radius: 3px;
275
- }
276
-
277
- .wpr-tplib-pro-wrap:not(.wpr-tplib-pro-active):before {
278
- content: 'Pro';
279
- background: #6A4BFF;
280
- }
281
-
282
- @media screen and ( max-width: 1364px ) {
283
- .wpr-tplib-template-wrap {
284
- width: 23%;
285
- }
286
- }
287
-
288
- .wpr-tplib-template {
289
- }
290
-
291
- .wpr-tplib-insert-template:not(.wpr-tplib-insert-pro) {
292
- display: none;
293
- }
294
-
295
- .wpr-tplib-template-wrap:hover .wpr-tplib-insert-pro {
296
- opacity: 1;
297
- visibility: visible;
298
- }
299
-
300
- .wpr-tplib-template-media {
301
- position: relative;
302
- background-color: #e8e8e8;
303
- }
304
-
305
- .wpr-tplib-template-media img {
306
- display: block;
307
- width: 100%;
308
- max-width: 100%;
309
- height: auto;
310
- }
311
-
312
- .wpr-tplib-template-media:hover .wpr-tplib-template-media-overlay {
313
- opacity: 1;
314
- }
315
-
316
- .wpr-tplib-template-media-overlay {
317
- opacity: 0;
318
- position: absolute;
319
- top: 0;
320
- left: 0;
321
- width: 100%;
322
- height: 100%;
323
- background-color: rgba(0, 0, 0, 0.5);
324
- color: #fff;
325
- cursor: pointer;
326
- -webkit-transition: opacity 0.1s ease-in;
327
- -o-transition: opacity 0.1s ease-in;
328
- transition: opacity 0.1s ease-in;
329
- }
330
-
331
- .wpr-tplib-template-media-overlay i {
332
- position: absolute;
333
- top: 50%;
334
- left: 50%;
335
- -webkit-transform: translate(-50%, -50%);
336
- -ms-transform: translate(-50%, -50%);
337
- transform: translate(-50%, -50%);
338
- font-size: 25px;
339
- }
340
-
341
- .wpr-tplib-preview-wrap {
342
- display: none;
343
- }
344
-
345
- .wpr-tplib-image {
346
- display: -webkit-box;
347
- display: -ms-flexbox;
348
- display: flex;
349
- -webkit-box-pack: center;
350
- -ms-flex-pack: center;
351
- justify-content: center;
352
- padding: 20px;
353
- }
354
-
355
- .wpr-tplib-iframe {
356
- position: relative;
357
- padding-top: 56.25%;
358
- }
359
-
360
- .wpr-tplib-iframe iframe {
361
- position: absolute;
362
- top: 0;
363
- left: 0;
364
- width: 100%;
365
- height: 100%;
366
- border: none;
367
- }
368
-
369
- .wpr-tplib-template-footer {
370
- display: -webkit-box;
371
- display: -ms-flexbox;
372
- display: flex;
373
- -webkit-box-orient: vertical;
374
- -webkit-box-direction: normal;
375
- -ms-flex-flow: column wrap;
376
- flex-flow: column wrap;
377
- -ms-flex-line-pack: justify;
378
- align-content: space-between;
379
- -webkit-box-pack: center;
380
- -ms-flex-pack: center;
381
- justify-content: center;
382
- height: 45px;
383
- padding: 5px 15px;
384
- background-color: #fff;
385
- border-top: 1px solid #efefef;
386
- }
387
-
388
- .wpr-tplib-template-footer h3 {
389
- overflow: hidden;
390
- color: #6d7882;
391
- font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
392
- font-size: 13px;
393
- font-weight: normal;
394
- white-space: nowrap;
395
- -o-text-overflow: ellipsis;
396
- text-overflow: ellipsis;
397
- }
398
-
399
- .wpr-tplib-template-footer .wpr-tplib-insert-template {
400
- opacity: 0;
401
- visibility: hidden;
402
- padding: 6px 10px;
403
- color: #fff;
404
- background-color: #6A4BFF;
405
- font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
406
- font-size: 13px;
407
- line-height: 1;
408
- letter-spacing: 0.3px;
409
- border-radius: 3px;
410
- cursor: pointer;
411
- -webkit-transition: all 0.1s ease-in;
412
- -o-transition: all 0.1s ease-in;
413
- transition: all 0.1s ease-in;
414
- }
415
-
416
-
417
- #masonry-effect {
418
- display: -webkit-box;
419
- display: -ms-flexbox;
420
- display: flex;
421
- -webkit-box-orient: horizontal;
422
- -webkit-box-direction: normal;
423
- -ms-flex-direction: row;
424
- flex-direction: row;
425
- -ms-flex-wrap: wrap;
426
- flex-wrap: wrap;
427
- }
428
- .item {
429
- -webkit-box-sizing: border-box;
430
- box-sizing: border-box;
431
- -webkit-box-orient: vertical;
432
- -webkit-box-direction: normal;
433
- -ms-flex-direction: column;
434
- flex-direction: column;
435
- position: relative;
436
- width: calc(33.3%);
437
  }
1
+ #wpcontent {
2
+ padding: 0;
3
+ }
4
+
5
+ .wpr-settings-page-header {
6
+ padding: 10px 30px 30px;
7
+ }
8
+
9
+ .wpr-settings-page-header h1 {
10
+ font-size: 42px;
11
+ }
12
+
13
+ .wpr-settings-page-header p {
14
+ margin-top: 5px;
15
+ color: #5a5a5a;
16
+ font-size: 16px;
17
+ margin-bottom: 30px;
18
+ }
19
+
20
+ .wpr-premade-blocks-tutorial {
21
+ display: inline-block;
22
+ margin-left: 45px;
23
+ padding: 9px 25px;
24
+ border: 0;
25
+ color: #fff;
26
+ background: #6A4BFF;
27
+ -webkit-box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
28
+ box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
29
+ font-size: 14px;
30
+ text-decoration: none;
31
+ border-radius: 3px;
32
+ }
33
+
34
+ .wpr-premade-blocks-tutorial:hover,
35
+ .wpr-premade-blocks-tutorial:focus {
36
+ color: #fff;
37
+ background: #5a39fb;
38
+ }
39
+
40
+ .wpr-tplib-content-wrap {
41
+ }
42
+
43
+ .wpr-tplib-sidebar {
44
+ padding: 30px;
45
+ display: -webkit-box;
46
+ display: -ms-flexbox;
47
+ display: flex;
48
+ }
49
+
50
+ .wpr-tplib-sidebar .wpr-tplib-search {
51
+ display: none;
52
+ position: relative;
53
+ margin: 30px 0;
54
+ }
55
+
56
+ .wpr-tplib-sidebar .wpr-tplib-search i {
57
+ position: absolute;
58
+ top: 50%;
59
+ right: 10px;
60
+ font-size: 12px;
61
+ -webkit-transform: translateY(-50%);
62
+ -ms-transform: translateY(-50%);
63
+ transform: translateY(-50%);
64
+ }
65
+
66
+ .wpr-tplib-sidebar .wpr-tplib-search input {
67
+ width: 100%;
68
+ padding: 8px 10px;
69
+ border: 0;
70
+ border-bottom: 1px solid #efefef;
71
+ }
72
+
73
+ .wpr-tplib-sidebar .wpr-tplib-search input::-webkit-input-placeholder {
74
+ color: #9a9a9a;
75
+ }
76
+
77
+ .wpr-tplib-sidebar .wpr-tplib-search input::-moz-placeholder {
78
+ color: #9a9a9a;
79
+ }
80
+
81
+ .wpr-tplib-sidebar .wpr-tplib-search input:-ms-input-placeholder {
82
+ color: #9a9a9a;
83
+ }
84
+
85
+ .wpr-tplib-sidebar .wpr-tplib-search input::-ms-input-placeholder {
86
+ color: #9a9a9a;
87
+ }
88
+
89
+ .wpr-tplib-sidebar .wpr-tplib-search input::placeholder {
90
+ color: #9a9a9a;
91
+ }
92
+
93
+ .wpr-tplib-filters-wrap {
94
+ display: -webkit-box;
95
+ display: -ms-flexbox;
96
+ display: flex;
97
+ }
98
+
99
+ .wpr-tplib-sub-filters {
100
+ display: none;
101
+ margin-left: 20px;
102
+ }
103
+
104
+ .wpr-tplib-sub-filters ul {
105
+ display: -webkit-box;
106
+ display: -ms-flexbox;
107
+ display: flex;
108
+ }
109
+
110
+ .wpr-tplib-sub-filters ul li {
111
+ padding: 10px 25px;
112
+ margin-right: 7px;
113
+ line-height: 15px;
114
+ font-size: 13px;
115
+ font-weight: normal;
116
+ background: #fff;
117
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
118
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
119
+ cursor: pointer;
120
+ border-radius: 3px;
121
+ }
122
+
123
+ .wpr-tplib-sub-filters ul li:hover,
124
+ .wpr-tplib-sub-filters ul .wpr-tplib-activ-filter {
125
+ background: #6A4BFF;
126
+ color: #fff;
127
+ }
128
+
129
+ .wpr-tplib-filters {
130
+ -webkit-box-sizing: border-box;
131
+ box-sizing: border-box;
132
+ display: -webkit-box;
133
+ display: -ms-flexbox;
134
+ display: flex;
135
+ -webkit-box-orient: vertical;
136
+ -webkit-box-direction: normal;
137
+ -ms-flex-direction: column;
138
+ flex-direction: column;
139
+ -webkit-box-align: start;
140
+ -ms-flex-align: start;
141
+ align-items: flex-start;
142
+ position: relative;
143
+ width: 200px;
144
+ font-size: 14px;
145
+ font-weight: normal;
146
+ font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
147
+ color: #6d7882;
148
+ }
149
+
150
+ .wpr-tplib-filters h3 {
151
+ display: -webkit-box;
152
+ display: -ms-flexbox;
153
+ display: flex;
154
+ width: 100%;
155
+ padding: 10px 15px;
156
+ margin: 0;
157
+ font-size: 13px;
158
+ font-weight: normal;
159
+ font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
160
+ background: #fff;
161
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
162
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
163
+ cursor: pointer;
164
+ border-radius: 3px;
165
+ }
166
+
167
+ .wpr-tplib-filters h3 span {
168
+ width: 100%;
169
+ }
170
+
171
+ .wpr-tplib-filters h3 i.fa-angle-down:before {
172
+ content: "\f347";
173
+ font-family: dashicons;
174
+ line-height: 18px;
175
+ font-weight: 400;
176
+ font-style: normal;
177
+ speak: never;
178
+ text-decoration: inherit;
179
+ text-transform: none;
180
+ text-rendering: auto;
181
+ -webkit-font-smoothing: antialiased;
182
+ -moz-osx-font-smoothing: grayscale;
183
+ font-size: 15px;
184
+ vertical-align: top;
185
+ text-align: center;
186
+ }
187
+
188
+ .wpr-tplib-filters-list {
189
+ visibility: hidden;
190
+ opacity: 0;
191
+ position: absolute;
192
+ top: 38px;
193
+ z-index: 999;
194
+ width: 700px;
195
+ padding: 20px 30px;
196
+ background: #fff;
197
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
198
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
199
+ -webkit-transition: all 0.2s ease-in;
200
+ -o-transition: all 0.2s ease-in;
201
+ transition: all 0.2s ease-in;
202
+ border-radius: 3px;
203
+ }
204
+
205
+ .wpr-tplib-filters-list ul {
206
+ display: -webkit-box;
207
+ display: -ms-flexbox;
208
+ display: flex;
209
+ -ms-flex-wrap: wrap;
210
+ flex-wrap: wrap;
211
+ margin-top: 0;
212
+ }
213
+
214
+ .wpr-tplib-filters-list ul li {
215
+ -webkit-box-sizing: border-box;
216
+ box-sizing: border-box;
217
+ width: 25%;
218
+ padding: 12px;
219
+ color: #6d7882;
220
+ background: #fff;
221
+ font-size: 13px;
222
+ line-height: 1;
223
+ cursor: pointer;
224
+ }
225
+
226
+ .wpr-tplib-filters-list ul li:hover {
227
+ background: #f9f9f9;
228
+ color: #222;
229
+ }
230
+
231
+ .wpr-tplib-template-gird {
232
+ overflow: auto;
233
+ margin-left: -10px;
234
+ padding: 0 30px;
235
+ }
236
+
237
+ .elementor-clearfix:after {
238
+ content: '';
239
+ display: block;
240
+ clear: both;
241
+ width: 0;
242
+ height: 0;
243
+ }
244
+
245
+ .wpr-tplib-template-wrap {
246
+ position: relative;
247
+ float: left;
248
+ overflow: hidden;
249
+ width: 18.5%;
250
+ margin: 10px;
251
+ border-radius: 3px;
252
+ -webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
253
+ box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
254
+ }
255
+
256
+ .wpr-tplib-template-wrap:not(.wpr-tplib-pro-active):before {
257
+ content: 'Free';
258
+ display: block;
259
+ position: absolute;
260
+ top: 10px;
261
+ right: 10px;
262
+ z-index: 1;
263
+ width: 45px;
264
+ padding: 4px;
265
+ font-size: 11px;
266
+ font-weight: bold;
267
+ letter-spacing: 0.3px;
268
+ text-transform: uppercase;
269
+ text-align: center;
270
+ background: #555;
271
+ color: #fff;
272
+ -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
273
+ box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
274
+ border-radius: 3px;
275
+ }
276
+
277
+ .wpr-tplib-pro-wrap:not(.wpr-tplib-pro-active):before {
278
+ content: 'Pro';
279
+ background: #6A4BFF;
280
+ }
281
+
282
+ @media screen and ( max-width: 1364px ) {
283
+ .wpr-tplib-template-wrap {
284
+ width: 23%;
285
+ }
286
+ }
287
+
288
+ .wpr-tplib-template {
289
+ }
290
+
291
+ .wpr-tplib-insert-template:not(.wpr-tplib-insert-pro) {
292
+ display: none;
293
+ }
294
+
295
+ .wpr-tplib-template-wrap:hover .wpr-tplib-insert-pro {
296
+ opacity: 1;
297
+ visibility: visible;
298
+ }
299
+
300
+ .wpr-tplib-template-media {
301
+ position: relative;
302
+ background-color: #e8e8e8;
303
+ }
304
+
305
+ .wpr-tplib-template-media img {
306
+ display: block;
307
+ width: 100%;
308
+ max-width: 100%;
309
+ height: auto;
310
+ }
311
+
312
+ .wpr-tplib-template-media:hover .wpr-tplib-template-media-overlay {
313
+ opacity: 1;
314
+ }
315
+
316
+ .wpr-tplib-template-media-overlay {
317
+ opacity: 0;
318
+ position: absolute;
319
+ top: 0;
320
+ left: 0;
321
+ width: 100%;
322
+ height: 100%;
323
+ background-color: rgba(0, 0, 0, 0.5);
324
+ color: #fff;
325
+ cursor: pointer;
326
+ -webkit-transition: opacity 0.1s ease-in;
327
+ -o-transition: opacity 0.1s ease-in;
328
+ transition: opacity 0.1s ease-in;
329
+ }
330
+
331
+ .wpr-tplib-template-media-overlay i {
332
+ position: absolute;
333
+ top: 50%;
334
+ left: 50%;
335
+ -webkit-transform: translate(-50%, -50%);
336
+ -ms-transform: translate(-50%, -50%);
337
+ transform: translate(-50%, -50%);
338
+ font-size: 25px;
339
+ }
340
+
341
+ .wpr-tplib-preview-wrap {
342
+ display: none;
343
+ }
344
+
345
+ .wpr-tplib-image {
346
+ display: -webkit-box;
347
+ display: -ms-flexbox;
348
+ display: flex;
349
+ -webkit-box-pack: center;
350
+ -ms-flex-pack: center;
351
+ justify-content: center;
352
+ padding: 20px;
353
+ }
354
+
355
+ .wpr-tplib-iframe {
356
+ position: relative;
357
+ padding-top: 56.25%;
358
+ }
359
+
360
+ .wpr-tplib-iframe iframe {
361
+ position: absolute;
362
+ top: 0;
363
+ left: 0;
364
+ width: 100%;
365
+ height: 100%;
366
+ border: none;
367
+ }
368
+
369
+ .wpr-tplib-template-footer {
370
+ display: -webkit-box;
371
+ display: -ms-flexbox;
372
+ display: flex;
373
+ -webkit-box-orient: vertical;
374
+ -webkit-box-direction: normal;
375
+ -ms-flex-flow: column wrap;
376
+ flex-flow: column wrap;
377
+ -ms-flex-line-pack: justify;
378
+ align-content: space-between;
379
+ -webkit-box-pack: center;
380
+ -ms-flex-pack: center;
381
+ justify-content: center;
382
+ height: 45px;
383
+ padding: 5px 15px;
384
+ background-color: #fff;
385
+ border-top: 1px solid #efefef;
386
+ }
387
+
388
+ .wpr-tplib-template-footer h3 {
389
+ overflow: hidden;
390
+ color: #6d7882;
391
+ font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
392
+ font-size: 13px;
393
+ font-weight: normal;
394
+ white-space: nowrap;
395
+ -o-text-overflow: ellipsis;
396
+ text-overflow: ellipsis;
397
+ }
398
+
399
+ .wpr-tplib-template-footer .wpr-tplib-insert-template {
400
+ opacity: 0;
401
+ visibility: hidden;
402
+ padding: 6px 10px;
403
+ color: #fff;
404
+ background-color: #6A4BFF;
405
+ font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
406
+ font-size: 13px;
407
+ line-height: 1;
408
+ letter-spacing: 0.3px;
409
+ border-radius: 3px;
410
+ cursor: pointer;
411
+ -webkit-transition: all 0.1s ease-in;
412
+ -o-transition: all 0.1s ease-in;
413
+ transition: all 0.1s ease-in;
414
+ }
415
+
416
+
417
+ #masonry-effect {
418
+ display: -webkit-box;
419
+ display: -ms-flexbox;
420
+ display: flex;
421
+ -webkit-box-orient: horizontal;
422
+ -webkit-box-direction: normal;
423
+ -ms-flex-direction: row;
424
+ flex-direction: row;
425
+ -ms-flex-wrap: wrap;
426
+ flex-wrap: wrap;
427
+ }
428
+ .item {
429
+ -webkit-box-sizing: border-box;
430
+ box-sizing: border-box;
431
+ -webkit-box-orient: vertical;
432
+ -webkit-box-direction: normal;
433
+ -ms-flex-direction: column;
434
+ flex-direction: column;
435
+ position: relative;
436
+ width: calc(33.3%);
437
  }
assets/css/editor.css CHANGED
@@ -1,761 +1,761 @@
1
- /*--------------------------------------------------------------
2
- == General
3
- --------------------------------------------------------------*/
4
- .wpr-elementor-hidden-control {
5
- overflow: hidden;
6
- width: 0 !important;
7
- height: 0 !important;
8
- padding: 0 !important;
9
- margin: 0 !important;
10
- visibility: hidden !important;
11
- opacity: 0 !important;
12
- }
13
-
14
-
15
- /*--------------------------------------------------------------
16
- == WPR Widgets
17
- --------------------------------------------------------------*/
18
- .elementor-panel .wpr-icon:after {
19
- content: 'R';
20
- display: block;
21
- position: absolute;
22
- top: 3px;
23
- right: 3px;
24
- font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
25
- font-size: 10px;
26
- font-weight: bold;
27
- color: #ffffff;
28
- background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
29
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
30
- background-image: linear-gradient(#6A4BFF, #7E94FE);
31
- -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
32
- box-shadow: 0 0 2px 2px #b8c7ff;
33
- width: 19px;
34
- height: 19px;
35
- line-height: 19px;
36
- border-radius: 15px;
37
- margin: 3px;
38
- }
39
-
40
- .elementor-panel .elementor-element .icon {
41
- position: relative !important;
42
- }
43
-
44
- .elementor-control-type-section[class*="elementor-control-wpr_section_"]:after {
45
- content: 'R';
46
- display: block;
47
- position: absolute;
48
- top: 7px;
49
- right: 7px;
50
- font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
51
- font-size: 10px;
52
- font-weight: bold;
53
- color: #ffffff;
54
- background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
55
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
56
- background-image: linear-gradient(#6A4BFF, #7E94FE);
57
- -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
58
- box-shadow: 0 0 2px 2px #b8c7ff;
59
- width: 19px;
60
- height: 19px;
61
- line-height: 19px;
62
- border-radius: 15px;
63
- margin: 3px;
64
- text-align: center;
65
- }
66
-
67
- /*--------------------------------------------------------------
68
- == Adjustments
69
- --------------------------------------------------------------*/
70
- .elementor-control-element_select,
71
- .elementor-control-element_align_hr,
72
- .elementor-control-element_read_more_text,
73
- .elementor-control-element_tax_sep,
74
- .elementor-control-element_sharing_icon_6,
75
- .elementor-control-element_sharing_trigger_direction,
76
- .elementor-control-element_sharing_icon_display,
77
- .elementor-control-element_sharing_tooltip,
78
- .elementor-control-element_custom_field_wrapper_html,
79
- .elementor-control-slider_item_bg_size,
80
- .elementor-control-element_addcart_variable_txt,
81
- .elementor-control-type {
82
- margin-bottom: 15px;
83
- }
84
-
85
- .elementor-control-slider_content_bg_color,
86
- .elementor-control-slider_nav_border_border,
87
- .elementor-control-slider_nav_border_radius,
88
- .elementor-control-scroll_btn_vr,
89
- .elementor-control-pagination_load_more_text,
90
- .elementor-control-pagination_finish_text,
91
- .elementor-control-pagination_prev_next,
92
- .elementor-control-author_transition_duration,
93
- .elementor-control-comments_transition_duration,
94
- .elementor-control-likes_transition_duration,
95
- .elementor-control-sharing_transition_duration,
96
- .elementor-control-lightbox_transition_duration,
97
- .elementor-control-custom_field1_transition_duration,
98
- .elementor-control-custom_field2_transition_duration,
99
- .elementor-control-custom_field3_transition_duration,
100
- .elementor-control-custom_field4_transition_duration,
101
- .elementor-control-filters_transition_duration,
102
- .elementor-control-pagination_transition_duration,
103
- .elementor-control-element_extra_text_pos,
104
- .elementor-control-element_custom_field_wrapper,
105
- .elementor-control-overlay_post_link,
106
- .elementor-control-read_more_animation_height,
107
- .elementor-control-archive_link_transition_duration,
108
- .elementor-control-post_info_tax_select,
109
- .elementor-control-post_info_link_wrap,
110
- .elementor-control-tabs_sharing_custom_colors,
111
- .elementor-control-post_info_show_avatar,
112
- .elementor-control-post_info_cf,
113
- .elementor-control-pricing_items .elementor-control-price,
114
- .elementor-control-pricing_items .elementor-control-feature_text,
115
- .elementor-control-pricing_items .elementor-control-btn_text,
116
- .elementor-control-divider_style,
117
- .elementor-control-filters_pointer,
118
- .elementor-control-title_transition_duration,
119
- .elementor-control-tax1_transition_duration,
120
- .elementor-control-tax2_transition_duration,
121
- .elementor-control-filters_transition_duration,
122
- .elementor-control-pagination_older_text,
123
- .elementor-control-tooltip_position {
124
- padding-top: 15px !important;
125
- }
126
-
127
- .elementor-control-title_pointer_animation + .elementor-control-title_transition_duration,
128
- .elementor-control-tax1_pointer_animation + .elementor-control-tax1_transition_duration,
129
- .elementor-control-tax2_pointer_animation + .elementor-control-tax2_transition_duration,
130
- .elementor-control-filters_pointer_animation + .elementor-control-filters_transition_duration {
131
- padding-top: 0 !important;
132
- }
133
-
134
- .elementor-control-pagination_load_more_text {
135
- padding-bottom: 0 !important;
136
- }
137
-
138
- .elementor-control-filters_transition_duration {
139
- padding-top: 0 !important;
140
- }
141
-
142
- .elementor-control-animation_divider,
143
- .elementor-control-overlay_divider,
144
- .elementor-control-slider_item_btn_1_divider,
145
- .elementor-control-slider_item_btn_2_divider,
146
- .elementor-control-slider_btn_typography_1_divider,
147
- .elementor-control-slider_btn_box_shadow_1_divider,
148
- .elementor-control-slider_btn_typography_2_divider,
149
- .elementor-control-slider_btn_box_shadow_2_divider,
150
- .elementor-control-testimonial_title_divider,
151
- .elementor-control-social_media_divider,
152
- .elementor-control-social_divider_1,
153
- .elementor-control-social_divider_2,
154
- .elementor-control-social_divider_3,
155
- .elementor-control-social_divider_4,
156
- .elementor-control-social_divider_5,
157
- .elementor-control-custom_field_wrapper_html_divider1,
158
- .elementor-control-custom_field_wrapper_html_divider2,
159
- .elementor-control-lightbox_shadow_divider {
160
- padding: 0 !important;
161
- }
162
-
163
- .elementor-control-custom_field_wrapper_html_divider1 hr,
164
- .elementor-control-lightbox_shadow_divider hr {
165
- height: 1px !important;
166
- }
167
-
168
- .elementor-control-element_show_on {
169
- padding-top: 15px !important;
170
- border-top: 1px solid #d5dadf;
171
- }
172
-
173
- [class*="wpr__section_"] ~ .elementor-control-type-number .elementor-control-input-wrapper,
174
- [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-number .elementor-control-input-wrapper {
175
- max-width: 30% !important;
176
- margin-left: auto !important;
177
- }
178
-
179
- [class*="wpr__section_"] ~ .elementor-control-type-select .elementor-control-input-wrapper,
180
- [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-select .elementor-control-input-wrapper {
181
- width: auto !important;
182
- min-width: 30% !important;
183
- margin-left: auto !important;
184
- }
185
-
186
- .elementor-control-submit_preview_changes .elementor-control-input-wrapper {
187
- text-align: center !important;
188
- }
189
-
190
- .elementor-control-query_manual_related,
191
- .elementor-control-query_manual_current {
192
- display: none !important;
193
- }
194
-
195
- /* Fix Select Inputs */
196
- .elementor-control-button_hover_animation .elementor-control-input-wrapper,
197
- .elementor-control-front_btn_animation .elementor-control-input-wrapper,
198
- .elementor-control-back_btn_animation .elementor-control-input-wrapper,
199
-
200
- .elementor-control-select_template .select2-selection,
201
- .elementor-control-switcher_first_select_template .select2-selection,
202
- .elementor-control-switcher_second_select_template .select2-selection,
203
- .elementor-control-switcher_select_template .select2-selection,
204
- .elementor-control-slider_select_template .select2-selection {
205
- width: 135px !important;
206
- }
207
-
208
- .elementor-control-type-repeater .elementor-control-content > label {
209
- display: none !important;
210
- }
211
-
212
-
213
- /*--------------------------------------------------------------
214
- == Notification
215
- --------------------------------------------------------------*/
216
- #wpr-template-settings-notification {
217
- position: fixed;
218
- left: 40px;
219
- bottom: 5px;
220
- z-index: 9999;
221
- padding: 13px 25px;
222
- background: #fff;
223
- color: #222;
224
- -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
225
- box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
226
- border-radius: 3px;
227
- }
228
-
229
- #wpr-template-settings-notification:before {
230
- content: "";
231
- position: absolute;
232
- left: -6px;
233
- bottom: 10px;
234
- width: 0;
235
- height: 0;
236
- border-top: 6px solid transparent;
237
- border-bottom: 6px solid transparent;
238
- border-right-style: solid;
239
- border-right-width: 6px;
240
- border-right-color: #fff;
241
- }
242
-
243
- #wpr-template-settings-notification h4 {
244
- margin-bottom: 10px;
245
- }
246
-
247
- #wpr-template-settings-notification h4 span {
248
- font-size: 14px;
249
- vertical-align: super;
250
- color: #5f5f5f;
251
- }
252
-
253
- #wpr-template-settings-notification h4 i {
254
- margin-right: 10px;
255
- color: #3db050;
256
- font-size: 24px;
257
- }
258
-
259
- #wpr-template-settings-notification p {
260
- color: #666;
261
- font-size: 12px;
262
- line-height: 1.5;
263
- }
264
-
265
- #wpr-template-settings-notification > i {
266
- position: absolute;
267
- top: 7px;
268
- right: 7px;
269
- cursor: pointer;
270
- color: #999;
271
- }
272
-
273
- .elementor-control-cf7_notice,
274
- .elementor-control-wpforms_notice,
275
- .elementor-control-ninja_forms_notice,
276
- .elementor-control-caldera_notice {
277
- color: red;
278
- }
279
-
280
- /* Help Button - select with referrals - [href^="https://royal-elementor-addons.com/contact/"] */
281
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] {
282
- display: inline-block;
283
- padding: 12px 35px;
284
- font-size: 13px;
285
- font-weight: normal;
286
- color: #fff;
287
- background: #6A65FF;
288
- border-radius: 3px;
289
- -webkit-box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
290
- box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
291
- letter-spacing: 0.3px;
292
- -webkit-transition: all 0.2s ease-in;
293
- -o-transition: all 0.2s ease-in;
294
- transition: all 0.2s ease-in;
295
- }
296
-
297
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover {
298
- color: #fff;
299
- background: #6A4BFF;
300
- }
301
-
302
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] i {
303
- color: #fff;
304
- font-size: 14px;
305
- vertical-align: top;
306
- }
307
-
308
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i {
309
- color: #fff;
310
- }
311
-
312
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i:before {
313
- content: '\e942' !important;
314
- }
315
-
316
-
317
- /*--------------------------------------------------------------
318
- == Modal Popup Editor
319
- --------------------------------------------------------------*/
320
- .elementor-editor-wpr-popups .elementor-control-document_settings,
321
- .elementor-editor-wpr-popups .elementor-control-post_title,
322
- .elementor-editor-wpr-popups .elementor-control-post_status {
323
- display: none !important;
324
- }
325
-
326
-
327
- /*--------------------------------------------------------------
328
- == Elementor Editor Popup
329
- --------------------------------------------------------------*/
330
- #wpr-template-editor-popup .dialog-widget-content {
331
- width: 90vw;
332
- height: 90vh;
333
- }
334
-
335
- #wpr-template-editor-popup .dialog-message {
336
- padding: 0;
337
- width: 100%;
338
- height: 100%;
339
- }
340
-
341
- #wpr-template-editor-popup .dialog-close-button {
342
- font-size: 24px;
343
- color: #222;
344
- }
345
-
346
- #wpr-template-editor-popup .dialog-header {
347
- display: none;
348
- }
349
-
350
- #wpr-template-editor-loading {
351
- position: absolute;
352
- top: 0;
353
- left: 0;
354
- width: 100%;
355
- height: 100%;
356
- background: #f1f3f5;
357
- z-index: 9999;
358
- -webkit-transform: translateZ(0);
359
- transform: translateZ(0);
360
- display: -webkit-box;
361
- display: -ms-flexbox;
362
- display: flex;
363
- -webkit-box-pack: center;
364
- -ms-flex-pack: center;
365
- justify-content: center;
366
- -webkit-box-align: center;
367
- -ms-flex-align: center;
368
- align-items: center;
369
- }
370
-
371
- #wpr-template-editor-loading .elementor-loader-wrapper {
372
- top: auto;
373
- left: auto;
374
- -webkit-transform: none;
375
- -ms-transform: none;
376
- transform: none;
377
- }
378
-
379
- /* Disable Transitions on Responsive Preview */
380
- #elementor-preview-responsive-wrapper {
381
- -webkit-transition: none !important;
382
- -o-transition: none !important;
383
- transition: none !important;
384
- }
385
-
386
-
387
- /*--------------------------------------------------------------
388
- == Magazine Grid Layout
389
- --------------------------------------------------------------*/
390
- .elementor-control-layout_select.elementor-control .elementor-control-field {
391
- -webkit-box-orient: vertical !important;
392
- -webkit-box-direction: normal !important;
393
- -ms-flex-direction: column !important;
394
- flex-direction: column !important;
395
- -webkit-box-align: start;
396
- -ms-flex-align: start;
397
- align-items: flex-start;
398
- }
399
-
400
- .elementor-control-layout_select.elementor-control .elementor-control-input-wrapper {
401
- display: -webkit-box;
402
- display: -ms-flexbox;
403
- display: flex;
404
- width: 100% !important;
405
- margin-top: 10px;
406
- }
407
-
408
- .elementor-control-layout_select.elementor-control .elementor-choices {
409
- -ms-flex-wrap: wrap;
410
- flex-wrap: wrap;
411
- -webkit-box-align: stretch;
412
- -ms-flex-align: stretch;
413
- align-items: stretch;
414
- width: 100% !important;
415
- height: auto;
416
- border: 1px solid #dfd5d5;
417
- }
418
-
419
- .elementor-control-layout_select.elementor-control .elementor-choices label {
420
- width: 33.3%;
421
- height: 50px;
422
- background-size: 75%;
423
- background-position: center center;
424
- background-repeat: no-repeat;
425
- }
426
-
427
- .elementor-control-layout_select input[type="radio"]:checked + label {
428
- border: 2px solid #D30C5C;
429
- border-radius: 0 !important;
430
- background-color: #ffffff;
431
- }
432
-
433
- .elementor-control-layout_select label:nth-child(2) {
434
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='15.2' class='st1' width='22.2' height='11.9'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='9.2'/%3E%3C/g%3E%3C/svg%3E");
435
- }
436
-
437
- .elementor-control-layout_select label:nth-child(4) {
438
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
439
- }
440
-
441
- .elementor-control-layout_select label:nth-child(6) {
442
- background: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Cg%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
443
- }
444
-
445
- .elementor-control-layout_select label:nth-child(8) {
446
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
447
- }
448
-
449
- .elementor-control-layout_select label:nth-child(10) {
450
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='13.9' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3Crect x='2.3' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='2.3' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
451
- }
452
-
453
- .elementor-control-layout_select label:nth-child(12) {
454
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='28.5' height='22.2'/%3E%3Crect x='31.8' y='12.9' class='st1' width='15.9' height='6.3'/%3E%3Crect x='31.8' y='4.9' class='st1' width='15.9' height='6.8'/%3E%3Crect x='31.8' y='20.3' class='st1' width='15.9' height='6.8'/%3E%3C/g%3E%3C/svg%3E");
455
- }
456
-
457
- .elementor-control-layout_select label:nth-child(14) {
458
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='13.9' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='2.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
459
- }
460
-
461
- .elementor-control-layout_select label:nth-child(16) {
462
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='33.9' height='13.2'/%3E%3Crect x='2.2' y='19.3' class='st1' width='16.4' height='7.8'/%3E%3Crect x='19.7' y='19.3' class='st1' width='16.4' height='7.8'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='13.2'/%3E%3Crect x='37.2' y='19.3' class='st1' width='10.5' height='7.8'/%3E%3C/g%3E%3C/svg%3E");
463
- }
464
-
465
- .elementor-control-layout_select label:nth-child(18) {
466
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='12.1'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='12.1'/%3E%3Crect x='2.2' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3Crect x='17.8' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3Crect x='33.3' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3C/g%3E%3C/svg%3E");
467
- }
468
-
469
- .elementor-control-layout_select label:nth-child(20) {
470
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
471
- }
472
-
473
- .elementor-control-layout_select label:nth-child(22) {
474
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='14.5' height='22.2'/%3E%3Crect x='33.4' y='4.9' class='st1' width='14.4' height='22.2'/%3E%3Crect x='17.9' y='4.9' class='st1' width='14.4' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
475
- }
476
-
477
- .elementor-control-layout_select label:nth-child(24) {
478
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='10.6' height='22.2'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='14' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
479
- }
480
-
481
- /*--------------------------------------------------------------
482
- == Widget Preview and Library buttons
483
- --------------------------------------------------------------*/
484
- .elementor-control-wpr_library_buttons {
485
- height: 80px;
486
- padding: 0;
487
- }
488
-
489
- .elementor-control-wpr_library_buttons .elementor-control-raw-html {
490
- padding: 0 10px 10px 10px;
491
- border-bottom: 1px solid #efefef;
492
- }
493
-
494
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div {
495
- display: -webkit-box;
496
- display: -ms-flexbox;
497
- display: flex;
498
- -webkit-box-pack: center;
499
- -ms-flex-pack: center;
500
- justify-content: center;
501
- }
502
-
503
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a {
504
- -webkit-box-flex: 1;
505
- -ms-flex-positive: 1;
506
- flex-grow: 1;
507
- padding: 10px 15px;
508
- border-radius: 3px;
509
- /*box-shadow: 1px 2px 5px 0 rgba(0,0,0,0.2);*/
510
- white-space: nowrap;
511
- overflow: hidden;
512
- -o-text-overflow: ellipsis;
513
- text-overflow: ellipsis;
514
- text-align: center;
515
- }
516
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child {
517
- background-color: #1CB4E4;
518
- color: #fff;
519
- margin-right: 3px;
520
- }
521
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child {
522
- margin-left: 3px;
523
- background-color: #6A65FF;
524
- color: #fff;
525
- }
526
-
527
- .elementor-control-wpr_library_buttons .elementor-control-raw-html > a {
528
- display: block;
529
- margin-top: 10px;
530
- line-height: 20px;
531
- color: #777;
532
- border: none !important;
533
- }
534
-
535
-
536
- /*--------------------------------------------------------------
537
- == Free/Pro Options
538
- --------------------------------------------------------------*/
539
- .elementor-control select option[value*=pro-] {
540
- background: #f0f0f0;
541
- }
542
-
543
- .elementor-control[class*="pro_notice"] {
544
- padding: 5px 0 15px 0 !important;
545
- }
546
-
547
- .wpr-pro-notice {
548
- padding: 20px;
549
- border-top: 1px solid #e6e9ec;
550
- border-bottom: 1px solid #e6e9ec;
551
- background-color: #f2fbff;
552
- line-height: 1.4;
553
- text-align: center;
554
- }
555
-
556
- .wpr-pro-notice-video {
557
- display: block;
558
- margin-top: 7px;
559
- line-height: 20px;
560
- border: none !important;
561
- }
562
-
563
- #elementor-controls .elementor-control-slider_section_pro_notice {
564
- margin-top: -16px;
565
- padding-bottom: 0 !important;
566
- }
567
-
568
- .elementor-control-layout_select_pro_notice + div,
569
- .elementor-control-element_align_pro_notice + div {
570
- padding-top: 15px;
571
- }
572
-
573
- .elementor-control-layout_select .elementor-choices label {
574
- position: relative;
575
- }
576
-
577
- .elementor-control-layout_select .elementor-choices label:nth-child(2):after,
578
- .elementor-control-layout_select .elementor-choices label:nth-child(4):after,
579
- .elementor-control-layout_select .elementor-choices label:nth-child(6):after,
580
- .elementor-control-layout_select .elementor-choices label:nth-child(8):after,
581
- .elementor-control-layout_select .elementor-choices label:nth-child(10):after,
582
- .elementor-control-layout_select .elementor-choices label:nth-child(12):after {
583
- content: ' ';
584
- display: block;
585
- width: 100%;
586
- height: 100%;
587
- position: absolute;
588
- top: 0;
589
- left: 0;
590
- background: rgba(0,0,0,0.2);
591
- }
592
-
593
- /* Adjustments */
594
- .elementor-control.elementor-control-element_align_pro_notice,
595
- .elementor-control.elementor-control-search_pro_notice,
596
- .elementor-control.elementor-control-layout_select_pro_notice,
597
- .elementor-control.elementor-control-grid_columns_pro_notice,
598
- .elementor-control.elementor-control-slider_content_type_pro_notice,
599
- .elementor-control.elementor-control-slider_repeater_pro_notice,
600
- .elementor-control.elementor-control-slider_dots_layout_pro_notice,
601
- .elementor-control.elementor-control-testimonial_repeater_pro_notice,
602
- .elementor-control.elementor-control-testimonial_icon_pro_notice,
603
- .elementor-control.elementor-control-menu_layout_pro_notice,
604
- .elementor-control.elementor-control-menu_items_submenu_entrance_pro_notice,
605
- .elementor-control.elementor-control-switcher_label_style_pro_notice,
606
- .elementor-control.elementor-control-countdown_type_pro_notice,
607
- .elementor-control.elementor-control-layout_pro_notice,
608
- .elementor-control.elementor-control-anim_timing_pro_notice,
609
- .elementor-control.elementor-control-tab_content_type_pro_notice,
610
- .elementor-control.elementor-control-tabs_repeater_pro_notice,
611
- .elementor-control.elementor-control-tabs_align_pro_notice,
612
- .elementor-control.elementor-control-front_trigger_pro_notice,
613
- .elementor-control.elementor-control-back_link_type_pro_notice,
614
- .elementor-control.elementor-control-box_anim_timing_pro_notice,
615
- .elementor-control.elementor-control-image_style_pro_notice,
616
- .elementor-control.elementor-control-image_animation_timing_pro_notice,
617
- .elementor-control.elementor-control-label_display_pro_notice,
618
- .elementor-control.elementor-control-post_type_pro_notice,
619
- .elementor-control.elementor-control-type_select_pro_notice,
620
- .elementor-control.elementor-control-icon_style_pro_notice,
621
- .elementor-control.elementor-control-dual_button_pro_notice,
622
- .elementor-control.elementor-control-team_member_pro_notice,
623
- .elementor-control.elementor-control-price_list_pro_notice,
624
- .elementor-control.elementor-control-business_hours_pro_notice,
625
- .elementor-control.elementor-control-sharing_columns_pro_notice,
626
- .elementor-control.elementor-control-popup_trigger_pro_notice,
627
- .elementor-control.elementor-control-popup_show_again_delay_pro_notice,
628
- .elementor-control.elementor-control-group_popup_settings_pro_notice,
629
- .elementor-control.elementor-control-which_particle_pro_notice,
630
- .elementor-control.elementor-control-paralax_repeater_pro_notice,
631
- .elementor-control.elementor-control-opnepage_pro_notice,
632
- .elementor-control.elementor-control-timeline_repeater_pro_notice,
633
- .elementor-control.elementor-control-limit_grid_items_pro_notice {
634
- padding-bottom: 0 !important;
635
- }
636
-
637
- .elementor-control-search_pro_notice .wpr-pro-notice,
638
- .elementor-control-grid_columns_pro_notice .wpr-pro-notice,
639
- .elementor-control-slider_content_type_pro_notice .wpr-pro-notice,
640
- .elementor-control-slider_repeater_pro_notice .wpr-pro-notice,
641
- .elementor-control-slider_dots_layout_pro_notice .wpr-pro-notice,
642
- .elementor-control-testimonial_repeater_pro_notice .wpr-pro-notice,
643
- .elementor-control-testimonial_icon_pro_notice .wpr-pro-notice,
644
- .elementor-control-menu_layout_pro_notice .wpr-pro-notice,
645
- .elementor-control-menu_items_submenu_entrance_pro_notice .wpr-pro-notice,
646
- .elementor-control-switcher_label_style_pro_notice .wpr-pro-notice,
647
- .elementor-control-countdown_type_pro_notice .wpr-pro-notice,
648
- .elementor-control-layout_pro_notice .wpr-pro-notice,
649
- .elementor-control-anim_timing_pro_notice .wpr-pro-notice,
650
- .elementor-control-tab_content_type_pro_notice .wpr-pro-notice,
651
- .elementor-control-tabs_repeater_pro_notice .wpr-pro-notice,
652
- .elementor-control-tabs_align_pro_notice .wpr-pro-notice,
653
- .elementor-control-front_trigger_pro_notice .wpr-pro-notice,
654
- .elementor-control-back_link_type_pro_notice .wpr-pro-notice,
655
- .elementor-control-box_anim_timing_pro_notice .wpr-pro-notice,
656
- .elementor-control-image_style_pro_notice .wpr-pro-notice,
657
- .elementor-control-image_animation_timing_pro_notice .wpr-pro-notice,
658
- .elementor-control-label_display_pro_notice .wpr-pro-notice,
659
- .elementor-control-post_type_pro_notice .wpr-pro-notice,
660
- .elementor-control-type_select_pro_notice .wpr-pro-notice,
661
- .elementor-control-icon_style_pro_notice .wpr-pro-notice,
662
- .elementor-control-dual_button_pro_notice .wpr-pro-notice,
663
- .elementor-control-team_member_pro_notice .wpr-pro-notice,
664
- .elementor-control-price_list_pro_notice .wpr-pro-notice,
665
- .elementor-control-business_hours_pro_notice .wpr-pro-notice,
666
- .elementor-control-sharing_columns_pro_notice .wpr-pro-notice,
667
- .elementor-control-popup_trigger_pro_notice .wpr-pro-notice,
668
- .elementor-control-popup_show_again_delay_pro_notice .wpr-pro-notice,
669
- .elementor-control-group_popup_settings_pro_notice .wpr-pro-notice {
670
- border-bottom: none !important;
671
- }
672
-
673
- /* Both */
674
- .elementor-control.elementor-control-pagination_type_pro_notice,
675
- .elementor-control.elementor-control-tooltip_trigger_pro_notice {
676
- padding-top: 0 !important;
677
- padding-bottom: 0 !important;
678
- }
679
-
680
- .elementor-control-pagination_type_pro_notice .wpr-pro-notice {
681
- border-top: none !important;
682
- border-bottom: none !important;
683
- }
684
-
685
- .elementor-control-pro_features_section .elementor-section-toggle,
686
- .elementor-control-pro_features_section .elementor-section-title {
687
- color: #f54;
688
- }
689
-
690
- .elementor-control-pro_features_section .elementor-section-title {
691
- line-height: 20px;
692
- }
693
- .elementor-control-pro_features_section .elementor-section-title .dashicons {
694
- line-height: 20px;
695
- font-size: 13px;
696
- }
697
-
698
- .wpr-pro-features-list {
699
- text-align: center;
700
- }
701
-
702
- .wpr-pro-features-list ul {
703
- text-align: left;
704
- }
705
-
706
- .wpr-pro-features-list ul li {
707
- position: relative;
708
- line-height: 22px;
709
- padding-left: 20px;
710
- }
711
-
712
- .wpr-pro-features-list ul li::before {
713
- content: '.';
714
- font-size: 38px;
715
- position: absolute;
716
- top: -11px;
717
- left: 0;
718
- }
719
-
720
- .wpr-pro-features-list ul + a {
721
- display: inline-block;
722
- background-color: #f54;
723
- color: #fff;
724
- margin: 15px 15px 10px 0;
725
- padding: 7px 12px;
726
- border-radius: 3px;
727
- }
728
-
729
- .wpr-pro-features-list ul + a:hover {
730
- color: #fff;
731
- }
732
-
733
- /* Video Tutorial Link */
734
- .elementor-control[class*="video_tutorial"] {
735
- padding-top: 0 !important;
736
- padding-bottom: 5px !important;
737
- }
738
-
739
- .elementor-control[class*="video_tutorial"] a {
740
- line-height: 16px;
741
- font-size: 12px;
742
- }
743
-
744
- .elementor-control[class*="video_tutorial"] a .dashicons {
745
- font-size: 16px;
746
- }
747
-
748
-
749
- /*--------------------------------------------------------------
750
- == Elementor Search Notice
751
- --------------------------------------------------------------*/
752
- .wpr-elementor-search-notice {
753
- background: #fff;
754
- font-size: 13px;
755
- padding: 20px;
756
- line-height: 18px;
757
- margin: 10px;
758
- border-left: 3px solid #71d7f7;
759
- -webkit-box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
760
- box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
761
  }
1
+ /*--------------------------------------------------------------
2
+ == General
3
+ --------------------------------------------------------------*/
4
+ .wpr-elementor-hidden-control {
5
+ overflow: hidden;
6
+ width: 0 !important;
7
+ height: 0 !important;
8
+ padding: 0 !important;
9
+ margin: 0 !important;
10
+ visibility: hidden !important;
11
+ opacity: 0 !important;
12
+ }
13
+
14
+
15
+ /*--------------------------------------------------------------
16
+ == WPR Widgets
17
+ --------------------------------------------------------------*/
18
+ .elementor-panel .wpr-icon:after {
19
+ content: 'R';
20
+ display: block;
21
+ position: absolute;
22
+ top: 3px;
23
+ right: 3px;
24
+ font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
25
+ font-size: 10px;
26
+ font-weight: bold;
27
+ color: #ffffff;
28
+ background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
29
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
30
+ background-image: linear-gradient(#6A4BFF, #7E94FE);
31
+ -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
32
+ box-shadow: 0 0 2px 2px #b8c7ff;
33
+ width: 19px;
34
+ height: 19px;
35
+ line-height: 19px;
36
+ border-radius: 15px;
37
+ margin: 3px;
38
+ }
39
+
40
+ .elementor-panel .elementor-element .icon {
41
+ position: relative !important;
42
+ }
43
+
44
+ .elementor-control-type-section[class*="elementor-control-wpr_section_"]:after {
45
+ content: 'R';
46
+ display: block;
47
+ position: absolute;
48
+ top: 7px;
49
+ right: 7px;
50
+ font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
51
+ font-size: 10px;
52
+ font-weight: bold;
53
+ color: #ffffff;
54
+ background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
55
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
56
+ background-image: linear-gradient(#6A4BFF, #7E94FE);
57
+ -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
58
+ box-shadow: 0 0 2px 2px #b8c7ff;
59
+ width: 19px;
60
+ height: 19px;
61
+ line-height: 19px;
62
+ border-radius: 15px;
63
+ margin: 3px;
64
+ text-align: center;
65
+ }
66
+
67
+ /*--------------------------------------------------------------
68
+ == Adjustments
69
+ --------------------------------------------------------------*/
70
+ .elementor-control-element_select,
71
+ .elementor-control-element_align_hr,
72
+ .elementor-control-element_read_more_text,
73
+ .elementor-control-element_tax_sep,
74
+ .elementor-control-element_sharing_icon_6,
75
+ .elementor-control-element_sharing_trigger_direction,
76
+ .elementor-control-element_sharing_icon_display,
77
+ .elementor-control-element_sharing_tooltip,
78
+ .elementor-control-element_custom_field_wrapper_html,
79
+ .elementor-control-slider_item_bg_size,
80
+ .elementor-control-element_addcart_variable_txt,
81
+ .elementor-control-type {
82
+ margin-bottom: 15px;
83
+ }
84
+
85
+ .elementor-control-slider_content_bg_color,
86
+ .elementor-control-slider_nav_border_border,
87
+ .elementor-control-slider_nav_border_radius,
88
+ .elementor-control-scroll_btn_vr,
89
+ .elementor-control-pagination_load_more_text,
90
+ .elementor-control-pagination_finish_text,
91
+ .elementor-control-pagination_prev_next,
92
+ .elementor-control-author_transition_duration,
93
+ .elementor-control-comments_transition_duration,
94
+ .elementor-control-likes_transition_duration,
95
+ .elementor-control-sharing_transition_duration,
96
+ .elementor-control-lightbox_transition_duration,
97
+ .elementor-control-custom_field1_transition_duration,
98
+ .elementor-control-custom_field2_transition_duration,
99
+ .elementor-control-custom_field3_transition_duration,
100
+ .elementor-control-custom_field4_transition_duration,
101
+ .elementor-control-filters_transition_duration,
102
+ .elementor-control-pagination_transition_duration,
103
+ .elementor-control-element_extra_text_pos,
104
+ .elementor-control-element_custom_field_wrapper,
105
+ .elementor-control-overlay_post_link,
106
+ .elementor-control-read_more_animation_height,
107
+ .elementor-control-archive_link_transition_duration,
108
+ .elementor-control-post_info_tax_select,
109
+ .elementor-control-post_info_link_wrap,
110
+ .elementor-control-tabs_sharing_custom_colors,
111
+ .elementor-control-post_info_show_avatar,
112
+ .elementor-control-post_info_cf,
113
+ .elementor-control-pricing_items .elementor-control-price,
114
+ .elementor-control-pricing_items .elementor-control-feature_text,
115
+ .elementor-control-pricing_items .elementor-control-btn_text,
116
+ .elementor-control-divider_style,
117
+ .elementor-control-filters_pointer,
118
+ .elementor-control-title_transition_duration,
119
+ .elementor-control-tax1_transition_duration,
120
+ .elementor-control-tax2_transition_duration,
121
+ .elementor-control-filters_transition_duration,
122
+ .elementor-control-pagination_older_text,
123
+ .elementor-control-tooltip_position {
124
+ padding-top: 15px !important;
125
+ }
126
+
127
+ .elementor-control-title_pointer_animation + .elementor-control-title_transition_duration,
128
+ .elementor-control-tax1_pointer_animation + .elementor-control-tax1_transition_duration,
129
+ .elementor-control-tax2_pointer_animation + .elementor-control-tax2_transition_duration,
130
+ .elementor-control-filters_pointer_animation + .elementor-control-filters_transition_duration {
131
+ padding-top: 0 !important;
132
+ }
133
+
134
+ .elementor-control-pagination_load_more_text {
135
+ padding-bottom: 0 !important;
136
+ }
137
+
138
+ .elementor-control-filters_transition_duration {
139
+ padding-top: 0 !important;
140
+ }
141
+
142
+ .elementor-control-animation_divider,
143
+ .elementor-control-overlay_divider,
144
+ .elementor-control-slider_item_btn_1_divider,
145
+ .elementor-control-slider_item_btn_2_divider,
146
+ .elementor-control-slider_btn_typography_1_divider,
147
+ .elementor-control-slider_btn_box_shadow_1_divider,
148
+ .elementor-control-slider_btn_typography_2_divider,
149
+ .elementor-control-slider_btn_box_shadow_2_divider,
150
+ .elementor-control-testimonial_title_divider,
151
+ .elementor-control-social_media_divider,
152
+ .elementor-control-social_divider_1,
153
+ .elementor-control-social_divider_2,
154
+ .elementor-control-social_divider_3,
155
+ .elementor-control-social_divider_4,
156
+ .elementor-control-social_divider_5,
157
+ .elementor-control-custom_field_wrapper_html_divider1,
158
+ .elementor-control-custom_field_wrapper_html_divider2,
159
+ .elementor-control-lightbox_shadow_divider {
160
+ padding: 0 !important;
161
+ }
162
+
163
+ .elementor-control-custom_field_wrapper_html_divider1 hr,
164
+ .elementor-control-lightbox_shadow_divider hr {
165
+ height: 1px !important;
166
+ }
167
+
168
+ .elementor-control-element_show_on {
169
+ padding-top: 15px !important;
170
+ border-top: 1px solid #d5dadf;
171
+ }
172
+
173
+ [class*="wpr__section_"] ~ .elementor-control-type-number .elementor-control-input-wrapper,
174
+ [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-number .elementor-control-input-wrapper {
175
+ max-width: 30% !important;
176
+ margin-left: auto !important;
177
+ }
178
+
179
+ [class*="wpr__section_"] ~ .elementor-control-type-select .elementor-control-input-wrapper,
180
+ [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-select .elementor-control-input-wrapper {
181
+ width: auto !important;
182
+ min-width: 30% !important;
183
+ margin-left: auto !important;
184
+ }
185
+
186
+ .elementor-control-submit_preview_changes .elementor-control-input-wrapper {
187
+ text-align: center !important;
188
+ }
189
+
190
+ .elementor-control-query_manual_related,
191
+ .elementor-control-query_manual_current {
192
+ display: none !important;
193
+ }
194
+
195
+ /* Fix Select Inputs */
196
+ .elementor-control-button_hover_animation .elementor-control-input-wrapper,
197
+ .elementor-control-front_btn_animation .elementor-control-input-wrapper,
198
+ .elementor-control-back_btn_animation .elementor-control-input-wrapper,
199
+
200
+ .elementor-control-select_template .select2-selection,
201
+ .elementor-control-switcher_first_select_template .select2-selection,
202
+ .elementor-control-switcher_second_select_template .select2-selection,
203
+ .elementor-control-switcher_select_template .select2-selection,
204
+ .elementor-control-slider_select_template .select2-selection {
205
+ width: 135px !important;
206
+ }
207
+
208
+ .elementor-control-type-repeater .elementor-control-content > label {
209
+ display: none !important;
210
+ }
211
+
212
+
213
+ /*--------------------------------------------------------------
214
+ == Notification
215
+ --------------------------------------------------------------*/
216
+ #wpr-template-settings-notification {
217
+ position: fixed;
218
+ left: 40px;
219
+ bottom: 5px;
220
+ z-index: 9999;
221
+ padding: 13px 25px;
222
+ background: #fff;
223
+ color: #222;
224
+ -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
225
+ box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
226
+ border-radius: 3px;
227
+ }
228
+
229
+ #wpr-template-settings-notification:before {
230
+ content: "";
231
+ position: absolute;
232
+ left: -6px;
233
+ bottom: 10px;
234
+ width: 0;
235
+ height: 0;
236
+ border-top: 6px solid transparent;
237
+ border-bottom: 6px solid transparent;
238
+ border-right-style: solid;
239
+ border-right-width: 6px;
240
+ border-right-color: #fff;
241
+ }
242
+
243
+ #wpr-template-settings-notification h4 {
244
+ margin-bottom: 10px;
245
+ }
246
+
247
+ #wpr-template-settings-notification h4 span {
248
+ font-size: 14px;
249
+ vertical-align: super;
250
+ color: #5f5f5f;
251
+ }
252
+
253
+ #wpr-template-settings-notification h4 i {
254
+ margin-right: 10px;
255
+ color: #3db050;
256
+ font-size: 24px;
257
+ }
258
+
259
+ #wpr-template-settings-notification p {
260
+ color: #666;
261
+ font-size: 12px;
262
+ line-height: 1.5;
263
+ }
264
+
265
+ #wpr-template-settings-notification > i {
266
+ position: absolute;
267
+ top: 7px;
268
+ right: 7px;
269
+ cursor: pointer;
270
+ color: #999;
271
+ }
272
+
273
+ .elementor-control-cf7_notice,
274
+ .elementor-control-wpforms_notice,
275
+ .elementor-control-ninja_forms_notice,
276
+ .elementor-control-caldera_notice {
277
+ color: red;
278
+ }
279
+
280
+ /* Help Button - select with referrals - [href^="https://royal-elementor-addons.com/contact/"] */
281
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] {
282
+ display: inline-block;
283
+ padding: 12px 35px;
284
+ font-size: 13px;
285
+ font-weight: normal;
286
+ color: #fff;
287
+ background: #6A65FF;
288
+ border-radius: 3px;
289
+ -webkit-box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
290
+ box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
291
+ letter-spacing: 0.3px;
292
+ -webkit-transition: all 0.2s ease-in;
293
+ -o-transition: all 0.2s ease-in;
294
+ transition: all 0.2s ease-in;
295
+ }
296
+
297
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover {
298
+ color: #fff;
299
+ background: #6A4BFF;
300
+ }
301
+
302
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] i {
303
+ color: #fff;
304
+ font-size: 14px;
305
+ vertical-align: top;
306
+ }
307
+
308
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i {
309
+ color: #fff;
310
+ }
311
+
312
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i:before {
313
+ content: '\e942' !important;
314
+ }
315
+
316
+
317
+ /*--------------------------------------------------------------
318
+ == Modal Popup Editor
319
+ --------------------------------------------------------------*/
320
+ .elementor-editor-wpr-popups .elementor-control-document_settings,
321
+ .elementor-editor-wpr-popups .elementor-control-post_title,
322
+ .elementor-editor-wpr-popups .elementor-control-post_status {
323
+ display: none !important;
324
+ }
325
+
326
+
327
+ /*--------------------------------------------------------------
328
+ == Elementor Editor Popup
329
+ --------------------------------------------------------------*/
330
+ #wpr-template-editor-popup .dialog-widget-content {
331
+ width: 90vw;
332
+ height: 90vh;
333
+ }
334
+
335
+ #wpr-template-editor-popup .dialog-message {
336
+ padding: 0;
337
+ width: 100%;
338
+ height: 100%;
339
+ }
340
+
341
+ #wpr-template-editor-popup .dialog-close-button {
342
+ font-size: 24px;
343
+ color: #222;
344
+ }
345
+
346
+ #wpr-template-editor-popup .dialog-header {
347
+ display: none;
348
+ }
349
+
350
+ #wpr-template-editor-loading {
351
+ position: absolute;
352
+ top: 0;
353
+ left: 0;
354
+ width: 100%;
355
+ height: 100%;
356
+ background: #f1f3f5;
357
+ z-index: 9999;
358
+ -webkit-transform: translateZ(0);
359
+ transform: translateZ(0);
360
+ display: -webkit-box;
361
+ display: -ms-flexbox;
362
+ display: flex;
363
+ -webkit-box-pack: center;
364
+ -ms-flex-pack: center;
365
+ justify-content: center;
366
+ -webkit-box-align: center;
367
+ -ms-flex-align: center;
368
+ align-items: center;
369
+ }
370
+
371
+ #wpr-template-editor-loading .elementor-loader-wrapper {
372
+ top: auto;
373
+ left: auto;
374
+ -webkit-transform: none;
375
+ -ms-transform: none;
376
+ transform: none;
377
+ }
378
+
379
+ /* Disable Transitions on Responsive Preview */
380
+ #elementor-preview-responsive-wrapper {
381
+ -webkit-transition: none !important;
382
+ -o-transition: none !important;
383
+ transition: none !important;
384
+ }
385
+
386
+
387
+ /*--------------------------------------------------------------
388
+ == Magazine Grid Layout
389
+ --------------------------------------------------------------*/
390
+ .elementor-control-layout_select.elementor-control .elementor-control-field {
391
+ -webkit-box-orient: vertical !important;
392
+ -webkit-box-direction: normal !important;
393
+ -ms-flex-direction: column !important;
394
+ flex-direction: column !important;
395
+ -webkit-box-align: start;
396
+ -ms-flex-align: start;
397
+ align-items: flex-start;
398
+ }
399
+
400
+ .elementor-control-layout_select.elementor-control .elementor-control-input-wrapper {
401
+ display: -webkit-box;
402
+ display: -ms-flexbox;
403
+ display: flex;
404
+ width: 100% !important;
405
+ margin-top: 10px;
406
+ }
407
+
408
+ .elementor-control-layout_select.elementor-control .elementor-choices {
409
+ -ms-flex-wrap: wrap;
410
+ flex-wrap: wrap;
411
+ -webkit-box-align: stretch;
412
+ -ms-flex-align: stretch;
413
+ align-items: stretch;
414
+ width: 100% !important;
415
+ height: auto;
416
+ border: 1px solid #dfd5d5;
417
+ }
418
+
419
+ .elementor-control-layout_select.elementor-control .elementor-choices label {
420
+ width: 33.3%;
421
+ height: 50px;
422
+ background-size: 75%;
423
+ background-position: center center;
424
+ background-repeat: no-repeat;
425
+ }
426
+
427
+ .elementor-control-layout_select input[type="radio"]:checked + label {
428
+ border: 2px solid #D30C5C;
429
+ border-radius: 0 !important;
430
+ background-color: #ffffff;
431
+ }
432
+
433
+ .elementor-control-layout_select label:nth-child(2) {
434
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='15.2' class='st1' width='22.2' height='11.9'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='9.2'/%3E%3C/g%3E%3C/svg%3E");
435
+ }
436
+
437
+ .elementor-control-layout_select label:nth-child(4) {
438
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
439
+ }
440
+
441
+ .elementor-control-layout_select label:nth-child(6) {
442
+ background: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Cg%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
443
+ }
444
+
445
+ .elementor-control-layout_select label:nth-child(8) {
446
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
447
+ }
448
+
449
+ .elementor-control-layout_select label:nth-child(10) {
450
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='13.9' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='37.2' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3Crect x='2.3' y='16.6' class='st1' width='10.5' height='10.5'/%3E%3Crect x='2.3' y='4.9' class='st1' width='10.5' height='10.5'/%3E%3C/g%3E%3C/svg%3E");
451
+ }
452
+
453
+ .elementor-control-layout_select label:nth-child(12) {
454
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='28.5' height='22.2'/%3E%3Crect x='31.8' y='12.9' class='st1' width='15.9' height='6.3'/%3E%3Crect x='31.8' y='4.9' class='st1' width='15.9' height='6.8'/%3E%3Crect x='31.8' y='20.3' class='st1' width='15.9' height='6.8'/%3E%3C/g%3E%3C/svg%3E");
455
+ }
456
+
457
+ .elementor-control-layout_select label:nth-child(14) {
458
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='13.9' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='2.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
459
+ }
460
+
461
+ .elementor-control-layout_select label:nth-child(16) {
462
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='33.9' height='13.2'/%3E%3Crect x='2.2' y='19.3' class='st1' width='16.4' height='7.8'/%3E%3Crect x='19.7' y='19.3' class='st1' width='16.4' height='7.8'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='13.2'/%3E%3Crect x='37.2' y='19.3' class='st1' width='10.5' height='7.8'/%3E%3C/g%3E%3C/svg%3E");
463
+ }
464
+
465
+ .elementor-control-layout_select label:nth-child(18) {
466
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='12.1'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='12.1'/%3E%3Crect x='2.2' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3Crect x='17.8' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3Crect x='33.3' y='18.2' class='st1' width='14.4' height='8.9'/%3E%3C/g%3E%3C/svg%3E");
467
+ }
468
+
469
+ .elementor-control-layout_select label:nth-child(20) {
470
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='22.2' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
471
+ }
472
+
473
+ .elementor-control-layout_select label:nth-child(22) {
474
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='14.5' height='22.2'/%3E%3Crect x='33.4' y='4.9' class='st1' width='14.4' height='22.2'/%3E%3Crect x='17.9' y='4.9' class='st1' width='14.4' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
475
+ }
476
+
477
+ .elementor-control-layout_select label:nth-child(24) {
478
+ background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 32' style='enable-background:new 0 0 50 32;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0{fill:%23FFFFFF;} .st1{fill:%23C2C1C0;} %3C/style%3E%3Cg id='Background'%3E%3Crect class='st0' width='50' height='32'/%3E%3C/g%3E%3Cg id='Layer_1'%3E%3Crect x='2.2' y='4.9' class='st1' width='10.6' height='22.2'/%3E%3Crect x='37.2' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='25.6' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3Crect x='14' y='4.9' class='st1' width='10.5' height='22.2'/%3E%3C/g%3E%3C/svg%3E");
479
+ }
480
+
481
+ /*--------------------------------------------------------------
482
+ == Widget Preview and Library buttons
483
+ --------------------------------------------------------------*/
484
+ .elementor-control-wpr_library_buttons {
485
+ height: 80px;
486
+ padding: 0;
487
+ }
488
+
489
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html {
490
+ padding: 0 10px 10px 10px;
491
+ border-bottom: 1px solid #efefef;
492
+ }
493
+
494
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div {
495
+ display: -webkit-box;
496
+ display: -ms-flexbox;
497
+ display: flex;
498
+ -webkit-box-pack: center;
499
+ -ms-flex-pack: center;
500
+ justify-content: center;
501
+ }
502
+
503
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a {
504
+ -webkit-box-flex: 1;
505
+ -ms-flex-positive: 1;
506
+ flex-grow: 1;
507
+ padding: 10px 15px;
508
+ border-radius: 3px;
509
+ /*box-shadow: 1px 2px 5px 0 rgba(0,0,0,0.2);*/
510
+ white-space: nowrap;
511
+ overflow: hidden;
512
+ -o-text-overflow: ellipsis;
513
+ text-overflow: ellipsis;
514
+ text-align: center;
515
+ }
516
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child {
517
+ background-color: #1CB4E4;
518
+ color: #fff;
519
+ margin-right: 3px;
520
+ }
521
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child {
522
+ margin-left: 3px;
523
+ background-color: #6A65FF;
524
+ color: #fff;
525
+ }
526
+
527
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html > a {
528
+ display: block;
529
+ margin-top: 10px;
530
+ line-height: 20px;
531
+ color: #777;
532
+ border: none !important;
533
+ }
534
+
535
+
536
+ /*--------------------------------------------------------------
537
+ == Free/Pro Options
538
+ --------------------------------------------------------------*/
539
+ .elementor-control select option[value*=pro-] {
540
+ background: #f0f0f0;
541
+ }
542
+
543
+ .elementor-control[class*="pro_notice"] {
544
+ padding: 5px 0 15px 0 !important;
545
+ }
546
+
547
+ .wpr-pro-notice {
548
+ padding: 20px;
549
+ border-top: 1px solid #e6e9ec;
550
+ border-bottom: 1px solid #e6e9ec;
551
+ background-color: #f2fbff;
552
+ line-height: 1.4;
553
+ text-align: center;
554
+ }
555
+
556
+ .wpr-pro-notice-video {
557
+ display: block;
558
+ margin-top: 7px;
559
+ line-height: 20px;
560
+ border: none !important;
561
+ }
562
+
563
+ #elementor-controls .elementor-control-slider_section_pro_notice {
564
+ margin-top: -16px;
565
+ padding-bottom: 0 !important;
566
+ }
567
+
568
+ .elementor-control-layout_select_pro_notice + div,
569
+ .elementor-control-element_align_pro_notice + div {
570
+ padding-top: 15px;
571
+ }
572
+
573
+ .elementor-control-layout_select .elementor-choices label {
574
+ position: relative;
575
+ }
576
+
577
+ .elementor-control-layout_select .elementor-choices label:nth-child(2):after,
578
+ .elementor-control-layout_select .elementor-choices label:nth-child(4):after,
579
+ .elementor-control-layout_select .elementor-choices label:nth-child(6):after,
580
+ .elementor-control-layout_select .elementor-choices label:nth-child(8):after,
581
+ .elementor-control-layout_select .elementor-choices label:nth-child(10):after,
582
+ .elementor-control-layout_select .elementor-choices label:nth-child(12):after {
583
+ content: ' ';
584
+ display: block;
585
+ width: 100%;
586
+ height: 100%;
587
+ position: absolute;
588
+ top: 0;
589
+ left: 0;
590
+ background: rgba(0,0,0,0.2);
591
+ }
592
+
593
+ /* Adjustments */
594
+ .elementor-control.elementor-control-element_align_pro_notice,
595
+ .elementor-control.elementor-control-search_pro_notice,
596
+ .elementor-control.elementor-control-layout_select_pro_notice,
597
+ .elementor-control.elementor-control-grid_columns_pro_notice,
598
+ .elementor-control.elementor-control-slider_content_type_pro_notice,
599
+ .elementor-control.elementor-control-slider_repeater_pro_notice,
600
+ .elementor-control.elementor-control-slider_dots_layout_pro_notice,
601
+ .elementor-control.elementor-control-testimonial_repeater_pro_notice,
602
+ .elementor-control.elementor-control-testimonial_icon_pro_notice,
603
+ .elementor-control.elementor-control-menu_layout_pro_notice,
604
+ .elementor-control.elementor-control-menu_items_submenu_entrance_pro_notice,
605
+ .elementor-control.elementor-control-switcher_label_style_pro_notice,
606
+ .elementor-control.elementor-control-countdown_type_pro_notice,
607
+ .elementor-control.elementor-control-layout_pro_notice,
608
+ .elementor-control.elementor-control-anim_timing_pro_notice,
609
+ .elementor-control.elementor-control-tab_content_type_pro_notice,
610
+ .elementor-control.elementor-control-tabs_repeater_pro_notice,
611
+ .elementor-control.elementor-control-tabs_align_pro_notice,
612
+ .elementor-control.elementor-control-front_trigger_pro_notice,
613
+ .elementor-control.elementor-control-back_link_type_pro_notice,
614
+ .elementor-control.elementor-control-box_anim_timing_pro_notice,
615
+ .elementor-control.elementor-control-image_style_pro_notice,
616
+ .elementor-control.elementor-control-image_animation_timing_pro_notice,
617
+ .elementor-control.elementor-control-label_display_pro_notice,
618
+ .elementor-control.elementor-control-post_type_pro_notice,
619
+ .elementor-control.elementor-control-type_select_pro_notice,
620
+ .elementor-control.elementor-control-icon_style_pro_notice,
621
+ .elementor-control.elementor-control-dual_button_pro_notice,
622
+ .elementor-control.elementor-control-team_member_pro_notice,
623
+ .elementor-control.elementor-control-price_list_pro_notice,
624
+ .elementor-control.elementor-control-business_hours_pro_notice,
625
+ .elementor-control.elementor-control-sharing_columns_pro_notice,
626
+ .elementor-control.elementor-control-popup_trigger_pro_notice,
627
+ .elementor-control.elementor-control-popup_show_again_delay_pro_notice,
628
+ .elementor-control.elementor-control-group_popup_settings_pro_notice,
629
+ .elementor-control.elementor-control-which_particle_pro_notice,
630
+ .elementor-control.elementor-control-paralax_repeater_pro_notice,
631
+ .elementor-control.elementor-control-opnepage_pro_notice,
632
+ .elementor-control.elementor-control-timeline_repeater_pro_notice,
633
+ .elementor-control.elementor-control-limit_grid_items_pro_notice {
634
+ padding-bottom: 0 !important;
635
+ }
636
+
637
+ .elementor-control-search_pro_notice .wpr-pro-notice,
638
+ .elementor-control-grid_columns_pro_notice .wpr-pro-notice,
639
+ .elementor-control-slider_content_type_pro_notice .wpr-pro-notice,
640
+ .elementor-control-slider_repeater_pro_notice .wpr-pro-notice,
641
+ .elementor-control-slider_dots_layout_pro_notice .wpr-pro-notice,
642
+ .elementor-control-testimonial_repeater_pro_notice .wpr-pro-notice,
643
+ .elementor-control-testimonial_icon_pro_notice .wpr-pro-notice,
644
+ .elementor-control-menu_layout_pro_notice .wpr-pro-notice,
645
+ .elementor-control-menu_items_submenu_entrance_pro_notice .wpr-pro-notice,
646
+ .elementor-control-switcher_label_style_pro_notice .wpr-pro-notice,
647
+ .elementor-control-countdown_type_pro_notice .wpr-pro-notice,
648
+ .elementor-control-layout_pro_notice .wpr-pro-notice,
649
+ .elementor-control-anim_timing_pro_notice .wpr-pro-notice,
650
+ .elementor-control-tab_content_type_pro_notice .wpr-pro-notice,
651
+ .elementor-control-tabs_repeater_pro_notice .wpr-pro-notice,
652
+ .elementor-control-tabs_align_pro_notice .wpr-pro-notice,
653
+ .elementor-control-front_trigger_pro_notice .wpr-pro-notice,
654
+ .elementor-control-back_link_type_pro_notice .wpr-pro-notice,
655
+ .elementor-control-box_anim_timing_pro_notice .wpr-pro-notice,
656
+ .elementor-control-image_style_pro_notice .wpr-pro-notice,
657
+ .elementor-control-image_animation_timing_pro_notice .wpr-pro-notice,
658
+ .elementor-control-label_display_pro_notice .wpr-pro-notice,
659
+ .elementor-control-post_type_pro_notice .wpr-pro-notice,
660
+ .elementor-control-type_select_pro_notice .wpr-pro-notice,
661
+ .elementor-control-icon_style_pro_notice .wpr-pro-notice,
662
+ .elementor-control-dual_button_pro_notice .wpr-pro-notice,
663
+ .elementor-control-team_member_pro_notice .wpr-pro-notice,
664
+ .elementor-control-price_list_pro_notice .wpr-pro-notice,
665
+ .elementor-control-business_hours_pro_notice .wpr-pro-notice,
666
+ .elementor-control-sharing_columns_pro_notice .wpr-pro-notice,
667
+ .elementor-control-popup_trigger_pro_notice .wpr-pro-notice,
668
+ .elementor-control-popup_show_again_delay_pro_notice .wpr-pro-notice,
669
+ .elementor-control-group_popup_settings_pro_notice .wpr-pro-notice {
670
+ border-bottom: none !important;
671
+ }
672
+
673
+ /* Both */
674
+ .elementor-control.elementor-control-pagination_type_pro_notice,
675
+ .elementor-control.elementor-control-tooltip_trigger_pro_notice {
676
+ padding-top: 0 !important;
677
+ padding-bottom: 0 !important;
678
+ }
679
+
680
+ .elementor-control-pagination_type_pro_notice .wpr-pro-notice {
681
+ border-top: none !important;
682
+ border-bottom: none !important;
683
+ }
684
+
685
+ .elementor-control-pro_features_section .elementor-section-toggle,
686
+ .elementor-control-pro_features_section .elementor-section-title {
687
+ color: #f54;
688
+ }
689
+
690
+ .elementor-control-pro_features_section .elementor-section-title {
691
+ line-height: 20px;
692
+ }
693
+ .elementor-control-pro_features_section .elementor-section-title .dashicons {
694
+ line-height: 20px;
695
+ font-size: 13px;
696
+ }
697
+
698
+ .wpr-pro-features-list {
699
+ text-align: center;
700
+ }
701
+
702
+ .wpr-pro-features-list ul {
703
+ text-align: left;
704
+ }
705
+
706
+ .wpr-pro-features-list ul li {
707
+ position: relative;
708
+ line-height: 22px;
709
+ padding-left: 20px;
710
+ }
711
+
712
+ .wpr-pro-features-list ul li::before {
713
+ content: '.';
714
+ font-size: 38px;
715
+ position: absolute;
716
+ top: -11px;
717
+ left: 0;
718
+ }
719
+
720
+ .wpr-pro-features-list ul + a {
721
+ display: inline-block;
722
+ background-color: #f54;
723
+ color: #fff;
724
+ margin: 15px 15px 10px 0;
725
+ padding: 7px 12px;
726
+ border-radius: 3px;
727
+ }
728
+
729
+ .wpr-pro-features-list ul + a:hover {
730
+ color: #fff;
731
+ }
732
+
733
+ /* Video Tutorial Link */
734
+ .elementor-control[class*="video_tutorial"] {
735
+ padding-top: 0 !important;
736
+ padding-bottom: 5px !important;
737
+ }
738
+
739
+ .elementor-control[class*="video_tutorial"] a {
740
+ line-height: 16px;
741
+ font-size: 12px;
742
+ }
743
+
744
+ .elementor-control[class*="video_tutorial"] a .dashicons {
745
+ font-size: 16px;
746
+ }
747
+
748
+
749
+ /*--------------------------------------------------------------
750
+ == Elementor Search Notice
751
+ --------------------------------------------------------------*/
752
+ .wpr-elementor-search-notice {
753
+ background: #fff;
754
+ font-size: 13px;
755
+ padding: 20px;
756
+ line-height: 18px;
757
+ margin: 10px;
758
+ border-left: 3px solid #71d7f7;
759
+ -webkit-box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
760
+ box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
761
  }
assets/css/lib/animations/button-animations.css CHANGED
@@ -1,1629 +1,1629 @@
1
- /*!
2
- * Hover.css (http://ianlunn.github.io/Hover/)
3
- * Version: 2.3.2
4
- * Author: Ian Lunn @IanLunn
5
- * Author URL: http://ianlunn.co.uk/
6
- * Github: https://github.com/IanLunn/Hover
7
-
8
- * Hover.css Copyright Ian Lunn 2017. Generated with Sass.
9
- */
10
-
11
-
12
- /* 2D TRANSITIONS */
13
- /* Forward */
14
- .elementor-animation-forward {
15
- display: inline-block;
16
- vertical-align: middle;
17
- -webkit-transform: perspective(1px) translateZ(0);
18
- transform: perspective(1px) translateZ(0);
19
- -webkit-transition-duration: 0.3s;
20
- -o-transition-duration: 0.3s;
21
- transition-duration: 0.3s;
22
- -webkit-transition-property: transform;
23
- -webkit-transition-property: -webkit-transform;
24
- transition-property: -webkit-transform;
25
- -o-transition-property: transform;
26
- transition-property: transform;
27
- transition-property: transform, -webkit-transform;
28
- }
29
- .elementor-animation-forward:hover, .elementor-animation-forward:focus, .elementor-animation-forward:active {
30
- -webkit-transform: translateX(8px);
31
- -ms-transform: translateX(8px);
32
- transform: translateX(8px);
33
- }
34
-
35
- /* Backward */
36
- .elementor-animation-backward {
37
- display: inline-block;
38
- vertical-align: middle;
39
- -webkit-transform: perspective(1px) translateZ(0);
40
- transform: perspective(1px) translateZ(0);
41
- -webkit-transition-duration: 0.3s;
42
- -o-transition-duration: 0.3s;
43
- transition-duration: 0.3s;
44
- -webkit-transition-property: transform;
45
- -webkit-transition-property: -webkit-transform;
46
- transition-property: -webkit-transform;
47
- -o-transition-property: transform;
48
- transition-property: transform;
49
- transition-property: transform, -webkit-transform;
50
- }
51
- .elementor-animation-backward:hover, .elementor-animation-backward:focus, .elementor-animation-backward:active {
52
- -webkit-transform: translateX(-8px);
53
- -ms-transform: translateX(-8px);
54
- transform: translateX(-8px);
55
- }
56
-
57
- /* BACKGROUND TRANSITIONS */
58
- /* Back Pulse */
59
- @-webkit-keyframes wpr-button-back-pulse {
60
- 50% {
61
- opacity: 0.5;
62
- }
63
- }
64
- @keyframes wpr-button-back-pulse {
65
- 50% {
66
- opacity: 0.5;
67
- }
68
- }
69
-
70
- .wpr-button-back-pulse:before {
71
- content: "";
72
- width: 100%;
73
- height: 100%;
74
- position: absolute;
75
- top: 0;
76
- left: 0;
77
- opacity: 0;
78
- z-index: -1;
79
- }
80
-
81
- .wpr-button-back-pulse:hover:before {
82
- opacity: 1;
83
- -webkit-animation-name: wpr-button-back-pulse;
84
- animation-name: wpr-button-back-pulse;
85
- -webkit-animation-duration: 1s;
86
- animation-duration: 1s;
87
- -webkit-animation-delay: 0.5s;
88
- animation-delay: 0.5s;
89
- -webkit-animation-timing-function: linear;
90
- animation-timing-function: linear;
91
- -webkit-animation-iteration-count: infinite;
92
- animation-iteration-count: infinite;
93
- }
94
-
95
- /* Sweep To Right */
96
- .wpr-button-sweep-to-right {
97
- display: inline-block;
98
- vertical-align: middle;
99
- -webkit-transform: perspective(1px) translateZ(0);
100
- transform: perspective(1px) translateZ(0);
101
- position: relative;
102
- -webkit-transition-property: color;
103
- -o-transition-property: color;
104
- transition-property: color;
105
- -webkit-transition-duration: 0.3s;
106
- -o-transition-duration: 0.3s;
107
- transition-duration: 0.3s;
108
- }
109
- .wpr-button-sweep-to-right:before {
110
- content: "";
111
- position: absolute;
112
- z-index: -1;
113
- top: 0;
114
- left: 0;
115
- right: 0;
116
- bottom: 0;
117
- -webkit-transform: scaleX(0);
118
- -ms-transform: scaleX(0);
119
- transform: scaleX(0);
120
- -webkit-transform-origin: 0 50%;
121
- -ms-transform-origin: 0 50%;
122
- transform-origin: 0 50%;
123
- -webkit-transition-property: transform;
124
- -webkit-transition-property: -webkit-transform;
125
- transition-property: -webkit-transform;
126
- -o-transition-property: transform;
127
- transition-property: transform;
128
- transition-property: transform, -webkit-transform;
129
- -webkit-transition-duration: 0.3s;
130
- -o-transition-duration: 0.3s;
131
- transition-duration: 0.3s;
132
- -webkit-transition-timing-function: ease-out;
133
- -o-transition-timing-function: ease-out;
134
- transition-timing-function: ease-out;
135
- }
136
- .wpr-button-sweep-to-right:hover:before, .wpr-button-sweep-to-right:focus:before, .wpr-button-sweep-to-right:active:before {
137
- -webkit-transform: scaleX(1);
138
- -ms-transform: scaleX(1);
139
- transform: scaleX(1);
140
- }
141
-
142
- /* Sweep To Left */
143
- .wpr-button-sweep-to-left {
144
- display: inline-block;
145
- vertical-align: middle;
146
- -webkit-transform: perspective(1px) translateZ(0);
147
- transform: perspective(1px) translateZ(0);
148
- position: relative;
149
- -webkit-transition-property: color;
150
- -o-transition-property: color;
151
- transition-property: color;
152
- -webkit-transition-duration: 0.3s;
153
- -o-transition-duration: 0.3s;
154
- transition-duration: 0.3s;
155
- }
156
- .wpr-button-sweep-to-left:before {
157
- content: "";
158
- position: absolute;
159
- z-index: -1;
160
- top: 0;
161
- left: 0;
162
- right: 0;
163
- bottom: 0;
164
- -webkit-transform: scaleX(0);
165
- -ms-transform: scaleX(0);
166
- transform: scaleX(0);
167
- -webkit-transform-origin: 100% 50%;
168
- -ms-transform-origin: 100% 50%;
169
- transform-origin: 100% 50%;
170
- -webkit-transition-property: transform;
171
- -webkit-transition-property: -webkit-transform;
172
- transition-property: -webkit-transform;
173
- -o-transition-property: transform;
174
- transition-property: transform;
175
- transition-property: transform, -webkit-transform;
176
- -webkit-transition-duration: 0.3s;
177
- -o-transition-duration: 0.3s;
178
- transition-duration: 0.3s;
179
- -webkit-transition-timing-function: ease-out;
180
- -o-transition-timing-function: ease-out;
181
- transition-timing-function: ease-out;
182
- }
183
- .wpr-button-sweep-to-left:hover:before, .wpr-button-sweep-to-left:focus:before, .wpr-button-sweep-to-left:active:before {
184
- -webkit-transform: scaleX(1);
185
- -ms-transform: scaleX(1);
186
- transform: scaleX(1);
187
- }
188
-
189
- /* Sweep To Bottom */
190
- .wpr-button-sweep-to-bottom {
191
- display: inline-block;
192
- vertical-align: middle;
193
- -webkit-transform: perspective(1px) translateZ(0);
194
- transform: perspective(1px) translateZ(0);
195
- position: relative;
196
- -webkit-transition-property: color;
197
- -o-transition-property: color;
198
- transition-property: color;
199
- -webkit-transition-duration: 0.3s;
200
- -o-transition-duration: 0.3s;
201
- transition-duration: 0.3s;
202
- }
203
- .wpr-button-sweep-to-bottom:before {
204
- content: "";
205
- position: absolute;
206
- z-index: -1;
207
- top: 0;
208
- left: 0;
209
- right: 0;
210
- bottom: 0;
211
- -webkit-transform: scaleY(0);
212
- -ms-transform: scaleY(0);
213
- transform: scaleY(0);
214
- -webkit-transform-origin: 50% 0;
215
- -ms-transform-origin: 50% 0;
216
- transform-origin: 50% 0;
217
- -webkit-transition-property: transform;
218
- -webkit-transition-property: -webkit-transform;
219
- transition-property: -webkit-transform;
220
- -o-transition-property: transform;
221
- transition-property: transform;
222
- transition-property: transform, -webkit-transform;
223
- -webkit-transition-duration: 0.3s;
224
- -o-transition-duration: 0.3s;
225
- transition-duration: 0.3s;
226
- -webkit-transition-timing-function: ease-out;
227
- -o-transition-timing-function: ease-out;
228
- transition-timing-function: ease-out;
229
- }
230
- .wpr-button-sweep-to-bottom:hover:before, .wpr-button-sweep-to-bottom:focus:before, .wpr-button-sweep-to-bottom:active:before {
231
- -webkit-transform: scaleY(1);
232
- -ms-transform: scaleY(1);
233
- transform: scaleY(1);
234
- }
235
-
236
- /* Sweep To Top */
237
- .wpr-button-sweep-to-top {
238
- display: inline-block;
239
- vertical-align: middle;
240
- -webkit-transform: perspective(1px) translateZ(0);
241
- transform: perspective(1px) translateZ(0);
242
- position: relative;
243
- -webkit-transition-property: color;
244
- -o-transition-property: color;
245
- transition-property: color;
246
- -webkit-transition-duration: 0.3s;
247
- -o-transition-duration: 0.3s;
248
- transition-duration: 0.3s;
249
- }
250
- .wpr-button-sweep-to-top:before {
251
- content: "";
252
- position: absolute;
253
- z-index: -1;
254
- top: 0;
255
- left: 0;
256
- right: 0;
257
- bottom: 0;
258
- -webkit-transform: scaleY(0);
259
- -ms-transform: scaleY(0);
260
- transform: scaleY(0);
261
- -webkit-transform-origin: 50% 100%;
262
- -ms-transform-origin: 50% 100%;
263
- transform-origin: 50% 100%;
264
- -webkit-transition-property: transform;
265
- -webkit-transition-property: -webkit-transform;
266
- transition-property: -webkit-transform;
267
- -o-transition-property: transform;
268
- transition-property: transform;
269
- transition-property: transform, -webkit-transform;
270
- -webkit-transition-duration: 0.3s;
271
- -o-transition-duration: 0.3s;
272
- transition-duration: 0.3s;
273
- -webkit-transition-timing-function: ease-out;
274
- -o-transition-timing-function: ease-out;
275
- transition-timing-function: ease-out;
276
- }
277
- .wpr-button-sweep-to-top:hover:before, .wpr-button-sweep-to-top:focus:before, .wpr-button-sweep-to-top:active:before {
278
- -webkit-transform: scaleY(1);
279
- -ms-transform: scaleY(1);
280
- transform: scaleY(1);
281
- }
282
-
283
- /* Bounce To Right */
284
- .wpr-button-bounce-to-right {
285
- display: inline-block;
286
- vertical-align: middle;
287
- -webkit-transform: perspective(1px) translateZ(0);
288
- transform: perspective(1px) translateZ(0);
289
- position: relative;
290
- -webkit-transition-property: color;
291
- -o-transition-property: color;
292
- transition-property: color;
293
- -webkit-transition-duration: 0.5s;
294
- -o-transition-duration: 0.5s;
295
- transition-duration: 0.5s;
296
- }
297
- .wpr-button-bounce-to-right:before {
298
- content: "";
299
- position: absolute;
300
- z-index: -1;
301
- top: 0;
302
- left: 0;
303
- right: 0;
304
- bottom: 0;
305
- -webkit-transform: scaleX(0);
306
- -ms-transform: scaleX(0);
307
- transform: scaleX(0);
308
- -webkit-transform-origin: 0 50%;
309
- -ms-transform-origin: 0 50%;
310
- transform-origin: 0 50%;
311
- -webkit-transition-property: transform;
312
- -webkit-transition-property: -webkit-transform;
313
- transition-property: -webkit-transform;
314
- -o-transition-property: transform;
315
- transition-property: transform;
316
- transition-property: transform, -webkit-transform;
317
- -webkit-transition-duration: 0.5s;
318
- -o-transition-duration: 0.5s;
319
- transition-duration: 0.5s;
320
- -webkit-transition-timing-function: ease-out;
321
- -o-transition-timing-function: ease-out;
322
- transition-timing-function: ease-out;
323
- }
324
-
325
- .wpr-button-bounce-to-right:hover:before, .wpr-button-bounce-to-right:focus:before, .wpr-button-bounce-to-right:active:before {
326
- -webkit-transform: scaleX(1);
327
- -ms-transform: scaleX(1);
328
- transform: scaleX(1);
329
- -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
330
- -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
331
- transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
332
- }
333
-
334
- /* Bounce To Left */
335
- .wpr-button-bounce-to-left {
336
- display: inline-block;
337
- vertical-align: middle;
338
- -webkit-transform: perspective(1px) translateZ(0);
339
- transform: perspective(1px) translateZ(0);
340
- position: relative;
341
- -webkit-transition-property: color;
342
- -o-transition-property: color;
343
- transition-property: color;
344
- -webkit-transition-duration: 0.5s;
345
- -o-transition-duration: 0.5s;
346
- transition-duration: 0.5s;
347
- }
348
- .wpr-button-bounce-to-left:before {
349
- content: "";
350
- position: absolute;
351
- z-index: -1;
352
- top: 0;
353
- left: 0;
354
- right: 0;
355
- bottom: 0;
356
- -webkit-transform: scaleX(0);
357
- -ms-transform: scaleX(0);
358
- transform: scaleX(0);
359
- -webkit-transform-origin: 100% 50%;
360
- -ms-transform-origin: 100% 50%;
361
- transform-origin: 100% 50%;
362
- -webkit-transition-property: transform;
363
- -webkit-transition-property: -webkit-transform;
364
- transition-property: -webkit-transform;
365
- -o-transition-property: transform;
366
- transition-property: transform;
367
- transition-property: transform, -webkit-transform;
368
- -webkit-transition-duration: 0.5s;
369
- -o-transition-duration: 0.5s;
370
- transition-duration: 0.5s;
371
- -webkit-transition-timing-function: ease-out;
372
- -o-transition-timing-function: ease-out;
373
- transition-timing-function: ease-out;
374
- }
375
- .wpr-button-bounce-to-left:hover:before, .wpr-button-bounce-to-left:focus:before, .wpr-button-bounce-to-left:active:before {
376
- -webkit-transform: scaleX(1);
377
- -ms-transform: scaleX(1);
378
- transform: scaleX(1);
379
- -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
380
- -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
381
- transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
382
- }
383
-
384
- /* Bounce To Bottom */
385
- .wpr-button-bounce-to-bottom {
386
- display: inline-block;
387
- vertical-align: middle;
388
- -webkit-transform: perspective(1px) translateZ(0);
389
- transform: perspective(1px) translateZ(0);
390
- position: relative;
391
- -webkit-transition-property: color;
392
- -o-transition-property: color;
393
- transition-property: color;
394
- -webkit-transition-duration: 0.5s;
395
- -o-transition-duration: 0.5s;
396
- transition-duration: 0.5s;
397
- }
398
- .wpr-button-bounce-to-bottom:before {
399
- content: "";
400
- position: absolute;
401
- z-index: -1;
402
- top: 0;
403
- left: 0;
404
- right: 0;
405
- bottom: 0;
406
- -webkit-transform: scaleY(0);
407
- -ms-transform: scaleY(0);
408
- transform: scaleY(0);
409
- -webkit-transform-origin: 50% 0;
410
- -ms-transform-origin: 50% 0;
411
- transform-origin: 50% 0;
412
- -webkit-transition-property: transform;
413
- -webkit-transition-property: -webkit-transform;
414
- transition-property: -webkit-transform;
415
- -o-transition-property: transform;
416
- transition-property: transform;
417
- transition-property: transform, -webkit-transform;
418
- -webkit-transition-duration: 0.5s;
419
- -o-transition-duration: 0.5s;
420
- transition-duration: 0.5s;
421
- -webkit-transition-timing-function: ease-out;
422
- -o-transition-timing-function: ease-out;
423
- transition-timing-function: ease-out;
424
- }
425
- .wpr-button-bounce-to-bottom:hover:before, .wpr-button-bounce-to-bottom:focus:before, .wpr-button-bounce-to-bottom:active:before {
426
- -webkit-transform: scaleY(1);
427
- -ms-transform: scaleY(1);
428
- transform: scaleY(1);
429
- -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
430
- -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
431
- transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
432
- }
433
-
434
- /* Bounce To Top */
435
- .wpr-button-bounce-to-top {
436
- display: inline-block;
437
- vertical-align: middle;
438
- -webkit-transform: perspective(1px) translateZ(0);
439
- transform: perspective(1px) translateZ(0);
440
- position: relative;
441
- -webkit-transition-property: color;
442
- -o-transition-property: color;
443
- transition-property: color;
444
- -webkit-transition-duration: 0.5s;
445
- -o-transition-duration: 0.5s;
446
- transition-duration: 0.5s;
447
- }
448
- .wpr-button-bounce-to-top:before {
449
- content: "";
450
- position: absolute;
451
- z-index: -1;
452
- top: 0;
453
- left: 0;
454
- right: 0;
455
- bottom: 0;
456
- -webkit-transform: scaleY(0);
457
- -ms-transform: scaleY(0);
458
- transform: scaleY(0);
459
- -webkit-transform-origin: 50% 100%;
460
- -ms-transform-origin: 50% 100%;
461
- transform-origin: 50% 100%;
462
- -webkit-transition-property: transform;
463
- -webkit-transition-property: -webkit-transform;
464
- transition-property: -webkit-transform;
465
- -o-transition-property: transform;
466
- transition-property: transform;
467
- transition-property: transform, -webkit-transform;
468
- -webkit-transition-duration: 0.5s;
469
- -o-transition-duration: 0.5s;
470
- transition-duration: 0.5s;
471
- -webkit-transition-timing-function: ease-out;
472
- -o-transition-timing-function: ease-out;
473
- transition-timing-function: ease-out;
474
- }
475
- .wpr-button-bounce-to-top:hover, .wpr-button-bounce-to-top:focus, .wpr-button-bounce-to-top:active {
476
- color: white;
477
- }
478
- .wpr-button-bounce-to-top:hover:before, .wpr-button-bounce-to-top:focus:before, .wpr-button-bounce-to-top:active:before {
479
- -webkit-transform: scaleY(1);
480
- -ms-transform: scaleY(1);
481
- transform: scaleY(1);
482
- -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
483
- -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
484
- transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
485
- }
486
-
487
- /* Radial Out */
488
- .wpr-button-radial-out {
489
- display: inline-block;
490
- vertical-align: middle;
491
- -webkit-transform: perspective(1px) translateZ(0);
492
- transform: perspective(1px) translateZ(0);
493
- position: relative;
494
- overflow: hidden;
495
- -webkit-transition-property: color;
496
- -o-transition-property: color;
497
- transition-property: color;
498
- -webkit-transition-duration: 0.3s;
499
- -o-transition-duration: 0.3s;
500
- transition-duration: 0.3s;
501
- }
502
- .wpr-button-radial-out:before {
503
- content: "";
504
- position: absolute;
505
- z-index: -1;
506
- top: 0;
507
- left: 0;
508
- right: 0;
509
- bottom: 0;
510
- border-radius: 100%;
511
- -webkit-transform: scale(0);
512
- -ms-transform: scale(0);
513
- transform: scale(0);
514
- -webkit-transition-property: transform;
515
- -webkit-transition-property: -webkit-transform;
516
- transition-property: -webkit-transform;
517
- -o-transition-property: transform;
518
- transition-property: transform;
519
- transition-property: transform, -webkit-transform;
520
- -webkit-transition-duration: 0.3s;
521
- -o-transition-duration: 0.3s;
522
- transition-duration: 0.3s;
523
- -webkit-transition-timing-function: ease-out;
524
- -o-transition-timing-function: ease-out;
525
- transition-timing-function: ease-out;
526
- }
527
- .wpr-button-radial-out:hover, .wpr-button-radial-out:focus, .wpr-button-radial-out:active {
528
- color: white;
529
- }
530
- .wpr-button-radial-out:hover:before, .wpr-button-radial-out:focus:before, .wpr-button-radial-out:active:before {
531
- -webkit-transform: scale(2);
532
- -ms-transform: scale(2);
533
- transform: scale(2);
534
- }
535
-
536
- /* Radial In */
537
- .wpr-button-radial-in {
538
- display: inline-block;
539
- vertical-align: middle;
540
- -webkit-transform: perspective(1px) translateZ(0);
541
- transform: perspective(1px) translateZ(0);
542
- position: relative;
543
- overflow: hidden;
544
- -webkit-transition-property: color;
545
- -o-transition-property: color;
546
- transition-property: color;
547
- -webkit-transition-duration: 0.3s;
548
- -o-transition-duration: 0.3s;
549
- transition-duration: 0.3s;
550
- }
551
- .wpr-button-radial-in:before {
552
- content: "";
553
- position: absolute;
554
- z-index: -1;
555
- top: 0;
556
- left: 0;
557
- right: 0;
558
- bottom: 0;
559
- border-radius: 100%;
560
- -webkit-transform: scale(2);
561
- -ms-transform: scale(2);
562
- transform: scale(2);
563
- -webkit-transition-property: transform;
564
- -webkit-transition-property: -webkit-transform;
565
- transition-property: -webkit-transform;
566
- -o-transition-property: transform;
567
- transition-property: transform;
568
- transition-property: transform, -webkit-transform;
569
- -webkit-transition-duration: 0.3s;
570
- -o-transition-duration: 0.3s;
571
- transition-duration: 0.3s;
572
- -webkit-transition-timing-function: ease-out;
573
- -o-transition-timing-function: ease-out;
574
- transition-timing-function: ease-out;
575
- }
576
- .wpr-button-radial-in:hover, .wpr-button-radial-in:focus, .wpr-button-radial-in:active {
577
- color: white;
578
- }
579
- .wpr-button-radial-in:hover:before, .wpr-button-radial-in:focus:before, .wpr-button-radial-in:active:before {
580
- -webkit-transform: scale(0);
581
- -ms-transform: scale(0);
582
- transform: scale(0);
583
- }
584
-
585
- /* Rectangle In */
586
- .wpr-button-rectangle-in {
587
- display: inline-block;
588
- vertical-align: middle;
589
- -webkit-transform: perspective(1px) translateZ(0);
590
- transform: perspective(1px) translateZ(0);
591
- position: relative;
592
- -webkit-transition-property: color;
593
- -o-transition-property: color;
594
- transition-property: color;
595
- -webkit-transition-duration: 0.3s;
596
- -o-transition-duration: 0.3s;
597
- transition-duration: 0.3s;
598
- }
599
- .wpr-button-rectangle-in:before {
600
- content: "";
601
- position: absolute;
602
- z-index: -1;
603
- top: 0;
604
- left: 0;
605
- right: 0;
606
- bottom: 0;
607
- -webkit-transform: scale(1);
608
- -ms-transform: scale(1);
609
- transform: scale(1);
610
- -webkit-transition-property: transform;
611
- -webkit-transition-property: -webkit-transform;
612
- transition-property: -webkit-transform;
613
- -o-transition-property: transform;
614
- transition-property: transform;
615
- transition-property: transform, -webkit-transform;
616
- -webkit-transition-duration: 0.3s;
617
- -o-transition-duration: 0.3s;
618
- transition-duration: 0.3s;
619
- -webkit-transition-timing-function: ease-out;
620
- -o-transition-timing-function: ease-out;
621
- transition-timing-function: ease-out;
622
- }
623
- .wpr-button-rectangle-in:hover:before, .wpr-button-rectangle-in:focus:before, .wpr-button-rectangle-in:active:before {
624
- -webkit-transform: scale(0);
625
- -ms-transform: scale(0);
626
- transform: scale(0);
627
- }
628
-
629
- /* Rectangle Out */
630
- .wpr-button-rectangle-out {
631
- display: inline-block;
632
- vertical-align: middle;
633
- -webkit-transform: perspective(1px) translateZ(0);
634
- transform: perspective(1px) translateZ(0);
635
- position: relative;
636
- -webkit-transition-property: color;
637
- -o-transition-property: color;
638
- transition-property: color;
639
- -webkit-transition-duration: 0.3s;
640
- -o-transition-duration: 0.3s;
641
- transition-duration: 0.3s;
642
- }
643
- .wpr-button-rectangle-out:before {
644
- content: "";
645
- position: absolute;
646
- z-index: -1;
647
- top: 0;
648
- left: 0;
649
- right: 0;
650
- bottom: 0;
651
- -webkit-transform: scale(0);
652
- -ms-transform: scale(0);
653
- transform: scale(0);
654
- -webkit-transition-property: transform;
655
- -webkit-transition-property: -webkit-transform;
656
- transition-property: -webkit-transform;
657
- -o-transition-property: transform;
658
- transition-property: transform;
659
- transition-property: transform, -webkit-transform;
660
- -webkit-transition-duration: 0.3s;
661
- -o-transition-duration: 0.3s;
662
- transition-duration: 0.3s;
663
- -webkit-transition-timing-function: ease-out;
664
- -o-transition-timing-function: ease-out;
665
- transition-timing-function: ease-out;
666
- }
667
- .wpr-button-rectangle-out:hover:before, .wpr-button-rectangle-out:focus:before, .wpr-button-rectangle-out:active:before {
668
- -webkit-transform: scale(1);
669
- -ms-transform: scale(1);
670
- transform: scale(1);
671
- }
672
-
673
- /* Shutter In Horizontal */
674
- .wpr-button-shutter-in-horizontal {
675
- display: inline-block;
676
- vertical-align: middle;
677
- -webkit-transform: perspective(1px) translateZ(0);
678
- transform: perspective(1px) translateZ(0);
679
- position: relative;
680
- -webkit-transition-property: color;
681
- -o-transition-property: color;
682
- transition-property: color;
683
- -webkit-transition-duration: 0.3s;
684
- -o-transition-duration: 0.3s;
685
- transition-duration: 0.3s;
686
- }
687
- .wpr-button-shutter-in-horizontal:before {
688
- content: "";
689
- position: absolute;
690
- z-index: -1;
691
- top: 0;
692
- bottom: 0;
693
- left: 0;
694
- right: 0;
695
- -webkit-transform: scaleX(1);
696
- -ms-transform: scaleX(1);
697
- transform: scaleX(1);
698
- -webkit-transform-origin: 50%;
699
- -ms-transform-origin: 50%;
700
- transform-origin: 50%;
701
- -webkit-transition-property: transform;
702
- -webkit-transition-property: -webkit-transform;
703
- transition-property: -webkit-transform;
704
- -o-transition-property: transform;
705
- transition-property: transform;
706
- transition-property: transform, -webkit-transform;
707
- -webkit-transition-duration: 0.3s;
708
- -o-transition-duration: 0.3s;
709
- transition-duration: 0.3s;
710
- -webkit-transition-timing-function: ease-out;
711
- -o-transition-timing-function: ease-out;
712
- transition-timing-function: ease-out;
713
- }
714
- .wpr-button-shutter-in-horizontal:hover:before, .wpr-button-shutter-in-horizontal:focus:before, .wpr-button-shutter-in-horizontal:active:before {
715
- -webkit-transform: scaleX(0);
716
- -ms-transform: scaleX(0);
717
- transform: scaleX(0);
718
- }
719
-
720
- /* Shutter Out Horizontal */
721
- .wpr-button-shutter-out-horizontal {
722
- display: inline-block;
723
- vertical-align: middle;
724
- -webkit-transform: perspective(1px) translateZ(0);
725
- transform: perspective(1px) translateZ(0);
726
- position: relative;
727
- -webkit-transition-property: color;
728
- -o-transition-property: color;
729
- transition-property: color;
730
- -webkit-transition-duration: 0.3s;
731
- -o-transition-duration: 0.3s;
732
- transition-duration: 0.3s;
733
- }
734
- .wpr-button-shutter-out-horizontal:before {
735
- content: "";
736
- position: absolute;
737
- z-index: -1;
738
- top: 0;
739
- bottom: 0;
740
- left: 0;
741
- right: 0;
742
- -webkit-transform: scaleX(0);
743
- -ms-transform: scaleX(0);
744
- transform: scaleX(0);
745
- -webkit-transform-origin: 50%;
746
- -ms-transform-origin: 50%;
747
- transform-origin: 50%;
748
- -webkit-transition-property: transform;
749
- -webkit-transition-property: -webkit-transform;
750
- transition-property: -webkit-transform;
751
- -o-transition-property: transform;
752
- transition-property: transform;
753
- transition-property: transform, -webkit-transform;
754
- -webkit-transition-duration: 0.3s;
755
- -o-transition-duration: 0.3s;
756
- transition-duration: 0.3s;
757
- -webkit-transition-timing-function: ease-out;
758
- -o-transition-timing-function: ease-out;
759
- transition-timing-function: ease-out;
760
- }
761
- .wpr-button-shutter-out-horizontal:hover:before, .wpr-button-shutter-out-horizontal:focus:before, .wpr-button-shutter-out-horizontal:active:before {
762
- -webkit-transform: scaleX(1);
763
- -ms-transform: scaleX(1);
764
- transform: scaleX(1);
765
- }
766
-
767
- /* Shutter In Vertical */
768
- .wpr-button-shutter-in-vertical {
769
- display: inline-block;
770
- vertical-align: middle;
771
- -webkit-transform: perspective(1px) translateZ(0);
772
- transform: perspective(1px) translateZ(0);
773
- position: relative;
774
- -webkit-transition-property: color;
775
- -o-transition-property: color;
776
- transition-property: color;
777
- -webkit-transition-duration: 0.3s;
778
- -o-transition-duration: 0.3s;
779
- transition-duration: 0.3s;
780
- }
781
- .wpr-button-shutter-in-vertical:before {
782
- content: "";
783
- position: absolute;
784
- z-index: -1;
785
- top: 0;
786
- bottom: 0;
787
- left: 0;
788
- right: 0;
789
- -webkit-transform: scaleY(1);
790
- -ms-transform: scaleY(1);
791
- transform: scaleY(1);
792
- -webkit-transform-origin: 50%;
793
- -ms-transform-origin: 50%;
794
- transform-origin: 50%;
795
- -webkit-transition-property: transform;
796
- -webkit-transition-property: -webkit-transform;
797
- transition-property: -webkit-transform;
798
- -o-transition-property: transform;
799
- transition-property: transform;
800
- transition-property: transform, -webkit-transform;
801
- -webkit-transition-duration: 0.3s;
802
- -o-transition-duration: 0.3s;
803
- transition-duration: 0.3s;
804
- -webkit-transition-timing-function: ease-out;
805
- -o-transition-timing-function: ease-out;
806
- transition-timing-function: ease-out;
807
- }
808
- .wpr-button-shutter-in-vertical:hover:before, .wpr-button-shutter-in-vertical:focus:before, .wpr-button-shutter-in-vertical:active:before {
809
- -webkit-transform: scaleY(0);
810
- -ms-transform: scaleY(0);
811
- transform: scaleY(0);
812
- }
813
-
814
- /* Shutter Out Vertical */
815
- .wpr-button-shutter-out-vertical {
816
- display: inline-block;
817
- vertical-align: middle;
818
- -webkit-transform: perspective(1px) translateZ(0);
819
- transform: perspective(1px) translateZ(0);
820
- position: relative;
821
- -webkit-transition-property: color;
822
- -o-transition-property: color;
823
- transition-property: color;
824
- -webkit-transition-duration: 0.3s;
825
- -o-transition-duration: 0.3s;
826
- transition-duration: 0.3s;
827
- }
828
- .wpr-button-shutter-out-vertical:before {
829
- content: "";
830
- position: absolute;
831
- z-index: -1;
832
- top: 0;
833
- bottom: 0;
834
- left: 0;
835
- right: 0;
836
- -webkit-transform: scaleY(0);
837
- -ms-transform: scaleY(0);
838
- transform: scaleY(0);
839
- -webkit-transform-origin: 50%;
840
- -ms-transform-origin: 50%;
841
- transform-origin: 50%;
842
- -webkit-transition-property: transform;
843
- -webkit-transition-property: -webkit-transform;
844
- transition-property: -webkit-transform;
845
- -o-transition-property: transform;
846
- transition-property: transform;
847
- transition-property: transform, -webkit-transform;
848
- -webkit-transition-duration: 0.3s;
849
- -o-transition-duration: 0.3s;
850
- transition-duration: 0.3s;
851
- -webkit-transition-timing-function: ease-out;
852
- -o-transition-timing-function: ease-out;
853
- transition-timing-function: ease-out;
854
- }
855
-
856
- .wpr-button-shutter-out-vertical:hover:before, .wpr-button-shutter-out-vertical:focus:before, .wpr-button-shutter-out-vertical:active:before {
857
- -webkit-transform: scaleY(1);
858
- -ms-transform: scaleY(1);
859
- transform: scaleY(1);
860
- }
861
-
862
- /* BORDER TRANSITIONS */
863
-
864
- /* Underline From Left */
865
- .wpr-button-underline-from-left {
866
- display: inline-block;
867
- vertical-align: middle;
868
- -webkit-transform: perspective(1px) translateZ(0);
869
- transform: perspective(1px) translateZ(0);
870
- position: relative;
871
- border: none !important;
872
- overflow: hidden;
873
- }
874
- .wpr-button-underline-from-left:before {
875
- content: "";
876
- position: absolute;
877
- z-index: -1;
878
- left: 0;
879
- right: 100%;
880
- bottom: 0;
881
- height: 4px;
882
- -webkit-transition-property: right;
883
- -o-transition-property: right;
884
- transition-property: right;
885
- -webkit-transition-duration: 0.3s;
886
- -o-transition-duration: 0.3s;
887
- transition-duration: 0.3s;
888
- -webkit-transition-timing-function: ease-out;
889
- -o-transition-timing-function: ease-out;
890
- transition-timing-function: ease-out;
891
- }
892
- .wpr-button-underline-from-left:hover:before, .wpr-button-underline-from-left:focus:before, .wpr-button-underline-from-left:active:before {
893
- right: 0;
894
- }
895
-
896
- /* Underline From Center */
897
- .wpr-button-underline-from-center {
898
- display: inline-block;
899
- vertical-align: middle;
900
- -webkit-transform: perspective(1px) translateZ(0);
901
- transform: perspective(1px) translateZ(0);
902
- position: relative;
903
- border: none !important;
904
- overflow: hidden;
905
- }
906
- .wpr-button-underline-from-center:before {
907
- content: "";
908
- position: absolute;
909
- z-index: -1;
910
- left: 51%;
911
- right: 51%;
912
- bottom: 0;
913
- -webkit-transition-property: left, right;
914
- -o-transition-property: left, right;
915
- transition-property: left, right;
916
- -webkit-transition-duration: 0.3s;
917
- -o-transition-duration: 0.3s;
918
- transition-duration: 0.3s;
919
- -webkit-transition-timing-function: ease-out;
920
- -o-transition-timing-function: ease-out;
921
- transition-timing-function: ease-out;
922
- }
923
- .wpr-button-underline-from-center:hover:before, .wpr-button-underline-from-center:focus:before, .wpr-button-underline-from-center:active:before {
924
- left: 0;
925
- right: 0;
926
- }
927
-
928
- /* Underline From Right */
929
- .wpr-button-underline-from-right {
930
- display: inline-block;
931
- vertical-align: middle;
932
- -webkit-transform: perspective(1px) translateZ(0);
933
- transform: perspective(1px) translateZ(0);
934
- position: relative;
935
- border: none !important;
936
- overflow: hidden;
937
- }
938
- .wpr-button-underline-from-right:before {
939
- content: "";
940
- position: absolute;
941
- z-index: -1;
942
- left: 100%;
943
- right: 0;
944
- bottom: 0;
945
- -webkit-transition-property: left;
946
- -o-transition-property: left;
947
- transition-property: left;
948
- -webkit-transition-duration: 0.3s;
949
- -o-transition-duration: 0.3s;
950
- transition-duration: 0.3s;
951
- -webkit-transition-timing-function: ease-out;
952
- -o-transition-timing-function: ease-out;
953
- transition-timing-function: ease-out;
954
- }
955
- .wpr-button-underline-from-right:hover:before, .wpr-button-underline-from-right:focus:before, .wpr-button-underline-from-right:active:before {
956
- left: 0;
957
- }
958
-
959
- /* Overline From Left */
960
- .wpr-button-overline-from-left {
961
- display: inline-block;
962
- vertical-align: middle;
963
- -webkit-transform: perspective(1px) translateZ(0);
964
- transform: perspective(1px) translateZ(0);
965
- position: relative;
966
- border: none !important;
967
- overflow: hidden;
968
- }
969
- .wpr-button-overline-from-left:before {
970
- content: "";
971
- position: absolute;
972
- z-index: -1;
973
- left: 0;
974
- right: 100%;
975
- top: 0;
976
- -webkit-transition-property: right;
977
- -o-transition-property: right;
978
- transition-property: right;
979
- -webkit-transition-duration: 0.3s;
980
- -o-transition-duration: 0.3s;
981
- transition-duration: 0.3s;
982
- -webkit-transition-timing-function: ease-out;
983
- -o-transition-timing-function: ease-out;
984
- transition-timing-function: ease-out;
985
- }
986
- .wpr-button-overline-from-left:hover:before, .wpr-button-overline-from-left:focus:before, .wpr-button-overline-from-left:active:before {
987
- right: 0;
988
- }
989
-
990
- /* Overline From Center */
991
- .wpr-button-overline-from-center {
992
- display: inline-block;
993
- vertical-align: middle;
994
- -webkit-transform: perspective(1px) translateZ(0);
995
- transform: perspective(1px) translateZ(0);
996
- position: relative;
997
- border: none !important;
998
- overflow: hidden;
999
- }
1000
- .wpr-button-overline-from-center:before {
1001
- content: "";
1002
- position: absolute;
1003
- z-index: -1;
1004
- left: 51%;
1005
- right: 51%;
1006
- top: 0;
1007
- -webkit-transition-property: left, right;
1008
- -o-transition-property: left, right;
1009
- transition-property: left, right;
1010
- -webkit-transition-duration: 0.3s;
1011
- -o-transition-duration: 0.3s;
1012
- transition-duration: 0.3s;
1013
- -webkit-transition-timing-function: ease-out;
1014
- -o-transition-timing-function: ease-out;
1015
- transition-timing-function: ease-out;
1016
- }
1017
- .wpr-button-overline-from-center:hover:before, .wpr-button-overline-from-center:focus:before, .wpr-button-overline-from-center:active:before {
1018
- left: 0;
1019
- right: 0;
1020
- }
1021
-
1022
- /* Overline From Right */
1023
- .wpr-button-overline-from-right {
1024
- display: inline-block;
1025
- vertical-align: middle;
1026
- -webkit-transform: perspective(1px) translateZ(0);
1027
- transform: perspective(1px) translateZ(0);
1028
- position: relative;
1029
- border: none !important;
1030
- overflow: hidden;
1031
- }
1032
- .wpr-button-overline-from-right:before {
1033
- content: "";
1034
- position: absolute;
1035
- z-index: -1;
1036
- left: 100%;
1037
- right: 0;
1038
- top: 0;
1039
- -webkit-transition-property: left;
1040
- -o-transition-property: left;
1041
- transition-property: left;
1042
- -webkit-transition-duration: 0.3s;
1043
- -o-transition-duration: 0.3s;
1044
- transition-duration: 0.3s;
1045
- -webkit-transition-timing-function: ease-out;
1046
- -o-transition-timing-function: ease-out;
1047
- transition-timing-function: ease-out;
1048
- }
1049
- .wpr-button-overline-from-right:hover:before, .wpr-button-overline-from-right:focus:before, .wpr-button-overline-from-right:active:before {
1050
- left: 0;
1051
- }
1052
-
1053
- /* Underline Reveal */
1054
- .wpr-button-underline-reveal {
1055
- display: inline-block;
1056
- vertical-align: middle;
1057
- -webkit-transform: perspective(1px) translateZ(0);
1058
- transform: perspective(1px) translateZ(0);
1059
- position: relative;
1060
- border: none !important;
1061
- overflow: hidden;
1062
- }
1063
- .wpr-button-underline-reveal:before {
1064
- content: "";
1065
- position: absolute;
1066
- z-index: -1;
1067
- left: 0;
1068
- right: 0;
1069
- bottom: 0;
1070
- -webkit-transform: translateY(100%);
1071
- -ms-transform: translateY(100%);
1072
- transform: translateY(100%);
1073
- -webkit-transition-property: transform;
1074
- -webkit-transition-property: -webkit-transform;
1075
- transition-property: -webkit-transform;
1076
- -o-transition-property: transform;
1077
- transition-property: transform;
1078
- transition-property: transform, -webkit-transform;
1079
- -webkit-transition-duration: 0.3s;
1080
- -o-transition-duration: 0.3s;
1081
- transition-duration: 0.3s;
1082
- -webkit-transition-timing-function: ease-out;
1083
- -o-transition-timing-function: ease-out;
1084
- transition-timing-function: ease-out;
1085
- }
1086
- .wpr-button-underline-reveal:hover:before, .wpr-button-underline-reveal:focus:before, .wpr-button-underline-reveal:active:before {
1087
- -webkit-transform: translateY(0);
1088
- -ms-transform: translateY(0);
1089
- transform: translateY(0);
1090
- }
1091
-
1092
- /* Overline Reveal */
1093
- .wpr-button-overline-reveal {
1094
- display: inline-block;
1095
- vertical-align: middle;
1096
- -webkit-transform: perspective(1px) translateZ(0);
1097
- transform: perspective(1px) translateZ(0);
1098
- position: relative;
1099
- border: none !important;
1100
- overflow: hidden;
1101
- }
1102
- .wpr-button-overline-reveal:before {
1103
- content: "";
1104
- position: absolute;
1105
- z-index: -1;
1106
- left: 0;
1107
- right: 0;
1108
- top: 0;
1109
- -webkit-transform: translateY(-100%);
1110
- -ms-transform: translateY(-100%);
1111
- transform: translateY(-100%);
1112
- -webkit-transition-property: transform;
1113
- -webkit-transition-property: -webkit-transform;
1114
- transition-property: -webkit-transform;
1115
- -o-transition-property: transform;
1116
- transition-property: transform;
1117
- transition-property: transform, -webkit-transform;
1118
- -webkit-transition-duration: 0.3s;
1119
- -o-transition-duration: 0.3s;
1120
- transition-duration: 0.3s;
1121
- -webkit-transition-timing-function: ease-out;
1122
- -o-transition-timing-function: ease-out;
1123
- transition-timing-function: ease-out;
1124
- }
1125
- .wpr-button-overline-reveal:hover:before, .wpr-button-overline-reveal:focus:before, .wpr-button-overline-reveal:active:before {
1126
- -webkit-transform: translateY(0);
1127
- -ms-transform: translateY(0);
1128
- transform: translateY(0);
1129
- }
1130
-
1131
- /* Winona */
1132
- .wpr-button-winona {
1133
- overflow: hidden;
1134
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1135
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1136
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1137
- }
1138
- .wpr-button-winona::after {
1139
- content: attr(data-text);
1140
- position: absolute;
1141
- width: 100%;
1142
- height: 100%;
1143
- top: 0;
1144
- left: 0;
1145
- opacity: 0;
1146
- -webkit-transform: translate3d(0, 25%, 0);
1147
- transform: translate3d(0, 25%, 0);
1148
- }
1149
-
1150
- .wpr-button-winona::after,
1151
- .wpr-button-winona > span {
1152
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1153
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1154
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1155
- }
1156
- .wpr-button-winona:hover::after {
1157
- opacity: 1;
1158
- -webkit-transform: translate3d(0, 0, 0);
1159
- transform: translate3d(0, 0, 0);
1160
- }
1161
- .wpr-button-winona:hover > span {
1162
- opacity: 0;
1163
- -webkit-transform: translate3d(0, -25%, 0);
1164
- transform: translate3d(0, -25%, 0);
1165
- }
1166
-
1167
- /* Wayra Left */
1168
- .wpr-button-wayra-left {
1169
- overflow: hidden;
1170
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1171
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1172
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1173
- }
1174
- .wpr-button-wayra-left::after {
1175
- content: '';
1176
- position: absolute;
1177
- top: 0;
1178
- left: 0;
1179
- width: 150%;
1180
- height: 100%;
1181
- z-index: -1;
1182
- -webkit-transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
1183
- transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
1184
- -webkit-transform-origin: 0% 100%;
1185
- -ms-transform-origin: 0% 100%;
1186
- transform-origin: 0% 100%;
1187
- -webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
1188
- -webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1189
- transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1190
- -o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1191
- transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1192
- transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1193
- }
1194
-
1195
- .wpr-button-wayra-left:hover::after {
1196
- opacity: 1;
1197
- -webkit-transform: rotate3d(0, 0, 1, 0deg);
1198
- transform: rotate3d(0, 0, 1, 0deg);
1199
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1200
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1201
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1202
- }
1203
-
1204
- /* Wayra Right */
1205
- .wpr-button-wayra-right {
1206
- overflow: hidden;
1207
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1208
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1209
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1210
- }
1211
- .wpr-button-wayra-right::after {
1212
- content: '';
1213
- position: absolute;
1214
- top: 0;
1215
- right: 0;
1216
- width: 150%;
1217
- height: 100%;
1218
- z-index: -1;
1219
- -webkit-transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
1220
- transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
1221
- -webkit-transform-origin: 100% 100%;
1222
- -ms-transform-origin: 100% 100%;
1223
- transform-origin: 100% 100%;
1224
- -webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
1225
- -webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1226
- transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1227
- -o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1228
- transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1229
- transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1230
- }
1231
-
1232
- .wpr-button-wayra-right:hover::after {
1233
- opacity: 1;
1234
- -webkit-transform: rotate3d(0, 0, 1, 0deg);
1235
- transform: rotate3d(0, 0, 1, 0deg);
1236
- -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1237
- -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1238
- transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1239
- }
1240
-
1241
-
1242
- /* Rayen Left */
1243
- .wpr-button-rayen-left {
1244
- overflow: hidden;
1245
- }
1246
- .wpr-button-rayen-left::after {
1247
- content: attr(data-text);
1248
- position: absolute;
1249
- top: 0;
1250
- left: 0;
1251
- width: 100%;
1252
- height: 100%;
1253
- -webkit-transform: translate3d(-100%, 0, 0);
1254
- transform: translate3d(-100%, 0, 0);
1255
- z-index: 10;
1256
- }
1257
- .wpr-button-rayen-left::after,
1258
- .wpr-button-rayen-left > span {
1259
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1260
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1261
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1262
- }
1263
- .wpr-button-rayen-left:hover::after {
1264
- -webkit-transform: translate3d(0, 0, 0);
1265
- transform: translate3d(0, 0, 0);
1266
- }
1267
- .wpr-button-rayen-left:hover > span {
1268
- -webkit-transform: translate3d(0, 100%, 0);
1269
- transform: translate3d(0, 100%, 0);
1270
- }
1271
-
1272
- /* Rayen Right */
1273
- .wpr-button-rayen-right {
1274
- overflow: hidden;
1275
- }
1276
- .wpr-button-rayen-right::after {
1277
- content: attr(data-text);
1278
- position: absolute;
1279
- top: 0;
1280
- right: 0;
1281
- width: 100%;
1282
- height: 100%;
1283
- -webkit-transform: translate3d(100%, 0, 0);
1284
- transform: translate3d(100%, 0, 0);
1285
- z-index: 10;
1286
- }
1287
- .wpr-button-rayen-right::after,
1288
- .wpr-button-rayen-right > span {
1289
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1290
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1291
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1292
- }
1293
- .wpr-button-rayen-right:hover::after {
1294
- -webkit-transform: translate3d(0, 0, 0);
1295
- transform: translate3d(0, 0, 0);
1296
- }
1297
- .wpr-button-rayen-right:hover > span {
1298
- -webkit-transform: translate3d(0, 100%, 0);
1299
- transform: translate3d(0, 100%, 0);
1300
- }
1301
-
1302
- /* Isi Right */
1303
- .wpr-button-isi-left {
1304
- overflow: hidden;
1305
- }
1306
- .wpr-button-isi-left::after {
1307
- content: '';
1308
- z-index: -1;
1309
- position: absolute;
1310
- top: 50%;
1311
- right: 100%;
1312
- margin: -15px 0 0 1px;
1313
- width: 15%;
1314
- height: 30px;
1315
- border-radius: 50%;
1316
- -webkit-transform-origin: 0% 50%;
1317
- -ms-transform-origin: 0% 50%;
1318
- transform-origin: 0% 50%;
1319
- -webkit-transform: scale3d(1, 2, 1);
1320
- transform: scale3d(1, 2, 1);
1321
- -webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1322
- -o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1323
- transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1324
- }
1325
- .wpr-button-isi-left:hover::after {
1326
- -webkit-transform: scale3d(9, 9, 1);
1327
- }
1328
-
1329
- /* Isi Left */
1330
- .wpr-button-isi-right {
1331
- overflow: hidden;
1332
- }
1333
- .wpr-button-isi-right::after {
1334
- content: '';
1335
- z-index: -1;
1336
- position: absolute;
1337
- top: 50%;
1338
- left: 100%;
1339
- margin: -15px 0 0 1px;
1340
- width: 15%;
1341
- height: 30px;
1342
- border-radius: 50%;
1343
- -webkit-transform-origin: 100% 50%;
1344
- -ms-transform-origin: 100% 50%;
1345
- transform-origin: 100% 50%;
1346
- -webkit-transform: scale3d(1, 2, 1);
1347
- transform: scale3d(1, 2, 1);
1348
- -webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1349
- -o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1350
- transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1351
- }
1352
- .wpr-button-isi-right:hover::after {
1353
- -webkit-transform: scale3d(9, 9, 1);
1354
- transform: scale3d(9, 9, 1);
1355
- }
1356
-
1357
- /* Aylen */
1358
- .wpr-button-aylen {
1359
- overflow: hidden;
1360
- }
1361
-
1362
- .wpr-button-aylen::after,
1363
- .wpr-button-aylen::before {
1364
- content: '';
1365
- position: absolute;
1366
- height: 100%;
1367
- width: 100%;
1368
- bottom: 100%;
1369
- left: 0;
1370
- z-index: -1;
1371
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1372
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1373
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1374
- }
1375
-
1376
- .wpr-button-aylen::after {
1377
- opacity: 0.75;
1378
- }
1379
-
1380
- .wpr-button-aylen:hover::after,
1381
- .wpr-button-aylen:hover::before {
1382
- -webkit-transform: translate3d(0, 100%, 0);
1383
- transform: translate3d(0, 100%, 0);
1384
- }
1385
- .wpr-button-aylen:hover::before {
1386
- -webkit-transition-delay: 0.175s;
1387
- -o-transition-delay: 0.175s;
1388
- transition-delay: 0.175s;
1389
- }
1390
-
1391
- /* Antiman */
1392
- .wpr-button-antiman {
1393
- overflow: visible !important;
1394
- border: none !important;
1395
- }
1396
-
1397
- .wpr-button-antiman::after {
1398
- content: '';
1399
- z-index: -1;
1400
- border-radius: inherit;
1401
- pointer-events: none;
1402
- position: absolute;
1403
- top: 0;
1404
- left: 0;
1405
- width: 100%;
1406
- height: 100%;
1407
- -webkit-backface-visibility: hidden;
1408
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1409
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1410
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1411
- }
1412
- .wpr-button-antiman::after {
1413
- opacity: 0;
1414
- -webkit-transform: scale3d(1.2, 1.2, 1);
1415
- transform: scale3d(1.2, 1.2, 1);
1416
- }
1417
- .wpr-button-antiman:hover::after {
1418
- opacity: 1;
1419
- -webkit-transform: scale3d(1, 1, 1);
1420
- transform: scale3d(1, 1, 1);
1421
- }
1422
-
1423
- /* Naira */
1424
- .wpr-button-naira {
1425
- overflow: hidden;
1426
- }
1427
- .wpr-button-naira::after {
1428
- content: '';
1429
- position: absolute;
1430
- left: -50%;
1431
- width: 200%;
1432
- height: 200%;
1433
- top: -50%;
1434
- z-index: -1;
1435
- -webkit-transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
1436
- transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
1437
- }
1438
- .wpr-button-naira .wpr-button-button-icon {
1439
- position: absolute;
1440
- top: 0;
1441
- width: 100%;
1442
- height: 100%;
1443
- left: 0;
1444
- margin: 0 !important;
1445
- -webkit-transform: translate3d(0, -100%, 0);
1446
- transform: translate3d(0, -100%, 0);
1447
- opacity: 0;
1448
- }
1449
- .wpr-button-naira .wpr-button-button-icon i {
1450
- position: absolute;
1451
- top: 50%;
1452
- left: 50%;
1453
- -webkit-transform: translate(-50%,-50%);
1454
- -ms-transform: translate(-50%,-50%);
1455
- transform: translate(-50%,-50%);
1456
- }
1457
-
1458
- .wpr-button-naira .wpr-button-button-text {
1459
- display: block;
1460
- }
1461
-
1462
- .wpr-button-naira .wpr-button-button-text,
1463
- .wpr-button-naira .wpr-button-button-icon {
1464
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1465
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1466
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1467
- }
1468
-
1469
- .wpr-button-naira:hover .wpr-button-button-icon {
1470
- -webkit-transform: translate3d(0, 0, 0);
1471
- transform: translate3d(0, 0, 0);
1472
- opacity: 1;
1473
- }
1474
- .wpr-button-naira:hover .wpr-button-button-text {
1475
- opacity: 0;
1476
- -webkit-transform: translate3d(0, 100%, 0);
1477
- transform: translate3d(0, 100%, 0);
1478
- }
1479
- @-webkit-keyframes anim-naira-1 {
1480
- 50% {
1481
- -webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1482
- transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1483
- -webkit-animation-timing-function: ease-out;
1484
- animation-timing-function: ease-out;
1485
- }
1486
- 100% {
1487
- -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1488
- transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1489
- }
1490
- }
1491
- @keyframes anim-naira-1 {
1492
- 50% {
1493
- -webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1494
- transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1495
- -webkit-animation-timing-function: ease-out;
1496
- animation-timing-function: ease-out;
1497
- }
1498
- 100% {
1499
- -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1500
- transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1501
- }
1502
- }
1503
- .wpr-button-naira:hover::after {
1504
- -webkit-animation-name: anim-naira-1;
1505
- animation-name: anim-naira-1;
1506
- -webkit-animation-fill-mode: forwards;
1507
- animation-fill-mode: forwards;
1508
- -webkit-animation-timing-function: ease-in;
1509
- animation-timing-function: ease-in;
1510
- }
1511
-
1512
- /* Naira Up*/
1513
- .wpr-button-naira-up {
1514
- overflow: hidden;
1515
- }
1516
- .wpr-button-naira-up::after {
1517
- content: '';
1518
- position: absolute;
1519
- left: -50%;
1520
- width: 200%;
1521
- height: 200%;
1522
- top: -50%;
1523
- z-index: -1;
1524
- -webkit-transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
1525
- transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
1526
- }
1527
- .wpr-button-naira-up .wpr-button-button-icon {
1528
- position: absolute;
1529
- top: 0;
1530
- width: 100%;
1531
- height: 100%;
1532
- left: 0;
1533
- margin: 0 !important;
1534
- -webkit-transform: translate3d(0, 100%, 0);
1535
- transform: translate3d(0, 100%, 0);
1536
- opacity: 0;
1537
- }
1538
-
1539
- .wpr-button-naira-up .wpr-button-button-icon i {
1540
- position: absolute;
1541
- top: 50%;
1542
- left: 50%;
1543
- -webkit-transform: translate(-50%,-50%);
1544
- -ms-transform: translate(-50%,-50%);
1545
- transform: translate(-50%,-50%);
1546
- }
1547
-
1548
- .wpr-button-naira-up .wpr-button-button-text {
1549
- display: block;
1550
- }
1551
-
1552
- .wpr-button-naira-up .wpr-button-button-text,
1553
- .wpr-button-naira-up .wpr-button-button-icon {
1554
- -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1555
- -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1556
- transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1557
- }
1558
-
1559
- .wpr-button-naira-up:hover .wpr-button-button-icon {
1560
- -webkit-transform: translate3d(0, 0, 0);
1561
- transform: translate3d(0, 0, 0);
1562
- opacity: 1;
1563
- }
1564
- .wpr-button-naira-up:hover .wpr-button-button-text {
1565
- opacity: 0;
1566
- -webkit-transform: translate3d(0, -100%, 0);
1567
- transform: translate3d(0, -100%, 0);
1568
- }
1569
- @-webkit-keyframes anim-naira-2 {
1570
- 50% {
1571
- -webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1572
- transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1573
- -webkit-animation-timing-function: ease-out;
1574
- animation-timing-function: ease-out;
1575
- }
1576
- 100% {
1577
- -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1578
- transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1579
- }
1580
- }
1581
- @keyframes anim-naira-2 {
1582
- 50% {
1583
- -webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1584
- transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1585
- -webkit-animation-timing-function: ease-out;
1586
- animation-timing-function: ease-out;
1587
- }
1588
- 100% {
1589
- -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1590
- transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1591
- }
1592
- }
1593
- .wpr-button-naira-up:hover::after {
1594
- -webkit-animation-name: anim-naira-2;
1595
- animation-name: anim-naira-2;
1596
- -webkit-animation-fill-mode: forwards;
1597
- animation-fill-mode: forwards;
1598
- -webkit-animation-timing-function: ease-in;
1599
- animation-timing-function: ease-in;
1600
- }
1601
-
1602
- /* Fade */
1603
- .wpr-button-none:before {
1604
- content: "";
1605
- position: absolute;
1606
- z-index: -1;
1607
- top: 0;
1608
- left: 0;
1609
- width: 100%;
1610
- height: 100%;
1611
- opacity: 0;
1612
- }
1613
- .wpr-button-none:hover:before {
1614
- opacity: 1;
1615
- }
1616
-
1617
-
1618
- .wpr-button-effect,
1619
- .wpr-button-effect::before,
1620
- .wpr-button-effect::after,
1621
- .wpr-button-effect span {
1622
- -webkit-transition-property: all;
1623
- -o-transition-property: all;
1624
- transition-property: all;
1625
- }
1626
-
1627
- .wpr-button-effect::after {
1628
- text-align: center;
1629
- }
1
+ /*!
2
+ * Hover.css (http://ianlunn.github.io/Hover/)
3
+ * Version: 2.3.2
4
+ * Author: Ian Lunn @IanLunn
5
+ * Author URL: http://ianlunn.co.uk/
6
+ * Github: https://github.com/IanLunn/Hover
7
+
8
+ * Hover.css Copyright Ian Lunn 2017. Generated with Sass.
9
+ */
10
+
11
+
12
+ /* 2D TRANSITIONS */
13
+ /* Forward */
14
+ .elementor-animation-forward {
15
+ display: inline-block;
16
+ vertical-align: middle;
17
+ -webkit-transform: perspective(1px) translateZ(0);
18
+ transform: perspective(1px) translateZ(0);
19
+ -webkit-transition-duration: 0.3s;
20
+ -o-transition-duration: 0.3s;
21
+ transition-duration: 0.3s;
22
+ -webkit-transition-property: transform;
23
+ -webkit-transition-property: -webkit-transform;
24
+ transition-property: -webkit-transform;
25
+ -o-transition-property: transform;
26
+ transition-property: transform;
27
+ transition-property: transform, -webkit-transform;
28
+ }
29
+ .elementor-animation-forward:hover, .elementor-animation-forward:focus, .elementor-animation-forward:active {
30
+ -webkit-transform: translateX(8px);
31
+ -ms-transform: translateX(8px);
32
+ transform: translateX(8px);
33
+ }
34
+
35
+ /* Backward */
36
+ .elementor-animation-backward {
37
+ display: inline-block;
38
+ vertical-align: middle;
39
+ -webkit-transform: perspective(1px) translateZ(0);
40
+ transform: perspective(1px) translateZ(0);
41
+ -webkit-transition-duration: 0.3s;
42
+ -o-transition-duration: 0.3s;
43
+ transition-duration: 0.3s;
44
+ -webkit-transition-property: transform;
45
+ -webkit-transition-property: -webkit-transform;
46
+ transition-property: -webkit-transform;
47
+ -o-transition-property: transform;
48
+ transition-property: transform;
49
+ transition-property: transform, -webkit-transform;
50
+ }
51
+ .elementor-animation-backward:hover, .elementor-animation-backward:focus, .elementor-animation-backward:active {
52
+ -webkit-transform: translateX(-8px);
53
+ -ms-transform: translateX(-8px);
54
+ transform: translateX(-8px);
55
+ }
56
+
57
+ /* BACKGROUND TRANSITIONS */
58
+ /* Back Pulse */
59
+ @-webkit-keyframes wpr-button-back-pulse {
60
+ 50% {
61
+ opacity: 0.5;
62
+ }
63
+ }
64
+ @keyframes wpr-button-back-pulse {
65
+ 50% {
66
+ opacity: 0.5;
67
+ }
68
+ }
69
+
70
+ .wpr-button-back-pulse:before {
71
+ content: "";
72
+ width: 100%;
73
+ height: 100%;
74
+ position: absolute;
75
+ top: 0;
76
+ left: 0;
77
+ opacity: 0;
78
+ z-index: -1;
79
+ }
80
+
81
+ .wpr-button-back-pulse:hover:before {
82
+ opacity: 1;
83
+ -webkit-animation-name: wpr-button-back-pulse;
84
+ animation-name: wpr-button-back-pulse;
85
+ -webkit-animation-duration: 1s;
86
+ animation-duration: 1s;
87
+ -webkit-animation-delay: 0.5s;
88
+ animation-delay: 0.5s;
89
+ -webkit-animation-timing-function: linear;
90
+ animation-timing-function: linear;
91
+ -webkit-animation-iteration-count: infinite;
92
+ animation-iteration-count: infinite;
93
+ }
94
+
95
+ /* Sweep To Right */
96
+ .wpr-button-sweep-to-right {
97
+ display: inline-block;
98
+ vertical-align: middle;
99
+ -webkit-transform: perspective(1px) translateZ(0);
100
+ transform: perspective(1px) translateZ(0);
101
+ position: relative;
102
+ -webkit-transition-property: color;
103
+ -o-transition-property: color;
104
+ transition-property: color;
105
+ -webkit-transition-duration: 0.3s;
106
+ -o-transition-duration: 0.3s;
107
+ transition-duration: 0.3s;
108
+ }
109
+ .wpr-button-sweep-to-right:before {
110
+ content: "";
111
+ position: absolute;
112
+ z-index: -1;
113
+ top: 0;
114
+ left: 0;
115
+ right: 0;
116
+ bottom: 0;
117
+ -webkit-transform: scaleX(0);
118
+ -ms-transform: scaleX(0);
119
+ transform: scaleX(0);
120
+ -webkit-transform-origin: 0 50%;
121
+ -ms-transform-origin: 0 50%;
122
+ transform-origin: 0 50%;
123
+ -webkit-transition-property: transform;
124
+ -webkit-transition-property: -webkit-transform;
125
+ transition-property: -webkit-transform;
126
+ -o-transition-property: transform;
127
+ transition-property: transform;
128
+ transition-property: transform, -webkit-transform;
129
+ -webkit-transition-duration: 0.3s;
130
+ -o-transition-duration: 0.3s;
131
+ transition-duration: 0.3s;
132
+ -webkit-transition-timing-function: ease-out;
133
+ -o-transition-timing-function: ease-out;
134
+ transition-timing-function: ease-out;
135
+ }
136
+ .wpr-button-sweep-to-right:hover:before, .wpr-button-sweep-to-right:focus:before, .wpr-button-sweep-to-right:active:before {
137
+ -webkit-transform: scaleX(1);
138
+ -ms-transform: scaleX(1);
139
+ transform: scaleX(1);
140
+ }
141
+
142
+ /* Sweep To Left */
143
+ .wpr-button-sweep-to-left {
144
+ display: inline-block;
145
+ vertical-align: middle;
146
+ -webkit-transform: perspective(1px) translateZ(0);
147
+ transform: perspective(1px) translateZ(0);
148
+ position: relative;
149
+ -webkit-transition-property: color;
150
+ -o-transition-property: color;
151
+ transition-property: color;
152
+ -webkit-transition-duration: 0.3s;
153
+ -o-transition-duration: 0.3s;
154
+ transition-duration: 0.3s;
155
+ }
156
+ .wpr-button-sweep-to-left:before {
157
+ content: "";
158
+ position: absolute;
159
+ z-index: -1;
160
+ top: 0;
161
+ left: 0;
162
+ right: 0;
163
+ bottom: 0;
164
+ -webkit-transform: scaleX(0);
165
+ -ms-transform: scaleX(0);
166
+ transform: scaleX(0);
167
+ -webkit-transform-origin: 100% 50%;
168
+ -ms-transform-origin: 100% 50%;
169
+ transform-origin: 100% 50%;
170
+ -webkit-transition-property: transform;
171
+ -webkit-transition-property: -webkit-transform;
172
+ transition-property: -webkit-transform;
173
+ -o-transition-property: transform;
174
+ transition-property: transform;
175
+ transition-property: transform, -webkit-transform;
176
+ -webkit-transition-duration: 0.3s;
177
+ -o-transition-duration: 0.3s;
178
+ transition-duration: 0.3s;
179
+ -webkit-transition-timing-function: ease-out;
180
+ -o-transition-timing-function: ease-out;
181
+ transition-timing-function: ease-out;
182
+ }
183
+ .wpr-button-sweep-to-left:hover:before, .wpr-button-sweep-to-left:focus:before, .wpr-button-sweep-to-left:active:before {
184
+ -webkit-transform: scaleX(1);
185
+ -ms-transform: scaleX(1);
186
+ transform: scaleX(1);
187
+ }
188
+
189
+ /* Sweep To Bottom */
190
+ .wpr-button-sweep-to-bottom {
191
+ display: inline-block;
192
+ vertical-align: middle;
193
+ -webkit-transform: perspective(1px) translateZ(0);
194
+ transform: perspective(1px) translateZ(0);
195
+ position: relative;
196
+ -webkit-transition-property: color;
197
+ -o-transition-property: color;
198
+ transition-property: color;
199
+ -webkit-transition-duration: 0.3s;
200
+ -o-transition-duration: 0.3s;
201
+ transition-duration: 0.3s;
202
+ }
203
+ .wpr-button-sweep-to-bottom:before {
204
+ content: "";
205
+ position: absolute;
206
+ z-index: -1;
207
+ top: 0;
208
+ left: 0;
209
+ right: 0;
210
+ bottom: 0;
211
+ -webkit-transform: scaleY(0);
212
+ -ms-transform: scaleY(0);
213
+ transform: scaleY(0);
214
+ -webkit-transform-origin: 50% 0;
215
+ -ms-transform-origin: 50% 0;
216
+ transform-origin: 50% 0;
217
+ -webkit-transition-property: transform;
218
+ -webkit-transition-property: -webkit-transform;
219
+ transition-property: -webkit-transform;
220
+ -o-transition-property: transform;
221
+ transition-property: transform;
222
+ transition-property: transform, -webkit-transform;
223
+ -webkit-transition-duration: 0.3s;
224
+ -o-transition-duration: 0.3s;
225
+ transition-duration: 0.3s;
226
+ -webkit-transition-timing-function: ease-out;
227
+ -o-transition-timing-function: ease-out;
228
+ transition-timing-function: ease-out;
229
+ }
230
+ .wpr-button-sweep-to-bottom:hover:before, .wpr-button-sweep-to-bottom:focus:before, .wpr-button-sweep-to-bottom:active:before {
231
+ -webkit-transform: scaleY(1);
232
+ -ms-transform: scaleY(1);
233
+ transform: scaleY(1);
234
+ }
235
+
236
+ /* Sweep To Top */
237
+ .wpr-button-sweep-to-top {
238
+ display: inline-block;
239
+ vertical-align: middle;
240
+ -webkit-transform: perspective(1px) translateZ(0);
241
+ transform: perspective(1px) translateZ(0);
242
+ position: relative;
243
+ -webkit-transition-property: color;
244
+ -o-transition-property: color;
245
+ transition-property: color;
246
+ -webkit-transition-duration: 0.3s;
247
+ -o-transition-duration: 0.3s;
248
+ transition-duration: 0.3s;
249
+ }
250
+ .wpr-button-sweep-to-top:before {
251
+ content: "";
252
+ position: absolute;
253
+ z-index: -1;
254
+ top: 0;
255
+ left: 0;
256
+ right: 0;
257
+ bottom: 0;
258
+ -webkit-transform: scaleY(0);
259
+ -ms-transform: scaleY(0);
260
+ transform: scaleY(0);
261
+ -webkit-transform-origin: 50% 100%;
262
+ -ms-transform-origin: 50% 100%;
263
+ transform-origin: 50% 100%;
264
+ -webkit-transition-property: transform;
265
+ -webkit-transition-property: -webkit-transform;
266
+ transition-property: -webkit-transform;
267
+ -o-transition-property: transform;
268
+ transition-property: transform;
269
+ transition-property: transform, -webkit-transform;
270
+ -webkit-transition-duration: 0.3s;
271
+ -o-transition-duration: 0.3s;
272
+ transition-duration: 0.3s;
273
+ -webkit-transition-timing-function: ease-out;
274
+ -o-transition-timing-function: ease-out;
275
+ transition-timing-function: ease-out;
276
+ }
277
+ .wpr-button-sweep-to-top:hover:before, .wpr-button-sweep-to-top:focus:before, .wpr-button-sweep-to-top:active:before {
278
+ -webkit-transform: scaleY(1);
279
+ -ms-transform: scaleY(1);
280
+ transform: scaleY(1);
281
+ }
282
+
283
+ /* Bounce To Right */
284
+ .wpr-button-bounce-to-right {
285
+ display: inline-block;
286
+ vertical-align: middle;
287
+ -webkit-transform: perspective(1px) translateZ(0);
288
+ transform: perspective(1px) translateZ(0);
289
+ position: relative;
290
+ -webkit-transition-property: color;
291
+ -o-transition-property: color;
292
+ transition-property: color;
293
+ -webkit-transition-duration: 0.5s;
294
+ -o-transition-duration: 0.5s;
295
+ transition-duration: 0.5s;
296
+ }
297
+ .wpr-button-bounce-to-right:before {
298
+ content: "";
299
+ position: absolute;
300
+ z-index: -1;
301
+ top: 0;
302
+ left: 0;
303
+ right: 0;
304
+ bottom: 0;
305
+ -webkit-transform: scaleX(0);
306
+ -ms-transform: scaleX(0);
307
+ transform: scaleX(0);
308
+ -webkit-transform-origin: 0 50%;
309
+ -ms-transform-origin: 0 50%;
310
+ transform-origin: 0 50%;
311
+ -webkit-transition-property: transform;
312
+ -webkit-transition-property: -webkit-transform;
313
+ transition-property: -webkit-transform;
314
+ -o-transition-property: transform;
315
+ transition-property: transform;
316
+ transition-property: transform, -webkit-transform;
317
+ -webkit-transition-duration: 0.5s;
318
+ -o-transition-duration: 0.5s;
319
+ transition-duration: 0.5s;
320
+ -webkit-transition-timing-function: ease-out;
321
+ -o-transition-timing-function: ease-out;
322
+ transition-timing-function: ease-out;
323
+ }
324
+
325
+ .wpr-button-bounce-to-right:hover:before, .wpr-button-bounce-to-right:focus:before, .wpr-button-bounce-to-right:active:before {
326
+ -webkit-transform: scaleX(1);
327
+ -ms-transform: scaleX(1);
328
+ transform: scaleX(1);
329
+ -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
330
+ -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
331
+ transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
332
+ }
333
+
334
+ /* Bounce To Left */
335
+ .wpr-button-bounce-to-left {
336
+ display: inline-block;
337
+ vertical-align: middle;
338
+ -webkit-transform: perspective(1px) translateZ(0);
339
+ transform: perspective(1px) translateZ(0);
340
+ position: relative;
341
+ -webkit-transition-property: color;
342
+ -o-transition-property: color;
343
+ transition-property: color;
344
+ -webkit-transition-duration: 0.5s;
345
+ -o-transition-duration: 0.5s;
346
+ transition-duration: 0.5s;
347
+ }
348
+ .wpr-button-bounce-to-left:before {
349
+ content: "";
350
+ position: absolute;
351
+ z-index: -1;
352
+ top: 0;
353
+ left: 0;
354
+ right: 0;
355
+ bottom: 0;
356
+ -webkit-transform: scaleX(0);
357
+ -ms-transform: scaleX(0);
358
+ transform: scaleX(0);
359
+ -webkit-transform-origin: 100% 50%;
360
+ -ms-transform-origin: 100% 50%;
361
+ transform-origin: 100% 50%;
362
+ -webkit-transition-property: transform;
363
+ -webkit-transition-property: -webkit-transform;
364
+ transition-property: -webkit-transform;
365
+ -o-transition-property: transform;
366
+ transition-property: transform;
367
+ transition-property: transform, -webkit-transform;
368
+ -webkit-transition-duration: 0.5s;
369
+ -o-transition-duration: 0.5s;
370
+ transition-duration: 0.5s;
371
+ -webkit-transition-timing-function: ease-out;
372
+ -o-transition-timing-function: ease-out;
373
+ transition-timing-function: ease-out;
374
+ }
375
+ .wpr-button-bounce-to-left:hover:before, .wpr-button-bounce-to-left:focus:before, .wpr-button-bounce-to-left:active:before {
376
+ -webkit-transform: scaleX(1);
377
+ -ms-transform: scaleX(1);
378
+ transform: scaleX(1);
379
+ -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
380
+ -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
381
+ transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
382
+ }
383
+
384
+ /* Bounce To Bottom */
385
+ .wpr-button-bounce-to-bottom {
386
+ display: inline-block;
387
+ vertical-align: middle;
388
+ -webkit-transform: perspective(1px) translateZ(0);
389
+ transform: perspective(1px) translateZ(0);
390
+ position: relative;
391
+ -webkit-transition-property: color;
392
+ -o-transition-property: color;
393
+ transition-property: color;
394
+ -webkit-transition-duration: 0.5s;
395
+ -o-transition-duration: 0.5s;
396
+ transition-duration: 0.5s;
397
+ }
398
+ .wpr-button-bounce-to-bottom:before {
399
+ content: "";
400
+ position: absolute;
401
+ z-index: -1;
402
+ top: 0;
403
+ left: 0;
404
+ right: 0;
405
+ bottom: 0;
406
+ -webkit-transform: scaleY(0);
407
+ -ms-transform: scaleY(0);
408
+ transform: scaleY(0);
409
+ -webkit-transform-origin: 50% 0;
410
+ -ms-transform-origin: 50% 0;
411
+ transform-origin: 50% 0;
412
+ -webkit-transition-property: transform;
413
+ -webkit-transition-property: -webkit-transform;
414
+ transition-property: -webkit-transform;
415
+ -o-transition-property: transform;
416
+ transition-property: transform;
417
+ transition-property: transform, -webkit-transform;
418
+ -webkit-transition-duration: 0.5s;
419
+ -o-transition-duration: 0.5s;
420
+ transition-duration: 0.5s;
421
+ -webkit-transition-timing-function: ease-out;
422
+ -o-transition-timing-function: ease-out;
423
+ transition-timing-function: ease-out;
424
+ }
425
+ .wpr-button-bounce-to-bottom:hover:before, .wpr-button-bounce-to-bottom:focus:before, .wpr-button-bounce-to-bottom:active:before {
426
+ -webkit-transform: scaleY(1);
427
+ -ms-transform: scaleY(1);
428
+ transform: scaleY(1);
429
+ -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
430
+ -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
431
+ transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
432
+ }
433
+
434
+ /* Bounce To Top */
435
+ .wpr-button-bounce-to-top {
436
+ display: inline-block;
437
+ vertical-align: middle;
438
+ -webkit-transform: perspective(1px) translateZ(0);
439
+ transform: perspective(1px) translateZ(0);
440
+ position: relative;
441
+ -webkit-transition-property: color;
442
+ -o-transition-property: color;
443
+ transition-property: color;
444
+ -webkit-transition-duration: 0.5s;
445
+ -o-transition-duration: 0.5s;
446
+ transition-duration: 0.5s;
447
+ }
448
+ .wpr-button-bounce-to-top:before {
449
+ content: "";
450
+ position: absolute;
451
+ z-index: -1;
452
+ top: 0;
453
+ left: 0;
454
+ right: 0;
455
+ bottom: 0;
456
+ -webkit-transform: scaleY(0);
457
+ -ms-transform: scaleY(0);
458
+ transform: scaleY(0);
459
+ -webkit-transform-origin: 50% 100%;
460
+ -ms-transform-origin: 50% 100%;
461
+ transform-origin: 50% 100%;
462
+ -webkit-transition-property: transform;
463
+ -webkit-transition-property: -webkit-transform;
464
+ transition-property: -webkit-transform;
465
+ -o-transition-property: transform;
466
+ transition-property: transform;
467
+ transition-property: transform, -webkit-transform;
468
+ -webkit-transition-duration: 0.5s;
469
+ -o-transition-duration: 0.5s;
470
+ transition-duration: 0.5s;
471
+ -webkit-transition-timing-function: ease-out;
472
+ -o-transition-timing-function: ease-out;
473
+ transition-timing-function: ease-out;
474
+ }
475
+ .wpr-button-bounce-to-top:hover, .wpr-button-bounce-to-top:focus, .wpr-button-bounce-to-top:active {
476
+ color: white;
477
+ }
478
+ .wpr-button-bounce-to-top:hover:before, .wpr-button-bounce-to-top:focus:before, .wpr-button-bounce-to-top:active:before {
479
+ -webkit-transform: scaleY(1);
480
+ -ms-transform: scaleY(1);
481
+ transform: scaleY(1);
482
+ -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
483
+ -o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
484
+ transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
485
+ }
486
+
487
+ /* Radial Out */
488
+ .wpr-button-radial-out {
489
+ display: inline-block;
490
+ vertical-align: middle;
491
+ -webkit-transform: perspective(1px) translateZ(0);
492
+ transform: perspective(1px) translateZ(0);
493
+ position: relative;
494
+ overflow: hidden;
495
+ -webkit-transition-property: color;
496
+ -o-transition-property: color;
497
+ transition-property: color;
498
+ -webkit-transition-duration: 0.3s;
499
+ -o-transition-duration: 0.3s;
500
+ transition-duration: 0.3s;
501
+ }
502
+ .wpr-button-radial-out:before {
503
+ content: "";
504
+ position: absolute;
505
+ z-index: -1;
506
+ top: 0;
507
+ left: 0;
508
+ right: 0;
509
+ bottom: 0;
510
+ border-radius: 100%;
511
+ -webkit-transform: scale(0);
512
+ -ms-transform: scale(0);
513
+ transform: scale(0);
514
+ -webkit-transition-property: transform;
515
+ -webkit-transition-property: -webkit-transform;
516
+ transition-property: -webkit-transform;
517
+ -o-transition-property: transform;
518
+ transition-property: transform;
519
+ transition-property: transform, -webkit-transform;
520
+ -webkit-transition-duration: 0.3s;
521
+ -o-transition-duration: 0.3s;
522
+ transition-duration: 0.3s;
523
+ -webkit-transition-timing-function: ease-out;
524
+ -o-transition-timing-function: ease-out;
525
+ transition-timing-function: ease-out;
526
+ }
527
+ .wpr-button-radial-out:hover, .wpr-button-radial-out:focus, .wpr-button-radial-out:active {
528
+ color: white;
529
+ }
530
+ .wpr-button-radial-out:hover:before, .wpr-button-radial-out:focus:before, .wpr-button-radial-out:active:before {
531
+ -webkit-transform: scale(2);
532
+ -ms-transform: scale(2);
533
+ transform: scale(2);
534
+ }
535
+
536
+ /* Radial In */
537
+ .wpr-button-radial-in {
538
+ display: inline-block;
539
+ vertical-align: middle;
540
+ -webkit-transform: perspective(1px) translateZ(0);
541
+ transform: perspective(1px) translateZ(0);
542
+ position: relative;
543
+ overflow: hidden;
544
+ -webkit-transition-property: color;
545
+ -o-transition-property: color;
546
+ transition-property: color;
547
+ -webkit-transition-duration: 0.3s;
548
+ -o-transition-duration: 0.3s;
549
+ transition-duration: 0.3s;
550
+ }
551
+ .wpr-button-radial-in:before {
552
+ content: "";
553
+ position: absolute;
554
+ z-index: -1;
555
+ top: 0;
556
+ left: 0;
557
+ right: 0;
558
+ bottom: 0;
559
+ border-radius: 100%;
560
+ -webkit-transform: scale(2);
561
+ -ms-transform: scale(2);
562
+ transform: scale(2);
563
+ -webkit-transition-property: transform;
564
+ -webkit-transition-property: -webkit-transform;
565
+ transition-property: -webkit-transform;
566
+ -o-transition-property: transform;
567
+ transition-property: transform;
568
+ transition-property: transform, -webkit-transform;
569
+ -webkit-transition-duration: 0.3s;
570
+ -o-transition-duration: 0.3s;
571
+ transition-duration: 0.3s;
572
+ -webkit-transition-timing-function: ease-out;
573
+ -o-transition-timing-function: ease-out;
574
+ transition-timing-function: ease-out;
575
+ }
576
+ .wpr-button-radial-in:hover, .wpr-button-radial-in:focus, .wpr-button-radial-in:active {
577
+ color: white;
578
+ }
579
+ .wpr-button-radial-in:hover:before, .wpr-button-radial-in:focus:before, .wpr-button-radial-in:active:before {
580
+ -webkit-transform: scale(0);
581
+ -ms-transform: scale(0);
582
+ transform: scale(0);
583
+ }
584
+
585
+ /* Rectangle In */
586
+ .wpr-button-rectangle-in {
587
+ display: inline-block;
588
+ vertical-align: middle;
589
+ -webkit-transform: perspective(1px) translateZ(0);
590
+ transform: perspective(1px) translateZ(0);
591
+ position: relative;
592
+ -webkit-transition-property: color;
593
+ -o-transition-property: color;
594
+ transition-property: color;
595
+ -webkit-transition-duration: 0.3s;
596
+ -o-transition-duration: 0.3s;
597
+ transition-duration: 0.3s;
598
+ }
599
+ .wpr-button-rectangle-in:before {
600
+ content: "";
601
+ position: absolute;
602
+ z-index: -1;
603
+ top: 0;
604
+ left: 0;
605
+ right: 0;
606
+ bottom: 0;
607
+ -webkit-transform: scale(1);
608
+ -ms-transform: scale(1);
609
+ transform: scale(1);
610
+ -webkit-transition-property: transform;
611
+ -webkit-transition-property: -webkit-transform;
612
+ transition-property: -webkit-transform;
613
+ -o-transition-property: transform;
614
+ transition-property: transform;
615
+ transition-property: transform, -webkit-transform;
616
+ -webkit-transition-duration: 0.3s;
617
+ -o-transition-duration: 0.3s;
618
+ transition-duration: 0.3s;
619
+ -webkit-transition-timing-function: ease-out;
620
+ -o-transition-timing-function: ease-out;
621
+ transition-timing-function: ease-out;
622
+ }
623
+ .wpr-button-rectangle-in:hover:before, .wpr-button-rectangle-in:focus:before, .wpr-button-rectangle-in:active:before {
624
+ -webkit-transform: scale(0);
625
+ -ms-transform: scale(0);
626
+ transform: scale(0);
627
+ }
628
+
629
+ /* Rectangle Out */
630
+ .wpr-button-rectangle-out {
631
+ display: inline-block;
632
+ vertical-align: middle;
633
+ -webkit-transform: perspective(1px) translateZ(0);
634
+ transform: perspective(1px) translateZ(0);
635
+ position: relative;
636
+ -webkit-transition-property: color;
637
+ -o-transition-property: color;
638
+ transition-property: color;
639
+ -webkit-transition-duration: 0.3s;
640
+ -o-transition-duration: 0.3s;
641
+ transition-duration: 0.3s;
642
+ }
643
+ .wpr-button-rectangle-out:before {
644
+ content: "";
645
+ position: absolute;
646
+ z-index: -1;
647
+ top: 0;
648
+ left: 0;
649
+ right: 0;
650
+ bottom: 0;
651
+ -webkit-transform: scale(0);
652
+ -ms-transform: scale(0);
653
+ transform: scale(0);
654
+ -webkit-transition-property: transform;
655
+ -webkit-transition-property: -webkit-transform;
656
+ transition-property: -webkit-transform;
657
+ -o-transition-property: transform;
658
+ transition-property: transform;
659
+ transition-property: transform, -webkit-transform;
660
+ -webkit-transition-duration: 0.3s;
661
+ -o-transition-duration: 0.3s;
662
+ transition-duration: 0.3s;
663
+ -webkit-transition-timing-function: ease-out;
664
+ -o-transition-timing-function: ease-out;
665
+ transition-timing-function: ease-out;
666
+ }
667
+ .wpr-button-rectangle-out:hover:before, .wpr-button-rectangle-out:focus:before, .wpr-button-rectangle-out:active:before {
668
+ -webkit-transform: scale(1);
669
+ -ms-transform: scale(1);
670
+ transform: scale(1);
671
+ }
672
+
673
+ /* Shutter In Horizontal */
674
+ .wpr-button-shutter-in-horizontal {
675
+ display: inline-block;
676
+ vertical-align: middle;
677
+ -webkit-transform: perspective(1px) translateZ(0);
678
+ transform: perspective(1px) translateZ(0);
679
+ position: relative;
680
+ -webkit-transition-property: color;
681
+ -o-transition-property: color;
682
+ transition-property: color;
683
+ -webkit-transition-duration: 0.3s;
684
+ -o-transition-duration: 0.3s;
685
+ transition-duration: 0.3s;
686
+ }
687
+ .wpr-button-shutter-in-horizontal:before {
688
+ content: "";
689
+ position: absolute;
690
+ z-index: -1;
691
+ top: 0;
692
+ bottom: 0;
693
+ left: 0;
694
+ right: 0;
695
+ -webkit-transform: scaleX(1);
696
+ -ms-transform: scaleX(1);
697
+ transform: scaleX(1);
698
+ -webkit-transform-origin: 50%;
699
+ -ms-transform-origin: 50%;
700
+ transform-origin: 50%;
701
+ -webkit-transition-property: transform;
702
+ -webkit-transition-property: -webkit-transform;
703
+ transition-property: -webkit-transform;
704
+ -o-transition-property: transform;
705
+ transition-property: transform;
706
+ transition-property: transform, -webkit-transform;
707
+ -webkit-transition-duration: 0.3s;
708
+ -o-transition-duration: 0.3s;
709
+ transition-duration: 0.3s;
710
+ -webkit-transition-timing-function: ease-out;
711
+ -o-transition-timing-function: ease-out;
712
+ transition-timing-function: ease-out;
713
+ }
714
+ .wpr-button-shutter-in-horizontal:hover:before, .wpr-button-shutter-in-horizontal:focus:before, .wpr-button-shutter-in-horizontal:active:before {
715
+ -webkit-transform: scaleX(0);
716
+ -ms-transform: scaleX(0);
717
+ transform: scaleX(0);
718
+ }
719
+
720
+ /* Shutter Out Horizontal */
721
+ .wpr-button-shutter-out-horizontal {
722
+ display: inline-block;
723
+ vertical-align: middle;
724
+ -webkit-transform: perspective(1px) translateZ(0);
725
+ transform: perspective(1px) translateZ(0);
726
+ position: relative;
727
+ -webkit-transition-property: color;
728
+ -o-transition-property: color;
729
+ transition-property: color;
730
+ -webkit-transition-duration: 0.3s;
731
+ -o-transition-duration: 0.3s;
732
+ transition-duration: 0.3s;
733
+ }
734
+ .wpr-button-shutter-out-horizontal:before {
735
+ content: "";
736
+ position: absolute;
737
+ z-index: -1;
738
+ top: 0;
739
+ bottom: 0;
740
+ left: 0;
741
+ right: 0;
742
+ -webkit-transform: scaleX(0);
743
+ -ms-transform: scaleX(0);
744
+ transform: scaleX(0);
745
+ -webkit-transform-origin: 50%;
746
+ -ms-transform-origin: 50%;
747
+ transform-origin: 50%;
748
+ -webkit-transition-property: transform;
749
+ -webkit-transition-property: -webkit-transform;
750
+ transition-property: -webkit-transform;
751
+ -o-transition-property: transform;
752
+ transition-property: transform;
753
+ transition-property: transform, -webkit-transform;
754
+ -webkit-transition-duration: 0.3s;
755
+ -o-transition-duration: 0.3s;
756
+ transition-duration: 0.3s;
757
+ -webkit-transition-timing-function: ease-out;
758
+ -o-transition-timing-function: ease-out;
759
+ transition-timing-function: ease-out;
760
+ }
761
+ .wpr-button-shutter-out-horizontal:hover:before, .wpr-button-shutter-out-horizontal:focus:before, .wpr-button-shutter-out-horizontal:active:before {
762
+ -webkit-transform: scaleX(1);
763
+ -ms-transform: scaleX(1);
764
+ transform: scaleX(1);
765
+ }
766
+
767
+ /* Shutter In Vertical */
768
+ .wpr-button-shutter-in-vertical {
769
+ display: inline-block;
770
+ vertical-align: middle;
771
+ -webkit-transform: perspective(1px) translateZ(0);
772
+ transform: perspective(1px) translateZ(0);
773
+ position: relative;
774
+ -webkit-transition-property: color;
775
+ -o-transition-property: color;
776
+ transition-property: color;
777
+ -webkit-transition-duration: 0.3s;
778
+ -o-transition-duration: 0.3s;
779
+ transition-duration: 0.3s;
780
+ }
781
+ .wpr-button-shutter-in-vertical:before {
782
+ content: "";
783
+ position: absolute;
784
+ z-index: -1;
785
+ top: 0;
786
+ bottom: 0;
787
+ left: 0;
788
+ right: 0;
789
+ -webkit-transform: scaleY(1);
790
+ -ms-transform: scaleY(1);
791
+ transform: scaleY(1);
792
+ -webkit-transform-origin: 50%;
793
+ -ms-transform-origin: 50%;
794
+ transform-origin: 50%;
795
+ -webkit-transition-property: transform;
796
+ -webkit-transition-property: -webkit-transform;
797
+ transition-property: -webkit-transform;
798
+ -o-transition-property: transform;
799
+ transition-property: transform;
800
+ transition-property: transform, -webkit-transform;
801
+ -webkit-transition-duration: 0.3s;
802
+ -o-transition-duration: 0.3s;
803
+ transition-duration: 0.3s;
804
+ -webkit-transition-timing-function: ease-out;
805
+ -o-transition-timing-function: ease-out;
806
+ transition-timing-function: ease-out;
807
+ }
808
+ .wpr-button-shutter-in-vertical:hover:before, .wpr-button-shutter-in-vertical:focus:before, .wpr-button-shutter-in-vertical:active:before {
809
+ -webkit-transform: scaleY(0);
810
+ -ms-transform: scaleY(0);
811
+ transform: scaleY(0);
812
+ }
813
+
814
+ /* Shutter Out Vertical */
815
+ .wpr-button-shutter-out-vertical {
816
+ display: inline-block;
817
+ vertical-align: middle;
818
+ -webkit-transform: perspective(1px) translateZ(0);
819
+ transform: perspective(1px) translateZ(0);
820
+ position: relative;
821
+ -webkit-transition-property: color;
822
+ -o-transition-property: color;
823
+ transition-property: color;
824
+ -webkit-transition-duration: 0.3s;
825
+ -o-transition-duration: 0.3s;
826
+ transition-duration: 0.3s;
827
+ }
828
+ .wpr-button-shutter-out-vertical:before {
829
+ content: "";
830
+ position: absolute;
831
+ z-index: -1;
832
+ top: 0;
833
+ bottom: 0;
834
+ left: 0;
835
+ right: 0;
836
+ -webkit-transform: scaleY(0);
837
+ -ms-transform: scaleY(0);
838
+ transform: scaleY(0);
839
+ -webkit-transform-origin: 50%;
840
+ -ms-transform-origin: 50%;
841
+ transform-origin: 50%;
842
+ -webkit-transition-property: transform;
843
+ -webkit-transition-property: -webkit-transform;
844
+ transition-property: -webkit-transform;
845
+ -o-transition-property: transform;
846
+ transition-property: transform;
847
+ transition-property: transform, -webkit-transform;
848
+ -webkit-transition-duration: 0.3s;
849
+ -o-transition-duration: 0.3s;
850
+ transition-duration: 0.3s;
851
+ -webkit-transition-timing-function: ease-out;
852
+ -o-transition-timing-function: ease-out;
853
+ transition-timing-function: ease-out;
854
+ }
855
+
856
+ .wpr-button-shutter-out-vertical:hover:before, .wpr-button-shutter-out-vertical:focus:before, .wpr-button-shutter-out-vertical:active:before {
857
+ -webkit-transform: scaleY(1);
858
+ -ms-transform: scaleY(1);
859
+ transform: scaleY(1);
860
+ }
861
+
862
+ /* BORDER TRANSITIONS */
863
+
864
+ /* Underline From Left */
865
+ .wpr-button-underline-from-left {
866
+ display: inline-block;
867
+ vertical-align: middle;
868
+ -webkit-transform: perspective(1px) translateZ(0);
869
+ transform: perspective(1px) translateZ(0);
870
+ position: relative;
871
+ border: none !important;
872
+ overflow: hidden;
873
+ }
874
+ .wpr-button-underline-from-left:before {
875
+ content: "";
876
+ position: absolute;
877
+ z-index: -1;
878
+ left: 0;
879
+ right: 100%;
880
+ bottom: 0;
881
+ height: 4px;
882
+ -webkit-transition-property: right;
883
+ -o-transition-property: right;
884
+ transition-property: right;
885
+ -webkit-transition-duration: 0.3s;
886
+ -o-transition-duration: 0.3s;
887
+ transition-duration: 0.3s;
888
+ -webkit-transition-timing-function: ease-out;
889
+ -o-transition-timing-function: ease-out;
890
+ transition-timing-function: ease-out;
891
+ }
892
+ .wpr-button-underline-from-left:hover:before, .wpr-button-underline-from-left:focus:before, .wpr-button-underline-from-left:active:before {
893
+ right: 0;
894
+ }
895
+
896
+ /* Underline From Center */
897
+ .wpr-button-underline-from-center {
898
+ display: inline-block;
899
+ vertical-align: middle;
900
+ -webkit-transform: perspective(1px) translateZ(0);
901
+ transform: perspective(1px) translateZ(0);
902
+ position: relative;
903
+ border: none !important;
904
+ overflow: hidden;
905
+ }
906
+ .wpr-button-underline-from-center:before {
907
+ content: "";
908
+ position: absolute;
909
+ z-index: -1;
910
+ left: 51%;
911
+ right: 51%;
912
+ bottom: 0;
913
+ -webkit-transition-property: left, right;
914
+ -o-transition-property: left, right;
915
+ transition-property: left, right;
916
+ -webkit-transition-duration: 0.3s;
917
+ -o-transition-duration: 0.3s;
918
+ transition-duration: 0.3s;
919
+ -webkit-transition-timing-function: ease-out;
920
+ -o-transition-timing-function: ease-out;
921
+ transition-timing-function: ease-out;
922
+ }
923
+ .wpr-button-underline-from-center:hover:before, .wpr-button-underline-from-center:focus:before, .wpr-button-underline-from-center:active:before {
924
+ left: 0;
925
+ right: 0;
926
+ }
927
+
928
+ /* Underline From Right */
929
+ .wpr-button-underline-from-right {
930
+ display: inline-block;
931
+ vertical-align: middle;
932
+ -webkit-transform: perspective(1px) translateZ(0);
933
+ transform: perspective(1px) translateZ(0);
934
+ position: relative;
935
+ border: none !important;
936
+ overflow: hidden;
937
+ }
938
+ .wpr-button-underline-from-right:before {
939
+ content: "";
940
+ position: absolute;
941
+ z-index: -1;
942
+ left: 100%;
943
+ right: 0;
944
+ bottom: 0;
945
+ -webkit-transition-property: left;
946
+ -o-transition-property: left;
947
+ transition-property: left;
948
+ -webkit-transition-duration: 0.3s;
949
+ -o-transition-duration: 0.3s;
950
+ transition-duration: 0.3s;
951
+ -webkit-transition-timing-function: ease-out;
952
+ -o-transition-timing-function: ease-out;
953
+ transition-timing-function: ease-out;
954
+ }
955
+ .wpr-button-underline-from-right:hover:before, .wpr-button-underline-from-right:focus:before, .wpr-button-underline-from-right:active:before {
956
+ left: 0;
957
+ }
958
+
959
+ /* Overline From Left */
960
+ .wpr-button-overline-from-left {
961
+ display: inline-block;
962
+ vertical-align: middle;
963
+ -webkit-transform: perspective(1px) translateZ(0);
964
+ transform: perspective(1px) translateZ(0);
965
+ position: relative;
966
+ border: none !important;
967
+ overflow: hidden;
968
+ }
969
+ .wpr-button-overline-from-left:before {
970
+ content: "";
971
+ position: absolute;
972
+ z-index: -1;
973
+ left: 0;
974
+ right: 100%;
975
+ top: 0;
976
+ -webkit-transition-property: right;
977
+ -o-transition-property: right;
978
+ transition-property: right;
979
+ -webkit-transition-duration: 0.3s;
980
+ -o-transition-duration: 0.3s;
981
+ transition-duration: 0.3s;
982
+ -webkit-transition-timing-function: ease-out;
983
+ -o-transition-timing-function: ease-out;
984
+ transition-timing-function: ease-out;
985
+ }
986
+ .wpr-button-overline-from-left:hover:before, .wpr-button-overline-from-left:focus:before, .wpr-button-overline-from-left:active:before {
987
+ right: 0;
988
+ }
989
+
990
+ /* Overline From Center */
991
+ .wpr-button-overline-from-center {
992
+ display: inline-block;
993
+ vertical-align: middle;
994
+ -webkit-transform: perspective(1px) translateZ(0);
995
+ transform: perspective(1px) translateZ(0);
996
+ position: relative;
997
+ border: none !important;
998
+ overflow: hidden;
999
+ }
1000
+ .wpr-button-overline-from-center:before {
1001
+ content: "";
1002
+ position: absolute;
1003
+ z-index: -1;
1004
+ left: 51%;
1005
+ right: 51%;
1006
+ top: 0;
1007
+ -webkit-transition-property: left, right;
1008
+ -o-transition-property: left, right;
1009
+ transition-property: left, right;
1010
+ -webkit-transition-duration: 0.3s;
1011
+ -o-transition-duration: 0.3s;
1012
+ transition-duration: 0.3s;
1013
+ -webkit-transition-timing-function: ease-out;
1014
+ -o-transition-timing-function: ease-out;
1015
+ transition-timing-function: ease-out;
1016
+ }
1017
+ .wpr-button-overline-from-center:hover:before, .wpr-button-overline-from-center:focus:before, .wpr-button-overline-from-center:active:before {
1018
+ left: 0;
1019
+ right: 0;
1020
+ }
1021
+
1022
+ /* Overline From Right */
1023
+ .wpr-button-overline-from-right {
1024
+ display: inline-block;
1025
+ vertical-align: middle;
1026
+ -webkit-transform: perspective(1px) translateZ(0);
1027
+ transform: perspective(1px) translateZ(0);
1028
+ position: relative;
1029
+ border: none !important;
1030
+ overflow: hidden;
1031
+ }
1032
+ .wpr-button-overline-from-right:before {
1033
+ content: "";
1034
+ position: absolute;
1035
+ z-index: -1;
1036
+ left: 100%;
1037
+ right: 0;
1038
+ top: 0;
1039
+ -webkit-transition-property: left;
1040
+ -o-transition-property: left;
1041
+ transition-property: left;
1042
+ -webkit-transition-duration: 0.3s;
1043
+ -o-transition-duration: 0.3s;
1044
+ transition-duration: 0.3s;
1045
+ -webkit-transition-timing-function: ease-out;
1046
+ -o-transition-timing-function: ease-out;
1047
+ transition-timing-function: ease-out;
1048
+ }
1049
+ .wpr-button-overline-from-right:hover:before, .wpr-button-overline-from-right:focus:before, .wpr-button-overline-from-right:active:before {
1050
+ left: 0;
1051
+ }
1052
+
1053
+ /* Underline Reveal */
1054
+ .wpr-button-underline-reveal {
1055
+ display: inline-block;
1056
+ vertical-align: middle;
1057
+ -webkit-transform: perspective(1px) translateZ(0);
1058
+ transform: perspective(1px) translateZ(0);
1059
+ position: relative;
1060
+ border: none !important;
1061
+ overflow: hidden;
1062
+ }
1063
+ .wpr-button-underline-reveal:before {
1064
+ content: "";
1065
+ position: absolute;
1066
+ z-index: -1;
1067
+ left: 0;
1068
+ right: 0;
1069
+ bottom: 0;
1070
+ -webkit-transform: translateY(100%);
1071
+ -ms-transform: translateY(100%);
1072
+ transform: translateY(100%);
1073
+ -webkit-transition-property: transform;
1074
+ -webkit-transition-property: -webkit-transform;
1075
+ transition-property: -webkit-transform;
1076
+ -o-transition-property: transform;
1077
+ transition-property: transform;
1078
+ transition-property: transform, -webkit-transform;
1079
+ -webkit-transition-duration: 0.3s;
1080
+ -o-transition-duration: 0.3s;
1081
+ transition-duration: 0.3s;
1082
+ -webkit-transition-timing-function: ease-out;
1083
+ -o-transition-timing-function: ease-out;
1084
+ transition-timing-function: ease-out;
1085
+ }
1086
+ .wpr-button-underline-reveal:hover:before, .wpr-button-underline-reveal:focus:before, .wpr-button-underline-reveal:active:before {
1087
+ -webkit-transform: translateY(0);
1088
+ -ms-transform: translateY(0);
1089
+ transform: translateY(0);
1090
+ }
1091
+
1092
+ /* Overline Reveal */
1093
+ .wpr-button-overline-reveal {
1094
+ display: inline-block;
1095
+ vertical-align: middle;
1096
+ -webkit-transform: perspective(1px) translateZ(0);
1097
+ transform: perspective(1px) translateZ(0);
1098
+ position: relative;
1099
+ border: none !important;
1100
+ overflow: hidden;
1101
+ }
1102
+ .wpr-button-overline-reveal:before {
1103
+ content: "";
1104
+ position: absolute;
1105
+ z-index: -1;
1106
+ left: 0;
1107
+ right: 0;
1108
+ top: 0;
1109
+ -webkit-transform: translateY(-100%);
1110
+ -ms-transform: translateY(-100%);
1111
+ transform: translateY(-100%);
1112
+ -webkit-transition-property: transform;
1113
+ -webkit-transition-property: -webkit-transform;
1114
+ transition-property: -webkit-transform;
1115
+ -o-transition-property: transform;
1116
+ transition-property: transform;
1117
+ transition-property: transform, -webkit-transform;
1118
+ -webkit-transition-duration: 0.3s;
1119
+ -o-transition-duration: 0.3s;
1120
+ transition-duration: 0.3s;
1121
+ -webkit-transition-timing-function: ease-out;
1122
+ -o-transition-timing-function: ease-out;
1123
+ transition-timing-function: ease-out;
1124
+ }
1125
+ .wpr-button-overline-reveal:hover:before, .wpr-button-overline-reveal:focus:before, .wpr-button-overline-reveal:active:before {
1126
+ -webkit-transform: translateY(0);
1127
+ -ms-transform: translateY(0);
1128
+ transform: translateY(0);
1129
+ }
1130
+
1131
+ /* Winona */
1132
+ .wpr-button-winona {
1133
+ overflow: hidden;
1134
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1135
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1136
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1137
+ }
1138
+ .wpr-button-winona::after {
1139
+ content: attr(data-text);
1140
+ position: absolute;
1141
+ width: 100%;
1142
+ height: 100%;
1143
+ top: 0;
1144
+ left: 0;
1145
+ opacity: 0;
1146
+ -webkit-transform: translate3d(0, 25%, 0);
1147
+ transform: translate3d(0, 25%, 0);
1148
+ }
1149
+
1150
+ .wpr-button-winona::after,
1151
+ .wpr-button-winona > span {
1152
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1153
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1154
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1155
+ }
1156
+ .wpr-button-winona:hover::after {
1157
+ opacity: 1;
1158
+ -webkit-transform: translate3d(0, 0, 0);
1159
+ transform: translate3d(0, 0, 0);
1160
+ }
1161
+ .wpr-button-winona:hover > span {
1162
+ opacity: 0;
1163
+ -webkit-transform: translate3d(0, -25%, 0);
1164
+ transform: translate3d(0, -25%, 0);
1165
+ }
1166
+
1167
+ /* Wayra Left */
1168
+ .wpr-button-wayra-left {
1169
+ overflow: hidden;
1170
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1171
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1172
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1173
+ }
1174
+ .wpr-button-wayra-left::after {
1175
+ content: '';
1176
+ position: absolute;
1177
+ top: 0;
1178
+ left: 0;
1179
+ width: 150%;
1180
+ height: 100%;
1181
+ z-index: -1;
1182
+ -webkit-transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
1183
+ transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
1184
+ -webkit-transform-origin: 0% 100%;
1185
+ -ms-transform-origin: 0% 100%;
1186
+ transform-origin: 0% 100%;
1187
+ -webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
1188
+ -webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1189
+ transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1190
+ -o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1191
+ transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1192
+ transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1193
+ }
1194
+
1195
+ .wpr-button-wayra-left:hover::after {
1196
+ opacity: 1;
1197
+ -webkit-transform: rotate3d(0, 0, 1, 0deg);
1198
+ transform: rotate3d(0, 0, 1, 0deg);
1199
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1200
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1201
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1202
+ }
1203
+
1204
+ /* Wayra Right */
1205
+ .wpr-button-wayra-right {
1206
+ overflow: hidden;
1207
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1208
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1209
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1210
+ }
1211
+ .wpr-button-wayra-right::after {
1212
+ content: '';
1213
+ position: absolute;
1214
+ top: 0;
1215
+ right: 0;
1216
+ width: 150%;
1217
+ height: 100%;
1218
+ z-index: -1;
1219
+ -webkit-transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
1220
+ transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
1221
+ -webkit-transform-origin: 100% 100%;
1222
+ -ms-transform-origin: 100% 100%;
1223
+ transform-origin: 100% 100%;
1224
+ -webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
1225
+ -webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1226
+ transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1227
+ -o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1228
+ transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
1229
+ transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
1230
+ }
1231
+
1232
+ .wpr-button-wayra-right:hover::after {
1233
+ opacity: 1;
1234
+ -webkit-transform: rotate3d(0, 0, 1, 0deg);
1235
+ transform: rotate3d(0, 0, 1, 0deg);
1236
+ -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1237
+ -o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1238
+ transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
1239
+ }
1240
+
1241
+
1242
+ /* Rayen Left */
1243
+ .wpr-button-rayen-left {
1244
+ overflow: hidden;
1245
+ }
1246
+ .wpr-button-rayen-left::after {
1247
+ content: attr(data-text);
1248
+ position: absolute;
1249
+ top: 0;
1250
+ left: 0;
1251
+ width: 100%;
1252
+ height: 100%;
1253
+ -webkit-transform: translate3d(-100%, 0, 0);
1254
+ transform: translate3d(-100%, 0, 0);
1255
+ z-index: 10;
1256
+ }
1257
+ .wpr-button-rayen-left::after,
1258
+ .wpr-button-rayen-left > span {
1259
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1260
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1261
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1262
+ }
1263
+ .wpr-button-rayen-left:hover::after {
1264
+ -webkit-transform: translate3d(0, 0, 0);
1265
+ transform: translate3d(0, 0, 0);
1266
+ }
1267
+ .wpr-button-rayen-left:hover > span {
1268
+ -webkit-transform: translate3d(0, 100%, 0);
1269
+ transform: translate3d(0, 100%, 0);
1270
+ }
1271
+
1272
+ /* Rayen Right */
1273
+ .wpr-button-rayen-right {
1274
+ overflow: hidden;
1275
+ }
1276
+ .wpr-button-rayen-right::after {
1277
+ content: attr(data-text);
1278
+ position: absolute;
1279
+ top: 0;
1280
+ right: 0;
1281
+ width: 100%;
1282
+ height: 100%;
1283
+ -webkit-transform: translate3d(100%, 0, 0);
1284
+ transform: translate3d(100%, 0, 0);
1285
+ z-index: 10;
1286
+ }
1287
+ .wpr-button-rayen-right::after,
1288
+ .wpr-button-rayen-right > span {
1289
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1290
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1291
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1292
+ }
1293
+ .wpr-button-rayen-right:hover::after {
1294
+ -webkit-transform: translate3d(0, 0, 0);
1295
+ transform: translate3d(0, 0, 0);
1296
+ }
1297
+ .wpr-button-rayen-right:hover > span {
1298
+ -webkit-transform: translate3d(0, 100%, 0);
1299
+ transform: translate3d(0, 100%, 0);
1300
+ }
1301
+
1302
+ /* Isi Right */
1303
+ .wpr-button-isi-left {
1304
+ overflow: hidden;
1305
+ }
1306
+ .wpr-button-isi-left::after {
1307
+ content: '';
1308
+ z-index: -1;
1309
+ position: absolute;
1310
+ top: 50%;
1311
+ right: 100%;
1312
+ margin: -15px 0 0 1px;
1313
+ width: 15%;
1314
+ height: 30px;
1315
+ border-radius: 50%;
1316
+ -webkit-transform-origin: 0% 50%;
1317
+ -ms-transform-origin: 0% 50%;
1318
+ transform-origin: 0% 50%;
1319
+ -webkit-transform: scale3d(1, 2, 1);
1320
+ transform: scale3d(1, 2, 1);
1321
+ -webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1322
+ -o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1323
+ transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1324
+ }
1325
+ .wpr-button-isi-left:hover::after {
1326
+ -webkit-transform: scale3d(9, 9, 1);
1327
+ }
1328
+
1329
+ /* Isi Left */
1330
+ .wpr-button-isi-right {
1331
+ overflow: hidden;
1332
+ }
1333
+ .wpr-button-isi-right::after {
1334
+ content: '';
1335
+ z-index: -1;
1336
+ position: absolute;
1337
+ top: 50%;
1338
+ left: 100%;
1339
+ margin: -15px 0 0 1px;
1340
+ width: 15%;
1341
+ height: 30px;
1342
+ border-radius: 50%;
1343
+ -webkit-transform-origin: 100% 50%;
1344
+ -ms-transform-origin: 100% 50%;
1345
+ transform-origin: 100% 50%;
1346
+ -webkit-transform: scale3d(1, 2, 1);
1347
+ transform: scale3d(1, 2, 1);
1348
+ -webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1349
+ -o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1350
+ transition-timing-function: cubic-bezier(0.7,0,0.9,1);
1351
+ }
1352
+ .wpr-button-isi-right:hover::after {
1353
+ -webkit-transform: scale3d(9, 9, 1);
1354
+ transform: scale3d(9, 9, 1);
1355
+ }
1356
+
1357
+ /* Aylen */
1358
+ .wpr-button-aylen {
1359
+ overflow: hidden;
1360
+ }
1361
+
1362
+ .wpr-button-aylen::after,
1363
+ .wpr-button-aylen::before {
1364
+ content: '';
1365
+ position: absolute;
1366
+ height: 100%;
1367
+ width: 100%;
1368
+ bottom: 100%;
1369
+ left: 0;
1370
+ z-index: -1;
1371
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1372
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1373
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1374
+ }
1375
+
1376
+ .wpr-button-aylen::after {
1377
+ opacity: 0.75;
1378
+ }
1379
+
1380
+ .wpr-button-aylen:hover::after,
1381
+ .wpr-button-aylen:hover::before {
1382
+ -webkit-transform: translate3d(0, 100%, 0);
1383
+ transform: translate3d(0, 100%, 0);
1384
+ }
1385
+ .wpr-button-aylen:hover::before {
1386
+ -webkit-transition-delay: 0.175s;
1387
+ -o-transition-delay: 0.175s;
1388
+ transition-delay: 0.175s;
1389
+ }
1390
+
1391
+ /* Antiman */
1392
+ .wpr-button-antiman {
1393
+ overflow: visible !important;
1394
+ border: none !important;
1395
+ }
1396
+
1397
+ .wpr-button-antiman::after {
1398
+ content: '';
1399
+ z-index: -1;
1400
+ border-radius: inherit;
1401
+ pointer-events: none;
1402
+ position: absolute;
1403
+ top: 0;
1404
+ left: 0;
1405
+ width: 100%;
1406
+ height: 100%;
1407
+ -webkit-backface-visibility: hidden;
1408
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1409
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1410
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1411
+ }
1412
+ .wpr-button-antiman::after {
1413
+ opacity: 0;
1414
+ -webkit-transform: scale3d(1.2, 1.2, 1);
1415
+ transform: scale3d(1.2, 1.2, 1);
1416
+ }
1417
+ .wpr-button-antiman:hover::after {
1418
+ opacity: 1;
1419
+ -webkit-transform: scale3d(1, 1, 1);
1420
+ transform: scale3d(1, 1, 1);
1421
+ }
1422
+
1423
+ /* Naira */
1424
+ .wpr-button-naira {
1425
+ overflow: hidden;
1426
+ }
1427
+ .wpr-button-naira::after {
1428
+ content: '';
1429
+ position: absolute;
1430
+ left: -50%;
1431
+ width: 200%;
1432
+ height: 200%;
1433
+ top: -50%;
1434
+ z-index: -1;
1435
+ -webkit-transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
1436
+ transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
1437
+ }
1438
+ .wpr-button-naira .wpr-button-button-icon {
1439
+ position: absolute;
1440
+ top: 0;
1441
+ width: 100%;
1442
+ height: 100%;
1443
+ left: 0;
1444
+ margin: 0 !important;
1445
+ -webkit-transform: translate3d(0, -100%, 0);
1446
+ transform: translate3d(0, -100%, 0);
1447
+ opacity: 0;
1448
+ }
1449
+ .wpr-button-naira .wpr-button-button-icon i {
1450
+ position: absolute;
1451
+ top: 50%;
1452
+ left: 50%;
1453
+ -webkit-transform: translate(-50%,-50%);
1454
+ -ms-transform: translate(-50%,-50%);
1455
+ transform: translate(-50%,-50%);
1456
+ }
1457
+
1458
+ .wpr-button-naira .wpr-button-button-text {
1459
+ display: block;
1460
+ }
1461
+
1462
+ .wpr-button-naira .wpr-button-button-text,
1463
+ .wpr-button-naira .wpr-button-button-icon {
1464
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1465
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1466
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1467
+ }
1468
+
1469
+ .wpr-button-naira:hover .wpr-button-button-icon {
1470
+ -webkit-transform: translate3d(0, 0, 0);
1471
+ transform: translate3d(0, 0, 0);
1472
+ opacity: 1;
1473
+ }
1474
+ .wpr-button-naira:hover .wpr-button-button-text {
1475
+ opacity: 0;
1476
+ -webkit-transform: translate3d(0, 100%, 0);
1477
+ transform: translate3d(0, 100%, 0);
1478
+ }
1479
+ @-webkit-keyframes anim-naira-1 {
1480
+ 50% {
1481
+ -webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1482
+ transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1483
+ -webkit-animation-timing-function: ease-out;
1484
+ animation-timing-function: ease-out;
1485
+ }
1486
+ 100% {
1487
+ -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1488
+ transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1489
+ }
1490
+ }
1491
+ @keyframes anim-naira-1 {
1492
+ 50% {
1493
+ -webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1494
+ transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
1495
+ -webkit-animation-timing-function: ease-out;
1496
+ animation-timing-function: ease-out;
1497
+ }
1498
+ 100% {
1499
+ -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1500
+ transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1501
+ }
1502
+ }
1503
+ .wpr-button-naira:hover::after {
1504
+ -webkit-animation-name: anim-naira-1;
1505
+ animation-name: anim-naira-1;
1506
+ -webkit-animation-fill-mode: forwards;
1507
+ animation-fill-mode: forwards;
1508
+ -webkit-animation-timing-function: ease-in;
1509
+ animation-timing-function: ease-in;
1510
+ }
1511
+
1512
+ /* Naira Up*/
1513
+ .wpr-button-naira-up {
1514
+ overflow: hidden;
1515
+ }
1516
+ .wpr-button-naira-up::after {
1517
+ content: '';
1518
+ position: absolute;
1519
+ left: -50%;
1520
+ width: 200%;
1521
+ height: 200%;
1522
+ top: -50%;
1523
+ z-index: -1;
1524
+ -webkit-transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
1525
+ transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
1526
+ }
1527
+ .wpr-button-naira-up .wpr-button-button-icon {
1528
+ position: absolute;
1529
+ top: 0;
1530
+ width: 100%;
1531
+ height: 100%;
1532
+ left: 0;
1533
+ margin: 0 !important;
1534
+ -webkit-transform: translate3d(0, 100%, 0);
1535
+ transform: translate3d(0, 100%, 0);
1536
+ opacity: 0;
1537
+ }
1538
+
1539
+ .wpr-button-naira-up .wpr-button-button-icon i {
1540
+ position: absolute;
1541
+ top: 50%;
1542
+ left: 50%;
1543
+ -webkit-transform: translate(-50%,-50%);
1544
+ -ms-transform: translate(-50%,-50%);
1545
+ transform: translate(-50%,-50%);
1546
+ }
1547
+
1548
+ .wpr-button-naira-up .wpr-button-button-text {
1549
+ display: block;
1550
+ }
1551
+
1552
+ .wpr-button-naira-up .wpr-button-button-text,
1553
+ .wpr-button-naira-up .wpr-button-button-icon {
1554
+ -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1555
+ -o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1556
+ transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
1557
+ }
1558
+
1559
+ .wpr-button-naira-up:hover .wpr-button-button-icon {
1560
+ -webkit-transform: translate3d(0, 0, 0);
1561
+ transform: translate3d(0, 0, 0);
1562
+ opacity: 1;
1563
+ }
1564
+ .wpr-button-naira-up:hover .wpr-button-button-text {
1565
+ opacity: 0;
1566
+ -webkit-transform: translate3d(0, -100%, 0);
1567
+ transform: translate3d(0, -100%, 0);
1568
+ }
1569
+ @-webkit-keyframes anim-naira-2 {
1570
+ 50% {
1571
+ -webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1572
+ transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1573
+ -webkit-animation-timing-function: ease-out;
1574
+ animation-timing-function: ease-out;
1575
+ }
1576
+ 100% {
1577
+ -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1578
+ transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1579
+ }
1580
+ }
1581
+ @keyframes anim-naira-2 {
1582
+ 50% {
1583
+ -webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1584
+ transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
1585
+ -webkit-animation-timing-function: ease-out;
1586
+ animation-timing-function: ease-out;
1587
+ }
1588
+ 100% {
1589
+ -webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1590
+ transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
1591
+ }
1592
+ }
1593
+ .wpr-button-naira-up:hover::after {
1594
+ -webkit-animation-name: anim-naira-2;
1595
+ animation-name: anim-naira-2;
1596
+ -webkit-animation-fill-mode: forwards;
1597
+ animation-fill-mode: forwards;
1598
+ -webkit-animation-timing-function: ease-in;
1599
+ animation-timing-function: ease-in;
1600
+ }
1601
+
1602
+ /* Fade */
1603
+ .wpr-button-none:before {
1604
+ content: "";
1605
+ position: absolute;
1606
+ z-index: -1;
1607
+ top: 0;
1608
+ left: 0;
1609
+ width: 100%;
1610
+ height: 100%;
1611
+ opacity: 0;
1612
+ }
1613
+ .wpr-button-none:hover:before {
1614
+ opacity: 1;
1615
+ }
1616
+
1617
+
1618
+ .wpr-button-effect,
1619
+ .wpr-button-effect::before,
1620
+ .wpr-button-effect::after,
1621
+ .wpr-button-effect span {
1622
+ -webkit-transition-property: all;
1623
+ -o-transition-property: all;
1624
+ transition-property: all;
1625
+ }
1626
+
1627
+ .wpr-button-effect::after {
1628
+ text-align: center;
1629
+ }
assets/css/lib/animations/loading-animations.css CHANGED
@@ -1,1064 +1,1064 @@
1
- /*
2
- * Usage:
3
- *
4
- <div class="wpr-rotating-plane"></div>
5
- *
6
- */
7
-
8
- .wpr-rotating-plane {
9
- width: 40px;
10
- height: 40px;
11
- background-color: #333;
12
- -webkit-animation: wpr-rotatePlane 1.2s infinite ease-in-out;
13
- animation: wpr-rotatePlane 1.2s infinite ease-in-out;
14
- }
15
-
16
- @-webkit-keyframes wpr-rotatePlane {
17
- 0% {
18
- -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
19
- transform: perspective(120px) rotateX(0deg) rotateY(0deg);
20
- }
21
- 50% {
22
- -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
23
- transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
24
- }
25
- 100% {
26
- -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
27
- transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
28
- }
29
- }
30
-
31
- @keyframes wpr-rotatePlane {
32
- 0% {
33
- -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
34
- transform: perspective(120px) rotateX(0deg) rotateY(0deg);
35
- }
36
- 50% {
37
- -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
38
- transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
39
- }
40
- 100% {
41
- -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
42
- transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
43
- }
44
- }
45
-
46
-
47
- /*
48
- * Usage:
49
- *
50
- <div class="wpr-double-bounce">
51
- <div class="wpr-child wpr-double-bounce1"></div>
52
- <div class="wpr-child wpr-double-bounce2"></div>
53
- </div>
54
- *
55
- */
56
-
57
- .wpr-double-bounce {
58
- width: 23px;
59
- height: 23px;
60
- position: relative;
61
- }
62
-
63
- .wpr-double-bounce .wpr-child {
64
- width: 100%;
65
- height: 100%;
66
- border-radius: 50%;
67
- opacity: 0.6;
68
- position: absolute;
69
- top: 0;
70
- left: 0;
71
- -webkit-animation: wpr-doubleBounce 2s infinite ease-in-out;
72
- animation: wpr-doubleBounce 2s infinite ease-in-out;
73
- }
74
-
75
- .wpr-double-bounce .wpr-double-bounce2 {
76
- -webkit-animation-delay: -1.0s;
77
- animation-delay: -1.0s;
78
- }
79
-
80
- @-webkit-keyframes wpr-doubleBounce {
81
- 0%,
82
- 100% {
83
- -webkit-transform: scale(0);
84
- transform: scale(0);
85
- }
86
- 50% {
87
- -webkit-transform: scale(1);
88
- transform: scale(1);
89
- }
90
- }
91
-
92
- @keyframes wpr-doubleBounce {
93
- 0%,
94
- 100% {
95
- -webkit-transform: scale(0);
96
- transform: scale(0);
97
- }
98
- 50% {
99
- -webkit-transform: scale(1);
100
- transform: scale(1);
101
- }
102
- }
103
-
104
-
105
- /*
106
- * Usage:
107
- *
108
- <div class="wpr-wave">
109
- <div class="wpr-rect wpr-rect1"></div>
110
- <div class="wpr-rect wpr-rect2"></div>
111
- <div class="wpr-rect wpr-rect3"></div>
112
- <div class="wpr-rect wpr-rect4"></div>
113
- <div class="wpr-rect wpr-rect5"></div>
114
- </div>
115
- *
116
- */
117
-
118
- .wpr-wave {
119
- width: 50px;
120
- height: 25px;
121
- text-align: center;
122
- }
123
-
124
- .wpr-wave .wpr-rect {
125
- height: 100%;
126
- width: 4px;
127
- margin-right: 2px;
128
- display: inline-block;
129
- -webkit-animation: wpr-waveStretchDelay 1.2s infinite ease-in-out;
130
- animation: wpr-waveStretchDelay 1.2s infinite ease-in-out;
131
- }
132
-
133
- .wpr-wave .wpr-rect1 {
134
- -webkit-animation-delay: -1.2s;
135
- animation-delay: -1.2s;
136
- }
137
-
138
- .wpr-wave .wpr-rect2 {
139
- -webkit-animation-delay: -1.1s;
140
- animation-delay: -1.1s;
141
- }
142
-
143
- .wpr-wave .wpr-rect3 {
144
- -webkit-animation-delay: -1s;
145
- animation-delay: -1s;
146
- }
147
-
148
- .wpr-wave .wpr-rect4 {
149
- -webkit-animation-delay: -0.9s;
150
- animation-delay: -0.9s;
151
- }
152
-
153
- .wpr-wave .wpr-rect5 {
154
- -webkit-animation-delay: -0.8s;
155
- animation-delay: -0.8s;
156
- }
157
-
158
- @-webkit-keyframes wpr-waveStretchDelay {
159
- 0%,
160
- 40%,
161
- 100% {
162
- -webkit-transform: scaleY(0.4);
163
- transform: scaleY(0.4);
164
- }
165
- 20% {
166
- -webkit-transform: scaleY(1);
167
- transform: scaleY(1);
168
- }
169
- }
170
-
171
- @keyframes wpr-waveStretchDelay {
172
- 0%,
173
- 40%,
174
- 100% {
175
- -webkit-transform: scaleY(0.4);
176
- transform: scaleY(0.4);
177
- }
178
- 20% {
179
- -webkit-transform: scaleY(1);
180
- transform: scaleY(1);
181
- }
182
- }
183
-
184
-
185
- /*
186
- * Usage:
187
- *
188
- <div class="wpr-wandering-cubes">
189
- <div class="wpr-cube wpr-cube1"></div>
190
- <div class="wpr-cube wpr-cube2"></div>
191
- </div>
192
- *
193
- */
194
-
195
- .wpr-wandering-cubes {
196
- width: 40px;
197
- height: 40px;
198
- position: relative;
199
- }
200
-
201
- .wpr-wandering-cubes .wpr-cube {
202
- background-color: #333;
203
- width: 10px;
204
- height: 10px;
205
- position: absolute;
206
- top: 0;
207
- left: 0;
208
- -webkit-animation: wpr-wanderingCube 1.8s ease-in-out -1.8s infinite both;
209
- animation: wpr-wanderingCube 1.8s ease-in-out -1.8s infinite both;
210
- }
211
-
212
- .wpr-wandering-cubes .wpr-cube2 {
213
- -webkit-animation-delay: -0.9s;
214
- animation-delay: -0.9s;
215
- }
216
-
217
- @-webkit-keyframes wpr-wanderingCube {
218
- 0% {
219
- -webkit-transform: rotate(0deg);
220
- transform: rotate(0deg);
221
- }
222
- 25% {
223
- -webkit-transform: translateX(30px) rotate(-90deg) scale(0.5);
224
- transform: translateX(30px) rotate(-90deg) scale(0.5);
225
- }
226
- 50% {
227
- /* Hack to make FF rotate in the right direction */
228
- -webkit-transform: translateX(30px) translateY(30px) rotate(-179deg);
229
- transform: translateX(30px) translateY(30px) rotate(-179deg);
230
- }
231
- 50.1% {
232
- -webkit-transform: translateX(30px) translateY(30px) rotate(-180deg);
233
- transform: translateX(30px) translateY(30px) rotate(-180deg);
234
- }
235
- 75% {
236
- -webkit-transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
237
- transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
238
- }
239
- 100% {
240
- -webkit-transform: rotate(-360deg);
241
- transform: rotate(-360deg);
242
- }
243
- }
244
-
245
- @keyframes wpr-wanderingCube {
246
- 0% {
247
- -webkit-transform: rotate(0deg);
248
- transform: rotate(0deg);
249
- }
250
- 25% {
251
- -webkit-transform: translateX(30px) rotate(-90deg) scale(0.5);
252
- transform: translateX(30px) rotate(-90deg) scale(0.5);
253
- }
254
- 50% {
255
- /* Hack to make FF rotate in the right direction */
256
- -webkit-transform: translateX(30px) translateY(30px) rotate(-179deg);
257
- transform: translateX(30px) translateY(30px) rotate(-179deg);
258
- }
259
- 50.1% {
260
- -webkit-transform: translateX(30px) translateY(30px) rotate(-180deg);
261
- transform: translateX(30px) translateY(30px) rotate(-180deg);
262
- }
263
- 75% {
264
- -webkit-transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
265
- transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
266
- }
267
- 100% {
268
- -webkit-transform: rotate(-360deg);
269
- transform: rotate(-360deg);
270
- }
271
- }
272
-
273
-
274
- /*
275
- * Usage:
276
- *
277
- <div class="wpr-spinner wpr-spinner-pulse"></div>
278
- *
279
- */
280
-
281
- .wpr-spinner-pulse {
282
- width: 23px;
283
- height: 23px;
284
- border-radius: 100%;
285
- -webkit-animation: wpr-pulseScaleOut 1s infinite ease-in-out;
286
- animation: wpr-pulseScaleOut 1s infinite ease-in-out;
287
- }
288
-
289
- @-webkit-keyframes wpr-pulseScaleOut {
290
- 0% {
291
- -webkit-transform: scale(0);
292
- transform: scale(0);
293
- }
294
- 100% {
295
- -webkit-transform: scale(1);
296
- transform: scale(1);
297
- opacity: 0;
298
- }
299
- }
300
-
301
- @keyframes wpr-pulseScaleOut {
302
- 0% {
303
- -webkit-transform: scale(0);
304
- transform: scale(0);
305
- }
306
- 100% {
307
- -webkit-transform: scale(1);
308
- transform: scale(1);
309
- opacity: 0;
310
- }
311
- }
312
-
313
-
314
- /*
315
- * Usage:
316
- *
317
- <div class="wpr-chasing-dots">
318
- <div class="wpr-child wpr-dot1"></div>
319
- <div class="wpr-child wpr-dot2"></div>
320
- </div>
321
- *
322
- */
323
-
324
- .wpr-chasing-dots {
325
- width: 20px;
326
- height: 20px;
327
- position: relative;
328
- text-align: center;
329
- -webkit-animation: wpr-chasingDotsRotate 2s infinite linear;
330
- animation: wpr-chasingDotsRotate 2s infinite linear;
331
- }
332
-
333
- .wpr-chasing-dots .wpr-child {
334
- width: 60%;
335
- height: 60%;
336
- display: inline-block;
337
- position: absolute;
338
- top: 0;
339
- border-radius: 100%;
340
- -webkit-animation: wpr-chasingDotsBounce 2s infinite ease-in-out;
341
- animation: wpr-chasingDotsBounce 2s infinite ease-in-out;
342
- }
343
-
344
- .wpr-chasing-dots .wpr-dot2 {
345
- top: auto;
346
- bottom: 0;
347
- -webkit-animation-delay: -1s;
348
- animation-delay: -1s;
349
- }
350
-
351
- @-webkit-keyframes wpr-chasingDotsRotate {
352
- 100% {
353
- -webkit-transform: rotate(360deg);
354
- transform: rotate(360deg);
355
- }
356
- }
357
-
358
- @keyframes wpr-chasingDotsRotate {
359
- 100% {
360
- -webkit-transform: rotate(360deg);
361
- transform: rotate(360deg);
362
- }
363
- }
364
-
365
- @-webkit-keyframes wpr-chasingDotsBounce {
366
- 0%,
367
- 100% {
368
- -webkit-transform: scale(0);
369
- transform: scale(0);
370
- }
371
- 50% {
372
- -webkit-transform: scale(1);
373
- transform: scale(1);
374
- }
375
- }
376
-
377
- @keyframes wpr-chasingDotsBounce {
378
- 0%,
379
- 100% {
380
- -webkit-transform: scale(0);
381
- transform: scale(0);
382
- }
383
- 50% {
384
- -webkit-transform: scale(1);
385
- transform: scale(1);
386
- }
387
- }
388
-
389
-
390
- /*
391
- * Usage:
392
- *
393
- <div class="wpr-three-bounce">
394
- <div class="wpr-child wpr-bounce1"></div>
395
- <div class="wpr-child wpr-bounce2"></div>
396
- <div class="wpr-child wpr-bounce3"></div>
397
- </div>
398
- *
399
- */
400
-
401
- .wpr-three-bounce {
402
- width: 80px;
403
- text-align: center;
404
- }
405
-
406
- .wpr-three-bounce .wpr-child {
407
- width: 10px;
408
- height: 10px;
409
- border-radius: 100%;
410
- margin-right: 1px;
411
- display: inline-block;
412
- -webkit-animation: wpr-three-bounce 1.4s ease-in-out 0s infinite both;
413
- animation: wpr-three-bounce 1.4s ease-in-out 0s infinite both;
414
- }
415
-
416
- .wpr-three-bounce .wpr-bounce1 {
417
- -webkit-animation-delay: -0.32s;
418
- animation-delay: -0.32s;
419
- }
420
-
421
- .wpr-three-bounce .wpr-bounce2 {
422
- -webkit-animation-delay: -0.16s;
423
- animation-delay: -0.16s;
424
- }
425
-
426
- @-webkit-keyframes wpr-three-bounce {
427
- 0%,
428
- 80%,
429
- 100% {
430
- -webkit-transform: scale(0);
431
- transform: scale(0);
432
- }
433
- 40% {
434
- -webkit-transform: scale(1);
435
- transform: scale(1);
436
- }
437
- }
438
-
439
- @keyframes wpr-three-bounce {
440
- 0%,
441
- 80%,
442
- 100% {
443
- -webkit-transform: scale(0);
444
- transform: scale(0);
445
- }
446
- 40% {
447
- -webkit-transform: scale(1);
448
- transform: scale(1);
449
- }
450
- }
451
-
452
-
453
- /*
454
- * Usage:
455
- *
456
- <div class="wpr-circle">
457
- <div class="wpr-circle1 wpr-child"></div>
458
- <div class="wpr-circle2 wpr-child"></div>
459
- <div class="wpr-circle3 wpr-child"></div>
460
- <div class="wpr-circle4 wpr-child"></div>
461
- <div class="wpr-circle5 wpr-child"></div>
462
- <div class="wpr-circle6 wpr-child"></div>
463
- <div class="wpr-circle7 wpr-child"></div>
464
- <div class="wpr-circle8 wpr-child"></div>
465
- <div class="wpr-circle9 wpr-child"></div>
466
- <div class="wpr-circle10 wpr-child"></div>
467
- <div class="wpr-circle11 wpr-child"></div>
468
- <div class="wpr-circle12 wpr-child"></div>
469
- </div>
470
- *
471
- */
472
-
473
- .wpr-circle {
474
- width: 22px;
475
- height: 22px;
476
- position: relative;
477
- }
478
-
479
- .wpr-circle .wpr-child {
480
- width: 100%;
481
- height: 100%;
482
- position: absolute;
483
- left: 0;
484
- top: 0;
485
- }
486
-
487
- .wpr-circle .wpr-child:before {
488
- content: '';
489
- display: block;
490
- margin: 0 auto;
491
- width: 15%;
492
- height: 15%;
493
- background-color: #333;
494
- border-radius: 100%;
495
- -webkit-animation: wpr-circleBounceDelay 1.2s infinite ease-in-out both;
496
- animation: wpr-circleBounceDelay 1.2s infinite ease-in-out both;
497
- }
498
-
499
- .wpr-circle .wpr-circle2 {
500
- -webkit-transform: rotate(30deg);
501
- -ms-transform: rotate(30deg);
502
- transform: rotate(30deg);
503
- }
504
-
505
- .wpr-circle .wpr-circle3 {
506
- -webkit-transform: rotate(60deg);
507
- -ms-transform: rotate(60deg);
508
- transform: rotate(60deg);
509
- }
510
-
511
- .wpr-circle .wpr-circle4 {
512
- -webkit-transform: rotate(90deg);
513
- -ms-transform: rotate(90deg);
514
- transform: rotate(90deg);
515
- }
516
-
517
- .wpr-circle .wpr-circle5 {
518
- -webkit-transform: rotate(120deg);
519
- -ms-transform: rotate(120deg);
520
- transform: rotate(120deg);
521
- }
522
-
523
- .wpr-circle .wpr-circle6 {
524
- -webkit-transform: rotate(150deg);
525
- -ms-transform: rotate(150deg);
526
- transform: rotate(150deg);
527
- }
528
-
529
- .wpr-circle .wpr-circle7 {
530
- -webkit-transform: rotate(180deg);
531
- -ms-transform: rotate(180deg);
532
- transform: rotate(180deg);
533
- }
534
-
535
- .wpr-circle .wpr-circle8 {
536
- -webkit-transform: rotate(210deg);
537
- -ms-transform: rotate(210deg);
538
- transform: rotate(210deg);
539
- }
540
-
541
- .wpr-circle .wpr-circle9 {
542
- -webkit-transform: rotate(240deg);
543
- -ms-transform: rotate(240deg);
544
- transform: rotate(240deg);
545
- }
546
-
547
- .wpr-circle .wpr-circle10 {
548
- -webkit-transform: rotate(270deg);
549
- -ms-transform: rotate(270deg);
550
- transform: rotate(270deg);
551
- }
552
-
553
- .wpr-circle .wpr-circle11 {
554
- -webkit-transform: rotate(300deg);
555
- -ms-transform: rotate(300deg);
556
- transform: rotate(300deg);
557
- }
558
-
559
- .wpr-circle .wpr-circle12 {
560
- -webkit-transform: rotate(330deg);
561
- -ms-transform: rotate(330deg);
562
- transform: rotate(330deg);
563
- }
564
-
565
- .wpr-circle .wpr-circle2:before {
566
- -webkit-animation-delay: -1.1s;
567
- animation-delay: -1.1s;
568
- }
569
-
570
- .wpr-circle .wpr-circle3:before {
571
- -webkit-animation-delay: -1s;
572
- animation-delay: -1s;
573
- }
574
-
575
- .wpr-circle .wpr-circle4:before {
576
- -webkit-animation-delay: -0.9s;
577
- animation-delay: -0.9s;
578
- }
579
-
580
- .wpr-circle .wpr-circle5:before {
581
- -webkit-animation-delay: -0.8s;
582
- animation-delay: -0.8s;
583
- }
584
-
585
- .wpr-circle .wpr-circle6:before {
586
- -webkit-animation-delay: -0.7s;
587
- animation-delay: -0.7s;
588
- }
589
-
590
- .wpr-circle .wpr-circle7:before {
591
- -webkit-animation-delay: -0.6s;
592
- animation-delay: -0.6s;
593
- }
594
-
595
- .wpr-circle .wpr-circle8:before {
596
- -webkit-animation-delay: -0.5s;
597
- animation-delay: -0.5s;
598
- }
599
-
600
- .wpr-circle .wpr-circle9:before {
601
- -webkit-animation-delay: -0.4s;
602
- animation-delay: -0.4s;
603
- }
604
-
605
- .wpr-circle .wpr-circle10:before {
606
- -webkit-animation-delay: -0.3s;
607
- animation-delay: -0.3s;
608
- }
609
-
610
- .wpr-circle .wpr-circle11:before {
611
- -webkit-animation-delay: -0.2s;
612
- animation-delay: -0.2s;
613
- }
614
-
615
- .wpr-circle .wpr-circle12:before {
616
- -webkit-animation-delay: -0.1s;
617
- animation-delay: -0.1s;
618
- }
619
-
620
- @-webkit-keyframes wpr-circleBounceDelay {
621
- 0%,
622
- 80%,
623
- 100% {
624
- -webkit-transform: scale(0);
625
- transform: scale(0);
626
- }
627
- 40% {
628
- -webkit-transform: scale(1);
629
- transform: scale(1);
630
- }
631
- }
632
-
633
- @keyframes wpr-circleBounceDelay {
634
- 0%,
635
- 80%,
636
- 100% {
637
- -webkit-transform: scale(0);
638
- transform: scale(0);
639
- }
640
- 40% {
641
- -webkit-transform: scale(1);
642
- transform: scale(1);
643
- }
644
- }
645
-
646
-
647
- /*
648
- * Usage:
649
- *
650
- <div class="wpr-cube-grid">
651
- <div class="wpr-cube wpr-cube1"></div>
652
- <div class="wpr-cube wpr-cube2"></div>
653
- <div class="wpr-cube wpr-cube3"></div>
654
- <div class="wpr-cube wpr-cube4"></div>
655
- <div class="wpr-cube wpr-cube5"></div>
656
- <div class="wpr-cube wpr-cube6"></div>
657
- <div class="wpr-cube wpr-cube7"></div>
658
- <div class="wpr-cube wpr-cube8"></div>
659
- <div class="wpr-cube wpr-cube9"></div>
660
- </div>
661
- *
662
- */
663
-
664
- .wpr-cube-grid {
665
- width: 40px;
666
- height: 40px;
667
- /*
668
- * Spinner positions
669
- * 1 2 3
670
- * 4 5 6
671
- * 7 8 9
672
- */
673
- }
674
-
675
- .wpr-cube-grid .wpr-cube {
676
- width: 33.33%;
677
- height: 33.33%;
678
- background-color: #333;
679
- float: left;
680
- -webkit-animation: wpr-cubeGridScaleDelay 1.3s infinite ease-in-out;
681
- animation: wpr-cubeGridScaleDelay 1.3s infinite ease-in-out;
682
- }
683
-
684
- .wpr-cube-grid .wpr-cube1 {
685
- -webkit-animation-delay: 0.2s;
686
- animation-delay: 0.2s;
687
- }
688
-
689
- .wpr-cube-grid .wpr-cube2 {
690
- -webkit-animation-delay: 0.3s;
691
- animation-delay: 0.3s;
692
- }
693
-
694
- .wpr-cube-grid .wpr-cube3 {
695
- -webkit-animation-delay: 0.4s;
696
- animation-delay: 0.4s;
697
- }
698
-
699
- .wpr-cube-grid .wpr-cube4 {
700
- -webkit-animation-delay: 0.1s;
701
- animation-delay: 0.1s;
702
- }
703
-
704
- .wpr-cube-grid .wpr-cube5 {
705
- -webkit-animation-delay: 0.2s;
706
- animation-delay: 0.2s;
707
- }
708
-
709
- .wpr-cube-grid .wpr-cube6 {
710
- -webkit-animation-delay: 0.3s;
711
- animation-delay: 0.3s;
712
- }
713
-
714
- .wpr-cube-grid .wpr-cube7 {
715
- -webkit-animation-delay: 0.0s;
716
- animation-delay: 0.0s;
717
- }
718
-
719
- .wpr-cube-grid .wpr-cube8 {
720
- -webkit-animation-delay: 0.1s;
721
- animation-delay: 0.1s;
722
- }
723
-
724
- .wpr-cube-grid .wpr-cube9 {
725
- -webkit-animation-delay: 0.2s;
726
- animation-delay: 0.2s;
727
- }
728
-
729
- @-webkit-keyframes wpr-cubeGridScaleDelay {
730
- 0%,
731
- 70%,
732
- 100% {
733
- -webkit-transform: scale3D(1, 1, 1);
734
- transform: scale3D(1, 1, 1);
735
- }
736
- 35% {
737
- -webkit-transform: scale3D(0, 0, 1);
738
- transform: scale3D(0, 0, 1);
739
- }
740
- }
741
-
742
- @keyframes wpr-cubeGridScaleDelay {
743
- 0%,
744
- 70%,
745
- 100% {
746
- -webkit-transform: scale3D(1, 1, 1);
747
- transform: scale3D(1, 1, 1);
748
- }
749
- 35% {
750
- -webkit-transform: scale3D(0, 0, 1);
751
- transform: scale3D(0, 0, 1);
752
- }
753
- }
754
-
755
-
756
- /*
757
- * Usage:
758
- *
759
- <div class="wpr-fading-circle">
760
- <div class="wpr-circle1 wpr-circle"></div>
761
- <div class="wpr-circle2 wpr-circle"></div>
762
- <div class="wpr-circle3 wpr-circle"></div>
763
- <div class="wpr-circle4 wpr-circle"></div>
764
- <div class="wpr-circle5 wpr-circle"></div>
765
- <div class="wpr-circle6 wpr-circle"></div>
766
- <div class="wpr-circle7 wpr-circle"></div>
767
- <div class="wpr-circle8 wpr-circle"></div>
768
- <div class="wpr-circle9 wpr-circle"></div>
769
- <div class="wpr-circle10 wpr-circle"></div>
770
- <div class="wpr-circle11 wpr-circle"></div>
771
- <div class="wpr-circle12 wpr-circle"></div>
772
- </div>
773
- *
774
- */
775
-
776
- .wpr-fading-circle {
777
- width: 25px;
778
- height: 25px;
779
- position: relative;
780
- }
781
-
782
- .wpr-fading-circle .wpr-circle {
783
- width: 100%;
784
- height: 100%;
785
- position: absolute;
786
- left: 0;
787
- top: 0;
788
- }
789
-
790
- .wpr-fading-circle .wpr-circle:before {
791
- content: '';
792
- display: block;
793
- margin: 0 auto;
794
- width: 15%;
795
- height: 15%;
796
- border-radius: 100%;
797
- -webkit-animation: wpr-circleFadeDelay 1.2s infinite ease-in-out both;
798
- animation: wpr-circleFadeDelay 1.2s infinite ease-in-out both;
799
- }
800
-
801
- .wpr-fading-circle .wpr-circle2 {
802
- -webkit-transform: rotate(30deg);
803
- -ms-transform: rotate(30deg);
804
- transform: rotate(30deg);
805
- }
806
-
807
- .wpr-fading-circle .wpr-circle3 {
808
- -webkit-transform: rotate(60deg);
809
- -ms-transform: rotate(60deg);
810
- transform: rotate(60deg);
811
- }
812
-
813
- .wpr-fading-circle .wpr-circle4 {
814
- -webkit-transform: rotate(90deg);
815
- -ms-transform: rotate(90deg);
816
- transform: rotate(90deg);
817
- }
818
-
819
- .wpr-fading-circle .wpr-circle5 {
820
- -webkit-transform: rotate(120deg);
821
- -ms-transform: rotate(120deg);
822
- transform: rotate(120deg);
823
- }
824
-
825
- .wpr-fading-circle .wpr-circle6 {
826
- -webkit-transform: rotate(150deg);
827
- -ms-transform: rotate(150deg);
828
- transform: rotate(150deg);
829
- }
830
-
831
- .wpr-fading-circle .wpr-circle7 {
832
- -webkit-transform: rotate(180deg);
833
- -ms-transform: rotate(180deg);
834
- transform: rotate(180deg);
835
- }
836
-
837
- .wpr-fading-circle .wpr-circle8 {
838
- -webkit-transform: rotate(210deg);
839
- -ms-transform: rotate(210deg);
840
- transform: rotate(210deg);
841
- }
842
-
843
- .wpr-fading-circle .wpr-circle9 {
844
- -webkit-transform: rotate(240deg);
845
- -ms-transform: rotate(240deg);
846
- transform: rotate(240deg);
847
- }
848
-
849
- .wpr-fading-circle .wpr-circle10 {
850
- -webkit-transform: rotate(270deg);
851
- -ms-transform: rotate(270deg);
852
- transform: rotate(270deg);
853
- }
854
-
855
- .wpr-fading-circle .wpr-circle11 {
856
- -webkit-transform: rotate(300deg);
857
- -ms-transform: rotate(300deg);
858
- transform: rotate(300deg);
859
- }
860
-
861
- .wpr-fading-circle .wpr-circle12 {
862
- -webkit-transform: rotate(330deg);
863
- -ms-transform: rotate(330deg);
864
- transform: rotate(330deg);
865
- }
866
-
867
- .wpr-fading-circle .wpr-circle2:before {
868
- -webkit-animation-delay: -1.1s;
869
- animation-delay: -1.1s;
870
- }
871
-
872
- .wpr-fading-circle .wpr-circle3:before {
873
- -webkit-animation-delay: -1s;
874
- animation-delay: -1s;
875
- }
876
-
877
- .wpr-fading-circle .wpr-circle4:before {
878
- -webkit-animation-delay: -0.9s;
879
- animation-delay: -0.9s;
880
- }
881
-
882
- .wpr-fading-circle .wpr-circle5:before {
883
- -webkit-animation-delay: -0.8s;
884
- animation-delay: -0.8s;
885
- }
886
-
887
- .wpr-fading-circle .wpr-circle6:before {
888
- -webkit-animation-delay: -0.7s;
889
- animation-delay: -0.7s;
890
- }
891
-
892
- .wpr-fading-circle .wpr-circle7:before {
893
- -webkit-animation-delay: -0.6s;
894
- animation-delay: -0.6s;
895
- }
896
-
897
- .wpr-fading-circle .wpr-circle8:before {
898
- -webkit-animation-delay: -0.5s;
899
- animation-delay: -0.5s;
900
- }
901
-
902
- .wpr-fading-circle .wpr-circle9:before {
903
- -webkit-animation-delay: -0.4s;
904
- animation-delay: -0.4s;
905
- }
906
-
907
- .wpr-fading-circle .wpr-circle10:before {
908
- -webkit-animation-delay: -0.3s;
909
- animation-delay: -0.3s;
910
- }
911
-
912
- .wpr-fading-circle .wpr-circle11:before {
913
- -webkit-animation-delay: -0.2s;
914
- animation-delay: -0.2s;
915
- }
916
-
917
- .wpr-fading-circle .wpr-circle12:before {
918
- -webkit-animation-delay: -0.1s;
919
- animation-delay: -0.1s;
920
- }
921
-
922
- @-webkit-keyframes wpr-circleFadeDelay {
923
- 0%,
924
- 39%,
925
- 100% {
926
- opacity: 0;
927
- }
928
- 40% {
929
- opacity: 1;
930
- }
931
- }
932
-
933
- @keyframes wpr-circleFadeDelay {
934
- 0%,
935
- 39%,
936
- 100% {
937
- opacity: 0;
938
- }
939
- 40% {
940
- opacity: 1;
941
- }
942
- }
943
-
944
-
945
- /*
946
- * Usage:
947
- *
948
- <div class="wpr-folding-cube">
949
- <div class="wpr-cube1 wpr-cube"></div>
950
- <div class="wpr-cube2 wpr-cube"></div>
951
- <div class="wpr-cube4 wpr-cube"></div>
952
- <div class="wpr-cube3 wpr-cube"></div>
953
- </div>
954
- *
955
- */
956
-
957
- .wpr-folding-cube {
958
- width: 40px;
959
- height: 40px;
960
- position: relative;
961
- -webkit-transform: rotateZ(45deg);
962
- -ms-transform: rotate(45deg);
963
- transform: rotateZ(45deg);
964
- }
965
-
966
- .wpr-folding-cube .wpr-cube {
967
- float: left;
968
- width: 50%;
969
- height: 50%;
970
- position: relative;
971
- -webkit-transform: scale(1.1);
972
- -ms-transform: scale(1.1);
973
- transform: scale(1.1);
974
- }
975
-
976
- .wpr-folding-cube .wpr-cube:before {
977
- content: '';
978
- position: absolute;
979
- top: 0;
980
- left: 0;
981
- width: 100%;
982
- height: 100%;
983
- background-color: #333;
984
- -webkit-animation: wpr-foldCubeAngle 2.4s infinite linear both;
985
- animation: wpr-foldCubeAngle 2.4s infinite linear both;
986
- -webkit-transform-origin: 100% 100%;
987
- -ms-transform-origin: 100% 100%;
988
- transform-origin: 100% 100%;
989
- }
990
-
991
- .wpr-folding-cube .wpr-cube2 {
992
- -webkit-transform: scale(1.1) rotateZ(90deg);
993
- -ms-transform: scale(1.1) rotate(90deg);
994
- transform: scale(1.1) rotateZ(90deg);
995
- }
996
-
997
- .wpr-folding-cube .wpr-cube3 {
998
- -webkit-transform: scale(1.1) rotateZ(180deg);
999
- -ms-transform: scale(1.1) rotate(180deg);
1000
- transform: scale(1.1) rotateZ(180deg);
1001
- }
1002
-
1003
- .wpr-folding-cube .wpr-cube4 {
1004
- -webkit-transform: scale(1.1) rotateZ(270deg);
1005
- -ms-transform: scale(1.1) rotate(270deg);
1006
- transform: scale(1.1) rotateZ(270deg);
1007
- }
1008
-
1009
- .wpr-folding-cube .wpr-cube2:before {
1010
- -webkit-animation-delay: 0.3s;
1011
- animation-delay: 0.3s;
1012
- }
1013
-
1014
- .wpr-folding-cube .wpr-cube3:before {
1015
- -webkit-animation-delay: 0.6s;
1016
- animation-delay: 0.6s;
1017
- }
1018
-
1019
- .wpr-folding-cube .wpr-cube4:before {
1020
- -webkit-animation-delay: 0.9s;
1021
- animation-delay: 0.9s;
1022
- }
1023
-
1024
- @-webkit-keyframes wpr-foldCubeAngle {
1025
- 0%,
1026
- 10% {
1027
- -webkit-transform: perspective(140px) rotateX(-180deg);
1028
- transform: perspective(140px) rotateX(-180deg);
1029
- opacity: 0;
1030
- }
1031
- 25%,
1032
- 75% {
1033
- -webkit-transform: perspective(140px) rotateX(0deg);
1034
- transform: perspective(140px) rotateX(0deg);
1035
- opacity: 1;
1036
- }
1037
- 90%,
1038
- 100% {
1039
- -webkit-transform: perspective(140px) rotateY(180deg);
1040
- transform: perspective(140px) rotateY(180deg);
1041
- opacity: 0;
1042
- }
1043
- }
1044
-
1045
- @keyframes wpr-foldCubeAngle {
1046
- 0%,
1047
- 10% {
1048
- -webkit-transform: perspective(140px) rotateX(-180deg);
1049
- transform: perspective(140px) rotateX(-180deg);
1050
- opacity: 0;
1051
- }
1052
- 25%,
1053
- 75% {
1054
- -webkit-transform: perspective(140px) rotateX(0deg);
1055
- transform: perspective(140px) rotateX(0deg);
1056
- opacity: 1;
1057
- }
1058
- 90%,
1059
- 100% {
1060
- -webkit-transform: perspective(140px) rotateY(180deg);
1061
- transform: perspective(140px) rotateY(180deg);
1062
- opacity: 0;
1063
- }
1064
  }
1
+ /*
2
+ * Usage:
3
+ *
4
+ <div class="wpr-rotating-plane"></div>
5
+ *
6
+ */
7
+
8
+ .wpr-rotating-plane {
9
+ width: 40px;
10
+ height: 40px;
11
+ background-color: #333;
12
+ -webkit-animation: wpr-rotatePlane 1.2s infinite ease-in-out;
13
+ animation: wpr-rotatePlane 1.2s infinite ease-in-out;
14
+ }
15
+
16
+ @-webkit-keyframes wpr-rotatePlane {
17
+ 0% {
18
+ -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
19
+ transform: perspective(120px) rotateX(0deg) rotateY(0deg);
20
+ }
21
+ 50% {
22
+ -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
23
+ transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
24
+ }
25
+ 100% {
26
+ -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
27
+ transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
28
+ }
29
+ }
30
+
31
+ @keyframes wpr-rotatePlane {
32
+ 0% {
33
+ -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
34
+ transform: perspective(120px) rotateX(0deg) rotateY(0deg);
35
+ }
36
+ 50% {
37
+ -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
38
+ transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
39
+ }
40
+ 100% {
41
+ -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
42
+ transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
43
+ }
44
+ }
45
+
46
+
47
+ /*
48
+ * Usage:
49
+ *
50
+ <div class="wpr-double-bounce">
51
+ <div class="wpr-child wpr-double-bounce1"></div>
52
+ <div class="wpr-child wpr-double-bounce2"></div>
53
+ </div>
54
+ *
55
+ */
56
+
57
+ .wpr-double-bounce {
58
+ width: 23px;
59
+ height: 23px;
60
+ position: relative;
61
+ }
62
+
63
+ .wpr-double-bounce .wpr-child {
64
+ width: 100%;
65
+ height: 100%;
66
+ border-radius: 50%;
67
+ opacity: 0.6;
68
+ position: absolute;
69
+ top: 0;
70
+ left: 0;
71
+ -webkit-animation: wpr-doubleBounce 2s infinite ease-in-out;
72
+ animation: wpr-doubleBounce 2s infinite ease-in-out;
73
+ }
74
+
75
+ .wpr-double-bounce .wpr-double-bounce2 {
76
+ -webkit-animation-delay: -1.0s;
77
+ animation-delay: -1.0s;
78
+ }
79
+
80
+ @-webkit-keyframes wpr-doubleBounce {
81
+ 0%,
82
+ 100% {
83
+ -webkit-transform: scale(0);
84
+ transform: scale(0);
85
+ }
86
+ 50% {
87
+ -webkit-transform: scale(1);
88
+ transform: scale(1);
89
+ }
90
+ }
91
+
92
+ @keyframes wpr-doubleBounce {
93
+ 0%,
94
+ 100% {
95
+ -webkit-transform: scale(0);
96
+ transform: scale(0);
97
+ }
98
+ 50% {
99
+ -webkit-transform: scale(1);
100
+ transform: scale(1);
101
+ }
102
+ }
103
+
104
+
105
+ /*
106
+ * Usage:
107
+ *
108
+ <div class="wpr-wave">
109
+ <div class="wpr-rect wpr-rect1"></div>
110
+ <div class="wpr-rect wpr-rect2"></div>
111
+ <div class="wpr-rect wpr-rect3"></div>
112
+ <div class="wpr-rect wpr-rect4"></div>
113
+ <div class="wpr-rect wpr-rect5"></div>
114
+ </div>
115
+ *
116
+ */
117
+
118
+ .wpr-wave {
119
+ width: 50px;
120
+ height: 25px;
121
+ text-align: center;
122
+ }
123
+
124
+ .wpr-wave .wpr-rect {
125
+ height: 100%;
126
+ width: 4px;
127
+ margin-right: 2px;
128
+ display: inline-block;
129
+ -webkit-animation: wpr-waveStretchDelay 1.2s infinite ease-in-out;
130
+ animation: wpr-waveStretchDelay 1.2s infinite ease-in-out;
131
+ }
132
+
133
+ .wpr-wave .wpr-rect1 {
134
+ -webkit-animation-delay: -1.2s;
135
+ animation-delay: -1.2s;
136
+ }
137
+
138
+ .wpr-wave .wpr-rect2 {
139
+ -webkit-animation-delay: -1.1s;
140
+ animation-delay: -1.1s;
141
+ }
142
+
143
+ .wpr-wave .wpr-rect3 {
144
+ -webkit-animation-delay: -1s;
145
+ animation-delay: -1s;
146
+ }
147
+
148
+ .wpr-wave .wpr-rect4 {
149
+ -webkit-animation-delay: -0.9s;
150
+ animation-delay: -0.9s;
151
+ }
152
+
153
+ .wpr-wave .wpr-rect5 {
154
+ -webkit-animation-delay: -0.8s;
155
+ animation-delay: -0.8s;
156
+ }
157
+
158
+ @-webkit-keyframes wpr-waveStretchDelay {
159
+ 0%,
160
+ 40%,
161
+ 100% {
162
+ -webkit-transform: scaleY(0.4);
163
+ transform: scaleY(0.4);
164
+ }
165
+ 20% {
166
+ -webkit-transform: scaleY(1);
167
+ transform: scaleY(1);
168
+ }
169
+ }
170
+
171
+ @keyframes wpr-waveStretchDelay {
172
+ 0%,
173
+ 40%,
174
+ 100% {
175
+ -webkit-transform: scaleY(0.4);
176
+ transform: scaleY(0.4);
177
+ }
178
+ 20% {
179
+ -webkit-transform: scaleY(1);
180
+ transform: scaleY(1);
181
+ }
182
+ }
183
+
184
+
185
+ /*
186
+ * Usage:
187
+ *
188
+ <div class="wpr-wandering-cubes">
189
+ <div class="wpr-cube wpr-cube1"></div>
190
+ <div class="wpr-cube wpr-cube2"></div>
191
+ </div>
192
+ *
193
+ */
194
+
195
+ .wpr-wandering-cubes {
196
+ width: 40px;
197
+ height: 40px;
198
+ position: relative;
199
+ }
200
+
201
+ .wpr-wandering-cubes .wpr-cube {
202
+ background-color: #333;
203
+ width: 10px;
204
+ height: 10px;
205
+ position: absolute;
206
+ top: 0;
207
+ left: 0;
208
+ -webkit-animation: wpr-wanderingCube 1.8s ease-in-out -1.8s infinite both;
209
+ animation: wpr-wanderingCube 1.8s ease-in-out -1.8s infinite both;
210
+ }
211
+
212
+ .wpr-wandering-cubes .wpr-cube2 {
213
+ -webkit-animation-delay: -0.9s;
214
+ animation-delay: -0.9s;
215
+ }
216
+
217
+ @-webkit-keyframes wpr-wanderingCube {
218
+ 0% {
219
+ -webkit-transform: rotate(0deg);
220
+ transform: rotate(0deg);
221
+ }
222
+ 25% {
223
+ -webkit-transform: translateX(30px) rotate(-90deg) scale(0.5);
224
+ transform: translateX(30px) rotate(-90deg) scale(0.5);
225
+ }
226
+ 50% {
227
+ /* Hack to make FF rotate in the right direction */
228
+ -webkit-transform: translateX(30px) translateY(30px) rotate(-179deg);
229
+ transform: translateX(30px) translateY(30px) rotate(-179deg);
230
+ }
231
+ 50.1% {
232
+ -webkit-transform: translateX(30px) translateY(30px) rotate(-180deg);
233
+ transform: translateX(30px) translateY(30px) rotate(-180deg);
234
+ }
235
+ 75% {
236
+ -webkit-transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
237
+ transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
238
+ }
239
+ 100% {
240
+ -webkit-transform: rotate(-360deg);
241
+ transform: rotate(-360deg);
242
+ }
243
+ }
244
+
245
+ @keyframes wpr-wanderingCube {
246
+ 0% {
247
+ -webkit-transform: rotate(0deg);
248
+ transform: rotate(0deg);
249
+ }
250
+ 25% {
251
+ -webkit-transform: translateX(30px) rotate(-90deg) scale(0.5);
252
+ transform: translateX(30px) rotate(-90deg) scale(0.5);
253
+ }
254
+ 50% {
255
+ /* Hack to make FF rotate in the right direction */
256
+ -webkit-transform: translateX(30px) translateY(30px) rotate(-179deg);
257
+ transform: translateX(30px) translateY(30px) rotate(-179deg);
258
+ }
259
+ 50.1% {
260
+ -webkit-transform: translateX(30px) translateY(30px) rotate(-180deg);
261
+ transform: translateX(30px) translateY(30px) rotate(-180deg);
262
+ }
263
+ 75% {
264
+ -webkit-transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
265
+ transform: translateX(0) translateY(30px) rotate(-270deg) scale(0.5);
266
+ }
267
+ 100% {
268
+ -webkit-transform: rotate(-360deg);
269
+ transform: rotate(-360deg);
270
+ }
271
+ }
272
+
273
+
274
+ /*
275
+ * Usage:
276
+ *
277
+ <div class="wpr-spinner wpr-spinner-pulse"></div>
278
+ *
279
+ */
280
+
281
+ .wpr-spinner-pulse {
282
+ width: 23px;
283
+ height: 23px;
284
+ border-radius: 100%;
285
+ -webkit-animation: wpr-pulseScaleOut 1s infinite ease-in-out;
286
+ animation: wpr-pulseScaleOut 1s infinite ease-in-out;
287
+ }
288
+
289
+ @-webkit-keyframes wpr-pulseScaleOut {
290
+ 0% {
291
+ -webkit-transform: scale(0);
292
+ transform: scale(0);
293
+ }
294
+ 100% {
295
+ -webkit-transform: scale(1);
296
+ transform: scale(1);
297
+ opacity: 0;
298
+ }
299
+ }
300
+
301
+ @keyframes wpr-pulseScaleOut {
302
+ 0% {
303
+ -webkit-transform: scale(0);
304
+ transform: scale(0);
305
+ }
306
+ 100% {
307
+ -webkit-transform: scale(1);
308
+ transform: scale(1);
309
+ opacity: 0;
310
+ }
311
+ }
312
+
313
+
314
+ /*
315
+ * Usage:
316
+ *
317
+ <div class="wpr-chasing-dots">
318
+ <div class="wpr-child wpr-dot1"></div>
319
+ <div class="wpr-child wpr-dot2"></div>
320
+ </div>
321
+ *
322
+ */
323
+
324
+ .wpr-chasing-dots {
325
+ width: 20px;
326
+ height: 20px;
327
+ position: relative;
328
+ text-align: center;
329
+ -webkit-animation: wpr-chasingDotsRotate 2s infinite linear;
330
+ animation: wpr-chasingDotsRotate 2s infinite linear;
331
+ }
332
+
333
+ .wpr-chasing-dots .wpr-child {
334
+ width: 60%;
335
+ height: 60%;
336
+ display: inline-block;
337
+ position: absolute;
338
+ top: 0;
339
+ border-radius: 100%;
340
+ -webkit-animation: wpr-chasingDotsBounce 2s infinite ease-in-out;
341
+ animation: wpr-chasingDotsBounce 2s infinite ease-in-out;
342
+ }
343
+
344
+ .wpr-chasing-dots .wpr-dot2 {
345
+ top: auto;
346
+ bottom: 0;
347
+ -webkit-animation-delay: -1s;
348
+ animation-delay: -1s;
349
+ }
350
+
351
+ @-webkit-keyframes wpr-chasingDotsRotate {
352
+ 100% {
353
+ -webkit-transform: rotate(360deg);
354
+ transform: rotate(360deg);
355
+ }
356
+ }
357
+
358
+ @keyframes wpr-chasingDotsRotate {
359
+ 100% {
360
+ -webkit-transform: rotate(360deg);
361
+ transform: rotate(360deg);
362
+ }
363
+ }
364
+
365
+ @-webkit-keyframes wpr-chasingDotsBounce {
366
+ 0%,
367
+ 100% {
368
+ -webkit-transform: scale(0);
369
+ transform: scale(0);
370
+ }
371
+ 50% {
372
+ -webkit-transform: scale(1);
373
+ transform: scale(1);
374
+ }
375
+ }
376
+
377
+ @keyframes wpr-chasingDotsBounce {
378
+ 0%,
379
+ 100% {
380
+ -webkit-transform: scale(0);
381
+ transform: scale(0);
382
+ }
383
+ 50% {
384
+ -webkit-transform: scale(1);
385
+ transform: scale(1);
386
+ }
387
+ }
388
+
389
+
390
+ /*
391
+ * Usage:
392
+ *
393
+ <div class="wpr-three-bounce">
394
+ <div class="wpr-child wpr-bounce1"></div>
395
+ <div class="wpr-child wpr-bounce2"></div>
396
+ <div class="wpr-child wpr-bounce3"></div>
397
+ </div>
398
+ *
399
+ */
400
+
401
+ .wpr-three-bounce {
402
+ width: 80px;
403
+ text-align: center;
404
+ }
405
+
406
+ .wpr-three-bounce .wpr-child {
407
+ width: 10px;
408
+ height: 10px;
409
+ border-radius: 100%;
410
+ margin-right: 1px;
411
+ display: inline-block;
412
+ -webkit-animation: wpr-three-bounce 1.4s ease-in-out 0s infinite both;
413
+ animation: wpr-three-bounce 1.4s ease-in-out 0s infinite both;
414
+ }
415
+
416
+ .wpr-three-bounce .wpr-bounce1 {
417
+ -webkit-animation-delay: -0.32s;
418
+ animation-delay: -0.32s;
419
+ }
420
+
421
+ .wpr-three-bounce .wpr-bounce2 {
422
+ -webkit-animation-delay: -0.16s;
423
+ animation-delay: -0.16s;
424
+ }
425
+
426
+ @-webkit-keyframes wpr-three-bounce {
427
+ 0%,
428
+ 80%,
429
+ 100% {
430
+ -webkit-transform: scale(0);
431
+ transform: scale(0);
432
+ }
433
+ 40% {
434
+ -webkit-transform: scale(1);
435
+ transform: scale(1);
436
+ }
437
+ }
438
+
439
+ @keyframes wpr-three-bounce {
440
+ 0%,
441
+ 80%,
442
+ 100% {
443
+ -webkit-transform: scale(0);
444
+ transform: scale(0);
445
+ }
446
+ 40% {
447
+ -webkit-transform: scale(1);
448
+ transform: scale(1);
449
+ }
450
+ }
451
+
452
+
453
+ /*
454
+ * Usage:
455
+ *
456
+ <div class="wpr-circle">
457
+ <div class="wpr-circle1 wpr-child"></div>
458
+ <div class="wpr-circle2 wpr-child"></div>
459
+ <div class="wpr-circle3 wpr-child"></div>
460
+ <div class="wpr-circle4 wpr-child"></div>
461
+ <div class="wpr-circle5 wpr-child"></div>
462
+ <div class="wpr-circle6 wpr-child"></div>
463
+ <div class="wpr-circle7 wpr-child"></div>
464
+ <div class="wpr-circle8 wpr-child"></div>
465
+ <div class="wpr-circle9 wpr-child"></div>
466
+ <div class="wpr-circle10 wpr-child"></div>
467
+ <div class="wpr-circle11 wpr-child"></div>
468
+ <div class="wpr-circle12 wpr-child"></div>
469
+ </div>
470
+ *
471
+ */
472
+
473
+ .wpr-circle {
474
+ width: 22px;
475
+ height: 22px;
476
+ position: relative;
477
+ }
478
+
479
+ .wpr-circle .wpr-child {
480
+ width: 100%;
481
+ height: 100%;
482
+ position: absolute;
483
+ left: 0;
484
+ top: 0;
485
+ }
486
+
487
+ .wpr-circle .wpr-child:before {
488
+ content: '';
489
+ display: block;
490
+ margin: 0 auto;
491
+ width: 15%;
492
+ height: 15%;
493
+ background-color: #333;
494
+ border-radius: 100%;
495
+ -webkit-animation: wpr-circleBounceDelay 1.2s infinite ease-in-out both;
496
+ animation: wpr-circleBounceDelay 1.2s infinite ease-in-out both;
497
+ }
498
+
499
+ .wpr-circle .wpr-circle2 {
500
+ -webkit-transform: rotate(30deg);
501
+ -ms-transform: rotate(30deg);
502
+ transform: rotate(30deg);
503
+ }
504
+
505
+ .wpr-circle .wpr-circle3 {
506
+ -webkit-transform: rotate(60deg);
507
+ -ms-transform: rotate(60deg);
508
+ transform: rotate(60deg);
509
+ }
510
+
511
+ .wpr-circle .wpr-circle4 {
512
+ -webkit-transform: rotate(90deg);
513
+ -ms-transform: rotate(90deg);
514
+ transform: rotate(90deg);
515
+ }
516
+
517
+ .wpr-circle .wpr-circle5 {
518
+ -webkit-transform: rotate(120deg);
519
+ -ms-transform: rotate(120deg);
520
+ transform: rotate(120deg);
521
+ }
522
+
523
+ .wpr-circle .wpr-circle6 {
524
+ -webkit-transform: rotate(150deg);
525
+ -ms-transform: rotate(150deg);
526
+ transform: rotate(150deg);
527
+ }
528
+
529
+ .wpr-circle .wpr-circle7 {
530
+ -webkit-transform: rotate(180deg);
531
+ -ms-transform: rotate(180deg);
532
+ transform: rotate(180deg);
533
+ }
534
+
535
+ .wpr-circle .wpr-circle8 {
536
+ -webkit-transform: rotate(210deg);
537
+ -ms-transform: rotate(210deg);
538
+ transform: rotate(210deg);
539
+ }
540
+
541
+ .wpr-circle .wpr-circle9 {
542
+ -webkit-transform: rotate(240deg);
543
+ -ms-transform: rotate(240deg);
544
+ transform: rotate(240deg);
545
+ }
546
+
547
+ .wpr-circle .wpr-circle10 {
548
+ -webkit-transform: rotate(270deg);
549
+ -ms-transform: rotate(270deg);
550
+ transform: rotate(270deg);
551
+ }
552
+
553
+ .wpr-circle .wpr-circle11 {
554
+ -webkit-transform: rotate(300deg);
555
+ -ms-transform: rotate(300deg);
556
+ transform: rotate(300deg);
557
+ }
558
+
559
+ .wpr-circle .wpr-circle12 {
560
+ -webkit-transform: rotate(330deg);
561
+ -ms-transform: rotate(330deg);
562
+ transform: rotate(330deg);
563
+ }
564
+
565
+ .wpr-circle .wpr-circle2:before {
566
+ -webkit-animation-delay: -1.1s;
567
+ animation-delay: -1.1s;
568
+ }
569
+
570
+ .wpr-circle .wpr-circle3:before {
571
+ -webkit-animation-delay: -1s;
572
+ animation-delay: -1s;
573
+ }
574
+
575
+ .wpr-circle .wpr-circle4:before {
576
+ -webkit-animation-delay: -0.9s;
577
+ animation-delay: -0.9s;
578
+ }
579
+
580
+ .wpr-circle .wpr-circle5:before {
581
+ -webkit-animation-delay: -0.8s;
582
+ animation-delay: -0.8s;
583
+ }
584
+
585
+ .wpr-circle .wpr-circle6:before {
586
+ -webkit-animation-delay: -0.7s;
587
+ animation-delay: -0.7s;
588
+ }
589
+
590
+ .wpr-circle .wpr-circle7:before {
591
+ -webkit-animation-delay: -0.6s;
592
+ animation-delay: -0.6s;
593
+ }
594
+
595
+ .wpr-circle .wpr-circle8:before {
596
+ -webkit-animation-delay: -0.5s;
597
+ animation-delay: -0.5s;
598
+ }
599
+
600
+ .wpr-circle .wpr-circle9:before {
601
+ -webkit-animation-delay: -0.4s;
602
+ animation-delay: -0.4s;
603
+ }
604
+
605
+ .wpr-circle .wpr-circle10:before {
606
+ -webkit-animation-delay: -0.3s;
607
+ animation-delay: -0.3s;
608
+ }
609
+
610
+ .wpr-circle .wpr-circle11:before {
611
+ -webkit-animation-delay: -0.2s;
612
+ animation-delay: -0.2s;
613
+ }
614
+
615
+ .wpr-circle .wpr-circle12:before {
616
+ -webkit-animation-delay: -0.1s;
617
+ animation-delay: -0.1s;
618
+ }
619
+
620
+ @-webkit-keyframes wpr-circleBounceDelay {
621
+ 0%,
622
+ 80%,
623
+ 100% {
624
+ -webkit-transform: scale(0);
625
+ transform: scale(0);
626
+ }
627
+ 40% {
628
+ -webkit-transform: scale(1);
629
+ transform: scale(1);
630
+ }
631
+ }
632
+
633
+ @keyframes wpr-circleBounceDelay {
634
+ 0%,
635
+ 80%,
636
+ 100% {
637
+ -webkit-transform: scale(0);
638
+ transform: scale(0);
639
+ }
640
+ 40% {
641
+ -webkit-transform: scale(1);
642
+ transform: scale(1);
643
+ }
644
+ }
645
+
646
+
647
+ /*
648
+ * Usage:
649
+ *
650
+ <div class="wpr-cube-grid">
651
+ <div class="wpr-cube wpr-cube1"></div>
652
+ <div class="wpr-cube wpr-cube2"></div>
653
+ <div class="wpr-cube wpr-cube3"></div>
654
+ <div class="wpr-cube wpr-cube4"></div>
655
+ <div class="wpr-cube wpr-cube5"></div>
656
+ <div class="wpr-cube wpr-cube6"></div>
657
+ <div class="wpr-cube wpr-cube7"></div>
658
+ <div class="wpr-cube wpr-cube8"></div>
659
+ <div class="wpr-cube wpr-cube9"></div>
660
+ </div>
661
+ *
662
+ */
663
+
664
+ .wpr-cube-grid {
665
+ width: 40px;
666
+ height: 40px;
667
+ /*
668
+ * Spinner positions
669
+ * 1 2 3
670
+ * 4 5 6
671
+ * 7 8 9
672
+ */
673
+ }
674
+
675
+ .wpr-cube-grid .wpr-cube {
676
+ width: 33.33%;
677
+ height: 33.33%;
678
+ background-color: #333;
679
+ float: left;
680
+ -webkit-animation: wpr-cubeGridScaleDelay 1.3s infinite ease-in-out;
681
+ animation: wpr-cubeGridScaleDelay 1.3s infinite ease-in-out;
682
+ }
683
+
684
+ .wpr-cube-grid .wpr-cube1 {
685
+ -webkit-animation-delay: 0.2s;
686
+ animation-delay: 0.2s;
687
+ }
688
+
689
+ .wpr-cube-grid .wpr-cube2 {
690
+ -webkit-animation-delay: 0.3s;
691
+ animation-delay: 0.3s;
692
+ }
693
+
694
+ .wpr-cube-grid .wpr-cube3 {
695
+ -webkit-animation-delay: 0.4s;
696
+ animation-delay: 0.4s;
697
+ }
698
+
699
+ .wpr-cube-grid .wpr-cube4 {
700
+ -webkit-animation-delay: 0.1s;
701
+ animation-delay: 0.1s;
702
+ }
703
+
704
+ .wpr-cube-grid .wpr-cube5 {
705
+ -webkit-animation-delay: 0.2s;
706
+ animation-delay: 0.2s;
707
+ }
708
+
709
+ .wpr-cube-grid .wpr-cube6 {
710
+ -webkit-animation-delay: 0.3s;
711
+ animation-delay: 0.3s;
712
+ }
713
+
714
+ .wpr-cube-grid .wpr-cube7 {
715
+ -webkit-animation-delay: 0.0s;
716
+ animation-delay: 0.0s;
717
+ }
718
+
719
+ .wpr-cube-grid .wpr-cube8 {
720
+ -webkit-animation-delay: 0.1s;
721
+ animation-delay: 0.1s;
722
+ }
723
+
724
+ .wpr-cube-grid .wpr-cube9 {
725
+ -webkit-animation-delay: 0.2s;
726
+ animation-delay: 0.2s;
727
+ }
728
+
729
+ @-webkit-keyframes wpr-cubeGridScaleDelay {
730
+ 0%,
731
+ 70%,
732
+ 100% {
733
+ -webkit-transform: scale3D(1, 1, 1);
734
+ transform: scale3D(1, 1, 1);
735
+ }
736
+ 35% {
737
+ -webkit-transform: scale3D(0, 0, 1);
738
+ transform: scale3D(0, 0, 1);
739
+ }
740
+ }
741
+
742
+ @keyframes wpr-cubeGridScaleDelay {
743
+ 0%,
744
+ 70%,
745
+ 100% {
746
+ -webkit-transform: scale3D(1, 1, 1);
747
+ transform: scale3D(1, 1, 1);
748
+ }
749
+ 35% {
750
+ -webkit-transform: scale3D(0, 0, 1);
751
+ transform: scale3D(0, 0, 1);
752
+ }
753
+ }
754
+
755
+
756
+ /*
757
+ * Usage:
758
+ *
759
+ <div class="wpr-fading-circle">
760
+ <div class="wpr-circle1 wpr-circle"></div>
761
+ <div class="wpr-circle2 wpr-circle"></div>
762
+ <div class="wpr-circle3 wpr-circle"></div>
763
+ <div class="wpr-circle4 wpr-circle"></div>
764
+ <div class="wpr-circle5 wpr-circle"></div>
765
+ <div class="wpr-circle6 wpr-circle"></div>
766
+ <div class="wpr-circle7 wpr-circle"></div>
767
+ <div class="wpr-circle8 wpr-circle"></div>
768
+ <div class="wpr-circle9 wpr-circle"></div>
769
+ <div class="wpr-circle10 wpr-circle"></div>
770
+ <div class="wpr-circle11 wpr-circle"></div>
771
+ <div class="wpr-circle12 wpr-circle"></div>
772
+ </div>
773
+ *
774
+ */
775
+
776
+ .wpr-fading-circle {
777
+ width: 25px;
778
+ height: 25px;
779
+ position: relative;
780
+ }
781
+
782
+ .wpr-fading-circle .wpr-circle {
783
+ width: 100%;
784
+ height: 100%;
785
+ position: absolute;
786
+ left: 0;
787
+ top: 0;
788
+ }
789
+
790
+ .wpr-fading-circle .wpr-circle:before {
791
+ content: '';
792
+ display: block;
793
+ margin: 0 auto;
794
+ width: 15%;
795
+ height: 15%;
796
+ border-radius: 100%;
797
+ -webkit-animation: wpr-circleFadeDelay 1.2s infinite ease-in-out both;
798
+ animation: wpr-circleFadeDelay 1.2s infinite ease-in-out both;
799
+ }
800
+
801
+ .wpr-fading-circle .wpr-circle2 {
802
+ -webkit-transform: rotate(30deg);
803
+ -ms-transform: rotate(30deg);
804
+ transform: rotate(30deg);
805
+ }
806
+
807
+ .wpr-fading-circle .wpr-circle3 {
808
+ -webkit-transform: rotate(60deg);
809
+ -ms-transform: rotate(60deg);
810
+ transform: rotate(60deg);
811
+ }
812
+
813
+ .wpr-fading-circle .wpr-circle4 {
814
+ -webkit-transform: rotate(90deg);
815
+ -ms-transform: rotate(90deg);
816
+ transform: rotate(90deg);
817
+ }
818
+
819
+ .wpr-fading-circle .wpr-circle5 {
820
+ -webkit-transform: rotate(120deg);
821
+ -ms-transform: rotate(120deg);
822
+ transform: rotate(120deg);
823
+ }
824
+
825
+ .wpr-fading-circle .wpr-circle6 {
826
+ -webkit-transform: rotate(150deg);
827
+ -ms-transform: rotate(150deg);
828
+ transform: rotate(150deg);
829
+ }
830
+
831
+ .wpr-fading-circle .wpr-circle7 {
832
+ -webkit-transform: rotate(180deg);
833
+ -ms-transform: rotate(180deg);
834
+ transform: rotate(180deg);
835
+ }
836
+
837
+ .wpr-fading-circle .wpr-circle8 {
838
+ -webkit-transform: rotate(210deg);
839
+ -ms-transform: rotate(210deg);
840
+ transform: rotate(210deg);
841
+ }
842
+
843
+ .wpr-fading-circle .wpr-circle9 {
844
+ -webkit-transform: rotate(240deg);
845
+ -ms-transform: rotate(240deg);
846
+ transform: rotate(240deg);
847
+ }
848
+
849
+ .wpr-fading-circle .wpr-circle10 {
850
+ -webkit-transform: rotate(270deg);
851
+ -ms-transform: rotate(270deg);
852
+ transform: rotate(270deg);
853
+ }
854
+
855
+ .wpr-fading-circle .wpr-circle11 {
856
+ -webkit-transform: rotate(300deg);
857
+ -ms-transform: rotate(300deg);
858
+ transform: rotate(300deg);
859
+ }
860
+
861
+ .wpr-fading-circle .wpr-circle12 {
862
+ -webkit-transform: rotate(330deg);
863
+ -ms-transform: rotate(330deg);
864
+ transform: rotate(330deg);
865
+ }
866
+
867
+ .wpr-fading-circle .wpr-circle2:before {
868
+ -webkit-animation-delay: -1.1s;
869
+ animation-delay: -1.1s;
870
+ }
871
+
872
+ .wpr-fading-circle .wpr-circle3:before {
873
+ -webkit-animation-delay: -1s;
874
+ animation-delay: -1s;
875
+ }
876
+
877
+ .wpr-fading-circle .wpr-circle4:before {
878
+ -webkit-animation-delay: -0.9s;
879
+ animation-delay: -0.9s;
880
+ }
881
+
882
+ .wpr-fading-circle .wpr-circle5:before {
883
+ -webkit-animation-delay: -0.8s;
884
+ animation-delay: -0.8s;
885
+ }
886
+
887
+ .wpr-fading-circle .wpr-circle6:before {
888
+ -webkit-animation-delay: -0.7s;
889
+ animation-delay: -0.7s;
890
+ }
891
+
892
+ .wpr-fading-circle .wpr-circle7:before {
893
+ -webkit-animation-delay: -0.6s;
894
+ animation-delay: -0.6s;
895
+ }
896
+
897
+ .wpr-fading-circle .wpr-circle8:before {
898
+ -webkit-animation-delay: -0.5s;
899
+ animation-delay: -0.5s;
900
+ }
901
+
902
+ .wpr-fading-circle .wpr-circle9:before {
903
+ -webkit-animation-delay: -0.4s;
904
+ animation-delay: -0.4s;
905
+ }
906
+
907
+ .wpr-fading-circle .wpr-circle10:before {
908
+ -webkit-animation-delay: -0.3s;
909
+ animation-delay: -0.3s;
910
+ }
911
+
912
+ .wpr-fading-circle .wpr-circle11:before {
913
+ -webkit-animation-delay: -0.2s;
914
+ animation-delay: -0.2s;
915
+ }
916
+
917
+ .wpr-fading-circle .wpr-circle12:before {
918
+ -webkit-animation-delay: -0.1s;
919
+ animation-delay: -0.1s;
920
+ }
921
+
922
+ @-webkit-keyframes wpr-circleFadeDelay {
923
+ 0%,
924
+ 39%,
925
+ 100% {
926
+ opacity: 0;
927
+ }
928
+ 40% {
929
+ opacity: 1;
930
+ }
931
+ }
932
+
933
+ @keyframes wpr-circleFadeDelay {
934
+ 0%,
935
+ 39%,
936
+ 100% {
937
+ opacity: 0;
938
+ }
939
+ 40% {
940
+ opacity: 1;
941
+ }
942
+ }
943
+
944
+
945
+ /*
946
+ * Usage:
947
+ *
948
+ <div class="wpr-folding-cube">
949
+ <div class="wpr-cube1 wpr-cube"></div>
950
+ <div class="wpr-cube2 wpr-cube"></div>
951
+ <div class="wpr-cube4 wpr-cube"></div>
952
+ <div class="wpr-cube3 wpr-cube"></div>
953
+ </div>
954
+ *
955
+ */
956
+
957
+ .wpr-folding-cube {
958
+ width: 40px;
959
+ height: 40px;
960
+ position: relative;
961
+ -webkit-transform: rotateZ(45deg);
962
+ -ms-transform: rotate(45deg);
963
+ transform: rotateZ(45deg);
964
+ }
965
+
966
+ .wpr-folding-cube .wpr-cube {
967
+ float: left;
968
+ width: 50%;
969
+ height: 50%;
970
+ position: relative;
971
+ -webkit-transform: scale(1.1);
972
+ -ms-transform: scale(1.1);
973
+ transform: scale(1.1);
974
+ }
975
+
976
+ .wpr-folding-cube .wpr-cube:before {
977
+ content: '';
978
+ position: absolute;
979
+ top: 0;
980
+ left: 0;
981
+ width: 100%;
982
+ height: 100%;
983
+ background-color: #333;
984
+ -webkit-animation: wpr-foldCubeAngle 2.4s infinite linear both;
985
+ animation: wpr-foldCubeAngle 2.4s infinite linear both;
986
+ -webkit-transform-origin: 100% 100%;
987
+ -ms-transform-origin: 100% 100%;
988
+ transform-origin: 100% 100%;
989
+ }
990
+
991
+ .wpr-folding-cube .wpr-cube2 {
992
+ -webkit-transform: scale(1.1) rotateZ(90deg);
993
+ -ms-transform: scale(1.1) rotate(90deg);
994
+ transform: scale(1.1) rotateZ(90deg);
995
+ }
996
+
997
+ .wpr-folding-cube .wpr-cube3 {
998
+ -webkit-transform: scale(1.1) rotateZ(180deg);
999
+ -ms-transform: scale(1.1) rotate(180deg);
1000
+ transform: scale(1.1) rotateZ(180deg);
1001
+ }
1002
+
1003
+ .wpr-folding-cube .wpr-cube4 {
1004
+ -webkit-transform: scale(1.1) rotateZ(270deg);
1005
+ -ms-transform: scale(1.1) rotate(270deg);
1006
+ transform: scale(1.1) rotateZ(270deg);
1007
+ }
1008
+
1009
+ .wpr-folding-cube .wpr-cube2:before {
1010
+ -webkit-animation-delay: 0.3s;
1011
+ animation-delay: 0.3s;
1012
+ }
1013
+
1014
+ .wpr-folding-cube .wpr-cube3:before {
1015
+ -webkit-animation-delay: 0.6s;
1016
+ animation-delay: 0.6s;
1017
+ }
1018
+
1019
+ .wpr-folding-cube .wpr-cube4:before {
1020
+ -webkit-animation-delay: 0.9s;
1021
+ animation-delay: 0.9s;
1022
+ }
1023
+
1024
+ @-webkit-keyframes wpr-foldCubeAngle {
1025
+ 0%,
1026
+ 10% {
1027
+ -webkit-transform: perspective(140px) rotateX(-180deg);
1028
+ transform: perspective(140px) rotateX(-180deg);
1029
+ opacity: 0;
1030
+ }
1031
+ 25%,
1032
+ 75% {
1033
+ -webkit-transform: perspective(140px) rotateX(0deg);
1034
+ transform: perspective(140px) rotateX(0deg);
1035
+ opacity: 1;
1036
+ }
1037
+ 90%,
1038
+ 100% {
1039
+ -webkit-transform: perspective(140px) rotateY(180deg);
1040
+ transform: perspective(140px) rotateY(180deg);
1041
+ opacity: 0;
1042
+ }
1043
+ }
1044
+
1045
+ @keyframes wpr-foldCubeAngle {
1046
+ 0%,
1047
+ 10% {
1048
+ -webkit-transform: perspective(140px) rotateX(-180deg);
1049
+ transform: perspective(140px) rotateX(-180deg);
1050
+ opacity: 0;
1051
+ }
1052
+ 25%,
1053
+ 75% {
1054
+ -webkit-transform: perspective(140px) rotateX(0deg);
1055
+ transform: perspective(140px) rotateX(0deg);
1056
+ opacity: 1;
1057
+ }
1058
+ 90%,
1059
+ 100% {
1060
+ -webkit-transform: perspective(140px) rotateY(180deg);
1061
+ transform: perspective(140px) rotateY(180deg);
1062
+ opacity: 0;
1063
+ }
1064
  }
assets/css/lib/animations/wpr-animations.css CHANGED
@@ -1,1133 +1,1133 @@
1
- /*!
2
- * WPR Animations
3
- * Version: 1.0
4
- * Author: WP Royal
5
- * Author URL: https://royal-elementor-addons.com/
6
-
7
- * WPR Animations Copyright WP Royal 2020.
8
- */
9
-
10
- .wpr-anim-transparency {
11
- opacity: 0;
12
- }
13
-
14
- .wpr-element-fade-in,
15
- .wpr-overlay-fade-in {
16
- opacity: 0;
17
- }
18
-
19
- .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-element-fade-in,
20
- .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-overlay-fade-in,
21
- .wpr-animation-enter > .wpr-anim-size-small.wpr-overlay-fade-in {
22
- opacity: 0.4;
23
- }
24
-
25
- .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-element-fade-in,
26
- .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-overlay-fade-in,
27
- .wpr-animation-enter > .wpr-anim-size-medium.wpr-overlay-fade-in {
28
- opacity: 0.75;
29
- }
30
-
31
- .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-element-fade-in,
32
- .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-overlay-fade-in,
33
- .wpr-animation-enter > .wpr-anim-size-large.wpr-overlay-fade-in {
34
- opacity: 1;
35
- }
36
-
37
- .wpr-element-fade-out,
38
- .wpr-overlay-fade-out {
39
- opacity: 1;
40
- }
41
-
42
- .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-element-fade-out,
43
- .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-overlay-fade-out,
44
- .wpr-animation-enter > .wpr-anim-size-small.wpr-overlay-fade-out {
45
- opacity: 0.75;
46
- }
47
-
48
- .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-element-fade-out,
49
- .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-overlay-fade-out,
50
- .wpr-animation-enter > .wpr-anim-size-medium.wpr-overlay-fade-out {
51
- opacity: 0.4;
52
- }
53
-
54
- .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-element-fade-out,
55
- .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-overlay-fade-out,
56
- .wpr-animation-enter > .wpr-anim-size-large.wpr-overlay-fade-out {
57
- opacity: 0;
58
- }
59
-
60
- .wpr-anim-size-small.wpr-element-slide-top {
61
- -webkit-transform: translateY(-30%);
62
- -ms-transform: translateY(-30%);
63
- transform: translateY(-30%);
64
- }
65
-
66
- .wpr-anim-size-medium.wpr-element-slide-top {
67
- -webkit-transform: translateY(-100%);
68
- -ms-transform: translateY(-100%);
69
- transform: translateY(-100%);
70
- }
71
-
72
- .wpr-anim-size-large.wpr-element-slide-top {
73
- -webkit-transform: translateY(-200%);
74
- -ms-transform: translateY(-200%);
75
- transform: translateY(-200%);
76
- }
77
-
78
- .wpr-anim-size-small.wpr-overlay-slide-top {
79
- -webkit-transform: translateY(-50%);
80
- -ms-transform: translateY(-50%);
81
- transform: translateY(-50%);
82
- }
83
-
84
- .wpr-anim-size-medium.wpr-overlay-slide-top {
85
- -webkit-transform: translateY(-70%);
86
- -ms-transform: translateY(-70%);
87
- transform: translateY(-70%);
88
- }
89
-
90
- .wpr-anim-size-large.wpr-overlay-slide-top {
91
- -webkit-transform: translateY(-100%);
92
- -ms-transform: translateY(-100%);
93
- transform: translateY(-100%);
94
- }
95
-
96
- .wpr-animation-wrap:hover .wpr-element-slide-top,
97
- .wpr-animation-wrap:hover .wpr-overlay-slide-top,
98
- .wpr-animation-enter > .wpr-overlay-slide-top {
99
- opacity: 1;
100
- -webkit-transform: translateY(0);
101
- -ms-transform: translateY(0);
102
- transform: translateY(0);
103
- }
104
-
105
- .wpr-anim-size-small.wpr-element-slide-bottom {
106
- -webkit-transform: translateY(30%);
107
- -ms-transform: translateY(30%);
108
- transform: translateY(30%);
109
- }
110
-
111
- .wpr-anim-size-medium.wpr-element-slide-bottom {
112
- -webkit-transform: translateY(100%);
113
- -ms-transform: translateY(100%);
114
- transform: translateY(100%);
115
- }
116
-
117
- .wpr-anim-size-large.wpr-element-slide-bottom {
118
- -webkit-transform: translateY(200%);
119
- -ms-transform: translateY(200%);
120
- transform: translateY(200%);
121
- }
122
-
123
- .wpr-anim-size-small.wpr-overlay-slide-bottom {
124
- -webkit-transform: translateY(50%);
125
- -ms-transform: translateY(50%);
126
- transform: translateY(50%);
127
- }
128
-
129
- .wpr-anim-size-medium.wpr-overlay-slide-bottom {
130
- -webkit-transform: translateY(70%);
131
- -ms-transform: translateY(70%);
132
- transform: translateY(70%);
133
- }
134
-
135
- .wpr-anim-size-large.wpr-overlay-slide-bottom {
136
- -webkit-transform: translateY(100%);
137
- -ms-transform: translateY(100%);
138
- transform: translateY(100%);
139
- }
140
-
141
- .wpr-animation-wrap:hover .wpr-element-slide-bottom,
142
- .wpr-animation-wrap:hover .wpr-overlay-slide-bottom,
143
- .wpr-animation-enter > .wpr-overlay-slide-bottom {
144
- opacity: 1;
145
- -webkit-transform: translateY(0);
146
- -ms-transform: translateY(0);
147
- transform: translateY(0);
148
- }
149
-
150
- .wpr-anim-size-small.wpr-element-slide-right {
151
- -webkit-transform: translateX(30%);
152
- -ms-transform: translateX(30%);
153
- transform: translateX(30%);
154
- }
155
-
156
- .wpr-anim-size-medium.wpr-element-slide-right {
157
- -webkit-transform: translateX(150%);
158
- -ms-transform: translateX(150%);
159
- transform: translateX(150%);
160
- }
161
-
162
- .wpr-anim-size-large.wpr-element-slide-right {
163
- -webkit-transform: translateX(300%);
164
- -ms-transform: translateX(300%);
165
- transform: translateX(300%);
166
- }
167
-
168
- .wpr-anim-size-small.wpr-overlay-slide-right {
169
- -webkit-transform: translateX(50%);
170
- -ms-transform: translateX(50%);
171
- transform: translateX(50%);
172
- }
173
-
174
- .wpr-anim-size-medium.wpr-overlay-slide-right {
175
- -webkit-transform: translateX(70%);
176
- -ms-transform: translateX(70%);
177
- transform: translateX(70%);
178
- }
179
-
180
- .wpr-anim-size-large.wpr-overlay-slide-right {
181
- -webkit-transform: translateX(100%);
182
- -ms-transform: translateX(100%);
183
- transform: translateX(100%);
184
- }
185
-
186
- .wpr-animation-wrap:hover .wpr-element-slide-right,
187
- .wpr-animation-wrap:hover .wpr-overlay-slide-right,
188
- .wpr-animation-enter > .wpr-overlay-slide-right {
189
- opacity: 1;
190
- -webkit-transform: translateX(0);
191
- -ms-transform: translateX(0);
192
- transform: translateX(0);
193
- }
194
-
195
- .wpr-anim-size-small.wpr-element-slide-left {
196
- -webkit-transform: translateX(-30%);
197
- -ms-transform: translateX(-30%);
198
- transform: translateX(-30%);
199
- }
200
-
201
- .wpr-anim-size-medium.wpr-element-slide-left {
202
- -webkit-transform: translateX(-150%);
203
- -ms-transform: translateX(-150%);
204
- transform: translateX(-150%);
205
- }
206
-
207
- .wpr-anim-size-large.wpr-element-slide-left {
208
- -webkit-transform: translateX(-300%);
209
- -ms-transform: translateX(-300%);
210
- transform: translateX(-300%);
211
- }
212
-
213
- .wpr-anim-size-small.wpr-overlay-slide-left {
214
- -webkit-transform: translateX(-50%);
215
- -ms-transform: translateX(-50%);
216
- transform: translateX(-50%);
217
- }
218
-
219
- .wpr-anim-size-medium.wpr-overlay-slide-left {
220
- -webkit-transform: translateX(-70%);
221
- -ms-transform: translateX(-70%);
222
- transform: translateX(-70%);
223
- }
224
-
225
- .wpr-anim-size-large.wpr-overlay-slide-left {
226
- -webkit-transform: translateX(-100%);
227
- -ms-transform: translateX(-100%);
228
- transform: translateX(-100%);
229
- }
230
-
231
- .wpr-animation-wrap:hover .wpr-element-slide-left,
232
- .wpr-animation-wrap:hover .wpr-overlay-slide-left,
233
- .wpr-animation-enter > .wpr-overlay-slide-left {
234
- opacity: 1;
235
- -webkit-transform: translateX(0);
236
- -ms-transform: translateX(0);
237
- transform: translateX(0);
238
- }
239
-
240
- .wpr-element-slide-x-right,
241
- .wpr-element-slide-x-left {
242
- position: relative;
243
- overflow: hidden;
244
- }
245
-
246
- .wpr-element-slide-x-right .inner-block,
247
- .wpr-element-slide-x-left .inner-block {
248
- position: relative;
249
- -webkit-transition-duration: inherit;
250
- -o-transition-duration: inherit;
251
- transition-duration: inherit;
252
- }
253
-
254
- .wpr-element-slide-x-right .inner-block {
255
- right: -100%;
256
- }
257
-
258
- .wpr-animation-wrap:hover .wpr-element-slide-x-right .inner-block {
259
- right: 0;
260
- }
261
-
262
- .wpr-element-slide-x-left .inner-block {
263
- left: -100%;
264
- }
265
-
266
- .wpr-animation-wrap:hover .wpr-element-slide-x-left .inner-block {
267
- left: 0;
268
- }
269
-
270
- .wpr-element-skew-top,
271
- .wpr-overlay-skew-top {
272
- -webkit-transform-origin: center top 0;
273
- -ms-transform-origin: center top 0;
274
- transform-origin: center top 0;
275
- }
276
-
277
- .wpr-overlay-skew-top {
278
- top: 0 !important;
279
- }
280
-
281
- .wpr-anim-size-small.wpr-element-skew-top,
282
- .wpr-anim-size-small.wpr-overlay-skew-top {
283
- -webkit-transform: perspective(600px) rotateX(-30deg);
284
- transform: perspective(600px) rotateX(-30deg);
285
- }
286
-
287
- .wpr-anim-size-medium.wpr-element-skew-top,
288
- .wpr-anim-size-medium.wpr-overlay-skew-top {
289
- -webkit-transform: perspective(600px) rotateX(-50deg);
290
- transform: perspective(600px) rotateX(-50deg);
291
- }
292
-
293
- .wpr-anim-size-large.wpr-element-skew-top,
294
- .wpr-anim-size-large.wpr-overlay-skew-top {
295
- -webkit-transform: perspective(600px) rotateX(-90deg);
296
- transform: perspective(600px) rotateX(-90deg);
297
- }
298
-
299
- .wpr-animation-wrap:hover .wpr-element-skew-top,
300
- .wpr-animation-wrap:hover .wpr-overlay-skew-top,
301
- .wpr-animation-enter > .wpr-overlay-skew-top {
302
- opacity: 1;
303
- -webkit-transform: perspective(600px) rotateX(0deg);
304
- transform: perspective(600px) rotateX(0deg);
305
- }
306
-
307
- .wpr-element-skew-bottom,
308
- .wpr-overlay-skew-bottom {
309
- -webkit-transform-origin: center bottom 0;
310
- -ms-transform-origin: center bottom 0;
311
- transform-origin: center bottom 0;
312
- }
313
-
314
- .wpr-overlay-skew-bottom {
315
- top: auto !important;
316
- bottom: 0 !important;
317
- }
318
-
319
- .wpr-anim-size-small.wpr-element-skew-bottom,
320
- .wpr-anim-size-small.wpr-overlay-skew-bottom {
321
- -webkit-transform: perspective(600px) rotateX(30deg);
322
- transform: perspective(600px) rotateX(30deg);
323
- }
324
-
325
- .wpr-anim-size-medium.wpr-element-skew-bottom,
326
- .wpr-anim-size-medium.wpr-overlay-skew-bottom {
327
- -webkit-transform: perspective(600px) rotateX(50deg);
328
- transform: perspective(600px) rotateX(50deg);
329
- }
330
-
331
- .wpr-anim-size-large.wpr-element-skew-bottom,
332
- .wpr-anim-size-large.wpr-overlay-skew-bottom {
333
- -webkit-transform: perspective(600px) rotateX(90deg);
334
- transform: perspective(600px) rotateX(90deg);
335
- }
336
-
337
- .wpr-animation-wrap:hover .wpr-element-skew-bottom,
338
- .wpr-animation-wrap:hover .wpr-overlay-skew-bottom,
339
- .wpr-animation-enter > .wpr-overlay-skew-bottom {
340
- opacity: 1;
341
- -webkit-transform: perspective(600px) rotateX(0deg);
342
- transform: perspective(600px) rotateX(0deg);
343
- }
344
-
345
- .wpr-element-skew-right,
346
- .wpr-overlay-skew-right {
347
- -webkit-transform-origin: center right 0;
348
- -ms-transform-origin: center right 0;
349
- transform-origin: center right 0;
350
- }
351
-
352
- .wpr-overlay-skew-right {
353
- left: auto !important;
354
- right: 0 !important;
355
- }
356
-
357
- .wpr-anim-size-small.wpr-element-skew-right,
358
- .wpr-anim-size-small.wpr-overlay-skew-right {
359
- -webkit-transform: perspective(600px) rotateY(-30deg);
360
- transform: perspective(600px) rotateY(-30deg);
361
- }
362
-
363
- .wpr-anim-size-medium.wpr-element-skew-right,
364
- .wpr-anim-size-medium.wpr-overlay-skew-right {
365
- -webkit-transform: perspective(600px) rotateY(-50deg);
366
- transform: perspective(600px) rotateY(-50deg);
367
- }
368
-
369
- .wpr-anim-size-large.wpr-element-skew-right,
370
- .wpr-anim-size-large.wpr-overlay-skew-right {
371
- -webkit-transform: perspective(600px) rotateY(-90deg);
372
- transform: perspective(600px) rotateY(-90deg);
373
- }
374
-
375
- .wpr-animation-wrap:hover .wpr-element-skew-right,
376
- .wpr-animation-wrap:hover .wpr-overlay-skew-right,
377
- .wpr-animation-enter > .wpr-overlay-skew-right {
378
- opacity: 1;
379
- -webkit-transform: perspective(600px) rotateY(0deg);
380
- transform: perspective(600px) rotateY(0deg);
381
- }
382
-
383
- .wpr-element-skew-left,
384
- .wpr-overlay-skew-left {
385
- -webkit-transform-origin: center left 0;
386
- -ms-transform-origin: center left 0;
387
- transform-origin: center left 0;
388
- }
389
-
390
- .wpr-overlay-skew-left {
391
- left: 0 !important;
392
- }
393
-
394
- .wpr-anim-size-small.wpr-element-skew-left,
395
- .wpr-anim-size-small.wpr-overlay-skew-left {
396
- -webkit-transform: perspective(600px) rotateY(30deg);
397
- transform: perspective(600px) rotateY(30deg);
398
- }
399
-
400
- .wpr-anim-size-medium.wpr-element-skew-left,
401
- .wpr-anim-size-medium.wpr-overlay-skew-left {
402
- -webkit-transform: perspective(600px) rotateY(50deg);
403
- transform: perspective(600px) rotateY(50deg);
404
- }
405
-
406
- .wpr-anim-size-large.wpr-element-skew-left,
407
- .wpr-anim-size-large.wpr-overlay-skew-left {
408
- -webkit-transform: perspective(600px) rotateY(90deg);
409
- transform: perspective(600px) rotateY(90deg);
410
- }
411
-
412
- .wpr-animation-wrap:hover .wpr-element-skew-left,
413
- .wpr-animation-wrap:hover .wpr-overlay-skew-left,
414
- .wpr-animation-enter > .wpr-overlay-skew-left {
415
- opacity: 1;
416
- -webkit-transform: perspective(600px) rotateY(0deg);
417
- transform: perspective(600px) rotateY(0deg);
418
- }
419
-
420
- .wpr-anim-size-small.wpr-element-scale-up,
421
- .wpr-anim-size-small.wpr-overlay-scale-up {
422
- -webkit-transform: scale(0.9);
423
- -ms-transform: scale(0.9);
424
- transform: scale(0.9);
425
- }
426
-
427
- .wpr-anim-size-medium.wpr-element-scale-up,
428
- .wpr-anim-size-medium.wpr-overlay-scale-up {
429
- -webkit-transform: scale(0.6);
430
- -ms-transform: scale(0.6);
431
- transform: scale(0.6);
432
- }
433
-
434
- .wpr-anim-size-large.wpr-element-scale-up,
435
- .wpr-anim-size-large.wpr-overlay-scale-up {
436
- -webkit-transform: scale(0.2);
437
- -ms-transform: scale(0.2);
438
- transform: scale(0.2);
439
- }
440
-
441
- .wpr-animation-wrap:hover .wpr-element-scale-up,
442
- .wpr-animation-wrap:hover .wpr-overlay-scale-up,
443
- .wpr-animation-enter > .wpr-overlay-scale-up {
444
- opacity: 1;
445
- -webkit-transform: scale(1);
446
- -ms-transform: scale(1);
447
- transform: scale(1);
448
- }
449
-
450
- .wpr-anim-size-small.wpr-element-scale-down,
451
- .wpr-anim-size-small.wpr-overlay-scale-down {
452
- -webkit-transform: scale(1.1);
453
- -ms-transform: scale(1.1);
454
- transform: scale(1.1);
455
- }
456
-
457
- .wpr-anim-size-medium.wpr-element-scale-down,
458
- .wpr-anim-size-medium.wpr-overlay-scale-down {
459
- -webkit-transform: scale(1.4);
460
- -ms-transform: scale(1.4);
461
- transform: scale(1.4);
462
- }
463
-
464
- .wpr-anim-size-large.wpr-element-scale-down,
465
- .wpr-anim-size-large.wpr-overlay-scale-down {
466
- -webkit-transform: scale(1.9);
467
- -ms-transform: scale(1.9);
468
- transform: scale(1.9);
469
- }
470
-
471
- .wpr-animation-wrap:hover .wpr-element-scale-down,
472
- .wpr-animation-wrap:hover .wpr-overlay-scale-down,
473
- .wpr-animation-enter > .wpr-overlay-scale-down {
474
- opacity: 1;
475
- -webkit-transform: scale(1);
476
- -ms-transform: scale(1);
477
- transform: scale(1);
478
- }
479
-
480
- .wpr-anim-size-small.wpr-element-roll-right,
481
- .wpr-anim-size-small.wpr-overlay-roll-right {
482
- -webkit-transform: translateX(100%) rotate(90deg);
483
- -ms-transform: translateX(100%) rotate(90deg);
484
- transform: translateX(100%) rotate(90deg);
485
- }
486
-
487
- .wpr-anim-size-medium.wpr-element-roll-right,
488
- .wpr-anim-size-medium.wpr-overlay-roll-right {
489
- -webkit-transform: translateX(100%) rotate(240deg);
490
- -ms-transform: translateX(100%) rotate(240deg);
491
- transform: translateX(100%) rotate(240deg);
492
- }
493
-
494
- .wpr-anim-size-large.wpr-element-roll-right,
495
- .wpr-anim-size-large.wpr-overlay-roll-right {
496
- -webkit-transform: translateX(100%) rotate(360deg);
497
- -ms-transform: translateX(100%) rotate(360deg);
498
- transform: translateX(100%) rotate(360deg);
499
- }
500
-
501
- .wpr-animation-wrap:hover .wpr-element-roll-right,
502
- .wpr-animation-wrap:hover .wpr-overlay-roll-right,
503
- .wpr-animation-enter > .wpr-overlay-roll-right {
504
- opacity: 1;
505
- -webkit-transform: translateX(0) rotate(0);
506
- -ms-transform: translateX(0) rotate(0);
507
- transform: translateX(0) rotate(0);
508
- }
509
-
510
- .wpr-anim-size-small.wpr-element-roll-left,
511
- .wpr-anim-size-small.wpr-overlay-roll-left {
512
- -webkit-transform: translateX(-100%) rotate(-90deg);
513
- -ms-transform: translateX(-100%) rotate(-90deg);
514
- transform: translateX(-100%) rotate(-90deg);
515
- }
516
-
517
- .wpr-anim-size-medium.wpr-element-roll-left,
518
- .wpr-anim-size-medium.wpr-overlay-roll-left {
519
- -webkit-transform: translateX(-100%) rotate(-240deg);
520
- -ms-transform: translateX(-100%) rotate(-240deg);
521
- transform: translateX(-100%) rotate(-240deg);
522
- }
523
-
524
- .wpr-anim-size-large.wpr-element-roll-left,
525
- .wpr-anim-size-large.wpr-overlay-roll-left {
526
- -webkit-transform: translateX(-100%) rotate(-360deg);
527
- -ms-transform: translateX(-100%) rotate(-360deg);
528
- transform: translateX(-100%) rotate(-360deg);
529
- }
530
-
531
- .wpr-animation-wrap:hover .wpr-element-roll-left,
532
- .wpr-animation-wrap:hover .wpr-overlay-roll-left,
533
- .wpr-animation-enter > .wpr-overlay-roll-left {
534
- opacity: 1;
535
- -webkit-transform: translateX(0) rotate(0);
536
- -ms-transform: translateX(0) rotate(0);
537
- transform: translateX(0) rotate(0);
538
- }
539
-
540
-
541
- /* Timing Functions */
542
-
543
- .wpr-anim-timing-linear {
544
- -webkit-transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
545
- -o-transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
546
- transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
547
- }
548
-
549
- .wpr-anim-timing-ease-default {
550
- -webkit-transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
551
- -o-transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
552
- transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
553
- }
554
-
555
- .wpr-anim-timing-ease-in {
556
- -webkit-transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
557
- -o-transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
558
- transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
559
- }
560
-
561
- .wpr-anim-timing-ease-out {
562
- -webkit-transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
563
- -o-transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
564
- transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
565
- }
566
-
567
- .wpr-anim-timing-ease-in-out {
568
- -webkit-transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
569
- -o-transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
570
- transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
571
- }
572
-
573
- .wpr-anim-timing-ease-in-quad {
574
- -webkit-transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
575
- -o-transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
576
- transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
577
- }
578
-
579
- .wpr-anim-timing-ease-in-cubic {
580
- -webkit-transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
581
- -o-transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
582
- transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
583
- }
584
-
585
- .wpr-anim-timing-ease-in-quart {
586
- -webkit-transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
587
- -o-transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
588
- transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
589
- }
590
-
591
- .wpr-anim-timing-ease-in-quint {
592
- -webkit-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
593
- -o-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
594
- transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
595
- }
596
-
597
- .wpr-anim-timing-ease-in-sine {
598
- -webkit-transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
599
- -o-transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
600
- transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
601
- }
602
-
603
- .wpr-anim-timing-ease-in-expo {
604
- -webkit-transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
605
- -o-transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
606
- transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
607
- }
608
-
609
- .wpr-anim-timing-ease-in-circ {
610
- -webkit-transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
611
- -o-transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
612
- transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
613
- }
614
-
615
- .wpr-anim-timing-ease-in-back {
616
- -webkit-transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
617
- -o-transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
618
- transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
619
- }
620
-
621
- .wpr-anim-timing-ease-out-quad {
622
- -webkit-transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
623
- -o-transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
624
- transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
625
- }
626
-
627
- .wpr-anim-timing-ease-out-cubic {
628
- -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
629
- -o-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
630
- transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
631
- }
632
-
633
- .wpr-anim-timing-ease-out-quart {
634
- -webkit-transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
635
- -o-transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
636
- transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
637
- }
638
-
639
- .wpr-anim-timing-ease-out-quint {
640
- -webkit-transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
641
- -o-transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
642
- transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
643
- }
644
-
645
- .wpr-anim-timing-ease-out-sine {
646
- -webkit-transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
647
- -o-transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
648
- transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
649
- }
650
-
651
- .wpr-anim-timing-ease-out-expo {
652
- -webkit-transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
653
- -o-transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
654
- transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
655
- }
656
-
657
- .wpr-anim-timing-ease-out-circ {
658
- -webkit-transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
659
- -o-transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
660
- transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
661
- }
662
-
663
- .wpr-anim-timing-ease-out-back {
664
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
665
- -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
666
- transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
667
- }
668
-
669
- .wpr-anim-timing-ease-in-out-quad {
670
- -webkit-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955);
671
- -o-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955);
672
- transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955)
673
- }
674
-
675
- .wpr-anim-timing-ease-in-out-cubic {
676
- -webkit-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
677
- -o-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
678
- transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
679
- }
680
-
681
- .wpr-anim-timing-ease-in-out-quart {
682
- -webkit-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
683
- -o-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
684
- transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
685
- }
686
-
687
- .wpr-anim-timing-ease-in-out-quint {
688
- -webkit-transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
689
- -o-transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
690
- transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
691
- }
692
-
693
- .wpr-anim-timing-ease-in-out-sine {
694
- -webkit-transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
695
- -o-transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
696
- transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
697
- }
698
-
699
- .wpr-anim-timing-ease-in-out-expo {
700
- -webkit-transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
701
- -o-transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
702
- transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
703
- }
704
-
705
- .wpr-anim-timing-ease-in-out-circ {
706
- -webkit-transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
707
- -o-transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
708
- transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
709
- }
710
-
711
- .wpr-anim-timing-ease-in-out-back {
712
- -webkit-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
713
- -o-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
714
- transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
715
- }
716
-
717
-
718
- /* Image Effects */
719
-
720
- .wpr-slide.wpr-effect-dir-top:hover img {
721
- -webkit-transform: translateY(-100%);
722
- -ms-transform: translateY(-100%);
723
- transform: translateY(-100%);
724
- }
725
-
726
- .wpr-slide.wpr-effect-dir-bottom:hover img {
727
- -webkit-transform: translateY(100%);
728
- -ms-transform: translateY(100%);
729
- transform: translateY(100%);
730
- }
731
-
732
- .wpr-slide.wpr-effect-dir-right:hover img {
733
- -webkit-transform: translateX(100%);
734
- -ms-transform: translateX(100%);
735
- transform: translateX(100%);
736
- }
737
-
738
- .wpr-slide.wpr-effect-dir-left:hover img {
739
- -webkit-transform: translateX(-100%);
740
- -ms-transform: translateX(-100%);
741
- transform: translateX(-100%);
742
- }
743
-
744
- .wpr-zoom-in.wpr-effect-size-small:hover img {
745
- -webkit-transform: scale(1.1);
746
- -ms-transform: scale(1.1);
747
- transform: scale(1.1);
748
- }
749
-
750
- .wpr-zoom-in.wpr-effect-size-medium:hover img {
751
- -webkit-transform: scale(1.3);
752
- -ms-transform: scale(1.3);
753
- transform: scale(1.3);
754
- }
755
-
756
- .wpr-zoom-in.wpr-effect-size-large:hover img {
757
- -webkit-transform: scale(1.5);
758
- -ms-transform: scale(1.5);
759
- transform: scale(1.5);
760
- }
761
-
762
- .wpr-zoom-out.wpr-effect-size-small img {
763
- -webkit-transform: scale(1.1);
764
- -ms-transform: scale(1.1);
765
- transform: scale(1.1);
766
- }
767
-
768
- .wpr-zoom-out.wpr-effect-size-medium img {
769
- -webkit-transform: scale(1.3);
770
- -ms-transform: scale(1.3);
771
- transform: scale(1.3);
772
- }
773
-
774
- .wpr-zoom-out.wpr-effect-size-large img {
775
- -webkit-transform: scale(1.5);
776
- -ms-transform: scale(1.5);
777
- transform: scale(1.5);
778
- }
779
-
780
- .wpr-zoom-out.wpr-effect-size-small:hover img,
781
- .wpr-zoom-out.wpr-effect-size-medium:hover img,
782
- .wpr-zoom-out.wpr-effect-size-large:hover img {
783
- -webkit-transform: scale(1);
784
- -ms-transform: scale(1);
785
- transform: scale(1);
786
- }
787
-
788
- .wpr-grayscale-in.wpr-effect-size-small:hover img {
789
- -webkit-filter: grayscale(0.3);
790
- filter: grayscale(0.3);
791
- }
792
-
793
- .wpr-grayscale-in.wpr-effect-size-medium:hover img {
794
- -webkit-filter: grayscale(0.6);
795
- filter: grayscale(0.6);
796
- }
797
-
798
- .wpr-grayscale-in.wpr-effect-size-large:hover img {
799
- -webkit-filter: grayscale(1);
800
- filter: grayscale(1);
801
- }
802
-
803
- .wpr-grayscale-out.wpr-effect-size-small img {
804
- -webkit-filter: grayscale(0.3);
805
- filter: grayscale(0.3);
806
- }
807
-
808
- .wpr-grayscale-out.wpr-effect-size-medium img {
809
- -webkit-filter: grayscale(0.6);
810
- filter: grayscale(0.6);
811
- }
812
-
813
- .wpr-grayscale-out.wpr-effect-size-large img {
814
- -webkit-filter: grayscale(1);
815
- filter: grayscale(1);
816
- }
817
-
818
- .wpr-grayscale-out.wpr-effect-size-small:hover img,
819
- .wpr-grayscale-out.wpr-effect-size-medium:hover img,
820
- .wpr-grayscale-out.wpr-effect-size-large:hover img {
821
- -webkit-filter: grayscale(0);
822
- filter: grayscale(0);
823
- }
824
-
825
- .wpr-blur-in.wpr-effect-size-small:hover img {
826
- -webkit-filter: blur(1px);
827
- filter: blur(1px);
828
- }
829
-
830
- .wpr-blur-in.wpr-effect-size-medium:hover img {
831
- -webkit-filter: blur(3px);
832
- filter: blur(3px);
833
- }
834
-
835
- .wpr-blur-in.wpr-effect-size-large:hover img {
836
- -webkit-filter: blur(5px);
837
- filter: blur(5px);
838
- }
839
-
840
- .wpr-blur-out.wpr-effect-size-small img {
841
- -webkit-filter: blur(1px);
842
- filter: blur(1px);
843
- }
844
-
845
- .wpr-blur-out.wpr-effect-size-medium img {
846
- -webkit-filter: blur(3px);
847
- filter: blur(3px);
848
- }
849
-
850
- .wpr-blur-out.wpr-effect-size-large img {
851
- -webkit-filter: blur(5px);
852
- filter: blur(5px);
853
- }
854
-
855
- .wpr-blur-out.wpr-effect-size-small:hover img,
856
- .wpr-blur-out.wpr-effect-size-medium:hover img,
857
- .wpr-blur-out.wpr-effect-size-large:hover img {
858
- -webkit-filter: blur(0px);
859
- filter: blur(0px);
860
- }
861
-
862
-
863
- /* Background Animation */
864
-
865
- .wpr-animation-wrap:hover .wpr-bg-anim-zoom-in {
866
- -webkit-transform: scale(1.2);
867
- -ms-transform: scale(1.2);
868
- transform: scale(1.2);
869
- }
870
-
871
- .wpr-bg-anim-zoom-out {
872
- -webkit-transform: scale(1.2);
873
- -ms-transform: scale(1.2);
874
- transform: scale(1.2);
875
- }
876
-
877
- .wpr-animation-wrap:hover .wpr-bg-anim-zoom-out {
878
- -webkit-transform: scale(1);
879
- -ms-transform: scale(1);
880
- transform: scale(1);
881
- }
882
-
883
- .wpr-bg-anim-move-left {
884
- -webkit-transform: scale(1.2) translateX(8%);
885
- -ms-transform: scale(1.2) translateX(8%);
886
- transform: scale(1.2) translateX(8%);
887
- }
888
-
889
- .wpr-animation-wrap:hover .wpr-bg-anim-move-left {
890
- -webkit-transform: scale(1.2) translateX(-8%);
891
- -ms-transform: scale(1.2) translateX(-8%);
892
- transform: scale(1.2) translateX(-8%);
893
- }
894
-
895
- .wpr-bg-anim-move-right {
896
- -webkit-transform: scale(1.2) translateX(-8%);
897
- -ms-transform: scale(1.2) translateX(-8%);
898
- transform: scale(1.2) translateX(-8%);
899
- }
900
-
901
- .wpr-animation-wrap:hover .wpr-bg-anim-move-right {
902
- -webkit-transform: scale(1.2) translateX(8%);
903
- -ms-transform: scale(1.2) translateX(8%);
904
- transform: scale(1.2) translateX(8%);
905
- }
906
-
907
- .wpr-bg-anim-move-up {
908
- -webkit-transform: scale(1.2) translateY(8%);
909
- -ms-transform: scale(1.2) translateY(8%);
910
- transform: scale(1.2) translateY(8%);
911
- }
912
-
913
- .wpr-animation-wrap:hover .wpr-bg-anim-move-up {
914
- -webkit-transform: scale(1.2) translateY(-8%);
915
- -ms-transform: scale(1.2) translateY(-8%);
916
- transform: scale(1.2) translateY(-8%);
917
- }
918
-
919
- .wpr-animation-wrap:hover .wpr-bg-anim-move-down {
920
- -webkit-transform: scale(1.2) translateY(-8%);
921
- -ms-transform: scale(1.2) translateY(-8%);
922
- transform: scale(1.2) translateY(-8%);
923
- }
924
-
925
- .wpr-animation-wrap:hover .wpr-bg-anim-move-down {
926
- -webkit-transform: scale(1.2) translateY(8%);
927
- -ms-transform: scale(1.2) translateY(8%);
928
- transform: scale(1.2) translateY(8%);
929
- }
930
-
931
-
932
- /* Border Animations*/
933
-
934
- /* Layla */
935
- .wpr-border-anim-layla::before,
936
- .wpr-border-anim-layla::after {
937
- position: absolute;
938
- content: '';
939
- opacity: 0;
940
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
941
- transition: opacity 0.35s, -webkit-transform 0.35s;
942
- -o-transition: opacity 0.35s, transform 0.35s;
943
- transition: opacity 0.35s, transform 0.35s;
944
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
945
- }
946
-
947
- .wpr-border-anim-layla::before {
948
- -webkit-transform: scale(0,1);
949
- -ms-transform: scale(0,1);
950
- transform: scale(0,1);
951
- -webkit-transform-origin: 0 0;
952
- -ms-transform-origin: 0 0;
953
- transform-origin: 0 0;
954
- }
955
-
956
- .wpr-border-anim-layla::after {
957
- -webkit-transform: scale(1,0);
958
- -ms-transform: scale(1,0);
959
- transform: scale(1,0);
960
- -webkit-transform-origin: 100% 0;
961
- -ms-transform-origin: 100% 0;
962
- transform-origin: 100% 0;
963
- }
964
-
965
- .wpr-animation-wrap:hover .wpr-border-anim-layla::before,
966
- .wpr-animation-wrap:hover .wpr-border-anim-layla::after {
967
- opacity: 1;
968
- -webkit-transform: scale(1);
969
- -ms-transform: scale(1);
970
- transform: scale(1);
971
- }
972
-
973
- .wpr-animation-wrap:hover .wpr-border-anim-layla::after {
974
- -webkit-transition-delay: 0.15s;
975
- -o-transition-delay: 0.15s;
976
- transition-delay: 0.15s;
977
- }
978
-
979
- /* Oscar */
980
- .wpr-border-anim-oscar::before {
981
- position: absolute;
982
- content: '';
983
- opacity: 0;
984
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
985
- transition: opacity 0.35s, -webkit-transform 0.35s;
986
- -o-transition: opacity 0.35s, transform 0.35s;
987
- transition: opacity 0.35s, transform 0.35s;
988
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
989
- -webkit-transform: scale(0.9);
990
- -ms-transform: scale(0.9);
991
- transform: scale(0.9);
992
- }
993
-
994
- .wpr-animation-wrap:hover .wpr-border-anim-oscar::before {
995
- opacity: 1;
996
- -webkit-transform: scale(1);
997
- -ms-transform: scale(1);
998
- transform: scale(1);
999
- }
1000
-
1001
- /* Bubba */
1002
- .wpr-border-anim-bubba::before,
1003
- .wpr-border-anim-bubba::after {
1004
- position: absolute;
1005
- content: '';
1006
- opacity: 0;
1007
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1008
- transition: opacity 0.35s, -webkit-transform 0.35s;
1009
- -o-transition: opacity 0.35s, transform 0.35s;
1010
- transition: opacity 0.35s, transform 0.35s;
1011
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1012
- }
1013
-
1014
- .wpr-border-anim-bubba::before {
1015
- -webkit-transform: scale(0,1);
1016
- -ms-transform: scale(0,1);
1017
- transform: scale(0,1);
1018
- }
1019
-
1020
- .wpr-border-anim-bubba::after {
1021
- -webkit-transform: scale(1,0);
1022
- -ms-transform: scale(1,0);
1023
- transform: scale(1,0);
1024
- }
1025
-
1026
- .wpr-animation-wrap:hover .wpr-border-anim-bubba::before,
1027
- .wpr-animation-wrap:hover .wpr-border-anim-bubba::after {
1028
- opacity: 1;
1029
- -webkit-transform: scale(1);
1030
- -ms-transform: scale(1);
1031
- transform: scale(1);
1032
- }
1033
-
1034
- /* Romeo */
1035
- .wpr-border-anim-romeo::before,
1036
- .wpr-border-anim-romeo::after {
1037
- position: absolute;
1038
- top: 50%;
1039
- left: 50%;
1040
- width: 80%;
1041
- content: '';
1042
- opacity: 0;
1043
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1044
- transition: opacity 0.35s, -webkit-transform 0.35s;
1045
- -o-transition: opacity 0.35s, transform 0.35s;
1046
- transition: opacity 0.35s, transform 0.35s;
1047
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1048
- -webkit-transform: translate3d(-50%,-50%,0);
1049
- transform: translate3d(-50%,-50%,0);
1050
- }
1051
-
1052
- .wpr-animation-wrap:hover .wpr-border-anim-romeo::before {
1053
- opacity: 1;
1054
- -webkit-transform: translate3d(-50%,-50%,0) rotate(45deg);
1055
- transform: translate3d(-50%,-50%,0) rotate(45deg);
1056
- }
1057
-
1058
- .wpr-animation-wrap:hover .wpr-border-anim-romeo::after {
1059
- opacity: 1;
1060
- -webkit-transform: translate3d(-50%,-50%,0) rotate(-45deg);
1061
- transform: translate3d(-50%,-50%,0) rotate(-45deg);
1062
- }
1063
-
1064
- /* Chicho */
1065
- .wpr-border-anim-chicho::before {
1066
- position: absolute;
1067
- content: '';
1068
- -webkit-transform: scale(1.1);
1069
- -ms-transform: scale(1.1);
1070
- transform: scale(1.1);
1071
- opacity: 0;
1072
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1073
- transition: opacity 0.35s, -webkit-transform 0.35s;
1074
- -o-transition: opacity 0.35s, transform 0.35s;
1075
- transition: opacity 0.35s, transform 0.35s;
1076
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1077
- }
1078
-
1079
- .wpr-animation-wrap:hover .wpr-border-anim-chicho::before {
1080
- opacity: 1;
1081
- -webkit-transform: scale(1);
1082
- -ms-transform: scale(1);
1083
- transform: scale(1);
1084
- }
1085
-
1086
- /* Apollo */
1087
- .wpr-border-anim-apollo::before {
1088
- position: absolute;
1089
- top: 0;
1090
- left: 0;
1091
- width: 100%;
1092
- height: 100%;
1093
- content: '';
1094
- -webkit-transition: -webkit-transform 0.6s;
1095
- transition: -webkit-transform 0.6s;
1096
- -o-transition: transform 0.6s;
1097
- transition: transform 0.6s;
1098
- transition: transform 0.6s, -webkit-transform 0.6s;
1099
- -webkit-transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,-100%,0);
1100
- transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,-100%,0);
1101
- }
1102
-
1103
- .wpr-animation-wrap:hover .wpr-border-anim-apollo::before {
1104
- -webkit-transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,100%,0);
1105
- transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,100%,0);
1106
- }
1107
-
1108
- /* Jazz */
1109
- .wpr-border-anim-jazz::after {
1110
- -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1111
- transition: opacity 0.35s, -webkit-transform 0.35s;
1112
- -o-transition: opacity 0.35s, transform 0.35s;
1113
- transition: opacity 0.35s, transform 0.35s;
1114
- transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1115
- position: absolute;
1116
- top: 0;
1117
- left: 0;
1118
- width: 100%;
1119
- height: 100%;
1120
- content: '';
1121
- opacity: 0;
1122
- -webkit-transform: rotate3d(0,0,1,45deg) scale3d(1,0,1);
1123
- transform: rotate3d(0,0,1,45deg) scale3d(1,0,1);
1124
- -webkit-transform-origin: 50% 50%;
1125
- -ms-transform-origin: 50% 50%;
1126
- transform-origin: 50% 50%;
1127
- }
1128
-
1129
- .wpr-animation-wrap:hover .wpr-border-anim-jazz::after {
1130
- opacity: 1;
1131
- -webkit-transform: rotate3d(0,0,1,45deg) scale3d(1,1,1);
1132
- transform: rotate3d(0,0,1,45deg) scale3d(1,1,1);
1133
  }
1
+ /*!
2
+ * WPR Animations
3
+ * Version: 1.0
4
+ * Author: WP Royal
5
+ * Author URL: https://royal-elementor-addons.com/
6
+
7
+ * WPR Animations Copyright WP Royal 2020.
8
+ */
9
+
10
+ .wpr-anim-transparency {
11
+ opacity: 0;
12
+ }
13
+
14
+ .wpr-element-fade-in,
15
+ .wpr-overlay-fade-in {
16
+ opacity: 0;
17
+ }
18
+
19
+ .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-element-fade-in,
20
+ .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-overlay-fade-in,
21
+ .wpr-animation-enter > .wpr-anim-size-small.wpr-overlay-fade-in {
22
+ opacity: 0.4;
23
+ }
24
+
25
+ .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-element-fade-in,
26
+ .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-overlay-fade-in,
27
+ .wpr-animation-enter > .wpr-anim-size-medium.wpr-overlay-fade-in {
28
+ opacity: 0.75;
29
+ }
30
+
31
+ .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-element-fade-in,
32
+ .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-overlay-fade-in,
33
+ .wpr-animation-enter > .wpr-anim-size-large.wpr-overlay-fade-in {
34
+ opacity: 1;
35
+ }
36
+
37
+ .wpr-element-fade-out,
38
+ .wpr-overlay-fade-out {
39
+ opacity: 1;
40
+ }
41
+
42
+ .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-element-fade-out,
43
+ .wpr-animation-wrap:hover .wpr-anim-size-small.wpr-overlay-fade-out,
44
+ .wpr-animation-enter > .wpr-anim-size-small.wpr-overlay-fade-out {
45
+ opacity: 0.75;
46
+ }
47
+
48
+ .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-element-fade-out,
49
+ .wpr-animation-wrap:hover .wpr-anim-size-medium.wpr-overlay-fade-out,
50
+ .wpr-animation-enter > .wpr-anim-size-medium.wpr-overlay-fade-out {
51
+ opacity: 0.4;
52
+ }
53
+
54
+ .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-element-fade-out,
55
+ .wpr-animation-wrap:hover .wpr-anim-size-large.wpr-overlay-fade-out,
56
+ .wpr-animation-enter > .wpr-anim-size-large.wpr-overlay-fade-out {
57
+ opacity: 0;
58
+ }
59
+
60
+ .wpr-anim-size-small.wpr-element-slide-top {
61
+ -webkit-transform: translateY(-30%);
62
+ -ms-transform: translateY(-30%);
63
+ transform: translateY(-30%);
64
+ }
65
+
66
+ .wpr-anim-size-medium.wpr-element-slide-top {
67
+ -webkit-transform: translateY(-100%);
68
+ -ms-transform: translateY(-100%);
69
+ transform: translateY(-100%);
70
+ }
71
+
72
+ .wpr-anim-size-large.wpr-element-slide-top {
73
+ -webkit-transform: translateY(-200%);
74
+ -ms-transform: translateY(-200%);
75
+ transform: translateY(-200%);
76
+ }
77
+
78
+ .wpr-anim-size-small.wpr-overlay-slide-top {
79
+ -webkit-transform: translateY(-50%);
80
+ -ms-transform: translateY(-50%);
81
+ transform: translateY(-50%);
82
+ }
83
+
84
+ .wpr-anim-size-medium.wpr-overlay-slide-top {
85
+ -webkit-transform: translateY(-70%);
86
+ -ms-transform: translateY(-70%);
87
+ transform: translateY(-70%);
88
+ }
89
+
90
+ .wpr-anim-size-large.wpr-overlay-slide-top {
91
+ -webkit-transform: translateY(-100%);
92
+ -ms-transform: translateY(-100%);
93
+ transform: translateY(-100%);
94
+ }
95
+
96
+ .wpr-animation-wrap:hover .wpr-element-slide-top,
97
+ .wpr-animation-wrap:hover .wpr-overlay-slide-top,
98
+ .wpr-animation-enter > .wpr-overlay-slide-top {
99
+ opacity: 1;
100
+ -webkit-transform: translateY(0);
101
+ -ms-transform: translateY(0);
102
+ transform: translateY(0);
103
+ }
104
+
105
+ .wpr-anim-size-small.wpr-element-slide-bottom {
106
+ -webkit-transform: translateY(30%);
107
+ -ms-transform: translateY(30%);
108
+ transform: translateY(30%);
109
+ }
110
+
111
+ .wpr-anim-size-medium.wpr-element-slide-bottom {
112
+ -webkit-transform: translateY(100%);
113
+ -ms-transform: translateY(100%);
114
+ transform: translateY(100%);
115
+ }
116
+
117
+ .wpr-anim-size-large.wpr-element-slide-bottom {
118
+ -webkit-transform: translateY(200%);
119
+ -ms-transform: translateY(200%);
120
+ transform: translateY(200%);
121
+ }
122
+
123
+ .wpr-anim-size-small.wpr-overlay-slide-bottom {
124
+ -webkit-transform: translateY(50%);
125
+ -ms-transform: translateY(50%);
126
+ transform: translateY(50%);
127
+ }
128
+
129
+ .wpr-anim-size-medium.wpr-overlay-slide-bottom {
130
+ -webkit-transform: translateY(70%);
131
+ -ms-transform: translateY(70%);
132
+ transform: translateY(70%);
133
+ }
134
+
135
+ .wpr-anim-size-large.wpr-overlay-slide-bottom {
136
+ -webkit-transform: translateY(100%);
137
+ -ms-transform: translateY(100%);
138
+ transform: translateY(100%);
139
+ }
140
+
141
+ .wpr-animation-wrap:hover .wpr-element-slide-bottom,
142
+ .wpr-animation-wrap:hover .wpr-overlay-slide-bottom,
143
+ .wpr-animation-enter > .wpr-overlay-slide-bottom {
144
+ opacity: 1;
145
+ -webkit-transform: translateY(0);
146
+ -ms-transform: translateY(0);
147
+ transform: translateY(0);
148
+ }
149
+
150
+ .wpr-anim-size-small.wpr-element-slide-right {
151
+ -webkit-transform: translateX(30%);
152
+ -ms-transform: translateX(30%);
153
+ transform: translateX(30%);
154
+ }
155
+
156
+ .wpr-anim-size-medium.wpr-element-slide-right {
157
+ -webkit-transform: translateX(150%);
158
+ -ms-transform: translateX(150%);
159
+ transform: translateX(150%);
160
+ }
161
+
162
+ .wpr-anim-size-large.wpr-element-slide-right {
163
+ -webkit-transform: translateX(300%);
164
+ -ms-transform: translateX(300%);
165
+ transform: translateX(300%);
166
+ }
167
+
168
+ .wpr-anim-size-small.wpr-overlay-slide-right {
169
+ -webkit-transform: translateX(50%);
170
+ -ms-transform: translateX(50%);
171
+ transform: translateX(50%);
172
+ }
173
+
174
+ .wpr-anim-size-medium.wpr-overlay-slide-right {
175
+ -webkit-transform: translateX(70%);
176
+ -ms-transform: translateX(70%);
177
+ transform: translateX(70%);
178
+ }
179
+
180
+ .wpr-anim-size-large.wpr-overlay-slide-right {
181
+ -webkit-transform: translateX(100%);
182
+ -ms-transform: translateX(100%);
183
+ transform: translateX(100%);
184
+ }
185
+
186
+ .wpr-animation-wrap:hover .wpr-element-slide-right,
187
+ .wpr-animation-wrap:hover .wpr-overlay-slide-right,
188
+ .wpr-animation-enter > .wpr-overlay-slide-right {
189
+ opacity: 1;
190
+ -webkit-transform: translateX(0);
191
+ -ms-transform: translateX(0);
192
+ transform: translateX(0);
193
+ }
194
+
195
+ .wpr-anim-size-small.wpr-element-slide-left {
196
+ -webkit-transform: translateX(-30%);
197
+ -ms-transform: translateX(-30%);
198
+ transform: translateX(-30%);
199
+ }
200
+
201
+ .wpr-anim-size-medium.wpr-element-slide-left {
202
+ -webkit-transform: translateX(-150%);
203
+ -ms-transform: translateX(-150%);
204
+ transform: translateX(-150%);
205
+ }
206
+
207
+ .wpr-anim-size-large.wpr-element-slide-left {
208
+ -webkit-transform: translateX(-300%);
209
+ -ms-transform: translateX(-300%);
210
+ transform: translateX(-300%);
211
+ }
212
+
213
+ .wpr-anim-size-small.wpr-overlay-slide-left {
214
+ -webkit-transform: translateX(-50%);
215
+ -ms-transform: translateX(-50%);
216
+ transform: translateX(-50%);
217
+ }
218
+
219
+ .wpr-anim-size-medium.wpr-overlay-slide-left {
220
+ -webkit-transform: translateX(-70%);
221
+ -ms-transform: translateX(-70%);
222
+ transform: translateX(-70%);
223
+ }
224
+
225
+ .wpr-anim-size-large.wpr-overlay-slide-left {
226
+ -webkit-transform: translateX(-100%);
227
+ -ms-transform: translateX(-100%);
228
+ transform: translateX(-100%);
229
+ }
230
+
231
+ .wpr-animation-wrap:hover .wpr-element-slide-left,
232
+ .wpr-animation-wrap:hover .wpr-overlay-slide-left,
233
+ .wpr-animation-enter > .wpr-overlay-slide-left {
234
+ opacity: 1;
235
+ -webkit-transform: translateX(0);
236
+ -ms-transform: translateX(0);
237
+ transform: translateX(0);
238
+ }
239
+
240
+ .wpr-element-slide-x-right,
241
+ .wpr-element-slide-x-left {
242
+ position: relative;
243
+ overflow: hidden;
244
+ }
245
+
246
+ .wpr-element-slide-x-right .inner-block,
247
+ .wpr-element-slide-x-left .inner-block {
248
+ position: relative;
249
+ -webkit-transition-duration: inherit;
250
+ -o-transition-duration: inherit;
251
+ transition-duration: inherit;
252
+ }
253
+
254
+ .wpr-element-slide-x-right .inner-block {
255
+ right: -100%;
256
+ }
257
+
258
+ .wpr-animation-wrap:hover .wpr-element-slide-x-right .inner-block {
259
+ right: 0;
260
+ }
261
+
262
+ .wpr-element-slide-x-left .inner-block {
263
+ left: -100%;
264
+ }
265
+
266
+ .wpr-animation-wrap:hover .wpr-element-slide-x-left .inner-block {
267
+ left: 0;
268
+ }
269
+
270
+ .wpr-element-skew-top,
271
+ .wpr-overlay-skew-top {
272
+ -webkit-transform-origin: center top 0;
273
+ -ms-transform-origin: center top 0;
274
+ transform-origin: center top 0;
275
+ }
276
+
277
+ .wpr-overlay-skew-top {
278
+ top: 0 !important;
279
+ }
280
+
281
+ .wpr-anim-size-small.wpr-element-skew-top,
282
+ .wpr-anim-size-small.wpr-overlay-skew-top {
283
+ -webkit-transform: perspective(600px) rotateX(-30deg);
284
+ transform: perspective(600px) rotateX(-30deg);
285
+ }
286
+
287
+ .wpr-anim-size-medium.wpr-element-skew-top,
288
+ .wpr-anim-size-medium.wpr-overlay-skew-top {
289
+ -webkit-transform: perspective(600px) rotateX(-50deg);
290
+ transform: perspective(600px) rotateX(-50deg);
291
+ }
292
+
293
+ .wpr-anim-size-large.wpr-element-skew-top,
294
+ .wpr-anim-size-large.wpr-overlay-skew-top {
295
+ -webkit-transform: perspective(600px) rotateX(-90deg);
296
+ transform: perspective(600px) rotateX(-90deg);
297
+ }
298
+
299
+ .wpr-animation-wrap:hover .wpr-element-skew-top,
300
+ .wpr-animation-wrap:hover .wpr-overlay-skew-top,
301
+ .wpr-animation-enter > .wpr-overlay-skew-top {
302
+ opacity: 1;
303
+ -webkit-transform: perspective(600px) rotateX(0deg);
304
+ transform: perspective(600px) rotateX(0deg);
305
+ }
306
+
307
+ .wpr-element-skew-bottom,
308
+ .wpr-overlay-skew-bottom {
309
+ -webkit-transform-origin: center bottom 0;
310
+ -ms-transform-origin: center bottom 0;
311
+ transform-origin: center bottom 0;
312
+ }
313
+
314
+ .wpr-overlay-skew-bottom {
315
+ top: auto !important;
316
+ bottom: 0 !important;
317
+ }
318
+
319
+ .wpr-anim-size-small.wpr-element-skew-bottom,
320
+ .wpr-anim-size-small.wpr-overlay-skew-bottom {
321
+ -webkit-transform: perspective(600px) rotateX(30deg);
322
+ transform: perspective(600px) rotateX(30deg);
323
+ }
324
+
325
+ .wpr-anim-size-medium.wpr-element-skew-bottom,
326
+ .wpr-anim-size-medium.wpr-overlay-skew-bottom {
327
+ -webkit-transform: perspective(600px) rotateX(50deg);
328
+ transform: perspective(600px) rotateX(50deg);
329
+ }
330
+
331
+ .wpr-anim-size-large.wpr-element-skew-bottom,
332
+ .wpr-anim-size-large.wpr-overlay-skew-bottom {
333
+ -webkit-transform: perspective(600px) rotateX(90deg);
334
+ transform: perspective(600px) rotateX(90deg);
335
+ }
336
+
337
+ .wpr-animation-wrap:hover .wpr-element-skew-bottom,
338
+ .wpr-animation-wrap:hover .wpr-overlay-skew-bottom,
339
+ .wpr-animation-enter > .wpr-overlay-skew-bottom {
340
+ opacity: 1;
341
+ -webkit-transform: perspective(600px) rotateX(0deg);
342
+ transform: perspective(600px) rotateX(0deg);
343
+ }
344
+
345
+ .wpr-element-skew-right,
346
+ .wpr-overlay-skew-right {
347
+ -webkit-transform-origin: center right 0;
348
+ -ms-transform-origin: center right 0;
349
+ transform-origin: center right 0;
350
+ }
351
+
352
+ .wpr-overlay-skew-right {
353
+ left: auto !important;
354
+ right: 0 !important;
355
+ }
356
+
357
+ .wpr-anim-size-small.wpr-element-skew-right,
358
+ .wpr-anim-size-small.wpr-overlay-skew-right {
359
+ -webkit-transform: perspective(600px) rotateY(-30deg);
360
+ transform: perspective(600px) rotateY(-30deg);
361
+ }
362
+
363
+ .wpr-anim-size-medium.wpr-element-skew-right,
364
+ .wpr-anim-size-medium.wpr-overlay-skew-right {
365
+ -webkit-transform: perspective(600px) rotateY(-50deg);
366
+ transform: perspective(600px) rotateY(-50deg);
367
+ }
368
+
369
+ .wpr-anim-size-large.wpr-element-skew-right,
370
+ .wpr-anim-size-large.wpr-overlay-skew-right {
371
+ -webkit-transform: perspective(600px) rotateY(-90deg);
372
+ transform: perspective(600px) rotateY(-90deg);
373
+ }
374
+
375
+ .wpr-animation-wrap:hover .wpr-element-skew-right,
376
+ .wpr-animation-wrap:hover .wpr-overlay-skew-right,
377
+ .wpr-animation-enter > .wpr-overlay-skew-right {
378
+ opacity: 1;
379
+ -webkit-transform: perspective(600px) rotateY(0deg);
380
+ transform: perspective(600px) rotateY(0deg);
381
+ }
382
+
383
+ .wpr-element-skew-left,
384
+ .wpr-overlay-skew-left {
385
+ -webkit-transform-origin: center left 0;
386
+ -ms-transform-origin: center left 0;
387
+ transform-origin: center left 0;
388
+ }
389
+
390
+ .wpr-overlay-skew-left {
391
+ left: 0 !important;
392
+ }
393
+
394
+ .wpr-anim-size-small.wpr-element-skew-left,
395
+ .wpr-anim-size-small.wpr-overlay-skew-left {
396
+ -webkit-transform: perspective(600px) rotateY(30deg);
397
+ transform: perspective(600px) rotateY(30deg);
398
+ }
399
+
400
+ .wpr-anim-size-medium.wpr-element-skew-left,
401
+ .wpr-anim-size-medium.wpr-overlay-skew-left {
402
+ -webkit-transform: perspective(600px) rotateY(50deg);
403
+ transform: perspective(600px) rotateY(50deg);
404
+ }
405
+
406
+ .wpr-anim-size-large.wpr-element-skew-left,
407
+ .wpr-anim-size-large.wpr-overlay-skew-left {
408
+ -webkit-transform: perspective(600px) rotateY(90deg);
409
+ transform: perspective(600px) rotateY(90deg);
410
+ }
411
+
412
+ .wpr-animation-wrap:hover .wpr-element-skew-left,
413
+ .wpr-animation-wrap:hover .wpr-overlay-skew-left,
414
+ .wpr-animation-enter > .wpr-overlay-skew-left {
415
+ opacity: 1;
416
+ -webkit-transform: perspective(600px) rotateY(0deg);
417
+ transform: perspective(600px) rotateY(0deg);
418
+ }
419
+
420
+ .wpr-anim-size-small.wpr-element-scale-up,
421
+ .wpr-anim-size-small.wpr-overlay-scale-up {
422
+ -webkit-transform: scale(0.9);
423
+ -ms-transform: scale(0.9);
424
+ transform: scale(0.9);
425
+ }
426
+
427
+ .wpr-anim-size-medium.wpr-element-scale-up,
428
+ .wpr-anim-size-medium.wpr-overlay-scale-up {
429
+ -webkit-transform: scale(0.6);
430
+ -ms-transform: scale(0.6);
431
+ transform: scale(0.6);
432
+ }
433
+
434
+ .wpr-anim-size-large.wpr-element-scale-up,
435
+ .wpr-anim-size-large.wpr-overlay-scale-up {
436
+ -webkit-transform: scale(0.2);
437
+ -ms-transform: scale(0.2);
438
+ transform: scale(0.2);
439
+ }
440
+
441
+ .wpr-animation-wrap:hover .wpr-element-scale-up,
442
+ .wpr-animation-wrap:hover .wpr-overlay-scale-up,
443
+ .wpr-animation-enter > .wpr-overlay-scale-up {
444
+ opacity: 1;
445
+ -webkit-transform: scale(1);
446
+ -ms-transform: scale(1);
447
+ transform: scale(1);
448
+ }
449
+
450
+ .wpr-anim-size-small.wpr-element-scale-down,
451
+ .wpr-anim-size-small.wpr-overlay-scale-down {
452
+ -webkit-transform: scale(1.1);
453
+ -ms-transform: scale(1.1);
454
+ transform: scale(1.1);
455
+ }
456
+
457
+ .wpr-anim-size-medium.wpr-element-scale-down,
458
+ .wpr-anim-size-medium.wpr-overlay-scale-down {
459
+ -webkit-transform: scale(1.4);
460
+ -ms-transform: scale(1.4);
461
+ transform: scale(1.4);
462
+ }
463
+
464
+ .wpr-anim-size-large.wpr-element-scale-down,
465
+ .wpr-anim-size-large.wpr-overlay-scale-down {
466
+ -webkit-transform: scale(1.9);
467
+ -ms-transform: scale(1.9);
468
+ transform: scale(1.9);
469
+ }
470
+
471
+ .wpr-animation-wrap:hover .wpr-element-scale-down,
472
+ .wpr-animation-wrap:hover .wpr-overlay-scale-down,
473
+ .wpr-animation-enter > .wpr-overlay-scale-down {
474
+ opacity: 1;
475
+ -webkit-transform: scale(1);
476
+ -ms-transform: scale(1);
477
+ transform: scale(1);
478
+ }
479
+
480
+ .wpr-anim-size-small.wpr-element-roll-right,
481
+ .wpr-anim-size-small.wpr-overlay-roll-right {
482
+ -webkit-transform: translateX(100%) rotate(90deg);
483
+ -ms-transform: translateX(100%) rotate(90deg);
484
+ transform: translateX(100%) rotate(90deg);
485
+ }
486
+
487
+ .wpr-anim-size-medium.wpr-element-roll-right,
488
+ .wpr-anim-size-medium.wpr-overlay-roll-right {
489
+ -webkit-transform: translateX(100%) rotate(240deg);
490
+ -ms-transform: translateX(100%) rotate(240deg);
491
+ transform: translateX(100%) rotate(240deg);
492
+ }
493
+
494
+ .wpr-anim-size-large.wpr-element-roll-right,
495
+ .wpr-anim-size-large.wpr-overlay-roll-right {
496
+ -webkit-transform: translateX(100%) rotate(360deg);
497
+ -ms-transform: translateX(100%) rotate(360deg);
498
+ transform: translateX(100%) rotate(360deg);
499
+ }
500
+
501
+ .wpr-animation-wrap:hover .wpr-element-roll-right,
502
+ .wpr-animation-wrap:hover .wpr-overlay-roll-right,
503
+ .wpr-animation-enter > .wpr-overlay-roll-right {
504
+ opacity: 1;
505
+ -webkit-transform: translateX(0) rotate(0);
506
+ -ms-transform: translateX(0) rotate(0);
507
+ transform: translateX(0) rotate(0);
508
+ }
509
+
510
+ .wpr-anim-size-small.wpr-element-roll-left,
511
+ .wpr-anim-size-small.wpr-overlay-roll-left {
512
+ -webkit-transform: translateX(-100%) rotate(-90deg);
513
+ -ms-transform: translateX(-100%) rotate(-90deg);
514
+ transform: translateX(-100%) rotate(-90deg);
515
+ }
516
+
517
+ .wpr-anim-size-medium.wpr-element-roll-left,
518
+ .wpr-anim-size-medium.wpr-overlay-roll-left {
519
+ -webkit-transform: translateX(-100%) rotate(-240deg);
520
+ -ms-transform: translateX(-100%) rotate(-240deg);
521
+ transform: translateX(-100%) rotate(-240deg);
522
+ }
523
+
524
+ .wpr-anim-size-large.wpr-element-roll-left,
525
+ .wpr-anim-size-large.wpr-overlay-roll-left {
526
+ -webkit-transform: translateX(-100%) rotate(-360deg);
527
+ -ms-transform: translateX(-100%) rotate(-360deg);
528
+ transform: translateX(-100%) rotate(-360deg);
529
+ }
530
+
531
+ .wpr-animation-wrap:hover .wpr-element-roll-left,
532
+ .wpr-animation-wrap:hover .wpr-overlay-roll-left,
533
+ .wpr-animation-enter > .wpr-overlay-roll-left {
534
+ opacity: 1;
535
+ -webkit-transform: translateX(0) rotate(0);
536
+ -ms-transform: translateX(0) rotate(0);
537
+ transform: translateX(0) rotate(0);
538
+ }
539
+
540
+
541
+ /* Timing Functions */
542
+
543
+ .wpr-anim-timing-linear {
544
+ -webkit-transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
545
+ -o-transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
546
+ transition-timing-function: cubic-bezier(0.250, 0.250, 0.750, 0.750);
547
+ }
548
+
549
+ .wpr-anim-timing-ease-default {
550
+ -webkit-transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
551
+ -o-transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
552
+ transition-timing-function: cubic-bezier(0.250, 0.100, 0.250, 1.000);
553
+ }
554
+
555
+ .wpr-anim-timing-ease-in {
556
+ -webkit-transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
557
+ -o-transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
558
+ transition-timing-function: cubic-bezier(0.420, 0.000, 1.000, 1.000);
559
+ }
560
+
561
+ .wpr-anim-timing-ease-out {
562
+ -webkit-transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
563
+ -o-transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
564
+ transition-timing-function: cubic-bezier(0.000, 0.000, 0.580, 1.000);
565
+ }
566
+
567
+ .wpr-anim-timing-ease-in-out {
568
+ -webkit-transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
569
+ -o-transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
570
+ transition-timing-function: cubic-bezier(0.420, 0.000, 0.580, 1.000);
571
+ }
572
+
573
+ .wpr-anim-timing-ease-in-quad {
574
+ -webkit-transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
575
+ -o-transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
576
+ transition-timing-function: cubic-bezier(0.550, 0.085, 0.680, 0.530);
577
+ }
578
+
579
+ .wpr-anim-timing-ease-in-cubic {
580
+ -webkit-transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
581
+ -o-transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
582
+ transition-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
583
+ }
584
+
585
+ .wpr-anim-timing-ease-in-quart {
586
+ -webkit-transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
587
+ -o-transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
588
+ transition-timing-function: cubic-bezier(0.895, 0.030, 0.685, 0.220);
589
+ }
590
+
591
+ .wpr-anim-timing-ease-in-quint {
592
+ -webkit-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
593
+ -o-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
594
+ transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
595
+ }
596
+
597
+ .wpr-anim-timing-ease-in-sine {
598
+ -webkit-transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
599
+ -o-transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
600
+ transition-timing-function: cubic-bezier(0.470, 0.000, 0.745, 0.715);
601
+ }
602
+
603
+ .wpr-anim-timing-ease-in-expo {
604
+ -webkit-transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
605
+ -o-transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
606
+ transition-timing-function: cubic-bezier(0.950, 0.050, 0.795, 0.035);
607
+ }
608
+
609
+ .wpr-anim-timing-ease-in-circ {
610
+ -webkit-transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
611
+ -o-transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
612
+ transition-timing-function: cubic-bezier(0.600, 0.040, 0.980, 0.335);
613
+ }
614
+
615
+ .wpr-anim-timing-ease-in-back {
616
+ -webkit-transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
617
+ -o-transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
618
+ transition-timing-function: cubic-bezier(0.600, -0.280, 0.735, 0.045);
619
+ }
620
+
621
+ .wpr-anim-timing-ease-out-quad {
622
+ -webkit-transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
623
+ -o-transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
624
+ transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
625
+ }
626
+
627
+ .wpr-anim-timing-ease-out-cubic {
628
+ -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
629
+ -o-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
630
+ transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
631
+ }
632
+
633
+ .wpr-anim-timing-ease-out-quart {
634
+ -webkit-transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
635
+ -o-transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
636
+ transition-timing-function: cubic-bezier(0.165, 0.840, 0.440, 1.000);
637
+ }
638
+
639
+ .wpr-anim-timing-ease-out-quint {
640
+ -webkit-transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
641
+ -o-transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
642
+ transition-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
643
+ }
644
+
645
+ .wpr-anim-timing-ease-out-sine {
646
+ -webkit-transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
647
+ -o-transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
648
+ transition-timing-function: cubic-bezier(0.390, 0.575, 0.565, 1.000);
649
+ }
650
+
651
+ .wpr-anim-timing-ease-out-expo {
652
+ -webkit-transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
653
+ -o-transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
654
+ transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
655
+ }
656
+
657
+ .wpr-anim-timing-ease-out-circ {
658
+ -webkit-transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
659
+ -o-transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
660
+ transition-timing-function: cubic-bezier(0.075, 0.820, 0.165, 1.000);
661
+ }
662
+
663
+ .wpr-anim-timing-ease-out-back {
664
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
665
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
666
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275);
667
+ }
668
+
669
+ .wpr-anim-timing-ease-in-out-quad {
670
+ -webkit-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955);
671
+ -o-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955);
672
+ transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955)
673
+ }
674
+
675
+ .wpr-anim-timing-ease-in-out-cubic {
676
+ -webkit-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
677
+ -o-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
678
+ transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
679
+ }
680
+
681
+ .wpr-anim-timing-ease-in-out-quart {
682
+ -webkit-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
683
+ -o-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
684
+ transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
685
+ }
686
+
687
+ .wpr-anim-timing-ease-in-out-quint {
688
+ -webkit-transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
689
+ -o-transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
690
+ transition-timing-function: cubic-bezier(0.860, 0.000, 0.070, 1.000);
691
+ }
692
+
693
+ .wpr-anim-timing-ease-in-out-sine {
694
+ -webkit-transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
695
+ -o-transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
696
+ transition-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
697
+ }
698
+
699
+ .wpr-anim-timing-ease-in-out-expo {
700
+ -webkit-transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
701
+ -o-transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
702
+ transition-timing-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
703
+ }
704
+
705
+ .wpr-anim-timing-ease-in-out-circ {
706
+ -webkit-transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
707
+ -o-transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
708
+ transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
709
+ }
710
+
711
+ .wpr-anim-timing-ease-in-out-back {
712
+ -webkit-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
713
+ -o-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
714
+ transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
715
+ }
716
+
717
+
718
+ /* Image Effects */
719
+
720
+ .wpr-slide.wpr-effect-dir-top:hover img {
721
+ -webkit-transform: translateY(-100%);
722
+ -ms-transform: translateY(-100%);
723
+ transform: translateY(-100%);
724
+ }
725
+
726
+ .wpr-slide.wpr-effect-dir-bottom:hover img {
727
+ -webkit-transform: translateY(100%);
728
+ -ms-transform: translateY(100%);
729
+ transform: translateY(100%);
730
+ }
731
+
732
+ .wpr-slide.wpr-effect-dir-right:hover img {
733
+ -webkit-transform: translateX(100%);
734
+ -ms-transform: translateX(100%);
735
+ transform: translateX(100%);
736
+ }
737
+
738
+ .wpr-slide.wpr-effect-dir-left:hover img {
739
+ -webkit-transform: translateX(-100%);
740
+ -ms-transform: translateX(-100%);
741
+ transform: translateX(-100%);
742
+ }
743
+
744
+ .wpr-zoom-in.wpr-effect-size-small:hover img {
745
+ -webkit-transform: scale(1.1);
746
+ -ms-transform: scale(1.1);
747
+ transform: scale(1.1);
748
+ }
749
+
750
+ .wpr-zoom-in.wpr-effect-size-medium:hover img {
751
+ -webkit-transform: scale(1.3);
752
+ -ms-transform: scale(1.3);
753
+ transform: scale(1.3);
754
+ }
755
+
756
+ .wpr-zoom-in.wpr-effect-size-large:hover img {
757
+ -webkit-transform: scale(1.5);
758
+ -ms-transform: scale(1.5);
759
+ transform: scale(1.5);
760
+ }
761
+
762
+ .wpr-zoom-out.wpr-effect-size-small img {
763
+ -webkit-transform: scale(1.1);
764
+ -ms-transform: scale(1.1);
765
+ transform: scale(1.1);
766
+ }
767
+
768
+ .wpr-zoom-out.wpr-effect-size-medium img {
769
+ -webkit-transform: scale(1.3);
770
+ -ms-transform: scale(1.3);
771
+ transform: scale(1.3);
772
+ }
773
+
774
+ .wpr-zoom-out.wpr-effect-size-large img {
775
+ -webkit-transform: scale(1.5);
776
+ -ms-transform: scale(1.5);
777
+ transform: scale(1.5);
778
+ }
779
+
780
+ .wpr-zoom-out.wpr-effect-size-small:hover img,
781
+ .wpr-zoom-out.wpr-effect-size-medium:hover img,
782
+ .wpr-zoom-out.wpr-effect-size-large:hover img {
783
+ -webkit-transform: scale(1);
784
+ -ms-transform: scale(1);
785
+ transform: scale(1);
786
+ }
787
+
788
+ .wpr-grayscale-in.wpr-effect-size-small:hover img {
789
+ -webkit-filter: grayscale(0.3);
790
+ filter: grayscale(0.3);
791
+ }
792
+
793
+ .wpr-grayscale-in.wpr-effect-size-medium:hover img {
794
+ -webkit-filter: grayscale(0.6);
795
+ filter: grayscale(0.6);
796
+ }
797
+
798
+ .wpr-grayscale-in.wpr-effect-size-large:hover img {
799
+ -webkit-filter: grayscale(1);
800
+ filter: grayscale(1);
801
+ }
802
+
803
+ .wpr-grayscale-out.wpr-effect-size-small img {
804
+ -webkit-filter: grayscale(0.3);
805
+ filter: grayscale(0.3);
806
+ }
807
+
808
+ .wpr-grayscale-out.wpr-effect-size-medium img {
809
+ -webkit-filter: grayscale(0.6);
810
+ filter: grayscale(0.6);
811
+ }
812
+
813
+ .wpr-grayscale-out.wpr-effect-size-large img {
814
+ -webkit-filter: grayscale(1);
815
+ filter: grayscale(1);
816
+ }
817
+
818
+ .wpr-grayscale-out.wpr-effect-size-small:hover img,
819
+ .wpr-grayscale-out.wpr-effect-size-medium:hover img,
820
+ .wpr-grayscale-out.wpr-effect-size-large:hover img {
821
+ -webkit-filter: grayscale(0);
822
+ filter: grayscale(0);
823
+ }
824
+
825
+ .wpr-blur-in.wpr-effect-size-small:hover img {
826
+ -webkit-filter: blur(1px);
827
+ filter: blur(1px);
828
+ }
829
+
830
+ .wpr-blur-in.wpr-effect-size-medium:hover img {
831
+ -webkit-filter: blur(3px);
832
+ filter: blur(3px);
833
+ }
834
+
835
+ .wpr-blur-in.wpr-effect-size-large:hover img {
836
+ -webkit-filter: blur(5px);
837
+ filter: blur(5px);
838
+ }
839
+
840
+ .wpr-blur-out.wpr-effect-size-small img {
841
+ -webkit-filter: blur(1px);
842
+ filter: blur(1px);
843
+ }
844
+
845
+ .wpr-blur-out.wpr-effect-size-medium img {
846
+ -webkit-filter: blur(3px);
847
+ filter: blur(3px);
848
+ }
849
+
850
+ .wpr-blur-out.wpr-effect-size-large img {
851
+ -webkit-filter: blur(5px);
852
+ filter: blur(5px);
853
+ }
854
+
855
+ .wpr-blur-out.wpr-effect-size-small:hover img,
856
+ .wpr-blur-out.wpr-effect-size-medium:hover img,
857
+ .wpr-blur-out.wpr-effect-size-large:hover img {
858
+ -webkit-filter: blur(0px);
859
+ filter: blur(0px);
860
+ }
861
+
862
+
863
+ /* Background Animation */
864
+
865
+ .wpr-animation-wrap:hover .wpr-bg-anim-zoom-in {
866
+ -webkit-transform: scale(1.2);
867
+ -ms-transform: scale(1.2);
868
+ transform: scale(1.2);
869
+ }
870
+
871
+ .wpr-bg-anim-zoom-out {
872
+ -webkit-transform: scale(1.2);
873
+ -ms-transform: scale(1.2);
874
+ transform: scale(1.2);
875
+ }
876
+
877
+ .wpr-animation-wrap:hover .wpr-bg-anim-zoom-out {
878
+ -webkit-transform: scale(1);
879
+ -ms-transform: scale(1);
880
+ transform: scale(1);
881
+ }
882
+
883
+ .wpr-bg-anim-move-left {
884
+ -webkit-transform: scale(1.2) translateX(8%);
885
+ -ms-transform: scale(1.2) translateX(8%);
886
+ transform: scale(1.2) translateX(8%);
887
+ }
888
+
889
+ .wpr-animation-wrap:hover .wpr-bg-anim-move-left {
890
+ -webkit-transform: scale(1.2) translateX(-8%);
891
+ -ms-transform: scale(1.2) translateX(-8%);
892
+ transform: scale(1.2) translateX(-8%);
893
+ }
894
+
895
+ .wpr-bg-anim-move-right {
896
+ -webkit-transform: scale(1.2) translateX(-8%);
897
+ -ms-transform: scale(1.2) translateX(-8%);
898
+ transform: scale(1.2) translateX(-8%);
899
+ }
900
+
901
+ .wpr-animation-wrap:hover .wpr-bg-anim-move-right {
902
+ -webkit-transform: scale(1.2) translateX(8%);
903
+ -ms-transform: scale(1.2) translateX(8%);
904
+ transform: scale(1.2) translateX(8%);
905
+ }
906
+
907
+ .wpr-bg-anim-move-up {
908
+ -webkit-transform: scale(1.2) translateY(8%);
909
+ -ms-transform: scale(1.2) translateY(8%);
910
+ transform: scale(1.2) translateY(8%);
911
+ }
912
+
913
+ .wpr-animation-wrap:hover .wpr-bg-anim-move-up {
914
+ -webkit-transform: scale(1.2) translateY(-8%);
915
+ -ms-transform: scale(1.2) translateY(-8%);
916
+ transform: scale(1.2) translateY(-8%);
917
+ }
918
+
919
+ .wpr-animation-wrap:hover .wpr-bg-anim-move-down {
920
+ -webkit-transform: scale(1.2) translateY(-8%);
921
+ -ms-transform: scale(1.2) translateY(-8%);
922
+ transform: scale(1.2) translateY(-8%);
923
+ }
924
+
925
+ .wpr-animation-wrap:hover .wpr-bg-anim-move-down {
926
+ -webkit-transform: scale(1.2) translateY(8%);
927
+ -ms-transform: scale(1.2) translateY(8%);
928
+ transform: scale(1.2) translateY(8%);
929
+ }
930
+
931
+
932
+ /* Border Animations*/
933
+
934
+ /* Layla */
935
+ .wpr-border-anim-layla::before,
936
+ .wpr-border-anim-layla::after {
937
+ position: absolute;
938
+ content: '';
939
+ opacity: 0;
940
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
941
+ transition: opacity 0.35s, -webkit-transform 0.35s;
942
+ -o-transition: opacity 0.35s, transform 0.35s;
943
+ transition: opacity 0.35s, transform 0.35s;
944
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
945
+ }
946
+
947
+ .wpr-border-anim-layla::before {
948
+ -webkit-transform: scale(0,1);
949
+ -ms-transform: scale(0,1);
950
+ transform: scale(0,1);
951
+ -webkit-transform-origin: 0 0;
952
+ -ms-transform-origin: 0 0;
953
+ transform-origin: 0 0;
954
+ }
955
+
956
+ .wpr-border-anim-layla::after {
957
+ -webkit-transform: scale(1,0);
958
+ -ms-transform: scale(1,0);
959
+ transform: scale(1,0);
960
+ -webkit-transform-origin: 100% 0;
961
+ -ms-transform-origin: 100% 0;
962
+ transform-origin: 100% 0;
963
+ }
964
+
965
+ .wpr-animation-wrap:hover .wpr-border-anim-layla::before,
966
+ .wpr-animation-wrap:hover .wpr-border-anim-layla::after {
967
+ opacity: 1;
968
+ -webkit-transform: scale(1);
969
+ -ms-transform: scale(1);
970
+ transform: scale(1);
971
+ }
972
+
973
+ .wpr-animation-wrap:hover .wpr-border-anim-layla::after {
974
+ -webkit-transition-delay: 0.15s;
975
+ -o-transition-delay: 0.15s;
976
+ transition-delay: 0.15s;
977
+ }
978
+
979
+ /* Oscar */
980
+ .wpr-border-anim-oscar::before {
981
+ position: absolute;
982
+ content: '';
983
+ opacity: 0;
984
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
985
+ transition: opacity 0.35s, -webkit-transform 0.35s;
986
+ -o-transition: opacity 0.35s, transform 0.35s;
987
+ transition: opacity 0.35s, transform 0.35s;
988
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
989
+ -webkit-transform: scale(0.9);
990
+ -ms-transform: scale(0.9);
991
+ transform: scale(0.9);
992
+ }
993
+
994
+ .wpr-animation-wrap:hover .wpr-border-anim-oscar::before {
995
+ opacity: 1;
996
+ -webkit-transform: scale(1);
997
+ -ms-transform: scale(1);
998
+ transform: scale(1);
999
+ }
1000
+
1001
+ /* Bubba */
1002
+ .wpr-border-anim-bubba::before,
1003
+ .wpr-border-anim-bubba::after {
1004
+ position: absolute;
1005
+ content: '';
1006
+ opacity: 0;
1007
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1008
+ transition: opacity 0.35s, -webkit-transform 0.35s;
1009
+ -o-transition: opacity 0.35s, transform 0.35s;
1010
+ transition: opacity 0.35s, transform 0.35s;
1011
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1012
+ }
1013
+
1014
+ .wpr-border-anim-bubba::before {
1015
+ -webkit-transform: scale(0,1);
1016
+ -ms-transform: scale(0,1);
1017
+ transform: scale(0,1);
1018
+ }
1019
+
1020
+ .wpr-border-anim-bubba::after {
1021
+ -webkit-transform: scale(1,0);
1022
+ -ms-transform: scale(1,0);
1023
+ transform: scale(1,0);
1024
+ }
1025
+
1026
+ .wpr-animation-wrap:hover .wpr-border-anim-bubba::before,
1027
+ .wpr-animation-wrap:hover .wpr-border-anim-bubba::after {
1028
+ opacity: 1;
1029
+ -webkit-transform: scale(1);
1030
+ -ms-transform: scale(1);
1031
+ transform: scale(1);
1032
+ }
1033
+
1034
+ /* Romeo */
1035
+ .wpr-border-anim-romeo::before,
1036
+ .wpr-border-anim-romeo::after {
1037
+ position: absolute;
1038
+ top: 50%;
1039
+ left: 50%;
1040
+ width: 80%;
1041
+ content: '';
1042
+ opacity: 0;
1043
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1044
+ transition: opacity 0.35s, -webkit-transform 0.35s;
1045
+ -o-transition: opacity 0.35s, transform 0.35s;
1046
+ transition: opacity 0.35s, transform 0.35s;
1047
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1048
+ -webkit-transform: translate3d(-50%,-50%,0);
1049
+ transform: translate3d(-50%,-50%,0);
1050
+ }
1051
+
1052
+ .wpr-animation-wrap:hover .wpr-border-anim-romeo::before {
1053
+ opacity: 1;
1054
+ -webkit-transform: translate3d(-50%,-50%,0) rotate(45deg);
1055
+ transform: translate3d(-50%,-50%,0) rotate(45deg);
1056
+ }
1057
+
1058
+ .wpr-animation-wrap:hover .wpr-border-anim-romeo::after {
1059
+ opacity: 1;
1060
+ -webkit-transform: translate3d(-50%,-50%,0) rotate(-45deg);
1061
+ transform: translate3d(-50%,-50%,0) rotate(-45deg);
1062
+ }
1063
+
1064
+ /* Chicho */
1065
+ .wpr-border-anim-chicho::before {
1066
+ position: absolute;
1067
+ content: '';
1068
+ -webkit-transform: scale(1.1);
1069
+ -ms-transform: scale(1.1);
1070
+ transform: scale(1.1);
1071
+ opacity: 0;
1072
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1073
+ transition: opacity 0.35s, -webkit-transform 0.35s;
1074
+ -o-transition: opacity 0.35s, transform 0.35s;
1075
+ transition: opacity 0.35s, transform 0.35s;
1076
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1077
+ }
1078
+
1079
+ .wpr-animation-wrap:hover .wpr-border-anim-chicho::before {
1080
+ opacity: 1;
1081
+ -webkit-transform: scale(1);
1082
+ -ms-transform: scale(1);
1083
+ transform: scale(1);
1084
+ }
1085
+
1086
+ /* Apollo */
1087
+ .wpr-border-anim-apollo::before {
1088
+ position: absolute;
1089
+ top: 0;
1090
+ left: 0;
1091
+ width: 100%;
1092
+ height: 100%;
1093
+ content: '';
1094
+ -webkit-transition: -webkit-transform 0.6s;
1095
+ transition: -webkit-transform 0.6s;
1096
+ -o-transition: transform 0.6s;
1097
+ transition: transform 0.6s;
1098
+ transition: transform 0.6s, -webkit-transform 0.6s;
1099
+ -webkit-transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,-100%,0);
1100
+ transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,-100%,0);
1101
+ }
1102
+
1103
+ .wpr-animation-wrap:hover .wpr-border-anim-apollo::before {
1104
+ -webkit-transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,100%,0);
1105
+ transform: scale3d(2.9,2.4,1) rotate3d(0,0,1,45deg) translate3d(0,100%,0);
1106
+ }
1107
+
1108
+ /* Jazz */
1109
+ .wpr-border-anim-jazz::after {
1110
+ -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
1111
+ transition: opacity 0.35s, -webkit-transform 0.35s;
1112
+ -o-transition: opacity 0.35s, transform 0.35s;
1113
+ transition: opacity 0.35s, transform 0.35s;
1114
+ transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
1115
+ position: absolute;
1116
+ top: 0;
1117
+ left: 0;
1118
+ width: 100%;
1119
+ height: 100%;
1120
+ content: '';
1121
+ opacity: 0;
1122
+ -webkit-transform: rotate3d(0,0,1,45deg) scale3d(1,0,1);
1123
+ transform: rotate3d(0,0,1,45deg) scale3d(1,0,1);
1124
+ -webkit-transform-origin: 50% 50%;
1125
+ -ms-transform-origin: 50% 50%;
1126
+ transform-origin: 50% 50%;
1127
+ }
1128
+
1129
+ .wpr-animation-wrap:hover .wpr-border-anim-jazz::after {
1130
+ opacity: 1;
1131
+ -webkit-transform: rotate3d(0,0,1,45deg) scale3d(1,1,1);
1132
+ transform: rotate3d(0,0,1,45deg) scale3d(1,1,1);
1133
  }
assets/css/lib/lightgallery/lightgallery.css CHANGED
@@ -1,982 +1,982 @@
1
- /*! lightgallery - v1.6.12 - 2019-02-19
2
- * http://sachinchoolur.github.io/lightGallery/
3
- * Copyright (c) 2019 Sachin N; Licensed GPLv3 */
4
- @font-face {
5
- font-family: 'lg';
6
- src: url("fonts/lg.eot?n1z373");
7
- src: url("fonts/lg.eot?#iefixn1z373") format("embedded-opentype"), url("fonts/lg.woff?n1z373") format("woff"), url("fonts/lg.ttf?n1z373") format("truetype"), url("fonts/lg.svg?n1z373#lg") format("svg");
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
- .lg-icon {
12
- font-family: 'lg';
13
- speak: none;
14
- font-style: normal;
15
- font-weight: normal;
16
- font-variant: normal;
17
- text-transform: none;
18
- line-height: 1;
19
- /* Better Font Rendering =========== */
20
- -webkit-font-smoothing: antialiased;
21
- -moz-osx-font-smoothing: grayscale;
22
- }
23
-
24
- .lg-actions .lg-next, .lg-actions .lg-prev {
25
- background-color: rgba(0, 0, 0, 0.45);
26
- border-radius: 2px;
27
- color: #999;
28
- cursor: pointer;
29
- display: block;
30
- font-size: 22px;
31
- margin-top: -10px;
32
- padding: 8px 10px 9px;
33
- position: absolute;
34
- top: 50%;
35
- z-index: 1080;
36
- border: none;
37
- outline: none;
38
- }
39
- .lg-actions .lg-next.disabled, .lg-actions .lg-prev.disabled {
40
- pointer-events: none;
41
- opacity: 0.5;
42
- }
43
- .lg-actions .lg-next:hover, .lg-actions .lg-prev:hover {
44
- color: #FFF;
45
- }
46
- .lg-actions .lg-next {
47
- right: 20px;
48
- }
49
- .lg-actions .lg-next:before {
50
- content: "\e095";
51
- }
52
- .lg-actions .lg-prev {
53
- left: 20px;
54
- }
55
- .lg-actions .lg-prev:after {
56
- content: "\e094";
57
- }
58
-
59
- @-webkit-keyframes lg-right-end {
60
- 0% {
61
- left: 0;
62
- }
63
- 50% {
64
- left: -30px;
65
- }
66
- 100% {
67
- left: 0;
68
- }
69
- }
70
- @-moz-keyframes lg-right-end {
71
- 0% {
72
- left: 0;
73
- }
74
- 50% {
75
- left: -30px;
76
- }
77
- 100% {
78
- left: 0;
79
- }
80
- }
81
- @-ms-keyframes lg-right-end {
82
- 0% {
83
- left: 0;
84
- }
85
- 50% {
86
- left: -30px;
87
- }
88
- 100% {
89
- left: 0;
90
- }
91
- }
92
- @keyframes lg-right-end {
93
- 0% {
94
- left: 0;
95
- }
96
- 50% {
97
- left: -30px;
98
- }
99
- 100% {
100
- left: 0;
101
- }
102
- }
103
- @-webkit-keyframes lg-left-end {
104
- 0% {
105
- left: 0;
106
- }
107
- 50% {
108
- left: 30px;
109
- }
110
- 100% {
111
- left: 0;
112
- }
113
- }
114
- @-moz-keyframes lg-left-end {
115
- 0% {
116
- left: 0;
117
- }
118
- 50% {
119
- left: 30px;
120
- }
121
- 100% {
122
- left: 0;
123
- }
124
- }
125
- @-ms-keyframes lg-left-end {
126
- 0% {
127
- left: 0;
128
- }
129
- 50% {
130
- left: 30px;
131
- }
132
- 100% {
133
- left: 0;
134
- }
135
- }
136
- @keyframes lg-left-end {
137
- 0% {
138
- left: 0;
139
- }
140
- 50% {
141
- left: 30px;
142
- }
143
- 100% {
144
- left: 0;
145
- }
146
- }
147
- .lg-outer.lg-right-end .lg-object {
148
- -webkit-animation: lg-right-end 0.3s;
149
- -o-animation: lg-right-end 0.3s;
150
- animation: lg-right-end 0.3s;
151
- position: relative;
152
- }
153
- .lg-outer.lg-left-end .lg-object {
154
- -webkit-animation: lg-left-end 0.3s;
155
- -o-animation: lg-left-end 0.3s;
156
- animation: lg-left-end 0.3s;
157
- position: relative;
158
- }
159
-
160
- .lg-toolbar {
161
- z-index: 1082;
162
- left: 0;
163
- position: absolute;
164
- top: 0;
165
- width: 100%;
166
- background-color: rgba(0, 0, 0, 0.45);
167
- }
168
- .lg-toolbar .lg-icon {
169
- color: #999;
170
- cursor: pointer;
171
- float: right;
172
- font-size: 24px;
173
- height: 47px;
174
- line-height: 27px;
175
- padding: 10px 0;
176
- text-align: center;
177
- width: 50px;
178
- text-decoration: none !important;
179
- outline: medium none;
180
- -webkit-transition: color 0.2s linear;
181
- -o-transition: color 0.2s linear;
182
- transition: color 0.2s linear;
183
- }
184
- .lg-toolbar .lg-icon:hover {
185
- color: #FFF;
186
- }
187
- .lg-toolbar .lg-close:after {
188
- content: "\e070";
189
- }
190
- .lg-toolbar .lg-download:after {
191
- content: "\e0f2";
192
- }
193
-
194
- .lg-sub-html {
195
- background-color: rgba(0, 0, 0, 0.45);
196
- bottom: 0;
197
- color: #EEE;
198
- font-size: 16px;
199
- left: 0;
200
- padding: 10px 40px;
201
- position: fixed;
202
- right: 0;
203
- text-align: center;
204
- z-index: 1080;
205
- }
206
- .lg-sub-html h4 {
207
- margin: 0;
208
- font-size: 13px;
209
- font-weight: bold;
210
- }
211
- .lg-sub-html p {
212
- font-size: 12px;
213
- margin: 5px 0 0;
214
- }
215
-
216
- #lg-counter {
217
- color: #999;
218
- display: inline-block;
219
- font-size: 16px;
220
- padding-left: 20px;
221
- padding-top: 12px;
222
- vertical-align: middle;
223
- }
224
-
225
- .lg-toolbar, .lg-prev, .lg-next {
226
- opacity: 1;
227
- -webkit-transition: -webkit-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
228
- -moz-transition: -moz-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
229
- -o-transition: -o-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
230
- transition: transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
231
- }
232
-
233
- .lg-hide-items .lg-prev {
234
- opacity: 0;
235
- -webkit-transform: translate3d(-10px, 0, 0);
236
- transform: translate3d(-10px, 0, 0);
237
- }
238
- .lg-hide-items .lg-next {
239
- opacity: 0;
240
- -webkit-transform: translate3d(10px, 0, 0);
241
- transform: translate3d(10px, 0, 0);
242
- }
243
- .lg-hide-items .lg-toolbar {
244
- opacity: 0;
245
- -webkit-transform: translate3d(0, -10px, 0);
246
- transform: translate3d(0, -10px, 0);
247
- }
248
-
249
- body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object {
250
- -webkit-transform: scale3d(0.5, 0.5, 0.5);
251
- transform: scale3d(0.5, 0.5, 0.5);
252
- opacity: 0;
253
- -webkit-transition: -webkit-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
254
- -moz-transition: -moz-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
255
- -o-transition: -o-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
256
- transition: transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
257
- -webkit-transform-origin: 50% 50%;
258
- -moz-transform-origin: 50% 50%;
259
- -ms-transform-origin: 50% 50%;
260
- transform-origin: 50% 50%;
261
- }
262
- body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object {
263
- -webkit-transform: scale3d(1, 1, 1);
264
- transform: scale3d(1, 1, 1);
265
- opacity: 1;
266
- }
267
-
268
- .lg-outer .lg-thumb-outer {
269
- background-color: #0D0A0A;
270
- bottom: 0;
271
- position: absolute;
272
- width: 100%;
273
- z-index: 1080;
274
- max-height: 350px;
275
- -webkit-transform: translate3d(0, 100%, 0);
276
- transform: translate3d(0, 100%, 0);
277
- -webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
278
- -moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
279
- -o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
280
- transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
281
- }
282
- .lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item {
283
- cursor: -webkit-grab;
284
- cursor: -moz-grab;
285
- cursor: -o-grab;
286
- cursor: -ms-grab;
287
- cursor: grab;
288
- }
289
- .lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item {
290
- cursor: move;
291
- cursor: -webkit-grabbing;
292
- cursor: -moz-grabbing;
293
- cursor: -o-grabbing;
294
- cursor: -ms-grabbing;
295
- cursor: grabbing;
296
- }
297
- .lg-outer .lg-thumb-outer.lg-dragging .lg-thumb {
298
- -webkit-transition-duration: 0s !important;
299
- transition-duration: 0s !important;
300
- }
301
- .lg-outer.lg-thumb-open .lg-thumb-outer {
302
- -webkit-transform: translate3d(0, 0%, 0);
303
- transform: translate3d(0, 0%, 0);
304
- }
305
- .lg-outer .lg-thumb {
306
- padding: 10px 0;
307
- height: 100%;
308
- margin-bottom: -5px;
309
- }
310
- .lg-outer .lg-thumb-item {
311
- border-radius: 5px;
312
- cursor: pointer;
313
- float: left;
314
- overflow: hidden;
315
- height: 100%;
316
- border: 2px solid #FFF;
317
- border-radius: 4px;
318
- margin-bottom: 5px;
319
- }
320
- @media (min-width: 1025px) {
321
- .lg-outer .lg-thumb-item {
322
- -webkit-transition: border-color 0.25s ease;
323
- -o-transition: border-color 0.25s ease;
324
- transition: border-color 0.25s ease;
325
- }
326
- }
327
- .lg-outer .lg-thumb-item.active, .lg-outer .lg-thumb-item:hover {
328
- border-color: #a90707;
329
- }
330
- .lg-outer .lg-thumb-item img {
331
- width: 100%;
332
- height: 100%;
333
- object-fit: cover;
334
- }
335
- .lg-outer.lg-has-thumb .lg-item {
336
- padding-bottom: 120px;
337
- }
338
- .lg-outer.lg-can-toggle .lg-item {
339
- padding-bottom: 0;
340
- }
341
- .lg-outer.lg-pull-caption-up .lg-sub-html {
342
- -webkit-transition: bottom 0.25s ease;
343
- -o-transition: bottom 0.25s ease;
344
- transition: bottom 0.25s ease;
345
- }
346
- .lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html {
347
- bottom: 100px;
348
- }
349
- .lg-outer .lg-toogle-thumb {
350
- background-color: #0D0A0A;
351
- border-radius: 2px 2px 0 0;
352
- color: #999;
353
- cursor: pointer;
354
- font-size: 24px;
355
- height: 39px;
356
- line-height: 27px;
357
- padding: 5px 0;
358
- position: absolute;
359
- right: 20px;
360
- text-align: center;
361
- top: -39px;
362
- width: 50px;
363
- }
364
- .lg-outer .lg-toogle-thumb:after {
365
- content: "\e1ff";
366
- }
367
- .lg-outer .lg-toogle-thumb:hover {
368
- color: #FFF;
369
- }
370
-
371
- .lg-outer .lg-video-cont {
372
- display: inline-block;
373
- vertical-align: middle;
374
- max-width: 1140px;
375
- max-height: 100%;
376
- width: 100%;
377
- padding: 0 5px;
378
- }
379
- .lg-outer .lg-video {
380
- width: 100%;
381
- height: 0;
382
- padding-bottom: 56.25%;
383
- overflow: hidden;
384
- position: relative;
385
- }
386
- .lg-outer .lg-video .lg-object {
387
- display: inline-block;
388
- position: absolute;
389
- top: 0;
390
- left: 0;
391
- width: 100% !important;
392
- height: 100% !important;
393
- }
394
- .lg-outer .lg-video .lg-video-play {
395
- width: 84px;
396
- height: 59px;
397
- position: absolute;
398
- left: 50%;
399
- top: 50%;
400
- margin-left: -42px;
401
- margin-top: -30px;
402
- z-index: 1080;
403
- cursor: pointer;
404
- }
405
- .lg-outer .lg-has-iframe .lg-video {
406
- -webkit-overflow-scrolling: touch;
407
- overflow: auto;
408
- }
409
- .lg-outer .lg-has-vimeo .lg-video-play {
410
- background: url("img/vimeo-play.png") no-repeat scroll 0 0 transparent;
411
- }
412
- .lg-outer .lg-has-vimeo:hover .lg-video-play {
413
- background: url("img/vimeo-play.png") no-repeat scroll 0 -58px transparent;
414
- }
415
- .lg-outer .lg-has-html5 .lg-video-play {
416
- background: transparent url("img/video-play.png") no-repeat scroll 0 0;
417
- height: 64px;
418
- margin-left: -32px;
419
- margin-top: -32px;
420
- width: 64px;
421
- opacity: 0.8;
422
- }
423
- .lg-outer .lg-has-html5:hover .lg-video-play {
424
- opacity: 1;
425
- }
426
- .lg-outer .lg-has-youtube .lg-video-play {
427
- background: url("img/youtube-play.png") no-repeat scroll 0 0 transparent;
428
- }
429
- .lg-outer .lg-has-youtube:hover .lg-video-play {
430
- background: url("img/youtube-play.png") no-repeat scroll 0 -60px transparent;
431
- }
432
- .lg-outer .lg-video-object {
433
- width: 100% !important;
434
- height: 100% !important;
435
- position: absolute;
436
- top: 0;
437
- left: 0;
438
- }
439
- .lg-outer .lg-has-video .lg-video-object {
440
- visibility: hidden;
441
- }
442
- .lg-outer .lg-has-video.lg-video-playing .lg-object, .lg-outer .lg-has-video.lg-video-playing .lg-video-play {
443
- display: none;
444
- }
445
- .lg-outer .lg-has-video.lg-video-playing .lg-video-object {
446
- visibility: visible;
447
- }
448
-
449
- .lg-progress-bar {
450
- background-color: #333;
451
- height: 5px;
452
- left: 0;
453
- position: absolute;
454
- top: 0;
455
- width: 100%;
456
- z-index: 1083;
457
- opacity: 0;
458
- -webkit-transition: opacity 0.08s ease 0s;
459
- -moz-transition: opacity 0.08s ease 0s;
460
- -o-transition: opacity 0.08s ease 0s;
461
- transition: opacity 0.08s ease 0s;
462
- }
463
- .lg-progress-bar .lg-progress {
464
- background-color: #a90707;
465
- height: 5px;
466
- width: 0;
467
- }
468
- .lg-progress-bar.lg-start .lg-progress {
469
- width: 100%;
470
- }
471
- .lg-show-autoplay .lg-progress-bar {
472
- opacity: 1;
473
- }
474
-
475
- .lg-autoplay-button:after {
476
- content: "\e01d";
477
- }
478
- .lg-show-autoplay .lg-autoplay-button:after {
479
- content: "\e01a";
480
- }
481
-
482
- .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap, .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image {
483
- -webkit-transition-duration: 0s;
484
- transition-duration: 0s;
485
- }
486
- .lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
487
- -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
488
- -moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
489
- -o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
490
- transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
491
- }
492
- .lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
493
- -webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
494
- -moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
495
- -o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
496
- transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
497
- }
498
- .lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
499
- -webkit-transform: translate3d(0, 0, 0);
500
- transform: translate3d(0, 0, 0);
501
- -webkit-backface-visibility: hidden;
502
- -moz-backface-visibility: hidden;
503
- backface-visibility: hidden;
504
- }
505
- .lg-outer .lg-item.lg-complete.lg-zoomable .lg-image {
506
- -webkit-transform: scale3d(1, 1, 1);
507
- transform: scale3d(1, 1, 1);
508
- -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
509
- -moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
510
- -o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
511
- transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
512
- -webkit-transform-origin: 0 0;
513
- -moz-transform-origin: 0 0;
514
- -ms-transform-origin: 0 0;
515
- transform-origin: 0 0;
516
- -webkit-backface-visibility: hidden;
517
- -moz-backface-visibility: hidden;
518
- backface-visibility: hidden;
519
- }
520
-
521
- #lg-zoom-in:after {
522
- content: "\e311";
523
- }
524
-
525
- #lg-actual-size {
526
- font-size: 20px;
527
- }
528
- #lg-actual-size:after {
529
- content: "\e033";
530
- }
531
-
532
- #lg-zoom-out {
533
- opacity: 0.5;
534
- pointer-events: none;
535
- }
536
- #lg-zoom-out:after {
537
- content: "\e312";
538
- }
539
- .lg-zoomed #lg-zoom-out {
540
- opacity: 1;
541
- pointer-events: auto;
542
- }
543
-
544
- .lg-outer .lg-pager-outer {
545
- bottom: 60px;
546
- left: 0;
547
- position: absolute;
548
- right: 0;
549
- text-align: center;
550
- z-index: 1080;
551
- height: 10px;
552
- }
553
- .lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont {
554
- overflow: visible;
555
- }
556
- .lg-outer .lg-pager-cont {
557
- cursor: pointer;
558
- display: inline-block;
559
- overflow: hidden;
560
- position: relative;
561
- vertical-align: top;
562
- margin: 0 5px;
563
- }
564
- .lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont {
565
- opacity: 1;
566
- -webkit-transform: translate3d(0, 0, 0);
567
- transform: translate3d(0, 0, 0);
568
- }
569
- .lg-outer .lg-pager-cont.lg-pager-active .lg-pager {
570
- box-shadow: 0 0 0 2px white inset;
571
- }
572
- .lg-outer .lg-pager-thumb-cont {
573
- background-color: #fff;
574
- color: #FFF;
575
- bottom: 100%;
576
- height: 83px;
577
- left: 0;
578
- margin-bottom: 20px;
579
- margin-left: -60px;
580
- opacity: 0;
581
- padding: 5px;
582
- position: absolute;
583
- width: 120px;
584
- border-radius: 3px;
585
- -webkit-transition: opacity 0.15s ease 0s, -webkit-transform 0.15s ease 0s;
586
- -moz-transition: opacity 0.15s ease 0s, -moz-transform 0.15s ease 0s;
587
- -o-transition: opacity 0.15s ease 0s, -o-transform 0.15s ease 0s;
588
- transition: opacity 0.15s ease 0s, transform 0.15s ease 0s;
589
- -webkit-transform: translate3d(0, 5px, 0);
590
- transform: translate3d(0, 5px, 0);
591
- }
592
- .lg-outer .lg-pager-thumb-cont img {
593
- width: 100%;
594
- height: 100%;
595
- }
596
- .lg-outer .lg-pager {
597
- background-color: rgba(255, 255, 255, 0.5);
598
- border-radius: 50%;
599
- box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.7) inset;
600
- display: block;
601
- height: 12px;
602
- -webkit-transition: box-shadow 0.3s ease 0s;
603
- -o-transition: box-shadow 0.3s ease 0s;
604
- transition: box-shadow 0.3s ease 0s;
605
- width: 12px;
606
- }
607
- .lg-outer .lg-pager:hover, .lg-outer .lg-pager:focus {
608
- box-shadow: 0 0 0 8px white inset;
609
- }
610
- .lg-outer .lg-caret {
611
- border-left: 10px solid transparent;
612
- border-right: 10px solid transparent;
613
- border-top: 10px dashed;
614
- bottom: -10px;
615
- display: inline-block;
616
- height: 0;
617
- left: 50%;
618
- margin-left: -5px;
619
- position: absolute;
620
- vertical-align: middle;
621
- width: 0;
622
- }
623
-
624
- .lg-fullscreen:after {
625
- content: "\e20c";
626
- }
627
- .lg-fullscreen-on .lg-fullscreen:after {
628
- content: "\e20d";
629
- }
630
-
631
- .lg-outer #lg-dropdown-overlay {
632
- background-color: rgba(0, 0, 0, 0.25);
633
- bottom: 0;
634
- cursor: default;
635
- left: 0;
636
- position: fixed;
637
- right: 0;
638
- top: 0;
639
- z-index: 1081;
640
- opacity: 0;
641
- visibility: hidden;
642
- -webkit-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
643
- -o-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
644
- transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
645
- }
646
- .lg-outer.lg-dropdown-active .lg-dropdown, .lg-outer.lg-dropdown-active #lg-dropdown-overlay {
647
- -webkit-transition-delay: 0s;
648
- transition-delay: 0s;
649
- -moz-transform: translate3d(0, 0px, 0);
650
- -o-transform: translate3d(0, 0px, 0);
651
- -ms-transform: translate3d(0, 0px, 0);
652
- -webkit-transform: translate3d(0, 0px, 0);
653
- transform: translate3d(0, 0px, 0);
654
- opacity: 1;
655
- visibility: visible;
656
- }
657
- .lg-outer.lg-dropdown-active #lg-share {
658
- color: #FFF;
659
- }
660
- .lg-outer .lg-dropdown {
661
- background-color: #fff;
662
- border-radius: 2px;
663
- font-size: 14px;
664
- list-style-type: none;
665
- margin: 0;
666
- padding: 10px 0;
667
- position: absolute;
668
- right: 0;
669
- text-align: left;
670
- top: 50px;
671
- opacity: 0;
672
- visibility: hidden;
673
- -moz-transform: translate3d(0, 5px, 0);
674
- -o-transform: translate3d(0, 5px, 0);
675
- -ms-transform: translate3d(0, 5px, 0);
676
- -webkit-transform: translate3d(0, 5px, 0);
677
- transform: translate3d(0, 5px, 0);
678
- -webkit-transition: -webkit-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
679
- -moz-transition: -moz-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
680
- -o-transition: -o-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
681
- transition: transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
682
- }
683
- .lg-outer .lg-dropdown:after {
684
- content: "";
685
- display: block;
686
- height: 0;
687
- width: 0;
688
- position: absolute;
689
- border: 8px solid transparent;
690
- border-bottom-color: #FFF;
691
- right: 16px;
692
- top: -16px;
693
- }
694
- .lg-outer .lg-dropdown > li:last-child {
695
- margin-bottom: 0px;
696
- }
697
- .lg-outer .lg-dropdown > li:hover a, .lg-outer .lg-dropdown > li:hover .lg-icon {
698
- color: #333;
699
- }
700
- .lg-outer .lg-dropdown a {
701
- color: #333;
702
- display: block;
703
- white-space: pre;
704
- padding: 4px 12px;
705
- font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
706
- font-size: 12px;
707
- }
708
- .lg-outer .lg-dropdown a:hover {
709
- background-color: rgba(0, 0, 0, 0.07);
710
- }
711
- .lg-outer .lg-dropdown .lg-dropdown-text {
712
- display: inline-block;
713
- line-height: 1;
714
- margin-top: -3px;
715
- vertical-align: middle;
716
- }
717
- .lg-outer .lg-dropdown .lg-icon {
718
- color: #333;
719
- display: inline-block;
720
- float: none;
721
- font-size: 20px;
722
- height: auto;
723
- line-height: 1;
724
- margin-right: 8px;
725
- padding: 0;
726
- vertical-align: middle;
727
- width: auto;
728
- }
729
- .lg-outer #lg-share {
730
- position: relative;
731
- }
732
- .lg-outer #lg-share:after {
733
- content: "\e80d";
734
- }
735
- .lg-outer #lg-share-facebook .lg-icon {
736
- color: #3b5998;
737
- }
738
- .lg-outer #lg-share-facebook .lg-icon:after {
739
- content: "\e901";
740
- }
741
- .lg-outer #lg-share-twitter .lg-icon {
742
- color: #00aced;
743
- }
744
- .lg-outer #lg-share-twitter .lg-icon:after {
745
- content: "\e904";
746
- }
747
- .lg-outer #lg-share-googleplus .lg-icon {
748
- color: #dd4b39;
749
- }
750
- .lg-outer #lg-share-googleplus .lg-icon:after {
751
- content: "\e902";
752
- }
753
- .lg-outer #lg-share-pinterest .lg-icon {
754
- color: #cb2027;
755
- }
756
- .lg-outer #lg-share-pinterest .lg-icon:after {
757
- content: "\e903";
758
- }
759
-
760
- .lg-group:after {
761
- content: "";
762
- display: table;
763
- clear: both;
764
- }
765
-
766
- .lg-outer {
767
- width: 100%;
768
- height: 100%;
769
- position: fixed;
770
- top: 0;
771
- left: 0;
772
- z-index: 1050;
773
- text-align: left;
774
- opacity: 0;
775
- -webkit-transition: opacity 0.15s ease 0s;
776
- -o-transition: opacity 0.15s ease 0s;
777
- transition: opacity 0.15s ease 0s;
778
- }
779
- .lg-outer * {
780
- -webkit-box-sizing: border-box;
781
- -moz-box-sizing: border-box;
782
- box-sizing: border-box;
783
- }
784
- .lg-outer.lg-visible {
785
- opacity: 1;
786
- }
787
- .lg-outer.lg-css3 .lg-item.lg-prev-slide, .lg-outer.lg-css3 .lg-item.lg-next-slide, .lg-outer.lg-css3 .lg-item.lg-current {
788
- -webkit-transition-duration: inherit !important;
789
- transition-duration: inherit !important;
790
- -webkit-transition-timing-function: inherit !important;
791
- transition-timing-function: inherit !important;
792
- }
793
- .lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-current {
794
- -webkit-transition-duration: 0s !important;
795
- transition-duration: 0s !important;
796
- opacity: 1;
797
- }
798
- .lg-outer.lg-grab img.lg-object {
799
- cursor: -webkit-grab;
800
- cursor: -moz-grab;
801
- cursor: -o-grab;
802
- cursor: -ms-grab;
803
- cursor: grab;
804
- }
805
- .lg-outer.lg-grabbing img.lg-object {
806
- cursor: move;
807
- cursor: -webkit-grabbing;
808
- cursor: -moz-grabbing;
809
- cursor: -o-grabbing;
810
- cursor: -ms-grabbing;
811
- cursor: grabbing;
812
- }
813
- .lg-outer .lg {
814
- height: 100%;
815
- width: 100%;
816
- position: relative;
817
- overflow: hidden;
818
- margin-left: auto;
819
- margin-right: auto;
820
- max-width: 100%;
821
- max-height: 100%;
822
- }
823
- .lg-outer .lg-inner {
824
- width: 100%;
825
- height: 100%;
826
- position: absolute;
827
- left: 0;
828
- top: 0;
829
- white-space: nowrap;
830
- }
831
- .lg-outer .lg-item {
832
- background: url("img/loading.gif") no-repeat scroll center center transparent;
833
- display: none !important;
834
- }
835
- .lg-outer.lg-css3 .lg-prev-slide, .lg-outer.lg-css3 .lg-current, .lg-outer.lg-css3 .lg-next-slide {
836
- display: inline-block !important;
837
- }
838
- .lg-outer.lg-css .lg-current {
839
- display: inline-block !important;
840
- }
841
- .lg-outer .lg-item, .lg-outer .lg-img-wrap {
842
- display: inline-block;
843
- text-align: center;
844
- position: absolute;
845
- width: 100%;
846
- height: 100%;
847
- }
848
- .lg-outer .lg-item:before, .lg-outer .lg-img-wrap:before {
849
- content: "";
850
- display: inline-block;
851
- height: 50%;
852
- width: 1px;
853
- margin-right: -1px;
854
- }
855
- .lg-outer .lg-img-wrap {
856
- position: absolute;
857
- padding: 0 5px;
858
- left: 0;
859
- right: 0;
860
- top: 0;
861
- bottom: 0;
862
- }
863
- .lg-outer .lg-item.lg-complete {
864
- background-image: none;
865
- }
866
- .lg-outer .lg-item.lg-current {
867
- z-index: 1060;
868
- }
869
- .lg-outer .lg-image {
870
- display: inline-block;
871
- vertical-align: middle;
872
- max-width: 100%;
873
- max-height: 100%;
874
- width: auto !important;
875
- height: auto !important;
876
- }
877
- .lg-outer.lg-show-after-load .lg-item .lg-object, .lg-outer.lg-show-after-load .lg-item .lg-video-play {
878
- opacity: 0;
879
- -webkit-transition: opacity 0.15s ease 0s;
880
- -o-transition: opacity 0.15s ease 0s;
881
- transition: opacity 0.15s ease 0s;
882
- }
883
- .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object, .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play {
884
- opacity: 1;
885
- }
886
- .lg-outer .lg-empty-html {
887
- display: none;
888
- }
889
- .lg-outer.lg-hide-download #lg-download {
890
- display: none;
891
- }
892
-
893
- .lg-backdrop {
894
- position: fixed;
895
- top: 0;
896
- left: 0;
897
- right: 0;
898
- bottom: 0;
899
- z-index: 1040;
900
- background-color: #000;
901
- opacity: 0;
902
- -webkit-transition: opacity 0.15s ease 0s;
903
- -o-transition: opacity 0.15s ease 0s;
904
- transition: opacity 0.15s ease 0s;
905
- }
906
- .lg-backdrop.in {
907
- opacity: 1;
908
- }
909
-
910
- .lg-css3.lg-no-trans .lg-prev-slide, .lg-css3.lg-no-trans .lg-next-slide, .lg-css3.lg-no-trans .lg-current {
911
- -webkit-transition: none 0s ease 0s !important;
912
- -moz-transition: none 0s ease 0s !important;
913
- -o-transition: none 0s ease 0s !important;
914
- transition: none 0s ease 0s !important;
915
- }
916
- .lg-css3.lg-use-css3 .lg-item {
917
- -webkit-backface-visibility: hidden;
918
- -moz-backface-visibility: hidden;
919
- backface-visibility: hidden;
920
- }
921
- .lg-css3.lg-use-left .lg-item {
922
- -webkit-backface-visibility: hidden;
923
- -moz-backface-visibility: hidden;
924
- backface-visibility: hidden;
925
- }
926
- .lg-css3.lg-fade .lg-item {
927
- opacity: 0;
928
- }
929
- .lg-css3.lg-fade .lg-item.lg-current {
930
- opacity: 1;
931
- }
932
- .lg-css3.lg-fade .lg-item.lg-prev-slide, .lg-css3.lg-fade .lg-item.lg-next-slide, .lg-css3.lg-fade .lg-item.lg-current {
933
- -webkit-transition: opacity 0.1s ease 0s;
934
- -moz-transition: opacity 0.1s ease 0s;
935
- -o-transition: opacity 0.1s ease 0s;
936
- transition: opacity 0.1s ease 0s;
937
- }
938
- .lg-css3.lg-slide.lg-use-css3 .lg-item {
939
- opacity: 0;
940
- }
941
- .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide {
942
- -webkit-transform: translate3d(-100%, 0, 0);
943
- transform: translate3d(-100%, 0, 0);
944
- }
945
- .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide {
946
- -webkit-transform: translate3d(100%, 0, 0);
947
- transform: translate3d(100%, 0, 0);
948
- }
949
- .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
950
- -webkit-transform: translate3d(0, 0, 0);
951
- transform: translate3d(0, 0, 0);
952
- opacity: 1;
953
- }
954
- .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
955
- -webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
956
- -moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
957
- -o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
958
- transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
959
- }
960
- .lg-css3.lg-slide.lg-use-left .lg-item {
961
- opacity: 0;
962
- position: absolute;
963
- left: 0;
964
- }
965
- .lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide {
966
- left: -100%;
967
- }
968
- .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide {
969
- left: 100%;
970
- }
971
- .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
972
- left: 0;
973
- opacity: 1;
974
- }
975
- .lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
976
- -webkit-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
977
- -moz-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
978
- -o-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
979
- transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
980
- }
981
-
982
- /*# sourceMappingURL=lightgallery.css.map */
1
+ /*! lightgallery - v1.6.12 - 2019-02-19
2
+ * http://sachinchoolur.github.io/lightGallery/
3
+ * Copyright (c) 2019 Sachin N; Licensed GPLv3 */
4
+ @font-face {
5
+ font-family: 'lg';
6
+ src: url("fonts/lg.eot?n1z373");
7
+ src: url("fonts/lg.eot?#iefixn1z373") format("embedded-opentype"), url("fonts/lg.woff?n1z373") format("woff"), url("fonts/lg.ttf?n1z373") format("truetype"), url("fonts/lg.svg?n1z373#lg") format("svg");
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+ .lg-icon {
12
+ font-family: 'lg';
13
+ speak: none;
14
+ font-style: normal;
15
+ font-weight: normal;
16
+ font-variant: normal;
17
+ text-transform: none;
18
+ line-height: 1;
19
+ /* Better Font Rendering =========== */
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
+ }
23
+
24
+ .lg-actions .lg-next, .lg-actions .lg-prev {
25
+ background-color: rgba(0, 0, 0, 0.45);
26
+ border-radius: 2px;
27
+ color: #999;
28
+ cursor: pointer;
29
+ display: block;
30
+ font-size: 22px;
31
+ margin-top: -10px;
32
+ padding: 8px 10px 9px;
33
+ position: absolute;
34
+ top: 50%;
35
+ z-index: 1080;
36
+ border: none;
37
+ outline: none;
38
+ }
39
+ .lg-actions .lg-next.disabled, .lg-actions .lg-prev.disabled {
40
+ pointer-events: none;
41
+ opacity: 0.5;
42
+ }
43
+ .lg-actions .lg-next:hover, .lg-actions .lg-prev:hover {
44
+ color: #FFF;
45
+ }
46
+ .lg-actions .lg-next {
47
+ right: 20px;
48
+ }
49
+ .lg-actions .lg-next:before {
50
+ content: "\e095";
51
+ }
52
+ .lg-actions .lg-prev {
53
+ left: 20px;
54
+ }
55
+ .lg-actions .lg-prev:after {
56
+ content: "\e094";
57
+ }
58
+
59
+ @-webkit-keyframes lg-right-end {
60
+ 0% {
61
+ left: 0;
62
+ }
63
+ 50% {
64
+ left: -30px;
65
+ }
66
+ 100% {
67
+ left: 0;
68
+ }
69
+ }
70
+ @-moz-keyframes lg-right-end {
71
+ 0% {
72
+ left: 0;
73
+ }
74
+ 50% {
75
+ left: -30px;
76
+ }
77
+ 100% {
78
+ left: 0;
79
+ }
80
+ }
81
+ @-ms-keyframes lg-right-end {
82
+ 0% {
83
+ left: 0;
84
+ }
85
+ 50% {
86
+ left: -30px;
87
+ }
88
+ 100% {
89
+ left: 0;
90
+ }
91
+ }
92
+ @keyframes lg-right-end {
93
+ 0% {
94
+ left: 0;
95
+ }
96
+ 50% {
97
+ left: -30px;
98
+ }
99
+ 100% {
100
+ left: 0;
101
+ }
102
+ }
103
+ @-webkit-keyframes lg-left-end {
104
+ 0% {
105
+ left: 0;
106
+ }
107
+ 50% {
108
+ left: 30px;
109
+ }
110
+ 100% {
111
+ left: 0;
112
+ }
113
+ }
114
+ @-moz-keyframes lg-left-end {
115
+ 0% {
116
+ left: 0;
117
+ }
118
+ 50% {
119
+ left: 30px;
120
+ }
121
+ 100% {
122
+ left: 0;
123
+ }
124
+ }
125
+ @-ms-keyframes lg-left-end {
126
+ 0% {
127
+ left: 0;
128
+ }
129
+ 50% {
130
+ left: 30px;
131
+ }
132
+ 100% {
133
+ left: 0;
134
+ }
135
+ }
136
+ @keyframes lg-left-end {
137
+ 0% {
138
+ left: 0;
139
+ }
140
+ 50% {
141
+ left: 30px;
142
+ }
143
+ 100% {
144
+ left: 0;
145
+ }
146
+ }
147
+ .lg-outer.lg-right-end .lg-object {
148
+ -webkit-animation: lg-right-end 0.3s;
149
+ -o-animation: lg-right-end 0.3s;
150
+ animation: lg-right-end 0.3s;
151
+ position: relative;
152
+ }
153
+ .lg-outer.lg-left-end .lg-object {
154
+ -webkit-animation: lg-left-end 0.3s;
155
+ -o-animation: lg-left-end 0.3s;
156
+ animation: lg-left-end 0.3s;
157
+ position: relative;
158
+ }
159
+
160
+ .lg-toolbar {
161
+ z-index: 1082;
162
+ left: 0;
163
+ position: absolute;
164
+ top: 0;
165
+ width: 100%;
166
+ background-color: rgba(0, 0, 0, 0.45);
167
+ }
168
+ .lg-toolbar .lg-icon {
169
+ color: #999;
170
+ cursor: pointer;
171
+ float: right;
172
+ font-size: 24px;
173
+ height: 47px;
174
+ line-height: 27px;
175
+ padding: 10px 0;
176
+ text-align: center;
177
+ width: 50px;
178
+ text-decoration: none !important;
179
+ outline: medium none;
180
+ -webkit-transition: color 0.2s linear;
181
+ -o-transition: color 0.2s linear;
182
+ transition: color 0.2s linear;
183
+ }
184
+ .lg-toolbar .lg-icon:hover {
185
+ color: #FFF;
186
+ }
187
+ .lg-toolbar .lg-close:after {
188
+ content: "\e070";
189
+ }
190
+ .lg-toolbar .lg-download:after {
191
+ content: "\e0f2";
192
+ }
193
+
194
+ .lg-sub-html {
195
+ background-color: rgba(0, 0, 0, 0.45);
196
+ bottom: 0;
197
+ color: #EEE;
198
+ font-size: 16px;
199
+ left: 0;
200
+ padding: 10px 40px;
201
+ position: fixed;
202
+ right: 0;
203
+ text-align: center;
204
+ z-index: 1080;
205
+ }
206
+ .lg-sub-html h4 {
207
+ margin: 0;
208
+ font-size: 13px;
209
+ font-weight: bold;
210
+ }
211
+ .lg-sub-html p {
212
+ font-size: 12px;
213
+ margin: 5px 0 0;
214
+ }
215
+
216
+ #lg-counter {
217
+ color: #999;
218
+ display: inline-block;
219
+ font-size: 16px;
220
+ padding-left: 20px;
221
+ padding-top: 12px;
222
+ vertical-align: middle;
223
+ }
224
+
225
+ .lg-toolbar, .lg-prev, .lg-next {
226
+ opacity: 1;
227
+ -webkit-transition: -webkit-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
228
+ -moz-transition: -moz-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
229
+ -o-transition: -o-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
230
+ transition: transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
231
+ }
232
+
233
+ .lg-hide-items .lg-prev {
234
+ opacity: 0;
235
+ -webkit-transform: translate3d(-10px, 0, 0);
236
+ transform: translate3d(-10px, 0, 0);
237
+ }
238
+ .lg-hide-items .lg-next {
239
+ opacity: 0;
240
+ -webkit-transform: translate3d(10px, 0, 0);
241
+ transform: translate3d(10px, 0, 0);
242
+ }
243
+ .lg-hide-items .lg-toolbar {
244
+ opacity: 0;
245
+ -webkit-transform: translate3d(0, -10px, 0);
246
+ transform: translate3d(0, -10px, 0);
247
+ }
248
+
249
+ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object {
250
+ -webkit-transform: scale3d(0.5, 0.5, 0.5);
251
+ transform: scale3d(0.5, 0.5, 0.5);
252
+ opacity: 0;
253
+ -webkit-transition: -webkit-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
254
+ -moz-transition: -moz-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
255
+ -o-transition: -o-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
256
+ transition: transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
257
+ -webkit-transform-origin: 50% 50%;
258
+ -moz-transform-origin: 50% 50%;
259
+ -ms-transform-origin: 50% 50%;
260
+ transform-origin: 50% 50%;
261
+ }
262
+ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object {
263
+ -webkit-transform: scale3d(1, 1, 1);
264
+ transform: scale3d(1, 1, 1);
265
+ opacity: 1;
266
+ }
267
+
268
+ .lg-outer .lg-thumb-outer {
269
+ background-color: #0D0A0A;
270
+ bottom: 0;
271
+ position: absolute;
272
+ width: 100%;
273
+ z-index: 1080;
274
+ max-height: 350px;
275
+ -webkit-transform: translate3d(0, 100%, 0);
276
+ transform: translate3d(0, 100%, 0);
277
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
278
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
279
+ -o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
280
+ transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
281
+ }
282
+ .lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item {
283
+ cursor: -webkit-grab;
284
+ cursor: -moz-grab;
285
+ cursor: -o-grab;
286
+ cursor: -ms-grab;
287
+ cursor: grab;
288
+ }
289
+ .lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item {
290
+ cursor: move;
291
+ cursor: -webkit-grabbing;
292
+ cursor: -moz-grabbing;
293
+ cursor: -o-grabbing;
294
+ cursor: -ms-grabbing;
295
+ cursor: grabbing;
296
+ }
297
+ .lg-outer .lg-thumb-outer.lg-dragging .lg-thumb {
298
+ -webkit-transition-duration: 0s !important;
299
+ transition-duration: 0s !important;
300
+ }
301
+ .lg-outer.lg-thumb-open .lg-thumb-outer {
302
+ -webkit-transform: translate3d(0, 0%, 0);
303
+ transform: translate3d(0, 0%, 0);
304
+ }
305
+ .lg-outer .lg-thumb {
306
+ padding: 10px 0;
307
+ height: 100%;
308
+ margin-bottom: -5px;
309
+ }
310
+ .lg-outer .lg-thumb-item {
311
+ border-radius: 5px;
312
+ cursor: pointer;
313
+ float: left;
314
+ overflow: hidden;
315
+ height: 100%;
316
+ border: 2px solid #FFF;
317
+ border-radius: 4px;
318
+ margin-bottom: 5px;
319
+ }
320
+ @media (min-width: 1025px) {
321
+ .lg-outer .lg-thumb-item {
322
+ -webkit-transition: border-color 0.25s ease;
323
+ -o-transition: border-color 0.25s ease;
324
+ transition: border-color 0.25s ease;
325
+ }
326
+ }
327
+ .lg-outer .lg-thumb-item.active, .lg-outer .lg-thumb-item:hover {
328
+ border-color: #a90707;
329
+ }
330
+ .lg-outer .lg-thumb-item img {
331
+ width: 100%;
332
+ height: 100%;
333
+ object-fit: cover;
334
+ }
335
+ .lg-outer.lg-has-thumb .lg-item {
336
+ padding-bottom: 120px;
337
+ }
338
+ .lg-outer.lg-can-toggle .lg-item {
339
+ padding-bottom: 0;
340
+ }
341
+ .lg-outer.lg-pull-caption-up .lg-sub-html {
342
+ -webkit-transition: bottom 0.25s ease;
343
+ -o-transition: bottom 0.25s ease;
344
+ transition: bottom 0.25s ease;
345
+ }
346
+ .lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html {
347
+ bottom: 100px;
348
+ }
349
+ .lg-outer .lg-toogle-thumb {
350
+ background-color: #0D0A0A;
351
+ border-radius: 2px 2px 0 0;
352
+ color: #999;
353
+ cursor: pointer;
354
+ font-size: 24px;
355
+ height: 39px;
356
+ line-height: 27px;
357
+ padding: 5px 0;
358
+ position: absolute;
359
+ right: 20px;
360
+ text-align: center;
361
+ top: -39px;
362
+ width: 50px;
363
+ }
364
+ .lg-outer .lg-toogle-thumb:after {
365
+ content: "\e1ff";
366
+ }
367
+ .lg-outer .lg-toogle-thumb:hover {
368
+ color: #FFF;
369
+ }
370
+
371
+ .lg-outer .lg-video-cont {
372
+ display: inline-block;
373
+ vertical-align: middle;
374
+ max-width: 1140px;
375
+ max-height: 100%;
376
+ width: 100%;
377
+ padding: 0 5px;
378
+ }
379
+ .lg-outer .lg-video {
380
+ width: 100%;
381
+ height: 0;
382
+ padding-bottom: 56.25%;
383
+ overflow: hidden;
384
+ position: relative;
385
+ }
386
+ .lg-outer .lg-video .lg-object {
387
+ display: inline-block;
388
+ position: absolute;
389
+ top: 0;
390
+ left: 0;
391
+ width: 100% !important;
392
+ height: 100% !important;
393
+ }
394
+ .lg-outer .lg-video .lg-video-play {
395
+ width: 84px;
396
+ height: 59px;
397
+ position: absolute;
398
+ left: 50%;
399
+ top: 50%;
400
+ margin-left: -42px;
401
+ margin-top: -30px;
402
+ z-index: 1080;
403
+ cursor: pointer;
404
+ }
405
+ .lg-outer .lg-has-iframe .lg-video {
406
+ -webkit-overflow-scrolling: touch;
407
+ overflow: auto;
408
+ }
409
+ .lg-outer .lg-has-vimeo .lg-video-play {
410
+ background: url("img/vimeo-play.png") no-repeat scroll 0 0 transparent;
411
+ }
412
+ .lg-outer .lg-has-vimeo:hover .lg-video-play {
413
+ background: url("img/vimeo-play.png") no-repeat scroll 0 -58px transparent;
414
+ }
415
+ .lg-outer .lg-has-html5 .lg-video-play {
416
+ background: transparent url("img/video-play.png") no-repeat scroll 0 0;
417
+ height: 64px;
418
+ margin-left: -32px;
419
+ margin-top: -32px;
420
+ width: 64px;
421
+ opacity: 0.8;
422
+ }
423
+ .lg-outer .lg-has-html5:hover .lg-video-play {
424
+ opacity: 1;
425
+ }
426
+ .lg-outer .lg-has-youtube .lg-video-play {
427
+ background: url("img/youtube-play.png") no-repeat scroll 0 0 transparent;
428
+ }
429
+ .lg-outer .lg-has-youtube:hover .lg-video-play {
430
+ background: url("img/youtube-play.png") no-repeat scroll 0 -60px transparent;
431
+ }
432
+ .lg-outer .lg-video-object {
433
+ width: 100% !important;
434
+ height: 100% !important;
435
+ position: absolute;
436
+ top: 0;
437
+ left: 0;
438
+ }
439
+ .lg-outer .lg-has-video .lg-video-object {
440
+ visibility: hidden;
441
+ }
442
+ .lg-outer .lg-has-video.lg-video-playing .lg-object, .lg-outer .lg-has-video.lg-video-playing .lg-video-play {
443
+ display: none;
444
+ }
445
+ .lg-outer .lg-has-video.lg-video-playing .lg-video-object {
446
+ visibility: visible;
447
+ }
448
+
449
+ .lg-progress-bar {
450
+ background-color: #333;
451
+ height: 5px;
452
+ left: 0;
453
+ position: absolute;
454
+ top: 0;
455
+ width: 100%;
456
+ z-index: 1083;
457
+ opacity: 0;
458
+ -webkit-transition: opacity 0.08s ease 0s;
459
+ -moz-transition: opacity 0.08s ease 0s;
460
+ -o-transition: opacity 0.08s ease 0s;
461
+ transition: opacity 0.08s ease 0s;
462
+ }
463
+ .lg-progress-bar .lg-progress {
464
+ background-color: #a90707;
465
+ height: 5px;
466
+ width: 0;
467
+ }
468
+ .lg-progress-bar.lg-start .lg-progress {
469
+ width: 100%;
470
+ }
471
+ .lg-show-autoplay .lg-progress-bar {
472
+ opacity: 1;
473
+ }
474
+
475
+ .lg-autoplay-button:after {
476
+ content: "\e01d";
477
+ }
478
+ .lg-show-autoplay .lg-autoplay-button:after {
479
+ content: "\e01a";
480
+ }
481
+
482
+ .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap, .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image {
483
+ -webkit-transition-duration: 0s;
484
+ transition-duration: 0s;
485
+ }
486
+ .lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
487
+ -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
488
+ -moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
489
+ -o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
490
+ transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
491
+ }
492
+ .lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
493
+ -webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
494
+ -moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
495
+ -o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
496
+ transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
497
+ }
498
+ .lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
499
+ -webkit-transform: translate3d(0, 0, 0);
500
+ transform: translate3d(0, 0, 0);
501
+ -webkit-backface-visibility: hidden;
502
+ -moz-backface-visibility: hidden;
503
+ backface-visibility: hidden;
504
+ }
505
+ .lg-outer .lg-item.lg-complete.lg-zoomable .lg-image {
506
+ -webkit-transform: scale3d(1, 1, 1);
507
+ transform: scale3d(1, 1, 1);
508
+ -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
509
+ -moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
510
+ -o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
511
+ transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
512
+ -webkit-transform-origin: 0 0;
513
+ -moz-transform-origin: 0 0;
514
+ -ms-transform-origin: 0 0;
515
+ transform-origin: 0 0;
516
+ -webkit-backface-visibility: hidden;
517
+ -moz-backface-visibility: hidden;
518
+ backface-visibility: hidden;
519
+ }
520
+
521
+ #lg-zoom-in:after {
522
+ content: "\e311";
523
+ }
524
+
525
+ #lg-actual-size {
526
+ font-size: 20px;
527
+ }
528
+ #lg-actual-size:after {
529
+ content: "\e033";
530
+ }
531
+
532
+ #lg-zoom-out {
533
+ opacity: 0.5;
534
+ pointer-events: none;
535
+ }
536
+ #lg-zoom-out:after {
537
+ content: "\e312";
538
+ }
539
+ .lg-zoomed #lg-zoom-out {
540
+ opacity: 1;
541
+ pointer-events: auto;
542
+ }
543
+
544
+ .lg-outer .lg-pager-outer {
545
+ bottom: 60px;
546
+ left: 0;
547
+ position: absolute;
548
+ right: 0;
549
+ text-align: center;
550
+ z-index: 1080;
551
+ height: 10px;
552
+ }
553
+ .lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont {
554
+ overflow: visible;
555
+ }
556
+ .lg-outer .lg-pager-cont {
557
+ cursor: pointer;
558
+ display: inline-block;
559
+ overflow: hidden;
560
+ position: relative;
561
+ vertical-align: top;
562
+ margin: 0 5px;
563
+ }
564
+ .lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont {
565
+ opacity: 1;
566
+ -webkit-transform: translate3d(0, 0, 0);
567
+ transform: translate3d(0, 0, 0);
568
+ }
569
+ .lg-outer .lg-pager-cont.lg-pager-active .lg-pager {
570
+ box-shadow: 0 0 0 2px white inset;
571
+ }
572
+ .lg-outer .lg-pager-thumb-cont {
573
+ background-color: #fff;
574
+ color: #FFF;
575
+ bottom: 100%;
576
+ height: 83px;
577
+ left: 0;
578
+ margin-bottom: 20px;
579
+ margin-left: -60px;
580
+ opacity: 0;
581
+ padding: 5px;
582
+ position: absolute;
583
+ width: 120px;
584
+ border-radius: 3px;
585
+ -webkit-transition: opacity 0.15s ease 0s, -webkit-transform 0.15s ease 0s;
586
+ -moz-transition: opacity 0.15s ease 0s, -moz-transform 0.15s ease 0s;
587
+ -o-transition: opacity 0.15s ease 0s, -o-transform 0.15s ease 0s;
588
+ transition: opacity 0.15s ease 0s, transform 0.15s ease 0s;
589
+ -webkit-transform: translate3d(0, 5px, 0);
590
+ transform: translate3d(0, 5px, 0);
591
+ }
592
+ .lg-outer .lg-pager-thumb-cont img {
593
+ width: 100%;
594
+ height: 100%;
595
+ }
596
+ .lg-outer .lg-pager {
597
+ background-color: rgba(255, 255, 255, 0.5);
598
+ border-radius: 50%;
599
+ box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.7) inset;
600
+ display: block;
601
+ height: 12px;
602
+ -webkit-transition: box-shadow 0.3s ease 0s;
603
+ -o-transition: box-shadow 0.3s ease 0s;
604
+ transition: box-shadow 0.3s ease 0s;
605
+ width: 12px;
606
+ }
607
+ .lg-outer .lg-pager:hover, .lg-outer .lg-pager:focus {
608
+ box-shadow: 0 0 0 8px white inset;
609
+ }
610
+ .lg-outer .lg-caret {
611
+ border-left: 10px solid transparent;
612
+ border-right: 10px solid transparent;
613
+ border-top: 10px dashed;
614
+ bottom: -10px;
615
+ display: inline-block;
616
+ height: 0;
617
+ left: 50%;
618
+ margin-left: -5px;
619
+ position: absolute;
620
+ vertical-align: middle;
621
+ width: 0;
622
+ }
623
+
624
+ .lg-fullscreen:after {
625
+ content: "\e20c";
626
+ }
627
+ .lg-fullscreen-on .lg-fullscreen:after {
628
+ content: "\e20d";
629
+ }
630
+
631
+ .lg-outer #lg-dropdown-overlay {
632
+ background-color: rgba(0, 0, 0, 0.25);
633
+ bottom: 0;
634
+ cursor: default;
635
+ left: 0;
636
+ position: fixed;
637
+ right: 0;
638
+ top: 0;
639
+ z-index: 1081;
640
+ opacity: 0;
641
+ visibility: hidden;
642
+ -webkit-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
643
+ -o-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
644
+ transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
645
+ }
646
+ .lg-outer.lg-dropdown-active .lg-dropdown, .lg-outer.lg-dropdown-active #lg-dropdown-overlay {
647
+ -webkit-transition-delay: 0s;
648
+ transition-delay: 0s;
649
+ -moz-transform: translate3d(0, 0px, 0);
650
+ -o-transform: translate3d(0, 0px, 0);
651
+ -ms-transform: translate3d(0, 0px, 0);
652
+ -webkit-transform: translate3d(0, 0px, 0);
653
+ transform: translate3d(0, 0px, 0);
654
+ opacity: 1;
655
+ visibility: visible;
656
+ }
657
+ .lg-outer.lg-dropdown-active #lg-share {
658
+ color: #FFF;
659
+ }
660
+ .lg-outer .lg-dropdown {
661
+ background-color: #fff;
662
+ border-radius: 2px;
663
+ font-size: 14px;
664
+ list-style-type: none;
665
+ margin: 0;
666
+ padding: 10px 0;
667
+ position: absolute;
668
+ right: 0;
669
+ text-align: left;
670
+ top: 50px;
671
+ opacity: 0;
672
+ visibility: hidden;
673
+ -moz-transform: translate3d(0, 5px, 0);
674
+ -o-transform: translate3d(0, 5px, 0);
675
+ -ms-transform: translate3d(0, 5px, 0);
676
+ -webkit-transform: translate3d(0, 5px, 0);
677
+ transform: translate3d(0, 5px, 0);
678
+ -webkit-transition: -webkit-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
679
+ -moz-transition: -moz-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
680
+ -o-transition: -o-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
681
+ transition: transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
682
+ }
683
+ .lg-outer .lg-dropdown:after {
684
+ content: "";
685
+ display: block;
686
+ height: 0;
687
+ width: 0;
688
+ position: absolute;
689
+ border: 8px solid transparent;
690
+ border-bottom-color: #FFF;
691
+ right: 16px;
692
+ top: -16px;
693
+ }
694
+ .lg-outer .lg-dropdown > li:last-child {
695
+ margin-bottom: 0px;
696
+ }
697
+ .lg-outer .lg-dropdown > li:hover a, .lg-outer .lg-dropdown > li:hover .lg-icon {
698
+ color: #333;
699
+ }
700
+ .lg-outer .lg-dropdown a {
701
+ color: #333;
702
+ display: block;
703
+ white-space: pre;
704
+ padding: 4px 12px;
705
+ font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
706
+ font-size: 12px;
707
+ }
708
+ .lg-outer .lg-dropdown a:hover {
709
+ background-color: rgba(0, 0, 0, 0.07);
710
+ }
711
+ .lg-outer .lg-dropdown .lg-dropdown-text {
712
+ display: inline-block;
713
+ line-height: 1;
714
+ margin-top: -3px;
715
+ vertical-align: middle;
716
+ }
717
+ .lg-outer .lg-dropdown .lg-icon {
718
+ color: #333;
719
+ display: inline-block;
720
+ float: none;
721
+ font-size: 20px;
722
+ height: auto;
723
+ line-height: 1;
724
+ margin-right: 8px;
725
+ padding: 0;
726
+ vertical-align: middle;
727
+ width: auto;
728
+ }
729
+ .lg-outer #lg-share {
730
+ position: relative;
731
+ }
732
+ .lg-outer #lg-share:after {
733
+ content: "\e80d";
734
+ }
735
+ .lg-outer #lg-share-facebook .lg-icon {
736
+ color: #3b5998;
737
+ }
738
+ .lg-outer #lg-share-facebook .lg-icon:after {
739
+ content: "\e901";
740
+ }
741
+ .lg-outer #lg-share-twitter .lg-icon {
742
+ color: #00aced;
743
+ }
744
+ .lg-outer #lg-share-twitter .lg-icon:after {
745
+ content: "\e904";
746
+ }
747
+ .lg-outer #lg-share-googleplus .lg-icon {
748
+ color: #dd4b39;
749
+ }
750
+ .lg-outer #lg-share-googleplus .lg-icon:after {
751
+ content: "\e902";
752
+ }
753
+ .lg-outer #lg-share-pinterest .lg-icon {
754
+ color: #cb2027;
755
+ }
756
+ .lg-outer #lg-share-pinterest .lg-icon:after {
757
+ content: "\e903";
758
+ }
759
+
760
+ .lg-group:after {
761
+ content: "";
762
+ display: table;
763
+ clear: both;
764
+ }
765
+
766
+ .lg-outer {
767
+ width: 100%;
768
+ height: 100%;
769
+ position: fixed;
770
+ top: 0;
771
+ left: 0;
772
+ z-index: 1050;
773
+ text-align: left;
774
+ opacity: 0;
775
+ -webkit-transition: opacity 0.15s ease 0s;
776
+ -o-transition: opacity 0.15s ease 0s;
777
+ transition: opacity 0.15s ease 0s;
778
+ }
779
+ .lg-outer * {
780
+ -webkit-box-sizing: border-box;
781
+ -moz-box-sizing: border-box;
782
+ box-sizing: border-box;
783
+ }
784
+ .lg-outer.lg-visible {
785
+ opacity: 1;
786
+ }
787
+ .lg-outer.lg-css3 .lg-item.lg-prev-slide, .lg-outer.lg-css3 .lg-item.lg-next-slide, .lg-outer.lg-css3 .lg-item.lg-current {
788
+ -webkit-transition-duration: inherit !important;
789
+ transition-duration: inherit !important;
790
+ -webkit-transition-timing-function: inherit !important;
791
+ transition-timing-function: inherit !important;
792
+ }
793
+ .lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-current {
794
+ -webkit-transition-duration: 0s !important;
795
+ transition-duration: 0s !important;
796
+ opacity: 1;
797
+ }
798
+ .lg-outer.lg-grab img.lg-object {
799
+ cursor: -webkit-grab;
800
+ cursor: -moz-grab;
801
+ cursor: -o-grab;
802
+ cursor: -ms-grab;
803
+ cursor: grab;
804
+ }
805
+ .lg-outer.lg-grabbing img.lg-object {
806
+ cursor: move;
807
+ cursor: -webkit-grabbing;
808
+ cursor: -moz-grabbing;
809
+ cursor: -o-grabbing;
810
+ cursor: -ms-grabbing;
811
+ cursor: grabbing;
812
+ }
813
+ .lg-outer .lg {
814
+ height: 100%;
815
+ width: 100%;
816
+ position: relative;
817
+ overflow: hidden;
818
+ margin-left: auto;
819
+ margin-right: auto;
820
+ max-width: 100%;
821
+ max-height: 100%;
822
+ }
823
+ .lg-outer .lg-inner {
824
+ width: 100%;
825
+ height: 100%;
826
+ position: absolute;
827
+ left: 0;
828
+ top: 0;
829
+ white-space: nowrap;
830
+ }
831
+ .lg-outer .lg-item {
832
+ background: url("img/loading.gif") no-repeat scroll center center transparent;
833
+ display: none !important;
834
+ }
835
+ .lg-outer.lg-css3 .lg-prev-slide, .lg-outer.lg-css3 .lg-current, .lg-outer.lg-css3 .lg-next-slide {
836
+ display: inline-block !important;
837
+ }
838
+ .lg-outer.lg-css .lg-current {
839
+ display: inline-block !important;
840
+ }
841
+ .lg-outer .lg-item, .lg-outer .lg-img-wrap {
842
+ display: inline-block;
843
+ text-align: center;
844
+ position: absolute;
845
+ width: 100%;
846
+ height: 100%;
847
+ }
848
+ .lg-outer .lg-item:before, .lg-outer .lg-img-wrap:before {
849
+ content: "";
850
+ display: inline-block;
851
+ height: 50%;
852
+ width: 1px;
853
+ margin-right: -1px;
854
+ }
855
+ .lg-outer .lg-img-wrap {
856
+ position: absolute;
857
+ padding: 0 5px;
858
+ left: 0;
859
+ right: 0;
860
+ top: 0;
861
+ bottom: 0;
862
+ }
863
+ .lg-outer .lg-item.lg-complete {
864
+ background-image: none;
865
+ }
866
+ .lg-outer .lg-item.lg-current {
867
+ z-index: 1060;
868
+ }
869
+ .lg-outer .lg-image {
870
+ display: inline-block;
871
+ vertical-align: middle;
872
+ max-width: 100%;
873
+ max-height: 100%;
874
+ width: auto !important;
875
+ height: auto !important;
876
+ }
877
+ .lg-outer.lg-show-after-load .lg-item .lg-object, .lg-outer.lg-show-after-load .lg-item .lg-video-play {
878
+ opacity: 0;
879
+ -webkit-transition: opacity 0.15s ease 0s;
880
+ -o-transition: opacity 0.15s ease 0s;
881
+ transition: opacity 0.15s ease 0s;
882
+ }
883
+ .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object, .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play {
884
+ opacity: 1;
885
+ }
886
+ .lg-outer .lg-empty-html {
887
+ display: none;
888
+ }
889
+ .lg-outer.lg-hide-download #lg-download {
890
+ display: none;
891
+ }
892
+
893
+ .lg-backdrop {
894
+ position: fixed;
895
+ top: 0;
896
+ left: 0;
897
+ right: 0;
898
+ bottom: 0;
899
+ z-index: 1040;
900
+ background-color: #000;
901
+ opacity: 0;
902
+ -webkit-transition: opacity 0.15s ease 0s;
903
+ -o-transition: opacity 0.15s ease 0s;
904
+ transition: opacity 0.15s ease 0s;
905
+ }
906
+ .lg-backdrop.in {
907
+ opacity: 1;
908
+ }
909
+
910
+ .lg-css3.lg-no-trans .lg-prev-slide, .lg-css3.lg-no-trans .lg-next-slide, .lg-css3.lg-no-trans .lg-current {
911
+ -webkit-transition: none 0s ease 0s !important;
912
+ -moz-transition: none 0s ease 0s !important;
913
+ -o-transition: none 0s ease 0s !important;
914
+ transition: none 0s ease 0s !important;
915
+ }
916
+ .lg-css3.lg-use-css3 .lg-item {
917
+ -webkit-backface-visibility: hidden;
918
+ -moz-backface-visibility: hidden;
919
+ backface-visibility: hidden;
920
+ }
921
+ .lg-css3.lg-use-left .lg-item {
922
+ -webkit-backface-visibility: hidden;
923
+ -moz-backface-visibility: hidden;
924
+ backface-visibility: hidden;
925
+ }
926
+ .lg-css3.lg-fade .lg-item {
927
+ opacity: 0;
928
+ }
929
+ .lg-css3.lg-fade .lg-item.lg-current {
930
+ opacity: 1;
931
+ }
932
+ .lg-css3.lg-fade .lg-item.lg-prev-slide, .lg-css3.lg-fade .lg-item.lg-next-slide, .lg-css3.lg-fade .lg-item.lg-current {
933
+ -webkit-transition: opacity 0.1s ease 0s;
934
+ -moz-transition: opacity 0.1s ease 0s;
935
+ -o-transition: opacity 0.1s ease 0s;
936
+ transition: opacity 0.1s ease 0s;
937
+ }
938
+ .lg-css3.lg-slide.lg-use-css3 .lg-item {
939
+ opacity: 0;
940
+ }
941
+ .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide {
942
+ -webkit-transform: translate3d(-100%, 0, 0);
943
+ transform: translate3d(-100%, 0, 0);
944
+ }
945
+ .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide {
946
+ -webkit-transform: translate3d(100%, 0, 0);
947
+ transform: translate3d(100%, 0, 0);
948
+ }
949
+ .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
950
+ -webkit-transform: translate3d(0, 0, 0);
951
+ transform: translate3d(0, 0, 0);
952
+ opacity: 1;
953
+ }
954
+ .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
955
+ -webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
956
+ -moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
957
+ -o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
958
+ transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
959
+ }
960
+ .lg-css3.lg-slide.lg-use-left .lg-item {
961
+ opacity: 0;
962
+ position: absolute;
963
+ left: 0;
964
+ }
965
+ .lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide {
966
+ left: -100%;
967
+ }
968
+ .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide {
969
+ left: 100%;
970
+ }
971
+ .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
972
+ left: 0;
973
+ opacity: 1;
974
+ }
975
+ .lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
976
+ -webkit-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
977
+ -moz-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
978
+ -o-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
979
+ transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
980
+ }
981
+
982
+ /*# sourceMappingURL=lightgallery.css.map */
assets/js/admin/wp-color-picker-alpha.min.js CHANGED
@@ -1,11 +1,11 @@
1
- /**!
2
- * wp-color-picker-alpha
3
- *
4
- * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
5
- * Only run in input and is defined data alpha in true
6
- *
7
- * Version: 2.1.4
8
- * https://github.com/kallookoo/wp-color-picker-alpha
9
- * Licensed under the GPLv2 license or later.
10
- */
11
- !function(t){if(!t.wp.wpColorPicker.prototype._hasAlpha){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='<div class="wp-picker-holder" />',e='<div class="wp-picker-container" />',a='<input type="button" class="button button-small" />',i=void 0!==wpColorPickerL10n.current;if(i)var n='<a tabindex="0" class="wp-color-result" />';else{n='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>';var l="<label></label>",s='<span class="screen-reader-text"></span>'}Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),i?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(a).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(a)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),i||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),i||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),i?c.wrap('<span class="wp-picker-input-wrap" />').after(p.button):(p.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),i?p.toggler.html('<span class="color-alpha" />'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('<span class="color-alpha" />')),p.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r),o.element.trigger("change")):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(o.picker.find(".iris-picker-inner")),a={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(a,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var i=o.picker.width()-o.controls.square.width()-20,n=i/6,l=i/2-n;t.each(["aContainer","strip"],function(t,r){o.controls[r].width(l).css({"margin-left":n+"px"})}),o._initControls(),o._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,r){t._color._alpha=parseFloat(r.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,r=t.element;if(this.options.alpha){var e=t.controls,a=parseInt(100*t._color._alpha),i=t._color.toRgb(),n=["rgb("+i.r+","+i.g+","+i.b+") 0%","rgba("+i.r+","+i.g+","+i.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(e.aSlider.slider("value",a),t._color._alpha<1?(e.strip.attr("style",e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),r.width(parseInt(l+s))):r.width(l))}(r.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()}),r.trigger("change")},_addInputListeners:function(t){var o=this,r=function(r){var e=new Color(t.val()),a=t.val();t.removeClass("iris-error"),e.error?""!==a&&t.addClass("iris-error"):e.toString()!==o._color.toString()&&("keyup"===r.type&&a.match(/^[0-9a-fA-F]{3}$/)||o._setOption("color",e.toString()))};t.on("change",r).on("keyup",o._debounce(r,100)),o.options.hide&&t.on("focus",function(){o.show()})}})}}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});
1
+ /**!
2
+ * wp-color-picker-alpha
3
+ *
4
+ * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
5
+ * Only run in input and is defined data alpha in true
6
+ *
7
+ * Version: 2.1.4
8
+ * https://github.com/kallookoo/wp-color-picker-alpha
9
+ * Licensed under the GPLv2 license or later.
10
+ */
11
+ !function(t){if(!t.wp.wpColorPicker.prototype._hasAlpha){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='<div class="wp-picker-holder" />',e='<div class="wp-picker-container" />',a='<input type="button" class="button button-small" />',i=void 0!==wpColorPickerL10n.current;if(i)var n='<a tabindex="0" class="wp-color-result" />';else{n='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>';var l="<label></label>",s='<span class="screen-reader-text"></span>'}Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),i?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(a).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(a)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),i||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),i||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),i?c.wrap('<span class="wp-picker-input-wrap" />').after(p.button):(p.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),i?p.toggler.html('<span class="color-alpha" />'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('<span class="color-alpha" />')),p.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r),o.element.trigger("change")):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(o.picker.find(".iris-picker-inner")),a={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(a,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var i=o.picker.width()-o.controls.square.width()-20,n=i/6,l=i/2-n;t.each(["aContainer","strip"],function(t,r){o.controls[r].width(l).css({"margin-left":n+"px"})}),o._initControls(),o._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,r){t._color._alpha=parseFloat(r.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,r=t.element;if(this.options.alpha){var e=t.controls,a=parseInt(100*t._color._alpha),i=t._color.toRgb(),n=["rgb("+i.r+","+i.g+","+i.b+") 0%","rgba("+i.r+","+i.g+","+i.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(e.aSlider.slider("value",a),t._color._alpha<1?(e.strip.attr("style",e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),r.width(parseInt(l+s))):r.width(l))}(r.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()}),r.trigger("change")},_addInputListeners:function(t){var o=this,r=function(r){var e=new Color(t.val()),a=t.val();t.removeClass("iris-error"),e.error?""!==a&&t.addClass("iris-error"):e.toString()!==o._color.toString()&&("keyup"===r.type&&a.match(/^[0-9a-fA-F]{3}$/)||o._setOption("color",e.toString()))};t.on("change",r).on("keyup",o._debounce(r,100)),o.options.hide&&t.on("focus",function(){o.show()})}})}}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});
assets/js/lib/flipster/jquery.flipster.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! jQuery.Flipster, v1.1.5 (built 2020-10-17) */
2
-
3
  !function(P,t,D){"use strict";function L(n,i){var a=null;return function(){var t=this,e=arguments;null===a&&(a=setTimeout(function(){n.apply(t,e),a=null},i))}}var r,e=(r={},function(t){if(r[t]!==D)return r[t];var e=document.createElement("div").style,n=t.charAt(0).toUpperCase()+t.slice(1),i=(t+" "+["webkit","moz","ms","o"].join(n+" ")+n).split(" ");for(var a in i)if(i[a]in e)return r[t]=i[a];return r[t]=!1}),a="http://www.w3.org/2000/svg",E=P(t),M=e("transform"),i={itemContainer:"ul",itemSelector:"li",start:"center",fadeIn:400,loop:!1,autoplay:!1,pauseOnHover:!0,style:"coverflow",spacing:-.6,click:!0,keyboard:!0,scrollwheel:!0,touch:!0,nav:!1,buttons:!1,buttonPrev:"Previous",buttonNext:"Next",onItemSwitch:!1},T={main:"flipster",active:"flipster--active",container:"flipster__container",nav:"flipster__nav",navChild:"flipster__nav__child",navItem:"flipster__nav__item",navLink:"flipster__nav__link",navCurrent:"flipster__nav__item--current",navCategory:"flipster__nav__item--category",navCategoryLink:"flipster__nav__link--category",button:"flipster__button",buttonPrev:"flipster__button--prev",buttonNext:"flipster__button--next",item:"flipster__item",itemCurrent:"flipster__item--current",itemPast:"flipster__item--past",itemFuture:"flipster__item--future",itemContent:"flipster__item__content"},X=new RegExp("\\b("+T.itemCurrent+"|"+T.itemPast+"|"+T.itemFuture+")(.*?)(\\s|$)","g"),j=new RegExp("\\s\\s+","g");P.fn.flipster=function(e){if("string"==typeof e){var n=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=P(this).data("methods");return t[e]?t[e].apply(this,n):this})}var I=P.extend({},i,e);return this.each(function(){var t,f,r,n,p,s,l,c,u,v=P(this),o=[],h=0,d=!1,e=!1;function i(e){return e=e||"next",P('<button class="'+T.button+" "+("next"===e?T.buttonNext:T.buttonPrev)+'" role="button" />').html((n="next"===(t=e)?I.buttonNext:I.buttonPrev,"custom"===I.buttons?n:'<svg viewBox="0 0 13 20" xmlns="'+a+'" aria-labelledby="title"><title>'+n+'</title><polyline points="10,3 3,10 10,17"'+("next"===t?' transform="rotate(180 6.5,10)"':"")+"/></svg>")).on("click",function(t){y(e),t.preventDefault()});var t,n}function m(){v.css("transition",""),f.css("transition",""),p.css("transition","")}function g(a){var t,e;a&&(v.css("transition","none"),f.css("transition","none"),p.css("transition","none")),r=f.width(),f.height((e=0,p.each(function(){t=P(this).height(),e<t&&(e=t)}),e)),r?(n&&(clearInterval(n),n=!1),p.each(function(t){var e,n,i=P(this);i.attr("class",function(t,e){return e&&e.replace(X,"").replace(j," ")}),e=i.outerWidth(),0!==I.spacing&&i.css("margin-right",e*I.spacing+"px"),n=i.position().left,o[t]=-1*(n+e/2-r/2),t===p.length-1&&(_(),a&&setTimeout(m,1))})):n=n||setInterval(function(){g(a)},500)}function _(){var e,n,i,a=p.length;p.each(function(t){e=P(this),n=" ",i=t===h?(n+=T.itemCurrent,a+1):t<h?(n+=T.itemPast+" "+T.itemPast+"-"+(h-t),a-(h-t)):(n+=T.itemFuture+" "+T.itemFuture+"-"+(t-h),a-(t-h)),e.css("z-index",i).attr("class",function(t,e){return e&&e.replace(X,"").replace(j," ")+n})}),0<=h&&(r&&o[h]!==D||g(!0),M?f.css("transform","translateX("+o[h]+"px)"):f.css({left:o[h]+"px"})),function(){if(I.nav){var t=s.data("flip-category");c.removeClass(T.navCurrent),u.filter(function(){return P(this).data("index")===h||t&&P(this).data("category")===t}).parent().addClass(T.navCurrent)}}()}function y(t){var e=h;if(!(p.length<=1))return"prev"===t?0<h?h--:I.loop&&(h=p.length-1):"next"===t?h<p.length-1?h++:I.loop&&(h=0):"number"==typeof t?h=t:t!==D&&(h=p.index(t),I.loop&&e!=h&&(e==p.length-1&&h!=p.length-2&&(h=0),0==e&&1!=h&&(h=p.length-1))),s=p.eq(h),h!==e&&I.onItemSwitch&&I.onItemSwitch.call(v,p[h],p[e]),_(),v}function b(t){return I.autoplay=t||I.autoplay,clearInterval(d),d=setInterval(function(){var t=h;y("next"),t!==h||I.loop||clearInterval(d)},I.autoplay),v}function x(){return clearInterval(d),d=0,v}function w(t){return x(),I.autoplay&&t&&(d=-1),v}function C(){g(!0),v.hide().css("visibility","").addClass(T.active).fadeIn(I.fadeIn)}function k(){var o;if(f=v.find(I.itemContainer).addClass(T.container),!((p=f.find(I.itemSelector)).length<=1))return p.addClass(T.item).each(function(){var t=P(this);t.children("."+T.itemContent).length||t.wrapInner('<div class="'+T.itemContent+'" />')}),I.click&&p.on("click.flipster touchend.flipster",function(t){e||(P(this).hasClass(T.itemCurrent)||t.preventDefault(),y(this))}),I.buttons&&1<p.length&&(v.find("."+T.button).remove(),v.append(i("prev"),i("next"))),o={},!I.nav||p.length<=1||(l&&l.remove(),l=P('<ul class="'+T.nav+'" role="navigation" />'),u=P(""),p.each(function(t){var e=P(this),n=e.data("flip-category"),i=e.data("flip-title")||e.attr("title")||t,a=P('<a href="#" class="'+T.navLink+'">'+i+"</a>").data("index",t);if(u=u.add(a),n){if(!o[n]){var r=P('<li class="'+T.navItem+" "+T.navCategory+'">'),s=P('<a href="#" class="'+T.navLink+" "+T.navCategoryLink+'" data-flip-category="'+n+'">'+n+"</a>").data("category",n).data("index",t);o[n]=P('<ul class="'+T.navChild+'" />'),u=u.add(s),r.append(s,o[n]).appendTo(l)}o[n].append(a)}else l.append(a);a.wrap('<li class="'+T.navItem+'">')}),l.on("click","a",function(t){var e=P(this).data("index");0<=e&&(y(e),t.preventDefault())}),"after"===I.nav?v.append(l):v.prepend(l),c=l.find("."+T.navItem)),0<=h&&y(h),v}t={jump:y,next:function(){return y("next")},prev:function(){return y("prev")},play:b,stop:x,pause:w,index:k},v.data("methods",t),v.hasClass(T.active)||function(){var t;if(v.css("visibility","hidden"),k(),p.length<=1)v.css("visibility","");else{t=!!I.style&&"flipster--"+I.style.split(" ").join(" flipster--"),v.addClass([T.main,M?"flipster--transform":" flipster--no-transform",t,I.click?"flipster--click":""].join(" ")),I.start&&(h="center"===I.start?Math.floor(p.length/2):I.start),y(h);var e,n,i,a,r,s,o,l,c=v.find("img");if(c.length){var u=0;c.on("load",function(){++u>=c.length&&C()}),setTimeout(C,750)}else C();E.on("resize.flipster",L(g,400)),I.autoplay&&b(),I.pauseOnHover&&f.on("mouseenter.flipster",function(){d?w(!0):x()}).on("mouseleave.flipster",function(){-1===d&&b()}),e=v,I.keyboard&&(e[0].tabIndex=0,e.on("keydown.flipster",L(function(t){var e=t.which;37!==e&&39!==e||(y(37===e?"prev":"next"),t.preventDefault())},250))),function(t){if(I.scrollwheel){var e,n,i=!1,a=0,r=0,s=0,o=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/webkit/.test(navigator.userAgent.toLowerCase());t.on("mousewheel.flipster wheel.flipster",function(){i=!0}).on("mousewheel.flipster wheel.flipster",L(function(t){clearTimeout(r),r=setTimeout(function(){s=a=0},300),t=t.originalEvent,s+=t.wheelDelta||-1*(t.deltaY+t.deltaX),Math.abs(s)<25&&!o||(a++,n!==(e=0<s?"prev":"next")&&(a=0),n=e,(a<6||a%3==0)&&y(e),s=0)},50)),t.on("mousewheel.flipster wheel.flipster",function(t){i&&(t.preventDefault(),i=!1)})}}(f),n=f,I.touch&&n.on({"touchstart.flipster":function(t){t=t.originalEvent,i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY},"touchmove.flipster":function(t){t=t.originalEvent,r=t.touches?t.touches[0].clientX:t.clientX,s=t.touches?t.touches[0].clientY:t.clientY,l=r-i,o=s-a,30<Math.abs(l)&&Math.abs(o)<100&&t.preventDefault()},"touchend.flipster touchcancel.flipster ":function(){l=r-i,o=s-a,30<Math.abs(l)&&Math.abs(o)<100&&y(0<l?"prev":"next")}})}}()})}}(jQuery,window);
1
+ /*! jQuery.Flipster, v1.1.5 (built 2020-10-17) */
2
+
3
  !function(P,t,D){"use strict";function L(n,i){var a=null;return function(){var t=this,e=arguments;null===a&&(a=setTimeout(function(){n.apply(t,e),a=null},i))}}var r,e=(r={},function(t){if(r[t]!==D)return r[t];var e=document.createElement("div").style,n=t.charAt(0).toUpperCase()+t.slice(1),i=(t+" "+["webkit","moz","ms","o"].join(n+" ")+n).split(" ");for(var a in i)if(i[a]in e)return r[t]=i[a];return r[t]=!1}),a="http://www.w3.org/2000/svg",E=P(t),M=e("transform"),i={itemContainer:"ul",itemSelector:"li",start:"center",fadeIn:400,loop:!1,autoplay:!1,pauseOnHover:!0,style:"coverflow",spacing:-.6,click:!0,keyboard:!0,scrollwheel:!0,touch:!0,nav:!1,buttons:!1,buttonPrev:"Previous",buttonNext:"Next",onItemSwitch:!1},T={main:"flipster",active:"flipster--active",container:"flipster__container",nav:"flipster__nav",navChild:"flipster__nav__child",navItem:"flipster__nav__item",navLink:"flipster__nav__link",navCurrent:"flipster__nav__item--current",navCategory:"flipster__nav__item--category",navCategoryLink:"flipster__nav__link--category",button:"flipster__button",buttonPrev:"flipster__button--prev",buttonNext:"flipster__button--next",item:"flipster__item",itemCurrent:"flipster__item--current",itemPast:"flipster__item--past",itemFuture:"flipster__item--future",itemContent:"flipster__item__content"},X=new RegExp("\\b("+T.itemCurrent+"|"+T.itemPast+"|"+T.itemFuture+")(.*?)(\\s|$)","g"),j=new RegExp("\\s\\s+","g");P.fn.flipster=function(e){if("string"==typeof e){var n=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=P(this).data("methods");return t[e]?t[e].apply(this,n):this})}var I=P.extend({},i,e);return this.each(function(){var t,f,r,n,p,s,l,c,u,v=P(this),o=[],h=0,d=!1,e=!1;function i(e){return e=e||"next",P('<button class="'+T.button+" "+("next"===e?T.buttonNext:T.buttonPrev)+'" role="button" />').html((n="next"===(t=e)?I.buttonNext:I.buttonPrev,"custom"===I.buttons?n:'<svg viewBox="0 0 13 20" xmlns="'+a+'" aria-labelledby="title"><title>'+n+'</title><polyline points="10,3 3,10 10,17"'+("next"===t?' transform="rotate(180 6.5,10)"':"")+"/></svg>")).on("click",function(t){y(e),t.preventDefault()});var t,n}function m(){v.css("transition",""),f.css("transition",""),p.css("transition","")}function g(a){var t,e;a&&(v.css("transition","none"),f.css("transition","none"),p.css("transition","none")),r=f.width(),f.height((e=0,p.each(function(){t=P(this).height(),e<t&&(e=t)}),e)),r?(n&&(clearInterval(n),n=!1),p.each(function(t){var e,n,i=P(this);i.attr("class",function(t,e){return e&&e.replace(X,"").replace(j," ")}),e=i.outerWidth(),0!==I.spacing&&i.css("margin-right",e*I.spacing+"px"),n=i.position().left,o[t]=-1*(n+e/2-r/2),t===p.length-1&&(_(),a&&setTimeout(m,1))})):n=n||setInterval(function(){g(a)},500)}function _(){var e,n,i,a=p.length;p.each(function(t){e=P(this),n=" ",i=t===h?(n+=T.itemCurrent,a+1):t<h?(n+=T.itemPast+" "+T.itemPast+"-"+(h-t),a-(h-t)):(n+=T.itemFuture+" "+T.itemFuture+"-"+(t-h),a-(t-h)),e.css("z-index",i).attr("class",function(t,e){return e&&e.replace(X,"").replace(j," ")+n})}),0<=h&&(r&&o[h]!==D||g(!0),M?f.css("transform","translateX("+o[h]+"px)"):f.css({left:o[h]+"px"})),function(){if(I.nav){var t=s.data("flip-category");c.removeClass(T.navCurrent),u.filter(function(){return P(this).data("index")===h||t&&P(this).data("category")===t}).parent().addClass(T.navCurrent)}}()}function y(t){var e=h;if(!(p.length<=1))return"prev"===t?0<h?h--:I.loop&&(h=p.length-1):"next"===t?h<p.length-1?h++:I.loop&&(h=0):"number"==typeof t?h=t:t!==D&&(h=p.index(t),I.loop&&e!=h&&(e==p.length-1&&h!=p.length-2&&(h=0),0==e&&1!=h&&(h=p.length-1))),s=p.eq(h),h!==e&&I.onItemSwitch&&I.onItemSwitch.call(v,p[h],p[e]),_(),v}function b(t){return I.autoplay=t||I.autoplay,clearInterval(d),d=setInterval(function(){var t=h;y("next"),t!==h||I.loop||clearInterval(d)},I.autoplay),v}function x(){return clearInterval(d),d=0,v}function w(t){return x(),I.autoplay&&t&&(d=-1),v}function C(){g(!0),v.hide().css("visibility","").addClass(T.active).fadeIn(I.fadeIn)}function k(){var o;if(f=v.find(I.itemContainer).addClass(T.container),!((p=f.find(I.itemSelector)).length<=1))return p.addClass(T.item).each(function(){var t=P(this);t.children("."+T.itemContent).length||t.wrapInner('<div class="'+T.itemContent+'" />')}),I.click&&p.on("click.flipster touchend.flipster",function(t){e||(P(this).hasClass(T.itemCurrent)||t.preventDefault(),y(this))}),I.buttons&&1<p.length&&(v.find("."+T.button).remove(),v.append(i("prev"),i("next"))),o={},!I.nav||p.length<=1||(l&&l.remove(),l=P('<ul class="'+T.nav+'" role="navigation" />'),u=P(""),p.each(function(t){var e=P(this),n=e.data("flip-category"),i=e.data("flip-title")||e.attr("title")||t,a=P('<a href="#" class="'+T.navLink+'">'+i+"</a>").data("index",t);if(u=u.add(a),n){if(!o[n]){var r=P('<li class="'+T.navItem+" "+T.navCategory+'">'),s=P('<a href="#" class="'+T.navLink+" "+T.navCategoryLink+'" data-flip-category="'+n+'">'+n+"</a>").data("category",n).data("index",t);o[n]=P('<ul class="'+T.navChild+'" />'),u=u.add(s),r.append(s,o[n]).appendTo(l)}o[n].append(a)}else l.append(a);a.wrap('<li class="'+T.navItem+'">')}),l.on("click","a",function(t){var e=P(this).data("index");0<=e&&(y(e),t.preventDefault())}),"after"===I.nav?v.append(l):v.prepend(l),c=l.find("."+T.navItem)),0<=h&&y(h),v}t={jump:y,next:function(){return y("next")},prev:function(){return y("prev")},play:b,stop:x,pause:w,index:k},v.data("methods",t),v.hasClass(T.active)||function(){var t;if(v.css("visibility","hidden"),k(),p.length<=1)v.css("visibility","");else{t=!!I.style&&"flipster--"+I.style.split(" ").join(" flipster--"),v.addClass([T.main,M?"flipster--transform":" flipster--no-transform",t,I.click?"flipster--click":""].join(" ")),I.start&&(h="center"===I.start?Math.floor(p.length/2):I.start),y(h);var e,n,i,a,r,s,o,l,c=v.find("img");if(c.length){var u=0;c.on("load",function(){++u>=c.length&&C()}),setTimeout(C,750)}else C();E.on("resize.flipster",L(g,400)),I.autoplay&&b(),I.pauseOnHover&&f.on("mouseenter.flipster",function(){d?w(!0):x()}).on("mouseleave.flipster",function(){-1===d&&b()}),e=v,I.keyboard&&(e[0].tabIndex=0,e.on("keydown.flipster",L(function(t){var e=t.which;37!==e&&39!==e||(y(37===e?"prev":"next"),t.preventDefault())},250))),function(t){if(I.scrollwheel){var e,n,i=!1,a=0,r=0,s=0,o=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/webkit/.test(navigator.userAgent.toLowerCase());t.on("mousewheel.flipster wheel.flipster",function(){i=!0}).on("mousewheel.flipster wheel.flipster",L(function(t){clearTimeout(r),r=setTimeout(function(){s=a=0},300),t=t.originalEvent,s+=t.wheelDelta||-1*(t.deltaY+t.deltaX),Math.abs(s)<25&&!o||(a++,n!==(e=0<s?"prev":"next")&&(a=0),n=e,(a<6||a%3==0)&&y(e),s=0)},50)),t.on("mousewheel.flipster wheel.flipster",function(t){i&&(t.preventDefault(),i=!1)})}}(f),n=f,I.touch&&n.on({"touchstart.flipster":function(t){t=t.originalEvent,i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY},"touchmove.flipster":function(t){t=t.originalEvent,r=t.touches?t.touches[0].clientX:t.clientX,s=t.touches?t.touches[0].clientY:t.clientY,l=r-i,o=s-a,30<Math.abs(l)&&Math.abs(o)<100&&t.preventDefault()},"touchend.flipster touchcancel.flipster ":function(){l=r-i,o=s-a,30<Math.abs(l)&&Math.abs(o)<100&&y(0<l?"prev":"next")}})}}()})}}(jQuery,window);
assets/js/lib/jarallax/jarallax.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*!
2
- * Name : Just Another Parallax [Jarallax]
3
- * Version : 1.12.7
4
- * Author : nK <https://nkdev.info>
5
- * GitHub : https://github.com/nk-o/jarallax
6
  */!function(n){var o={};function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=n,i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=10)}([,,function(e,t){e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},function(t,e,n){!function(e){e="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};t.exports=e}.call(this,n(4))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(o=window)}e.exports=o},,,,,,function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var t=n(2),t=n.n(t),i=n(3),a=n(12);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o,l=i.window.jarallax;i.window.jarallax=a.default,i.window.jarallax.noConflict=function(){return i.window.jarallax=l,this},void 0!==i.jQuery&&((n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.prototype.unshift.call(t,this);var o=a.default.apply(i.window,t);return"object"!==r(o)?o:this}).constructor=a.default.constructor,o=i.jQuery.fn.jarallax,i.jQuery.fn.jarallax=n,i.jQuery.fn.jarallax.noConflict=function(){return i.jQuery.fn.jarallax=o,this}),t()(function(){Object(a.default)(document.querySelectorAll("[data-jarallax]"))})},function(e,t,n){"use strict";n.r(t);var o=n(2),o=n.n(o),f=n(3);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var o,i,a=[],r=!0,l=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r,g,u=f.window.navigator,p=-1<u.userAgent.indexOf("MSIE ")||-1<u.userAgent.indexOf("Trident/")||-1<u.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u.userAgent),d=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n+=1)if(t&&void 0!==t.style[e[n]])return e[n];return!1}();function m(){g=l?(!r&&document.body&&((r=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(r)),(r?r.clientHeight:0)||f.window.innerHeight||document.documentElement.clientHeight):f.window.innerHeight||document.documentElement.clientHeight}m(),f.window.addEventListener("resize",m),f.window.addEventListener("orientationchange",m),f.window.addEventListener("load",m),o()(function(){m()});var y=[];function b(){y.length&&(y.forEach(function(e,t){var n=e.instance,o=e.oldData,i=n.$item.getBoundingClientRect(),e={width:i.width,height:i.height,top:i.top,bottom:i.bottom,wndW:f.window.innerWidth,wndH:g},i=!o||o.wndW!==e.wndW||o.wndH!==e.wndH||o.width!==e.width||o.height!==e.height,o=i||!o||o.top!==e.top||o.bottom!==e.bottom;y[t].oldData=e,i&&n.onResize(),o&&n.onScroll()}),f.window.requestAnimationFrame(b))}var h=0,v=function(){function l(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var n=this;n.instanceID=h,h+=1,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var o,i,a=n.$item.dataset||{},r={};Object.keys(a).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(r[t]=a[e])}),n.options=n.extend({},n.defaults,r,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp&&(o=n.options.disableParallax,n.options.disableParallax=function(){return o.test(u.userAgent)}),"function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp&&(i=n.options.disableVideo,n.options.disableVideo=function(){return i.test(u.userAgent)}),"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});t=n.options.elementInViewport;(t=t&&"object"===c(t)&&void 0!==t.length?s(t,1)[0]:t)instanceof Element||(t=null),n.options.elementInViewport=t,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:/iPad|iPhone|iPod|Android/.test(u.userAgent)?"absolute":"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}var e,t,n;return e=l,(t=[{key:"css",value:function(t,n){return"string"==typeof n?f.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&d&&(n[d]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return n=n||{},Object.keys(o).forEach(function(t){o[t]&&Object.keys(o[t]).forEach(function(e){n[e]=o[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:f.window.innerWidth||document.documentElement.clientWidth,height:g,y:document.documentElement.scrollTop}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return(t=t&&"string"==typeof t?e.$item.querySelector(t):t)instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!!e.image.$item||(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!(!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return d&&!this.options.disableParallax()}},{key:"init",value:function(){var e,t=this,n={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"},o={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",willChange:"transform,opacity"};t.options.keepImg||((e=t.$item.getAttribute("style"))&&t.$item.setAttribute("data-jarallax-original-styles",e),!t.image.useImgTag||(e=t.image.$item.getAttribute("style"))&&t.image.$item.setAttribute("data-jarallax-original-styles",e)),"static"===t.css(t.$item,"position")&&t.css(t.$item,{position:"relative"}),"auto"===t.css(t.$item,"z-index")&&t.css(t.$item,{zIndex:0}),t.image.$container=document.createElement("div"),t.css(t.image.$container,n),t.css(t.image.$container,{"z-index":t.options.zIndex}),p&&t.css(t.image.$container,{opacity:.9999}),t.image.$container.setAttribute("id","jarallax-container-".concat(t.instanceID)),t.$item.appendChild(t.image.$container),t.image.useImgTag?o=t.extend({"object-fit":t.options.imgSize,"object-position":t.options.imgPosition,"font-family":"object-fit: ".concat(t.options.imgSize,"; object-position: ").concat(t.options.imgPosition,";"),"max-width":"none"},n,o):(t.image.$item=document.createElement("div"),t.image.src&&(o=t.extend({"background-position":t.options.imgPosition,"background-size":t.options.imgSize,"background-repeat":t.options.imgRepeat,"background-image":t.image.bgImage||'url("'.concat(t.image.src,'")')},n,o))),"opacity"!==t.options.type&&"scale"!==t.options.type&&"scale-opacity"!==t.options.type&&1!==t.options.speed||(t.image.position="absolute"),"fixed"===t.image.position&&(n=function(e){for(var t=[];null!==e.parentElement;)1===(e=e.parentElement).nodeType&&t.push(e);return t}(t.$item).filter(function(e){var t=f.window.getComputedStyle(e),e=t["-webkit-transform"]||t["-moz-transform"]||t.transform;return e&&"none"!==e||/(auto|scroll)/.test(t.overflow+t["overflow-y"]+t["overflow-x"])}),t.image.position=n.length?"absolute":"fixed"),o.position=t.image.position,t.css(t.image.$item,o),t.image.$container.appendChild(t.image.$item),t.onResize(),t.onScroll(!0),t.options.onInit&&t.options.onInit.call(t),"none"!==t.css(t.$item,"background-image")&&t.css(t.$item,{"background-image":"none"}),t.addToParallaxList()}},{key:"addToParallaxList",value:function(){y.push({instance:this}),1===y.length&&f.window.requestAnimationFrame(b)}},{key:"removeFromParallaxList",value:function(){var n=this;y.forEach(function(e,t){e.instance.instanceID===n.instanceID&&y.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t,n=e.$item.getAttribute("data-jarallax-original-styles");e.$item.removeAttribute("data-jarallax-original-styles"),n?e.$item.setAttribute("style",n):e.$item.removeAttribute("style"),e.image.useImgTag&&(t=e.image.$item.getAttribute("data-jarallax-original-styles"),e.image.$item.removeAttribute("data-jarallax-original-styles"),t?e.image.$item.setAttribute("style",n):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)),e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){var e,t,n;"fixed"===this.image.position&&(t=(n=(e=this).image.$container.getBoundingClientRect()).width,n=n.height,e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-".concat(e.instanceID)),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles)),n="#jarallax-container-".concat(e.instanceID," {\n clip: rect(0 ").concat(t,"px ").concat(n,"px 0);\n clip: rect(0, ").concat(t,"px, ").concat(n,"px, 0);\n -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n }"),e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=n:e.$clipStyles.innerHTML=n)}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,o=e.options.speed,i="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return i&&(o<0?(a=o*Math.max(n,g),g<n&&(a-=o*(n-g))):a=o*(n+g),1<o?r=Math.abs(a-g):o<0?r=a/o+Math.abs(a):r+=(g-n)*(1-o),a/=2),e.parallaxScrollDistance=a,l=i?(g-r)/2:(n-r)/2,e.css(e.image.$item,{height:"".concat(r,"px"),marginTop:"".concat(l,"px"),left:"fixed"===e.image.position?"".concat(t.left,"px"):"0",width:"".concat(t.width,"px")}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t,n,o,i,a,r,l,s=this,c=s.$item.getBoundingClientRect(),u=c.top,p=c.height,d={},m=c;s.options.elementInViewport&&(m=s.options.elementInViewport.getBoundingClientRect()),s.isElementInViewport=0<=m.bottom&&0<=m.right&&m.top<=g&&m.left<=f.window.innerWidth,(e||s.isElementInViewport)&&(t=Math.max(0,u),n=Math.max(0,p+u),o=Math.max(0,-u),i=Math.max(0,u+p-g),a=Math.max(0,p-(u+p-g)),r=Math.max(0,-u+g-p),m=1-(g-u)/(g+p)*2,e=1,p<g?e=1-(o||i)/p:n<=g?e=n/g:a<=g&&(e=a/g),"opacity"!==s.options.type&&"scale-opacity"!==s.options.type&&"scroll-opacity"!==s.options.type||(d.transform="translate3d(0,0,0)",d.opacity=e),"scale"!==s.options.type&&"scale-opacity"!==s.options.type||(l=1,s.options.speed<0?l-=s.options.speed*e:l+=s.options.speed*(1-e),d.transform="scale(".concat(l,") translate3d(0,0,0)")),"scroll"!==s.options.type&&"scroll-opacity"!==s.options.type||(l=s.parallaxScrollDistance*m,"absolute"===s.image.position&&(l-=u),d.transform="translate3d(0,".concat(l,"px,0)")),s.css(s.image.$item,d),s.options.onScroll&&s.options.onScroll.call(s,{section:c,beforeTop:t,beforeTopEnd:n,afterTop:o,beforeBottom:i,beforeBottomEnd:a,afterBottom:r,visiblePercent:e,fromViewportCenter:m}))}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}])&&a(e.prototype,t),n&&a(e,n),l}(),o=function(e,t){for(var n,o=(e=("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?[e]:e).length,i=0,a=arguments.length,r=new Array(2<a?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];for(;i<o;i+=1)if("object"===c(t)||void 0===t?e[i].jarallax||(e[i].jarallax=new v(e[i],t)):e[i].jarallax&&(n=e[i].jarallax[t].apply(e[i].jarallax,r)),void 0!==n)return n;return e};o.constructor=v,t.default=o}]);
1
+ /*!
2
+ * Name : Just Another Parallax [Jarallax]
3
+ * Version : 1.12.7
4
+ * Author : nK <https://nkdev.info>
5
+ * GitHub : https://github.com/nk-o/jarallax
6
  */!function(n){var o={};function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=n,i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=10)}([,,function(e,t){e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},function(t,e,n){!function(e){e="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};t.exports=e}.call(this,n(4))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(o=window)}e.exports=o},,,,,,function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var t=n(2),t=n.n(t),i=n(3),a=n(12);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o,l=i.window.jarallax;i.window.jarallax=a.default,i.window.jarallax.noConflict=function(){return i.window.jarallax=l,this},void 0!==i.jQuery&&((n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.prototype.unshift.call(t,this);var o=a.default.apply(i.window,t);return"object"!==r(o)?o:this}).constructor=a.default.constructor,o=i.jQuery.fn.jarallax,i.jQuery.fn.jarallax=n,i.jQuery.fn.jarallax.noConflict=function(){return i.jQuery.fn.jarallax=o,this}),t()(function(){Object(a.default)(document.querySelectorAll("[data-jarallax]"))})},function(e,t,n){"use strict";n.r(t);var o=n(2),o=n.n(o),f=n(3);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var o,i,a=[],r=!0,l=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r,g,u=f.window.navigator,p=-1<u.userAgent.indexOf("MSIE ")||-1<u.userAgent.indexOf("Trident/")||-1<u.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u.userAgent),d=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n+=1)if(t&&void 0!==t.style[e[n]])return e[n];return!1}();function m(){g=l?(!r&&document.body&&((r=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(r)),(r?r.clientHeight:0)||f.window.innerHeight||document.documentElement.clientHeight):f.window.innerHeight||document.documentElement.clientHeight}m(),f.window.addEventListener("resize",m),f.window.addEventListener("orientationchange",m),f.window.addEventListener("load",m),o()(function(){m()});var y=[];function b(){y.length&&(y.forEach(function(e,t){var n=e.instance,o=e.oldData,i=n.$item.getBoundingClientRect(),e={width:i.width,height:i.height,top:i.top,bottom:i.bottom,wndW:f.window.innerWidth,wndH:g},i=!o||o.wndW!==e.wndW||o.wndH!==e.wndH||o.width!==e.width||o.height!==e.height,o=i||!o||o.top!==e.top||o.bottom!==e.bottom;y[t].oldData=e,i&&n.onResize(),o&&n.onScroll()}),f.window.requestAnimationFrame(b))}var h=0,v=function(){function l(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var n=this;n.instanceID=h,h+=1,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var o,i,a=n.$item.dataset||{},r={};Object.keys(a).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(r[t]=a[e])}),n.options=n.extend({},n.defaults,r,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp&&(o=n.options.disableParallax,n.options.disableParallax=function(){return o.test(u.userAgent)}),"function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp&&(i=n.options.disableVideo,n.options.disableVideo=function(){return i.test(u.userAgent)}),"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});t=n.options.elementInViewport;(t=t&&"object"===c(t)&&void 0!==t.length?s(t,1)[0]:t)instanceof Element||(t=null),n.options.elementInViewport=t,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:/iPad|iPhone|iPod|Android/.test(u.userAgent)?"absolute":"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}var e,t,n;return e=l,(t=[{key:"css",value:function(t,n){return"string"==typeof n?f.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&d&&(n[d]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return n=n||{},Object.keys(o).forEach(function(t){o[t]&&Object.keys(o[t]).forEach(function(e){n[e]=o[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:f.window.innerWidth||document.documentElement.clientWidth,height:g,y:document.documentElement.scrollTop}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return(t=t&&"string"==typeof t?e.$item.querySelector(t):t)instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!!e.image.$item||(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!(!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return d&&!this.options.disableParallax()}},{key:"init",value:function(){var e,t=this,n={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"},o={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",willChange:"transform,opacity"};t.options.keepImg||((e=t.$item.getAttribute("style"))&&t.$item.setAttribute("data-jarallax-original-styles",e),!t.image.useImgTag||(e=t.image.$item.getAttribute("style"))&&t.image.$item.setAttribute("data-jarallax-original-styles",e)),"static"===t.css(t.$item,"position")&&t.css(t.$item,{position:"relative"}),"auto"===t.css(t.$item,"z-index")&&t.css(t.$item,{zIndex:0}),t.image.$container=document.createElement("div"),t.css(t.image.$container,n),t.css(t.image.$container,{"z-index":t.options.zIndex}),p&&t.css(t.image.$container,{opacity:.9999}),t.image.$container.setAttribute("id","jarallax-container-".concat(t.instanceID)),t.$item.appendChild(t.image.$container),t.image.useImgTag?o=t.extend({"object-fit":t.options.imgSize,"object-position":t.options.imgPosition,"font-family":"object-fit: ".concat(t.options.imgSize,"; object-position: ").concat(t.options.imgPosition,";"),"max-width":"none"},n,o):(t.image.$item=document.createElement("div"),t.image.src&&(o=t.extend({"background-position":t.options.imgPosition,"background-size":t.options.imgSize,"background-repeat":t.options.imgRepeat,"background-image":t.image.bgImage||'url("'.concat(t.image.src,'")')},n,o))),"opacity"!==t.options.type&&"scale"!==t.options.type&&"scale-opacity"!==t.options.type&&1!==t.options.speed||(t.image.position="absolute"),"fixed"===t.image.position&&(n=function(e){for(var t=[];null!==e.parentElement;)1===(e=e.parentElement).nodeType&&t.push(e);return t}(t.$item).filter(function(e){var t=f.window.getComputedStyle(e),e=t["-webkit-transform"]||t["-moz-transform"]||t.transform;return e&&"none"!==e||/(auto|scroll)/.test(t.overflow+t["overflow-y"]+t["overflow-x"])}),t.image.position=n.length?"absolute":"fixed"),o.position=t.image.position,t.css(t.image.$item,o),t.image.$container.appendChild(t.image.$item),t.onResize(),t.onScroll(!0),t.options.onInit&&t.options.onInit.call(t),"none"!==t.css(t.$item,"background-image")&&t.css(t.$item,{"background-image":"none"}),t.addToParallaxList()}},{key:"addToParallaxList",value:function(){y.push({instance:this}),1===y.length&&f.window.requestAnimationFrame(b)}},{key:"removeFromParallaxList",value:function(){var n=this;y.forEach(function(e,t){e.instance.instanceID===n.instanceID&&y.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t,n=e.$item.getAttribute("data-jarallax-original-styles");e.$item.removeAttribute("data-jarallax-original-styles"),n?e.$item.setAttribute("style",n):e.$item.removeAttribute("style"),e.image.useImgTag&&(t=e.image.$item.getAttribute("data-jarallax-original-styles"),e.image.$item.removeAttribute("data-jarallax-original-styles"),t?e.image.$item.setAttribute("style",n):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)),e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){var e,t,n;"fixed"===this.image.position&&(t=(n=(e=this).image.$container.getBoundingClientRect()).width,n=n.height,e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-".concat(e.instanceID)),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles)),n="#jarallax-container-".concat(e.instanceID," {\n clip: rect(0 ").concat(t,"px ").concat(n,"px 0);\n clip: rect(0, ").concat(t,"px, ").concat(n,"px, 0);\n -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n }"),e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=n:e.$clipStyles.innerHTML=n)}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,o=e.options.speed,i="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return i&&(o<0?(a=o*Math.max(n,g),g<n&&(a-=o*(n-g))):a=o*(n+g),1<o?r=Math.abs(a-g):o<0?r=a/o+Math.abs(a):r+=(g-n)*(1-o),a/=2),e.parallaxScrollDistance=a,l=i?(g-r)/2:(n-r)/2,e.css(e.image.$item,{height:"".concat(r,"px"),marginTop:"".concat(l,"px"),left:"fixed"===e.image.position?"".concat(t.left,"px"):"0",width:"".concat(t.width,"px")}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t,n,o,i,a,r,l,s=this,c=s.$item.getBoundingClientRect(),u=c.top,p=c.height,d={},m=c;s.options.elementInViewport&&(m=s.options.elementInViewport.getBoundingClientRect()),s.isElementInViewport=0<=m.bottom&&0<=m.right&&m.top<=g&&m.left<=f.window.innerWidth,(e||s.isElementInViewport)&&(t=Math.max(0,u),n=Math.max(0,p+u),o=Math.max(0,-u),i=Math.max(0,u+p-g),a=Math.max(0,p-(u+p-g)),r=Math.max(0,-u+g-p),m=1-(g-u)/(g+p)*2,e=1,p<g?e=1-(o||i)/p:n<=g?e=n/g:a<=g&&(e=a/g),"opacity"!==s.options.type&&"scale-opacity"!==s.options.type&&"scroll-opacity"!==s.options.type||(d.transform="translate3d(0,0,0)",d.opacity=e),"scale"!==s.options.type&&"scale-opacity"!==s.options.type||(l=1,s.options.speed<0?l-=s.options.speed*e:l+=s.options.speed*(1-e),d.transform="scale(".concat(l,") translate3d(0,0,0)")),"scroll"!==s.options.type&&"scroll-opacity"!==s.options.type||(l=s.parallaxScrollDistance*m,"absolute"===s.image.position&&(l-=u),d.transform="translate3d(0,".concat(l,"px,0)")),s.css(s.image.$item,d),s.options.onScroll&&s.options.onScroll.call(s,{section:c,beforeTop:t,beforeTopEnd:n,afterTop:o,beforeBottom:i,beforeBottomEnd:a,afterBottom:r,visiblePercent:e,fromViewportCenter:m}))}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}])&&a(e.prototype,t),n&&a(e,n),l}(),o=function(e,t){for(var n,o=(e=("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?[e]:e).length,i=0,a=arguments.length,r=new Array(2<a?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];for(;i<o;i+=1)if("object"===c(t)||void 0===t?e[i].jarallax||(e[i].jarallax=new v(e[i],t)):e[i].jarallax&&(n=e[i].jarallax[t].apply(e[i].jarallax,r)),void 0!==n)return n;return e};o.constructor=v,t.default=o}]);
assets/js/lib/perfect-scrollbar/perfect-scrollbar.js CHANGED
@@ -1,1324 +1,1324 @@
1
- /*!
2
- * perfect-scrollbar v1.4.0
3
- * (c) 2018 Hyunje Jun
4
- * @license MIT
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
- typeof define === 'function' && define.amd ? define(factory) :
9
- (global.PerfectScrollbar = factory());
10
- }(this, (function () { 'use strict';
11
-
12
- function get(element) {
13
- return getComputedStyle(element);
14
- }
15
-
16
- function set(element, obj) {
17
- for (var key in obj) {
18
- var val = obj[key];
19
- if (typeof val === 'number') {
20
- val = val + "px";
21
- }
22
- element.style[key] = val;
23
- }
24
- return element;
25
- }
26
-
27
- function div(className) {
28
- var div = document.createElement('div');
29
- div.className = className;
30
- return div;
31
- }
32
-
33
- var elMatches =
34
- typeof Element !== 'undefined' &&
35
- (Element.prototype.matches ||
36
- Element.prototype.webkitMatchesSelector ||
37
- Element.prototype.mozMatchesSelector ||
38
- Element.prototype.msMatchesSelector);
39
-
40
- function matches(element, query) {
41
- if (!elMatches) {
42
- throw new Error('No element matching method supported');
43
- }
44
-
45
- return elMatches.call(element, query);
46
- }
47
-
48
- function remove(element) {
49
- if (element.remove) {
50
- element.remove();
51
- } else {
52
- if (element.parentNode) {
53
- element.parentNode.removeChild(element);
54
- }
55
- }
56
- }
57
-
58
- function queryChildren(element, selector) {
59
- return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
60
- );
61
- }
62
-
63
- var cls = {
64
- main: 'ps',
65
- element: {
66
- thumb: function (x) { return ("ps__thumb-" + x); },
67
- rail: function (x) { return ("ps__rail-" + x); },
68
- consuming: 'ps__child--consume',
69
- },
70
- state: {
71
- focus: 'ps--focus',
72
- clicking: 'ps--clicking',
73
- active: function (x) { return ("ps--active-" + x); },
74
- scrolling: function (x) { return ("ps--scrolling-" + x); },
75
- },
76
- };
77
-
78
- /*
79
- * Helper methods
80
- */
81
- var scrollingClassTimeout = { x: null, y: null };
82
-
83
- function addScrollingClass(i, x) {
84
- var classList = i.element.classList;
85
- var className = cls.state.scrolling(x);
86
-
87
- if (classList.contains(className)) {
88
- clearTimeout(scrollingClassTimeout[x]);
89
- } else {
90
- classList.add(className);
91
- }
92
- }
93
-
94
- function removeScrollingClass(i, x) {
95
- scrollingClassTimeout[x] = setTimeout(
96
- function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
97
- i.settings.scrollingThreshold
98
- );
99
- }
100
-
101
- function setScrollingClassInstantly(i, x) {
102
- addScrollingClass(i, x);
103
- removeScrollingClass(i, x);
104
- }
105
-
106
- var EventElement = function EventElement(element) {
107
- this.element = element;
108
- this.handlers = {};
109
- };
110
-
111
- var prototypeAccessors = { isEmpty: { configurable: true } };
112
-
113
- EventElement.prototype.bind = function bind (eventName, handler) {
114
- if (typeof this.handlers[eventName] === 'undefined') {
115
- this.handlers[eventName] = [];
116
- }
117
- this.handlers[eventName].push(handler);
118
- this.element.addEventListener(eventName, handler, false);
119
- };
120
-
121
- EventElement.prototype.unbind = function unbind (eventName, target) {
122
- var this$1 = this;
123
-
124
- this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
125
- if (target && handler !== target) {
126
- return true;
127
- }
128
- this$1.element.removeEventListener(eventName, handler, false);
129
- return false;
130
- });
131
- };
132
-
133
- EventElement.prototype.unbindAll = function unbindAll () {
134
- var this$1 = this;
135
-
136
- for (var name in this$1.handlers) {
137
- this$1.unbind(name);
138
- }
139
- };
140
-
141
- prototypeAccessors.isEmpty.get = function () {
142
- var this$1 = this;
143
-
144
- return Object.keys(this.handlers).every(
145
- function (key) { return this$1.handlers[key].length === 0; }
146
- );
147
- };
148
-
149
- Object.defineProperties( EventElement.prototype, prototypeAccessors );
150
-
151
- var EventManager = function EventManager() {
152
- this.eventElements = [];
153
- };
154
-
155
- EventManager.prototype.eventElement = function eventElement (element) {
156
- var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
157
- if (!ee) {
158
- ee = new EventElement(element);
159
- this.eventElements.push(ee);
160
- }
161
- return ee;
162
- };
163
-
164
- EventManager.prototype.bind = function bind (element, eventName, handler) {
165
- this.eventElement(element).bind(eventName, handler);
166
- };
167
-
168
- EventManager.prototype.unbind = function unbind (element, eventName, handler) {
169
- var ee = this.eventElement(element);
170
- ee.unbind(eventName, handler);
171
-
172
- if (ee.isEmpty) {
173
- // remove
174
- this.eventElements.splice(this.eventElements.indexOf(ee), 1);
175
- }
176
- };
177
-
178
- EventManager.prototype.unbindAll = function unbindAll () {
179
- this.eventElements.forEach(function (e) { return e.unbindAll(); });
180
- this.eventElements = [];
181
- };
182
-
183
- EventManager.prototype.once = function once (element, eventName, handler) {
184
- var ee = this.eventElement(element);
185
- var onceHandler = function (evt) {
186
- ee.unbind(eventName, onceHandler);
187
- handler(evt);
188
- };
189
- ee.bind(eventName, onceHandler);
190
- };
191
-
192
- function createEvent(name) {
193
- if (typeof window.CustomEvent === 'function') {
194
- return new CustomEvent(name);
195
- } else {
196
- var evt = document.createEvent('CustomEvent');
197
- evt.initCustomEvent(name, false, false, undefined);
198
- return evt;
199
- }
200
- }
201
-
202
- var processScrollDiff = function(
203
- i,
204
- axis,
205
- diff,
206
- useScrollingClass,
207
- forceFireReachEvent
208
- ) {
209
- if ( useScrollingClass === void 0 ) useScrollingClass = true;
210
- if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
211
-
212
- var fields;
213
- if (axis === 'top') {
214
- fields = [
215
- 'contentHeight',
216
- 'containerHeight',
217
- 'scrollTop',
218
- 'y',
219
- 'up',
220
- 'down' ];
221
- } else if (axis === 'left') {
222
- fields = [
223
- 'contentWidth',
224
- 'containerWidth',
225
- 'scrollLeft',
226
- 'x',
227
- 'left',
228
- 'right' ];
229
- } else {
230
- throw new Error('A proper axis should be provided');
231
- }
232
-
233
- processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
234
- };
235
-
236
- function processScrollDiff$1(
237
- i,
238
- diff,
239
- ref,
240
- useScrollingClass,
241
- forceFireReachEvent
242
- ) {
243
- var contentHeight = ref[0];
244
- var containerHeight = ref[1];
245
- var scrollTop = ref[2];
246
- var y = ref[3];
247
- var up = ref[4];
248
- var down = ref[5];
249
- if ( useScrollingClass === void 0 ) useScrollingClass = true;
250
- if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
251
-
252
- var element = i.element;
253
-
254
- // reset reach
255
- i.reach[y] = null;
256
-
257
- // 1 for subpixel rounding
258
- if (element[scrollTop] < 1) {
259
- i.reach[y] = 'start';
260
- }
261
-
262
- // 1 for subpixel rounding
263
- if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
264
- i.reach[y] = 'end';
265
- }
266
-
267
- if (diff) {
268
- element.dispatchEvent(createEvent(("ps-scroll-" + y)));
269
-
270
- if (diff < 0) {
271
- element.dispatchEvent(createEvent(("ps-scroll-" + up)));
272
- } else if (diff > 0) {
273
- element.dispatchEvent(createEvent(("ps-scroll-" + down)));
274
- }
275
-
276
- if (useScrollingClass) {
277
- setScrollingClassInstantly(i, y);
278
- }
279
- }
280
-
281
- if (i.reach[y] && (diff || forceFireReachEvent)) {
282
- element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
283
- }
284
- }
285
-
286
- function toInt(x) {
287
- return parseInt(x, 10) || 0;
288
- }
289
-
290
- function isEditable(el) {
291
- return (
292
- matches(el, 'input,[contenteditable]') ||
293
- matches(el, 'select,[contenteditable]') ||
294
- matches(el, 'textarea,[contenteditable]') ||
295
- matches(el, 'button,[contenteditable]')
296
- );
297
- }
298
-
299
- function outerWidth(element) {
300
- var styles = get(element);
301
- return (
302
- toInt(styles.width) +
303
- toInt(styles.paddingLeft) +
304
- toInt(styles.paddingRight) +
305
- toInt(styles.borderLeftWidth) +
306
- toInt(styles.borderRightWidth)
307
- );
308
- }
309
-
310
- var env = {
311
- isWebKit:
312
- typeof document !== 'undefined' &&
313
- 'WebkitAppearance' in document.documentElement.style,
314
- supportsTouch:
315
- typeof window !== 'undefined' &&
316
- ('ontouchstart' in window ||
317
- (window.DocumentTouch && document instanceof window.DocumentTouch)),
318
- supportsIePointer:
319
- typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
320
- isChrome:
321
- typeof navigator !== 'undefined' &&
322
- /Chrome/i.test(navigator && navigator.userAgent),
323
- };
324
-
325
- var updateGeometry = function(i) {
326
- var element = i.element;
327
- var roundedScrollTop = Math.floor(element.scrollTop);
328
-
329
- i.containerWidth = element.clientWidth;
330
- i.containerHeight = element.clientHeight;
331
- i.contentWidth = element.scrollWidth;
332
- i.contentHeight = element.scrollHeight;
333
-
334
- if (!element.contains(i.scrollbarXRail)) {
335
- // clean up and append
336
- queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
337
- );
338
- element.appendChild(i.scrollbarXRail);
339
- }
340
- if (!element.contains(i.scrollbarYRail)) {
341
- // clean up and append
342
- queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
343
- );
344
- element.appendChild(i.scrollbarYRail);
345
- }
346
-
347
- if (
348
- !i.settings.suppressScrollX &&
349
- i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
350
- ) {
351
- i.scrollbarXActive = true;
352
- i.railXWidth = i.containerWidth - i.railXMarginWidth;
353
- i.railXRatio = i.containerWidth / i.railXWidth;
354
- i.scrollbarXWidth = getThumbSize(
355
- i,
356
- toInt(i.railXWidth * i.containerWidth / i.contentWidth)
357
- );
358
- i.scrollbarXLeft = toInt(
359
- (i.negativeScrollAdjustment + element.scrollLeft) *
360
- (i.railXWidth - i.scrollbarXWidth) /
361
- (i.contentWidth - i.containerWidth)
362
- );
363
- } else {
364
- i.scrollbarXActive = false;
365
- }
366
-
367
- if (
368
- !i.settings.suppressScrollY &&
369
- i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
370
- ) {
371
- i.scrollbarYActive = true;
372
- i.railYHeight = i.containerHeight - i.railYMarginHeight;
373
- i.railYRatio = i.containerHeight / i.railYHeight;
374
- i.scrollbarYHeight = getThumbSize(
375
- i,
376
- toInt(i.railYHeight * i.containerHeight / i.contentHeight)
377
- );
378
- i.scrollbarYTop = toInt(
379
- roundedScrollTop *
380
- (i.railYHeight - i.scrollbarYHeight) /
381
- (i.contentHeight - i.containerHeight)
382
- );
383
- } else {
384
- i.scrollbarYActive = false;
385
- }
386
-
387
- if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
388
- i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
389
- }
390
- if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
391
- i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
392
- }
393
-
394
- updateCss(element, i);
395
-
396
- if (i.scrollbarXActive) {
397
- element.classList.add(cls.state.active('x'));
398
- } else {
399
- element.classList.remove(cls.state.active('x'));
400
- i.scrollbarXWidth = 0;
401
- i.scrollbarXLeft = 0;
402
- element.scrollLeft = 0;
403
- }
404
- if (i.scrollbarYActive) {
405
- element.classList.add(cls.state.active('y'));
406
- } else {
407
- element.classList.remove(cls.state.active('y'));
408
- i.scrollbarYHeight = 0;
409
- i.scrollbarYTop = 0;
410
- element.scrollTop = 0;
411
- }
412
- };
413
-
414
- function getThumbSize(i, thumbSize) {
415
- if (i.settings.minScrollbarLength) {
416
- thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
417
- }
418
- if (i.settings.maxScrollbarLength) {
419
- thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
420
- }
421
- return thumbSize;
422
- }
423
-
424
- function updateCss(element, i) {
425
- var xRailOffset = { width: i.railXWidth };
426
- var roundedScrollTop = Math.floor(element.scrollTop);
427
-
428
- if (i.isRtl) {
429
- xRailOffset.left =
430
- i.negativeScrollAdjustment +
431
- element.scrollLeft +
432
- i.containerWidth -
433
- i.contentWidth;
434
- } else {
435
- xRailOffset.left = element.scrollLeft;
436
- }
437
- if (i.isScrollbarXUsingBottom) {
438
- xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
439
- } else {
440
- xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
441
- }
442
- set(i.scrollbarXRail, xRailOffset);
443
-
444
- var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
445
- if (i.isScrollbarYUsingRight) {
446
- if (i.isRtl) {
447
- yRailOffset.right =
448
- i.contentWidth -
449
- (i.negativeScrollAdjustment + element.scrollLeft) -
450
- i.scrollbarYRight -
451
- i.scrollbarYOuterWidth;
452
- } else {
453
- yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
454
- }
455
- } else {
456
- if (i.isRtl) {
457
- yRailOffset.left =
458
- i.negativeScrollAdjustment +
459
- element.scrollLeft +
460
- i.containerWidth * 2 -
461
- i.contentWidth -
462
- i.scrollbarYLeft -
463
- i.scrollbarYOuterWidth;
464
- } else {
465
- yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
466
- }
467
- }
468
- set(i.scrollbarYRail, yRailOffset);
469
-
470
- set(i.scrollbarX, {
471
- left: i.scrollbarXLeft,
472
- width: i.scrollbarXWidth - i.railBorderXWidth,
473
- });
474
- set(i.scrollbarY, {
475
- top: i.scrollbarYTop,
476
- height: i.scrollbarYHeight - i.railBorderYWidth,
477
- });
478
- }
479
-
480
- var clickRail = function(i) {
481
- i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
482
- i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
483
- var positionTop =
484
- e.pageY -
485
- window.pageYOffset -
486
- i.scrollbarYRail.getBoundingClientRect().top;
487
- var direction = positionTop > i.scrollbarYTop ? 1 : -1;
488
-
489
- i.element.scrollTop += direction * i.containerHeight;
490
- updateGeometry(i);
491
-
492
- e.stopPropagation();
493
- });
494
-
495
- i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
496
- i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
497
- var positionLeft =
498
- e.pageX -
499
- window.pageXOffset -
500
- i.scrollbarXRail.getBoundingClientRect().left;
501
- var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
502
-
503
- i.element.scrollLeft += direction * i.containerWidth;
504
- updateGeometry(i);
505
-
506
- e.stopPropagation();
507
- });
508
- };
509
-
510
- var dragThumb = function(i) {
511
- bindMouseScrollHandler(i, [
512
- 'containerWidth',
513
- 'contentWidth',
514
- 'pageX',
515
- 'railXWidth',
516
- 'scrollbarX',
517
- 'scrollbarXWidth',
518
- 'scrollLeft',
519
- 'x',
520
- 'scrollbarXRail' ]);
521
- bindMouseScrollHandler(i, [
522
- 'containerHeight',
523
- 'contentHeight',
524
- 'pageY',
525
- 'railYHeight',
526
- 'scrollbarY',
527
- 'scrollbarYHeight',
528
- 'scrollTop',
529
- 'y',
530
- 'scrollbarYRail' ]);
531
- };
532
-
533
- function bindMouseScrollHandler(
534
- i,
535
- ref
536
- ) {
537
- var containerHeight = ref[0];
538
- var contentHeight = ref[1];
539
- var pageY = ref[2];
540
- var railYHeight = ref[3];
541
- var scrollbarY = ref[4];
542
- var scrollbarYHeight = ref[5];
543
- var scrollTop = ref[6];
544
- var y = ref[7];
545
- var scrollbarYRail = ref[8];
546
-
547
- var element = i.element;
548
-
549
- var startingScrollTop = null;
550
- var startingMousePageY = null;
551
- var scrollBy = null;
552
-
553
- function mouseMoveHandler(e) {
554
- element[scrollTop] =
555
- startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
556
- addScrollingClass(i, y);
557
- updateGeometry(i);
558
-
559
- e.stopPropagation();
560
- e.preventDefault();
561
- }
562
-
563
- function mouseUpHandler() {
564
- removeScrollingClass(i, y);
565
- i[scrollbarYRail].classList.remove(cls.state.clicking);
566
- i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
567
- }
568
-
569
- i.event.bind(i[scrollbarY], 'mousedown', function (e) {
570
- startingScrollTop = element[scrollTop];
571
- startingMousePageY = e[pageY];
572
- scrollBy =
573
- (i[contentHeight] - i[containerHeight]) /
574
- (i[railYHeight] - i[scrollbarYHeight]);
575
-
576
- i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
577
- i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
578
-
579
- i[scrollbarYRail].classList.add(cls.state.clicking);
580
-
581
- e.stopPropagation();
582
- e.preventDefault();
583
- });
584
- }
585
-
586
- var keyboard = function(i) {
587
- var element = i.element;
588
-
589
- var elementHovered = function () { return matches(element, ':hover'); };
590
- var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
591
-
592
- function shouldPreventDefault(deltaX, deltaY) {
593
- var scrollTop = Math.floor(element.scrollTop);
594
- if (deltaX === 0) {
595
- if (!i.scrollbarYActive) {
596
- return false;
597
- }
598
- if (
599
- (scrollTop === 0 && deltaY > 0) ||
600
- (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
601
- ) {
602
- return !i.settings.wheelPropagation;
603
- }
604
- }
605
-
606
- var scrollLeft = element.scrollLeft;
607
- if (deltaY === 0) {
608
- if (!i.scrollbarXActive) {
609
- return false;
610
- }
611
- if (
612
- (scrollLeft === 0 && deltaX < 0) ||
613
- (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
614
- ) {
615
- return !i.settings.wheelPropagation;
616
- }
617
- }
618
- return true;
619
- }
620
-
621
- i.event.bind(i.ownerDocument, 'keydown', function (e) {
622
- if (
623
- (e.isDefaultPrevented && e.isDefaultPrevented()) ||
624
- e.defaultPrevented
625
- ) {
626
- return;
627
- }
628
-
629
- if (!elementHovered() && !scrollbarFocused()) {
630
- return;
631
- }
632
-
633
- var activeElement = document.activeElement
634
- ? document.activeElement
635
- : i.ownerDocument.activeElement;
636
- if (activeElement) {
637
- if (activeElement.tagName === 'IFRAME') {
638
- activeElement = activeElement.contentDocument.activeElement;
639
- } else {
640
- // go deeper if element is a webcomponent
641
- while (activeElement.shadowRoot) {
642
- activeElement = activeElement.shadowRoot.activeElement;
643
- }
644
- }
645
- if (isEditable(activeElement)) {
646
- return;
647
- }
648
- }
649
-
650
- var deltaX = 0;
651
- var deltaY = 0;
652
-
653
- switch (e.which) {
654
- case 37: // left
655
- if (e.metaKey) {
656
- deltaX = -i.contentWidth;
657
- } else if (e.altKey) {
658
- deltaX = -i.containerWidth;
659
- } else {
660
- deltaX = -30;
661
- }
662
- break;
663
- case 38: // up
664
- if (e.metaKey) {
665
- deltaY = i.contentHeight;
666
- } else if (e.altKey) {
667
- deltaY = i.containerHeight;
668
- } else {
669
- deltaY = 30;
670
- }
671
- break;
672
- case 39: // right
673
- if (e.metaKey) {
674
- deltaX = i.contentWidth;
675
- } else if (e.altKey) {
676
- deltaX = i.containerWidth;
677
- } else {
678
- deltaX = 30;
679
- }
680
- break;
681
- case 40: // down
682
- if (e.metaKey) {
683
- deltaY = -i.contentHeight;
684
- } else if (e.altKey) {
685
- deltaY = -i.containerHeight;
686
- } else {
687
- deltaY = -30;
688
- }
689
- break;
690
- case 32: // space bar
691
- if (e.shiftKey) {
692
- deltaY = i.containerHeight;
693
- } else {
694
- deltaY = -i.containerHeight;
695
- }
696
- break;
697
- case 33: // page up
698
- deltaY = i.containerHeight;
699
- break;
700
- case 34: // page down
701
- deltaY = -i.containerHeight;
702
- break;
703
- case 36: // home
704
- deltaY = i.contentHeight;
705
- break;
706
- case 35: // end
707
- deltaY = -i.contentHeight;
708
- break;
709
- default:
710
- return;
711
- }
712
-
713
- if (i.settings.suppressScrollX && deltaX !== 0) {
714
- return;
715
- }
716
- if (i.settings.suppressScrollY && deltaY !== 0) {
717
- return;
718
- }
719
-
720
- element.scrollTop -= deltaY;
721
- element.scrollLeft += deltaX;
722
- updateGeometry(i);
723
-
724
- if (shouldPreventDefault(deltaX, deltaY)) {
725
- e.preventDefault();
726
- }
727
- });
728
- };
729
-
730
- var wheel = function(i) {
731
- var element = i.element;
732
-
733
- function shouldPreventDefault(deltaX, deltaY) {
734
- var roundedScrollTop = Math.floor(element.scrollTop);
735
- var isTop = element.scrollTop === 0;
736
- var isBottom =
737
- roundedScrollTop + element.offsetHeight === element.scrollHeight;
738
- var isLeft = element.scrollLeft === 0;
739
- var isRight =
740
- element.scrollLeft + element.offsetWidth === element.scrollWidth;
741
-
742
- var hitsBound;
743
-
744
- // pick axis with primary direction
745
- if (Math.abs(deltaY) > Math.abs(deltaX)) {
746
- hitsBound = isTop || isBottom;
747
- } else {
748
- hitsBound = isLeft || isRight;
749
- }
750
-
751
- return hitsBound ? !i.settings.wheelPropagation : true;
752
- }
753
-
754
- function getDeltaFromEvent(e) {
755
- var deltaX = e.deltaX;
756
- var deltaY = -1 * e.deltaY;
757
-
758
- if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
759
- // OS X Safari
760
- deltaX = -1 * e.wheelDeltaX / 6;
761
- deltaY = e.wheelDeltaY / 6;
762
- }
763
-
764
- if (e.deltaMode && e.deltaMode === 1) {
765
- // Firefox in deltaMode 1: Line scrolling
766
- deltaX *= 10;
767
- deltaY *= 10;
768
- }
769
-
770
- if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
771
- // IE in some mouse drivers
772
- deltaX = 0;
773
- deltaY = e.wheelDelta;
774
- }
775
-
776
- if (e.shiftKey) {
777
- // reverse axis with shift key
778
- return [-deltaY, -deltaX];
779
- }
780
- return [deltaX, deltaY];
781
- }
782
-
783
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
784
- // FIXME: this is a workaround for <select> issue in FF and IE #571
785
- if (!env.isWebKit && element.querySelector('select:focus')) {
786
- return true;
787
- }
788
-
789
- if (!element.contains(target)) {
790
- return false;
791
- }
792
-
793
- var cursor = target;
794
-
795
- while (cursor && cursor !== element) {
796
- if (cursor.classList.contains(cls.element.consuming)) {
797
- return true;
798
- }
799
-
800
- var style = get(cursor);
801
- var overflow = [style.overflow, style.overflowX, style.overflowY].join(
802
- ''
803
- );
804
-
805
- // if scrollable
806
- if (overflow.match(/(scroll|auto)/)) {
807
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
808
- if (maxScrollTop > 0) {
809
- if (
810
- !(cursor.scrollTop === 0 && deltaY > 0) &&
811
- !(cursor.scrollTop === maxScrollTop && deltaY < 0)
812
- ) {
813
- return true;
814
- }
815
- }
816
- var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
817
- if (maxScrollLeft > 0) {
818
- if (
819
- !(cursor.scrollLeft === 0 && deltaX < 0) &&
820
- !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
821
- ) {
822
- return true;
823
- }
824
- }
825
- }
826
-
827
- cursor = cursor.parentNode;
828
- }
829
-
830
- return false;
831
- }
832
-
833
- function mousewheelHandler(e) {
834
- var ref = getDeltaFromEvent(e);
835
- var deltaX = ref[0];
836
- var deltaY = ref[1];
837
-
838
- if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
839
- return;
840
- }
841
-
842
- var shouldPrevent = false;
843
- if (!i.settings.useBothWheelAxes) {
844
- // deltaX will only be used for horizontal scrolling and deltaY will
845
- // only be used for vertical scrolling - this is the default
846
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
847
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
848
- } else if (i.scrollbarYActive && !i.scrollbarXActive) {
849
- // only vertical scrollbar is active and useBothWheelAxes option is
850
- // active, so let's scroll vertical bar using both mouse wheel axes
851
- if (deltaY) {
852
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
853
- } else {
854
- element.scrollTop += deltaX * i.settings.wheelSpeed;
855
- }
856
- shouldPrevent = true;
857
- } else if (i.scrollbarXActive && !i.scrollbarYActive) {
858
- // useBothWheelAxes and only horizontal bar is active, so use both
859
- // wheel axes for horizontal bar
860
- if (deltaX) {
861
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
862
- } else {
863
- element.scrollLeft -= deltaY * i.settings.wheelSpeed;
864
- }
865
- shouldPrevent = true;
866
- }
867
-
868
- updateGeometry(i);
869
-
870
- shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
871
- if (shouldPrevent && !e.ctrlKey) {
872
- e.stopPropagation();
873
- e.preventDefault();
874
- }
875
- }
876
-
877
- if (typeof window.onwheel !== 'undefined') {
878
- i.event.bind(element, 'wheel', mousewheelHandler);
879
- } else if (typeof window.onmousewheel !== 'undefined') {
880
- i.event.bind(element, 'mousewheel', mousewheelHandler);
881
- }
882
- };
883
-
884
- var touch = function(i) {
885
- if (!env.supportsTouch && !env.supportsIePointer) {
886
- return;
887
- }
888
-
889
- var element = i.element;
890
-
891
- function shouldPrevent(deltaX, deltaY) {
892
- var scrollTop = Math.floor(element.scrollTop);
893
- var scrollLeft = element.scrollLeft;
894
- var magnitudeX = Math.abs(deltaX);
895
- var magnitudeY = Math.abs(deltaY);
896
-
897
- if (magnitudeY > magnitudeX) {
898
- // user is perhaps trying to swipe up/down the page
899
-
900
- if (
901
- (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
902
- (deltaY > 0 && scrollTop === 0)
903
- ) {
904
- // set prevent for mobile Chrome refresh
905
- return window.scrollY === 0 && deltaY > 0 && env.isChrome;
906
- }
907
- } else if (magnitudeX > magnitudeY) {
908
- // user is perhaps trying to swipe left/right across the page
909
-
910
- if (
911
- (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
912
- (deltaX > 0 && scrollLeft === 0)
913
- ) {
914
- return true;
915
- }
916
- }
917
-
918
- return true;
919
- }
920
-
921
- function applyTouchMove(differenceX, differenceY) {
922
- element.scrollTop -= differenceY;
923
- element.scrollLeft -= differenceX;
924
-
925
- updateGeometry(i);
926
- }
927
-
928
- var startOffset = {};
929
- var startTime = 0;
930
- var speed = {};
931
- var easingLoop = null;
932
-
933
- function getTouch(e) {
934
- if (e.targetTouches) {
935
- return e.targetTouches[0];
936
- } else {
937
- // Maybe IE pointer
938
- return e;
939
- }
940
- }
941
-
942
- function shouldHandle(e) {
943
- if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
944
- return false;
945
- }
946
- if (e.targetTouches && e.targetTouches.length === 1) {
947
- return true;
948
- }
949
- if (
950
- e.pointerType &&
951
- e.pointerType !== 'mouse' &&
952
- e.pointerType !== e.MSPOINTER_TYPE_MOUSE
953
- ) {
954
- return true;
955
- }
956
- return false;
957
- }
958
-
959
- function touchStart(e) {
960
- if (!shouldHandle(e)) {
961
- return;
962
- }
963
-
964
- var touch = getTouch(e);
965
-
966
- startOffset.pageX = touch.pageX;
967
- startOffset.pageY = touch.pageY;
968
-
969
- startTime = new Date().getTime();
970
-
971
- if (easingLoop !== null) {
972
- clearInterval(easingLoop);
973
- }
974
- }
975
-
976
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
977
- if (!element.contains(target)) {
978
- return false;
979
- }
980
-
981
- var cursor = target;
982
-
983
- while (cursor && cursor !== element) {
984
- if (cursor.classList.contains(cls.element.consuming)) {
985
- return true;
986
- }
987
-
988
- var style = get(cursor);
989
- var overflow = [style.overflow, style.overflowX, style.overflowY].join(
990
- ''
991
- );
992
-
993
- // if scrollable
994
- if (overflow.match(/(scroll|auto)/)) {
995
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
996
- if (maxScrollTop > 0) {
997
- if (
998
- !(cursor.scrollTop === 0 && deltaY > 0) &&
999
- !(cursor.scrollTop === maxScrollTop && deltaY < 0)
1000
- ) {
1001
- return true;
1002
- }
1003
- }
1004
- var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
1005
- if (maxScrollLeft > 0) {
1006
- if (
1007
- !(cursor.scrollLeft === 0 && deltaX < 0) &&
1008
- !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
1009
- ) {
1010
- return true;
1011
- }
1012
- }
1013
- }
1014
-
1015
- cursor = cursor.parentNode;
1016
- }
1017
-
1018
- return false;
1019
- }
1020
-
1021
- function touchMove(e) {
1022
- if (shouldHandle(e)) {
1023
- var touch = getTouch(e);
1024
-
1025
- var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
1026
-
1027
- var differenceX = currentOffset.pageX - startOffset.pageX;
1028
- var differenceY = currentOffset.pageY - startOffset.pageY;
1029
-
1030
- if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
1031
- return;
1032
- }
1033
-
1034
- applyTouchMove(differenceX, differenceY);
1035
- startOffset = currentOffset;
1036
-
1037
- var currentTime = new Date().getTime();
1038
-
1039
- var timeGap = currentTime - startTime;
1040
- if (timeGap > 0) {
1041
- speed.x = differenceX / timeGap;
1042
- speed.y = differenceY / timeGap;
1043
- startTime = currentTime;
1044
- }
1045
-
1046
- if (shouldPrevent(differenceX, differenceY)) {
1047
- e.preventDefault();
1048
- }
1049
- }
1050
- }
1051
- function touchEnd() {
1052
- if (i.settings.swipeEasing) {
1053
- clearInterval(easingLoop);
1054
- easingLoop = setInterval(function() {
1055
- if (i.isInitialized) {
1056
- clearInterval(easingLoop);
1057
- return;
1058
- }
1059
-
1060
- if (!speed.x && !speed.y) {
1061
- clearInterval(easingLoop);
1062
- return;
1063
- }
1064
-
1065
- if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
1066
- clearInterval(easingLoop);
1067
- return;
1068
- }
1069
-
1070
- applyTouchMove(speed.x * 30, speed.y * 30);
1071
-
1072
- speed.x *= 0.8;
1073
- speed.y *= 0.8;
1074
- }, 10);
1075
- }
1076
- }
1077
-
1078
- if (env.supportsTouch) {
1079
- i.event.bind(element, 'touchstart', touchStart);
1080
- i.event.bind(element, 'touchmove', touchMove);
1081
- i.event.bind(element, 'touchend', touchEnd);
1082
- } else if (env.supportsIePointer) {
1083
- if (window.PointerEvent) {
1084
- i.event.bind(element, 'pointerdown', touchStart);
1085
- i.event.bind(element, 'pointermove', touchMove);
1086
- i.event.bind(element, 'pointerup', touchEnd);
1087
- } else if (window.MSPointerEvent) {
1088
- i.event.bind(element, 'MSPointerDown', touchStart);
1089
- i.event.bind(element, 'MSPointerMove', touchMove);
1090
- i.event.bind(element, 'MSPointerUp', touchEnd);
1091
- }
1092
- }
1093
- };
1094
-
1095
- var defaultSettings = function () { return ({
1096
- handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
1097
- maxScrollbarLength: null,
1098
- minScrollbarLength: null,
1099
- scrollingThreshold: 1000,
1100
- scrollXMarginOffset: 0,
1101
- scrollYMarginOffset: 0,
1102
- suppressScrollX: false,
1103
- suppressScrollY: false,
1104
- swipeEasing: true,
1105
- useBothWheelAxes: false,
1106
- wheelPropagation: true,
1107
- wheelSpeed: 1,
1108
- }); };
1109
-
1110
- var handlers = {
1111
- 'click-rail': clickRail,
1112
- 'drag-thumb': dragThumb,
1113
- keyboard: keyboard,
1114
- wheel: wheel,
1115
- touch: touch,
1116
- };
1117
-
1118
- var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
1119
- var this$1 = this;
1120
- if ( userSettings === void 0 ) userSettings = {};
1121
-
1122
- if (typeof element === 'string') {
1123
- element = document.querySelector(element);
1124
- }
1125
-
1126
- if (!element || !element.nodeName) {
1127
- throw new Error('no element is specified to initialize PerfectScrollbar');
1128
- }
1129
-
1130
- this.element = element;
1131
-
1132
- element.classList.add(cls.main);
1133
-
1134
- this.settings = defaultSettings();
1135
- for (var key in userSettings) {
1136
- this$1.settings[key] = userSettings[key];
1137
- }
1138
-
1139
- this.containerWidth = null;
1140
- this.containerHeight = null;
1141
- this.contentWidth = null;
1142
- this.contentHeight = null;
1143
-
1144
- var focus = function () { return element.classList.add(cls.state.focus); };
1145
- var blur = function () { return element.classList.remove(cls.state.focus); };
1146
-
1147
- this.isRtl = get(element).direction === 'rtl';
1148
- this.isNegativeScroll = (function () {
1149
- var originalScrollLeft = element.scrollLeft;
1150
- var result = null;
1151
- element.scrollLeft = -1;
1152
- result = element.scrollLeft < 0;
1153
- element.scrollLeft = originalScrollLeft;
1154
- return result;
1155
- })();
1156
- this.negativeScrollAdjustment = this.isNegativeScroll
1157
- ? element.scrollWidth - element.clientWidth
1158
- : 0;
1159
- this.event = new EventManager();
1160
- this.ownerDocument = element.ownerDocument || document;
1161
-
1162
- this.scrollbarXRail = div(cls.element.rail('x'));
1163
- element.appendChild(this.scrollbarXRail);
1164
- this.scrollbarX = div(cls.element.thumb('x'));
1165
- this.scrollbarXRail.appendChild(this.scrollbarX);
1166
- this.scrollbarX.setAttribute('tabindex', 0);
1167
- this.event.bind(this.scrollbarX, 'focus', focus);
1168
- this.event.bind(this.scrollbarX, 'blur', blur);
1169
- this.scrollbarXActive = null;
1170
- this.scrollbarXWidth = null;
1171
- this.scrollbarXLeft = null;
1172
- var railXStyle = get(this.scrollbarXRail);
1173
- this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
1174
- if (isNaN(this.scrollbarXBottom)) {
1175
- this.isScrollbarXUsingBottom = false;
1176
- this.scrollbarXTop = toInt(railXStyle.top);
1177
- } else {
1178
- this.isScrollbarXUsingBottom = true;
1179
- }
1180
- this.railBorderXWidth =
1181
- toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
1182
- // Set rail to display:block to calculate margins
1183
- set(this.scrollbarXRail, { display: 'block' });
1184
- this.railXMarginWidth =
1185
- toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
1186
- set(this.scrollbarXRail, { display: '' });
1187
- this.railXWidth = null;
1188
- this.railXRatio = null;
1189
-
1190
- this.scrollbarYRail = div(cls.element.rail('y'));
1191
- element.appendChild(this.scrollbarYRail);
1192
- this.scrollbarY = div(cls.element.thumb('y'));
1193
- this.scrollbarYRail.appendChild(this.scrollbarY);
1194
- this.scrollbarY.setAttribute('tabindex', 0);
1195
- this.event.bind(this.scrollbarY, 'focus', focus);
1196
- this.event.bind(this.scrollbarY, 'blur', blur);
1197
- this.scrollbarYActive = null;
1198
- this.scrollbarYHeight = null;
1199
- this.scrollbarYTop = null;
1200
- var railYStyle = get(this.scrollbarYRail);
1201
- this.scrollbarYRight = parseInt(railYStyle.right, 10);
1202
- if (isNaN(this.scrollbarYRight)) {
1203
- this.isScrollbarYUsingRight = false;
1204
- this.scrollbarYLeft = toInt(railYStyle.left);
1205
- } else {
1206
- this.isScrollbarYUsingRight = true;
1207
- }
1208
- this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
1209
- this.railBorderYWidth =
1210
- toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
1211
- set(this.scrollbarYRail, { display: 'block' });
1212
- this.railYMarginHeight =
1213
- toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
1214
- set(this.scrollbarYRail, { display: '' });
1215
- this.railYHeight = null;
1216
- this.railYRatio = null;
1217
-
1218
- this.reach = {
1219
- x:
1220
- element.scrollLeft <= 0
1221
- ? 'start'
1222
- : element.scrollLeft >= this.contentWidth - this.containerWidth
1223
- ? 'end'
1224
- : null,
1225
- y:
1226
- element.scrollTop <= 0
1227
- ? 'start'
1228
- : element.scrollTop >= this.contentHeight - this.containerHeight
1229
- ? 'end'
1230
- : null,
1231
- };
1232
-
1233
- this.isAlive = true;
1234
-
1235
- this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
1236
-
1237
- this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
1238
- this.lastScrollLeft = element.scrollLeft; // for onScroll only
1239
- this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
1240
- updateGeometry(this);
1241
- };
1242
-
1243
- PerfectScrollbar.prototype.update = function update () {
1244
- if (!this.isAlive) {
1245
- return;
1246
- }
1247
-
1248
- // Recalcuate negative scrollLeft adjustment
1249
- this.negativeScrollAdjustment = this.isNegativeScroll
1250
- ? this.element.scrollWidth - this.element.clientWidth
1251
- : 0;
1252
-
1253
- // Recalculate rail margins
1254
- set(this.scrollbarXRail, { display: 'block' });
1255
- set(this.scrollbarYRail, { display: 'block' });
1256
- this.railXMarginWidth =
1257
- toInt(get(this.scrollbarXRail).marginLeft) +
1258
- toInt(get(this.scrollbarXRail).marginRight);
1259
- this.railYMarginHeight =
1260
- toInt(get(this.scrollbarYRail).marginTop) +
1261
- toInt(get(this.scrollbarYRail).marginBottom);
1262
-
1263
- // Hide scrollbars not to affect scrollWidth and scrollHeight
1264
- set(this.scrollbarXRail, { display: 'none' });
1265
- set(this.scrollbarYRail, { display: 'none' });
1266
-
1267
- updateGeometry(this);
1268
-
1269
- processScrollDiff(this, 'top', 0, false, true);
1270
- processScrollDiff(this, 'left', 0, false, true);
1271
-
1272
- set(this.scrollbarXRail, { display: '' });
1273
- set(this.scrollbarYRail, { display: '' });
1274
- };
1275
-
1276
- PerfectScrollbar.prototype.onScroll = function onScroll (e) {
1277
- if (!this.isAlive) {
1278
- return;
1279
- }
1280
-
1281
- updateGeometry(this);
1282
- processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
1283
- processScrollDiff(
1284
- this,
1285
- 'left',
1286
- this.element.scrollLeft - this.lastScrollLeft
1287
- );
1288
-
1289
- this.lastScrollTop = Math.floor(this.element.scrollTop);
1290
- this.lastScrollLeft = this.element.scrollLeft;
1291
- };
1292
-
1293
- PerfectScrollbar.prototype.destroy = function destroy () {
1294
- if (!this.isAlive) {
1295
- return;
1296
- }
1297
-
1298
- this.event.unbindAll();
1299
- remove(this.scrollbarX);
1300
- remove(this.scrollbarY);
1301
- remove(this.scrollbarXRail);
1302
- remove(this.scrollbarYRail);
1303
- this.removePsClasses();
1304
-
1305
- // unset elements
1306
- this.element = null;
1307
- this.scrollbarX = null;
1308
- this.scrollbarY = null;
1309
- this.scrollbarXRail = null;
1310
- this.scrollbarYRail = null;
1311
-
1312
- this.isAlive = false;
1313
- };
1314
-
1315
- PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
1316
- this.element.className = this.element.className
1317
- .split(' ')
1318
- .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
1319
- .join(' ');
1320
- };
1321
-
1322
- return PerfectScrollbar;
1323
-
1324
- })));
1
+ /*!
2
+ * perfect-scrollbar v1.4.0
3
+ * (c) 2018 Hyunje Jun
4
+ * @license MIT
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global.PerfectScrollbar = factory());
10
+ }(this, (function () { 'use strict';
11
+
12
+ function get(element) {
13
+ return getComputedStyle(element);
14
+ }
15
+
16
+ function set(element, obj) {
17
+ for (var key in obj) {
18
+ var val = obj[key];
19
+ if (typeof val === 'number') {
20
+ val = val + "px";
21
+ }
22
+ element.style[key] = val;
23
+ }
24
+ return element;
25
+ }
26
+
27
+ function div(className) {
28
+ var div = document.createElement('div');
29
+ div.className = className;
30
+ return div;
31
+ }
32
+
33
+ var elMatches =
34
+ typeof Element !== 'undefined' &&
35
+ (Element.prototype.matches ||
36
+ Element.prototype.webkitMatchesSelector ||
37
+ Element.prototype.mozMatchesSelector ||
38
+ Element.prototype.msMatchesSelector);
39
+
40
+ function matches(element, query) {
41
+ if (!elMatches) {
42
+ throw new Error('No element matching method supported');
43
+ }
44
+
45
+ return elMatches.call(element, query);
46
+ }
47
+
48
+ function remove(element) {
49
+ if (element.remove) {
50
+ element.remove();
51
+ } else {
52
+ if (element.parentNode) {
53
+ element.parentNode.removeChild(element);
54
+ }
55
+ }
56
+ }
57
+
58
+ function queryChildren(element, selector) {
59
+ return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
60
+ );
61
+ }
62
+
63
+ var cls = {
64
+ main: 'ps',
65
+ element: {
66
+ thumb: function (x) { return ("ps__thumb-" + x); },
67
+ rail: function (x) { return ("ps__rail-" + x); },
68
+ consuming: 'ps__child--consume',
69
+ },
70
+ state: {
71
+ focus: 'ps--focus',
72
+ clicking: 'ps--clicking',
73
+ active: function (x) { return ("ps--active-" + x); },
74
+ scrolling: function (x) { return ("ps--scrolling-" + x); },
75
+ },
76
+ };
77
+
78
+ /*
79
+ * Helper methods
80
+ */
81
+ var scrollingClassTimeout = { x: null, y: null };
82
+
83
+ function addScrollingClass(i, x) {
84
+ var classList = i.element.classList;
85
+ var className = cls.state.scrolling(x);
86
+
87
+ if (classList.contains(className)) {
88
+ clearTimeout(scrollingClassTimeout[x]);
89
+ } else {
90
+ classList.add(className);
91
+ }
92
+ }
93
+
94
+ function removeScrollingClass(i, x) {
95
+ scrollingClassTimeout[x] = setTimeout(
96
+ function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
97
+ i.settings.scrollingThreshold
98
+ );
99
+ }
100
+
101
+ function setScrollingClassInstantly(i, x) {
102
+ addScrollingClass(i, x);
103
+ removeScrollingClass(i, x);
104
+ }
105
+
106
+ var EventElement = function EventElement(element) {
107
+ this.element = element;
108
+ this.handlers = {};
109
+ };
110
+
111
+ var prototypeAccessors = { isEmpty: { configurable: true } };
112
+
113
+ EventElement.prototype.bind = function bind (eventName, handler) {
114
+ if (typeof this.handlers[eventName] === 'undefined') {
115
+ this.handlers[eventName] = [];
116
+ }
117
+ this.handlers[eventName].push(handler);
118
+ this.element.addEventListener(eventName, handler, false);
119
+ };
120
+
121
+ EventElement.prototype.unbind = function unbind (eventName, target) {
122
+ var this$1 = this;
123
+
124
+ this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
125
+ if (target && handler !== target) {
126
+ return true;
127
+ }
128
+ this$1.element.removeEventListener(eventName, handler, false);
129
+ return false;
130
+ });
131
+ };
132
+
133
+ EventElement.prototype.unbindAll = function unbindAll () {
134
+ var this$1 = this;
135
+
136
+ for (var name in this$1.handlers) {
137
+ this$1.unbind(name);
138
+ }
139
+ };
140
+
141
+ prototypeAccessors.isEmpty.get = function () {
142
+ var this$1 = this;
143
+
144
+ return Object.keys(this.handlers).every(
145
+ function (key) { return this$1.handlers[key].length === 0; }
146
+ );
147
+ };
148
+
149
+ Object.defineProperties( EventElement.prototype, prototypeAccessors );
150
+
151
+ var EventManager = function EventManager() {
152
+ this.eventElements = [];
153
+ };
154
+
155
+ EventManager.prototype.eventElement = function eventElement (element) {
156
+ var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
157
+ if (!ee) {
158
+ ee = new EventElement(element);
159
+ this.eventElements.push(ee);
160
+ }
161
+ return ee;
162
+ };
163
+
164
+ EventManager.prototype.bind = function bind (element, eventName, handler) {
165
+ this.eventElement(element).bind(eventName, handler);
166
+ };
167
+
168
+ EventManager.prototype.unbind = function unbind (element, eventName, handler) {
169
+ var ee = this.eventElement(element);
170
+ ee.unbind(eventName, handler);
171
+
172
+ if (ee.isEmpty) {
173
+ // remove
174
+ this.eventElements.splice(this.eventElements.indexOf(ee), 1);
175
+ }
176
+ };
177
+
178
+ EventManager.prototype.unbindAll = function unbindAll () {
179
+ this.eventElements.forEach(function (e) { return e.unbindAll(); });
180
+ this.eventElements = [];
181
+ };
182
+
183
+ EventManager.prototype.once = function once (element, eventName, handler) {
184
+ var ee = this.eventElement(element);
185
+ var onceHandler = function (evt) {
186
+ ee.unbind(eventName, onceHandler);
187
+ handler(evt);
188
+ };
189
+ ee.bind(eventName, onceHandler);
190
+ };
191
+
192
+ function createEvent(name) {
193
+ if (typeof window.CustomEvent === 'function') {
194
+ return new CustomEvent(name);
195
+ } else {
196
+ var evt = document.createEvent('CustomEvent');
197
+ evt.initCustomEvent(name, false, false, undefined);
198
+ return evt;
199
+ }
200
+ }
201
+
202
+ var processScrollDiff = function(
203
+ i,
204
+ axis,
205
+ diff,
206
+ useScrollingClass,
207
+ forceFireReachEvent
208
+ ) {
209
+ if ( useScrollingClass === void 0 ) useScrollingClass = true;
210
+ if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
211
+
212
+ var fields;
213
+ if (axis === 'top') {
214
+ fields = [
215
+ 'contentHeight',
216
+ 'containerHeight',
217
+ 'scrollTop',
218
+ 'y',
219
+ 'up',
220
+ 'down' ];
221
+ } else if (axis === 'left') {
222
+ fields = [
223
+ 'contentWidth',
224
+ 'containerWidth',
225
+ 'scrollLeft',
226
+ 'x',
227
+ 'left',
228
+ 'right' ];
229
+ } else {
230
+ throw new Error('A proper axis should be provided');
231
+ }
232
+
233
+ processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
234
+ };
235
+
236
+ function processScrollDiff$1(
237
+ i,
238
+ diff,
239
+ ref,
240
+ useScrollingClass,
241
+ forceFireReachEvent
242
+ ) {
243
+ var contentHeight = ref[0];
244
+ var containerHeight = ref[1];
245
+ var scrollTop = ref[2];
246
+ var y = ref[3];
247
+ var up = ref[4];
248
+ var down = ref[5];
249
+ if ( useScrollingClass === void 0 ) useScrollingClass = true;
250
+ if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
251
+
252
+ var element = i.element;
253
+
254
+ // reset reach
255
+ i.reach[y] = null;
256
+
257
+ // 1 for subpixel rounding
258
+ if (element[scrollTop] < 1) {
259
+ i.reach[y] = 'start';
260
+ }
261
+
262
+ // 1 for subpixel rounding
263
+ if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
264
+ i.reach[y] = 'end';
265
+ }
266
+
267
+ if (diff) {
268
+ element.dispatchEvent(createEvent(("ps-scroll-" + y)));
269
+
270
+ if (diff < 0) {
271
+ element.dispatchEvent(createEvent(("ps-scroll-" + up)));
272
+ } else if (diff > 0) {
273
+ element.dispatchEvent(createEvent(("ps-scroll-" + down)));
274
+ }
275
+
276
+ if (useScrollingClass) {
277
+ setScrollingClassInstantly(i, y);
278
+ }
279
+ }
280
+
281
+ if (i.reach[y] && (diff || forceFireReachEvent)) {
282
+ element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
283
+ }
284
+ }
285
+
286
+ function toInt(x) {
287
+ return parseInt(x, 10) || 0;
288
+ }
289
+
290
+ function isEditable(el) {
291
+ return (
292
+ matches(el, 'input,[contenteditable]') ||
293
+ matches(el, 'select,[contenteditable]') ||
294
+ matches(el, 'textarea,[contenteditable]') ||
295
+ matches(el, 'button,[contenteditable]')
296
+ );
297
+ }
298
+
299
+ function outerWidth(element) {
300
+ var styles = get(element);
301
+ return (
302
+ toInt(styles.width) +
303
+ toInt(styles.paddingLeft) +
304
+ toInt(styles.paddingRight) +
305
+ toInt(styles.borderLeftWidth) +
306
+ toInt(styles.borderRightWidth)
307
+ );
308
+ }
309
+
310
+ var env = {
311
+ isWebKit:
312
+ typeof document !== 'undefined' &&
313
+ 'WebkitAppearance' in document.documentElement.style,
314
+ supportsTouch:
315
+ typeof window !== 'undefined' &&
316
+ ('ontouchstart' in window ||
317
+ (window.DocumentTouch && document instanceof window.DocumentTouch)),
318
+ supportsIePointer:
319
+ typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
320
+ isChrome:
321
+ typeof navigator !== 'undefined' &&
322
+ /Chrome/i.test(navigator && navigator.userAgent),
323
+ };
324
+
325
+ var updateGeometry = function(i) {
326
+ var element = i.element;
327
+ var roundedScrollTop = Math.floor(element.scrollTop);
328
+
329
+ i.containerWidth = element.clientWidth;
330
+ i.containerHeight = element.clientHeight;
331
+ i.contentWidth = element.scrollWidth;
332
+ i.contentHeight = element.scrollHeight;
333
+
334
+ if (!element.contains(i.scrollbarXRail)) {
335
+ // clean up and append
336
+ queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
337
+ );
338
+ element.appendChild(i.scrollbarXRail);
339
+ }
340
+ if (!element.contains(i.scrollbarYRail)) {
341
+ // clean up and append
342
+ queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
343
+ );
344
+ element.appendChild(i.scrollbarYRail);
345
+ }
346
+
347
+ if (
348
+ !i.settings.suppressScrollX &&
349
+ i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
350
+ ) {
351
+ i.scrollbarXActive = true;
352
+ i.railXWidth = i.containerWidth - i.railXMarginWidth;
353
+ i.railXRatio = i.containerWidth / i.railXWidth;
354
+ i.scrollbarXWidth = getThumbSize(
355
+ i,
356
+ toInt(i.railXWidth * i.containerWidth / i.contentWidth)
357
+ );
358
+ i.scrollbarXLeft = toInt(
359
+ (i.negativeScrollAdjustment + element.scrollLeft) *
360
+ (i.railXWidth - i.scrollbarXWidth) /
361
+ (i.contentWidth - i.containerWidth)
362
+ );
363
+ } else {
364
+ i.scrollbarXActive = false;
365
+ }
366
+
367
+ if (
368
+ !i.settings.suppressScrollY &&
369
+ i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
370
+ ) {
371
+ i.scrollbarYActive = true;
372
+ i.railYHeight = i.containerHeight - i.railYMarginHeight;
373
+ i.railYRatio = i.containerHeight / i.railYHeight;
374
+ i.scrollbarYHeight = getThumbSize(
375
+ i,
376
+ toInt(i.railYHeight * i.containerHeight / i.contentHeight)
377
+ );
378
+ i.scrollbarYTop = toInt(
379
+ roundedScrollTop *
380
+ (i.railYHeight - i.scrollbarYHeight) /
381
+ (i.contentHeight - i.containerHeight)
382
+ );
383
+ } else {
384
+ i.scrollbarYActive = false;
385
+ }
386
+
387
+ if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
388
+ i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
389
+ }
390
+ if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
391
+ i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
392
+ }
393
+
394
+ updateCss(element, i);
395
+
396
+ if (i.scrollbarXActive) {
397
+ element.classList.add(cls.state.active('x'));
398
+ } else {
399
+ element.classList.remove(cls.state.active('x'));
400
+ i.scrollbarXWidth = 0;
401
+ i.scrollbarXLeft = 0;
402
+ element.scrollLeft = 0;
403
+ }
404
+ if (i.scrollbarYActive) {
405
+ element.classList.add(cls.state.active('y'));
406
+ } else {
407
+ element.classList.remove(cls.state.active('y'));
408
+ i.scrollbarYHeight = 0;
409
+ i.scrollbarYTop = 0;
410
+ element.scrollTop = 0;
411
+ }
412
+ };
413
+
414
+ function getThumbSize(i, thumbSize) {
415
+ if (i.settings.minScrollbarLength) {
416
+ thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
417
+ }
418
+ if (i.settings.maxScrollbarLength) {
419
+ thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
420
+ }
421
+ return thumbSize;
422
+ }
423
+
424
+ function updateCss(element, i) {
425
+ var xRailOffset = { width: i.railXWidth };
426
+ var roundedScrollTop = Math.floor(element.scrollTop);
427
+
428
+ if (i.isRtl) {
429
+ xRailOffset.left =
430
+ i.negativeScrollAdjustment +
431
+ element.scrollLeft +
432
+ i.containerWidth -
433
+ i.contentWidth;
434
+ } else {
435
+ xRailOffset.left = element.scrollLeft;
436
+ }
437
+ if (i.isScrollbarXUsingBottom) {
438
+ xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
439
+ } else {
440
+ xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
441
+ }
442
+ set(i.scrollbarXRail, xRailOffset);
443
+
444
+ var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
445
+ if (i.isScrollbarYUsingRight) {
446
+ if (i.isRtl) {
447
+ yRailOffset.right =
448
+ i.contentWidth -
449
+ (i.negativeScrollAdjustment + element.scrollLeft) -
450
+ i.scrollbarYRight -
451
+ i.scrollbarYOuterWidth;
452
+ } else {
453
+ yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
454
+ }
455
+ } else {
456
+ if (i.isRtl) {
457
+ yRailOffset.left =
458
+ i.negativeScrollAdjustment +
459
+ element.scrollLeft +
460
+ i.containerWidth * 2 -
461
+ i.contentWidth -
462
+ i.scrollbarYLeft -
463
+ i.scrollbarYOuterWidth;
464
+ } else {
465
+ yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
466
+ }
467
+ }
468
+ set(i.scrollbarYRail, yRailOffset);
469
+
470
+ set(i.scrollbarX, {
471
+ left: i.scrollbarXLeft,
472
+ width: i.scrollbarXWidth - i.railBorderXWidth,
473
+ });
474
+ set(i.scrollbarY, {
475
+ top: i.scrollbarYTop,
476
+ height: i.scrollbarYHeight - i.railBorderYWidth,
477
+ });
478
+ }
479
+
480
+ var clickRail = function(i) {
481
+ i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
482
+ i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
483
+ var positionTop =
484
+ e.pageY -
485
+ window.pageYOffset -
486
+ i.scrollbarYRail.getBoundingClientRect().top;
487
+ var direction = positionTop > i.scrollbarYTop ? 1 : -1;
488
+
489
+ i.element.scrollTop += direction * i.containerHeight;
490
+ updateGeometry(i);
491
+
492
+ e.stopPropagation();
493
+ });
494
+
495
+ i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
496
+ i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
497
+ var positionLeft =
498
+ e.pageX -
499
+ window.pageXOffset -
500
+ i.scrollbarXRail.getBoundingClientRect().left;
501
+ var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
502
+
503
+ i.element.scrollLeft += direction * i.containerWidth;
504
+ updateGeometry(i);
505
+
506
+ e.stopPropagation();
507
+ });
508
+ };
509
+
510
+ var dragThumb = function(i) {
511
+ bindMouseScrollHandler(i, [
512
+ 'containerWidth',
513
+ 'contentWidth',
514
+ 'pageX',
515
+ 'railXWidth',
516
+ 'scrollbarX',
517
+ 'scrollbarXWidth',
518
+ 'scrollLeft',
519
+ 'x',
520
+ 'scrollbarXRail' ]);
521
+ bindMouseScrollHandler(i, [
522
+ 'containerHeight',
523
+ 'contentHeight',
524
+ 'pageY',
525
+ 'railYHeight',
526
+ 'scrollbarY',
527
+ 'scrollbarYHeight',
528
+ 'scrollTop',
529
+ 'y',
530
+ 'scrollbarYRail' ]);
531
+ };
532
+
533
+ function bindMouseScrollHandler(
534
+ i,
535
+ ref
536
+ ) {
537
+ var containerHeight = ref[0];
538
+ var contentHeight = ref[1];
539
+ var pageY = ref[2];
540
+ var railYHeight = ref[3];
541
+ var scrollbarY = ref[4];
542
+ var scrollbarYHeight = ref[5];
543
+ var scrollTop = ref[6];
544
+ var y = ref[7];
545
+ var scrollbarYRail = ref[8];
546
+
547
+ var element = i.element;
548
+
549
+ var startingScrollTop = null;
550
+ var startingMousePageY = null;
551
+ var scrollBy = null;
552
+
553
+ function mouseMoveHandler(e) {
554
+ element[scrollTop] =
555
+ startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
556
+ addScrollingClass(i, y);
557
+ updateGeometry(i);
558
+
559
+ e.stopPropagation();
560
+ e.preventDefault();
561
+ }
562
+
563
+ function mouseUpHandler() {
564
+ removeScrollingClass(i, y);
565
+ i[scrollbarYRail].classList.remove(cls.state.clicking);
566
+ i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
567
+ }
568
+
569
+ i.event.bind(i[scrollbarY], 'mousedown', function (e) {
570
+ startingScrollTop = element[scrollTop];
571
+ startingMousePageY = e[pageY];
572
+ scrollBy =
573
+ (i[contentHeight] - i[containerHeight]) /
574
+ (i[railYHeight] - i[scrollbarYHeight]);
575
+
576
+ i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
577
+ i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
578
+
579
+ i[scrollbarYRail].classList.add(cls.state.clicking);
580
+
581
+ e.stopPropagation();
582
+ e.preventDefault();
583
+ });
584
+ }
585
+
586
+ var keyboard = function(i) {
587
+ var element = i.element;
588
+
589
+ var elementHovered = function () { return matches(element, ':hover'); };
590
+ var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
591
+
592
+ function shouldPreventDefault(deltaX, deltaY) {
593
+ var scrollTop = Math.floor(element.scrollTop);
594
+ if (deltaX === 0) {
595
+ if (!i.scrollbarYActive) {
596
+ return false;
597
+ }
598
+ if (
599
+ (scrollTop === 0 && deltaY > 0) ||
600
+ (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
601
+ ) {
602
+ return !i.settings.wheelPropagation;
603
+ }
604
+ }
605
+
606
+ var scrollLeft = element.scrollLeft;
607
+ if (deltaY === 0) {
608
+ if (!i.scrollbarXActive) {
609
+ return false;
610
+ }
611
+ if (
612
+ (scrollLeft === 0 && deltaX < 0) ||
613
+ (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
614
+ ) {
615
+ return !i.settings.wheelPropagation;
616
+ }
617
+ }
618
+ return true;
619
+ }
620
+
621
+ i.event.bind(i.ownerDocument, 'keydown', function (e) {
622
+ if (
623
+ (e.isDefaultPrevented && e.isDefaultPrevented()) ||
624
+ e.defaultPrevented
625
+ ) {
626
+ return;
627
+ }
628
+
629
+ if (!elementHovered() && !scrollbarFocused()) {
630
+ return;
631
+ }
632
+
633
+ var activeElement = document.activeElement
634
+ ? document.activeElement
635
+ : i.ownerDocument.activeElement;
636
+ if (activeElement) {
637
+ if (activeElement.tagName === 'IFRAME') {
638
+ activeElement = activeElement.contentDocument.activeElement;
639
+ } else {
640
+ // go deeper if element is a webcomponent
641
+ while (activeElement.shadowRoot) {
642
+ activeElement = activeElement.shadowRoot.activeElement;
643
+ }
644
+ }
645
+ if (isEditable(activeElement)) {
646
+ return;
647
+ }
648
+ }
649
+
650
+ var deltaX = 0;
651
+ var deltaY = 0;
652
+
653
+ switch (e.which) {
654
+ case 37: // left
655
+ if (e.metaKey) {
656
+ deltaX = -i.contentWidth;
657
+ } else if (e.altKey) {
658
+ deltaX = -i.containerWidth;
659
+ } else {
660
+ deltaX = -30;
661
+ }
662
+ break;
663
+ case 38: // up
664
+ if (e.metaKey) {
665
+ deltaY = i.contentHeight;
666
+ } else if (e.altKey) {
667
+ deltaY = i.containerHeight;
668
+ } else {
669
+ deltaY = 30;
670
+ }
671
+ break;
672
+ case 39: // right
673
+ if (e.metaKey) {
674
+ deltaX = i.contentWidth;
675
+ } else if (e.altKey) {
676
+ deltaX = i.containerWidth;
677
+ } else {
678
+ deltaX = 30;
679
+ }
680
+ break;
681
+ case 40: // down
682
+ if (e.metaKey) {
683
+ deltaY = -i.contentHeight;
684
+ } else if (e.altKey) {
685
+ deltaY = -i.containerHeight;
686
+ } else {
687
+ deltaY = -30;
688
+ }
689
+ break;
690
+ case 32: // space bar
691
+ if (e.shiftKey) {
692
+ deltaY = i.containerHeight;
693
+ } else {
694
+ deltaY = -i.containerHeight;
695
+ }
696
+ break;
697
+ case 33: // page up
698
+ deltaY = i.containerHeight;
699
+ break;
700
+ case 34: // page down
701
+ deltaY = -i.containerHeight;
702
+ break;
703
+ case 36: // home
704
+ deltaY = i.contentHeight;
705
+ break;
706
+ case 35: // end
707
+ deltaY = -i.contentHeight;
708
+ break;
709
+ default:
710
+ return;
711
+ }
712
+
713
+ if (i.settings.suppressScrollX && deltaX !== 0) {
714
+ return;
715
+ }
716
+ if (i.settings.suppressScrollY && deltaY !== 0) {
717
+ return;
718
+ }
719
+
720
+ element.scrollTop -= deltaY;
721
+ element.scrollLeft += deltaX;
722
+ updateGeometry(i);
723
+
724
+ if (shouldPreventDefault(deltaX, deltaY)) {
725
+ e.preventDefault();
726
+ }
727
+ });
728
+ };
729
+
730
+ var wheel = function(i) {
731
+ var element = i.element;
732
+
733
+ function shouldPreventDefault(deltaX, deltaY) {
734
+ var roundedScrollTop = Math.floor(element.scrollTop);
735
+ var isTop = element.scrollTop === 0;
736
+ var isBottom =
737
+ roundedScrollTop + element.offsetHeight === element.scrollHeight;
738
+ var isLeft = element.scrollLeft === 0;
739
+ var isRight =
740
+ element.scrollLeft + element.offsetWidth === element.scrollWidth;
741
+
742
+ var hitsBound;
743
+
744
+ // pick axis with primary direction
745
+ if (Math.abs(deltaY) > Math.abs(deltaX)) {
746
+ hitsBound = isTop || isBottom;
747
+ } else {
748
+ hitsBound = isLeft || isRight;
749
+ }
750
+
751
+ return hitsBound ? !i.settings.wheelPropagation : true;
752
+ }
753
+
754
+ function getDeltaFromEvent(e) {
755
+ var deltaX = e.deltaX;
756
+ var deltaY = -1 * e.deltaY;
757
+
758
+ if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
759
+ // OS X Safari
760
+ deltaX = -1 * e.wheelDeltaX / 6;
761
+ deltaY = e.wheelDeltaY / 6;
762
+ }
763
+
764
+ if (e.deltaMode && e.deltaMode === 1) {
765
+ // Firefox in deltaMode 1: Line scrolling
766
+ deltaX *= 10;
767
+ deltaY *= 10;
768
+ }
769
+
770
+ if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
771
+ // IE in some mouse drivers
772
+ deltaX = 0;
773
+ deltaY = e.wheelDelta;
774
+ }
775
+
776
+ if (e.shiftKey) {
777
+ // reverse axis with shift key
778
+ return [-deltaY, -deltaX];
779
+ }
780
+ return [deltaX, deltaY];
781
+ }
782
+
783
+ function shouldBeConsumedByChild(target, deltaX, deltaY) {
784
+ // FIXME: this is a workaround for <select> issue in FF and IE #571
785
+ if (!env.isWebKit && element.querySelector('select:focus')) {
786
+ return true;
787
+ }
788
+
789
+ if (!element.contains(target)) {
790
+ return false;
791
+ }
792
+
793
+ var cursor = target;
794
+
795
+ while (cursor && cursor !== element) {
796
+ if (cursor.classList.contains(cls.element.consuming)) {
797
+ return true;
798
+ }
799
+
800
+ var style = get(cursor);
801
+ var overflow = [style.overflow, style.overflowX, style.overflowY].join(
802
+ ''
803
+ );
804
+
805
+ // if scrollable
806
+ if (overflow.match(/(scroll|auto)/)) {
807
+ var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
808
+ if (maxScrollTop > 0) {
809
+ if (
810
+ !(cursor.scrollTop === 0 && deltaY > 0) &&
811
+ !(cursor.scrollTop === maxScrollTop && deltaY < 0)
812
+ ) {
813
+ return true;
814
+ }
815
+ }
816
+ var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
817
+ if (maxScrollLeft > 0) {
818
+ if (
819
+ !(cursor.scrollLeft === 0 && deltaX < 0) &&
820
+ !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
821
+ ) {
822
+ return true;
823
+ }
824
+ }
825
+ }
826
+
827
+ cursor = cursor.parentNode;
828
+ }
829
+
830
+ return false;
831
+ }
832
+
833
+ function mousewheelHandler(e) {
834
+ var ref = getDeltaFromEvent(e);
835
+ var deltaX = ref[0];
836
+ var deltaY = ref[1];
837
+
838
+ if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
839
+ return;
840
+ }
841
+
842
+ var shouldPrevent = false;
843
+ if (!i.settings.useBothWheelAxes) {
844
+ // deltaX will only be used for horizontal scrolling and deltaY will
845
+ // only be used for vertical scrolling - this is the default
846
+ element.scrollTop -= deltaY * i.settings.wheelSpeed;
847
+ element.scrollLeft += deltaX * i.settings.wheelSpeed;
848
+ } else if (i.scrollbarYActive && !i.scrollbarXActive) {
849
+ // only vertical scrollbar is active and useBothWheelAxes option is
850
+ // active, so let's scroll vertical bar using both mouse wheel axes
851
+ if (deltaY) {
852
+ element.scrollTop -= deltaY * i.settings.wheelSpeed;
853
+ } else {
854
+ element.scrollTop += deltaX * i.settings.wheelSpeed;
855
+ }
856
+ shouldPrevent = true;
857
+ } else if (i.scrollbarXActive && !i.scrollbarYActive) {
858
+ // useBothWheelAxes and only horizontal bar is active, so use both
859
+ // wheel axes for horizontal bar
860
+ if (deltaX) {
861
+ element.scrollLeft += deltaX * i.settings.wheelSpeed;
862
+ } else {
863
+ element.scrollLeft -= deltaY * i.settings.wheelSpeed;
864
+ }
865
+ shouldPrevent = true;
866
+ }
867
+
868
+ updateGeometry(i);
869
+
870
+ shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
871
+ if (shouldPrevent && !e.ctrlKey) {
872
+ e.stopPropagation();
873
+ e.preventDefault();
874
+ }
875
+ }
876
+
877
+ if (typeof window.onwheel !== 'undefined') {
878
+ i.event.bind(element, 'wheel', mousewheelHandler);
879
+ } else if (typeof window.onmousewheel !== 'undefined') {
880
+ i.event.bind(element, 'mousewheel', mousewheelHandler);
881
+ }
882
+ };
883
+
884
+ var touch = function(i) {
885
+ if (!env.supportsTouch && !env.supportsIePointer) {
886
+ return;
887
+ }
888
+
889
+ var element = i.element;
890
+
891
+ function shouldPrevent(deltaX, deltaY) {
892
+ var scrollTop = Math.floor(element.scrollTop);
893
+ var scrollLeft = element.scrollLeft;
894
+ var magnitudeX = Math.abs(deltaX);
895
+ var magnitudeY = Math.abs(deltaY);
896
+
897
+ if (magnitudeY > magnitudeX) {
898
+ // user is perhaps trying to swipe up/down the page
899
+
900
+ if (
901
+ (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
902
+ (deltaY > 0 && scrollTop === 0)
903
+ ) {
904
+ // set prevent for mobile Chrome refresh
905
+ return window.scrollY === 0 && deltaY > 0 && env.isChrome;
906
+ }
907
+ } else if (magnitudeX > magnitudeY) {
908
+ // user is perhaps trying to swipe left/right across the page
909
+
910
+ if (
911
+ (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
912
+ (deltaX > 0 && scrollLeft === 0)
913
+ ) {
914
+ return true;
915
+ }
916
+ }
917
+
918
+ return true;
919
+ }
920
+
921
+ function applyTouchMove(differenceX, differenceY) {
922
+ element.scrollTop -= differenceY;
923
+ element.scrollLeft -= differenceX;
924
+
925
+ updateGeometry(i);
926
+ }
927
+
928
+ var startOffset = {};
929
+ var startTime = 0;
930
+ var speed = {};
931
+ var easingLoop = null;
932
+
933
+ function getTouch(e) {
934
+ if (e.targetTouches) {
935
+ return e.targetTouches[0];
936
+ } else {
937
+ // Maybe IE pointer
938
+ return e;
939
+ }
940
+ }
941
+
942
+ function shouldHandle(e) {
943
+ if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
944
+ return false;
945
+ }
946
+ if (e.targetTouches && e.targetTouches.length === 1) {
947
+ return true;
948
+ }
949
+ if (
950
+ e.pointerType &&
951
+ e.pointerType !== 'mouse' &&
952
+ e.pointerType !== e.MSPOINTER_TYPE_MOUSE
953
+ ) {
954
+ return true;
955
+ }
956
+ return false;
957
+ }
958
+
959
+ function touchStart(e) {
960
+ if (!shouldHandle(e)) {
961
+ return;
962
+ }
963
+
964
+ var touch = getTouch(e);
965
+
966
+ startOffset.pageX = touch.pageX;
967
+ startOffset.pageY = touch.pageY;
968
+
969
+ startTime = new Date().getTime();
970
+
971
+ if (easingLoop !== null) {
972
+ clearInterval(easingLoop);
973
+ }
974
+ }
975
+
976
+ function shouldBeConsumedByChild(target, deltaX, deltaY) {
977
+ if (!element.contains(target)) {
978
+ return false;
979
+ }
980
+
981
+ var cursor = target;
982
+
983
+ while (cursor && cursor !== element) {
984
+ if (cursor.classList.contains(cls.element.consuming)) {
985
+ return true;
986
+ }
987
+
988
+ var style = get(cursor);
989
+ var overflow = [style.overflow, style.overflowX, style.overflowY].join(
990
+ ''
991
+ );
992
+
993
+ // if scrollable
994
+ if (overflow.match(/(scroll|auto)/)) {
995
+ var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
996
+ if (maxScrollTop > 0) {
997
+ if (
998
+ !(cursor.scrollTop === 0 && deltaY > 0) &&
999
+ !(cursor.scrollTop === maxScrollTop && deltaY < 0)
1000
+ ) {
1001
+ return true;
1002
+ }
1003
+ }
1004
+ var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
1005
+ if (maxScrollLeft > 0) {
1006
+ if (
1007
+ !(cursor.scrollLeft === 0 && deltaX < 0) &&
1008
+ !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
1009
+ ) {
1010
+ return true;
1011
+ }
1012
+ }
1013
+ }
1014
+
1015
+ cursor = cursor.parentNode;
1016
+ }
1017
+
1018
+ return false;
1019
+ }
1020
+
1021
+ function touchMove(e) {
1022
+ if (shouldHandle(e)) {
1023
+ var touch = getTouch(e);
1024
+
1025
+ var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
1026
+
1027
+ var differenceX = currentOffset.pageX - startOffset.pageX;
1028
+ var differenceY = currentOffset.pageY - startOffset.pageY;
1029
+
1030
+ if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
1031
+ return;
1032
+ }
1033
+
1034
+ applyTouchMove(differenceX, differenceY);
1035
+ startOffset = currentOffset;
1036
+
1037
+ var currentTime = new Date().getTime();
1038
+
1039
+ var timeGap = currentTime - startTime;
1040
+ if (timeGap > 0) {
1041
+ speed.x = differenceX / timeGap;
1042
+ speed.y = differenceY / timeGap;
1043
+ startTime = currentTime;
1044
+ }
1045
+
1046
+ if (shouldPrevent(differenceX, differenceY)) {
1047
+ e.preventDefault();
1048
+ }
1049
+ }
1050
+ }
1051
+ function touchEnd() {
1052
+ if (i.settings.swipeEasing) {
1053
+ clearInterval(easingLoop);
1054
+ easingLoop = setInterval(function() {
1055
+ if (i.isInitialized) {
1056
+ clearInterval(easingLoop);
1057
+ return;
1058
+ }
1059
+
1060
+ if (!speed.x && !speed.y) {
1061
+ clearInterval(easingLoop);
1062
+ return;
1063
+ }
1064
+
1065
+ if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
1066
+ clearInterval(easingLoop);
1067
+ return;
1068
+ }
1069
+
1070
+ applyTouchMove(speed.x * 30, speed.y * 30);
1071
+
1072
+ speed.x *= 0.8;
1073
+ speed.y *= 0.8;
1074
+ }, 10);
1075
+ }
1076
+ }
1077
+
1078
+ if (env.supportsTouch) {
1079
+ i.event.bind(element, 'touchstart', touchStart);
1080
+ i.event.bind(element, 'touchmove', touchMove);
1081
+ i.event.bind(element, 'touchend', touchEnd);
1082
+ } else if (env.supportsIePointer) {
1083
+ if (window.PointerEvent) {
1084
+ i.event.bind(element, 'pointerdown', touchStart);
1085
+ i.event.bind(element, 'pointermove', touchMove);
1086
+ i.event.bind(element, 'pointerup', touchEnd);
1087
+ } else if (window.MSPointerEvent) {
1088
+ i.event.bind(element, 'MSPointerDown', touchStart);
1089
+ i.event.bind(element, 'MSPointerMove', touchMove);
1090
+ i.event.bind(element, 'MSPointerUp', touchEnd);
1091
+ }
1092
+ }
1093
+ };
1094
+
1095
+ var defaultSettings = function () { return ({
1096
+ handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
1097
+ maxScrollbarLength: null,
1098
+ minScrollbarLength: null,
1099
+ scrollingThreshold: 1000,
1100
+ scrollXMarginOffset: 0,
1101
+ scrollYMarginOffset: 0,
1102
+ suppressScrollX: false,
1103
+ suppressScrollY: false,
1104
+ swipeEasing: true,
1105
+ useBothWheelAxes: false,
1106
+ wheelPropagation: true,
1107
+ wheelSpeed: 1,
1108
+ }); };
1109
+
1110
+ var handlers = {
1111
+ 'click-rail': clickRail,
1112
+ 'drag-thumb': dragThumb,
1113
+ keyboard: keyboard,
1114
+ wheel: wheel,
1115
+ touch: touch,
1116
+ };
1117
+
1118
+ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
1119
+ var this$1 = this;
1120
+ if ( userSettings === void 0 ) userSettings = {};
1121
+
1122
+ if (typeof element === 'string') {
1123
+ element = document.querySelector(element);
1124
+ }
1125
+
1126
+ if (!element || !element.nodeName) {
1127
+ throw new Error('no element is specified to initialize PerfectScrollbar');
1128
+ }
1129
+
1130
+ this.element = element;
1131
+
1132
+ element.classList.add(cls.main);
1133
+
1134
+ this.settings = defaultSettings();
1135
+ for (var key in userSettings) {
1136
+ this$1.settings[key] = userSettings[key];
1137
+ }
1138
+
1139
+ this.containerWidth = null;
1140
+ this.containerHeight = null;
1141
+ this.contentWidth = null;
1142
+ this.contentHeight = null;
1143
+
1144
+ var focus = function () { return element.classList.add(cls.state.focus); };
1145
+ var blur = function () { return element.classList.remove(cls.state.focus); };
1146
+
1147
+ this.isRtl = get(element).direction === 'rtl';
1148
+ this.isNegativeScroll = (function () {
1149
+ var originalScrollLeft = element.scrollLeft;
1150
+ var result = null;
1151
+ element.scrollLeft = -1;
1152
+ result = element.scrollLeft < 0;
1153
+ element.scrollLeft = originalScrollLeft;
1154
+ return result;
1155
+ })();
1156
+ this.negativeScrollAdjustment = this.isNegativeScroll
1157
+ ? element.scrollWidth - element.clientWidth
1158
+ : 0;
1159
+ this.event = new EventManager();
1160
+ this.ownerDocument = element.ownerDocument || document;
1161
+
1162
+ this.scrollbarXRail = div(cls.element.rail('x'));
1163
+ element.appendChild(this.scrollbarXRail);
1164
+ this.scrollbarX = div(cls.element.thumb('x'));
1165
+ this.scrollbarXRail.appendChild(this.scrollbarX);
1166
+ this.scrollbarX.setAttribute('tabindex', 0);
1167
+ this.event.bind(this.scrollbarX, 'focus', focus);
1168
+ this.event.bind(this.scrollbarX, 'blur', blur);
1169
+ this.scrollbarXActive = null;
1170
+ this.scrollbarXWidth = null;
1171
+ this.scrollbarXLeft = null;
1172
+ var railXStyle = get(this.scrollbarXRail);
1173
+ this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
1174
+ if (isNaN(this.scrollbarXBottom)) {
1175
+ this.isScrollbarXUsingBottom = false;
1176
+ this.scrollbarXTop = toInt(railXStyle.top);
1177
+ } else {
1178
+ this.isScrollbarXUsingBottom = true;
1179
+ }
1180
+ this.railBorderXWidth =
1181
+ toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
1182
+ // Set rail to display:block to calculate margins
1183
+ set(this.scrollbarXRail, { display: 'block' });
1184
+ this.railXMarginWidth =
1185
+ toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
1186
+ set(this.scrollbarXRail, { display: '' });
1187
+ this.railXWidth = null;
1188
+ this.railXRatio = null;
1189
+
1190
+ this.scrollbarYRail = div(cls.element.rail('y'));
1191
+ element.appendChild(this.scrollbarYRail);
1192
+ this.scrollbarY = div(cls.element.thumb('y'));
1193
+ this.scrollbarYRail.appendChild(this.scrollbarY);
1194
+ this.scrollbarY.setAttribute('tabindex', 0);
1195
+ this.event.bind(this.scrollbarY, 'focus', focus);
1196
+ this.event.bind(this.scrollbarY, 'blur', blur);
1197
+ this.scrollbarYActive = null;
1198
+ this.scrollbarYHeight = null;
1199
+ this.scrollbarYTop = null;
1200
+ var railYStyle = get(this.scrollbarYRail);
1201
+ this.scrollbarYRight = parseInt(railYStyle.right, 10);
1202
+ if (isNaN(this.scrollbarYRight)) {
1203
+ this.isScrollbarYUsingRight = false;
1204
+ this.scrollbarYLeft = toInt(railYStyle.left);
1205
+ } else {
1206
+ this.isScrollbarYUsingRight = true;
1207
+ }
1208
+ this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
1209
+ this.railBorderYWidth =
1210
+ toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
1211
+ set(this.scrollbarYRail, { display: 'block' });
1212
+ this.railYMarginHeight =
1213
+ toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
1214
+ set(this.scrollbarYRail, { display: '' });
1215
+ this.railYHeight = null;
1216
+ this.railYRatio = null;
1217
+
1218
+ this.reach = {
1219
+ x:
1220
+ element.scrollLeft <= 0
1221
+ ? 'start'
1222
+ : element.scrollLeft >= this.contentWidth - this.containerWidth
1223
+ ? 'end'
1224
+ : null,
1225
+ y:
1226
+ element.scrollTop <= 0
1227
+ ? 'start'
1228
+ : element.scrollTop >= this.contentHeight - this.containerHeight
1229
+ ? 'end'
1230
+ : null,
1231
+ };
1232
+
1233
+ this.isAlive = true;
1234
+
1235
+ this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
1236
+
1237
+ this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
1238
+ this.lastScrollLeft = element.scrollLeft; // for onScroll only
1239
+ this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
1240
+ updateGeometry(this);
1241
+ };
1242
+
1243
+ PerfectScrollbar.prototype.update = function update () {
1244
+ if (!this.isAlive) {
1245
+ return;
1246
+ }
1247
+
1248
+ // Recalcuate negative scrollLeft adjustment
1249
+ this.negativeScrollAdjustment = this.isNegativeScroll
1250
+ ? this.element.scrollWidth - this.element.clientWidth
1251
+ : 0;
1252
+
1253
+ // Recalculate rail margins
1254
+ set(this.scrollbarXRail, { display: 'block' });
1255
+ set(this.scrollbarYRail, { display: 'block' });
1256
+ this.railXMarginWidth =
1257
+ toInt(get(this.scrollbarXRail).marginLeft) +
1258
+ toInt(get(this.scrollbarXRail).marginRight);
1259
+ this.railYMarginHeight =
1260
+ toInt(get(this.scrollbarYRail).marginTop) +
1261
+ toInt(get(this.scrollbarYRail).marginBottom);
1262
+
1263
+ // Hide scrollbars not to affect scrollWidth and scrollHeight
1264
+ set(this.scrollbarXRail, { display: 'none' });
1265
+ set(this.scrollbarYRail, { display: 'none' });
1266
+
1267
+ updateGeometry(this);
1268
+
1269
+ processScrollDiff(this, 'top', 0, false, true);
1270
+ processScrollDiff(this, 'left', 0, false, true);
1271
+
1272
+ set(this.scrollbarXRail, { display: '' });
1273
+ set(this.scrollbarYRail, { display: '' });
1274
+ };
1275
+
1276
+ PerfectScrollbar.prototype.onScroll = function onScroll (e) {
1277
+ if (!this.isAlive) {
1278
+ return;
1279
+ }
1280
+
1281
+ updateGeometry(this);
1282
+ processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
1283
+ processScrollDiff(
1284
+ this,
1285
+ 'left',
1286
+ this.element.scrollLeft - this.lastScrollLeft
1287
+ );
1288
+
1289
+ this.lastScrollTop = Math.floor(this.element.scrollTop);
1290
+ this.lastScrollLeft = this.element.scrollLeft;
1291
+ };
1292
+
1293
+ PerfectScrollbar.prototype.destroy = function destroy () {
1294
+ if (!this.isAlive) {
1295
+ return;
1296
+ }
1297
+
1298
+ this.event.unbindAll();
1299
+ remove(this.scrollbarX);
1300
+ remove(this.scrollbarY);
1301
+ remove(this.scrollbarXRail);
1302
+ remove(this.scrollbarYRail);
1303
+ this.removePsClasses();
1304
+
1305
+ // unset elements
1306
+ this.element = null;
1307
+ this.scrollbarX = null;
1308
+ this.scrollbarY = null;
1309
+ this.scrollbarXRail = null;
1310
+ this.scrollbarYRail = null;
1311
+
1312
+ this.isAlive = false;
1313
+ };
1314
+
1315
+ PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
1316
+ this.element.className = this.element.className
1317
+ .split(' ')
1318
+ .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
1319
+ .join(' ');
1320
+ };
1321
+
1322
+ return PerfectScrollbar;
1323
+
1324
+ })));
base/module-base.php CHANGED
@@ -1,94 +1,94 @@
1
- <?php
2
- namespace WprAddons\Base;
3
-
4
- abstract class Module_Base {
5
-
6
- /**
7
- * @var \ReflectionClass
8
- */
9
- private $reflection;
10
-
11
- private $components = [];
12
-
13
- /**
14
- * @var Module_Base
15
- */
16
- protected static $_instances = [];
17
-
18
- /**
19
- * Throw error on object clone
20
- *
21
- * The whole idea of the singleton design pattern is that there is a single
22
- * object therefore, we don't want the object to be cloned.
23
- *
24
- * @since 1.0
25
- * @return void
26
- */
27
- public function __clone() {
28
- // Cloning instances of the class is forbidden
29
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
30
- }
31
-
32
- /**
33
- * Disable unserializing of the class
34
- *
35
- * @since 1.0
36
- * @return void
37
- */
38
- public function __wakeup() {
39
- // Unserializing instances of the class is forbidden
40
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
41
- }
42
-
43
- public static function class_name() {
44
- return get_called_class();
45
- }
46
-
47
- /**
48
- * @return Module_Base
49
- */
50
- public static function instance() {
51
- if ( empty( static::$_instances[ static::class_name() ] ) ) {
52
- static::$_instances[ static::class_name() ] = new static();
53
- }
54
-
55
- return static::$_instances[ static::class_name() ];
56
- }
57
-
58
- abstract public function get_name();
59
-
60
- public function get_assets_url() {
61
- return WPR_ADDONS_MODULES_URL . $this->get_name() . '/assets/';
62
- }
63
-
64
- public function get_widgets() {
65
- return [];
66
- }
67
-
68
- public function __construct() {
69
- $this->reflection = new \ReflectionClass( $this );
70
-
71
- add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
72
- }
73
-
74
- public function init_widgets() {
75
- $widget_manager = \Elementor\Plugin::instance()->widgets_manager;
76
-
77
- foreach ( $this->get_widgets() as $widget ) {
78
- $class_name = $this->reflection->getNamespaceName() .'\Widgets\\'. $widget;
79
- $widget_manager->register_widget_type( new $class_name() );
80
- }
81
- }
82
-
83
- public function add_component( $id, $instance ) {
84
- $this->components[ $id ] = $instance;
85
- }
86
-
87
- public function get_component( $id ) {
88
- if ( isset( $this->components[ $id ] ) ) {
89
- return $this->components[ $id ];
90
- }
91
-
92
- return false;
93
- }
94
- }
1
+ <?php
2
+ namespace WprAddons\Base;
3
+
4
+ abstract class Module_Base {
5
+
6
+ /**
7
+ * @var \ReflectionClass
8
+ */
9
+ private $reflection;
10
+
11
+ private $components = [];
12
+
13
+ /**
14
+ * @var Module_Base
15
+ */
16
+ protected static $_instances = [];
17
+
18
+ /**
19
+ * Throw error on object clone
20
+ *
21
+ * The whole idea of the singleton design pattern is that there is a single
22
+ * object therefore, we don't want the object to be cloned.
23
+ *
24
+ * @since 1.0
25
+ * @return void
26
+ */
27
+ public function __clone() {
28
+ // Cloning instances of the class is forbidden
29
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
30
+ }
31
+
32
+ /**
33
+ * Disable unserializing of the class
34
+ *
35
+ * @since 1.0
36
+ * @return void
37
+ */
38
+ public function __wakeup() {
39
+ // Unserializing instances of the class is forbidden
40
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
41
+ }
42
+
43
+ public static function class_name() {
44
+ return get_called_class();
45
+ }
46
+
47
+ /**
48
+ * @return Module_Base
49
+ */
50
+ public static function instance() {
51
+ if ( empty( static::$_instances[ static::class_name() ] ) ) {
52
+ static::$_instances[ static::class_name() ] = new static();
53
+ }
54
+
55
+ return static::$_instances[ static::class_name() ];
56
+ }
57
+
58
+ abstract public function get_name();
59
+
60
+ public function get_assets_url() {
61
+ return WPR_ADDONS_MODULES_URL . $this->get_name() . '/assets/';
62
+ }
63
+
64
+ public function get_widgets() {
65
+ return [];
66
+ }
67
+
68
+ public function __construct() {
69
+ $this->reflection = new \ReflectionClass( $this );
70
+
71
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
72
+ }
73
+
74
+ public function init_widgets() {
75
+ $widget_manager = \Elementor\Plugin::instance()->widgets_manager;
76
+
77
+ foreach ( $this->get_widgets() as $widget ) {
78
+ $class_name = $this->reflection->getNamespaceName() .'\Widgets\\'. $widget;
79
+ $widget_manager->register_widget_type( new $class_name() );
80
+ }
81
+ }
82
+
83
+ public function add_component( $id, $instance ) {
84
+ $this->components[ $id ] = $instance;
85
+ }
86
+
87
+ public function get_component( $id ) {
88
+ if ( isset( $this->components[ $id ] ) ) {
89
+ return $this->components[ $id ];
90
+ }
91
+
92
+ return false;
93
+ }
94
+ }
classes/rating-notice.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace WprAddons\Classes;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly
6
+ }
7
+
8
+ class WprRatingNotice {
9
+ private $past_date;
10
+
11
+ public function __construct() {
12
+ global $pagenow;
13
+ $this->past_date = false == get_option('wpr_maybe_later_time') ? strtotime( '-14 days' ) : strtotime('-7 days');
14
+
15
+ if ( current_user_can('administrator') ) {
16
+ if ( empty(get_option('wpr_rating_dismiss_notice', false)) && empty(get_option('wpr_rating_already_rated', false)) ) {
17
+ add_action( 'admin_init', [$this, 'check_plugin_install_time'] );
18
+ }
19
+ }
20
+
21
+ if ( is_admin() ) {
22
+ add_action( 'admin_head', [$this, 'enqueue_scripts' ] );
23
+ }
24
+
25
+ add_action( 'wp_ajax_wpr_rating_dismiss_notice', [$this, 'wpr_rating_dismiss_notice'] );
26
+ add_action( 'wp_ajax_wpr_rating_maybe_later', [$this, 'wpr_rating_maybe_later'] );
27
+ add_action( 'wp_ajax_wpr_rating_already_rated', [$this, 'wpr_rating_already_rated'] );
28
+ add_action( 'wp_ajax_wpr_rating_need_help', [$this, 'wpr_rating_need_help'] );
29
+ }
30
+
31
+ public function check_plugin_install_time() {
32
+ $install_date = get_option('royal_elementor_addons_activation_time');
33
+
34
+ if ( false == get_option('wpr_maybe_later_time') && false !== $install_date && $this->past_date >= $install_date ) {
35
+ add_action( 'admin_notices', [$this, 'render_rating_notice' ]);
36
+ } else if ( false != get_option('wpr_maybe_later_time') && $this->past_date >= get_option('wpr_maybe_later_time') ) {
37
+ add_action( 'admin_notices', [$this, 'render_rating_notice' ]);
38
+ }
39
+ }
40
+
41
+ public function wpr_rating_maybe_later() {
42
+ update_option( 'wpr_maybe_later_time', strtotime('now') );
43
+ }
44
+
45
+ function wpr_rating_already_rated() {
46
+ update_option( 'wpr_rating_already_rated' , true );
47
+ }
48
+
49
+ public function wpr_rating_dismiss_notice() {
50
+ update_option( 'wpr_rating_dismiss_notice', true );
51
+ }
52
+
53
+ public function wpr_rating_need_help() {
54
+ // Reset Activation Time if user Needs Help
55
+ update_option( 'royal_elementor_addons_activation_time', strtotime('now') );
56
+ }
57
+
58
+ public function render_rating_notice() {
59
+ global $pagenow;
60
+
61
+ if ( is_admin() ) {
62
+ $plugin_info = get_plugin_data( __FILE__ , true, true );
63
+ $dont_disturb = esc_url( get_admin_url() . '?spare_me=1' );
64
+
65
+ echo '<div class="notice wpr-rating-notice is-dismissible" style="border-left-color: #7A75FF!important; display: flex; align-items: center;">
66
+ <div class="wpr-rating-notice-logo">
67
+ <img src="' . WPR_ADDONS_ASSETS_URL . '/img/logo-128x128.png">
68
+ </div>
69
+ <div>
70
+ <h3>Thank you for using Royal Elementor Addons to build this website!</h3>
71
+ <p style="">Could you please do us a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.</p>
72
+ <p>
73
+ <a href="https://wordpress.org/support/plugin/royal-elementor-addons/reviews/?filter=5#new-post" target="_blank" class="wpr-you-deserve-it button button-primary">OK, you deserve it!</a>
74
+ <a class="wpr-maybe-later"><span class="dashicons dashicons-clock"></span> Maybe Later</a>
75
+ <a class="wpr-already-rated"><span class="dashicons dashicons-yes"></span> I Already did</a>
76
+ </p>
77
+ </div>
78
+ </div>';
79
+
80
+ // <a href="https://wordpress.org/support/plugin/royal-elementor-addons/" target="_blank" class="wpr-need-support"><span class="dashicons dashicons-sos"></span> I need support!</a>
81
+ // <a class="wpr-notice-dismiss-2"><span class="dashicons dashicons-thumbs-down"></span> NO, not good enough</a>
82
+ }
83
+ }
84
+
85
+ public static function enqueue_scripts() {
86
+ echo "
87
+ <script>
88
+ jQuery( document ).ready( function() {
89
+
90
+ jQuery(document).on( 'click', '.wpr-notice-dismiss-2', function() {
91
+ jQuery(document).find('.wpr-rating-notice').slideUp();
92
+ jQuery.post({
93
+ url: ajaxurl,
94
+ data: {
95
+ action: 'wpr_rating_dismiss_notice',
96
+ }
97
+ })
98
+ });
99
+
100
+ jQuery(document).on( 'click', '.wpr-maybe-later', function() {
101
+ jQuery(document).find('.wpr-rating-notice').slideUp();
102
+ jQuery.post({
103
+ url: ajaxurl,
104
+ data: {
105
+ action: 'wpr_rating_maybe_later',
106
+ }
107
+ })
108
+ });
109
+
110
+ jQuery(document).on( 'click', '.wpr-already-rated', function() {
111
+ jQuery(document).find('.wpr-rating-notice').slideUp();
112
+ jQuery.post({
113
+ url: ajaxurl,
114
+ data: {
115
+ action: 'wpr_rating_already_rated',
116
+ }
117
+ })
118
+ });
119
+
120
+ jQuery(document).on( 'click', '.wpr-need-support', function() {
121
+ jQuery.post({
122
+ url: ajaxurl,
123
+ data: {
124
+ action: 'wpr_rating_need_help',
125
+ }
126
+ })
127
+ });
128
+ });
129
+ </script>
130
+
131
+ <style>
132
+ .wpr-rating-notice {
133
+ padding: 10px 20px;
134
+ border-top: 0;
135
+ border-bottom: 0;
136
+ }
137
+
138
+ .wpr-rating-notice-logo {
139
+ margin-right: 20px;
140
+ width: 100px;
141
+ height: 100px;
142
+ }
143
+
144
+ .wpr-rating-notice-logo img {
145
+ max-width: 100%;
146
+ }
147
+
148
+ .wpr-rating-notice h3 {
149
+ margin-bottom: 0;
150
+ }
151
+
152
+ .wpr-rating-notice p {
153
+ margin-top: 3px;
154
+ margin-bottom: 15px;
155
+ }
156
+
157
+ .wpr-maybe-later,
158
+ .wpr-already-rated,
159
+ .wpr-need-support,
160
+ .wpr-notice-dismiss-2 {
161
+ text-decoration: none;
162
+ margin-left: 12px;
163
+ font-size: 14px;
164
+ cursor: pointer;
165
+ }
166
+
167
+ .wpr-already-rated .dashicons,
168
+ .wpr-maybe-later .dashicons,
169
+ .wpr-need-support .dashicons {
170
+ vertical-align: middle;
171
+ }
172
+
173
+ .wpr-notice-dismiss-2 .dashicons {
174
+ vertical-align: middle;
175
+ }
176
+
177
+ .wpr-rating-notice .notice-dismiss {
178
+ display: none;
179
+ }
180
+ </style>
181
+ ";
182
+ }
183
+
184
+ }
185
+
186
+ if ( 'Royal Addons' === Utilities::get_plugin_name() ) {
187
+ new WprRatingNotice();
188
+ }
classes/utilities.php CHANGED
@@ -1,797 +1,797 @@
1
- <?php
2
- namespace WprAddons\Classes;
3
-
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit; // Exit if accessed directly
6
- }
7
-
8
- class Utilities {
9
-
10
- /**
11
- ** Get Plugin Name
12
- */
13
- public static function get_plugin_name($full = false) {
14
- return class_exists('\WprAddonsPro\Admin\Wpr_White_Label') ? \WprAddonsPro\Admin\Wpr_White_Label::get_plugin_name($full) : 'Royal Addons';
15
- }
16
-
17
- /**
18
- ** Get Available Modules
19
- */
20
- public static function get_registered_modules() {
21
- return [
22
- 'Post Grid' => ['grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-portfolio-grid', ''],
23
- 'WooCommerce Grid' => ['woo-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-woo-grid', ''],
24
- 'Image Grid' => ['media-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-gallery-grid', ''],
25
- 'Magazine Grid' => ['magazine-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-magazine-grid', ''],
26
- 'Posts/Story Timeline' => ['posts-timeline', 'https://royal-elementor-addons.com/elementor-timeline-widget/', '', ''],
27
- 'Advanced Slider' => ['advanced-slider', 'https://royal-elementor-addons.com/elementor-advanced-slider-widget/', '', ''],
28
- 'Testimonial' => ['testimonial', 'https://royal-elementor-addons.com/elementor-testimonials-slider-widget/', '', ''],
29
- 'Nav Menu' => ['nav-menu', 'http://royal-elementor-addons.com/elementor-menu-widget/', '', ''],
30
- 'Onepage Navigation' => ['onepage-nav', 'https://royal-elementor-addons.com/elementor-one-page-navigation-widget/', '', ''],
31
- 'Pricing Table' => ['pricing-table', 'https://royal-elementor-addons.com/elementor-pricing-table-widget/', '', ''],
32
- 'Content Toggle' => ['content-toggle', 'https://royal-elementor-addons.com/elementor-content-toggle-widget/', '', ''],
33
- 'Countdown' => ['countdown', 'https://royal-elementor-addons.com/elementor-countdown-widget/', '', ''],
34
- 'Progress Bar' => ['progress-bar', 'https://royal-elementor-addons.com/elementor-progress-bar-widget/', '', ''],
35
- 'Tabs' => ['tabs', 'https://royal-elementor-addons.com/elementor-tabs-widget/', '', ''],
36
- 'Dual Color Heading' => ['dual-color-heading', '', '', 'new'],
37
- 'Advanced Text' => ['advanced-text', 'https://royal-elementor-addons.com/elementor-advanced-text-widget/', '', ''],
38
- 'Flip Carousel' => ['flip-carousel', '', '', 'new'],
39
- 'Flip Box' => ['flip-box', 'https://royal-elementor-addons.com/elementor-flip-box-widget/', '', ''],
40
- 'Promo Box' => ['promo-box', 'https://royal-elementor-addons.com/elementor-promo-box-widget/', '', ''],
41
- 'Feature List' => ['feature-list', '', '', 'new'],
42
- 'Before After' => ['before-after', 'https://royal-elementor-addons.com/elementor-before-after-widget/', '', ''],
43
- 'Image Hotspots' => ['image-hotspots', 'https://royal-elementor-addons.com/elementor-image-hotspot-widget/', '', ''],
44
- 'Forms' => ['forms', 'https://royal-elementor-addons.com/elementor-forms-widget/', '', ''],
45
- 'MailChimp' => ['mailchimp', 'https://royal-elementor-addons.com/elementor-mailchimp-subscription-widget/', '', ''],
46
- 'Content Ticker' => ['content-ticker', 'https://royal-elementor-addons.com/elementor-content-ticker-widget/', '', ''],
47
- 'Button' => ['button', 'https://royal-elementor-addons.com/elementor-button-widget/', '', ''],
48
- 'Dual Button' => ['dual-button', 'https://royal-elementor-addons.com/elementor-button-widget/', '#dualbuttonsection', ''],
49
- 'Team Member' => ['team-member', 'https://royal-elementor-addons.com/elementor-team-member-widget/', '', ''],
50
- 'Google Maps' => ['google-maps', 'http://royal-elementor-addons.com/elementor-google-maps-widget/', '', ''],
51
- 'Price List' => ['price-list', 'https://royal-elementor-addons.com/elementor-price-list-widget/', '', ''],
52
- 'Business Hours' => ['business-hours', 'https://royal-elementor-addons.com/elementor-business-hours-widget/', '', ''],
53
- 'Sharing Buttons' => ['sharing-buttons', 'https://royal-elementor-addons.com/elementor-social-sharing-buttons-widget/', '', ''],
54
- 'Search Form' => ['search', 'https://royal-elementor-addons.com/elementor-search-widget/', '', ''],
55
- 'Back to Top' => ['back-to-top', 'https://royal-elementor-addons.com/elementor-back-to-top-widget/', '', ''],
56
- 'Phone Call' => ['phone-call', 'https://royal-elementor-addons.com/elementor-phone-call-widget/', '', ''],
57
- 'Lottie Animations' => ['lottie-animations', 'https://royal-elementor-addons.com/elementor-lottie-animation-widget/', '', ''],
58
- 'Site Logo' => ['logo', '', '', ''],
59
- 'Popup Trigger' => ['popup-trigger', '', '', ''],
60
- 'Taxonomy List' => ['taxonomy-list', '', '', ''],
61
- 'Template' => ['elementor-template', '', '', ''],
62
- // 'Random Image' => ['random-image', '', ''],
63
- ];
64
- }
65
-
66
- /**
67
- ** Get Enabled Modules
68
- */
69
- public static function get_available_modules() {
70
- $modules = Utilities::get_registered_modules();
71
-
72
- foreach ( $modules as $title => $data ) {
73
- $slug = $data[0];
74
- if ( 'on' !== get_option('wpr-element-'. $slug, 'on') ) {
75
- unset($modules[$title]);
76
- }
77
- }
78
- return $modules;
79
- }
80
-
81
- /**
82
- ** Get Theme Builder Modules
83
- */
84
- public static function get_theme_builder_modules() {
85
- return [
86
- 'post-title',
87
- 'post-media',
88
- 'post-content',
89
- 'post-info',
90
- 'post-navigation',
91
- 'post-comments',
92
- 'author-box',
93
- 'archive-title',
94
- ];
95
- }
96
-
97
- /**
98
- ** Get Available Custom Post Types or Taxonomies
99
- */
100
- public static function get_custom_types_of( $query, $exclude_defaults = true ) {
101
- // Taxonomies
102
- if ( 'tax' === $query ) {
103
- $custom_types = get_taxonomies( [ 'show_in_nav_menus' => true ], 'objects' );
104
-
105
- // Post Types
106
- } else {
107
- $custom_types = get_post_types( [ 'show_in_nav_menus' => true ], 'objects' );
108
- }
109
-
110
- $custom_type_list = [];
111
-
112
- foreach ( $custom_types as $key => $value ) {
113
- if ( $exclude_defaults ) {
114
- if ( $key != 'post' && $key != 'page' && $key != 'category' && $key != 'post_tag' ) {
115
- $custom_type_list[ $key ] = $value->label;
116
- }
117
- } else {
118
- $custom_type_list[ $key ] = $value->label;
119
- }
120
- }
121
-
122
- return $custom_type_list;
123
- }
124
-
125
-
126
- /**
127
- ** Get All Users
128
- */
129
- public static function get_users() {
130
- $users = [];
131
-
132
- foreach ( get_users() as $key => $user ) {
133
- $users[$user->data->ID] = $user->data->user_nicename;
134
- }
135
-
136
- wp_reset_postdata();
137
-
138
- return $users;
139
- }
140
-
141
-
142
- /**
143
- ** Get User Roles
144
- */
145
- public static function get_user_roles() {
146
- if ( ! function_exists( 'get_editable_roles' ) ) {
147
- require_once ABSPATH . 'wp-admin/includes/user.php';
148
- }
149
-
150
- $r = [];
151
-
152
- $editable_roles = array_reverse( get_editable_roles() );
153
-
154
- $r['guest'] = esc_html__( 'Guest', 'wpr-addons' );
155
-
156
- foreach ( $editable_roles as $role => $details ) {
157
- $r[ $role ] = translate_user_role( $details['name'] );
158
- }
159
-
160
- return $r;
161
- }
162
-
163
-
164
- /**
165
- ** Get Terms of Taxonomy
166
- */
167
- public static function get_terms_by_taxonomy( $slug ) {
168
- if ( ( 'product_cat' === $slug || 'product_tag' === $slug ) && ! class_exists( 'WooCommerce' ) ) {
169
- return;
170
- }
171
-
172
- $query = get_terms( $slug, [ 'hide_empty' => false, 'posts_per_page' => -1 ] );
173
- $taxonomies = [];
174
-
175
- foreach ( $query as $tax ) {
176
- $taxonomies[$tax->term_id] = $tax->name;
177
- }
178
-
179
- wp_reset_postdata();
180
-
181
- return $taxonomies;
182
- }
183
-
184
-
185
- /**
186
- ** Get Posts of Post Type
187
- */
188
- public static function get_posts_by_post_type( $slug ) {
189
- $query = get_posts( [ 'post_type' => $slug, 'posts_per_page' => -1 ] );
190
- $posts = [];
191
-
192
- foreach ( $query as $post ) {
193
- $posts[$post->ID] = $post->post_title;
194
- }
195
-
196
- wp_reset_postdata();
197
-
198
- return $posts;
199
- }
200
-
201
-
202
- /**
203
- ** Get Library Template ID
204
- */
205
- public static function get_template_id( $slug ) {
206
- $template = get_page_by_path( $slug, OBJECT, 'wpr_templates' );
207
-
208
- return isset( $template->ID ) ? $template->ID : false;
209
- }
210
-
211
- /**
212
- ** Get Library Template Slug
213
- */
214
- public static function get_template_slug( $data, $page, $post_id = '' ) {
215
- if ( is_null($data) ) {
216
- return;
217
- }
218
-
219
- $template = NULL;
220
-
221
- // Find a Custom Condition
222
- foreach( $data as $id => $conditions ) {
223
- if ( in_array( $page .'/'. $post_id, $conditions) ) {
224
- $template = $id;
225
- } elseif ( in_array( $page .'/all', $conditions) ) {
226
- $template = $id;
227
- } elseif ( in_array( $page, $conditions) ) {
228
- $template = $id;
229
- }
230
- }
231
-
232
- // If a Custom NOT Found, use Global
233
- if ( is_null($template) ) {
234
- foreach( $data as $id => $conditions ) {
235
- if ( in_array( 'global', $conditions) ) {
236
- $template = $id;
237
- }
238
- }
239
- }
240
-
241
- return $template;
242
- }
243
-
244
-
245
- /**
246
- ** Get Elementor Template Type
247
- */
248
- public static function get_elementor_template_type( $id ) {
249
- $post_meta = get_post_meta($id);
250
- $template_type = isset($post_meta['_elementor_template_type'][0]) ? $post_meta['_elementor_template_type'][0] : false;
251
-
252
- return $template_type;
253
- }
254
-
255
-
256
- /**
257
- ** Get Royal Template Type
258
- */
259
- public static function get_wpr_template_type( $id ) {
260
- $post_meta = get_post_meta($id);
261
- $template_type = isset($post_meta['_wpr_template_type'][0]) ? $post_meta['_wpr_template_type'][0] : false;
262
-
263
- return $template_type;
264
- }
265
-
266
-
267
- /**
268
- ** Theme Builder Show Widgets on Spacific Pages
269
- */
270
- public static function show_theme_buider_widget_on( $type ) {
271
- global $post;
272
- $display = false;
273
-
274
- if ( Utilities::is_theme_builder_template() ) {
275
- $template_type = Utilities::get_wpr_template_type(get_the_ID());
276
-
277
- if ( $type === $template_type ) {
278
- $display = true;
279
- }
280
-
281
- $conditions = json_decode(get_option('wpr_single_conditions'));
282
- $front_page = Utilities::get_template_slug($conditions, 'single/front_page', get_the_ID());
283
- $page_404 = Utilities::get_template_slug($conditions, 'single/page_404', get_the_ID());
284
-
285
- if ( $post->post_name == $front_page || $post->post_name == $page_404 ) {
286
- $display = false;
287
- }
288
- }
289
-
290
- return $display;
291
- }
292
-
293
-
294
- /**
295
- ** Render Elementor Template
296
- */
297
- public static function render_elementor_template( $slug ) {
298
- $template_id = Utilities::get_template_id( $slug );
299
- $get_elementor_content = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, false );
300
-
301
- if ( '' === $get_elementor_content ) {
302
- return;
303
- }
304
-
305
- // Render Elementor Template Content
306
- echo ''. $get_elementor_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
307
- }
308
-
309
-
310
- /**
311
- ** Theme Builder Template Check
312
- */
313
- public static function is_theme_builder_template() {
314
- $current_page = get_post(get_the_ID());
315
-
316
- if ( $current_page ) {
317
- return strpos($current_page->post_name, 'user-archive') !== false || strpos($current_page->post_name, 'user-single') !== false;
318
- } else {
319
- return false;
320
- }
321
- }
322
-
323
-
324
- /**
325
- ** Blog Archive Page Check
326
- */
327
- public static function is_blog_archive() {
328
- $result = false;
329
- $front_page = get_option( 'page_on_front' );
330
- $posts_page = get_option( 'page_for_posts' );
331
-
332
- if ( is_home() && '0' === $front_page && '0' === $posts_page || (intval($posts_page) === get_queried_object_id() && !is_404()) ) {
333
- $result = true;
334
- }
335
-
336
- return $result;
337
- }
338
-
339
- // Get Post Sharing Icon
340
- public static function get_post_sharing_icon( $args = [] ) {
341
-
342
- if ( 'facebook-f' === $args['network'] ) {
343
- $sharing_url = 'https://www.facebook.com/sharer.php?u='. $args['url'];
344
- $network_title = esc_html__( 'Facebook', 'wpr-addons' );
345
- } elseif ( 'twitter' === $args['network'] ) {
346
- $sharing_url = 'https://twitter.com/intent/tweet?url='. $args['url'];
347
- $network_title = esc_html__( 'Twitter', 'wpr-addons' );
348
- } elseif ( 'linkedin-in' === $args['network'] ) {
349
- $sharing_url = 'https://www.linkedin.com/shareArticle?mini=true&url='. $args['url'] .'&title='. $args['title'] .'&summary='. $args['text'] .'&source='. $args['url'];
350
- $network_title = esc_html__( 'LinkedIn', 'wpr-addons' );
351
- } elseif ( 'pinterest-p' === $args['network'] ) {
352
- // $sharing_url = 'https://www.pinterest.com/pin/find/?url='. $args['url'];
353
- $sharing_url = 'https://www.pinterest.com/pin/create/button/?url='. $args['url'] .'&media='. $args['image'];
354
- $network_title = esc_html__( 'Pinterest', 'wpr-addons' );
355
- } elseif ( 'reddit' === $args['network'] ) {
356
- $sharing_url = 'https://reddit.com/submit?url='. $args['url'] .'&title='. $args['title'];
357
- $network_title = esc_html__( 'Reddit', 'wpr-addons' );
358
- } elseif ( 'tumblr' === $args['network'] ) {
359
- $sharing_url = 'https://tumblr.com/share/link?url='. $args['url'];
360
- $network_title = esc_html__( 'Tumblr', 'wpr-addons' );
361
- } elseif ( 'digg' === $args['network'] ) {
362
- $sharing_url = 'https://digg.com/submit?url='. $args['url'];
363
- $network_title = esc_html__( 'Digg', 'wpr-addons' );
364
- } elseif ( 'xing' === $args['network'] ) {
365
- $sharing_url = 'https://www.xing.com/app/user?op=share&url='. $args['url'];
366
- $network_title = esc_html__( 'Xing', 'wpr-addons' );
367
- } elseif ( 'stumbleupon' === $args['network'] ) {
368
- $sharing_url = 'https://www.stumbleupon.com/submit?url='. $args['url'];
369
- $network_title = esc_html__( 'StumpleUpon', 'wpr-addons' );
370
- } elseif ( 'vk' === $args['network'] ) {
371
- $sharing_url = 'https://vkontakte.ru/share.php?url='. $args['url'] .'&title='. $args['title'] .'&description='. wp_trim_words( $args['text'], 250 ) .'&image='. $args['image'] .'/';
372
- $network_title = esc_html__( 'vKontakte', 'wpr-addons' );
373
- } elseif ( 'odnoklassniki' === $args['network'] ) {
374
- $sharing_url = 'http://odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl='. $args['url'];
375
- $network_title = esc_html__( 'OdnoKlassniki', 'wpr-addons' );
376
- } elseif ( 'get-pocket' === $args['network'] ) {
377
- $sharing_url = 'https://getpocket.com/edit?url='. $args['url'];
378
- $network_title = esc_html__( 'Pocket', 'wpr-addons' );
379
- } elseif ( 'skype' === $args['network'] ) {
380
- $sharing_url = 'https://web.skype.com/share?url='. $args['url'];
381
- $network_title = esc_html__( 'Skype', 'wpr-addons' );
382
- } elseif ( 'whatsapp' === $args['network'] ) {
383
- $sharing_url = 'https://api.whatsapp.com/send?text=*'. $args['title'] .'*\n'. $args['text'] .'\n'. $args['url'];
384
- $network_title = esc_html__( 'WhatsApp', 'wpr-addons' );
385
- } elseif ( 'telegram' === $args['network'] ) {
386
- $sharing_url = 'https://telegram.me/share/url?url='. $args['url'] .'&text='. $args['text'];
387
- $network_title = esc_html__( 'Telegram', 'wpr-addons' );
388
- } elseif ( 'delicious' === $args['network'] ) {
389
- $sharing_url = 'https://del.icio.us/save?url='. $args['url'] .'&title={title}';
390
- $network_title = esc_html__( 'Delicious', 'wpr-addons' );
391
- } elseif ( 'envelope' === $args['network'] ) {
392
- $sharing_url = 'mailto:?subject='. $args['title'] .'&body='. $args['url'];
393
- $network_title = esc_html__( 'Email', 'wpr-addons' );
394
- } elseif ( 'print' === $args['network'] ) {
395
- $sharing_url = 'javascript:window.print()';
396
- $network_title = esc_html__( 'Print', 'wpr-addons' );
397
- } else {
398
- $sharing_url = '';
399
- $network_title = '';
400
- }
401
-
402
- $sharing_url = 'print' === $args['network'] ? $sharing_url : esc_url( $sharing_url );
403
-
404
- $output = '';
405
-
406
- if ( '' !== $network_title ) {
407
- $output .= '<a href="'. esc_url($sharing_url) .'" class="wpr-sharing-icon wpr-sharing-'. esc_attr( $args['network'] ) .'" title="" target="_blank">';
408
- // Tooltip
409
- $output .= 'yes' === $args['tooltip'] ? '<span class="wpr-sharing-tooltip wpr-tooltip">'. esc_html( $network_title ) .'</span>' : '';
410
-
411
- // Category
412
- if ( 'envelope' === $args['network'] || 'print' === $args['network'] ) {
413
- $category = 'fas';
414
- } else {
415
- $category = 'fab';
416
- }
417
-
418
- // Icon
419
- if ( 'yes' === $args['icons'] ) {
420
- $output .= '<i class="'. esc_attr($category) .' fa-'. esc_attr( $args['network'] ) .'"></i>';
421
- }
422
-
423
- // Label
424
- if ( isset( $args['labels'] ) && 'yes' === $args['labels'] ) {
425
- $label = isset( $args['custom_label'] ) && '' !== $args['custom_label'] ? $args['custom_label'] : $network_title;
426
- $output .= '<span class="wpr-sharing-label">'. esc_html( $label ) .'</span>';
427
- }
428
- $output .= '</a>';
429
- }
430
-
431
- return $output;
432
- }
433
-
434
-
435
- /**
436
- ** Filter oEmbed Results
437
- */
438
- public static function filter_oembed_results( $html ) {
439
- // Filter
440
- preg_match( '/<iframe.*src=\"(.*)\".*><\/iframe>/isU', $html, $matches );
441
-
442
- // Return URL
443
- return $matches[1] .'&auto_play=true';
444
- }
445
-
446
-
447
- /**
448
- ** Get Custom Meta Keys
449
- */
450
- public static function get_custom_meta_keys() {
451
- $data = [];
452
- $options = [];
453
- $merged_meta_keys = [];
454
- $post_types = Utilities::get_custom_types_of( 'post', false );
455
-
456
- foreach ( $post_types as $post_type_slug => $post_type_name ) {
457
- $data[ $post_type_slug ] = [];
458
- $posts = get_posts( [ 'post_type' => $post_type_slug ] );
459
-
460
- foreach ( $posts as $key => $post ) {
461
- $meta_keys = get_post_custom_keys( $post->ID );
462
-
463
- if ( ! empty($meta_keys) ) {
464
- for ( $i = 0; $i < count( $meta_keys ); $i++ ) {
465
- if ( '_' !== substr( $meta_keys[$i], 0, 1 ) ) {
466
- array_push( $data[$post_type_slug], $meta_keys[$i] );
467
- }
468
- }
469
- }
470
- }
471
-
472
- $data[ $post_type_slug ] = array_unique( $data[ $post_type_slug ] );
473
- }
474
-
475
- foreach ( $data as $array ) {
476
- $merged_meta_keys = array_unique( array_merge( $merged_meta_keys, $array ) );
477
- }
478
-
479
- // Rekey
480
- $merged_meta_keys = array_values($merged_meta_keys);
481
-
482
- for ( $i = 0; $i < count( $merged_meta_keys ); $i++ ) {
483
- $options[ $merged_meta_keys[$i] ] = $merged_meta_keys[$i];
484
- }
485
-
486
- return [ $data, $options ];
487
- }
488
-
489
-
490
- /**
491
- ** Get SVG Icons Array
492
- */
493
- public static function get_svg_icons_array( $stack, $fa_icons ) {
494
- $svg_icons = [];
495
-
496
- if ( 'arrows' === $stack ) {
497
- $svg_icons['svg-angle-1-left'] = esc_html__( 'Angle', 'wpr-addons' );
498
- $svg_icons['svg-angle-2-left'] = esc_html__( 'Angle Bold', 'wpr-addons' );
499
- $svg_icons['svg-angle-3-left'] = esc_html__( 'Angle Bold Round', 'wpr-addons' );
500
- $svg_icons['svg-angle-4-left'] = esc_html__( 'Angle Plane', 'wpr-addons' );
501
- $svg_icons['svg-arrow-1-left'] = esc_html__( 'Arrow', 'wpr-addons' );
502
- $svg_icons['svg-arrow-2-left'] = esc_html__( 'Arrow Bold', 'wpr-addons' );
503
- $svg_icons['svg-arrow-3-left'] = esc_html__( 'Arrow Bold Round', 'wpr-addons' );
504
- $svg_icons['svg-arrow-4-left'] = esc_html__( 'Arrow Caret', 'wpr-addons' );
505
-
506
- } elseif ( 'blockquote' === $stack ) {
507
- $svg_icons['svg-blockquote-1'] = esc_html__( 'Blockquote Round', 'wpr-addons' );
508
- $svg_icons['svg-blockquote-2'] = esc_html__( 'Blockquote ST', 'wpr-addons' );
509
- $svg_icons['svg-blockquote-3'] = esc_html__( 'Blockquote BS', 'wpr-addons' );
510
- $svg_icons['svg-blockquote-4'] = esc_html__( 'Blockquote Edges', 'wpr-addons' );
511
- $svg_icons['svg-blockquote-5'] = esc_html__( 'Blockquote Quad', 'wpr-addons' );
512
-
513
- } elseif ( 'sharing' === $stack ) {
514
- // $svg_icons['svg-sharing-1'] = esc_html__( 'sharing 1', 'wpr-addons' );
515
- // $svg_icons['svg-sharing-2'] = esc_html__( 'sharing 2', 'wpr-addons' );
516
- }
517
-
518
- // Merge FontAwesome and SVG icons
519
- return array_merge( $fa_icons, $svg_icons );
520
- }
521
-
522
-
523
- /**
524
- ** Get SVG Icon
525
- */
526
- public static function get_svg_icon( $icon, $dir ) {
527
- $style_attr = '';
528
-
529
- // Rotate Right
530
- if ( 'right' === $dir ) {
531
- $style_attr = 'style="transform: rotate(180deg); -webkit-transform: rotate(180deg);" ';
532
- }
533
-
534
- $icons = [
535
- // Arrows
536
- 'svg-angle-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 283.4 512" style="enable-background:new 0 0 283.4 512;" xml:space="preserve"><g><polygon class="st0" points="54.5,256.3 283.4,485.1 256.1,512.5 0,256.3 0,256.3 27.2,229 256.1,0 283.4,27.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
537
- 'svg-angle-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 303.3 512" style="enable-background:new 0 0 303.3 512;" xml:space="preserve"><g><polygon class="st0" points="94.7,256 303.3,464.6 256,512 47.3,303.4 0,256 47.3,208.6 256,0 303.3,47.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
538
- 'svg-angle-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 291.4 512" style="enable-background:new 0 0 291.4 512;" xml:space="preserve"><g><path class="st0" d="M281.1,451.5c13.8,13.8,13.8,36.3,0,50.1c-13.8,13.8-36.3,13.8-50.1,0L10.4,281C3.5,274.1,0,265.1,0,256c0-9.1,3.5-18.1,10.4-25L231,10.4c13.8-13.8,36.3-13.8,50.1,0c6.9,6.9,10.4,16,10.4,25s-3.5,18.1-10.4,25L85.5,256L281.1,451.5z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
539
- 'svg-angle-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 259.6 512" style="enable-background:new 0 0 259.6 512;" xml:space="preserve"><g><path class="st0" d="M256.6,18.1L126.2,256.1l130.6,237.6c3.6,5.6,3.9,10.8,0.2,14.9c-0.2,0.2-0.2,0.3-0.3,0.3s-0.3,0.3-0.3,0.3c-3.9,3.9-10.3,3.6-14.2-0.3L2.9,263.6c-2-2.1-3.1-4.7-2.9-7.5c0-2.8,1-5.6,3.1-7.7L242,3.1c4.1-4.1,10.6-4.1,14.6,0l0,0C260.7,7.3,260.5,10.9,256.6,18.1z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
540
- 'svg-arrow-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 338.4" style="enable-background:new 0 0 512 338.4;" xml:space="preserve"><g><polygon class="st0" points="511.4,183.1 53.4,183.1 188.9,318.7 169.2,338.4 0,169.2 169.2,0 188.9,19.7 53.4,155.3 511.4,155.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
541
- 'svg-arrow-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 320.6" style="enable-background:new 0 0 512 320.6;" xml:space="preserve"><g><polygon class="st0" points="512,184.4 92.7,184.4 194.7,286.4 160.5,320.6 34.3,194.4 34.3,194.4 0,160.2 160.4,0 194.5,34.2 92.7,136 512,136 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
542
- 'svg-arrow-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 320.6" style="enable-background:new 0 0 499.6 320.6;" xml:space="preserve"><g><path class="st0" d="M499.6,159.3c0.3,7-2.4,13.2-7,17.9c-4.3,4.3-10.4,7-16.9,7H81.6l95.6,95.6c9.3,9.3,9.3,24.4,0,33.8c-4.6,4.6-10.8,7-16.9,7c-6.1,0-12.3-2.4-16.9-7L6.9,177.2c-9.3-9.3-9.3-24.4,0-33.8l16.9-16.9l0,0L143.3,6.9c9.3-9.3,24.4-9.3,33.8,0c4.6,4.6,7,10.8,7,16.9s-2.4,12.3-7,16.9l-95.6,95.6h393.7C488.3,136.3,499.1,146.4,499.6,159.3z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
543
- 'svg-arrow-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 201.3" style="enable-background:new 0 0 499.6 201.3;" xml:space="preserve"><g><polygon class="st0" points="0,101.1 126,0 126,81.6 499.6,81.6 499.6,120.8 126,120.8 126,201.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
544
-
545
- // Blockquote
546
- 'svg-blockquote-1' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 406.1" style="enable-background:new 0 0 512 406.1;" xml:space="preserve"><g><g id="Layer_2_1_" class="st0"><path class="st1" d="M510.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C218.9,145.3,477.7,0.1,477.7,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C421.8,170.3,510.1,220.2,510.6,301.8z"/><path class="st1" d="M234.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C-57.1,145.3,201.8,0.1,201.8,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C145.9,170.3,234.1,220.2,234.6,301.8z"/></g></g></svg>',
547
- 'svg-blockquote-2' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 415.9" style="enable-background:new 0 0 512 415.9;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="512,0 303.1,208 303.1,415.9 512,415.9 "/><polygon class="st1" points="208.9,0 0,208 0,415.9 208.9,415.9 "/></g></g></svg>',
548
- 'svg-blockquote-3' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 369.3" style="enable-background:new 0 0 512 369.3;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="240.7,0 240.7,240.5 88.1,369.3 88.1,328.3 131.4,240.5 0.3,240.5 0.3,0 "/><polygon class="st1" points="512,43.3 512,238.6 388.1,343.2 388.1,310 423.2,238.6 316.7,238.6 316.7,43.3 "/></g></g></svg>',
549
- 'svg-blockquote-4' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 369.3" style="enable-background:new 0 0 512 369.3;" xml:space="preserve"><g><g class="st0"><g><path class="st1" d="M469.1,299.1c-62,79.7-148.7,69.8-148.7,69.8v-86.5c0,0,42.6-0.6,77.5-35.4c20.3-20.3,22.7-65.6,22.8-81.4h-101V-10.9H512v176.6C512.2,184.7,509.4,247.2,469.1,299.1z"/></g><g><path class="st1" d="M149.3,299.1c-62,79.7-148.7,69.8-148.7,69.8v-86.5c0,0,42.6-0.6,77.5-35.4c20.3-20.3,22.7-65.6,22.8-81.4H0V-10.9h192.2v176.6C192.4,184.7,189.7,247.2,149.3,299.1z"/></g></g></g></svg>',
550
- 'svg-blockquote-5' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 422.1" style="enable-background:new 0 0 512 422.1;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="237,0 237,223.7 169.3,422.1 25.7,422.1 53.4,223.7 0,223.7 0,0 "/><polygon class="st1" points="512,0 512,223.7 444.3,422.1 300.7,422.1 328.4,223.7 275,223.7 275,0 "/></g></g></svg>',
551
-
552
- // Sharing
553
- 'svg-sharing-1' => '<?xml version="1.0" ?><svg style="enable-background:new 0 0 48 48;" version="1.1" viewBox="0 0 48 48" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Icons"><g id="Icons_15_"><g><path d="M25.03766,20.73608v-3.7207c0-0.3799,0.4135-0.6034,0.7263-0.4023l9.3855,5.9218 c0.3017,0.19,0.3017,0.6146,0,0.8045l-5.1844,3.2738l-1.8659,1.1843l-2.3352,1.4749c-0.3129,0.2011-0.7263-0.0335-0.7263-0.4022 v-3.2403v-0.4916" style="fill:#5F83CF;"/><path d="M29.96506,26.61318l-1.8659,1.1843l-2.3352,1.4749c-0.3128,0.2011-0.7263-0.0335-0.7263-0.4022 v-3.2403v-0.4916c-2.5759,0.1057-5.718-0.3578-7.8439,0.6112c-1.9663,0.8963-3.5457,2.5639-4.2666,4.6015 c-0.1282,0.3623-0.2296,0.7341-0.3029,1.1114v-2.9721c0-1.128,0.2449-2.2513,0.7168-3.2759 c0.4588-0.9961,1.1271-1.8927,1.948-2.6196c0.8249-0.7306,1.8013-1.2869,2.8523-1.6189 c1.5111-0.4774,3.1532-0.4118,4.7155-0.3096c0.7252,0.0475,1.4538,0.0698,2.1808,0.0698" style="fill:#5F83CF;"/></g></g></g></svg>',
554
- 'svg-sharing-2' => '<?xml version="1.0" ?><svg style="enable-background:new 0 0 48 48;" version="1.1" viewBox="0 0 48 48" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Icons"><g id="Icons_16_"><g><path d="M27.775,21.64385L27.775,21.64385l1-0.01h1v1.65l2.17-1.38l0.1-0.06l2.95-1.87l-5.22-3.29v0.87 v0.77h-1l-1-0.02l0,0" style="fill:#5F83CF;"/><path d="M28.775,18.32385c-0.33,0-0.67-0.01-1-0.02c-0.22-0.01-0.43-0.02-0.65-0.04 c-1.3358-0.0496-2.5105-0.0408-3.55,0.24c-0.5,0.16-0.97,0.38-1.41,0.67c-0.26,0.16-0.51,0.34-0.74,0.55 c-0.62,0.54-1.12,1.22-1.47,1.97c-0.35,0.77-0.54,1.62-0.54,2.47v2.24c0.06-0.29,0.13-0.57,0.23-0.84 c0.54-1.53,1.73-2.79,3.22-3.47c1.34-0.61,3.21-0.47,4.91-0.45c0.35,0,0.68,0,1-0.01" style="fill:#5F83CF;"/><path d="M31.945,23.63175l-1.8884,1.1873v3.8702c0,0.5422-0.5142,0.991-1.1499,0.991H16.0432 c-0.6357,0-1.1498-0.4488-1.1498-0.991v-8.7689c0-0.5515,0.5142-1.0002,1.1498-1.0002h3.5525h0.0037 c0.0561-0.0748,0.1739-0.2057,0.2393-0.2618c0.6731-0.5983,1.4864-1.0657,2.3465-1.3368 c0.0467-0.0187,0.0935-0.0281,0.1402-0.0374h-6.2821c-1.6734,0-3.0383,1.1872-3.0383,2.6362v8.7689 c0,1.449,1.3649,2.6269,3.0383,2.6269h12.8634c1.6734,0,3.0383-1.1779,3.0383-2.6269V23.63175z" style="fill:#F2F2F2;"/></g></g></g></svg>',
555
-
556
- ];
557
-
558
- return $icons[$icon];
559
- }
560
-
561
-
562
- /**
563
- ** Get WPR Icon
564
- */
565
- public static function get_wpr_icon( $icon, $dir ) {
566
- if ( false !== strpos( $icon, 'svg-' ) ) {
567
- return Utilities::get_svg_icon( $icon, $dir );
568
-
569
- } elseif ( false !== strpos( $icon, 'fa-' ) ) {
570
- $dir = '' !== $dir ? '-'. $dir : '';
571
- return wp_kses('<i class="'. esc_attr($icon . $dir) .'"></i>', [
572
- 'i' => [
573
- 'class' => []
574
- ]
575
- ]);
576
- } else {
577
- return '';
578
- }
579
- }
580
-
581
-
582
- /**
583
- ** Mailchimp AJAX Subscribe
584
- */
585
- public static function ajax_mailchimp_subscribe() {
586
- // API Key
587
- $api_key = isset($_POST['apiKey']) ? sanitize_key($_POST['apiKey']) : '';
588
- $api_key_sufix = explode( '-', $api_key )[1];
589
-
590
- // List ID
591
- $list_id = isset($_POST['listId']) ? sanitize_text_field(wp_unslash($_POST['listId'])) : '';
592
-
593
- // Get Available Fileds (PHPCS - fields are sanitized later on input)
594
- $available_fields = isset($_POST['fields']) ? $_POST['fields'] : []; // phpcs:ignore
595
- wp_parse_str( $available_fields, $fields );
596
-
597
- // Merge Additional Fields
598
- $merge_fields = array(
599
- 'FNAME' => !empty( $fields['wpr_mailchimp_firstname'] ) ? sanitize_text_field($fields['wpr_mailchimp_firstname']) : '',
600
- 'LNAME' => !empty( $fields['wpr_mailchimp_lastname'] ) ? sanitize_text_field($fields['wpr_mailchimp_lastname']) : '',
601
- );
602
-
603
- // API URL
604
- $api_url = 'https://'. $api_key_sufix .'.api.mailchimp.com/3.0/lists/'. $list_id .'/members/'. md5(strtolower(sanitize_text_field($fields['wpr_mailchimp_email'])));
605
-
606
- // API Args
607
- $api_args = [
608
- 'method' => 'PUT',
609
- 'headers' => [
610
- 'Content-Type' => 'application/json',
611
- 'Authorization' => 'apikey '. $api_key,
612
- ],
613
- 'body' => json_encode([
614
- 'email_address' => sanitize_text_field($fields[ 'wpr_mailchimp_email' ]),
615
- 'status' => 'subscribed',
616
- 'merge_fields' => $merge_fields,
617
- ]),
618
- ];
619
-
620
- // Send Request
621
- $request = wp_remote_post( $api_url, $api_args );
622
-
623
- if ( ! is_wp_error($request) ) {
624
- $request = json_decode( wp_remote_retrieve_body($request) );
625
-
626
- // Set Status
627
- if ( ! empty($request) ) {
628
- if ($request->status == 'subscribed') {
629
- wp_send_json([ 'status' => 'subscribed' ]);
630
- } else {
631
- wp_send_json([ 'status' => $request->title ]);
632
- }
633
- }
634
- }
635
- }
636
-
637
- /**
638
- ** Mailchimp - Get Lists
639
- */
640
- public static function get_mailchimp_lists() {
641
- $api_key = get_option('wpr_mailchimp_api_key', '');
642
-
643
- $mailchimp_list = [
644
- 'def' => esc_html__( 'Select List', 'wpr-addons' )
645
- ];
646
-
647
- if ( '' === $api_key ) {
648
- return $mailchimp_list;
649
- } else {
650
- $url = 'https://'. substr( $api_key, strpos( $api_key, '-' ) + 1 ) .'.api.mailchimp.com/3.0/lists/';
651
- $args = [ 'headers' => [ 'Authorization' => 'Basic ' . base64_encode( 'user:'. $api_key ) ] ];
652
-
653
- $response = wp_remote_get( $url, $args );
654
- $body = json_decode($response['body']);
655
-
656
- if ( ! empty( $body->lists ) ) {
657
- foreach ( $body->lists as $list ) {
658
- $mailchimp_list[$list->id] = $list->name .' ('. $list->stats->member_count .')';
659
- }
660
- }
661
-
662
- return $mailchimp_list;
663
- }
664
- }
665
-
666
- /**
667
- ** WPR Animation Timings
668
- */
669
- public static function wpr_animation_timings() {
670
- $timing_functions = [
671
- 'ease-default' => 'Default',
672
- 'linear' => 'Linear',
673
- 'ease-in' => 'Ease In',
674
- 'ease-out' => 'Ease Out',
675
- 'pro-eio' => 'EI Out (Pro)',
676
- 'pro-eiqd' => 'EI Quad (Pro)',
677
- 'pro-eicb' => 'EI Cubic (Pro)',
678
- 'pro-eiqrt' => 'EI Quart (Pro)',
679
- 'pro-eiqnt' => 'EI Quint (Pro)',
680
- 'pro-eisn' => 'EI Sine (Pro)',
681
- 'pro-eiex' => 'EI Expo (Pro)',
682
- 'pro-eicr' => 'EI Circ (Pro)',
683
- 'pro-eibk' => 'EI Back (Pro)',
684
- 'pro-eoqd' => 'EO Quad (Pro)',
685
- 'pro-eocb' => 'EO Cubic (Pro)',
686
- 'pro-eoqrt' => 'EO Quart (Pro)',
687
- 'pro-eoqnt' => 'EO Quint (Pro)',
688
- 'pro-eosn' => 'EO Sine (Pro)',
689
- 'pro-eoex' => 'EO Expo (Pro)',
690
- 'pro-eocr' => 'EO Circ (Pro)',
691
- 'pro-eobk' => 'EO Back (Pro)',
692
- 'pro-eioqd' => 'EIO Quad (Pro)',
693
- 'pro-eiocb' => 'EIO Cubic (Pro)',
694
- 'pro-eioqrt' => 'EIO Quart (Pro)',
695
- 'pro-eioqnt' => 'EIO Quint (Pro)',
696
- 'pro-eiosn' => 'EIO Sine (Pro)',
697
- 'pro-eioex' => 'EIO Expo (Pro)',
698
- 'pro-eiocr' => 'EIO Circ (Pro)',
699
- 'pro-eiobk' => 'EIO Back (Pro)',
700
- ];
701
-
702
- if ( wpr_fs()->can_use_premium_code() && defined('WPR_ADDONS_PRO_VERSION') ) {
703
- $timing_functions = \WprAddonsPro\Includes\Controls\WPR_Control_Animations_Pro::wpr_animation_timings();
704
- }
705
-
706
- return $timing_functions;
707
- }
708
-
709
- public static function wpr_animation_timing_pro_conditions() {
710
- return ['pro-eio','pro-eiqd','pro-eicb','pro-eiqrt','pro-eiqnt','pro-eisn','pro-eiex','pro-eicr','pro-eibk','pro-eoqd','pro-eocb','pro-eoqrt','pro-eoqnt','pro-eosn','pro-eoex','pro-eocr','pro-eobk','pro-eioqd','pro-eiocb','pro-eioqrt','pro-eioqnt','pro-eiosn','pro-eioex','pro-eiocr','pro-eiobk'];
711
- }
712
-
713
- /**
714
- ** WPR Library Button
715
- */
716
- public static function wpr_library_buttons( $module, $controls_manager, $tutorial_url = '' ) {
717
- if ( empty(get_option('wpr_wl_plugin_links')) ) {
718
- if ( '' !== $tutorial_url ) {
719
- $tutorial_link = '<a href="'. esc_url($tutorial_url) .'" target="_blank">'. esc_html__( 'Watch Video Tutorial ', 'wpr-addons' ) .'<span class="dashicons dashicons-video-alt3"></span></a>';
720
- } else {
721
- $tutorial_link = '';
722
- }
723
-
724
- $module->add_control(
725
- 'wpr_library_buttons',
726
- [
727
- 'raw' => '<div><a href="#" target="_blank" data-theme="'. esc_attr(get_template()) .'">'. esc_html__( 'Widget Preview', 'wpr-addons' ) .'</a> <a href="#">'. esc_html__( 'Predefined Styles', 'wpr-addons' ) .'</a></div>'. $tutorial_link,
728
- 'type' => $controls_manager,
729
- ]
730
- );
731
- }
732
- }
733
-
734
- /**
735
- ** Upgrade to Pro Notice
736
- */
737
- public static function upgrade_pro_notice( $module, $controls_manager, $widget, $option, $condition = [] ) {
738
- if ( wpr_fs()->can_use_premium_code() ) {
739
- return;
740
- }
741
-
742
- $module->add_control(
743
- $option .'_pro_notice',
744
- [
745
- 'raw' => 'This option is available<br> in the <strong><a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-'. $widget .'-upgrade-pro#purchasepro" target="_blank">Pro version</a></strong>',
746
- // 'raw' => 'This option is available<br> in the <strong><a href="'. admin_url('admin.php?page=wpr-addons-pricing') .'" target="_blank">Pro version</a></strong>',
747
- 'type' => $controls_manager,
748
- 'content_classes' => 'wpr-pro-notice',
749
- 'condition' => [
750
- $option => $condition,
751
- ]
752
- ]
753
- );
754
- }
755
-
756
- /**
757
- ** Pro Features List Section
758
- */
759
- public static function pro_features_list_section( $module, $controls_manager, $widget, $features ) {
760
- if ( wpr_fs()->can_use_premium_code() ) {
761
- return;
762
- }
763
-
764
- $module->start_controls_section(
765
- 'pro_features_section',
766
- [
767
- 'label' => 'Pro Features <span class="dashicons dashicons-star-filled"></span>',
768
- ]
769
- );
770
-
771
- $list_html = '';
772
-
773
- for ($i=0; $i < count($features); $i++) {
774
- $list_html .= '<li>'. $features[$i] .'</li>';
775
- }
776
-
777
- $module->add_control(
778
- 'pro_features_list',
779
- [
780
- 'type' => $controls_manager,
781
- 'raw' => '<ul>'. $list_html .'</ul>
782
- <a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-pro-sec-'. $widget .'-upgrade-pro#purchasepro" target="_blank">Get Pro version</a>',
783
- 'content_classes' => 'wpr-pro-features-list',
784
- ]
785
- );
786
-
787
- $module->end_controls_section();
788
- }
789
-
790
- /**
791
- ** Check for New Free Users
792
- */
793
- public static function is_new_free_user() {
794
- return !wpr_fs()->can_use_premium_code() && (intval(get_option('royal_elementor_addons_activation_time')) > 1649247746);
795
- }
796
-
797
  }
1
+ <?php
2
+ namespace WprAddons\Classes;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly
6
+ }
7
+
8
+ class Utilities {
9
+
10
+ /**
11
+ ** Get Plugin Name
12
+ */
13
+ public static function get_plugin_name($full = false) {
14
+ return class_exists('\WprAddonsPro\Admin\Wpr_White_Label') ? \WprAddonsPro\Admin\Wpr_White_Label::get_plugin_name($full) : 'Royal Addons';
15
+ }
16
+
17
+ /**
18
+ ** Get Available Modules
19
+ */
20
+ public static function get_registered_modules() {
21
+ return [
22
+ 'Post Grid' => ['grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-portfolio-grid', ''],
23
+ 'WooCommerce Grid' => ['woo-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-woo-grid', ''],
24
+ 'Image Grid' => ['media-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-gallery-grid', ''],
25
+ 'Magazine Grid' => ['magazine-grid', 'https://royal-elementor-addons.com/elementor-grid-widget-examples/', '#filter:category-magazine-grid', ''],
26
+ 'Posts/Story Timeline' => ['posts-timeline', 'https://royal-elementor-addons.com/elementor-timeline-widget/', '', ''],
27
+ 'Advanced Slider' => ['advanced-slider', 'https://royal-elementor-addons.com/elementor-advanced-slider-widget/', '', ''],
28
+ 'Testimonial' => ['testimonial', 'https://royal-elementor-addons.com/elementor-testimonials-slider-widget/', '', ''],
29
+ 'Nav Menu' => ['nav-menu', 'http://royal-elementor-addons.com/elementor-menu-widget/', '', ''],
30
+ 'Onepage Navigation' => ['onepage-nav', 'https://royal-elementor-addons.com/elementor-one-page-navigation-widget/', '', ''],
31
+ 'Pricing Table' => ['pricing-table', 'https://royal-elementor-addons.com/elementor-pricing-table-widget/', '', ''],
32
+ 'Content Toggle' => ['content-toggle', 'https://royal-elementor-addons.com/elementor-content-toggle-widget/', '', ''],
33
+ 'Countdown' => ['countdown', 'https://royal-elementor-addons.com/elementor-countdown-widget/', '', ''],
34
+ 'Progress Bar' => ['progress-bar', 'https://royal-elementor-addons.com/elementor-progress-bar-widget/', '', ''],
35
+ 'Tabs' => ['tabs', 'https://royal-elementor-addons.com/elementor-tabs-widget/', '', ''],
36
+ 'Dual Color Heading' => ['dual-color-heading', '', '', 'new'],
37
+ 'Advanced Text' => ['advanced-text', 'https://royal-elementor-addons.com/elementor-advanced-text-widget/', '', ''],
38
+ 'Flip Carousel' => ['flip-carousel', '', '', 'new'],
39
+ 'Flip Box' => ['flip-box', 'https://royal-elementor-addons.com/elementor-flip-box-widget/', '', ''],
40
+ 'Promo Box' => ['promo-box', 'https://royal-elementor-addons.com/elementor-promo-box-widget/', '', ''],
41
+ 'Feature List' => ['feature-list', '', '', 'new'],
42
+ 'Before After' => ['before-after', 'https://royal-elementor-addons.com/elementor-before-after-widget/', '', ''],
43
+ 'Image Hotspots' => ['image-hotspots', 'https://royal-elementor-addons.com/elementor-image-hotspot-widget/', '', ''],
44
+ 'Forms' => ['forms', 'https://royal-elementor-addons.com/elementor-forms-widget/', '', ''],
45
+ 'MailChimp' => ['mailchimp', 'https://royal-elementor-addons.com/elementor-mailchimp-subscription-widget/', '', ''],
46
+ 'Content Ticker' => ['content-ticker', 'https://royal-elementor-addons.com/elementor-content-ticker-widget/', '', ''],
47
+ 'Button' => ['button', 'https://royal-elementor-addons.com/elementor-button-widget/', '', ''],
48
+ 'Dual Button' => ['dual-button', 'https://royal-elementor-addons.com/elementor-button-widget/', '#dualbuttonsection', ''],
49
+ 'Team Member' => ['team-member', 'https://royal-elementor-addons.com/elementor-team-member-widget/', '', ''],
50
+ 'Google Maps' => ['google-maps', 'http://royal-elementor-addons.com/elementor-google-maps-widget/', '', ''],
51
+ 'Price List' => ['price-list', 'https://royal-elementor-addons.com/elementor-price-list-widget/', '', ''],
52
+ 'Business Hours' => ['business-hours', 'https://royal-elementor-addons.com/elementor-business-hours-widget/', '', ''],
53
+ 'Sharing Buttons' => ['sharing-buttons', 'https://royal-elementor-addons.com/elementor-social-sharing-buttons-widget/', '', ''],
54
+ 'Search Form' => ['search', 'https://royal-elementor-addons.com/elementor-search-widget/', '', ''],
55
+ 'Back to Top' => ['back-to-top', 'https://royal-elementor-addons.com/elementor-back-to-top-widget/', '', ''],
56
+ 'Phone Call' => ['phone-call', 'https://royal-elementor-addons.com/elementor-phone-call-widget/', '', ''],
57
+ 'Lottie Animations' => ['lottie-animations', 'https://royal-elementor-addons.com/elementor-lottie-animation-widget/', '', ''],
58
+ 'Site Logo' => ['logo', '', '', ''],
59
+ 'Popup Trigger' => ['popup-trigger', '', '', ''],
60
+ 'Taxonomy List' => ['taxonomy-list', '', '', ''],
61
+ 'Template' => ['elementor-template', '', '', ''],
62
+ // 'Random Image' => ['random-image', '', ''],
63
+ ];
64
+ }
65
+
66
+ /**
67
+ ** Get Enabled Modules
68
+ */
69
+ public static function get_available_modules() {
70
+ $modules = Utilities::get_registered_modules();
71
+
72
+ foreach ( $modules as $title => $data ) {
73
+ $slug = $data[0];
74
+ if ( 'on' !== get_option('wpr-element-'. $slug, 'on') ) {
75
+ unset($modules[$title]);
76
+ }
77
+ }
78
+ return $modules;
79
+ }
80
+
81
+ /**
82
+ ** Get Theme Builder Modules
83
+ */
84
+ public static function get_theme_builder_modules() {
85
+ return [
86
+ 'post-title',
87
+ 'post-media',
88
+ 'post-content',
89
+ 'post-info',
90
+ 'post-navigation',
91
+ 'post-comments',
92
+ 'author-box',
93
+ 'archive-title',
94
+ ];
95
+ }
96
+
97
+ /**
98
+ ** Get Available Custom Post Types or Taxonomies
99
+ */
100
+ public static function get_custom_types_of( $query, $exclude_defaults = true ) {
101
+ // Taxonomies
102
+ if ( 'tax' === $query ) {
103
+ $custom_types = get_taxonomies( [ 'show_in_nav_menus' => true ], 'objects' );
104
+
105
+ // Post Types
106
+ } else {
107
+ $custom_types = get_post_types( [ 'show_in_nav_menus' => true ], 'objects' );
108
+ }
109
+
110
+ $custom_type_list = [];
111
+
112
+ foreach ( $custom_types as $key => $value ) {
113
+ if ( $exclude_defaults ) {
114
+ if ( $key != 'post' && $key != 'page' && $key != 'category' && $key != 'post_tag' ) {
115
+ $custom_type_list[ $key ] = $value->label;
116
+ }
117
+ } else {
118
+ $custom_type_list[ $key ] = $value->label;
119
+ }
120
+ }
121
+
122
+ return $custom_type_list;
123
+ }
124
+
125
+
126
+ /**
127
+ ** Get All Users
128
+ */
129
+ public static function get_users() {
130
+ $users = [];
131
+
132
+ foreach ( get_users() as $key => $user ) {
133
+ $users[$user->data->ID] = $user->data->user_nicename;
134
+ }
135
+
136
+ wp_reset_postdata();
137
+
138
+ return $users;
139
+ }
140
+
141
+
142
+ /**
143
+ ** Get User Roles
144
+ */
145
+ public static function get_user_roles() {
146
+ if ( ! function_exists( 'get_editable_roles' ) ) {
147
+ require_once ABSPATH . 'wp-admin/includes/user.php';
148
+ }
149
+
150
+ $r = [];
151
+
152
+ $editable_roles = array_reverse( get_editable_roles() );
153
+
154
+ $r['guest'] = esc_html__( 'Guest', 'wpr-addons' );
155
+
156
+ foreach ( $editable_roles as $role => $details ) {
157
+ $r[ $role ] = translate_user_role( $details['name'] );
158
+ }
159
+
160
+ return $r;
161
+ }
162
+
163
+
164
+ /**
165
+ ** Get Terms of Taxonomy
166
+ */
167
+ public static function get_terms_by_taxonomy( $slug ) {
168
+ if ( ( 'product_cat' === $slug || 'product_tag' === $slug ) && ! class_exists( 'WooCommerce' ) ) {
169
+ return;
170
+ }
171
+
172
+ $query = get_terms( $slug, [ 'hide_empty' => false, 'posts_per_page' => -1 ] );
173
+ $taxonomies = [];
174
+
175
+ foreach ( $query as $tax ) {
176
+ $taxonomies[$tax->term_id] = $tax->name;
177
+ }
178
+
179
+ wp_reset_postdata();
180
+
181
+ return $taxonomies;
182
+ }
183
+
184
+
185
+ /**
186
+ ** Get Posts of Post Type
187
+ */
188
+ public static function get_posts_by_post_type( $slug ) {
189
+ $query = get_posts( [ 'post_type' => $slug, 'posts_per_page' => -1 ] );
190
+ $posts = [];
191
+
192
+ foreach ( $query as $post ) {
193
+ $posts[$post->ID] = $post->post_title;
194
+ }
195
+
196
+ wp_reset_postdata();
197
+
198
+ return $posts;
199
+ }
200
+
201
+
202
+ /**
203
+ ** Get Library Template ID
204
+ */
205
+ public static function get_template_id( $slug ) {
206
+ $template = get_page_by_path( $slug, OBJECT, 'wpr_templates' );
207
+
208
+ return isset( $template->ID ) ? $template->ID : false;
209
+ }
210
+
211
+ /**
212
+ ** Get Library Template Slug
213
+ */
214
+ public static function get_template_slug( $data, $page, $post_id = '' ) {
215
+ if ( is_null($data) ) {
216
+ return;
217
+ }
218
+
219
+ $template = NULL;
220
+
221
+ // Find a Custom Condition
222
+ foreach( $data as $id => $conditions ) {
223
+ if ( in_array( $page .'/'. $post_id, $conditions) ) {
224
+ $template = $id;
225
+ } elseif ( in_array( $page .'/all', $conditions) ) {
226
+ $template = $id;
227
+ } elseif ( in_array( $page, $conditions) ) {
228
+ $template = $id;
229
+ }
230
+ }
231
+
232
+ // If a Custom NOT Found, use Global
233
+ if ( is_null($template) ) {
234
+ foreach( $data as $id => $conditions ) {
235
+ if ( in_array( 'global', $conditions) ) {
236
+ $template = $id;
237
+ }
238
+ }
239
+ }
240
+
241
+ return $template;
242
+ }
243
+
244
+
245
+ /**
246
+ ** Get Elementor Template Type
247
+ */
248
+ public static function get_elementor_template_type( $id ) {
249
+ $post_meta = get_post_meta($id);
250
+ $template_type = isset($post_meta['_elementor_template_type'][0]) ? $post_meta['_elementor_template_type'][0] : false;
251
+
252
+ return $template_type;
253
+ }
254
+
255
+
256
+ /**
257
+ ** Get Royal Template Type
258
+ */
259
+ public static function get_wpr_template_type( $id ) {
260
+ $post_meta = get_post_meta($id);
261
+ $template_type = isset($post_meta['_wpr_template_type'][0]) ? $post_meta['_wpr_template_type'][0] : false;
262
+
263
+ return $template_type;
264
+ }
265
+
266
+
267
+ /**
268
+ ** Theme Builder Show Widgets on Spacific Pages
269
+ */
270
+ public static function show_theme_buider_widget_on( $type ) {
271
+ global $post;
272
+ $display = false;
273
+
274
+ if ( Utilities::is_theme_builder_template() ) {
275
+ $template_type = Utilities::get_wpr_template_type(get_the_ID());
276
+
277
+ if ( $type === $template_type ) {
278
+ $display = true;
279
+ }
280
+
281
+ $conditions = json_decode(get_option('wpr_single_conditions'));
282
+ $front_page = Utilities::get_template_slug($conditions, 'single/front_page', get_the_ID());
283
+ $page_404 = Utilities::get_template_slug($conditions, 'single/page_404', get_the_ID());
284
+
285
+ if ( $post->post_name == $front_page || $post->post_name == $page_404 ) {
286
+ $display = false;
287
+ }
288
+ }
289
+
290
+ return $display;
291
+ }
292
+
293
+
294
+ /**
295
+ ** Render Elementor Template
296
+ */
297
+ public static function render_elementor_template( $slug ) {
298
+ $template_id = Utilities::get_template_id( $slug );
299
+ $get_elementor_content = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, false );
300
+
301
+ if ( '' === $get_elementor_content ) {
302
+ return;
303
+ }
304
+
305
+ // Render Elementor Template Content
306
+ echo ''. $get_elementor_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
307
+ }
308
+
309
+
310
+ /**
311
+ ** Theme Builder Template Check
312
+ */
313
+ public static function is_theme_builder_template() {
314
+ $current_page = get_post(get_the_ID());
315
+
316
+ if ( $current_page ) {
317
+ return strpos($current_page->post_name, 'user-archive') !== false || strpos($current_page->post_name, 'user-single') !== false;
318
+ } else {
319
+ return false;
320
+ }
321
+ }
322
+
323
+
324
+ /**
325
+ ** Blog Archive Page Check
326
+ */
327
+ public static function is_blog_archive() {
328
+ $result = false;
329
+ $front_page = get_option( 'page_on_front' );
330
+ $posts_page = get_option( 'page_for_posts' );
331
+
332
+ if ( is_home() && '0' === $front_page && '0' === $posts_page || (intval($posts_page) === get_queried_object_id() && !is_404()) ) {
333
+ $result = true;
334
+ }
335
+
336
+ return $result;
337
+ }
338
+
339
+ // Get Post Sharing Icon
340
+ public static function get_post_sharing_icon( $args = [] ) {
341
+
342
+ if ( 'facebook-f' === $args['network'] ) {
343
+ $sharing_url = 'https://www.facebook.com/sharer.php?u='. $args['url'];
344
+ $network_title = esc_html__( 'Facebook', 'wpr-addons' );
345
+ } elseif ( 'twitter' === $args['network'] ) {
346
+ $sharing_url = 'https://twitter.com/intent/tweet?url='. $args['url'];
347
+ $network_title = esc_html__( 'Twitter', 'wpr-addons' );
348
+ } elseif ( 'linkedin-in' === $args['network'] ) {
349
+ $sharing_url = 'https://www.linkedin.com/shareArticle?mini=true&url='. $args['url'] .'&title='. $args['title'] .'&summary='. $args['text'] .'&source='. $args['url'];
350
+ $network_title = esc_html__( 'LinkedIn', 'wpr-addons' );
351
+ } elseif ( 'pinterest-p' === $args['network'] ) {
352
+ // $sharing_url = 'https://www.pinterest.com/pin/find/?url='. $args['url'];
353
+ $sharing_url = 'https://www.pinterest.com/pin/create/button/?url='. $args['url'] .'&media='. $args['image'];
354
+ $network_title = esc_html__( 'Pinterest', 'wpr-addons' );
355
+ } elseif ( 'reddit' === $args['network'] ) {
356
+ $sharing_url = 'https://reddit.com/submit?url='. $args['url'] .'&title='. $args['title'];
357
+ $network_title = esc_html__( 'Reddit', 'wpr-addons' );
358
+ } elseif ( 'tumblr' === $args['network'] ) {
359
+ $sharing_url = 'https://tumblr.com/share/link?url='. $args['url'];
360
+ $network_title = esc_html__( 'Tumblr', 'wpr-addons' );
361
+ } elseif ( 'digg' === $args['network'] ) {
362
+ $sharing_url = 'https://digg.com/submit?url='. $args['url'];
363
+ $network_title = esc_html__( 'Digg', 'wpr-addons' );
364
+ } elseif ( 'xing' === $args['network'] ) {
365
+ $sharing_url = 'https://www.xing.com/app/user?op=share&url='. $args['url'];
366
+ $network_title = esc_html__( 'Xing', 'wpr-addons' );
367
+ } elseif ( 'stumbleupon' === $args['network'] ) {
368
+ $sharing_url = 'https://www.stumbleupon.com/submit?url='. $args['url'];
369
+ $network_title = esc_html__( 'StumpleUpon', 'wpr-addons' );
370
+ } elseif ( 'vk' === $args['network'] ) {
371
+ $sharing_url = 'https://vkontakte.ru/share.php?url='. $args['url'] .'&title='. $args['title'] .'&description='. wp_trim_words( $args['text'], 250 ) .'&image='. $args['image'] .'/';
372
+ $network_title = esc_html__( 'vKontakte', 'wpr-addons' );
373
+ } elseif ( 'odnoklassniki' === $args['network'] ) {
374
+ $sharing_url = 'http://odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl='. $args['url'];
375
+ $network_title = esc_html__( 'OdnoKlassniki', 'wpr-addons' );
376
+ } elseif ( 'get-pocket' === $args['network'] ) {
377
+ $sharing_url = 'https://getpocket.com/edit?url='. $args['url'];
378
+ $network_title = esc_html__( 'Pocket', 'wpr-addons' );
379
+ } elseif ( 'skype' === $args['network'] ) {
380
+ $sharing_url = 'https://web.skype.com/share?url='. $args['url'];
381
+ $network_title = esc_html__( 'Skype', 'wpr-addons' );
382
+ } elseif ( 'whatsapp' === $args['network'] ) {
383
+ $sharing_url = 'https://api.whatsapp.com/send?text=*'. $args['title'] .'*\n'. $args['text'] .'\n'. $args['url'];
384
+ $network_title = esc_html__( 'WhatsApp', 'wpr-addons' );
385
+ } elseif ( 'telegram' === $args['network'] ) {
386
+ $sharing_url = 'https://telegram.me/share/url?url='. $args['url'] .'&text='. $args['text'];
387
+ $network_title = esc_html__( 'Telegram', 'wpr-addons' );
388
+ } elseif ( 'delicious' === $args['network'] ) {
389
+ $sharing_url = 'https://del.icio.us/save?url='. $args['url'] .'&title={title}';
390
+ $network_title = esc_html__( 'Delicious', 'wpr-addons' );
391
+ } elseif ( 'envelope' === $args['network'] ) {
392
+ $sharing_url = 'mailto:?subject='. $args['title'] .'&body='. $args['url'];
393
+ $network_title = esc_html__( 'Email', 'wpr-addons' );
394
+ } elseif ( 'print' === $args['network'] ) {
395
+ $sharing_url = 'javascript:window.print()';
396
+ $network_title = esc_html__( 'Print', 'wpr-addons' );
397
+ } else {
398
+ $sharing_url = '';
399
+ $network_title = '';
400
+ }
401
+
402
+ $sharing_url = 'print' === $args['network'] ? $sharing_url : esc_url( $sharing_url );
403
+
404
+ $output = '';
405
+
406
+ if ( '' !== $network_title ) {
407
+ $output .= '<a href="'. esc_url($sharing_url) .'" class="wpr-sharing-icon wpr-sharing-'. esc_attr( $args['network'] ) .'" title="" target="_blank">';
408
+ // Tooltip
409
+ $output .= 'yes' === $args['tooltip'] ? '<span class="wpr-sharing-tooltip wpr-tooltip">'. esc_html( $network_title ) .'</span>' : '';
410
+
411
+ // Category
412
+ if ( 'envelope' === $args['network'] || 'print' === $args['network'] ) {
413
+ $category = 'fas';
414
+ } else {
415
+ $category = 'fab';
416
+ }
417
+
418
+ // Icon
419
+ if ( 'yes' === $args['icons'] ) {
420
+ $output .= '<i class="'. esc_attr($category) .' fa-'. esc_attr( $args['network'] ) .'"></i>';
421
+ }
422
+
423
+ // Label
424
+ if ( isset( $args['labels'] ) && 'yes' === $args['labels'] ) {
425
+ $label = isset( $args['custom_label'] ) && '' !== $args['custom_label'] ? $args['custom_label'] : $network_title;
426
+ $output .= '<span class="wpr-sharing-label">'. esc_html( $label ) .'</span>';
427
+ }
428
+ $output .= '</a>';
429
+ }
430
+
431
+ return $output;
432
+ }
433
+
434
+
435
+ /**
436
+ ** Filter oEmbed Results
437
+ */
438
+ public static function filter_oembed_results( $html ) {
439
+ // Filter
440
+ preg_match( '/<iframe.*src=\"(.*)\".*><\/iframe>/isU', $html, $matches );
441
+
442
+ // Return URL
443
+ return $matches[1] .'&auto_play=true';
444
+ }
445
+
446
+
447
+ /**
448
+ ** Get Custom Meta Keys
449
+ */
450
+ public static function get_custom_meta_keys() {
451
+ $data = [];
452
+ $options = [];
453
+ $merged_meta_keys = [];
454
+ $post_types = Utilities::get_custom_types_of( 'post', false );
455
+
456
+ foreach ( $post_types as $post_type_slug => $post_type_name ) {
457
+ $data[ $post_type_slug ] = [];
458
+ $posts = get_posts( [ 'post_type' => $post_type_slug ] );
459
+
460
+ foreach ( $posts as $key => $post ) {
461
+ $meta_keys = get_post_custom_keys( $post->ID );
462
+
463
+ if ( ! empty($meta_keys) ) {
464
+ for ( $i = 0; $i < count( $meta_keys ); $i++ ) {
465
+ if ( '_' !== substr( $meta_keys[$i], 0, 1 ) ) {
466
+ array_push( $data[$post_type_slug], $meta_keys[$i] );
467
+ }
468
+ }
469
+ }
470
+ }
471
+
472
+ $data[ $post_type_slug ] = array_unique( $data[ $post_type_slug ] );
473
+ }
474
+
475
+ foreach ( $data as $array ) {
476
+ $merged_meta_keys = array_unique( array_merge( $merged_meta_keys, $array ) );
477
+ }
478
+
479
+ // Rekey
480
+ $merged_meta_keys = array_values($merged_meta_keys);
481
+
482
+ for ( $i = 0; $i < count( $merged_meta_keys ); $i++ ) {
483
+ $options[ $merged_meta_keys[$i] ] = $merged_meta_keys[$i];
484
+ }
485
+
486
+ return [ $data, $options ];
487
+ }
488
+
489
+
490
+ /**
491
+ ** Get SVG Icons Array
492
+ */
493
+ public static function get_svg_icons_array( $stack, $fa_icons ) {
494
+ $svg_icons = [];
495
+
496
+ if ( 'arrows' === $stack ) {
497
+ $svg_icons['svg-angle-1-left'] = esc_html__( 'Angle', 'wpr-addons' );
498
+ $svg_icons['svg-angle-2-left'] = esc_html__( 'Angle Bold', 'wpr-addons' );
499
+ $svg_icons['svg-angle-3-left'] = esc_html__( 'Angle Bold Round', 'wpr-addons' );
500
+ $svg_icons['svg-angle-4-left'] = esc_html__( 'Angle Plane', 'wpr-addons' );
501
+ $svg_icons['svg-arrow-1-left'] = esc_html__( 'Arrow', 'wpr-addons' );
502
+ $svg_icons['svg-arrow-2-left'] = esc_html__( 'Arrow Bold', 'wpr-addons' );
503
+ $svg_icons['svg-arrow-3-left'] = esc_html__( 'Arrow Bold Round', 'wpr-addons' );
504
+ $svg_icons['svg-arrow-4-left'] = esc_html__( 'Arrow Caret', 'wpr-addons' );
505
+
506
+ } elseif ( 'blockquote' === $stack ) {
507
+ $svg_icons['svg-blockquote-1'] = esc_html__( 'Blockquote Round', 'wpr-addons' );
508
+ $svg_icons['svg-blockquote-2'] = esc_html__( 'Blockquote ST', 'wpr-addons' );
509
+ $svg_icons['svg-blockquote-3'] = esc_html__( 'Blockquote BS', 'wpr-addons' );
510
+ $svg_icons['svg-blockquote-4'] = esc_html__( 'Blockquote Edges', 'wpr-addons' );
511
+ $svg_icons['svg-blockquote-5'] = esc_html__( 'Blockquote Quad', 'wpr-addons' );
512
+
513
+ } elseif ( 'sharing' === $stack ) {
514
+ // $svg_icons['svg-sharing-1'] = esc_html__( 'sharing 1', 'wpr-addons' );
515
+ // $svg_icons['svg-sharing-2'] = esc_html__( 'sharing 2', 'wpr-addons' );
516
+ }
517
+
518
+ // Merge FontAwesome and SVG icons
519
+ return array_merge( $fa_icons, $svg_icons );
520
+ }
521
+
522
+
523
+ /**
524
+ ** Get SVG Icon
525
+ */
526
+ public static function get_svg_icon( $icon, $dir ) {
527
+ $style_attr = '';
528
+
529
+ // Rotate Right
530
+ if ( 'right' === $dir ) {
531
+ $style_attr = 'style="transform: rotate(180deg); -webkit-transform: rotate(180deg);" ';
532
+ }
533
+
534
+ $icons = [
535
+ // Arrows
536
+ 'svg-angle-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 283.4 512" style="enable-background:new 0 0 283.4 512;" xml:space="preserve"><g><polygon class="st0" points="54.5,256.3 283.4,485.1 256.1,512.5 0,256.3 0,256.3 27.2,229 256.1,0 283.4,27.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
537
+ 'svg-angle-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 303.3 512" style="enable-background:new 0 0 303.3 512;" xml:space="preserve"><g><polygon class="st0" points="94.7,256 303.3,464.6 256,512 47.3,303.4 0,256 47.3,208.6 256,0 303.3,47.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
538
+ 'svg-angle-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 291.4 512" style="enable-background:new 0 0 291.4 512;" xml:space="preserve"><g><path class="st0" d="M281.1,451.5c13.8,13.8,13.8,36.3,0,50.1c-13.8,13.8-36.3,13.8-50.1,0L10.4,281C3.5,274.1,0,265.1,0,256c0-9.1,3.5-18.1,10.4-25L231,10.4c13.8-13.8,36.3-13.8,50.1,0c6.9,6.9,10.4,16,10.4,25s-3.5,18.1-10.4,25L85.5,256L281.1,451.5z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
539
+ 'svg-angle-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 259.6 512" style="enable-background:new 0 0 259.6 512;" xml:space="preserve"><g><path class="st0" d="M256.6,18.1L126.2,256.1l130.6,237.6c3.6,5.6,3.9,10.8,0.2,14.9c-0.2,0.2-0.2,0.3-0.3,0.3s-0.3,0.3-0.3,0.3c-3.9,3.9-10.3,3.6-14.2-0.3L2.9,263.6c-2-2.1-3.1-4.7-2.9-7.5c0-2.8,1-5.6,3.1-7.7L242,3.1c4.1-4.1,10.6-4.1,14.6,0l0,0C260.7,7.3,260.5,10.9,256.6,18.1z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
540
+ 'svg-arrow-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 338.4" style="enable-background:new 0 0 512 338.4;" xml:space="preserve"><g><polygon class="st0" points="511.4,183.1 53.4,183.1 188.9,318.7 169.2,338.4 0,169.2 169.2,0 188.9,19.7 53.4,155.3 511.4,155.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
541
+ 'svg-arrow-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 320.6" style="enable-background:new 0 0 512 320.6;" xml:space="preserve"><g><polygon class="st0" points="512,184.4 92.7,184.4 194.7,286.4 160.5,320.6 34.3,194.4 34.3,194.4 0,160.2 160.4,0 194.5,34.2 92.7,136 512,136 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
542
+ 'svg-arrow-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 320.6" style="enable-background:new 0 0 499.6 320.6;" xml:space="preserve"><g><path class="st0" d="M499.6,159.3c0.3,7-2.4,13.2-7,17.9c-4.3,4.3-10.4,7-16.9,7H81.6l95.6,95.6c9.3,9.3,9.3,24.4,0,33.8c-4.6,4.6-10.8,7-16.9,7c-6.1,0-12.3-2.4-16.9-7L6.9,177.2c-9.3-9.3-9.3-24.4,0-33.8l16.9-16.9l0,0L143.3,6.9c9.3-9.3,24.4-9.3,33.8,0c4.6,4.6,7,10.8,7,16.9s-2.4,12.3-7,16.9l-95.6,95.6h393.7C488.3,136.3,499.1,146.4,499.6,159.3z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
543
+ 'svg-arrow-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 201.3" style="enable-background:new 0 0 499.6 201.3;" xml:space="preserve"><g><polygon class="st0" points="0,101.1 126,0 126,81.6 499.6,81.6 499.6,120.8 126,120.8 126,201.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
544
+
545
+ // Blockquote
546
+ 'svg-blockquote-1' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 406.1" style="enable-background:new 0 0 512 406.1;" xml:space="preserve"><g><g id="Layer_2_1_" class="st0"><path class="st1" d="M510.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C218.9,145.3,477.7,0.1,477.7,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C421.8,170.3,510.1,220.2,510.6,301.8z"/><path class="st1" d="M234.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C-57.1,145.3,201.8,0.1,201.8,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C145.9,170.3,234.1,220.2,234.6,301.8z"/></g></g></svg>',
547
+ 'svg-blockquote-2' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 415.9" style="enable-background:new 0 0 512 415.9;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="512,0 303.1,208 303.1,415.9 512,415.9 "/><polygon class="st1" points="208.9,0 0,208 0,415.9 208.9,415.9 "/></g></g></svg>',
548
+ 'svg-blockquote-3' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 369.3" style="enable-background:new 0 0 512 369.3;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="240.7,0 240.7,240.5 88.1,369.3 88.1,328.3 131.4,240.5 0.3,240.5 0.3,0 "/><polygon class="st1" points="512,43.3 512,238.6 388.1,343.2 388.1,310 423.2,238.6 316.7,238.6 316.7,43.3 "/></g></g></svg>',
549
+ 'svg-blockquote-4' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 369.3" style="enable-background:new 0 0 512 369.3;" xml:space="preserve"><g><g class="st0"><g><path class="st1" d="M469.1,299.1c-62,79.7-148.7,69.8-148.7,69.8v-86.5c0,0,42.6-0.6,77.5-35.4c20.3-20.3,22.7-65.6,22.8-81.4h-101V-10.9H512v176.6C512.2,184.7,509.4,247.2,469.1,299.1z"/></g><g><path class="st1" d="M149.3,299.1c-62,79.7-148.7,69.8-148.7,69.8v-86.5c0,0,42.6-0.6,77.5-35.4c20.3-20.3,22.7-65.6,22.8-81.4H0V-10.9h192.2v176.6C192.4,184.7,189.7,247.2,149.3,299.1z"/></g></g></g></svg>',
550
+ 'svg-blockquote-5' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 422.1" style="enable-background:new 0 0 512 422.1;" xml:space="preserve"><g><g class="st0"><polygon class="st1" points="237,0 237,223.7 169.3,422.1 25.7,422.1 53.4,223.7 0,223.7 0,0 "/><polygon class="st1" points="512,0 512,223.7 444.3,422.1 300.7,422.1 328.4,223.7 275,223.7 275,0 "/></g></g></svg>',
551
+
552
+ // Sharing
553
+ 'svg-sharing-1' => '<?xml version="1.0" ?><svg style="enable-background:new 0 0 48 48;" version="1.1" viewBox="0 0 48 48" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Icons"><g id="Icons_15_"><g><path d="M25.03766,20.73608v-3.7207c0-0.3799,0.4135-0.6034,0.7263-0.4023l9.3855,5.9218 c0.3017,0.19,0.3017,0.6146,0,0.8045l-5.1844,3.2738l-1.8659,1.1843l-2.3352,1.4749c-0.3129,0.2011-0.7263-0.0335-0.7263-0.4022 v-3.2403v-0.4916" style="fill:#5F83CF;"/><path d="M29.96506,26.61318l-1.8659,1.1843l-2.3352,1.4749c-0.3128,0.2011-0.7263-0.0335-0.7263-0.4022 v-3.2403v-0.4916c-2.5759,0.1057-5.718-0.3578-7.8439,0.6112c-1.9663,0.8963-3.5457,2.5639-4.2666,4.6015 c-0.1282,0.3623-0.2296,0.7341-0.3029,1.1114v-2.9721c0-1.128,0.2449-2.2513,0.7168-3.2759 c0.4588-0.9961,1.1271-1.8927,1.948-2.6196c0.8249-0.7306,1.8013-1.2869,2.8523-1.6189 c1.5111-0.4774,3.1532-0.4118,4.7155-0.3096c0.7252,0.0475,1.4538,0.0698,2.1808,0.0698" style="fill:#5F83CF;"/></g></g></g></svg>',
554
+ 'svg-sharing-2' => '<?xml version="1.0" ?><svg style="enable-background:new 0 0 48 48;" version="1.1" viewBox="0 0 48 48" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Icons"><g id="Icons_16_"><g><path d="M27.775,21.64385L27.775,21.64385l1-0.01h1v1.65l2.17-1.38l0.1-0.06l2.95-1.87l-5.22-3.29v0.87 v0.77h-1l-1-0.02l0,0" style="fill:#5F83CF;"/><path d="M28.775,18.32385c-0.33,0-0.67-0.01-1-0.02c-0.22-0.01-0.43-0.02-0.65-0.04 c-1.3358-0.0496-2.5105-0.0408-3.55,0.24c-0.5,0.16-0.97,0.38-1.41,0.67c-0.26,0.16-0.51,0.34-0.74,0.55 c-0.62,0.54-1.12,1.22-1.47,1.97c-0.35,0.77-0.54,1.62-0.54,2.47v2.24c0.06-0.29,0.13-0.57,0.23-0.84 c0.54-1.53,1.73-2.79,3.22-3.47c1.34-0.61,3.21-0.47,4.91-0.45c0.35,0,0.68,0,1-0.01" style="fill:#5F83CF;"/><path d="M31.945,23.63175l-1.8884,1.1873v3.8702c0,0.5422-0.5142,0.991-1.1499,0.991H16.0432 c-0.6357,0-1.1498-0.4488-1.1498-0.991v-8.7689c0-0.5515,0.5142-1.0002,1.1498-1.0002h3.5525h0.0037 c0.0561-0.0748,0.1739-0.2057,0.2393-0.2618c0.6731-0.5983,1.4864-1.0657,2.3465-1.3368 c0.0467-0.0187,0.0935-0.0281,0.1402-0.0374h-6.2821c-1.6734,0-3.0383,1.1872-3.0383,2.6362v8.7689 c0,1.449,1.3649,2.6269,3.0383,2.6269h12.8634c1.6734,0,3.0383-1.1779,3.0383-2.6269V23.63175z" style="fill:#F2F2F2;"/></g></g></g></svg>',
555
+
556
+ ];
557
+
558
+ return $icons[$icon];
559
+ }
560
+
561
+
562
+ /**
563
+ ** Get WPR Icon
564
+ */
565
+ public static function get_wpr_icon( $icon, $dir ) {
566
+ if ( false !== strpos( $icon, 'svg-' ) ) {
567
+ return Utilities::get_svg_icon( $icon, $dir );
568
+
569
+ } elseif ( false !== strpos( $icon, 'fa-' ) ) {
570
+ $dir = '' !== $dir ? '-'. $dir : '';
571
+ return wp_kses('<i class="'. esc_attr($icon . $dir) .'"></i>', [
572
+ 'i' => [
573
+ 'class' => []
574
+ ]
575
+ ]);
576
+ } else {
577
+ return '';
578
+ }
579
+ }
580
+
581
+
582
+ /**
583
+ ** Mailchimp AJAX Subscribe
584
+ */
585
+ public static function ajax_mailchimp_subscribe() {
586
+ // API Key
587
+ $api_key = isset($_POST['apiKey']) ? sanitize_key($_POST['apiKey']) : '';
588
+ $api_key_sufix = explode( '-', $api_key )[1];
589
+
590
+ // List ID
591
+ $list_id = isset($_POST['listId']) ? sanitize_text_field(wp_unslash($_POST['listId'])) : '';
592
+
593
+ // Get Available Fileds (PHPCS - fields are sanitized later on input)
594
+ $available_fields = isset($_POST['fields']) ? $_POST['fields'] : []; // phpcs:ignore
595
+ wp_parse_str( $available_fields, $fields );
596
+
597
+ // Merge Additional Fields
598
+ $merge_fields = array(
599
+ 'FNAME' => !empty( $fields['wpr_mailchimp_firstname'] ) ? sanitize_text_field($fields['wpr_mailchimp_firstname']) : '',
600
+ 'LNAME' => !empty( $fields['wpr_mailchimp_lastname'] ) ? sanitize_text_field($fields['wpr_mailchimp_lastname']) : '',
601
+ );
602
+
603
+ // API URL
604
+ $api_url = 'https://'. $api_key_sufix .'.api.mailchimp.com/3.0/lists/'. $list_id .'/members/'. md5(strtolower(sanitize_text_field($fields['wpr_mailchimp_email'])));
605
+
606
+ // API Args
607
+ $api_args = [
608
+ 'method' => 'PUT',
609
+ 'headers' => [
610
+ 'Content-Type' => 'application/json',
611
+ 'Authorization' => 'apikey '. $api_key,
612
+ ],
613
+ 'body' => json_encode([
614
+ 'email_address' => sanitize_text_field($fields[ 'wpr_mailchimp_email' ]),
615
+ 'status' => 'subscribed',
616
+ 'merge_fields' => $merge_fields,
617
+ ]),
618
+ ];
619
+
620
+ // Send Request
621
+ $request = wp_remote_post( $api_url, $api_args );
622
+
623
+ if ( ! is_wp_error($request) ) {
624
+ $request = json_decode( wp_remote_retrieve_body($request) );
625
+
626
+ // Set Status
627
+ if ( ! empty($request) ) {
628
+ if ($request->status == 'subscribed') {
629
+ wp_send_json([ 'status' => 'subscribed' ]);
630
+ } else {
631
+ wp_send_json([ 'status' => $request->title ]);
632
+ }
633
+ }
634
+ }
635
+ }
636
+
637
+ /**
638
+ ** Mailchimp - Get Lists
639
+ */
640
+ public static function get_mailchimp_lists() {
641
+ $api_key = get_option('wpr_mailchimp_api_key', '');
642
+
643
+ $mailchimp_list = [
644
+ 'def' => esc_html__( 'Select List', 'wpr-addons' )
645
+ ];
646
+
647
+ if ( '' === $api_key ) {
648
+ return $mailchimp_list;
649
+ } else {
650
+ $url = 'https://'. substr( $api_key, strpos( $api_key, '-' ) + 1 ) .'.api.mailchimp.com/3.0/lists/';
651
+ $args = [ 'headers' => [ 'Authorization' => 'Basic ' . base64_encode( 'user:'. $api_key ) ] ];
652
+
653
+ $response = wp_remote_get( $url, $args );
654
+ $body = json_decode($response['body']);
655
+
656
+ if ( ! empty( $body->lists ) ) {
657
+ foreach ( $body->lists as $list ) {
658
+ $mailchimp_list[$list->id] = $list->name .' ('. $list->stats->member_count .')';
659
+ }
660
+ }
661
+
662
+ return $mailchimp_list;
663
+ }
664
+ }
665
+
666
+ /**
667
+ ** WPR Animation Timings
668
+ */
669
+ public static function wpr_animation_timings() {
670
+ $timing_functions = [
671
+ 'ease-default' => 'Default',
672
+ 'linear' => 'Linear',
673
+ 'ease-in' => 'Ease In',
674
+ 'ease-out' => 'Ease Out',
675
+ 'pro-eio' => 'EI Out (Pro)',
676
+ 'pro-eiqd' => 'EI Quad (Pro)',
677
+ 'pro-eicb' => 'EI Cubic (Pro)',
678
+ 'pro-eiqrt' => 'EI Quart (Pro)',
679
+ 'pro-eiqnt' => 'EI Quint (Pro)',
680
+ 'pro-eisn' => 'EI Sine (Pro)',
681
+ 'pro-eiex' => 'EI Expo (Pro)',
682
+ 'pro-eicr' => 'EI Circ (Pro)',
683
+ 'pro-eibk' => 'EI Back (Pro)',
684
+ 'pro-eoqd' => 'EO Quad (Pro)',
685
+ 'pro-eocb' => 'EO Cubic (Pro)',
686
+ 'pro-eoqrt' => 'EO Quart (Pro)',
687
+ 'pro-eoqnt' => 'EO Quint (Pro)',
688
+ 'pro-eosn' => 'EO Sine (Pro)',
689
+ 'pro-eoex' => 'EO Expo (Pro)',
690
+ 'pro-eocr' => 'EO Circ (Pro)',
691
+ 'pro-eobk' => 'EO Back (Pro)',
692
+ 'pro-eioqd' => 'EIO Quad (Pro)',
693
+ 'pro-eiocb' => 'EIO Cubic (Pro)',
694
+ 'pro-eioqrt' => 'EIO Quart (Pro)',
695
+ 'pro-eioqnt' => 'EIO Quint (Pro)',
696
+ 'pro-eiosn' => 'EIO Sine (Pro)',
697
+ 'pro-eioex' => 'EIO Expo (Pro)',
698
+ 'pro-eiocr' => 'EIO Circ (Pro)',
699
+ 'pro-eiobk' => 'EIO Back (Pro)',
700
+ ];
701
+
702
+ if ( wpr_fs()->can_use_premium_code() && defined('WPR_ADDONS_PRO_VERSION') ) {
703
+ $timing_functions = \WprAddonsPro\Includes\Controls\WPR_Control_Animations_Pro::wpr_animation_timings();
704
+ }
705
+
706
+ return $timing_functions;
707
+ }
708
+
709
+ public static function wpr_animation_timing_pro_conditions() {
710
+ return ['pro-eio','pro-eiqd','pro-eicb','pro-eiqrt','pro-eiqnt','pro-eisn','pro-eiex','pro-eicr','pro-eibk','pro-eoqd','pro-eocb','pro-eoqrt','pro-eoqnt','pro-eosn','pro-eoex','pro-eocr','pro-eobk','pro-eioqd','pro-eiocb','pro-eioqrt','pro-eioqnt','pro-eiosn','pro-eioex','pro-eiocr','pro-eiobk'];
711
+ }
712
+
713
+ /**
714
+ ** WPR Library Button
715
+ */
716
+ public static function wpr_library_buttons( $module, $controls_manager, $tutorial_url = '' ) {
717
+ if ( empty(get_option('wpr_wl_plugin_links')) ) {
718
+ if ( '' !== $tutorial_url ) {
719
+ $tutorial_link = '<a href="'. esc_url($tutorial_url) .'" target="_blank">'. esc_html__( 'Watch Video Tutorial ', 'wpr-addons' ) .'<span class="dashicons dashicons-video-alt3"></span></a>';
720
+ } else {
721
+ $tutorial_link = '';
722
+ }
723
+
724
+ $module->add_control(
725
+ 'wpr_library_buttons',
726
+ [
727
+ 'raw' => '<div><a href="#" target="_blank" data-theme="'. esc_attr(get_template()) .'">'. esc_html__( 'Widget Preview', 'wpr-addons' ) .'</a> <a href="#">'. esc_html__( 'Predefined Styles', 'wpr-addons' ) .'</a></div>'. $tutorial_link,
728
+ 'type' => $controls_manager,
729
+ ]
730
+ );
731
+ }
732
+ }
733
+
734
+ /**
735
+ ** Upgrade to Pro Notice
736
+ */
737
+ public static function upgrade_pro_notice( $module, $controls_manager, $widget, $option, $condition = [] ) {
738
+ if ( wpr_fs()->can_use_premium_code() ) {
739
+ return;
740
+ }
741
+
742
+ $module->add_control(
743
+ $option .'_pro_notice',
744
+ [
745
+ 'raw' => 'This option is available<br> in the <strong><a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-'. $widget .'-upgrade-pro#purchasepro" target="_blank">Pro version</a></strong>',
746
+ // 'raw' => 'This option is available<br> in the <strong><a href="'. admin_url('admin.php?page=wpr-addons-pricing') .'" target="_blank">Pro version</a></strong>',
747
+ 'type' => $controls_manager,
748
+ 'content_classes' => 'wpr-pro-notice',
749
+ 'condition' => [
750
+ $option => $condition,
751
+ ]
752
+ ]
753
+ );
754
+ }
755
+
756
+ /**
757
+ ** Pro Features List Section
758
+ */
759
+ public static function pro_features_list_section( $module, $controls_manager, $widget, $features ) {
760
+ if ( wpr_fs()->can_use_premium_code() ) {
761
+ return;
762
+ }
763
+
764
+ $module->start_controls_section(
765
+ 'pro_features_section',
766
+ [
767
+ 'label' => 'Pro Features <span class="dashicons dashicons-star-filled"></span>',
768
+ ]
769
+ );
770
+
771
+ $list_html = '';
772
+
773
+ for ($i=0; $i < count($features); $i++) {
774
+ $list_html .= '<li>'. $features[$i] .'</li>';
775
+ }
776
+
777
+ $module->add_control(
778
+ 'pro_features_list',
779
+ [
780
+ 'type' => $controls_manager,
781
+ 'raw' => '<ul>'. $list_html .'</ul>
782
+ <a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-pro-sec-'. $widget .'-upgrade-pro#purchasepro" target="_blank">Get Pro version</a>',
783
+ 'content_classes' => 'wpr-pro-features-list',
784
+ ]
785
+ );
786
+
787
+ $module->end_controls_section();
788
+ }
789
+
790
+ /**
791
+ ** Check for New Free Users
792
+ */
793
+ public static function is_new_free_user() {
794
+ return !wpr_fs()->can_use_premium_code() && (intval(get_option('royal_elementor_addons_activation_time')) > 1649247746);
795
+ }
796
+
797
  }
extensions/wpr-custom-css.php CHANGED
@@ -1,82 +1,82 @@
1
- <?php
2
- use \Elementor\Controls_Manager;
3
- use WprAddons\Classes\Utilities;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- class Wpr_Custom_CSS {
10
-
11
- private static $instance = null;
12
-
13
- public function __construct() {
14
- // Add new controls to advanced tab globally
15
- add_action('elementor/element/after_section_end', [$this, 'add_section_custom_css_controls'], 25, 3);
16
-
17
- // Render the Custom CSS
18
- add_action('elementor/element/parse_css', [$this, 'add_post_css'], 10, 2);
19
- }
20
-
21
- public function add_section_custom_css_controls($widget, $section_id, $args) {
22
- if ( 'section_custom_css_pro' !== $section_id ) {
23
- return;
24
- }
25
-
26
- $widget->start_controls_section(
27
- 'wpr_section_custom_css',
28
- [
29
- 'label' => sprintf(esc_html__('Custom CSS - %s', 'wpr-addons'), Utilities::get_plugin_name()),
30
- 'tab' => Controls_Manager::TAB_ADVANCED
31
- ]
32
- );
33
-
34
- $widget->add_control(
35
- 'wpr_custom_css',
36
- [
37
- 'type' => Controls_Manager::CODE,
38
- 'label' => esc_html__('Custom CSS', 'wpr-addons'),
39
- 'language' => 'css',
40
- 'render_type' => 'ui',
41
- 'label_block' => true,
42
- ]
43
- );
44
-
45
- $widget->add_control(
46
- 'wpr_custom_css_description',
47
- [
48
- 'raw' => esc_html__('Use "selector" keyword to target wrapper element.', 'wpr-addons'),
49
- 'type' => Controls_Manager::RAW_HTML,
50
- 'content_classes' => 'elementor-descriptor',
51
- 'separator' => 'none'
52
- ]
53
- );
54
-
55
- $widget->end_controls_section();
56
- }
57
-
58
-
59
-
60
- public function add_post_css($post_css, $element) {
61
- $element_settings = $element->get_settings();
62
-
63
- if ( empty($element_settings['wpr_custom_css']) ) {
64
- return;
65
- }
66
-
67
- $css = trim($element_settings['wpr_custom_css']);
68
-
69
- if ( empty($css) ) {
70
- return;
71
- }
72
-
73
- $css = str_replace('selector', $post_css->get_element_unique_selector($element), $css);
74
-
75
- // Add a css comment
76
- $css = sprintf('/* Start custom CSS for %s, class: %s */', $element->get_name(), $element->get_unique_selector()) . $css . '/* End custom CSS */';
77
-
78
- $post_css->get_stylesheet()->add_raw_css($css);
79
- }
80
- }
81
-
82
- new Wpr_Custom_CSS();
1
+ <?php
2
+ use \Elementor\Controls_Manager;
3
+ use WprAddons\Classes\Utilities;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ class Wpr_Custom_CSS {
10
+
11
+ private static $instance = null;
12
+
13
+ public function __construct() {
14
+ // Add new controls to advanced tab globally
15
+ add_action('elementor/element/after_section_end', [$this, 'add_section_custom_css_controls'], 25, 3);
16
+
17
+ // Render the Custom CSS
18
+ add_action('elementor/element/parse_css', [$this, 'add_post_css'], 10, 2);
19
+ }
20
+
21
+ public function add_section_custom_css_controls($widget, $section_id, $args) {
22
+ if ( 'section_custom_css_pro' !== $section_id ) {
23
+ return;
24
+ }
25
+
26
+ $widget->start_controls_section(
27
+ 'wpr_section_custom_css',
28
+ [
29
+ 'label' => sprintf(esc_html__('Custom CSS - %s', 'wpr-addons'), Utilities::get_plugin_name()),
30
+ 'tab' => Controls_Manager::TAB_ADVANCED
31
+ ]
32
+ );
33
+
34
+ $widget->add_control(
35
+ 'wpr_custom_css',
36
+ [
37
+ 'type' => Controls_Manager::CODE,
38
+ 'label' => esc_html__('Custom CSS', 'wpr-addons'),
39
+ 'language' => 'css',
40
+ 'render_type' => 'ui',
41
+ 'label_block' => true,
42
+ ]
43
+ );
44
+
45
+ $widget->add_control(
46
+ 'wpr_custom_css_description',
47
+ [
48
+ 'raw' => esc_html__('Use "selector" keyword to target wrapper element.', 'wpr-addons'),
49
+ 'type' => Controls_Manager::RAW_HTML,
50
+ 'content_classes' => 'elementor-descriptor',
51
+ 'separator' => 'none'
52
+ ]
53
+ );
54
+
55
+ $widget->end_controls_section();
56
+ }
57
+
58
+
59
+
60
+ public function add_post_css($post_css, $element) {
61
+ $element_settings = $element->get_settings();
62
+
63
+ if ( empty($element_settings['wpr_custom_css']) ) {
64
+ return;
65
+ }
66
+
67
+ $css = trim($element_settings['wpr_custom_css']);
68
+
69
+ if ( empty($css) ) {
70
+ return;
71
+ }
72
+
73
+ $css = str_replace('selector', $post_css->get_element_unique_selector($element), $css);
74
+
75
+ // Add a css comment
76
+ $css = sprintf('/* Start custom CSS for %s, class: %s */', $element->get_name(), $element->get_unique_selector()) . $css . '/* End custom CSS */';
77
+
78
+ $post_css->get_stylesheet()->add_raw_css($css);
79
+ }
80
+ }
81
+
82
+ new Wpr_Custom_CSS();
extensions/wpr-parallax.php CHANGED
@@ -1,438 +1,437 @@
1
- <?php
2
- namespace WprAddons\Extensions;
3
-
4
- use Elementor\Controls_Manager;
5
- use Elementor\Control_Media;
6
- use Elementor\Controls_Stack;
7
- use Elementor\Element_Base;
8
- use Elementor\Repeater;
9
- use Elementor\Utils;
10
- use WprAddons\Classes\Utilities;
11
-
12
- if ( ! defined( 'ABSPATH' ) ) {
13
- exit; // Exit if accessed directly.
14
- }
15
-
16
- class Wpr_Parallax_Scroll {
17
-
18
- public function __construct() {
19
- add_action( 'elementor/element/section/section_background/after_section_end', [$this, 'register_controls'], 10);
20
- add_action( 'elementor/frontend/section/before_render', [$this, '_before_render'], 10, 1);
21
- add_action( 'elementor/section/print_template', [ $this, '_print_template' ], 10, 2 );
22
- add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
23
- }
24
-
25
- public function register_controls( $element ) {
26
- $element->start_controls_section(
27
- 'wpr_section_parallax',
28
- [
29
- 'tab' => Controls_Manager::TAB_STYLE,
30
- 'label' => sprintf(esc_html__('Parallax - %s', 'wpr-addons'), Utilities::get_plugin_name()),
31
- ]
32
- );
33
-
34
- $element->add_control(
35
- 'wpr_parallax',
36
- [
37
- 'type' => Controls_Manager::RAW_HTML,
38
- 'raw' => '<div class="elementor-update-preview editor-wpr-preview-update"><span>Update changes to Preview</span><button class="elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply</button>',
39
- 'separator' => 'after'
40
- ]
41
- );
42
-
43
- if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
44
-
45
- $element->add_control(
46
- 'parallax_video_tutorial',
47
- [
48
- 'raw' => '<br><a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial <span class="dashicons dashicons-video-alt3"></span></a>',
49
- 'type' => Controls_Manager::RAW_HTML,
50
- ]
51
- );
52
-
53
- $element->add_control(
54
- 'wpr_enable_jarallax',
55
- [
56
- 'type' => Controls_Manager::SWITCHER,
57
- 'label' => __('Enable Background Parallax', 'wpr-addons'),
58
- 'default' => 'no',
59
- 'label_on' => __('Yes', 'wpr-addons'),
60
- 'label_off' => __('No', 'wpr-addons'),
61
- 'return_value' => 'yes',
62
- 'render_type' => 'template',
63
- 'prefix_class' => 'wpr-jarallax-'
64
- ]
65
- );
66
-
67
- $element->add_control(
68
- 'speed',
69
- [
70
- 'label' => __( 'Animation Speed', 'wpr-addons' ),
71
- 'type' => Controls_Manager::NUMBER,
72
- 'min' => -1.0,
73
- 'max' => 2.0,
74
- 'step' => 0.1,
75
- 'default' => 1.4,
76
- 'render_type' => 'template',
77
- 'condition' => [
78
- 'wpr_enable_jarallax' => 'yes'
79
- ]
80
- ]
81
- );
82
-
83
- if ( wpr_fs()->can_use_premium_code() && defined('WPR_ADDONS_PRO_VERSION') ) {
84
- \WprAddonsPro\Extensions\Wpr_Parallax_Scroll_Pro::add_control_scroll_effect($element);
85
- } else {
86
- $element->add_control(
87
- 'scroll_effect',
88
- [
89
- 'label' => __( 'Scrolling Effect', 'wpr-addons' ),
90
- 'type' => Controls_Manager::SELECT,
91
- 'default' => 'scroll',
92
- 'options' => [
93
- 'scroll' => esc_html__( 'Scroll', 'wpr-addons' ),
94
- 'scale' => esc_html__( 'Zoom', 'wpr-addons' ),
95
- 'pro-op' => esc_html__( 'Opacity (Pro)', 'wpr-addons' ),
96
- 'pro-sclo' => esc_html__('Scale Opacity (Pro)', 'wpr-addons'),
97
- 'pro-scrlo' => esc_html__( 'Scroll Opacity (Pro)', 'wpr-addons' )
98
- ],
99
- 'render_type' => 'template',
100
- 'condition' => [
101
- 'wpr_enable_jarallax' => 'yes'
102
- ]
103
- ]
104
- );
105
-
106
- // Upgrade to Pro Notice
107
- Utilities::upgrade_pro_notice( $element, Controls_Manager::RAW_HTML, 'parallax-background', 'scroll_effect', ['pro-op','pro-sclo','pro-scrlo'] );
108
- }
109
-
110
- $element->add_control(
111
- 'bg_image',
112
- [
113
- 'label' => __( 'Choose Image', 'wpr-addons' ),
114
- 'type' => Controls_Manager::MEDIA,
115
- 'default' => [
116
- 'url' => Utils::get_placeholder_image_src(),
117
- ],
118
- 'render_type' => 'template',
119
- 'condition' => [
120
- 'wpr_enable_jarallax' => 'yes'
121
- ]
122
- ]
123
- );
124
-
125
- } // end if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
126
-
127
- $element->add_control(
128
- 'parallax_type_divider',
129
- [
130
- 'type' => Controls_Manager::DIVIDER,
131
- 'style' => 'thick',
132
- ]
133
- );
134
-
135
- if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
136
-
137
- $element->add_control(
138
- 'parallax_multi_video_tutorial',
139
- [
140
- 'raw' => '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial <span class="dashicons dashicons-video-alt3"></span></a>',
141
- 'type' => Controls_Manager::RAW_HTML,
142
- ]
143
- );
144
-
145
- $element->add_control(
146
- 'wpr_enable_parallax_hover',
147
- [
148
- 'type' => Controls_Manager::SWITCHER,
149
- 'label' => __('Enable Multi Layer Parallax', 'wpr-addons'),
150
- 'default' => 'no',
151
- 'label_on' => __('Yes', 'wpr-addons'),
152
- 'label_off' => __('No', 'wpr-addons'),
153
- 'return_value' => 'yes',
154
- 'render_type' => 'template',
155
- 'prefix_class' => 'wpr-parallax-'
156
- ]
157
- );
158
-
159
- $element->add_control(
160
- 'invert_direction',
161
- [
162
- 'type' => Controls_Manager::SWITCHER,
163
- 'label' => __('Invert Animation Direction', 'wpr-addons'),
164
- 'default' => 'no',
165
- 'label_on' => __('Yes', 'wpr-addons'),
166
- 'label_off' => __('No', 'wpr-addons'),
167
- 'return_value' => 'yes',
168
- 'render_type' => 'template',
169
- 'condition' => [
170
- 'wpr_enable_parallax_hover' => 'yes'
171
- ]
172
- ]
173
- );
174
-
175
- $element->add_control(
176
- 'scalar_speed',
177
- [
178
- 'type' => Controls_Manager::SLIDER,
179
- 'label' => esc_html__( 'Animation Speed', 'wpr-addons' ),
180
- 'size_units' => [ '%' ],
181
- 'range' => [
182
- '%' => [
183
- 'min' => 0.0,
184
- 'max' => 100.0,
185
- ]
186
- ],
187
- 'default' => [
188
- 'unit' => '%',
189
- 'size' => 10.0,
190
- ],
191
- 'condition' => [
192
- 'wpr_enable_parallax_hover' => 'yes'
193
- ]
194
- ]
195
- );
196
-
197
- $repeater = new Repeater();
198
-
199
- $repeater->add_control(
200
- 'repeater_bg_image',
201
- [
202
- 'label' => __( 'Choose Image', 'wpr-addons' ),
203
- 'type' => Controls_Manager::MEDIA,
204
- 'default' => [
205
- 'url' => Utils::get_placeholder_image_src(),
206
- ],
207
- 'render_type' => 'template',
208
- ]
209
- );
210
-
211
- $repeater->add_control(
212
- 'layer_width',
213
- [
214
- 'label' => esc_html__( 'Image Width', 'wpr-addons' ),
215
- 'type' => Controls_Manager::NUMBER,
216
- 'default' => 100,
217
- 'min' => 0,
218
- 'max' => 1000,
219
- 'step' => 10,
220
- 'selectors' => [
221
- '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'width: {{SIZE}}px !important;',
222
- ],
223
- ]
224
- );
225
-
226
- $repeater->add_control(
227
- 'layer_position_hr',
228
- [
229
- 'type' => Controls_Manager::SLIDER,
230
- 'label' => esc_html__( 'Horizontal Position (%)', 'wpr-addons' ),
231
- 'size_units' => [ '%' ],
232
- 'range' => [
233
- '%' => [
234
- 'min' => 0,
235
- 'max' => 100,
236
- ]
237
- ],
238
- 'default' => [
239
- 'unit' => '%',
240
- 'size' => 50,
241
- ],
242
- 'selectors' => [
243
- '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'left: {{SIZE}}{{UNIT}} !important;',
244
- ],
245
- 'separator' => 'before',
246
- ]
247
- );
248
-
249
- $repeater->add_control(
250
- 'layer_position_vr',
251
- [
252
- 'type' => Controls_Manager::SLIDER,
253
- 'label' => esc_html__( 'Vertical Position (%)', 'wpr-addons' ),
254
- 'size_units' => [ '%' ],
255
- 'range' => [
256
- '%' => [
257
- 'min' => 0,
258
- 'max' => 100,
259
- ]
260
- ],
261
- 'default' => [
262
- 'unit' => '%',
263
- 'size' => 50,
264
- ],
265
- 'selectors' => [
266
- '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'top: {{SIZE}}{{UNIT}}!important;',
267
- ],
268
- ]
269
- );
270
-
271
- $repeater->add_control(
272
- 'data_depth',
273
- [
274
- 'label' => __( 'Data Depth', 'wpr-addons' ),
275
- 'type' => Controls_Manager::NUMBER,
276
- 'min' => -1.0,
277
- 'max' => 2.0,
278
- 'step' => 0.1,
279
- 'default' => 0.4,
280
- 'render_type' => 'template',
281
- ]
282
- );
283
-
284
- $element->add_control(
285
- 'hover_parallax',
286
- [
287
- 'label' => __( 'Repeater List', 'wpr-addons' ),
288
- 'type' => Controls_Manager::REPEATER,
289
- 'fields' => $repeater->get_controls(),
290
- 'default' => [
291
- [
292
- 'layer_position_vr' => [
293
- 'unit' => '%',
294
- 'size' => 30,
295
- ],
296
- 'layer_position_hr' => [
297
- 'unit' => '%',
298
- 'size' => 40,
299
- ],
300
- ],
301
- [
302
- 'layer_position_vr' => [
303
- 'unit' => '%',
304
- 'size' => 60,
305
- ],
306
- 'layer_position_hr' => [
307
- 'unit' => '%',
308
- 'size' => 20,
309
- ],
310
- ],
311
- ],
312
- 'condition' => [
313
- 'wpr_enable_parallax_hover' => 'yes'
314
- ]
315
- ]
316
- );
317
-
318
- if ( ! wpr_fs()->can_use_premium_code() ) {
319
- $element->add_control(
320
- 'paralax_repeater_pro_notice',
321
- [
322
- 'type' => Controls_Manager::RAW_HTML,
323
- 'raw' => 'More than 2 Layers are available<br> in the <strong><a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-parallax-multi-layer-upgrade-pro#purchasepro" target="_blank">Pro version</a></strong>',
324
- // 'raw' => 'More than 2 Layers are available<br> in the <strong><a href="'. admin_url('admin.php?page=wpr-addons-pricing') .'" target="_blank">Pro version</a></strong>',
325
- 'content_classes' => 'wpr-pro-notice',
326
- 'condition' => [
327
- 'wpr_enable_parallax_hover' => 'yes'
328
- ]
329
- ]
330
- );
331
- }
332
-
333
- } // end if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
334
-
335
- $element->end_controls_section();
336
- }
337
-
338
- public function _before_render( $element ) {
339
- // bail if any other element but section
340
- // output buffer controlling functions removed elements from live preview
341
- if ( $element->get_name() !== 'section' ) return;
342
-
343
- $settings = $element->get_settings_for_display();
344
-
345
- // Parallax Background
346
- if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
347
- if ( 'yes' === $settings['wpr_enable_jarallax'] ) {
348
- $element->add_render_attribute( '_wrapper', [
349
- 'class' => 'wpr-jarallax',
350
- 'id' => 'wpr-test-parallax',
351
- 'speed-data' => $settings['speed'],
352
- 'bg-image' => $settings['bg_image']['url'],
353
- 'scroll-effect' => $settings['scroll_effect'],
354
- ] );
355
-
356
- // if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
357
- // echo '<div '. $element->get_render_attribute_string( '_wrapper' ) .'></div>';
358
- // }
359
- }
360
- }
361
-
362
- // Parallax Multi Layer
363
- if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
364
- if ( $settings['wpr_enable_parallax_hover'] == 'yes' ) {
365
- if ( $settings['hover_parallax'] ) {
366
-
367
- echo '<div class="wpr-parallax-multi-layer" scalar-speed="'. esc_attr($settings['scalar_speed']['size']) .'" direction="'. esc_attr($settings['invert_direction']) .'" style="overflow: hidden;">';
368
-
369
- foreach ( $settings['hover_parallax'] as $key => $item ) {
370
- if ( $key < 2 || wpr_fs()->can_use_premium_code() ) {
371
- echo '<div data-depth="'. esc_attr($item['data_depth']) .'" style-top="'. esc_attr($item['layer_position_vr']['size']) .'%" style-left="'. esc_attr($item['layer_position_hr']['size']) .'%" class="wpr-parallax-ml-children elementor-repeater-item-'. esc_attr($item['_id']) .'">';
372
- echo '<img src="'. esc_url($item['repeater_bg_image']['url']) .'">';
373
- echo '</div>';
374
- }
375
- }
376
-
377
- echo '</div>';
378
- }
379
- }
380
- }
381
-
382
- }
383
-
384
- public function _print_template( $template, $widget ) {
385
- ob_start();
386
-
387
- if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
388
- echo '<div class="wpr-jarallax" speed-data-editor="{{settings.speed}}" scroll-effect-editor="{{settings.scroll_effect}}" bg-image-editor="{{settings.bg_image.url}}"></div>';
389
- }
390
- // Multi Layer
391
- if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
392
- if ( ! wpr_fs()->can_use_premium_code() ) {
393
- ?>
394
- <# if ( settings.hover_parallax.length && settings.wpr_enable_parallax_hover == 'yes') { #>
395
- <div class="wpr-parallax-multi-layer" direction="{{settings.invert_direction}}" scalar-speed="{{settings.scalar_speed.size}}" data-relative-input="true" style="overflow: hidden;">
396
- <# _.each( settings.hover_parallax, function( item, index ) { #>
397
- <# if ( index > 1 ) return; #>
398
- <div data-depth="{{item.data_depth}}" class="wpr-parallax-ml-children elementor-repeater-item-{{ item._id }}">
399
- <img src="{{item.repeater_bg_image.url}}">
400
- </div>
401
- <# }); #>
402
- </div>
403
- <# } #>
404
- <?php
405
- } else {
406
- ?>
407
- <# if ( settings.hover_parallax.length && settings.wpr_enable_parallax_hover == 'yes') { #>
408
- <div class="wpr-parallax-multi-layer" direction="{{settings.invert_direction}}" scalar-speed="{{settings.scalar_speed.size}}" data-relative-input="true" style="overflow: hidden;">
409
- <# _.each( settings.hover_parallax, function( item ) { #>
410
- <div data-depth="{{item.data_depth}}" class="wpr-parallax-ml-children elementor-repeater-item-{{ item._id }}">
411
- <img src="{{item.repeater_bg_image.url}}">
412
- </div>
413
- <# }); #>
414
- </div>
415
- <# } #>
416
- <?php
417
- }
418
- }
419
-
420
- $parallax_content = ob_get_contents();
421
-
422
- ob_end_clean();
423
- return $template . $parallax_content;
424
- }
425
-
426
- public static function enqueue_scripts() {
427
- if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
428
- wp_enqueue_script( 'wpr-jarallax', WPR_ADDONS_URL . 'assets/js/lib/jarallax/jarallax.min.js', ['jquery'], '1.12.7', true );
429
- }
430
-
431
- if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
432
- wp_enqueue_script( 'wpr-parallax-hover', WPR_ADDONS_URL . 'assets/js/lib/parallax/parallax.min.js', ['jquery'], '1.0', true );
433
- }
434
- }
435
-
436
- }
437
-
438
- new Wpr_Parallax_Scroll();
1
+ <?php
2
+ namespace WprAddons\Extensions;
3
+
4
+ use Elementor\Controls_Manager;
5
+ use Elementor\Control_Media;
6
+ use Elementor\Controls_Stack;
7
+ use Elementor\Element_Base;
8
+ use Elementor\Repeater;
9
+ use Elementor\Utils;
10
+ use WprAddons\Classes\Utilities;
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
+ }
15
+
16
+ class Wpr_Parallax_Scroll {
17
+
18
+ public function __construct() {
19
+ add_action( 'elementor/element/section/section_background/after_section_end', [$this, 'register_controls'], 10);
20
+ add_action( 'elementor/frontend/section/before_render', [$this, '_before_render'], 10, 1);
21
+ add_action( 'elementor/section/print_template', [ $this, '_print_template' ], 10, 2 );
22
+ add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
23
+ }
24
+
25
+ public function register_controls( $element ) {
26
+ $element->start_controls_section(
27
+ 'wpr_section_parallax',
28
+ [
29
+ 'tab' => Controls_Manager::TAB_STYLE,
30
+ 'label' => sprintf(esc_html__('Parallax - %s', 'wpr-addons'), Utilities::get_plugin_name()),
31
+ ]
32
+ );
33
+
34
+ $element->add_control(
35
+ 'wpr_parallax',
36
+ [
37
+ 'type' => Controls_Manager::RAW_HTML,
38
+ 'raw' => '<div class="elementor-update-preview editor-wpr-preview-update"><span>Update changes to Preview</span><button class="elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply</button>',
39
+ 'separator' => 'after'
40
+ ]
41
+ );
42
+
43
+ if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
44
+
45
+ $element->add_control(
46
+ 'parallax_video_tutorial',
47
+ [
48
+ 'raw' => '<br><a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial <span class="dashicons dashicons-video-alt3"></span></a>',
49
+ 'type' => Controls_Manager::RAW_HTML,
50
+ ]
51
+ );
52
+
53
+ $element->add_control(
54
+ 'wpr_enable_jarallax',
55
+ [
56
+ 'type' => Controls_Manager::SWITCHER,
57
+ 'label' => __('Enable Background Parallax', 'wpr-addons'),
58
+ 'default' => 'no',
59
+ 'label_on' => __('Yes', 'wpr-addons'),
60
+ 'label_off' => __('No', 'wpr-addons'),
61
+ 'return_value' => 'yes',
62
+ 'render_type' => 'template',
63
+ 'prefix_class' => 'wpr-jarallax-'
64
+ ]
65
+ );
66
+
67
+ $element->add_control(
68
+ 'speed',
69
+ [
70
+ 'label' => __( 'Animation Speed', 'wpr-addons' ),
71
+ 'type' => Controls_Manager::NUMBER,
72
+ 'min' => -1.0,
73
+ 'max' => 2.0,
74
+ 'step' => 0.1,
75
+ 'default' => 1.4,
76
+ 'render_type' => 'template',
77
+ 'condition' => [
78
+ 'wpr_enable_jarallax' => 'yes'
79
+ ]
80
+ ]
81
+ );
82
+
83
+ if ( wpr_fs()->can_use_premium_code() && defined('WPR_ADDONS_PRO_VERSION') ) {
84
+ \WprAddonsPro\Extensions\Wpr_Parallax_Scroll_Pro::add_control_scroll_effect($element);
85
+ } else {
86
+ $element->add_control(
87
+ 'scroll_effect',
88
+ [
89
+ 'label' => __( 'Scrolling Effect', 'wpr-addons' ),
90
+ 'type' => Controls_Manager::SELECT,
91
+ 'default' => 'scroll',
92
+ 'options' => [
93
+ 'scroll' => esc_html__( 'Scroll', 'wpr-addons' ),
94
+ 'scale' => esc_html__( 'Zoom', 'wpr-addons' ),
95
+ 'pro-op' => esc_html__( 'Opacity (Pro)', 'wpr-addons' ),
96
+ 'pro-sclo' => esc_html__('Scale Opacity (Pro)', 'wpr-addons'),
97
+ 'pro-scrlo' => esc_html__( 'Scroll Opacity (Pro)', 'wpr-addons' )
98
+ ],
99
+ 'render_type' => 'template',
100
+ 'condition' => [
101
+ 'wpr_enable_jarallax' => 'yes'
102
+ ]
103
+ ]
104
+ );
105
+
106
+ // Upgrade to Pro Notice
107
+ Utilities::upgrade_pro_notice( $element, Controls_Manager::RAW_HTML, 'parallax-background', 'scroll_effect', ['pro-op','pro-sclo','pro-scrlo'] );
108
+ }
109
+
110
+ $element->add_control(
111
+ 'bg_image',
112
+ [
113
+ 'label' => __( 'Choose Image', 'wpr-addons' ),
114
+ 'type' => Controls_Manager::MEDIA,
115
+ 'default' => [
116
+ 'url' => Utils::get_placeholder_image_src(),
117
+ ],
118
+ 'render_type' => 'template',
119
+ 'condition' => [
120
+ 'wpr_enable_jarallax' => 'yes'
121
+ ]
122
+ ]
123
+ );
124
+
125
+ } // end if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
126
+
127
+ $element->add_control(
128
+ 'parallax_type_divider',
129
+ [
130
+ 'type' => Controls_Manager::DIVIDER,
131
+ 'style' => 'thick',
132
+ ]
133
+ );
134
+
135
+ if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
136
+
137
+ $element->add_control(
138
+ 'parallax_multi_video_tutorial',
139
+ [
140
+ 'raw' => '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial <span class="dashicons dashicons-video-alt3"></span></a>',
141
+ 'type' => Controls_Manager::RAW_HTML,
142
+ ]
143
+ );
144
+
145
+ $element->add_control(
146
+ 'wpr_enable_parallax_hover',
147
+ [
148
+ 'type' => Controls_Manager::SWITCHER,
149
+ 'label' => __('Enable Multi Layer Parallax', 'wpr-addons'),
150
+ 'default' => 'no',
151
+ 'label_on' => __('Yes', 'wpr-addons'),
152
+ 'label_off' => __('No', 'wpr-addons'),
153
+ 'return_value' => 'yes',
154
+ 'render_type' => 'template',
155
+ 'prefix_class' => 'wpr-parallax-'
156
+ ]
157
+ );
158
+
159
+ $element->add_control(
160
+ 'invert_direction',
161
+ [
162
+ 'type' => Controls_Manager::SWITCHER,
163
+ 'label' => __('Invert Animation Direction', 'wpr-addons'),
164
+ 'default' => 'no',
165
+ 'label_on' => __('Yes', 'wpr-addons'),
166
+ 'label_off' => __('No', 'wpr-addons'),
167
+ 'return_value' => 'yes',
168
+ 'render_type' => 'template',
169
+ 'condition' => [
170
+ 'wpr_enable_parallax_hover' => 'yes'
171
+ ]
172
+ ]
173
+ );
174
+
175
+ $element->add_control(
176
+ 'scalar_speed',
177
+ [
178
+ 'type' => Controls_Manager::SLIDER,
179
+ 'label' => esc_html__( 'Animation Speed', 'wpr-addons' ),
180
+ 'size_units' => [ '%' ],
181
+ 'range' => [
182
+ '%' => [
183
+ 'min' => 0.0,
184
+ 'max' => 100.0,
185
+ ]
186
+ ],
187
+ 'default' => [
188
+ 'unit' => '%',
189
+ 'size' => 10.0,
190
+ ],
191
+ 'condition' => [
192
+ 'wpr_enable_parallax_hover' => 'yes'
193
+ ]
194
+ ]
195
+ );
196
+
197
+ $repeater = new Repeater();
198
+
199
+ $repeater->add_control(
200
+ 'repeater_bg_image',
201
+ [
202
+ 'label' => __( 'Choose Image', 'wpr-addons' ),
203
+ 'type' => Controls_Manager::MEDIA,
204
+ 'default' => [
205
+ 'url' => Utils::get_placeholder_image_src(),
206
+ ],
207
+ 'render_type' => 'template',
208
+ ]
209
+ );
210
+
211
+ $repeater->add_control(
212
+ 'layer_width',
213
+ [
214
+ 'label' => esc_html__( 'Image Width', 'wpr-addons' ),
215
+ 'type' => Controls_Manager::NUMBER,
216
+ 'default' => 100,
217
+ 'min' => 0,
218
+ 'max' => 1000,
219
+ 'step' => 10,
220
+ 'selectors' => [
221
+ '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'width: {{SIZE}}px !important;',
222
+ ],
223
+ ]
224
+ );
225
+
226
+ $repeater->add_control(
227
+ 'layer_position_hr',
228
+ [
229
+ 'type' => Controls_Manager::SLIDER,
230
+ 'label' => esc_html__( 'Horizontal Position (%)', 'wpr-addons' ),
231
+ 'size_units' => [ '%' ],
232
+ 'range' => [
233
+ '%' => [
234
+ 'min' => 0,
235
+ 'max' => 100,
236
+ ]
237
+ ],
238
+ 'default' => [
239
+ 'unit' => '%',
240
+ 'size' => 50,
241
+ ],
242
+ 'selectors' => [
243
+ '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'left: {{SIZE}}{{UNIT}} !important;',
244
+ ],
245
+ 'separator' => 'before',
246
+ ]
247
+ );
248
+
249
+ $repeater->add_control(
250
+ 'layer_position_vr',
251
+ [
252
+ 'type' => Controls_Manager::SLIDER,
253
+ 'label' => esc_html__( 'Vertical Position (%)', 'wpr-addons' ),
254
+ 'size_units' => [ '%' ],
255
+ 'range' => [
256
+ '%' => [
257
+ 'min' => 0,
258
+ 'max' => 100,
259
+ ]
260
+ ],
261
+ 'default' => [
262
+ 'unit' => '%',
263
+ 'size' => 50,
264
+ ],
265
+ 'selectors' => [
266
+ '{{WRAPPER}} {{CURRENT_ITEM}}.wpr-parallax-ml-children' => 'top: {{SIZE}}{{UNIT}}!important;',
267
+ ],
268
+ ]
269
+ );
270
+
271
+ $repeater->add_control(
272
+ 'data_depth',
273
+ [
274
+ 'label' => __( 'Data Depth', 'wpr-addons' ),
275
+ 'type' => Controls_Manager::NUMBER,
276
+ 'min' => -1.0,
277
+ 'max' => 2.0,
278
+ 'step' => 0.1,
279
+ 'default' => 0.4,
280
+ 'render_type' => 'template',
281
+ ]
282
+ );
283
+
284
+ $element->add_control(
285
+ 'hover_parallax',
286
+ [
287
+ 'label' => __( 'Repeater List', 'wpr-addons' ),
288
+ 'type' => Controls_Manager::REPEATER,
289
+ 'fields' => $repeater->get_controls(),
290
+ 'default' => [
291
+ [
292
+ 'layer_position_vr' => [
293
+ 'unit' => '%',
294
+ 'size' => 30,
295
+ ],
296
+ 'layer_position_hr' => [
297
+ 'unit' => '%',
298
+ 'size' => 40,
299
+ ],
300
+ ],
301
+ [
302
+ 'layer_position_vr' => [
303
+ 'unit' => '%',
304
+ 'size' => 60,
305
+ ],
306
+ 'layer_position_hr' => [
307
+ 'unit' => '%',
308
+ 'size' => 20,
309
+ ],
310
+ ],
311
+ ],
312
+ 'condition' => [
313
+ 'wpr_enable_parallax_hover' => 'yes'
314
+ ]
315
+ ]
316
+ );
317
+
318
+ if ( ! wpr_fs()->can_use_premium_code() ) {
319
+ $element->add_control(
320
+ 'paralax_repeater_pro_notice',
321
+ [
322
+ 'type' => Controls_Manager::RAW_HTML,
323
+ 'raw' => 'More than 2 Layers are available<br> in the <strong><a href="https://royal-elementor-addons.com/?ref=rea-plugin-panel-parallax-multi-layer-upgrade-pro#purchasepro" target="_blank">Pro version</a></strong>',
324
+ // 'raw' => 'More than 2 Layers are available<br> in the <strong><a href="'. admin_url('admin.php?page=wpr-addons-pricing') .'" target="_blank">Pro version</a></strong>',
325
+ 'content_classes' => 'wpr-pro-notice',
326
+ 'condition' => [
327
+ 'wpr_enable_parallax_hover' => 'yes'
328
+ ]
329
+ ]
330
+ );
331
+ }
332
+
333
+ } // end if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
334
+
335
+ $element->end_controls_section();
336
+ }
337
+
338
+ public function _before_render( $element ) {
339
+ // bail if any other element but section
340
+ // output buffer controlling functions removed elements from live preview
341
+ if ( $element->get_name() !== 'section' ) return;
342
+
343
+ $settings = $element->get_settings_for_display();
344
+
345
+ // Parallax Background
346
+ if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
347
+ if ( 'yes' === $settings['wpr_enable_jarallax'] ) {
348
+ $element->add_render_attribute( '_wrapper', [
349
+ 'class' => 'wpr-jarallax',
350
+ 'speed-data' => $settings['speed'],
351
+ 'bg-image' => $settings['bg_image']['url'],
352
+ 'scroll-effect' => $settings['scroll_effect'],
353
+ ] );
354
+
355
+ // if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
356
+ // echo '<div '. $element->get_render_attribute_string( '_wrapper' ) .'></div>';
357
+ // }
358
+ }
359
+ }
360
+
361
+ // Parallax Multi Layer
362
+ if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
363
+ if ( $settings['wpr_enable_parallax_hover'] == 'yes' ) {
364
+ if ( $settings['hover_parallax'] ) {
365
+
366
+ echo '<div class="wpr-parallax-multi-layer" scalar-speed="'. esc_attr($settings['scalar_speed']['size']) .'" direction="'. esc_attr($settings['invert_direction']) .'" style="overflow: hidden;">';
367
+
368
+ foreach ( $settings['hover_parallax'] as $key => $item ) {
369
+ if ( $key < 2 || wpr_fs()->can_use_premium_code() ) {
370
+ echo '<div data-depth="'. esc_attr($item['data_depth']) .'" style-top="'. esc_attr($item['layer_position_vr']['size']) .'%" style-left="'. esc_attr($item['layer_position_hr']['size']) .'%" class="wpr-parallax-ml-children elementor-repeater-item-'. esc_attr($item['_id']) .'">';
371
+ echo '<img src="'. esc_url($item['repeater_bg_image']['url']) .'">';
372
+ echo '</div>';
373
+ }
374
+ }
375
+
376
+ echo '</div>';
377
+ }
378
+ }
379
+ }
380
+
381
+ }
382
+
383
+ public function _print_template( $template, $widget ) {
384
+ ob_start();
385
+
386
+ if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
387
+ echo '<div class="wpr-jarallax" speed-data-editor="{{settings.speed}}" scroll-effect-editor="{{settings.scroll_effect}}" bg-image-editor="{{settings.bg_image.url}}"></div>';
388
+ }
389
+ // Multi Layer
390
+ if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
391
+ if ( ! wpr_fs()->can_use_premium_code() ) {
392
+ ?>
393
+ <# if ( settings.hover_parallax.length && settings.wpr_enable_parallax_hover == 'yes') { #>
394
+ <div class="wpr-parallax-multi-layer" direction="{{settings.invert_direction}}" scalar-speed="{{settings.scalar_speed.size}}" data-relative-input="true" style="overflow: hidden;">
395
+ <# _.each( settings.hover_parallax, function( item, index ) { #>
396
+ <# if ( index > 1 ) return; #>
397
+ <div data-depth="{{item.data_depth}}" class="wpr-parallax-ml-children elementor-repeater-item-{{ item._id }}">
398
+ <img src="{{item.repeater_bg_image.url}}">
399
+ </div>
400
+ <# }); #>
401
+ </div>
402
+ <# } #>
403
+ <?php
404
+ } else {
405
+ ?>
406
+ <# if ( settings.hover_parallax.length && settings.wpr_enable_parallax_hover == 'yes') { #>
407
+ <div class="wpr-parallax-multi-layer" direction="{{settings.invert_direction}}" scalar-speed="{{settings.scalar_speed.size}}" data-relative-input="true" style="overflow: hidden;">
408
+ <# _.each( settings.hover_parallax, function( item ) { #>
409
+ <div data-depth="{{item.data_depth}}" class="wpr-parallax-ml-children elementor-repeater-item-{{ item._id }}">
410
+ <img src="{{item.repeater_bg_image.url}}">
411
+ </div>
412
+ <# }); #>
413
+ </div>
414
+ <# } #>
415
+ <?php
416
+ }
417
+ }
418
+
419
+ $parallax_content = ob_get_contents();
420
+
421
+ ob_end_clean();
422
+ return $template . $parallax_content;
423
+ }
424
+
425
+ public static function enqueue_scripts() {
426
+ if ( 'on' === get_option('wpr-parallax-background', 'on') ) {
427
+ wp_enqueue_script( 'wpr-jarallax', WPR_ADDONS_URL . 'assets/js/lib/jarallax/jarallax.min.js', ['jquery'], '1.12.7', true );
428
+ }
429
+
430
+ if ( 'on' === get_option('wpr-parallax-multi-layer', 'on') ) {
431
+ wp_enqueue_script( 'wpr-parallax-hover', WPR_ADDONS_URL . 'assets/js/lib/parallax/parallax.min.js', ['jquery'], '1.0', true );
432
+ }
433
+ }
434
+
435
+ }
436
+
437
+ new Wpr_Parallax_Scroll();
 
extensions/wpr-reading-progress-bar.php CHANGED
@@ -1,201 +1,201 @@
1
- <?php
2
-
3
- namespace WprAddons\Extensions\Wpr_ReadingProgressBar;
4
-
5
- // Elementor classes
6
- use Elementor\Controls_Manager;
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- class Wpr_ReadingProgressBar {
13
-
14
- private static $_instance = null;
15
-
16
- public final function __construct() {
17
- // Register controls on Post/Page Settings
18
- add_action( 'elementor/documents/register_controls', [ $this, 'register_controls' ], 10, 3 );
19
- add_action( 'wp_footer', [ $this, 'html_to_footer' ] );
20
- }
21
-
22
- public function register_controls( $element ) {
23
-
24
- $element->start_controls_section(
25
- 'wpr_reading_progress_bar',
26
- [
27
- 'tab' => Controls_Manager::TAB_SETTINGS,
28
- 'label' => __( 'Reading Progress Bar - Royal Addons', 'wpr-addons' ),
29
- ]
30
- );
31
-
32
- $element->add_control(
33
- 'wpr_rpb_apply_changes',
34
- [
35
- 'type' => Controls_Manager::RAW_HTML,
36
- 'raw' => '<div style="text-align: center;"><button class="elementor-update-preview-button elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply Changes</button></div>',
37
- 'condition' => [
38
- 'wpr_rpb_enable_globally' => 'yes'
39
- ]
40
- ]
41
- );
42
-
43
- $element->add_control(
44
- 'wpr_rpb_enable',
45
- [
46
- 'label' => __( 'Enable Progress Bar', 'wpr-addons' ),
47
- 'type' => Controls_Manager::SWITCHER,
48
- 'render_type' => 'template',
49
- 'label_on' => __( 'On', 'wpr-addons' ),
50
- 'label_off' => __( 'Off', 'wpr-addons' ),
51
- 'return_value' => 'yes',
52
- ]
53
- );
54
-
55
- $element->add_control(
56
- 'wpr_rpb_enable_globally',
57
- [
58
- 'label' => __( 'Enable Progress Bar Globally', 'wpr-addons' ),
59
- 'type' => Controls_Manager::SWITCHER,
60
- 'render_type' => 'template',
61
- 'label_on' => __( 'On', 'wpr-addons' ),
62
- 'label_off' => __( 'Off', 'wpr-addons' ),
63
- 'return_value' => 'yes',
64
- 'condition' => [
65
- 'wpr_rpb_enable' => 'yes',
66
- ],
67
- ]
68
- );
69
-
70
- $element->add_control(
71
- 'wpr_rpb_display_on',
72
- [
73
- 'label' => __( 'Display Progress Bar', 'wpr-addons' ),
74
- 'type' => \Elementor\Controls_Manager::SELECT,
75
- 'default' => 'page',
76
- 'options' => [
77
- 'page' => __( 'On All Pages', 'wpr-addons' ),
78
- 'post' => __( 'On All Posts', 'wpr-addons' ),
79
- 'global' => __( 'Globally', 'wpr-addons' ),
80
- ],
81
- 'separator' => 'after',
82
- 'condition' => [
83
- 'wpr_rpb_enable' => 'yes',
84
- 'wpr_rpb_enable_globally' => 'yes',
85
- ],
86
- ]
87
- );
88
-
89
- $element->add_control(
90
- 'wpr_height',
91
- [
92
- 'label' => __( 'Height', 'wpr-addons' ),
93
- 'type' => Controls_Manager::SLIDER,
94
- 'range' => [
95
- 'px' => [
96
- 'min' => 1,
97
- 'max' => 100,
98
- 'step' => 1,
99
- ],
100
- ],
101
- 'default' => [
102
- 'unit' => 'px',
103
- 'size' => 10,
104
- ],
105
- 'condition' => [
106
- 'wpr_rpb_enable' => 'yes',
107
- ],
108
- 'selectors' => [
109
- '.wpr-reading-progress-bar-container' => 'height: {{SIZE}}{{UNIT}} !important',
110
- '.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'height: {{SIZE}}{{UNIT}} !important',
111
- ],
112
- ]
113
- );
114
-
115
- $element->add_control(
116
- 'wpr_background_color',
117
- [
118
- 'label' => __( 'Background Color', 'wpr-addons' ),
119
- 'type' => \Elementor\Controls_Manager::COLOR,
120
- 'default' => '#C5C5C6',
121
- 'condition' => [
122
- 'wpr_rpb_enable' => 'yes',
123
- ],
124
- 'selectors' => [
125
- '.wpr-reading-progress-bar-container' => 'background-color: {{VALUE}};'
126
- ]
127
- ]
128
- );
129
-
130
- $element->add_control(
131
- 'wpr_fill_color',
132
- [
133
- 'label' => __( 'Fill Color', 'wpr-addons' ),
134
- 'type' => \Elementor\Controls_Manager::COLOR,
135
- 'default' => '#6A63DA',
136
- 'condition' => [
137
- 'wpr_rpb_enable' => 'yes',
138
- ],
139
- 'selectors' => [
140
- '.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'background-color: {{VALUE}};'
141
- ]
142
- ]
143
- );
144
-
145
- $element->add_control(//wpr_rpb_position
146
- 'progress_bar_position',
147
- [
148
- 'label' => __( 'Position', 'wpr-addons' ),
149
- 'type' => \Elementor\Controls_Manager::SELECT,
150
- 'default' => 'top',
151
- 'render_type' => 'template',
152
- 'options' => [
153
- 'top' => __( 'Top', 'wpr-addons' ),
154
- 'bottom' => __( 'Bottom', 'wpr-addons' ),
155
- ],
156
- 'selectors_dictionary' => [
157
- 'top' => 'top: 0px !important; bottom: auto !important;',
158
- 'bottom' => 'bottom: 0px !important; top: auto !important;',
159
- ],
160
- 'selectors' => [
161
- '{{WRAPPER}} .wpr-reading-progress-bar-container' => '{{VALUE}}',
162
- ],
163
- 'condition' => [
164
- 'wpr_rpb_enable' => 'yes',
165
- ],
166
- ]
167
- );
168
-
169
- $element->end_controls_section();
170
-
171
- }
172
-
173
- public function html_to_footer() {
174
- $settings = get_option('wpr_progress_bar_global_options');
175
- $rpb_position = 'top' === $settings['wpr_progress_bar_position'] ? 'top: 0px; bottom: auto;' : 'bottom: 0px; top: auto;';
176
- $rpb_background_color = 'background-color: '. $settings['wpr_background_color'] .' !important;';
177
- $rpb_fill_color = 'background-color: '. $settings['wpr_fill_color'] .'!important;';
178
- $rpb_height = 'height: '. $settings['wpr_height']['size'] . $settings['wpr_height']['unit'] .';';
179
-
180
- if ( !empty($settings) && 'yes' === $settings['wpr_rpb_enable'] ) {
181
- if ( 'yes' === $settings['wpr_rpb_enable_globally_option'] ) {
182
- if ( ('post' === $settings['wpr_rpb_display_option'] && ! is_single()) || ('page' === $settings['wpr_rpb_display_option'] && ! is_page()) ) {
183
- return;
184
- }
185
-
186
- echo '<div style="'. esc_attr($rpb_position . $rpb_background_color) .'" class="wpr-reading-progress-bar-container"><div style="'. esc_attr($rpb_fill_color . $rpb_height) .'" class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
187
- } else {
188
- echo '<div class="wpr-reading-progress-bar-container"><div class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
189
- }
190
- }
191
- }
192
-
193
- public static function instance() {
194
- if ( is_null( self::$_instance ) ) {
195
- self::$_instance = new self();
196
- }
197
- return self::$_instance;
198
- }
199
- }
200
-
201
  Wpr_ReadingProgressBar::instance();
1
+ <?php
2
+
3
+ namespace WprAddons\Extensions\Wpr_ReadingProgressBar;
4
+
5
+ // Elementor classes
6
+ use Elementor\Controls_Manager;
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ class Wpr_ReadingProgressBar {
13
+
14
+ private static $_instance = null;
15
+
16
+ public final function __construct() {
17
+ // Register controls on Post/Page Settings
18
+ add_action( 'elementor/documents/register_controls', [ $this, 'register_controls' ], 10, 3 );
19
+ add_action( 'wp_footer', [ $this, 'html_to_footer' ] );
20
+ }
21
+
22
+ public function register_controls( $element ) {
23
+
24
+ $element->start_controls_section(
25
+ 'wpr_reading_progress_bar',
26
+ [
27
+ 'tab' => Controls_Manager::TAB_SETTINGS,
28
+ 'label' => __( 'Reading Progress Bar - Royal Addons', 'wpr-addons' ),
29
+ ]
30
+ );
31
+
32
+ $element->add_control(
33
+ 'wpr_rpb_apply_changes',
34
+ [
35
+ 'type' => Controls_Manager::RAW_HTML,
36
+ 'raw' => '<div style="text-align: center;"><button class="elementor-update-preview-button elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply Changes</button></div>',
37
+ 'condition' => [
38
+ 'wpr_rpb_enable_globally' => 'yes'
39
+ ]
40
+ ]
41
+ );
42
+
43
+ $element->add_control(
44
+ 'wpr_rpb_enable',
45
+ [
46
+ 'label' => __( 'Enable Progress Bar', 'wpr-addons' ),
47
+ 'type' => Controls_Manager::SWITCHER,
48
+ 'render_type' => 'template',
49
+ 'label_on' => __( 'On', 'wpr-addons' ),
50
+ 'label_off' => __( 'Off', 'wpr-addons' ),
51
+ 'return_value' => 'yes',
52
+ ]
53
+ );
54
+
55
+ $element->add_control(
56
+ 'wpr_rpb_enable_globally',
57
+ [
58
+ 'label' => __( 'Enable Progress Bar Globally', 'wpr-addons' ),
59
+ 'type' => Controls_Manager::SWITCHER,
60
+ 'render_type' => 'template',
61
+ 'label_on' => __( 'On', 'wpr-addons' ),
62
+ 'label_off' => __( 'Off', 'wpr-addons' ),
63
+ 'return_value' => 'yes',
64
+ 'condition' => [
65
+ 'wpr_rpb_enable' => 'yes',
66
+ ],
67
+ ]
68
+ );
69
+
70
+ $element->add_control(
71
+ 'wpr_rpb_display_on',
72
+ [
73
+ 'label' => __( 'Display Progress Bar', 'wpr-addons' ),
74
+ 'type' => \Elementor\Controls_Manager::SELECT,
75
+ 'default' => 'page',
76
+ 'options' => [
77
+ 'page' => __( 'On All Pages', 'wpr-addons' ),
78
+ 'post' => __( 'On All Posts', 'wpr-addons' ),
79
+ 'global' => __( 'Globally', 'wpr-addons' ),
80
+ ],
81
+ 'separator' => 'after',
82
+ 'condition' => [
83
+ 'wpr_rpb_enable' => 'yes',
84
+ 'wpr_rpb_enable_globally' => 'yes',
85
+ ],
86
+ ]
87
+ );
88
+
89
+ $element->add_control(
90
+ 'wpr_height',
91
+ [
92
+ 'label' => __( 'Height', 'wpr-addons' ),
93
+ 'type' => Controls_Manager::SLIDER,
94
+ 'range' => [
95
+ 'px' => [
96
+ 'min' => 1,
97
+ 'max' => 100,
98
+ 'step' => 1,
99
+ ],
100
+ ],
101
+ 'default' => [
102
+ 'unit' => 'px',
103
+ 'size' => 10,
104
+ ],
105
+ 'condition' => [
106
+ 'wpr_rpb_enable' => 'yes',
107
+ ],
108
+ 'selectors' => [
109
+ '.wpr-reading-progress-bar-container' => 'height: {{SIZE}}{{UNIT}} !important',
110
+ '.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'height: {{SIZE}}{{UNIT}} !important',
111
+ ],
112
+ ]
113
+ );
114
+
115
+ $element->add_control(
116
+ 'wpr_background_color',
117
+ [
118
+ 'label' => __( 'Background Color', 'wpr-addons' ),
119
+ 'type' => \Elementor\Controls_Manager::COLOR,
120
+ 'default' => '#C5C5C6',
121
+ 'condition' => [
122
+ 'wpr_rpb_enable' => 'yes',
123
+ ],
124
+ 'selectors' => [
125
+ '.wpr-reading-progress-bar-container' => 'background-color: {{VALUE}};'
126
+ ]
127
+ ]
128
+ );
129
+
130
+ $element->add_control(
131
+ 'wpr_fill_color',
132
+ [
133
+ 'label' => __( 'Fill Color', 'wpr-addons' ),
134
+ 'type' => \Elementor\Controls_Manager::COLOR,
135
+ 'default' => '#6A63DA',
136
+ 'condition' => [
137
+ 'wpr_rpb_enable' => 'yes',
138
+ ],
139
+ 'selectors' => [
140
+ '.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'background-color: {{VALUE}};'
141
+ ]
142
+ ]
143
+ );
144
+
145
+ $element->add_control(//wpr_rpb_position
146
+ 'progress_bar_position',
147
+ [
148
+ 'label' => __( 'Position', 'wpr-addons' ),
149
+ 'type' => \Elementor\Controls_Manager::SELECT,
150
+ 'default' => 'top',
151
+ 'render_type' => 'template',
152
+ 'options' => [
153
+ 'top' => __( 'Top', 'wpr-addons' ),
154
+ 'bottom' => __( 'Bottom', 'wpr-addons' ),
155
+ ],
156
+ 'selectors_dictionary' => [
157
+ 'top' => 'top: 0px !important; bottom: auto !important;',
158
+ 'bottom' => 'bottom: 0px !important; top: auto !important;',
159
+ ],
160
+ 'selectors' => [
161
+ '{{WRAPPER}} .wpr-reading-progress-bar-container' => '{{VALUE}}',
162
+ ],
163
+ 'condition' => [
164
+ 'wpr_rpb_enable' => 'yes',
165
+ ],
166
+ ]
167
+ );
168
+
169
+ $element->end_controls_section();
170
+
171
+ }
172
+
173
+ public function html_to_footer() {
174
+ $settings = get_option('wpr_progress_bar_global_options');
175
+ $rpb_position = 'top' === $settings['wpr_progress_bar_position'] ? 'top: 0px; bottom: auto;' : 'bottom: 0px; top: auto;';
176
+ $rpb_background_color = 'background-color: '. $settings['wpr_background_color'] .' !important;';
177
+ $rpb_fill_color = 'background-color: '. $settings['wpr_fill_color'] .'!important;';
178
+ $rpb_height = 'height: '. $settings['wpr_height']['size'] . $settings['wpr_height']['unit'] .';';
179
+
180
+ if ( !empty($settings) && 'yes' === $settings['wpr_rpb_enable'] ) {
181
+ if ( 'yes' === $settings['wpr_rpb_enable_globally_option'] ) {
182
+ if ( ('post' === $settings['wpr_rpb_display_option'] && ! is_single()) || ('page' === $settings['wpr_rpb_display_option'] && ! is_page()) ) {
183
+ return;
184
+ }
185
+
186
+ echo '<div style="'. esc_attr($rpb_position . $rpb_background_color) .'" class="wpr-reading-progress-bar-container"><div style="'. esc_attr($rpb_fill_color . $rpb_height) .'" class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
187
+ } else {
188
+ echo '<div class="wpr-reading-progress-bar-container"><div class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
189
+ }
190
+ }
191
+ }
192
+
193
+ public static function instance() {
194
+ if ( is_null( self::$_instance ) ) {
195
+ self::$_instance = new self();
196
+ }
197
+ return self::$_instance;
198
+ }
199
+ }
200
+
201
  Wpr_ReadingProgressBar::instance();
freemius/assets/css/admin/affiliation.css CHANGED
@@ -1,12 +1,12 @@
1
- @charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
2
-
3
- #fs_affiliation_content_wrapper .postbox {
4
- padding: 0 20px 10px 20px;
5
- }
6
-
7
- #fs_affiliation_content_wrapper #apply_button {
8
- padding: 0 25px;
9
- text-transform: uppercase;
10
- font-size: 14px;
11
- letter-spacing: 0.5px;
12
  }
1
+ @charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
2
+
3
+ #fs_affiliation_content_wrapper .postbox {
4
+ padding: 0 20px 10px 20px;
5
+ }
6
+
7
+ #fs_affiliation_content_wrapper #apply_button {
8
+ padding: 0 25px;
9
+ text-transform: uppercase;
10
+ font-size: 14px;
11
+ letter-spacing: 0.5px;
12
  }
freemius/assets/css/admin/checkout.css CHANGED
@@ -1 +1 @@
1
- @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
1
+ @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
freemius/assets/css/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -1,1561 +1,1561 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.4
7
- *
8
- * @link https://github.com/easydigitaldownloads/EDD-License-handler/blob/master/EDD_SL_Plugin_Updater.php
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- class FS_Plugin_Updater {
16
-
17
- /**
18
- * @var Freemius
19
- * @since 1.0.4
20
- */
21
- private $_fs;
22
- /**
23
- * @var FS_Logger
24
- * @since 1.0.4
25
- */
26
- private $_logger;
27
- /**
28
- * @var object
29
- * @since 1.1.8.1
30
- */
31
- private $_update_details;
32
- /**
33
- * @var array
34
- * @since 2.1.2
35
- */
36
- private $_translation_updates;
37
-
38
- private static $_upgrade_basename = null;
39
-
40
- #--------------------------------------------------------------------------------
41
- #region Singleton
42
- #--------------------------------------------------------------------------------
43
-
44
- /**
45
- * @var FS_Plugin_Updater[]
46
- * @since 2.0.0
47
- */
48
- private static $_INSTANCES = array();
49
-
50
- /**
51
- * @param Freemius $freemius
52
- *
53
- * @return FS_Plugin_Updater
54
- */
55
- static function instance( Freemius $freemius ) {
56
- $key = $freemius->get_id();
57
-
58
- if ( ! isset( self::$_INSTANCES[ $key ] ) ) {
59
- self::$_INSTANCES[ $key ] = new self( $freemius );
60
- }
61
-
62
- return self::$_INSTANCES[ $key ];
63
- }
64
-
65
- #endregion
66
-
67
- private function __construct( Freemius $freemius ) {
68
- $this->_fs = $freemius;
69
-
70
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $freemius->get_slug() . '_updater', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
71
-
72
- $this->filters();
73
- }
74
-
75
- /**
76
- * Initiate required filters.
77
- *
78
- * @author Vova Feldman (@svovaf)
79
- * @since 1.0.4
80
- */
81
- private function filters() {
82
- // Override request for plugin information
83
- add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );
84
-
85
- $this->add_transient_filters();
86
-
87
- /**
88
- * If user has the premium plugin's code but do NOT have an active license,
89
- * encourage him to upgrade by showing that there's a new release, but instead
90
- * of showing an update link, show upgrade link to the pricing page.
91
- *
92
- * @since 1.1.6
93
- *
94
- */
95
- // WP 2.9+
96
- add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
97
- &$this,
98
- 'catch_plugin_update_row'
99
- ), 9 );
100
- add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
101
- &$this,
102
- 'edit_and_echo_plugin_update_row'
103
- ), 11, 2 );
104
-
105
- if ( ! $this->_fs->has_any_active_valid_license() ) {
106
- add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );
107
- }
108
-
109
- if ( ! WP_FS__IS_PRODUCTION_MODE ) {
110
- add_filter( 'http_request_host_is_external', array(
111
- $this,
112
- 'http_request_host_is_external_filter'
113
- ), 10, 3 );
114
- }
115
-
116
- if ( $this->_fs->is_premium() ) {
117
- if ( ! $this->is_correct_folder_name() ) {
118
- add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
119
- }
120
-
121
- add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
122
- add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
123
-
124
- if ( ! $this->_fs->has_any_active_valid_license() ) {
125
- add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
126
- }
127
- }
128
- }
129
-
130
- /**
131
- * @author Leo Fajardo (@leorw)
132
- * @since 2.1.4
133
- */
134
- function catch_plugin_information_dialog_contents() {
135
- if (
136
- 'plugin-information' !== fs_request_get( 'tab', false ) ||
137
- $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
138
- ) {
139
- return;
140
- }
141
-
142
- add_action( 'admin_footer', array( &$this, 'edit_and_echo_plugin_information_dialog_contents' ), 0, 1 );
143
-
144
- ob_start();
145
- }
146
-
147
- /**
148
- * @author Leo Fajardo (@leorw)
149
- * @since 2.1.4
150
- *
151
- * @param string $hook_suffix
152
- */
153
- function edit_and_echo_plugin_information_dialog_contents( $hook_suffix ) {
154
- if (
155
- 'plugin-information' !== fs_request_get( 'tab', false ) ||
156
- $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
157
- ) {
158
- return;
159
- }
160
-
161
- $license = $this->_fs->_get_license();
162
-
163
- $subscription = ( is_object( $license ) && ! $license->is_lifetime() ) ?
164
- $this->_fs->_get_subscription( $license->id ) :
165
- null;
166
-
167
- $contents = ob_get_clean();
168
-
169
- $update_button_id_attribute_pos = strpos( $contents, 'id="plugin_update_from_iframe"' );
170
-
171
- if ( false !== $update_button_id_attribute_pos ) {
172
- $update_button_start_pos = strrpos(
173
- substr( $contents, 0, $update_button_id_attribute_pos ),
174
- '<a'
175
- );
176
-
177
- $update_button_end_pos = ( strpos( $contents, '</a>', $update_button_id_attribute_pos ) + strlen( '</a>' ) );
178
-
179
- /**
180
- * The part of the contents without the update button.
181
- *
182
- * @author Leo Fajardo (@leorw)
183
- * @since 2.2.5
184
- */
185
- $modified_contents = substr( $contents, 0, $update_button_start_pos );
186
-
187
- $update_button = substr( $contents, $update_button_start_pos, ( $update_button_end_pos - $update_button_start_pos ) );
188
-
189
- /**
190
- * Replace the plugin information dialog's "Install Update Now" button's text and URL. If there's a license,
191
- * the text will be "Renew license" and will link to the checkout page with the license's billing cycle
192
- * and quota. If there's no license, the text will be "Buy license" and will link to the pricing page.
193
- */
194
- $update_button = preg_replace(
195
- '/(\<a.+)(id="plugin_update_from_iframe")(.+href=")([^\s]+)(".*\>)(.+)(\<\/a>)/is',
196
- is_object( $license ) ?
197
- sprintf(
198
- '$1$3%s$5%s$7',
199
- $this->_fs->checkout_url(
200
- is_object( $subscription ) ?
201
- ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) :
202
- WP_FS__PERIOD_LIFETIME,
203
- false,
204
- array( 'licenses' => $license->quota )
205
- ),
206
- fs_text_inline( 'Renew license', 'renew-license', $this->_fs->get_slug() )
207
- ) :
208
- sprintf(
209
- '$1$3%s$5%s$7',
210
- $this->_fs->pricing_url(),
211
- fs_text_inline( 'Buy license', 'buy-license', $this->_fs->get_slug() )
212
- ),
213
- $update_button
214
- );
215
-
216
- /**
217
- * Append the modified button.
218
- *
219
- * @author Leo Fajardo (@leorw)
220
- * @since 2.2.5
221
- */
222
- $modified_contents .= $update_button;
223
-
224
- /**
225
- * Append the remaining part of the contents after the update button.
226
- *
227
- * @author Leo Fajardo (@leorw)
228
- * @since 2.2.5
229
- */
230
- $modified_contents .= substr( $contents, $update_button_end_pos );
231
-
232
- $contents = $modified_contents;
233
- }
234
-
235
- echo $contents;
236
- }
237
-
238
- /**
239
- * @author Vova Feldman (@svovaf)
240
- * @since 2.0.0
241
- */
242
- private function add_transient_filters() {
243
- if ( $this->_fs->is_premium() && ! $this->_fs->is_tracking_allowed() ) {
244
- $this->_logger->log( 'Opted out sites cannot receive automatic software updates.' );
245
-
246
- return;
247
- }
248
-
249
- add_filter( 'pre_set_site_transient_update_plugins', array(
250
- &$this,
251
- 'pre_set_site_transient_update_plugins_filter'
252
- ) );
253
-
254
- add_filter( 'pre_set_site_transient_update_themes', array(
255
- &$this,
256
- 'pre_set_site_transient_update_plugins_filter'
257
- ) );
258
- }
259
-
260
- /**
261
- * @author Vova Feldman (@svovaf)
262
- * @since 2.0.0
263
- */
264
- private function remove_transient_filters() {
265
- remove_filter( 'pre_set_site_transient_update_plugins', array(
266
- &$this,
267
- 'pre_set_site_transient_update_plugins_filter'
268
- ) );
269
-
270
- remove_filter( 'pre_set_site_transient_update_themes', array(
271
- &$this,
272
- 'pre_set_site_transient_update_plugins_filter'
273
- ) );
274
- }
275
-
276
- /**
277
- * Capture plugin update row by turning output buffering.
278
- *
279
- * @author Vova Feldman (@svovaf)
280
- * @since 1.1.6
281
- */
282
- function catch_plugin_update_row() {
283
- ob_start();
284
- }
285
-
286
- /**
287
- * Overrides default update message format with "renew your license" message.
288
- *
289
- * @author Vova Feldman (@svovaf)
290
- * @since 1.1.6
291
- *
292
- * @param string $file
293
- * @param array $plugin_data
294
- */
295
- function edit_and_echo_plugin_update_row( $file, $plugin_data ) {
296
- $plugin_update_row = ob_get_clean();
297
-
298
- $current = get_site_transient( 'update_plugins' );
299
- if ( ! isset( $current->response[ $file ] ) ) {
300
- echo $plugin_update_row;
301
-
302
- return;
303
- }
304
-
305
- $r = $current->response[ $file ];
306
-
307
- $has_beta_update = $this->_fs->has_beta_update();
308
-
309
- if ( $this->_fs->has_any_active_valid_license() ) {
310
- if ( $has_beta_update ) {
311
- /**
312
- * Turn the "new version" text into "new Beta version".
313
- *
314
- * Sample input:
315
- * There is a new version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
316
- * Output:
317
- * There is a new Beta version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
318
- *
319
- * @author Leo Fajardo (@leorw)
320
- * @since 2.3.0
321
- */
322
- $plugin_update_row = preg_replace(
323
- '/(\<div.+>)(.+)(\<a.+href="([^\s]+)"([^\<]+)\>.+\<a.+)(\<\/div\>)/is',
324
- (
325
- '$1' .
326
- sprintf(
327
- fs_text_inline( 'There is a %s of %s available.', 'new-version-available', $this->_fs->get_slug() ),
328
- $has_beta_update ?
329
- fs_text_inline( 'new Beta version', 'new-beta-version', $this->_fs->get_slug() ) :
330
- fs_text_inline( 'new version', 'new-version', $this->_fs->get_slug() ),
331
- $this->_fs->get_plugin_title()
332
- ) .
333
- ' ' .
334
- '$3' .
335
- '$6'
336
- ),
337
- $plugin_update_row
338
- );
339
- }
340
- } else {
341
- /**
342
- * Turn the "new version" text into a link that opens the plugin information dialog when clicked and
343
- * make the "View version x details" text link to the checkout page instead of opening the plugin
344
- * information dialog when clicked.
345
- *
346
- * Sample input:
347
- * There is a new version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
348
- * Output:
349
- * There is a <a href="...>new version</a> of Awesome Plugin available. <a href="...>Buy a license now</a> to access version x.y.z security & feature updates, and support.
350
- * OR
351
- * There is a <a href="...>new Beta version</a> of Awesome Plugin available. <a href="...>Buy a license now</a> to access version x.y.z security & feature updates, and support.
352
- *
353
- * @author Leo Fajardo (@leorw)
354
- */
355
- $plugin_update_row = preg_replace(
356
- '/(\<div.+>)(.+)(\<a.+href="([^\s]+)"([^\<]+)\>.+\<a.+)(\<\/div\>)/is',
357
- (
358
- '$1' .
359
- sprintf(
360
- fs_text_inline( 'There is a %s of %s available.', 'new-version-available', $this->_fs->get_slug() ),
361
- sprintf(
362
- '<a href="$4"%s>%s</a>',
363
- '$5',
364
- $has_beta_update ?
365
- fs_text_inline( 'new Beta version', 'new-beta-version', $this->_fs->get_slug() ) :
366
- fs_text_inline( 'new version', 'new-version', $this->_fs->get_slug() )
367
- ),
368
- $this->_fs->get_plugin_title()
369
- ) .
370
- ' ' .
371
- $this->_fs->version_upgrade_checkout_link( $r->new_version ) .
372
- '$6'
373
- ),
374
- $plugin_update_row
375
- );
376
- }
377
-
378
- if (
379
- $this->_fs->is_plugin() &&
380
- isset( $r->upgrade_notice ) &&
381
- strlen( trim( $r->upgrade_notice ) ) > 0
382
- ) {
383
- $slug = $this->_fs->get_slug();
384
-
385
- $upgrade_notice_html = sprintf(
386
- '<p class="notice fs-upgrade-notice fs-slug-%1$s fs-type-%2$s" data-slug="%1$s" data-type="%2$s"><strong>%3$s</strong> %4$s</p>',
387
- $slug,
388
- $this->_fs->get_module_type(),
389
- fs_text_inline( 'Important Upgrade Notice:', 'upgrade_notice', $slug ),
390
- esc_html( $r->upgrade_notice )
391
- );
392
-
393
- $plugin_update_row = str_replace( '</div>', '</div>' . $upgrade_notice_html, $plugin_update_row );
394
- }
395
-
396
- echo $plugin_update_row;
397
- }
398
-
399
- /**
400
- * @author Leo Fajardo (@leorw)
401
- * @since 2.0.2
402
- *
403
- * @param array $prepared_themes
404
- *
405
- * @return array
406
- */
407
- function change_theme_update_info_html( $prepared_themes ) {
408
- $theme_basename = $this->_fs->get_plugin_basename();
409
-
410
- if ( ! isset( $prepared_themes[ $theme_basename ] ) ) {
411
- return $prepared_themes;
412
- }
413
-
414
- $themes_update = get_site_transient( 'update_themes' );
415
- if ( ! isset( $themes_update->response[ $theme_basename ] ) ||
416
- empty( $themes_update->response[ $theme_basename ]['package'] )
417
- ) {
418
- return $prepared_themes;
419
- }
420
-
421
- $prepared_themes[ $theme_basename ]['update'] = preg_replace(
422
- '/(\<p.+>)(.+)(\<a.+\<a.+)\.(.+\<\/p\>)/is',
423
- '$1 $2 ' . $this->_fs->version_upgrade_checkout_link( $themes_update->response[ $theme_basename ]['new_version'] ) .
424
- '$4',
425
- $prepared_themes[ $theme_basename ]['update']
426
- );
427
-
428
- // Set to false to prevent the "Update now" link for the context theme from being shown on the "Themes" page.
429
- $prepared_themes[ $theme_basename ]['hasPackage'] = false;
430
-
431
- return $prepared_themes;
432
- }
433
-
434
- /**
435
- * Since WP version 3.6, a new security feature was added that denies access to repository with a local ip.
436
- * During development mode we want to be able updating plugin versions via our localhost repository. This
437
- * filter white-list all domains including "api.freemius".
438
- *
439
- * @link http://www.emanueletessore.com/wordpress-download-failed-valid-url-provided/
440
- *
441
- * @author Vova Feldman (@svovaf)
442
- * @since 1.0.4
443
- *
444
- * @param bool $allow
445
- * @param string $host
446
- * @param string $url
447
- *
448
- * @return bool
449
- */
450
- function http_request_host_is_external_filter( $allow, $host, $url ) {
451
- return ( false !== strpos( $host, 'freemius' ) ) ? true : $allow;
452
- }
453
-
454
- /**
455
- * Check for Updates at the defined API endpoint and modify the update array.
456
- *
457
- * This function dives into the update api just when WordPress creates its update array,
458
- * then adds a custom API call and injects the custom plugin data retrieved from the API.
459
- * It is reassembled from parts of the native WordPress plugin update code.
460
- * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
461
- *
462
- * @author Vova Feldman (@svovaf)
463
- * @since 1.0.4
464
- *
465
- * @uses FS_Api
466
- *
467
- * @param object $transient_data Update array build by WordPress.
468
- *
469
- * @return object Modified update array with custom plugin data.
470
- */
471
- function pre_set_site_transient_update_plugins_filter( $transient_data ) {
472
- $this->_logger->entrance();
473
-
474
- /**
475
- * "plugins" or "themes".
476
- *
477
- * @author Leo Fajardo (@leorw)
478
- * @since 1.2.2
479
- */
480
- $module_type = $this->_fs->get_module_type() . 's';
481
-
482
- /**
483
- * Ensure that we don't mix plugins update info with themes update info.
484
- *
485
- * @author Leo Fajardo (@leorw)
486
- * @since 1.2.2
487
- */
488
- if ( "pre_set_site_transient_update_{$module_type}" !== current_filter() ) {
489
- return $transient_data;
490
- }
491
-
492
- if ( empty( $transient_data ) ||
493
- defined( 'WP_FS__UNINSTALL_MODE' )
494
- ) {
495
- return $transient_data;
496
- }
497
-
498
- global $wp_current_filter;
499
-
500
- $current_plugin_version = $this->_fs->get_plugin_version();
501
-
502
- if ( ! empty( $wp_current_filter ) && 'upgrader_process_complete' === $wp_current_filter[0] ) {
503
- if (
504
- is_null( $this->_update_details ) ||
505
- ( is_object( $this->_update_details ) && $this->_update_details->new_version !== $current_plugin_version )
506
- ) {
507
- /**
508
- * After an update, clear the stored update details and reparse the plugin's main file in order to get
509
- * the updated version's information and prevent the previous update information from showing up on the
510
- * updates page.
511
- *
512
- * @author Leo Fajardo (@leorw)
513
- * @since 2.3.1
514
- */
515
- $this->_update_details = null;
516
- $current_plugin_version = $this->_fs->get_plugin_version( true );
517
- }
518
- }
519
-
520
- if ( ! isset( $this->_update_details ) ) {
521
- // Get plugin's newest update.
522
- $new_version = $this->_fs->get_update(
523
- false,
524
- fs_request_get_bool( 'force-check' ),
525
- WP_FS__TIME_24_HOURS_IN_SEC / 24,
526
- $current_plugin_version
527
- );
528
-
529
- $this->_update_details = false;
530
-
531
- if ( is_object( $new_version ) && $this->is_new_version_premium( $new_version ) ) {
532
- $this->_logger->log( 'Found newer plugin version ' . $new_version->version );
533
-
534
- /**
535
- * Cache plugin details locally since set_site_transient( 'update_plugins' )
536
- * called multiple times and the non wp.org plugins are filtered after the
537
- * call to .org.
538
- *
539
- * @since 1.1.8.1
540
- */
541
- $this->_update_details = $this->get_update_details( $new_version );
542
- }
543
- }
544
-
545
- // Alias.
546
- $basename = $this->_fs->premium_plugin_basename();
547
-
548
- if ( is_object( $this->_update_details ) ) {
549
- if ( isset( $transient_data->no_update ) ) {
550
- unset( $transient_data->no_update[ $basename ] );
551
- }
552
-
553
- if ( ! isset( $transient_data->response ) ) {
554
- $transient_data->response = array();
555
- }
556
-
557
- // Add plugin to transient data.
558
- $transient_data->response[ $basename ] = $this->_fs->is_plugin() ?
559
- $this->_update_details :
560
- (array) $this->_update_details;
561
- } else {
562
- if ( isset( $transient_data->response ) ) {
563
- /**
564
- * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
565
- *
566
- * @author Leo Fajardo (@leorw)
567
- * @since 2.3.0
568
- */
569
- unset( $transient_data->response[ $basename ] );
570
- }
571
-
572
- if ( ! isset( $transient_data->no_update ) ) {
573
- $transient_data->no_update = array();
574
- }
575
-
576
- /**
577
- * Add product to no_update transient data to properly integrate with WP 5.5 auto-updates UI.
578
- *
579
- * @since 2.4.1
580
- * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/
581
- */
582
- $transient_data->no_update[ $basename ] = $this->_fs->is_plugin() ?
583
- (object) array(
584
- 'id' => $basename,
585
- 'slug' => $this->_fs->get_slug(),
586
- 'plugin' => $basename,
587
- 'new_version' => $this->_fs->get_plugin_version(),
588
- 'url' => '',
589
- 'package' => '',
590
- 'icons' => array(),
591
- 'banners' => array(),
592
- 'banners_rtl' => array(),
593
- 'tested' => '',
594
- 'requires_php' => '',
595
- 'compatibility' => new stdClass(),
596
- ) :
597
- array(
598
- 'theme' => $basename,
599
- 'new_version' => $this->_fs->get_plugin_version(),
600
- 'url' => '',
601
- 'package' => '',
602
- 'requires' => '',
603
- 'requires_php' => '',
604
- );
605
- }
606
-
607
- $slug = $this->_fs->get_slug();
608
-
609
- if ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() ) {
610
- if ( ! isset( $this->_translation_updates ) ) {
611
- $this->_translation_updates = array();
612
-
613
- if ( current_user_can( 'update_languages' ) ) {
614
- $translation_updates = $this->fetch_wp_org_module_translation_updates( $module_type, $slug );
615
- if ( ! empty( $translation_updates ) ) {
616
- $this->_translation_updates = $translation_updates;
617
- }
618
- }
619
- }
620
-
621
- if ( ! empty( $this->_translation_updates ) ) {
622
- $all_translation_updates = ( isset( $transient_data->translations ) && is_array( $transient_data->translations ) ) ?
623
- $transient_data->translations :
624
- array();
625
-
626
- $current_plugin_translation_updates_map = array();
627
- foreach ( $all_translation_updates as $key => $translation_update ) {
628
- if ( $module_type === ( $translation_update['type'] . 's' ) && $slug === $translation_update['slug'] ) {
629
- $current_plugin_translation_updates_map[ $translation_update['language'] ] = $translation_update;
630
- unset( $all_translation_updates[ $key ] );
631
- }
632
- }
633
-
634
- foreach ( $this->_translation_updates as $translation_update ) {
635
- $lang = $translation_update['language'];
636
- if ( ! isset( $current_plugin_translation_updates_map[ $lang ] ) ||
637
- version_compare( $translation_update['version'], $current_plugin_translation_updates_map[ $lang ]['version'], '>' )
638
- ) {
639
- $current_plugin_translation_updates_map[ $lang ] = $translation_update;
640
- }
641
- }
642
-
643
- $transient_data->translations = array_merge( $all_translation_updates, array_values( $current_plugin_translation_updates_map ) );
644
- }
645
- }
646
-
647
- return $transient_data;
648
- }
649
-
650
- /**
651
- * Get module's required data for the updates mechanism.
652
- *
653
- * @author Vova Feldman (@svovaf)
654
- * @since 2.0.0
655
- *
656
- * @param \FS_Plugin_Tag $new_version
657
- *
658
- * @return object
659
- */
660
- function get_update_details( FS_Plugin_Tag $new_version ) {
661
- $update = new stdClass();
662
- $update->slug = $this->_fs->get_slug();
663
- $update->new_version = $new_version->version;
664
- $update->url = WP_FS__ADDRESS;
665
- $update->package = $new_version->url;
666
- $update->tested = $new_version->tested_up_to_version;
667
- $update->requires = $new_version->requires_platform_version;
668
-
669
- $icon = $this->_fs->get_local_icon_url();
670
-
671
- if ( ! empty( $icon ) ) {
672
- $update->icons = array(
673
- // '1x' => $icon,
674
- // '2x' => $icon,
675
- 'default' => $icon,
676
- );
677
- }
678
-
679
- if ( $this->_fs->is_premium() ) {
680
- $latest_tag = $this->_fs->_fetch_latest_version( $this->_fs->get_id(), false );
681
-
682
- if (
683
- isset( $latest_tag->readme ) &&
684
- isset( $latest_tag->readme->upgrade_notice ) &&
685
- ! empty( $latest_tag->readme->upgrade_notice )
686
- ) {
687
- $update->upgrade_notice = $latest_tag->readme->upgrade_notice;
688
- }
689
- }
690
-
691
- $update->{$this->_fs->get_module_type()} = $this->_fs->get_plugin_basename();
692
-
693
- return $update;
694
- }
695
-
696
- /**
697
- * @author Leo Fajardo (@leorw)
698
- * @since 2.3.0
699
- *
700
- * @param FS_Plugin_Tag $new_version
701
- *
702
- * @return bool
703
- */
704
- private function is_new_version_premium( FS_Plugin_Tag $new_version ) {
705
- $query_str = parse_url( $new_version->url, PHP_URL_QUERY );
706
- if ( empty( $query_str ) ) {
707
- return false;
708
- }
709
-
710
- parse_str( $query_str, $params );
711
-
712
- return ( isset( $params['is_premium'] ) && 'true' == $params['is_premium'] );
713
- }
714
-
715
- /**
716
- * Update the updates transient with the module's update information.
717
- *
718
- * This method is required for multisite environment.
719
- * If a module is site activated (not network) and not on the main site,
720
- * the module will NOT be executed on the network level, therefore, the
721
- * custom updates logic will not be executed as well, so unless we force
722
- * the injection of the update into the updates transient, premium updates
723
- * will not work.
724
- *
725
- * @author Vova Feldman (@svovaf)
726
- * @since 2.0.0
727
- *
728
- * @param \FS_Plugin_Tag $new_version
729
- */
730
- function set_update_data( FS_Plugin_Tag $new_version ) {
731
- $this->_logger->entrance();
732
-
733
- if ( ! $this->is_new_version_premium( $new_version ) ) {
734
- return;
735
- }
736
-
737
- $transient_key = "update_{$this->_fs->get_module_type()}s";
738
-
739
- $transient_data = get_site_transient( $transient_key );
740
-
741
- $transient_data = is_object( $transient_data ) ?
742
- $transient_data :
743
- new stdClass();
744
-
745
- // Alias.
746
- $basename = $this->_fs->get_plugin_basename();
747
- $is_plugin = $this->_fs->is_plugin();
748
-
749
- if ( ! isset( $transient_data->response ) ||
750
- ! is_array( $transient_data->response )
751
- ) {
752
- $transient_data->response = array();
753
- } elseif ( ! empty( $transient_data->response[ $basename ] ) ) {
754
- $version = $is_plugin ?
755
- ( ! empty( $transient_data->response[ $basename ]->new_version ) ?
756
- $transient_data->response[ $basename ]->new_version :
757
- null
758
- ) : ( ! empty( $transient_data->response[ $basename ]['new_version'] ) ?
759
- $transient_data->response[ $basename ]['new_version'] :
760
- null
761
- );
762
-
763
- if ( $version == $new_version->version ) {
764
- // The update data is already set.
765
- return;
766
- }
767
- }
768
-
769
- // Remove the added filters.
770
- $this->remove_transient_filters();
771
-
772
- $this->_update_details = $this->get_update_details( $new_version );
773
-
774
- // Set update data in transient.
775
- $transient_data->response[ $basename ] = $is_plugin ?
776
- $this->_update_details :
777
- (array) $this->_update_details;
778
-
779
- if ( ! isset( $transient_data->checked ) ||
780
- ! is_array( $transient_data->checked )
781
- ) {
782
- $transient_data->checked = array();
783
- }
784
-
785
- // Flag the module as if it was already checked.
786
- $transient_data->checked[ $basename ] = $this->_fs->get_plugin_version();
787
- $transient_data->last_checked = time();
788
-
789
- set_site_transient( $transient_key, $transient_data );
790
-
791
- $this->add_transient_filters();
792
- }
793
-
794
- /**
795
- * @author Leo Fajardo (@leorw)
796
- * @since 2.0.2
797
- */
798
- function delete_update_data() {
799
- $this->_logger->entrance();
800
-
801
- $transient_key = "update_{$this->_fs->get_module_type()}s";
802
-
803
- $transient_data = get_site_transient( $transient_key );
804
-
805
- // Alias
806
- $basename = $this->_fs->get_plugin_basename();
807
-
808
- if ( ! is_object( $transient_data ) ||
809
- ! isset( $transient_data->response ) ||
810
- ! is_array( $transient_data->response ) ||
811
- empty( $transient_data->response[ $basename ] )
812
- ) {
813
- return;
814
- }
815
-
816
- unset( $transient_data->response[ $basename ] );
817
-
818
- // Remove the added filters.
819
- $this->remove_transient_filters();
820
-
821
- set_site_transient( $transient_key, $transient_data );
822
-
823
- $this->add_transient_filters();
824
- }
825
-
826
- /**
827
- * Try to fetch plugin's info from .org repository.
828
- *
829
- * @author Vova Feldman (@svovaf)
830
- * @since 1.0.5
831
- *
832
- * @param string $action
833
- * @param object $args
834
- *
835
- * @return bool|mixed
836
- */
837
- static function _fetch_plugin_info_from_repository( $action, $args ) {
838
- $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
839
- if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
840
- $url = set_url_scheme( $url, 'https' );
841
- }
842
-
843
- $args = array(
844
- 'timeout' => 15,
845
- 'body' => array(
846
- 'action' => $action,
847
- 'request' => serialize( $args )
848
- )
849
- );
850
-
851
- $request = wp_remote_post( $url, $args );
852
-
853
- if ( is_wp_error( $request ) ) {
854
- return false;
855
- }
856
-
857
- $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
858
-
859
- if ( ! is_object( $res ) && ! is_array( $res ) ) {
860
- return false;
861
- }
862
-
863
- return $res;
864
- }
865
-
866
- /**
867
- * Fetches module translation updates from wordpress.org.
868
- *
869
- * @author Leo Fajardo (@leorw)
870
- * @since 2.1.2
871
- *
872
- * @param string $module_type
873
- * @param string $slug
874
- *
875
- * @return array|null
876
- */
877
- private function fetch_wp_org_module_translation_updates( $module_type, $slug ) {
878
- $plugin_data = $this->_fs->get_plugin_data();
879
-
880
- $locales = array_values( get_available_languages() );
881
- $locales = apply_filters( "{$module_type}_update_check_locales", $locales );
882
- $locales = array_unique( $locales );
883
-
884
- $plugin_basename = $this->_fs->get_plugin_basename();
885
- if ( 'themes' === $module_type ) {
886
- $plugin_basename = $slug;
887
- }
888
-
889
- global $wp_version;
890
-
891
- $request_args = array(
892
- 'timeout' => 15,
893
- 'body' => array(
894
- "{$module_type}" => json_encode(
895
- array(
896
- "{$module_type}" => array(
897
- $plugin_basename => array(
898
- 'Name' => trim( str_replace( $this->_fs->get_plugin()->premium_suffix, '', $plugin_data['Name'] ) ),
899
- 'Author' => $plugin_data['Author'],
900
- )
901
- )
902
- )
903
- ),
904
- 'translations' => json_encode( $this->get_installed_translations( $module_type, $slug ) ),
905
- 'locale' => json_encode( $locales )
906
- ),
907
- 'user-agent' => ( 'WordPress/' . $wp_version . '; ' . home_url( '/' ) )
908
- );
909
-
910
- $url = "http://api.wordpress.org/{$module_type}/update-check/1.1/";
911
- if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
912
- $url = set_url_scheme( $url, 'https' );
913
- }
914
-
915
- $raw_response = Freemius::safe_remote_post(
916
- $url,
917
- $request_args,
918
- WP_FS__TIME_24_HOURS_IN_SEC,
919
- WP_FS__TIME_12_HOURS_IN_SEC,
920
- false
921
- );
922
-
923
- if ( is_wp_error( $raw_response ) ) {
924
- return null;
925
- }
926
-
927
- $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
928
-
929
- if ( ! is_array( $response ) ) {
930
- return null;
931
- }
932
-
933
- if ( ! isset( $response['translations'] ) || empty( $response['translations'] ) ) {
934
- return null;
935
- }
936
-
937
- return $response['translations'];
938
- }
939
-
940
- /**
941
- * @author Leo Fajardo (@leorw)
942
- * @since 2.1.2
943
- *
944
- * @param string $module_type
945
- * @param string $slug
946
- *
947
- * @return array
948
- */
949
- private function get_installed_translations( $module_type, $slug ) {
950
- if ( function_exists( 'wp_get_installed_translations' ) ) {
951
- return wp_get_installed_translations( $module_type );
952
- }
953
-
954
- $dir = "/{$module_type}";
955
-
956
- if ( ! is_dir( WP_LANG_DIR . $dir ) )
957
- return array();
958
-
959
- $files = scandir( WP_LANG_DIR . $dir );
960
- if ( ! $files )
961
- return array();
962
-
963
- $language_data = array();
964
-
965
- foreach ( $files as $file ) {
966
- if ( 0 !== strpos( $file, $slug ) ) {
967
- continue;
968
- }
969
-
970
- if ( '.' === $file[0] || is_dir( WP_LANG_DIR . "{$dir}/{$file}" ) ) {
971
- continue;
972
- }
973
-
974
- if ( substr( $file, -3 ) !== '.po' ) {
975
- continue;
976
- }
977
-
978
- if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
979
- continue;
980
- }
981
-
982
- if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) {
983
- continue;
984
- }
985
-
986
- list( , $textdomain, $language ) = $match;
987
-
988
- if ( '' === $textdomain ) {
989
- $textdomain = 'default';
990
- }
991
-
992
- $language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( WP_LANG_DIR . "{$dir}/{$file}" );
993
- }
994
-
995
- return $language_data;
996
- }
997
-
998
- /**
999
- * Updates information on the "View version x.x details" page with custom data.
1000
- *
1001
- * @author Vova Feldman (@svovaf)
1002
- * @since 1.0.4
1003
- *
1004
- * @uses FS_Api
1005
- *
1006
- * @param object $data
1007
- * @param string $action
1008
- * @param mixed $args
1009
- *
1010
- * @return object
1011
- */
1012
- function plugins_api_filter( $data, $action = '', $args = null ) {
1013
- $this->_logger->entrance();
1014
-
1015
- if ( ( 'plugin_information' !== $action ) ||
1016
- ! isset( $args->slug )
1017
- ) {
1018
- return $data;
1019
- }
1020
-
1021
- $addon = false;
1022
- $is_addon = false;
1023
- $addon_version = false;
1024
-
1025
- if ( $this->_fs->get_slug() !== $args->slug ) {
1026
- $addon = $this->_fs->get_addon_by_slug( $args->slug );
1027
-
1028
- if ( ! is_object( $addon ) ) {
1029
- return $data;
1030
- }
1031
-
1032
- if ( $this->_fs->is_addon_activated( $addon->id ) ) {
1033
- $addon_version = $this->_fs->get_addon_instance( $addon->id )->get_plugin_version();
1034
- } elseif ( $this->_fs->is_addon_installed( $addon->id ) ) {
1035
- $addon_plugin_data = get_plugin_data(
1036
- ( WP_PLUGIN_DIR . '/' . $this->_fs->get_addon_basename( $addon->id ) ),
1037
- false,
1038
- false
1039
- );
1040
-
1041
- if ( ! empty( $addon_plugin_data ) ) {
1042
- $addon_version = $addon_plugin_data['Version'];
1043
- }
1044
- }
1045
-
1046
- $is_addon = true;
1047
- }
1048
-
1049
- $plugin_in_repo = false;
1050
- if ( ! $is_addon ) {
1051
- // Try to fetch info from .org repository.
1052
- $data = self::_fetch_plugin_info_from_repository( $action, $args );
1053
-
1054
- $plugin_in_repo = ( false !== $data );
1055
- }
1056
-
1057
- if ( ! $plugin_in_repo ) {
1058
- $data = $args;
1059
-
1060
- // Fetch as much as possible info from local files.
1061
- $plugin_local_data = $this->_fs->get_plugin_data();
1062
- $data->name = $plugin_local_data['Name'];
1063
- $data->author = $plugin_local_data['Author'];
1064
- $data->sections = array(
1065
- 'description' => 'Upgrade ' . $plugin_local_data['Name'] . ' to latest.',
1066
- );
1067
-
1068
- // @todo Store extra plugin info on Freemius or parse readme.txt markup.
1069
- /*$info = $this->_fs->get_api_site_scope()->call('/information.json');
1070
-
1071
- if ( !isset($info->error) ) {
1072
- $data = $info;
1073
- }*/
1074
- }
1075
-
1076
- $plugin_version = $is_addon ?
1077
- $addon_version :
1078
- $this->_fs->get_plugin_version();
1079
-
1080
- // Get plugin's newest update.
1081
- $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version );
1082
-
1083
- if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
1084
- $data->version = $plugin_version;
1085
- } else {
1086
- if ( $is_addon ) {
1087
- $data->name = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
1088
- $data->slug = $addon->slug;
1089
- $data->url = WP_FS__ADDRESS;
1090
- $data->package = $new_version->url;
1091
- }
1092
-
1093
- if ( ! $plugin_in_repo ) {
1094
- $data->last_updated = ! is_null( $new_version->updated ) ? $new_version->updated : $new_version->created;
1095
- $data->requires = $new_version->requires_platform_version;
1096
- $data->tested = $new_version->tested_up_to_version;
1097
- }
1098
-
1099
- $data->version = $new_version->version;
1100
- $data->download_link = $new_version->url;
1101
-
1102
- if ( isset( $new_version->readme ) && is_object( $new_version->readme ) ) {
1103
- $new_version_readme_data = $new_version->readme;
1104
- if ( isset( $new_version_readme_data->sections ) ) {
1105
- $new_version_readme_data->sections = (array) $new_version_readme_data->sections;
1106
- } else {
1107
- $new_version_readme_data->sections = array();
1108
- }
1109
-
1110
- if ( isset( $data->sections ) ) {
1111
- if ( isset( $data->sections['screenshots'] ) ) {
1112
- $new_version_readme_data->sections['screenshots'] = $data->sections['screenshots'];
1113
- }
1114
-
1115
- if ( isset( $data->sections['reviews'] ) ) {
1116
- $new_version_readme_data->sections['reviews'] = $data->sections['reviews'];
1117
- }
1118
- }
1119
-
1120
- if ( isset( $new_version_readme_data->banners ) ) {
1121
- $new_version_readme_data->banners = (array) $new_version_readme_data->banners;
1122
- } elseif ( isset( $data->banners ) ) {
1123
- $new_version_readme_data->banners = $data->banners;
1124
- }
1125
-
1126
- $wp_org_sections = array(
1127
- 'author',
1128
- 'author_profile',
1129
- 'rating',
1130
- 'ratings',
1131
- 'num_ratings',
1132
- 'support_threads',
1133
- 'support_threads_resolved',
1134
- 'active_installs',
1135
- 'added',
1136
- 'homepage'
1137
- );
1138
-
1139
- foreach ( $wp_org_sections as $wp_org_section ) {
1140
- if ( isset( $data->{$wp_org_section} ) ) {
1141
- $new_version_readme_data->{$wp_org_section} = $data->{$wp_org_section};
1142
- }
1143
- }
1144
-
1145
- $data = $new_version_readme_data;
1146
- }
1147
- }
1148
-
1149
- return $data;
1150
- }
1151
-
1152
- /**
1153
- * @author Vova Feldman (@svovaf)
1154
- * @since 1.2.1.7
1155
- *
1156
- * @param number|bool $addon_id
1157
- * @param bool|string $newer_than Since 2.2.1
1158
- * @param bool|string $fetch_readme Since 2.2.1
1159
- *
1160
- * @return object
1161
- */
1162
- private function get_latest_download_details( $addon_id = false, $newer_than = false, $fetch_readme = true ) {
1163
- return $this->_fs->_fetch_latest_version( $addon_id, true, WP_FS__TIME_24_HOURS_IN_SEC, $newer_than, $fetch_readme );
1164
- }
1165
-
1166
- /**
1167
- * Checks if a given basename has a matching folder name
1168
- * with the current context plugin.
1169
- *
1170
- * @author Vova Feldman (@svovaf)
1171
- * @since 1.2.1.6
1172
- *
1173
- * @return bool
1174
- */
1175
- private function is_correct_folder_name() {
1176
- return ( $this->_fs->get_target_folder_name() == trim( dirname( $this->_fs->get_plugin_basename() ), '/\\' ) );
1177
- }
1178
-
1179
- /**
1180
- * This is a special after upgrade handler for migrating modules
1181
- * that didn't use the '-premium' suffix folder structure before
1182
- * the migration.
1183
- *
1184
- * @author Vova Feldman (@svovaf)
1185
- * @since 1.2.1.6
1186
- *
1187
- * @param bool $response Install response.
1188
- * @param array $hook_extra Extra arguments passed to hooked filters.
1189
- * @param array $result Installation result data.
1190
- *
1191
- * @return bool
1192
- */
1193
- function _maybe_update_folder_name( $response, $hook_extra, $result ) {
1194
- $basename = $this->_fs->get_plugin_basename();
1195
-
1196
- if ( true !== $response ||
1197
- empty( $hook_extra ) ||
1198
- empty( $hook_extra['plugin'] ) ||
1199
- $basename !== $hook_extra['plugin']
1200
- ) {
1201
- return $response;
1202
- }
1203
-
1204
- $active_plugins_basenames = get_option( 'active_plugins' );
1205
-
1206
- foreach ( $active_plugins_basenames as $key => $active_plugin_basename ) {
1207
- if ( $basename === $active_plugin_basename ) {
1208
- // Get filename including extension.
1209
- $filename = basename( $basename );
1210
-
1211
- $new_basename = plugin_basename(
1212
- trailingslashit( $this->_fs->is_premium() ? $this->_fs->get_premium_slug() : $this->_fs->get_slug() ) .
1213
- $filename
1214
- );
1215
-
1216
- // Verify that the expected correct path exists.
1217
- if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $new_basename ) ) ) {
1218
- // Override active plugin name.
1219
- $active_plugins_basenames[ $key ] = $new_basename;
1220
- update_option( 'active_plugins', $active_plugins_basenames );
1221
- }
1222
-
1223
- break;
1224
- }
1225
- }
1226
-
1227
- return $response;
1228
- }
1229
-
1230
- #----------------------------------------------------------------------------------
1231
- #region Auto Activation
1232
- #----------------------------------------------------------------------------------
1233
-
1234
- /**
1235
- * Installs and active a plugin when explicitly requested that from a 3rd party service.
1236
- *
1237
- * This logic was inspired by the TGMPA GPL licensed library by Thomas Griffin.
1238
- *
1239
- * @link http://tgmpluginactivation.com/
1240
- *
1241
- * @author Vova Feldman
1242
- * @since 1.2.1.7
1243
- *
1244
- * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/
1245
- *
1246
- * @uses WP_Filesystem
1247
- * @uses WP_Error
1248
- * @uses WP_Upgrader
1249
- * @uses Plugin_Upgrader
1250
- * @uses Plugin_Installer_Skin
1251
- * @uses Plugin_Upgrader_Skin
1252
- *
1253
- * @param number|bool $plugin_id
1254
- *
1255
- * @return array
1256
- */
1257
- function install_and_activate_plugin( $plugin_id = false ) {
1258
- if ( ! empty( $plugin_id ) && ! FS_Plugin::is_valid_id( $plugin_id ) ) {
1259
- // Invalid plugin ID.
1260
- return array(
1261
- 'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
1262
- 'code' => 'invalid_module_id',
1263
- );
1264
- }
1265
-
1266
- $is_addon = false;
1267
- if ( FS_Plugin::is_valid_id( $plugin_id ) &&
1268
- $plugin_id != $this->_fs->get_id()
1269
- ) {
1270
- $addon = $this->_fs->get_addon( $plugin_id );
1271
-
1272
- if ( ! is_object( $addon ) ) {
1273
- // Invalid add-on ID.
1274
- return array(
1275
- 'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
1276
- 'code' => 'invalid_module_id',
1277
- );
1278
- }
1279
-
1280
- $slug = $addon->slug;
1281
- $premium_slug = $addon->premium_slug;
1282
- $title = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
1283
-
1284
- $is_addon = true;
1285
- } else {
1286
- $slug = $this->_fs->get_slug();
1287
- $premium_slug = $this->_fs->get_premium_slug();
1288
- $title = $this->_fs->get_plugin_title() .
1289
- ( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' ) : '' );
1290
- }
1291
-
1292
- if ( $this->is_premium_plugin_active( $plugin_id ) ) {
1293
- // Premium version already activated.
1294
- return array(
1295
- 'message' => $is_addon ?
1296
- $this->_fs->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ) :
1297
- $this->_fs->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ),
1298
- 'code' => 'premium_installed',
1299
- );
1300
- }
1301
-
1302
- $latest_version = $this->get_latest_download_details( $plugin_id, false, false );
1303
- $target_folder = $premium_slug;
1304
-
1305
- // Prep variables for Plugin_Installer_Skin class.
1306
- $extra = array();
1307
- $extra['slug'] = $target_folder;
1308
- $source = $latest_version->url;
1309
- $api = null;
1310
-
1311
- $install_url = add_query_arg(
1312
- array(
1313
- 'action' => 'install-plugin',
1314
- 'plugin' => urlencode( $slug ),
1315
- ),
1316
- 'update.php'
1317
- );
1318
-
1319
- if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
1320
- // Include required resources for the installation.
1321
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1322
- }
1323
-
1324
- $skin_args = array(
1325
- 'type' => 'web',
1326
- 'title' => sprintf( $this->_fs->get_text_inline( 'Installing plugin: %s', 'installing-plugin-x' ), $title ),
1327
- 'url' => esc_url_raw( $install_url ),
1328
- 'nonce' => 'install-plugin_' . $slug,
1329
- 'plugin' => '',
1330
- 'api' => $api,
1331
- 'extra' => $extra,
1332
- );
1333
-
1334
- // $skin = new Automatic_Upgrader_Skin( $skin_args );
1335
- // $skin = new Plugin_Installer_Skin( $skin_args );
1336
- $skin = new WP_Ajax_Upgrader_Skin( $skin_args );
1337
-
1338
- // Create a new instance of Plugin_Upgrader.
1339
- $upgrader = new Plugin_Upgrader( $skin );
1340
-
1341
- // Perform the action and install the plugin from the $source urldecode().
1342
- add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
1343
-
1344
- $install_result = $upgrader->install( $source );
1345
-
1346
- remove_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1 );
1347
-
1348
- if ( is_wp_error( $install_result ) ) {
1349
- return array(
1350
- 'message' => $install_result->get_error_message(),
1351
- 'code' => $install_result->get_error_code(),
1352
- );
1353
- } elseif ( is_wp_error( $skin->result ) ) {
1354
- return array(
1355
- 'message' => $skin->result->get_error_message(),
1356
- 'code' => $skin->result->get_error_code(),
1357
- );
1358
- } elseif ( $skin->get_errors()->get_error_code() ) {
1359
- return array(
1360
- 'message' => $skin->get_error_messages(),
1361
- 'code' => 'unknown',
1362
- );
1363
- } elseif ( is_null( $install_result ) ) {
1364
- global $wp_filesystem;
1365
-
1366
- $error_code = 'unable_to_connect_to_filesystem';
1367
- $error_message = $this->_fs->get_text_inline( 'Unable to connect to the filesystem. Please confirm your credentials.' );
1368
-
1369
- // Pass through the error from WP_Filesystem if one was raised.
1370
- if ( $wp_filesystem instanceof WP_Filesystem_Base &&
1371
- is_wp_error( $wp_filesystem->errors ) &&
1372
- $wp_filesystem->errors->get_error_code()
1373
- ) {
1374
- $error_message = $wp_filesystem->errors->get_error_message();
1375
- }
1376
-
1377
- return array(
1378
- 'message' => $error_message,
1379
- 'code' => $error_code,
1380
- );
1381
- }
1382
-
1383
- // Grab the full path to the main plugin's file.
1384
- $plugin_activate = $upgrader->plugin_info();
1385
-
1386
- // Try to activate the plugin.
1387
- $activation_result = $this->try_activate_plugin( $plugin_activate );
1388
-
1389
- if ( is_wp_error( $activation_result ) ) {
1390
- return array(
1391
- 'message' => $activation_result->get_error_message(),
1392
- 'code' => $activation_result->get_error_code(),
1393
- );
1394
- }
1395
-
1396
- return $skin->get_upgrade_messages();
1397
- }
1398
-
1399
- /**
1400
- * Tries to activate a plugin. If fails, returns the error.
1401
- *
1402
- * @author Vova Feldman
1403
- * @since 1.2.1.7
1404
- *
1405
- * @param string $file_path Path within wp-plugins/ to main plugin file.
1406
- * This determines the styling of the output messages.
1407
- *
1408
- * @return bool|WP_Error
1409
- */
1410
- protected function try_activate_plugin( $file_path ) {
1411
- $activate = activate_plugin( $file_path, '', $this->_fs->is_network_active() );
1412
-
1413
- return is_wp_error( $activate ) ?
1414
- $activate :
1415
- true;
1416
- }
1417
-
1418
- /**
1419
- * Check if a premium module version is already active.
1420
- *
1421
- * @author Vova Feldman
1422
- * @since 1.2.1.7
1423
- *
1424
- * @param number|bool $plugin_id
1425
- *
1426
- * @return bool
1427
- */
1428
- private function is_premium_plugin_active( $plugin_id = false ) {
1429
- if ( $plugin_id != $this->_fs->get_id() ) {
1430
- return $this->_fs->is_addon_activated( $plugin_id, true );
1431
- }
1432
-
1433
- return is_plugin_active( $this->_fs->premium_plugin_basename() );
1434
- }
1435
-
1436
- /**
1437
- * Store the basename since it's not always available in the `_maybe_adjust_source_dir` method below.
1438
- *
1439
- * @author Leo Fajardo (@leorw)
1440
- * @since 2.2.1
1441
- *
1442
- * @param bool|WP_Error $response Response.
1443
- * @param array $hook_extra Extra arguments passed to hooked filters.
1444
- *
1445
- * @return bool|WP_Error
1446
- */
1447
- static function _store_basename_for_source_adjustment( $response, $hook_extra ) {
1448
- if ( isset( $hook_extra['plugin'] ) ) {
1449
- self::$_upgrade_basename = $hook_extra['plugin'];
1450
- } elseif ( isset( $hook_extra['theme'] ) ) {
1451
- self::$_upgrade_basename = $hook_extra['theme'];
1452
- } else {
1453
- self::$_upgrade_basename = null;
1454
- }
1455
-
1456
- return $response;
1457
- }
1458
-
1459
- /**
1460
- * Adjust the plugin directory name if necessary.
1461
- * Assumes plugin has a folder (not a single file plugin).
1462
- *
1463
- * The final destination directory of a plugin is based on the subdirectory name found in the
1464
- * (un)zipped source. In some cases this subdirectory name is not the same as the expected
1465
- * slug and the plugin will not be recognized as installed. This is fixed by adjusting
1466
- * the temporary unzipped source subdirectory name to the expected plugin slug.
1467
- *
1468
- * @author Vova Feldman
1469
- * @since 1.2.1.7
1470
- * @since 2.2.1 The method was converted to static since when the admin update bulk products via the Updates section, the logic applies the `upgrader_source_selection` filter for every product that is being updated.
1471
- *
1472
- * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
1473
- * @param string $remote_source Path to upgrade/zip-file-name.tmp.
1474
- * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
1475
- *
1476
- * @return string|WP_Error
1477
- */
1478
- static function _maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
1479
- if ( ! is_object( $GLOBALS['wp_filesystem'] ) ) {
1480
- return $source;
1481
- }
1482
-
1483
- $basename = self::$_upgrade_basename;
1484
- $is_theme = false;
1485
-
1486
- // Figure out what the slug is supposed to be.
1487
- if ( isset( $upgrader->skin->options['extra'] ) ) {
1488
- // Set by the auto-install logic.
1489
- $desired_slug = $upgrader->skin->options['extra']['slug'];
1490
- } elseif ( ! empty( $basename ) ) {
1491
- /**
1492
- * If it doesn't end with ".php", it's a theme.
1493
- *
1494
- * @author Leo Fajardo (@leorw)
1495
- * @since 2.2.1
1496
- */
1497
- $is_theme = ( ! fs_ends_with( $basename, '.php' ) );
1498
-
1499
- $desired_slug = ( ! $is_theme ) ?
1500
- dirname( $basename ) :
1501
- // Theme slug
1502
- $basename;
1503
- } else {
1504
- // Can't figure out the desired slug, stop the execution.
1505
- return $source;
1506
- }
1507
-
1508
- if ( is_multisite() ) {
1509
- /**
1510
- * If we are running in a multisite environment and the product is not network activated,
1511
- * the instance will not exist anyway. Therefore, try to update the source if necessary
1512
- * regardless if the Freemius instance of the product exists or not.
1513
- *
1514
- * @author Vova Feldman
1515
- */
1516
- } elseif ( ! empty( $basename ) ) {
1517
- $fs = Freemius::get_instance_by_file(
1518
- $basename,
1519
- $is_theme ?
1520
- WP_FS__MODULE_TYPE_THEME :
1521
- WP_FS__MODULE_TYPE_PLUGIN
1522
- );
1523
-
1524
- if ( ! is_object( $fs ) ) {
1525
- /**
1526
- * If the Freemius instance does not exist on a non-multisite network environment, it means that:
1527
- * 1. The product is not powered by Freemius; OR
1528
- * 2. The product is not activated, therefore, we don't mind if after the update the folder name will change.
1529
- *
1530
- * @author Leo Fajardo (@leorw)
1531
- * @since 2.2.1
1532
- */
1533
- return $source;
1534
- }
1535
- }
1536
-
1537
- $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
1538
-
1539
- if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1540
- $from_path = untrailingslashit( $source );
1541
- $to_path = trailingslashit( $remote_source ) . $desired_slug;
1542
-
1543
- if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
1544
- return trailingslashit( $to_path );
1545
- }
1546
-
1547
- return new WP_Error(
1548
- 'rename_failed',
1549
- fs_text_inline( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'module-package-rename-failure' ),
1550
- array(
1551
- 'found' => $subdir_name,
1552
- 'expected' => $desired_slug
1553
- )
1554
- );
1555
- }
1556
-
1557
- return $source;
1558
- }
1559
-
1560
- #endregion
1561
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.4
7
+ *
8
+ * @link https://github.com/easydigitaldownloads/EDD-License-handler/blob/master/EDD_SL_Plugin_Updater.php
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ class FS_Plugin_Updater {
16
+
17
+ /**
18
+ * @var Freemius
19
+ * @since 1.0.4
20
+ */
21
+ private $_fs;
22
+ /**
23
+ * @var FS_Logger
24
+ * @since 1.0.4
25
+ */
26
+ private $_logger;
27
+ /**
28
+ * @var object
29
+ * @since 1.1.8.1
30
+ */
31
+ private $_update_details;
32
+ /**
33
+ * @var array
34
+ * @since 2.1.2
35
+ */
36
+ private $_translation_updates;
37
+
38
+ private static $_upgrade_basename = null;
39
+
40
+ #--------------------------------------------------------------------------------
41
+ #region Singleton
42
+ #--------------------------------------------------------------------------------
43
+
44
+ /**
45
+ * @var FS_Plugin_Updater[]
46
+ * @since 2.0.0
47
+ */
48
+ private static $_INSTANCES = array();
49
+
50
+ /**
51
+ * @param Freemius $freemius
52
+ *
53
+ * @return FS_Plugin_Updater
54
+ */
55
+ static function instance( Freemius $freemius ) {
56
+ $key = $freemius->get_id();
57
+
58
+ if ( ! isset( self::$_INSTANCES[ $key ] ) ) {
59
+ self::$_INSTANCES[ $key ] = new self( $freemius );
60
+ }
61
+
62
+ return self::$_INSTANCES[ $key ];
63
+ }
64
+
65
+ #endregion
66
+
67
+ private function __construct( Freemius $freemius ) {
68
+ $this->_fs = $freemius;
69
+
70
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $freemius->get_slug() . '_updater', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
71
+
72
+ $this->filters();
73
+ }
74
+
75
+ /**
76
+ * Initiate required filters.
77
+ *
78
+ * @author Vova Feldman (@svovaf)
79
+ * @since 1.0.4
80
+ */
81
+ private function filters() {
82
+ // Override request for plugin information
83
+ add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );
84
+
85
+ $this->add_transient_filters();
86
+
87
+ /**
88
+ * If user has the premium plugin's code but do NOT have an active license,
89
+ * encourage him to upgrade by showing that there's a new release, but instead
90
+ * of showing an update link, show upgrade link to the pricing page.
91
+ *
92
+ * @since 1.1.6
93
+ *
94
+ */
95
+ // WP 2.9+
96
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
97
+ &$this,
98
+ 'catch_plugin_update_row'
99
+ ), 9 );
100
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
101
+ &$this,
102
+ 'edit_and_echo_plugin_update_row'
103
+ ), 11, 2 );
104
+
105
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
106
+ add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );
107
+ }
108
+
109
+ if ( ! WP_FS__IS_PRODUCTION_MODE ) {
110
+ add_filter( 'http_request_host_is_external', array(
111
+ $this,
112
+ 'http_request_host_is_external_filter'
113
+ ), 10, 3 );
114
+ }
115
+
116
+ if ( $this->_fs->is_premium() ) {
117
+ if ( ! $this->is_correct_folder_name() ) {
118
+ add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
119
+ }
120
+
121
+ add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
122
+ add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
123
+
124
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
125
+ add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
126
+ }
127
+ }
128
+ }
129
+
130
+ /**
131
+ * @author Leo Fajardo (@leorw)
132
+ * @since 2.1.4
133
+ */
134
+ function catch_plugin_information_dialog_contents() {
135
+ if (
136
+ 'plugin-information' !== fs_request_get( 'tab', false ) ||
137
+ $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
138
+ ) {
139
+ return;
140
+ }
141
+
142
+ add_action( 'admin_footer', array( &$this, 'edit_and_echo_plugin_information_dialog_contents' ), 0, 1 );
143
+
144
+ ob_start();
145
+ }
146
+
147
+ /**
148
+ * @author Leo Fajardo (@leorw)
149
+ * @since 2.1.4
150
+ *
151
+ * @param string $hook_suffix
152
+ */
153
+ function edit_and_echo_plugin_information_dialog_contents( $hook_suffix ) {
154
+ if (
155
+ 'plugin-information' !== fs_request_get( 'tab', false ) ||
156
+ $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
157
+ ) {
158
+ return;
159
+ }
160
+
161
+ $license = $this->_fs->_get_license();
162
+
163
+ $subscription = ( is_object( $license ) && ! $license->is_lifetime() ) ?
164
+ $this->_fs->_get_subscription( $license->id ) :
165
+ null;
166
+
167
+ $contents = ob_get_clean();
168
+
169
+ $update_button_id_attribute_pos = strpos( $contents, 'id="plugin_update_from_iframe"' );
170
+
171
+ if ( false !== $update_button_id_attribute_pos ) {
172
+ $update_button_start_pos = strrpos(
173
+ substr( $contents, 0, $update_button_id_attribute_pos ),
174
+ '<a'
175
+ );
176
+
177
+ $update_button_end_pos = ( strpos( $contents, '</a>', $update_button_id_attribute_pos ) + strlen( '</a>' ) );
178
+
179
+ /**
180
+ * The part of the contents without the update button.
181
+ *
182
+ * @author Leo Fajardo (@leorw)
183
+ * @since 2.2.5
184
+ */
185
+ $modified_contents = substr( $contents, 0, $update_button_start_pos );
186
+
187
+ $update_button = substr( $contents, $update_button_start_pos, ( $update_button_end_pos - $update_button_start_pos ) );
188
+
189
+ /**
190
+ * Replace the plugin information dialog's "Install Update Now" button's text and URL. If there's a license,
191
+ * the text will be "Renew license" and will link to the checkout page with the license's billing cycle
192
+ * and quota. If there's no license, the text will be "Buy license" and will link to the pricing page.
193
+ */
194
+ $update_button = preg_replace(
195
+ '/(\<a.+)(id="plugin_update_from_iframe")(.+href=")([^\s]+)(".*\>)(.+)(\<\/a>)/is',
196
+ is_object( $license ) ?
197
+ sprintf(
198
+ '$1$3%s$5%s$7',
199
+ $this->_fs->checkout_url(
200
+ is_object( $subscription ) ?
201
+ ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) :
202
+ WP_FS__PERIOD_LIFETIME,
203
+ false,
204
+ array( 'licenses' => $license->quota )
205
+ ),
206
+ fs_text_inline( 'Renew license', 'renew-license', $this->_fs->get_slug() )
207
+ ) :
208
+ sprintf(
209
+ '$1$3%s$5%s$7',
210
+ $this->_fs->pricing_url(),
211
+ fs_text_inline( 'Buy license', 'buy-license', $this->_fs->get_slug() )
212
+ ),
213
+ $update_button
214
+ );
215
+
216
+ /**
217
+ * Append the modified button.
218
+ *
219
+ * @author Leo Fajardo (@leorw)
220
+ * @since 2.2.5
221
+ */
222
+ $modified_contents .= $update_button;
223
+
224
+ /**
225
+ * Append the remaining part of the contents after the update button.
226
+ *
227
+ * @author Leo Fajardo (@leorw)
228
+ * @since 2.2.5
229
+ */
230
+ $modified_contents .= substr( $contents, $update_button_end_pos );
231
+
232
+ $contents = $modified_contents;
233
+ }
234
+
235
+ echo $contents;
236
+ }
237
+
238
+ /**
239
+ * @author Vova Feldman (@svovaf)
240
+ * @since 2.0.0
241
+ */
242
+ private function add_transient_filters() {
243
+ if ( $this->_fs->is_premium() && ! $this->_fs->is_tracking_allowed() ) {
244
+ $this->_logger->log( 'Opted out sites cannot receive automatic software updates.' );
245
+
246
+ return;
247
+ }
248
+
249
+ add_filter( 'pre_set_site_transient_update_plugins', array(
250
+ &$this,
251
+ 'pre_set_site_transient_update_plugins_filter'
252
+ ) );
253
+
254
+ add_filter( 'pre_set_site_transient_update_themes', array(
255
+ &$this,
256
+ 'pre_set_site_transient_update_plugins_filter'
257
+ ) );
258
+ }
259
+
260
+ /**
261
+ * @author Vova Feldman (@svovaf)
262
+ * @since 2.0.0
263
+ */
264
+ private function remove_transient_filters() {
265
+ remove_filter( 'pre_set_site_transient_update_plugins', array(
266
+ &$this,
267
+ 'pre_set_site_transient_update_plugins_filter'
268
+ ) );
269
+
270
+ remove_filter( 'pre_set_site_transient_update_themes', array(
271
+ &$this,
272
+ 'pre_set_site_transient_update_plugins_filter'
273
+ ) );
274
+ }
275
+
276
+ /**
277
+ * Capture plugin update row by turning output buffering.
278
+ *
279
+ * @author Vova Feldman (@svovaf)
280
+ * @since 1.1.6
281
+ */
282
+ function catch_plugin_update_row() {
283
+ ob_start();
284
+ }
285
+
286
+ /**
287
+ * Overrides default update message format with "renew your license" message.
288
+ *
289
+ * @author Vova Feldman (@svovaf)
290
+ * @since 1.1.6
291
+ *
292
+ * @param string $file
293
+ * @param array $plugin_data
294
+ */
295
+ function edit_and_echo_plugin_update_row( $file, $plugin_data ) {
296
+ $plugin_update_row = ob_get_clean();
297
+
298
+ $current = get_site_transient( 'update_plugins' );
299
+ if ( ! isset( $current->response[ $file ] ) ) {
300
+ echo $plugin_update_row;
301
+
302
+ return;
303
+ }
304
+
305
+ $r = $current->response[ $file ];
306
+
307
+ $has_beta_update = $this->_fs->has_beta_update();
308
+
309
+ if ( $this->_fs->has_any_active_valid_license() ) {
310
+ if ( $has_beta_update ) {
311
+ /**
312
+ * Turn the "new version" text into "new Beta version".
313
+ *
314
+ * Sample input:
315
+ * There is a new version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
316
+ * Output:
317
+ * There is a new Beta version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
318
+ *
319
+ * @author Leo Fajardo (@leorw)
320
+ * @since 2.3.0
321
+ */
322
+ $plugin_update_row = preg_replace(
323
+ '/(\<div.+>)(.+)(\<a.+href="([^\s]+)"([^\<]+)\>.+\<a.+)(\<\/div\>)/is',
324
+ (
325
+ '$1' .
326
+ sprintf(
327
+ fs_text_inline( 'There is a %s of %s available.', 'new-version-available', $this->_fs->get_slug() ),
328
+ $has_beta_update ?
329
+ fs_text_inline( 'new Beta version', 'new-beta-version', $this->_fs->get_slug() ) :
330
+ fs_text_inline( 'new version', 'new-version', $this->_fs->get_slug() ),
331
+ $this->_fs->get_plugin_title()
332
+ ) .
333
+ ' ' .
334
+ '$3' .
335
+ '$6'
336
+ ),
337
+ $plugin_update_row
338
+ );
339
+ }
340
+ } else {
341
+ /**
342
+ * Turn the "new version" text into a link that opens the plugin information dialog when clicked and
343
+ * make the "View version x details" text link to the checkout page instead of opening the plugin
344
+ * information dialog when clicked.
345
+ *
346
+ * Sample input:
347
+ * There is a new version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
348
+ * Output:
349
+ * There is a <a href="...>new version</a> of Awesome Plugin available. <a href="...>Buy a license now</a> to access version x.y.z security & feature updates, and support.
350
+ * OR
351
+ * There is a <a href="...>new Beta version</a> of Awesome Plugin available. <a href="...>Buy a license now</a> to access version x.y.z security & feature updates, and support.
352
+ *
353
+ * @author Leo Fajardo (@leorw)
354
+ */
355
+ $plugin_update_row = preg_replace(
356
+ '/(\<div.+>)(.+)(\<a.+href="([^\s]+)"([^\<]+)\>.+\<a.+)(\<\/div\>)/is',
357
+ (
358
+ '$1' .
359
+ sprintf(
360
+ fs_text_inline( 'There is a %s of %s available.', 'new-version-available', $this->_fs->get_slug() ),
361
+ sprintf(
362
+ '<a href="$4"%s>%s</a>',
363
+ '$5',
364
+ $has_beta_update ?
365
+ fs_text_inline( 'new Beta version', 'new-beta-version', $this->_fs->get_slug() ) :
366
+ fs_text_inline( 'new version', 'new-version', $this->_fs->get_slug() )
367
+ ),
368
+ $this->_fs->get_plugin_title()
369
+ ) .
370
+ ' ' .
371
+ $this->_fs->version_upgrade_checkout_link( $r->new_version ) .
372
+ '$6'
373
+ ),
374
+ $plugin_update_row
375
+ );
376
+ }
377
+
378
+ if (
379
+ $this->_fs->is_plugin() &&
380
+ isset( $r->upgrade_notice ) &&
381
+ strlen( trim( $r->upgrade_notice ) ) > 0
382
+ ) {
383
+ $slug = $this->_fs->get_slug();
384
+
385
+ $upgrade_notice_html = sprintf(
386
+ '<p class="notice fs-upgrade-notice fs-slug-%1$s fs-type-%2$s" data-slug="%1$s" data-type="%2$s"><strong>%3$s</strong> %4$s</p>',
387
+ $slug,
388
+ $this->_fs->get_module_type(),
389
+ fs_text_inline( 'Important Upgrade Notice:', 'upgrade_notice', $slug ),
390
+ esc_html( $r->upgrade_notice )
391
+ );
392
+
393
+ $plugin_update_row = str_replace( '</div>', '</div>' . $upgrade_notice_html, $plugin_update_row );
394
+ }
395
+
396
+ echo $plugin_update_row;
397
+ }
398
+
399
+ /**
400
+ * @author Leo Fajardo (@leorw)
401
+ * @since 2.0.2
402
+ *
403
+ * @param array $prepared_themes
404
+ *
405
+ * @return array
406
+ */
407
+ function change_theme_update_info_html( $prepared_themes ) {
408
+ $theme_basename = $this->_fs->get_plugin_basename();
409
+
410
+ if ( ! isset( $prepared_themes[ $theme_basename ] ) ) {
411
+ return $prepared_themes;
412
+ }
413
+
414
+ $themes_update = get_site_transient( 'update_themes' );
415
+ if ( ! isset( $themes_update->response[ $theme_basename ] ) ||
416
+ empty( $themes_update->response[ $theme_basename ]['package'] )
417
+ ) {
418
+ return $prepared_themes;
419
+ }
420
+
421
+ $prepared_themes[ $theme_basename ]['update'] = preg_replace(
422
+ '/(\<p.+>)(.+)(\<a.+\<a.+)\.(.+\<\/p\>)/is',
423
+ '$1 $2 ' . $this->_fs->version_upgrade_checkout_link( $themes_update->response[ $theme_basename ]['new_version'] ) .
424
+ '$4',
425
+ $prepared_themes[ $theme_basename ]['update']
426
+ );
427
+
428
+ // Set to false to prevent the "Update now" link for the context theme from being shown on the "Themes" page.
429
+ $prepared_themes[ $theme_basename ]['hasPackage'] = false;
430
+
431
+ return $prepared_themes;
432
+ }
433
+
434
+ /**
435
+ * Since WP version 3.6, a new security feature was added that denies access to repository with a local ip.
436
+ * During development mode we want to be able updating plugin versions via our localhost repository. This
437
+ * filter white-list all domains including "api.freemius".
438
+ *
439
+ * @link http://www.emanueletessore.com/wordpress-download-failed-valid-url-provided/
440
+ *
441
+ * @author Vova Feldman (@svovaf)
442
+ * @since 1.0.4
443
+ *
444
+ * @param bool $allow
445
+ * @param string $host
446
+ * @param string $url
447
+ *
448
+ * @return bool
449
+ */
450
+ function http_request_host_is_external_filter( $allow, $host, $url ) {
451
+ return ( false !== strpos( $host, 'freemius' ) ) ? true : $allow;
452
+ }
453
+
454
+ /**
455
+ * Check for Updates at the defined API endpoint and modify the update array.
456
+ *
457
+ * This function dives into the update api just when WordPress creates its update array,
458
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
459
+ * It is reassembled from parts of the native WordPress plugin update code.
460
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
461
+ *
462
+ * @author Vova Feldman (@svovaf)
463
+ * @since 1.0.4
464
+ *
465
+ * @uses FS_Api
466
+ *
467
+ * @param object $transient_data Update array build by WordPress.
468
+ *
469
+ * @return object Modified update array with custom plugin data.
470
+ */
471
+ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
472
+ $this->_logger->entrance();
473
+
474
+ /**
475
+ * "plugins" or "themes".
476
+ *
477
+ * @author Leo Fajardo (@leorw)
478
+ * @since 1.2.2
479
+ */
480
+ $module_type = $this->_fs->get_module_type() . 's';
481
+
482
+ /**
483
+ * Ensure that we don't mix plugins update info with themes update info.
484
+ *
485
+ * @author Leo Fajardo (@leorw)
486
+ * @since 1.2.2
487
+ */
488
+ if ( "pre_set_site_transient_update_{$module_type}" !== current_filter() ) {
489
+ return $transient_data;
490
+ }
491
+
492
+ if ( empty( $transient_data ) ||
493
+ defined( 'WP_FS__UNINSTALL_MODE' )
494
+ ) {
495
+ return $transient_data;
496
+ }
497
+
498
+ global $wp_current_filter;
499
+
500
+ $current_plugin_version = $this->_fs->get_plugin_version();
501
+
502
+ if ( ! empty( $wp_current_filter ) && 'upgrader_process_complete' === $wp_current_filter[0] ) {
503
+ if (
504
+ is_null( $this->_update_details ) ||
505
+ ( is_object( $this->_update_details ) && $this->_update_details->new_version !== $current_plugin_version )
506
+ ) {
507
+ /**
508
+ * After an update, clear the stored update details and reparse the plugin's main file in order to get
509
+ * the updated version's information and prevent the previous update information from showing up on the
510
+ * updates page.
511
+ *
512
+ * @author Leo Fajardo (@leorw)
513
+ * @since 2.3.1
514
+ */
515
+ $this->_update_details = null;
516
+ $current_plugin_version = $this->_fs->get_plugin_version( true );
517
+ }
518
+ }
519
+
520
+ if ( ! isset( $this->_update_details ) ) {
521
+ // Get plugin's newest update.
522
+ $new_version = $this->_fs->get_update(
523
+ false,
524
+ fs_request_get_bool( 'force-check' ),
525
+ WP_FS__TIME_24_HOURS_IN_SEC / 24,
526
+ $current_plugin_version
527
+ );
528
+
529
+ $this->_update_details = false;
530
+
531
+ if ( is_object( $new_version ) && $this->is_new_version_premium( $new_version ) ) {
532
+ $this->_logger->log( 'Found newer plugin version ' . $new_version->version );
533
+
534
+ /**
535
+ * Cache plugin details locally since set_site_transient( 'update_plugins' )
536
+ * called multiple times and the non wp.org plugins are filtered after the
537
+ * call to .org.
538
+ *
539
+ * @since 1.1.8.1
540
+ */
541
+ $this->_update_details = $this->get_update_details( $new_version );
542
+ }
543
+ }
544
+
545
+ // Alias.
546
+ $basename = $this->_fs->premium_plugin_basename();
547
+
548
+ if ( is_object( $this->_update_details ) ) {
549
+ if ( isset( $transient_data->no_update ) ) {
550
+ unset( $transient_data->no_update[ $basename ] );
551
+ }
552
+
553
+ if ( ! isset( $transient_data->response ) ) {
554
+ $transient_data->response = array();
555
+ }
556
+
557
+ // Add plugin to transient data.
558
+ $transient_data->response[ $basename ] = $this->_fs->is_plugin() ?
559
+ $this->_update_details :
560
+ (array) $this->_update_details;
561
+ } else {
562
+ if ( isset( $transient_data->response ) ) {
563
+ /**
564
+ * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
565
+ *
566
+ * @author Leo Fajardo (@leorw)
567
+ * @since 2.3.0
568
+ */
569
+ unset( $transient_data->response[ $basename ] );
570
+ }
571
+
572
+ if ( ! isset( $transient_data->no_update ) ) {
573
+ $transient_data->no_update = array();
574
+ }
575
+
576
+ /**
577
+ * Add product to no_update transient data to properly integrate with WP 5.5 auto-updates UI.
578
+ *
579
+ * @since 2.4.1
580
+ * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/
581
+ */
582
+ $transient_data->no_update[ $basename ] = $this->_fs->is_plugin() ?
583
+ (object) array(
584
+ 'id' => $basename,
585
+ 'slug' => $this->_fs->get_slug(),
586
+ 'plugin' => $basename,
587
+ 'new_version' => $this->_fs->get_plugin_version(),
588
+ 'url' => '',
589
+ 'package' => '',
590
+ 'icons' => array(),
591
+ 'banners' => array(),
592
+ 'banners_rtl' => array(),
593
+ 'tested' => '',
594
+ 'requires_php' => '',
595
+ 'compatibility' => new stdClass(),
596
+ ) :
597
+ array(
598
+ 'theme' => $basename,
599
+ 'new_version' => $this->_fs->get_plugin_version(),
600
+ 'url' => '',
601
+ 'package' => '',
602
+ 'requires' => '',
603
+ 'requires_php' => '',
604
+ );
605
+ }
606
+
607
+ $slug = $this->_fs->get_slug();
608
+
609
+ if ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() ) {
610
+ if ( ! isset( $this->_translation_updates ) ) {
611
+ $this->_translation_updates = array();
612
+
613
+ if ( current_user_can( 'update_languages' ) ) {
614
+ $translation_updates = $this->fetch_wp_org_module_translation_updates( $module_type, $slug );
615
+ if ( ! empty( $translation_updates ) ) {
616
+ $this->_translation_updates = $translation_updates;
617
+ }
618
+ }
619
+ }
620
+
621
+ if ( ! empty( $this->_translation_updates ) ) {
622
+ $all_translation_updates = ( isset( $transient_data->translations ) && is_array( $transient_data->translations ) ) ?
623
+ $transient_data->translations :
624
+ array();
625
+
626
+ $current_plugin_translation_updates_map = array();
627
+ foreach ( $all_translation_updates as $key => $translation_update ) {
628
+ if ( $module_type === ( $translation_update['type'] . 's' ) && $slug === $translation_update['slug'] ) {
629
+ $current_plugin_translation_updates_map[ $translation_update['language'] ] = $translation_update;
630
+ unset( $all_translation_updates[ $key ] );
631
+ }
632
+ }
633
+
634
+ foreach ( $this->_translation_updates as $translation_update ) {
635
+ $lang = $translation_update['language'];
636
+ if ( ! isset( $current_plugin_translation_updates_map[ $lang ] ) ||
637
+ version_compare( $translation_update['version'], $current_plugin_translation_updates_map[ $lang ]['version'], '>' )
638
+ ) {
639
+ $current_plugin_translation_updates_map[ $lang ] = $translation_update;
640
+ }
641
+ }
642
+
643
+ $transient_data->translations = array_merge( $all_translation_updates, array_values( $current_plugin_translation_updates_map ) );
644
+ }
645
+ }
646
+
647
+ return $transient_data;
648
+ }
649
+
650
+ /**
651
+ * Get module's required data for the updates mechanism.
652
+ *
653
+ * @author Vova Feldman (@svovaf)
654
+ * @since 2.0.0
655
+ *
656
+ * @param \FS_Plugin_Tag $new_version
657
+ *
658
+ * @return object
659
+ */
660
+ function get_update_details( FS_Plugin_Tag $new_version ) {
661
+ $update = new stdClass();
662
+ $update->slug = $this->_fs->get_slug();
663
+ $update->new_version = $new_version->version;
664
+ $update->url = WP_FS__ADDRESS;
665
+ $update->package = $new_version->url;
666
+ $update->tested = $new_version->tested_up_to_version;
667
+ $update->requires = $new_version->requires_platform_version;
668
+
669
+ $icon = $this->_fs->get_local_icon_url();
670
+
671
+ if ( ! empty( $icon ) ) {
672
+ $update->icons = array(
673
+ // '1x' => $icon,
674
+ // '2x' => $icon,
675
+ 'default' => $icon,
676
+ );
677
+ }
678
+
679
+ if ( $this->_fs->is_premium() ) {
680
+ $latest_tag = $this->_fs->_fetch_latest_version( $this->_fs->get_id(), false );
681
+
682
+ if (
683
+ isset( $latest_tag->readme ) &&
684
+ isset( $latest_tag->readme->upgrade_notice ) &&
685
+ ! empty( $latest_tag->readme->upgrade_notice )
686
+ ) {
687
+ $update->upgrade_notice = $latest_tag->readme->upgrade_notice;
688
+ }
689
+ }
690
+
691
+ $update->{$this->_fs->get_module_type()} = $this->_fs->get_plugin_basename();
692
+
693
+ return $update;
694
+ }
695
+
696
+ /**
697
+ * @author Leo Fajardo (@leorw)
698
+ * @since 2.3.0
699
+ *
700
+ * @param FS_Plugin_Tag $new_version
701
+ *
702
+ * @return bool
703
+ */
704
+ private function is_new_version_premium( FS_Plugin_Tag $new_version ) {
705
+ $query_str = parse_url( $new_version->url, PHP_URL_QUERY );
706
+ if ( empty( $query_str ) ) {
707
+ return false;
708
+ }
709
+
710
+ parse_str( $query_str, $params );
711
+
712
+ return ( isset( $params['is_premium'] ) && 'true' == $params['is_premium'] );
713
+ }
714
+
715
+ /**
716
+ * Update the updates transient with the module's update information.
717
+ *
718
+ * This method is required for multisite environment.
719
+ * If a module is site activated (not network) and not on the main site,
720
+ * the module will NOT be executed on the network level, therefore, the
721
+ * custom updates logic will not be executed as well, so unless we force
722
+ * the injection of the update into the updates transient, premium updates
723
+ * will not work.
724
+ *
725
+ * @author Vova Feldman (@svovaf)
726
+ * @since 2.0.0
727
+ *
728
+ * @param \FS_Plugin_Tag $new_version
729
+ */
730
+ function set_update_data( FS_Plugin_Tag $new_version ) {
731
+ $this->_logger->entrance();
732
+
733
+ if ( ! $this->is_new_version_premium( $new_version ) ) {
734
+ return;
735
+ }
736
+
737
+ $transient_key = "update_{$this->_fs->get_module_type()}s";
738
+
739
+ $transient_data = get_site_transient( $transient_key );
740
+
741
+ $transient_data = is_object( $transient_data ) ?
742
+ $transient_data :
743
+ new stdClass();
744
+
745
+ // Alias.
746
+ $basename = $this->_fs->get_plugin_basename();
747
+ $is_plugin = $this->_fs->is_plugin();
748
+
749
+ if ( ! isset( $transient_data->response ) ||
750
+ ! is_array( $transient_data->response )
751
+ ) {
752
+ $transient_data->response = array();
753
+ } elseif ( ! empty( $transient_data->response[ $basename ] ) ) {
754
+ $version = $is_plugin ?
755
+ ( ! empty( $transient_data->response[ $basename ]->new_version ) ?
756
+ $transient_data->response[ $basename ]->new_version :
757
+ null
758
+ ) : ( ! empty( $transient_data->response[ $basename ]['new_version'] ) ?
759
+ $transient_data->response[ $basename ]['new_version'] :
760
+ null
761
+ );
762
+
763
+ if ( $version == $new_version->version ) {
764
+ // The update data is already set.
765
+ return;
766
+ }
767
+ }
768
+
769
+ // Remove the added filters.
770
+ $this->remove_transient_filters();
771
+
772
+ $this->_update_details = $this->get_update_details( $new_version );
773
+
774
+ // Set update data in transient.
775
+ $transient_data->response[ $basename ] = $is_plugin ?
776
+ $this->_update_details :
777
+ (array) $this->_update_details;
778
+
779
+ if ( ! isset( $transient_data->checked ) ||
780
+ ! is_array( $transient_data->checked )
781
+ ) {
782
+ $transient_data->checked = array();
783
+ }
784
+
785
+ // Flag the module as if it was already checked.
786
+ $transient_data->checked[ $basename ] = $this->_fs->get_plugin_version();
787
+ $transient_data->last_checked = time();
788
+
789
+ set_site_transient( $transient_key, $transient_data );
790
+
791
+ $this->add_transient_filters();
792
+ }
793
+
794
+ /**
795
+ * @author Leo Fajardo (@leorw)
796
+ * @since 2.0.2
797
+ */
798
+ function delete_update_data() {
799
+ $this->_logger->entrance();
800
+
801
+ $transient_key = "update_{$this->_fs->get_module_type()}s";
802
+
803
+ $transient_data = get_site_transient( $transient_key );
804
+
805
+ // Alias
806
+ $basename = $this->_fs->get_plugin_basename();
807
+
808
+ if ( ! is_object( $transient_data ) ||
809
+ ! isset( $transient_data->response ) ||
810
+ ! is_array( $transient_data->response ) ||
811
+ empty( $transient_data->response[ $basename ] )
812
+ ) {
813
+ return;
814
+ }
815
+
816
+ unset( $transient_data->response[ $basename ] );
817
+
818
+ // Remove the added filters.
819
+ $this->remove_transient_filters();
820
+
821
+ set_site_transient( $transient_key, $transient_data );
822
+
823
+ $this->add_transient_filters();
824
+ }
825
+
826
+ /**
827
+ * Try to fetch plugin's info from .org repository.
828
+ *
829
+ * @author Vova Feldman (@svovaf)
830
+ * @since 1.0.5
831
+ *
832
+ * @param string $action
833
+ * @param object $args
834
+ *
835
+ * @return bool|mixed
836
+ */
837
+ static function _fetch_plugin_info_from_repository( $action, $args ) {
838
+ $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
839
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
840
+ $url = set_url_scheme( $url, 'https' );
841
+ }
842
+
843
+ $args = array(
844
+ 'timeout' => 15,
845
+ 'body' => array(
846
+ 'action' => $action,
847
+ 'request' => serialize( $args )
848
+ )
849
+ );
850
+
851
+ $request = wp_remote_post( $url, $args );
852
+
853
+ if ( is_wp_error( $request ) ) {
854
+ return false;
855
+ }
856
+
857
+ $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
858
+
859
+ if ( ! is_object( $res ) && ! is_array( $res ) ) {
860
+ return false;
861
+ }
862
+
863
+ return $res;
864
+ }
865
+
866
+ /**
867
+ * Fetches module translation updates from wordpress.org.
868
+ *
869
+ * @author Leo Fajardo (@leorw)
870
+ * @since 2.1.2
871
+ *
872
+ * @param string $module_type
873
+ * @param string $slug
874
+ *
875
+ * @return array|null
876
+ */
877
+ private function fetch_wp_org_module_translation_updates( $module_type, $slug ) {
878
+ $plugin_data = $this->_fs->get_plugin_data();
879
+
880
+ $locales = array_values( get_available_languages() );
881
+ $locales = apply_filters( "{$module_type}_update_check_locales", $locales );
882
+ $locales = array_unique( $locales );
883
+
884
+ $plugin_basename = $this->_fs->get_plugin_basename();
885
+ if ( 'themes' === $module_type ) {
886
+ $plugin_basename = $slug;
887
+ }
888
+
889
+ global $wp_version;
890
+
891
+ $request_args = array(
892
+ 'timeout' => 15,
893
+ 'body' => array(
894
+ "{$module_type}" => json_encode(
895
+ array(
896
+ "{$module_type}" => array(
897
+ $plugin_basename => array(
898
+ 'Name' => trim( str_replace( $this->_fs->get_plugin()->premium_suffix, '', $plugin_data['Name'] ) ),
899
+ 'Author' => $plugin_data['Author'],
900
+ )
901
+ )
902
+ )
903
+ ),
904
+ 'translations' => json_encode( $this->get_installed_translations( $module_type, $slug ) ),
905
+ 'locale' => json_encode( $locales )
906
+ ),
907
+ 'user-agent' => ( 'WordPress/' . $wp_version . '; ' . home_url( '/' ) )
908
+ );
909
+
910
+ $url = "http://api.wordpress.org/{$module_type}/update-check/1.1/";
911
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
912
+ $url = set_url_scheme( $url, 'https' );
913
+ }
914
+
915
+ $raw_response = Freemius::safe_remote_post(
916
+ $url,
917
+ $request_args,
918
+ WP_FS__TIME_24_HOURS_IN_SEC,
919
+ WP_FS__TIME_12_HOURS_IN_SEC,
920
+ false
921
+ );
922
+
923
+ if ( is_wp_error( $raw_response ) ) {
924
+ return null;
925
+ }
926
+
927
+ $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
928
+
929
+ if ( ! is_array( $response ) ) {
930
+ return null;
931
+ }
932
+
933
+ if ( ! isset( $response['translations'] ) || empty( $response['translations'] ) ) {
934
+ return null;
935
+ }
936
+
937
+ return $response['translations'];
938
+ }
939
+
940
+ /**
941
+ * @author Leo Fajardo (@leorw)
942
+ * @since 2.1.2
943
+ *
944
+ * @param string $module_type
945
+ * @param string $slug
946
+ *
947
+ * @return array
948
+ */
949
+ private function get_installed_translations( $module_type, $slug ) {
950
+ if ( function_exists( 'wp_get_installed_translations' ) ) {
951
+ return wp_get_installed_translations( $module_type );
952
+ }
953
+
954
+ $dir = "/{$module_type}";
955
+
956
+ if ( ! is_dir( WP_LANG_DIR . $dir ) )
957
+ return array();
958
+
959
+ $files = scandir( WP_LANG_DIR . $dir );
960
+ if ( ! $files )
961
+ return array();
962
+
963
+ $language_data = array();
964
+
965
+ foreach ( $files as $file ) {
966
+ if ( 0 !== strpos( $file, $slug ) ) {
967
+ continue;
968
+ }
969
+
970
+ if ( '.' === $file[0] || is_dir( WP_LANG_DIR . "{$dir}/{$file}" ) ) {
971
+ continue;
972
+ }
973
+
974
+ if ( substr( $file, -3 ) !== '.po' ) {
975
+ continue;
976
+ }
977
+
978
+ if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
979
+ continue;
980
+ }
981
+
982
+ if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) {
983
+ continue;
984
+ }
985
+
986
+ list( , $textdomain, $language ) = $match;
987
+
988
+ if ( '' === $textdomain ) {
989
+ $textdomain = 'default';
990
+ }
991
+
992
+ $language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( WP_LANG_DIR . "{$dir}/{$file}" );
993
+ }
994
+
995
+ return $language_data;
996
+ }
997
+
998
+ /**
999
+ * Updates information on the "View version x.x details" page with custom data.
1000
+ *
1001
+ * @author Vova Feldman (@svovaf)
1002
+ * @since 1.0.4
1003
+ *
1004
+ * @uses FS_Api
1005
+ *
1006
+ * @param object $data
1007
+ * @param string $action
1008
+ * @param mixed $args
1009
+ *
1010
+ * @return object
1011
+ */
1012
+ function plugins_api_filter( $data, $action = '', $args = null ) {
1013
+ $this->_logger->entrance();
1014
+
1015
+ if ( ( 'plugin_information' !== $action ) ||
1016
+ ! isset( $args->slug )
1017
+ ) {
1018
+ return $data;
1019
+ }
1020
+
1021
+ $addon = false;
1022
+ $is_addon = false;
1023
+ $addon_version = false;
1024
+
1025
+ if ( $this->_fs->get_slug() !== $args->slug ) {
1026
+ $addon = $this->_fs->get_addon_by_slug( $args->slug );
1027
+
1028
+ if ( ! is_object( $addon ) ) {
1029
+ return $data;
1030
+ }
1031
+
1032
+ if ( $this->_fs->is_addon_activated( $addon->id ) ) {
1033
+ $addon_version = $this->_fs->get_addon_instance( $addon->id )->get_plugin_version();
1034
+ } elseif ( $this->_fs->is_addon_installed( $addon->id ) ) {
1035
+ $addon_plugin_data = get_plugin_data(
1036
+ ( WP_PLUGIN_DIR . '/' . $this->_fs->get_addon_basename( $addon->id ) ),
1037
+ false,
1038
+ false
1039
+ );
1040
+
1041
+ if ( ! empty( $addon_plugin_data ) ) {
1042
+ $addon_version = $addon_plugin_data['Version'];
1043
+ }
1044
+ }
1045
+
1046
+ $is_addon = true;
1047
+ }
1048
+
1049
+ $plugin_in_repo = false;
1050
+ if ( ! $is_addon ) {
1051
+ // Try to fetch info from .org repository.
1052
+ $data = self::_fetch_plugin_info_from_repository( $action, $args );
1053
+
1054
+ $plugin_in_repo = ( false !== $data );
1055
+ }
1056
+
1057
+ if ( ! $plugin_in_repo ) {
1058
+ $data = $args;
1059
+
1060
+ // Fetch as much as possible info from local files.
1061
+ $plugin_local_data = $this->_fs->get_plugin_data();
1062
+ $data->name = $plugin_local_data['Name'];
1063
+ $data->author = $plugin_local_data['Author'];
1064
+ $data->sections = array(
1065
+ 'description' => 'Upgrade ' . $plugin_local_data['Name'] . ' to latest.',
1066
+ );
1067
+
1068
+ // @todo Store extra plugin info on Freemius or parse readme.txt markup.
1069
+ /*$info = $this->_fs->get_api_site_scope()->call('/information.json');
1070
+
1071
+ if ( !isset($info->error) ) {
1072
+ $data = $info;
1073
+ }*/
1074
+ }
1075
+
1076
+ $plugin_version = $is_addon ?
1077
+ $addon_version :
1078
+ $this->_fs->get_plugin_version();
1079
+
1080
+ // Get plugin's newest update.
1081
+ $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version );
1082
+
1083
+ if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
1084
+ $data->version = $plugin_version;
1085
+ } else {
1086
+ if ( $is_addon ) {
1087
+ $data->name = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
1088
+ $data->slug = $addon->slug;
1089
+ $data->url = WP_FS__ADDRESS;
1090
+ $data->package = $new_version->url;
1091
+ }
1092
+
1093
+ if ( ! $plugin_in_repo ) {
1094
+ $data->last_updated = ! is_null( $new_version->updated ) ? $new_version->updated : $new_version->created;
1095
+ $data->requires = $new_version->requires_platform_version;
1096
+ $data->tested = $new_version->tested_up_to_version;
1097
+ }
1098
+
1099
+ $data->version = $new_version->version;
1100
+ $data->download_link = $new_version->url;
1101
+
1102
+ if ( isset( $new_version->readme ) && is_object( $new_version->readme ) ) {
1103
+ $new_version_readme_data = $new_version->readme;
1104
+ if ( isset( $new_version_readme_data->sections ) ) {
1105
+ $new_version_readme_data->sections = (array) $new_version_readme_data->sections;
1106
+ } else {
1107
+ $new_version_readme_data->sections = array();
1108
+ }
1109
+
1110
+ if ( isset( $data->sections ) ) {
1111
+ if ( isset( $data->sections['screenshots'] ) ) {
1112
+ $new_version_readme_data->sections['screenshots'] = $data->sections['screenshots'];
1113
+ }
1114
+
1115
+ if ( isset( $data->sections['reviews'] ) ) {
1116
+ $new_version_readme_data->sections['reviews'] = $data->sections['reviews'];
1117
+ }
1118
+ }
1119
+
1120
+ if ( isset( $new_version_readme_data->banners ) ) {
1121
+ $new_version_readme_data->banners = (array) $new_version_readme_data->banners;
1122
+ } elseif ( isset( $data->banners ) ) {
1123
+ $new_version_readme_data->banners = $data->banners;
1124
+ }
1125
+
1126
+ $wp_org_sections = array(
1127
+ 'author',
1128
+ 'author_profile',
1129
+ 'rating',
1130
+ 'ratings',
1131
+ 'num_ratings',
1132
+ 'support_threads',
1133
+ 'support_threads_resolved',
1134
+ 'active_installs',
1135
+ 'added',
1136
+ 'homepage'
1137
+ );
1138
+
1139
+ foreach ( $wp_org_sections as $wp_org_section ) {
1140
+ if ( isset( $data->{$wp_org_section} ) ) {
1141
+ $new_version_readme_data->{$wp_org_section} = $data->{$wp_org_section};
1142
+ }
1143
+ }
1144
+
1145
+ $data = $new_version_readme_data;
1146
+ }
1147
+ }
1148
+
1149
+ return $data;
1150
+ }
1151
+
1152
+ /**
1153
+ * @author Vova Feldman (@svovaf)
1154
+ * @since 1.2.1.7
1155
+ *
1156
+ * @param number|bool $addon_id
1157
+ * @param bool|string $newer_than Since 2.2.1
1158
+ * @param bool|string $fetch_readme Since 2.2.1
1159
+ *
1160
+ * @return object
1161
+ */
1162
+ private function get_latest_download_details( $addon_id = false, $newer_than = false, $fetch_readme = true ) {
1163
+ return $this->_fs->_fetch_latest_version( $addon_id, true, WP_FS__TIME_24_HOURS_IN_SEC, $newer_than, $fetch_readme );
1164
+ }
1165
+
1166
+ /**
1167
+ * Checks if a given basename has a matching folder name
1168
+ * with the current context plugin.
1169
+ *
1170
+ * @author Vova Feldman (@svovaf)
1171
+ * @since 1.2.1.6
1172
+ *
1173
+ * @return bool
1174
+ */
1175
+ private function is_correct_folder_name() {
1176
+ return ( $this->_fs->get_target_folder_name() == trim( dirname( $this->_fs->get_plugin_basename() ), '/\\' ) );
1177
+ }
1178
+
1179
+ /**
1180
+ * This is a special after upgrade handler for migrating modules
1181
+ * that didn't use the '-premium' suffix folder structure before
1182
+ * the migration.
1183
+ *
1184
+ * @author Vova Feldman (@svovaf)
1185
+ * @since 1.2.1.6
1186
+ *
1187
+ * @param bool $response Install response.
1188
+ * @param array $hook_extra Extra arguments passed to hooked filters.
1189
+ * @param array $result Installation result data.
1190
+ *
1191
+ * @return bool
1192
+ */
1193
+ function _maybe_update_folder_name( $response, $hook_extra, $result ) {
1194
+ $basename = $this->_fs->get_plugin_basename();
1195
+
1196
+ if ( true !== $response ||
1197
+ empty( $hook_extra ) ||
1198
+ empty( $hook_extra['plugin'] ) ||
1199
+ $basename !== $hook_extra['plugin']
1200
+ ) {
1201
+ return $response;
1202
+ }
1203
+
1204
+ $active_plugins_basenames = get_option( 'active_plugins' );
1205
+
1206
+ foreach ( $active_plugins_basenames as $key => $active_plugin_basename ) {
1207
+ if ( $basename === $active_plugin_basename ) {
1208
+ // Get filename including extension.
1209
+ $filename = basename( $basename );
1210
+
1211
+ $new_basename = plugin_basename(
1212
+ trailingslashit( $this->_fs->is_premium() ? $this->_fs->get_premium_slug() : $this->_fs->get_slug() ) .
1213
+ $filename
1214
+ );
1215
+
1216
+ // Verify that the expected correct path exists.
1217
+ if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $new_basename ) ) ) {
1218
+ // Override active plugin name.
1219
+ $active_plugins_basenames[ $key ] = $new_basename;
1220
+ update_option( 'active_plugins', $active_plugins_basenames );
1221
+ }
1222
+
1223
+ break;
1224
+ }
1225
+ }
1226
+
1227
+ return $response;
1228
+ }
1229
+
1230
+ #----------------------------------------------------------------------------------
1231
+ #region Auto Activation
1232
+ #----------------------------------------------------------------------------------
1233
+
1234
+ /**
1235
+ * Installs and active a plugin when explicitly requested that from a 3rd party service.
1236
+ *
1237
+ * This logic was inspired by the TGMPA GPL licensed library by Thomas Griffin.
1238
+ *
1239
+ * @link http://tgmpluginactivation.com/
1240
+ *
1241
+ * @author Vova Feldman
1242
+ * @since 1.2.1.7
1243
+ *
1244
+ * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/
1245
+ *
1246
+ * @uses WP_Filesystem
1247
+ * @uses WP_Error
1248
+ * @uses WP_Upgrader
1249
+ * @uses Plugin_Upgrader
1250
+ * @uses Plugin_Installer_Skin
1251
+ * @uses Plugin_Upgrader_Skin
1252
+ *
1253
+ * @param number|bool $plugin_id
1254
+ *
1255
+ * @return array
1256
+ */
1257
+ function install_and_activate_plugin( $plugin_id = false ) {
1258
+ if ( ! empty( $plugin_id ) && ! FS_Plugin::is_valid_id( $plugin_id ) ) {
1259
+ // Invalid plugin ID.
1260
+ return array(
1261
+ 'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
1262
+ 'code' => 'invalid_module_id',
1263
+ );
1264
+ }
1265
+
1266
+ $is_addon = false;
1267
+ if ( FS_Plugin::is_valid_id( $plugin_id ) &&
1268
+ $plugin_id != $this->_fs->get_id()
1269
+ ) {
1270
+ $addon = $this->_fs->get_addon( $plugin_id );
1271
+
1272
+ if ( ! is_object( $addon ) ) {
1273
+ // Invalid add-on ID.
1274
+ return array(
1275
+ 'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
1276
+ 'code' => 'invalid_module_id',
1277
+ );
1278
+ }
1279
+
1280
+ $slug = $addon->slug;
1281
+ $premium_slug = $addon->premium_slug;
1282
+ $title = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
1283
+
1284
+ $is_addon = true;
1285
+ } else {
1286
+ $slug = $this->_fs->get_slug();
1287
+ $premium_slug = $this->_fs->get_premium_slug();
1288
+ $title = $this->_fs->get_plugin_title() .
1289
+ ( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' ) : '' );
1290
+ }
1291
+
1292
+ if ( $this->is_premium_plugin_active( $plugin_id ) ) {
1293
+ // Premium version already activated.
1294
+ return array(
1295
+ 'message' => $is_addon ?
1296
+ $this->_fs->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ) :
1297
+ $this->_fs->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ),
1298
+ 'code' => 'premium_installed',
1299
+ );
1300
+ }
1301
+
1302
+ $latest_version = $this->get_latest_download_details( $plugin_id, false, false );
1303
+ $target_folder = $premium_slug;
1304
+
1305
+ // Prep variables for Plugin_Installer_Skin class.
1306
+ $extra = array();
1307
+ $extra['slug'] = $target_folder;
1308
+ $source = $latest_version->url;
1309
+ $api = null;
1310
+
1311
+ $install_url = add_query_arg(
1312
+ array(
1313
+ 'action' => 'install-plugin',
1314
+ 'plugin' => urlencode( $slug ),
1315
+ ),
1316
+ 'update.php'
1317
+ );
1318
+
1319
+ if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
1320
+ // Include required resources for the installation.
1321
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1322
+ }
1323
+
1324
+ $skin_args = array(
1325
+ 'type' => 'web',
1326
+ 'title' => sprintf( $this->_fs->get_text_inline( 'Installing plugin: %s', 'installing-plugin-x' ), $title ),
1327
+ 'url' => esc_url_raw( $install_url ),
1328
+ 'nonce' => 'install-plugin_' . $slug,
1329
+ 'plugin' => '',
1330
+ 'api' => $api,
1331
+ 'extra' => $extra,
1332
+ );
1333
+
1334
+ // $skin = new Automatic_Upgrader_Skin( $skin_args );
1335
+ // $skin = new Plugin_Installer_Skin( $skin_args );
1336
+ $skin = new WP_Ajax_Upgrader_Skin( $skin_args );
1337
+
1338
+ // Create a new instance of Plugin_Upgrader.
1339
+ $upgrader = new Plugin_Upgrader( $skin );
1340
+
1341
+ // Perform the action and install the plugin from the $source urldecode().
1342
+ add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
1343
+
1344
+ $install_result = $upgrader->install( $source );
1345
+
1346
+ remove_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1 );
1347
+
1348
+ if ( is_wp_error( $install_result ) ) {
1349
+ return array(
1350
+ 'message' => $install_result->get_error_message(),
1351
+ 'code' => $install_result->get_error_code(),
1352
+ );
1353
+ } elseif ( is_wp_error( $skin->result ) ) {
1354
+ return array(
1355
+ 'message' => $skin->result->get_error_message(),
1356
+ 'code' => $skin->result->get_error_code(),
1357
+ );
1358
+ } elseif ( $skin->get_errors()->get_error_code() ) {
1359
+ return array(
1360
+ 'message' => $skin->get_error_messages(),
1361
+ 'code' => 'unknown',
1362
+ );
1363
+ } elseif ( is_null( $install_result ) ) {
1364
+ global $wp_filesystem;
1365
+
1366
+ $error_code = 'unable_to_connect_to_filesystem';
1367
+ $error_message = $this->_fs->get_text_inline( 'Unable to connect to the filesystem. Please confirm your credentials.' );
1368
+
1369
+ // Pass through the error from WP_Filesystem if one was raised.
1370
+ if ( $wp_filesystem instanceof WP_Filesystem_Base &&
1371
+ is_wp_error( $wp_filesystem->errors ) &&
1372
+ $wp_filesystem->errors->get_error_code()
1373
+ ) {
1374
+ $error_message = $wp_filesystem->errors->get_error_message();
1375
+ }
1376
+
1377
+ return array(
1378
+ 'message' => $error_message,
1379
+ 'code' => $error_code,
1380
+ );
1381
+ }
1382
+
1383
+ // Grab the full path to the main plugin's file.
1384
+ $plugin_activate = $upgrader->plugin_info();
1385
+
1386
+ // Try to activate the plugin.
1387
+ $activation_result = $this->try_activate_plugin( $plugin_activate );
1388
+
1389
+ if ( is_wp_error( $activation_result ) ) {
1390
+ return array(
1391
+ 'message' => $activation_result->get_error_message(),
1392
+ 'code' => $activation_result->get_error_code(),
1393
+ );
1394
+ }
1395
+
1396
+ return $skin->get_upgrade_messages();
1397
+ }
1398
+
1399
+ /**
1400
+ * Tries to activate a plugin. If fails, returns the error.
1401
+ *
1402
+ * @author Vova Feldman
1403
+ * @since 1.2.1.7
1404
+ *
1405
+ * @param string $file_path Path within wp-plugins/ to main plugin file.
1406
+ * This determines the styling of the output messages.
1407
+ *
1408
+ * @return bool|WP_Error
1409
+ */
1410
+ protected function try_activate_plugin( $file_path ) {
1411
+ $activate = activate_plugin( $file_path, '', $this->_fs->is_network_active() );
1412
+
1413
+ return is_wp_error( $activate ) ?
1414
+ $activate :
1415
+ true;
1416
+ }
1417
+
1418
+ /**
1419
+ * Check if a premium module version is already active.
1420
+ *
1421
+ * @author Vova Feldman
1422
+ * @since 1.2.1.7
1423
+ *
1424
+ * @param number|bool $plugin_id
1425
+ *
1426
+ * @return bool
1427
+ */
1428
+ private function is_premium_plugin_active( $plugin_id = false ) {
1429
+ if ( $plugin_id != $this->_fs->get_id() ) {
1430
+ return $this->_fs->is_addon_activated( $plugin_id, true );
1431
+ }
1432
+
1433
+ return is_plugin_active( $this->_fs->premium_plugin_basename() );
1434
+ }
1435
+
1436
+ /**
1437
+ * Store the basename since it's not always available in the `_maybe_adjust_source_dir` method below.
1438
+ *
1439
+ * @author Leo Fajardo (@leorw)
1440
+ * @since 2.2.1
1441
+ *
1442
+ * @param bool|WP_Error $response Response.
1443
+ * @param array $hook_extra Extra arguments passed to hooked filters.
1444
+ *
1445
+ * @return bool|WP_Error
1446
+ */
1447
+ static function _store_basename_for_source_adjustment( $response, $hook_extra ) {
1448
+ if ( isset( $hook_extra['plugin'] ) ) {
1449
+ self::$_upgrade_basename = $hook_extra['plugin'];
1450
+ } elseif ( isset( $hook_extra['theme'] ) ) {
1451
+ self::$_upgrade_basename = $hook_extra['theme'];
1452
+ } else {
1453
+ self::$_upgrade_basename = null;
1454
+ }
1455
+
1456
+ return $response;
1457
+ }
1458
+
1459
+ /**
1460
+ * Adjust the plugin directory name if necessary.
1461
+ * Assumes plugin has a folder (not a single file plugin).
1462
+ *
1463
+ * The final destination directory of a plugin is based on the subdirectory name found in the
1464
+ * (un)zipped source. In some cases this subdirectory name is not the same as the expected
1465
+ * slug and the plugin will not be recognized as installed. This is fixed by adjusting
1466
+ * the temporary unzipped source subdirectory name to the expected plugin slug.
1467
+ *
1468
+ * @author Vova Feldman
1469
+ * @since 1.2.1.7
1470
+ * @since 2.2.1 The method was converted to static since when the admin update bulk products via the Updates section, the logic applies the `upgrader_source_selection` filter for every product that is being updated.
1471
+ *
1472
+ * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
1473
+ * @param string $remote_source Path to upgrade/zip-file-name.tmp.
1474
+ * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
1475
+ *
1476
+ * @return string|WP_Error
1477
+ */
1478
+ static function _maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
1479
+ if ( ! is_object( $GLOBALS['wp_filesystem'] ) ) {
1480
+ return $source;
1481
+ }
1482
+
1483
+ $basename = self::$_upgrade_basename;
1484
+ $is_theme = false;
1485
+
1486
+ // Figure out what the slug is supposed to be.
1487
+ if ( isset( $upgrader->skin->options['extra'] ) ) {
1488
+ // Set by the auto-install logic.
1489
+ $desired_slug = $upgrader->skin->options['extra']['slug'];
1490
+ } elseif ( ! empty( $basename ) ) {
1491
+ /**
1492
+ * If it doesn't end with ".php", it's a theme.
1493
+ *
1494
+ * @author Leo Fajardo (@leorw)
1495
+ * @since 2.2.1
1496
+ */
1497
+ $is_theme = ( ! fs_ends_with( $basename, '.php' ) );
1498
+
1499
+ $desired_slug = ( ! $is_theme ) ?
1500
+ dirname( $basename ) :
1501
+ // Theme slug
1502
+ $basename;
1503
+ } else {
1504
+ // Can't figure out the desired slug, stop the execution.
1505
+ return $source;
1506
+ }
1507
+
1508
+ if ( is_multisite() ) {
1509
+ /**
1510
+ * If we are running in a multisite environment and the product is not network activated,
1511
+ * the instance will not exist anyway. Therefore, try to update the source if necessary
1512
+ * regardless if the Freemius instance of the product exists or not.
1513
+ *
1514
+ * @author Vova Feldman
1515
+ */
1516
+ } elseif ( ! empty( $basename ) ) {
1517
+ $fs = Freemius::get_instance_by_file(
1518
+ $basename,
1519
+ $is_theme ?
1520
+ WP_FS__MODULE_TYPE_THEME :
1521
+ WP_FS__MODULE_TYPE_PLUGIN
1522
+ );
1523
+
1524
+ if ( ! is_object( $fs ) ) {
1525
+ /**
1526
+ * If the Freemius instance does not exist on a non-multisite network environment, it means that:
1527
+ * 1. The product is not powered by Freemius; OR
1528
+ * 2. The product is not activated, therefore, we don't mind if after the update the folder name will change.
1529
+ *
1530
+ * @author Leo Fajardo (@leorw)
1531
+ * @since 2.2.1
1532
+ */
1533
+ return $source;
1534
+ }
1535
+ }
1536
+
1537
+ $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
1538
+
1539
+ if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1540
+ $from_path = untrailingslashit( $source );
1541
+ $to_path = trailingslashit( $remote_source ) . $desired_slug;
1542
+
1543
+ if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
1544
+ return trailingslashit( $to_path );
1545
+ }
1546
+
1547
+ return new WP_Error(
1548
+ 'rename_failed',
1549
+ fs_text_inline( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'module-package-rename-failure' ),
1550
+ array(
1551
+ 'found' => $subdir_name,
1552
+ 'expected' => $desired_slug
1553
+ )
1554
+ );
1555
+ }
1556
+
1557
+ return $source;
1558
+ }
1559
+
1560
+ #endregion
1561
+ }
freemius/includes/customizer/class-fs-customizer-upsell-control.php CHANGED
@@ -1,161 +1,161 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.2.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Customizer_Upsell_Control
15
- */
16
- class FS_Customizer_Upsell_Control extends WP_Customize_Control {
17
-
18
- /**
19
- * Control type
20
- *
21
- * @var string control type
22
- */
23
- public $type = 'freemius-upsell-control';
24
-
25
- /**
26
- * @var Freemius
27
- */
28
- public $fs = null;
29
-
30
- /**
31
- * @param WP_Customize_Manager $manager the customize manager class.
32
- * @param string $id id.
33
- * @param array $args customizer manager parameters.
34
- */
35
- public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
36
- $manager->register_control_type( 'FS_Customizer_Upsell_Control' );
37
-
38
- parent::__construct( $manager, $id, $args );
39
- }
40
-
41
- /**
42
- * Enqueue resources for the control.
43
- */
44
- public function enqueue() {
45
- fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
46
- }
47
-
48
- /**
49
- * Json conversion
50
- */
51
- public function to_json() {
52
- $pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' );
53
-
54
- parent::to_json();
55
-
56
- $this->json['button_text'] = $pricing_cta;
57
- $this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
58
- $this->fs->get_trial_url() :
59
- $this->fs->get_upgrade_url();
60
-
61
- $api = FS_Plugin::is_valid_id( $this->fs->get_bundle_id() ) ?
62
- $this->fs->get_api_bundle_scope() :
63
- $this->fs->get_api_plugin_scope();
64
-
65
- // Load features.
66
- $pricing = $api->get( $this->fs->add_show_pending( "pricing.json" ) );
67
-
68
- if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
69
- // Add support features.
70
- if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
71
- $support_features = array(
72
- 'kb' => 'Help Center',
73
- 'forum' => 'Support Forum',
74
- 'email' => 'Priority Email Support',
75
- 'phone' => 'Phone Support',
76
- 'skype' => 'Skype Support',
77
- 'is_success_manager' => 'Personal Success Manager',
78
- );
79
-
80
- for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
81
- if ( 'free' == $pricing->plans[$i]->name ) {
82
- continue;
83
- }
84
-
85
- if ( ! isset( $pricing->plans[ $i ]->features ) ||
86
- ! is_array( $pricing->plans[ $i ]->features ) ) {
87
- $pricing->plans[$i]->features = array();
88
- }
89
-
90
- foreach ( $support_features as $key => $label ) {
91
- $key = ( 'is_success_manager' !== $key ) ?
92
- "support_{$key}" :
93
- $key;
94
-
95
- if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
96
-
97
- $support_feature = new stdClass();
98
- $support_feature->title = $label;
99
-
100
- $pricing->plans[ $i ]->features[] = $support_feature;
101
- }
102
- }
103
- }
104
- }
105
- }
106
-
107
- $this->json['plans'] = $pricing->plans;
108
-
109
- $this->json['strings'] = array(
110
- 'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
111
- );
112
- }
113
-
114
- /**
115
- * Control content
116
- */
117
- public function content_template() {
118
- ?>
119
- <div id="fs_customizer_upsell">
120
- <# if ( data.plans ) { #>
121
- <ul class="fs-customizer-plans">
122
- <# for (i in data.plans) { #>
123
- <# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
124
- <li class="fs-customizer-plan">
125
- <div class="fs-accordion-section-open">
126
- <h2 class="fs-accordion-section-title menu-item">
127
- <span>{{ data.plans[i].title }}</span>
128
- <button type="button" class="button-link item-edit" aria-expanded="true">
129
- <span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
130
- <span class="toggle-indicator" aria-hidden="true"></span>
131
- </button>
132
- </h2>
133
- <div class="fs-accordion-section-content">
134
- <# if ( data.plans[i].description ) { #>
135
- <h3>{{ data.plans[i].description }}</h3>
136
- <# } #>
137
- <# if ( data.plans[i].features ) { #>
138
- <ul>
139
- <# for ( j in data.plans[i].features ) { #>
140
- <li><div class="fs-feature">
141
- <span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
142
- <# if ( data.plans[i].features[j].description ) { #>
143
- <span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
144
- <# } #>
145
- </div></li>
146
- <# } #>
147
- </ul>
148
- <# } #>
149
- <# if ( 'free' != data.plans[i].name ) { #>
150
- <a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
151
- <# } #>
152
- </div>
153
- </div>
154
- </li>
155
- <# } #>
156
- <# } #>
157
- </ul>
158
- <# } #>
159
- </div>
160
- <?php }
161
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.2.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Customizer_Upsell_Control
15
+ */
16
+ class FS_Customizer_Upsell_Control extends WP_Customize_Control {
17
+
18
+ /**
19
+ * Control type
20
+ *
21
+ * @var string control type
22
+ */
23
+ public $type = 'freemius-upsell-control';
24
+
25
+ /**
26
+ * @var Freemius
27
+ */
28
+ public $fs = null;
29
+
30
+ /**
31
+ * @param WP_Customize_Manager $manager the customize manager class.
32
+ * @param string $id id.
33
+ * @param array $args customizer manager parameters.
34
+ */
35
+ public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
36
+ $manager->register_control_type( 'FS_Customizer_Upsell_Control' );
37
+
38
+ parent::__construct( $manager, $id, $args );
39
+ }
40
+
41
+ /**
42
+ * Enqueue resources for the control.
43
+ */
44
+ public function enqueue() {
45
+ fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
46
+ }
47
+
48
+ /**
49
+ * Json conversion
50
+ */
51
+ public function to_json() {
52
+ $pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' );
53
+
54
+ parent::to_json();
55
+
56
+ $this->json['button_text'] = $pricing_cta;
57
+ $this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
58
+ $this->fs->get_trial_url() :
59
+ $this->fs->get_upgrade_url();
60
+
61
+ $api = FS_Plugin::is_valid_id( $this->fs->get_bundle_id() ) ?
62
+ $this->fs->get_api_bundle_scope() :
63
+ $this->fs->get_api_plugin_scope();
64
+
65
+ // Load features.
66
+ $pricing = $api->get( $this->fs->add_show_pending( "pricing.json" ) );
67
+
68
+ if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
69
+ // Add support features.
70
+ if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
71
+ $support_features = array(
72
+ 'kb' => 'Help Center',
73
+ 'forum' => 'Support Forum',
74
+ 'email' => 'Priority Email Support',
75
+ 'phone' => 'Phone Support',
76
+ 'skype' => 'Skype Support',
77
+ 'is_success_manager' => 'Personal Success Manager',
78
+ );
79
+
80
+ for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
81
+ if ( 'free' == $pricing->plans[$i]->name ) {
82
+ continue;
83
+ }
84
+
85
+ if ( ! isset( $pricing->plans[ $i ]->features ) ||
86
+ ! is_array( $pricing->plans[ $i ]->features ) ) {
87
+ $pricing->plans[$i]->features = array();
88
+ }
89
+
90
+ foreach ( $support_features as $key => $label ) {
91
+ $key = ( 'is_success_manager' !== $key ) ?
92
+ "support_{$key}" :
93
+ $key;
94
+
95
+ if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
96
+
97
+ $support_feature = new stdClass();
98
+ $support_feature->title = $label;
99
+
100
+ $pricing->plans[ $i ]->features[] = $support_feature;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ $this->json['plans'] = $pricing->plans;
108
+
109
+ $this->json['strings'] = array(
110
+ 'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Control content
116
+ */
117
+ public function content_template() {
118
+ ?>
119
+ <div id="fs_customizer_upsell">
120
+ <# if ( data.plans ) { #>
121
+ <ul class="fs-customizer-plans">
122
+ <# for (i in data.plans) { #>
123
+ <# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
124
+ <li class="fs-customizer-plan">
125
+ <div class="fs-accordion-section-open">
126
+ <h2 class="fs-accordion-section-title menu-item">
127
+ <span>{{ data.plans[i].title }}</span>
128
+ <button type="button" class="button-link item-edit" aria-expanded="true">
129
+ <span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
130
+ <span class="toggle-indicator" aria-hidden="true"></span>
131
+ </button>
132
+ </h2>
133
+ <div class="fs-accordion-section-content">
134
+ <# if ( data.plans[i].description ) { #>
135
+ <h3>{{ data.plans[i].description }}</h3>
136
+ <# } #>
137
+ <# if ( data.plans[i].features ) { #>
138
+ <ul>
139
+ <# for ( j in data.plans[i].features ) { #>
140
+ <li><div class="fs-feature">
141
+ <span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
142
+ <# if ( data.plans[i].features[j].description ) { #>
143
+ <span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
144
+ <# } #>
145
+ </div></li>
146
+ <# } #>
147
+ </ul>
148
+ <# } #>
149
+ <# if ( 'free' != data.plans[i].name ) { #>
150
+ <a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
151
+ <# } #>
152
+ </div>
153
+ </div>
154
+ </li>
155
+ <# } #>
156
+ <# } #>
157
+ </ul>
158
+ <# } #>
159
+ </div>
160
+ <?php }
161
  }
freemius/includes/entities/class-fs-affiliate-terms.php CHANGED
@@ -1,128 +1,128 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_AffiliateTerms extends FS_Scope_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var bool
19
- */
20
- public $is_active;
21
- /**
22
- * @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
23
- */
24
- public $type;
25
- /**
26
- * @var string Enum: `payout` or `credit`. Defaults to `payout`.
27
- */
28
- public $reward_type;
29
- /**
30
- * If `first`, the referral will be attributed to the first visited source containing the affiliation link that
31
- * was clicked.
32
- *
33
- * @var string Enum: `first` or `last`. Defaults to `first`.
34
- */
35
- public $referral_attribution;
36
- /**
37
- * @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
38
- */
39
- public $cookie_days;
40
- /**
41
- * @var int
42
- */
43
- public $commission;
44
- /**
45
- * @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
46
- */
47
- public $commission_type;
48
- /**
49
- * @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
50
- * greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
51
- * the initial upgrade/purchase.
52
- */
53
- public $commission_renewals_days;
54
- /**
55
- * @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
56
- */
57
- public $install_commission;
58
- /**
59
- * @var string Required default target link, e.g.: pricing page.
60
- */
61
- public $default_url;
62
- /**
63
- * @var string One of the following: 'all', 'new_customer', 'new_user'.
64
- * If 'all' - reward for any user type.
65
- * If 'new_customer' - reward only for new customers.
66
- * If 'new_user' - reward only for new users.
67
- */
68
- public $reward_customer_type;
69
- /**
70
- * @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
71
- * paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
72
- * customer payments for `future_payments_days` days after the initial payment.
73
- */
74
- public $future_payments_days;
75
- /**
76
- * @var bool If `true`, allow referrals from social sites.
77
- */
78
- public $is_social_allowed;
79
- /**
80
- * @var bool If `true`, allow conversions without HTTP referrer header at all.
81
- */
82
- public $is_app_allowed;
83
- /**
84
- * @var bool If `true`, allow referrals from any site.
85
- */
86
- public $is_any_site_allowed;
87
-
88
- #endregion Properties
89
-
90
- /**
91
- * @author Leo Fajardo (@leorw)
92
- *
93
- * @return string
94
- */
95
- function get_formatted_commission()
96
- {
97
- return ( 'dollar' === $this->commission_type ) ?
98
- ( '$' . $this->commission ) :
99
- ( $this->commission . '%' );
100
- }
101
-
102
- /**
103
- * @author Leo Fajardo (@leorw)
104
- *
105
- * @return bool
106
- */
107
- function has_lifetime_commission() {
108
- return ( 0 !== $this->future_payments_days );
109
- }
110
-
111
- /**
112
- * @author Leo Fajardo (@leorw)
113
- *
114
- * @return bool
115
- */
116
- function is_session_cookie() {
117
- return ( 0 == $this->cookie_days );
118
- }
119
-
120
- /**
121
- * @author Leo Fajardo (@leorw)
122
- *
123
- * @return bool
124
- */
125
- function has_renewals_commission() {
126
- return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
127
- }
128
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_AffiliateTerms extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var bool
19
+ */
20
+ public $is_active;
21
+ /**
22
+ * @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
23
+ */
24
+ public $type;
25
+ /**
26
+ * @var string Enum: `payout` or `credit`. Defaults to `payout`.
27
+ */
28
+ public $reward_type;
29
+ /**
30
+ * If `first`, the referral will be attributed to the first visited source containing the affiliation link that
31
+ * was clicked.
32
+ *
33
+ * @var string Enum: `first` or `last`. Defaults to `first`.
34
+ */
35
+ public $referral_attribution;
36
+ /**
37
+ * @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
38
+ */
39
+ public $cookie_days;
40
+ /**
41
+ * @var int
42
+ */
43
+ public $commission;
44
+ /**
45
+ * @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
46
+ */
47
+ public $commission_type;
48
+ /**
49
+ * @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
50
+ * greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
51
+ * the initial upgrade/purchase.
52
+ */
53
+ public $commission_renewals_days;
54
+ /**
55
+ * @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
56
+ */
57
+ public $install_commission;
58
+ /**
59
+ * @var string Required default target link, e.g.: pricing page.
60
+ */
61
+ public $default_url;
62
+ /**
63
+ * @var string One of the following: 'all', 'new_customer', 'new_user'.
64
+ * If 'all' - reward for any user type.
65
+ * If 'new_customer' - reward only for new customers.
66
+ * If 'new_user' - reward only for new users.
67
+ */
68
+ public $reward_customer_type;
69
+ /**
70
+ * @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
71
+ * paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
72
+ * customer payments for `future_payments_days` days after the initial payment.
73
+ */
74
+ public $future_payments_days;
75
+ /**
76
+ * @var bool If `true`, allow referrals from social sites.
77
+ */
78
+ public $is_social_allowed;
79
+ /**
80
+ * @var bool If `true`, allow conversions without HTTP referrer header at all.
81
+ */
82
+ public $is_app_allowed;
83
+ /**
84
+ * @var bool If `true`, allow referrals from any site.
85
+ */
86
+ public $is_any_site_allowed;
87
+
88
+ #endregion Properties
89
+
90
+ /**
91
+ * @author Leo Fajardo (@leorw)
92
+ *
93
+ * @return string
94
+ */
95
+ function get_formatted_commission()
96
+ {
97
+ return ( 'dollar' === $this->commission_type ) ?
98
+ ( '$' . $this->commission ) :
99
+ ( $this->commission . '%' );
100
+ }
101
+
102
+ /**
103
+ * @author Leo Fajardo (@leorw)
104
+ *
105
+ * @return bool
106
+ */
107
+ function has_lifetime_commission() {
108
+ return ( 0 !== $this->future_payments_days );
109
+ }
110
+
111
+ /**
112
+ * @author Leo Fajardo (@leorw)
113
+ *
114
+ * @return bool
115
+ */
116
+ function is_session_cookie() {
117
+ return ( 0 == $this->cookie_days );
118
+ }
119
+
120
+ /**
121
+ * @author Leo Fajardo (@leorw)
122
+ *
123
+ * @return bool
124
+ */
125
+ function has_renewals_commission() {
126
+ return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
127
+ }
128
  }
freemius/includes/entities/class-fs-payment.php CHANGED
@@ -1,168 +1,168 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Payment extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var number
19
- */
20
- public $plugin_id;
21
- /**
22
- * @var number
23
- */
24
- public $user_id;
25
- /**
26
- * @var number
27
- */
28
- public $install_id;
29
- /**
30
- * @var number
31
- */
32
- public $subscription_id;
33
- /**
34
- * @var number
35
- */
36
- public $plan_id;
37
- /**
38
- * @var number
39
- */
40
- public $license_id;
41
- /**
42
- * @var float
43
- */
44
- public $gross;
45
- /**
46
- * @author Leo Fajardo (@leorw)
47
- * @since 2.3.0
48
- *
49
- * @var string One of the following: `usd`, `gbp`, `eur`.
50
- */
51
- public $currency;
52
- /**
53
- * @var number
54
- */
55
- public $bound_payment_id;
56
- /**
57
- * @var string
58
- */
59
- public $external_id;
60
- /**
61
- * @var string
62
- */
63
- public $gateway;
64
- /**
65
- * @var string ISO 3166-1 alpha-2 - two-letter country code.
66
- *
67
- * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
68
- */
69
- public $country_code;
70
- /**
71
- * @var string
72
- */
73
- public $vat_id;
74
- /**
75
- * @var float Actual Tax / VAT in $$$
76
- */
77
- public $vat;
78
- /**
79
- * @var int Payment source.
80
- */
81
- public $source = 0;
82
-
83
- #endregion Properties
84
-
85
- const CURRENCY_USD = 'usd';
86
- const CURRENCY_GBP = 'gbp';
87
- const CURRENCY_EUR = 'eur';
88
-
89
- /**
90
- * @param object|bool $payment
91
- */
92
- function __construct( $payment = false ) {
93
- parent::__construct( $payment );
94
- }
95
-
96
- static function get_type() {
97
- return 'payment';
98
- }
99
-
100
- /**
101
- * @author Vova Feldman (@svovaf)
102
- * @since 1.0.0
103
- *
104
- * @return bool
105
- */
106
- function is_refund() {
107
- return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
108
- }
109
-
110
- /**
111
- * Checks if the payment was migrated from another platform.
112
- *
113
- * @author Vova Feldman (@svovaf)
114
- * @since 2.0.2
115
- *
116
- * @return bool
117
- */
118
- function is_migrated() {
119
- return ( 0 != $this->source );
120
- }
121
-
122
- /**
123
- * Returns the gross in this format:
124
- * `{symbol}{amount | 2 decimal digits} {currency | uppercase}`
125
- *
126
- * Examples: £9.99 GBP, -£9.99 GBP.
127
- *
128
- * @author Leo Fajardo (@leorw)
129
- * @since 2.3.0
130
- *
131
- * @return string
132
- */
133
- function formatted_gross()
134
- {
135
- return (
136
- ( $this->gross < 0 ? '-' : '' ) .
137
- $this->get_symbol() .
138
- number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' .
139
- strtoupper( $this->currency )
140
- );
141
- }
142
-
143
- /**
144
- * A map between supported currencies with their symbols.
145
- *
146
- * @var array<string,string>
147
- */
148
- static $CURRENCY_2_SYMBOL;
149
-
150
- /**
151
- * @author Leo Fajardo (@leorw)
152
- * @since 2.3.0
153
- *
154
- * @return string
155
- */
156
- private function get_symbol() {
157
- if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) {
158
- // Lazy load.
159
- self::$CURRENCY_2_SYMBOL = array(
160
- self::CURRENCY_USD => '$',
161
- self::CURRENCY_GBP => '&pound;',
162
- self::CURRENCY_EUR => '&euro;',
163
- );
164
- }
165
-
166
- return self::$CURRENCY_2_SYMBOL[ $this->currency ];
167
- }
168
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2016, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Payment extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plugin_id;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $user_id;
25
+ /**
26
+ * @var number
27
+ */
28
+ public $install_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $subscription_id;
33
+ /**
34
+ * @var number
35
+ */
36
+ public $plan_id;
37
+ /**
38
+ * @var number
39
+ */
40
+ public $license_id;
41
+ /**
42
+ * @var float
43
+ */
44
+ public $gross;
45
+ /**
46
+ * @author Leo Fajardo (@leorw)
47
+ * @since 2.3.0
48
+ *
49
+ * @var string One of the following: `usd`, `gbp`, `eur`.
50
+ */
51
+ public $currency;
52
+ /**
53
+ * @var number
54
+ */
55
+ public $bound_payment_id;
56
+ /**
57
+ * @var string
58
+ */
59
+ public $external_id;
60
+ /**
61
+ * @var string
62
+ */
63
+ public $gateway;
64
+ /**
65
+ * @var string ISO 3166-1 alpha-2 - two-letter country code.
66
+ *
67
+ * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
68
+ */
69
+ public $country_code;
70
+ /**
71
+ * @var string
72
+ */
73
+ public $vat_id;
74
+ /**
75
+ * @var float Actual Tax / VAT in $$$
76
+ */
77
+ public $vat;
78
+ /**
79
+ * @var int Payment source.
80
+ */
81
+ public $source = 0;
82
+
83
+ #endregion Properties
84
+
85
+ const CURRENCY_USD = 'usd';
86
+ const CURRENCY_GBP = 'gbp';
87
+ const CURRENCY_EUR = 'eur';
88
+
89
+ /**
90
+ * @param object|bool $payment
91
+ */
92
+ function __construct( $payment = false ) {
93
+ parent::__construct( $payment );
94
+ }
95
+
96
+ static function get_type() {
97
+ return 'payment';
98
+ }
99
+
100
+ /**
101
+ * @author Vova Feldman (@svovaf)
102
+ * @since 1.0.0
103
+ *
104
+ * @return bool
105
+ */
106
+ function is_refund() {
107
+ return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
108
+ }
109
+
110
+ /**
111
+ * Checks if the payment was migrated from another platform.
112
+ *
113
+ * @author Vova Feldman (@svovaf)
114
+ * @since 2.0.2
115
+ *
116
+ * @return bool
117
+ */
118
+ function is_migrated() {
119
+ return ( 0 != $this->source );
120
+ }
121
+
122
+ /**
123
+ * Returns the gross in this format:
124
+ * `{symbol}{amount | 2 decimal digits} {currency | uppercase}`
125
+ *
126
+ * Examples: £9.99 GBP, -£9.99 GBP.
127
+ *
128
+ * @author Leo Fajardo (@leorw)
129
+ * @since 2.3.0
130
+ *
131
+ * @return string
132
+ */
133
+ function formatted_gross()
134
+ {
135
+ return (
136
+ ( $this->gross < 0 ? '-' : '' ) .
137
+ $this->get_symbol() .
138
+ number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' .
139
+ strtoupper( $this->currency )
140
+ );
141
+ }
142
+
143
+ /**
144
+ * A map between supported currencies with their symbols.
145
+ *
146
+ * @var array<string,string>
147
+ */
148
+ static $CURRENCY_2_SYMBOL;
149
+
150
+ /**
151
+ * @author Leo Fajardo (@leorw)
152
+ * @since 2.3.0
153
+ *
154
+ * @return string
155
+ */
156
+ private function get_symbol() {
157
+ if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) {
158
+ // Lazy load.
159
+ self::$CURRENCY_2_SYMBOL = array(
160
+ self::CURRENCY_USD => '$',
161
+ self::CURRENCY_GBP => '&pound;',
162
+ self::CURRENCY_EUR => '&euro;',
163
+ );
164
+ }
165
+
166
+ return self::$CURRENCY_2_SYMBOL[ $this->currency ];
167
+ }
168
  }
freemius/includes/entities/class-fs-user.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_User extends FS_Scope_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var string
19
- */
20
- public $email;
21
- /**
22
- * @var string
23
- */
24
- public $first;
25
- /**
26
- * @var string
27
- */
28
- public $last;
29
- /**
30
- * @var bool
31
- */
32
- public $is_verified;
33
- /**
34
- * @var string|null
35
- */
36
- public $customer_id;
37
- /**
38
- * @var float
39
- */
40
- public $gross;
41
-
42
- #endregion Properties
43
-
44
- /**
45
- * @param object|bool $user
46
- */
47
- function __construct( $user = false ) {
48
- parent::__construct( $user );
49
- }
50
-
51
- function get_name() {
52
- return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
53
- }
54
-
55
- function is_verified() {
56
- return ( isset( $this->is_verified ) && true === $this->is_verified );
57
- }
58
-
59
- static function get_type() {
60
- return 'user';
61
- }
62
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_User extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var string
19
+ */
20
+ public $email;
21
+ /**
22
+ * @var string
23
+ */
24
+ public $first;
25
+ /**
26
+ * @var string
27
+ */
28
+ public $last;
29
+ /**
30
+ * @var bool
31
+ */
32
+ public $is_verified;
33
+ /**
34
+ * @var string|null
35
+ */
36
+ public $customer_id;
37
+ /**
38
+ * @var float
39
+ */
40
+ public $gross;
41
+
42
+ #endregion Properties
43
+
44
+ /**
45
+ * @param object|bool $user
46
+ */
47
+ function __construct( $user = false ) {
48
+ parent::__construct( $user );
49
+ }
50
+
51
+ function get_name() {
52
+ return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
53
+ }
54
+
55
+ function is_verified() {
56
+ return ( isset( $this->is_verified ) && true === $this->is_verified );
57
+ }
58
+
59
+ static function get_type() {
60
+ return 'user';
61
+ }
62
  }
freemius/includes/fs-essential-functions.php CHANGED
@@ -1,500 +1,500 @@
1
- <?php
2
- /**
3
- * IMPORTANT:
4
- * This file will be loaded based on the order of the plugins/themes load.
5
- * If there's a theme and a plugin using Freemius, the plugin's essential
6
- * file will always load first.
7
- *
8
- * @package Freemius
9
- * @copyright Copyright (c) 2015, Freemius, Inc.
10
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
11
- * @since 1.1.5
12
- */
13
-
14
- if ( ! function_exists( 'fs_normalize_path' ) ) {
15
- if ( function_exists( 'wp_normalize_path' ) ) {
16
- /**
17
- * Normalize a filesystem path.
18
- *
19
- * Replaces backslashes with forward slashes for Windows systems, and ensures
20
- * no duplicate slashes exist.
21
- *
22
- * @param string $path Path to normalize.
23
- *
24
- * @return string Normalized path.
25
- */
26
- function fs_normalize_path( $path ) {
27
- return wp_normalize_path( $path );
28
- }
29
- } else {
30
- function fs_normalize_path( $path ) {
31
- $path = str_replace( '\\', '/', $path );
32
- $path = preg_replace( '|/+|', '/', $path );
33
-
34
- return $path;
35
- }
36
- }
37
- }
38
-
39
- require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-2.2.1.php';
40
-
41
- #region Core Redirect (copied from BuddyPress) -----------------------------------------
42
-
43
- if ( ! function_exists( 'fs_redirect' ) ) {
44
- /**
45
- * Redirects to another page, with a workaround for the IIS Set-Cookie bug.
46
- *
47
- * @link http://support.microsoft.com/kb/q176113/
48
- * @since 1.5.1
49
- * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
50
- *
51
- * @param string $location The path to redirect to.
52
- * @param bool $exit If true, exit after redirect (Since 1.2.1.5).
53
- * @param int $status Status code to use.
54
- *
55
- * @return bool False if $location is not set
56
- */
57
- function fs_redirect( $location, $exit = true, $status = 302 ) {
58
- global $is_IIS;
59
-
60
- $file = '';
61
- $line = '';
62
- if ( headers_sent($file, $line) ) {
63
- if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notices' ) ) {
64
- $notices = FS_Admin_Notices::instance( 'global' );
65
-
66
- $notices->add( "Freemius failed to redirect the page because the headers have been already sent from line <b><code>{$line}</code></b> in file <b><code>{$file}</code></b>. If it's unexpected, it usually happens due to invalid space and/or EOL character(s).", 'Oops...', 'error' );
67
- }
68
-
69
- return false;
70
- }
71
-
72
- if ( defined( 'DOING_AJAX' ) ) {
73
- // Don't redirect on AJAX calls.
74
- return false;
75
- }
76
-
77
- if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
78
- {
79
- return false;
80
- }
81
-
82
- $location = fs_sanitize_redirect( $location );
83
-
84
- if ( $is_IIS ) {
85
- header( "Refresh: 0;url=$location" );
86
- } else {
87
- if ( php_sapi_name() != 'cgi-fcgi' ) {
88
- status_header( $status );
89
- } // This causes problems on IIS and some FastCGI setups
90
- header( "Location: $location" );
91
- }
92
-
93
- if ( $exit ) {
94
- exit();
95
- }
96
-
97
- return true;
98
- }
99
-
100
- if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
101
- /**
102
- * Sanitizes a URL for use in a redirect.
103
- *
104
- * @since 2.3
105
- *
106
- * @param string $location
107
- *
108
- * @return string redirect-sanitized URL
109
- */
110
- function fs_sanitize_redirect( $location ) {
111
- $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
112
- $location = fs_kses_no_null( $location );
113
-
114
- // remove %0d and %0a from location
115
- $strip = array( '%0d', '%0a' );
116
- $found = true;
117
- while ( $found ) {
118
- $found = false;
119
- foreach ( (array) $strip as $val ) {
120
- while ( strpos( $location, $val ) !== false ) {
121
- $found = true;
122
- $location = str_replace( $val, '', $location );
123
- }
124
- }
125
- }
126
-
127
- return $location;
128
- }
129
- }
130
-
131
- if ( ! function_exists( 'fs_kses_no_null' ) ) {
132
- /**
133
- * Removes any NULL characters in $string.
134
- *
135
- * @since 1.0.0
136
- *
137
- * @param string $string
138
- *
139
- * @return string
140
- */
141
- function fs_kses_no_null( $string ) {
142
- $string = preg_replace( '/\0+/', '', $string );
143
- $string = preg_replace( '/(\\\\0)+/', '', $string );
144
-
145
- return $string;
146
- }
147
- }
148
- }
149
-
150
- #endregion Core Redirect (copied from BuddyPress) -----------------------------------------
151
-
152
- if ( ! function_exists( '__fs' ) ) {
153
- global $fs_text_overrides;
154
-
155
- if ( ! isset( $fs_text_overrides ) ) {
156
- $fs_text_overrides = array();
157
- }
158
-
159
- /**
160
- * Retrieve a translated text by key.
161
- *
162
- * @deprecated Use `fs_text()` instead since methods starting with `__` trigger warnings in Php 7.
163
- * @todo Remove this method in the future.
164
- *
165
- * @author Vova Feldman (@svovaf)
166
- * @since 1.1.4
167
- *
168
- * @param string $key
169
- * @param string $slug
170
- *
171
- * @return string
172
- *
173
- * @global $fs_text, $fs_text_overrides
174
- */
175
- function __fs( $key, $slug = 'freemius' ) {
176
- _deprecated_function( __FUNCTION__, '2.0.0', 'fs_text()' );
177
-
178
- global $fs_text,
179
- $fs_module_info_text,
180
- $fs_text_overrides;
181
-
182
- if ( isset( $fs_text_overrides[ $slug ] ) ) {
183
- if ( isset( $fs_text_overrides[ $slug ][ $key ] ) ) {
184
- return $fs_text_overrides[ $slug ][ $key ];
185
- }
186
-
187
- $lower_key = strtolower( $key );
188
- if ( isset( $fs_text_overrides[ $slug ][ $lower_key ] ) ) {
189
- return $fs_text_overrides[ $slug ][ $lower_key ];
190
- }
191
- }
192
-
193
- if ( ! isset( $fs_text ) ) {
194
- $dir = defined( 'WP_FS__DIR_INCLUDES' ) ?
195
- WP_FS__DIR_INCLUDES :
196
- dirname( __FILE__ );
197
-
198
- require_once $dir . '/i18n.php';
199
- }
200
-
201
- if ( isset( $fs_text[ $key ] ) ) {
202
- return $fs_text[ $key ];
203
- }
204
-
205
- if ( isset( $fs_module_info_text[ $key ] ) ) {
206
- return $fs_module_info_text[ $key ];
207
- }
208
-
209
- return $key;
210
- }
211
-
212
- /**
213
- * Output a translated text by key.
214
- *
215
- * @deprecated Use `fs_echo()` instead for consistency with `fs_text()`.
216
- *
217
- * @todo Remove this method in the future.
218
- *
219
- * @author Vova Feldman (@svovaf)
220
- * @since 1.1.4
221
- *
222
- * @param string $key
223
- * @param string $slug
224
- */
225
- function _efs( $key, $slug = 'freemius' ) {
226
- fs_echo( $key, $slug );
227
- }
228
- }
229
-
230
- if ( ! function_exists( 'fs_get_ip' ) ) {
231
- /**
232
- * Get client IP.
233
- *
234
- * @author Vova Feldman (@svovaf)
235
- * @since 1.1.2
236
- *
237
- * @return string|null
238
- */
239
- function fs_get_ip() {
240
- $fields = array(
241
- 'HTTP_CF_CONNECTING_IP',
242
- 'HTTP_CLIENT_IP',
243
- 'HTTP_X_FORWARDED_FOR',
244
- 'HTTP_X_FORWARDED',
245
- 'HTTP_FORWARDED_FOR',
246
- 'HTTP_FORWARDED',
247
- 'REMOTE_ADDR',
248
- );
249
-
250
- foreach ( $fields as $ip_field ) {
251
- if ( ! empty( $_SERVER[ $ip_field ] ) ) {
252
- return $_SERVER[ $ip_field ];
253
- }
254
- }
255
-
256
- return null;
257
- }
258
- }
259
-
260
- /**
261
- * Leverage backtrace to find caller plugin main file path.
262
- *
263
- * @author Vova Feldman (@svovaf)
264
- * @since 1.0.6
265
- *
266
- * @return string
267
- */
268
- function fs_find_caller_plugin_file() {
269
- /**
270
- * All the code below will be executed once on activation.
271
- * If the user changes the main plugin's file name, the file_exists()
272
- * will catch it.
273
- */
274
- if ( ! function_exists( 'get_plugins' ) ) {
275
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
276
- }
277
-
278
- $all_plugins = fs_get_plugins( true );
279
- $all_plugins_paths = array();
280
-
281
- // Get active plugin's main files real full names (might be symlinks).
282
- foreach ( $all_plugins as $relative_path => $data ) {
283
- $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
284
- }
285
-
286
- $plugin_file = null;
287
- for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
288
- if ( empty( $bt[ $i ]['file'] ) ) {
289
- continue;
290
- }
291
-
292
- if ( in_array( fs_normalize_path( $bt[ $i ]['file'] ), $all_plugins_paths ) ) {
293
- $plugin_file = $bt[ $i ]['file'];
294
- break;
295
- }
296
- }
297
-
298
- if ( is_null( $plugin_file ) ) {
299
- // Throw an error to the developer in case of some edge case dev environment.
300
- wp_die(
301
- 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
302
- 'Error',
303
- array( 'back_link' => true )
304
- );
305
- }
306
-
307
- return $plugin_file;
308
- }
309
-
310
- require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-1.1.7.1.php';
311
-
312
- /**
313
- * Update SDK newest version reference.
314
- *
315
- * @author Vova Feldman (@svovaf)
316
- * @since 1.1.6
317
- *
318
- * @param string $sdk_relative_path
319
- * @param string|bool $plugin_file
320
- *
321
- * @global $fs_active_plugins
322
- */
323
- function fs_update_sdk_newest_version( $sdk_relative_path, $plugin_file = false ) {
324
- /**
325
- * If there is a plugin running an older version of FS (1.2.1 or below), the `fs_update_sdk_newest_version()`
326
- * function in the older version will be used instead of this one. But since the older version is using
327
- * the `is_plugin_active` function to check if a plugin is active, passing the theme's `plugin_path` to the
328
- * `is_plugin_active` function will return false since the path is not a plugin path, so `in_activation` will be
329
- * `true` for theme modules and the upgrading of the SDK version to 1.2.2 or newer version will work fine.
330
- *
331
- * Future versions that will call this function will use the proper logic here instead of just relying on the
332
- * `is_plugin_active` function to fail for themes.
333
- *
334
- * @author Leo Fajardo (@leorw)
335
- * @since 1.2.2
336
- */
337
-
338
- global $fs_active_plugins;
339
-
340
- $newest_sdk = $fs_active_plugins->plugins[ $sdk_relative_path ];
341
-
342
- if ( ! is_string( $plugin_file ) ) {
343
- $plugin_file = plugin_basename( fs_find_caller_plugin_file() );
344
- }
345
-
346
- if ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) {
347
- if ( ! function_exists( 'is_plugin_active' ) ) {
348
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
349
- }
350
-
351
- $in_activation = ( ! is_plugin_active( $plugin_file ) );
352
- } else {
353
- $theme = wp_get_theme();
354
- $in_activation = ( $newest_sdk->plugin_path == $theme->stylesheet );
355
- }
356
-
357
- $fs_active_plugins->newest = (object) array(
358
- 'plugin_path' => $plugin_file,
359
- 'sdk_path' => $sdk_relative_path,
360
- 'version' => $newest_sdk->version,
361
- 'in_activation' => $in_activation,
362
- 'timestamp' => time(),
363
- );
364
-
365
- // Update DB with latest SDK version and path.
366
- update_option( 'fs_active_plugins', $fs_active_plugins );
367
- }
368
-
369
- /**
370
- * Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
371
- *
372
- * @author Vova Feldman (@svovaf)
373
- * @since 1.1.6
374
- *
375
- * @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
376
- *
377
- * @global $fs_active_plugins
378
- */
379
- function fs_newest_sdk_plugin_first() {
380
- global $fs_active_plugins;
381
-
382
- /**
383
- * @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
384
- *
385
- * @link https://github.com/Freemius/wordpress-sdk/issues/26
386
- */
387
-
388
- $newest_sdk_plugin_path = $fs_active_plugins->newest->plugin_path;
389
-
390
- $active_plugins = get_option( 'active_plugins', array() );
391
- $updated_active_plugins = array( $newest_sdk_plugin_path );
392
-
393
- $plugin_found = false;
394
- $is_first_path = true;
395
-
396
- foreach ( $active_plugins as $key => $plugin_path ) {
397
- if ( $plugin_path === $newest_sdk_plugin_path ) {
398
- if ( $is_first_path ) {
399
- // if it's the first plugin already, no need to continue
400
- return false;
401
- }
402
-
403
- $plugin_found = true;
404
-
405
- // Skip the plugin (it is already added as the 1st item of $updated_active_plugins).
406
- continue;
407
- }
408
-
409
- $updated_active_plugins[] = $plugin_path;
410
-
411
- if ( $is_first_path ) {
412
- $is_first_path = false;
413
- }
414
- }
415
-
416
- if ( $plugin_found ) {
417
- update_option( 'active_plugins', $updated_active_plugins );
418
-
419
- return true;
420
- }
421
-
422
- if ( is_multisite() ) {
423
- // Plugin is network active.
424
- $network_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
425
-
426
- if ( isset( $network_active_plugins[ $newest_sdk_plugin_path ] ) ) {
427
- reset( $network_active_plugins );
428
- if ( $newest_sdk_plugin_path === key( $network_active_plugins ) ) {
429
- // Plugin is already activated first on the network level.
430
- return false;
431
- } else {
432
- $time = $network_active_plugins[ $newest_sdk_plugin_path ];
433
-
434
- // Remove plugin from its current position.
435
- unset( $network_active_plugins[ $newest_sdk_plugin_path ] );
436
-
437
- // Set it to be included first.
438
- $network_active_plugins = array( $newest_sdk_plugin_path => $time ) + $network_active_plugins;
439
-
440
- update_site_option( 'active_sitewide_plugins', $network_active_plugins );
441
-
442
- return true;
443
- }
444
- }
445
- }
446
-
447
- return false;
448
- }
449
-
450
- /**
451
- * Go over all Freemius SDKs in the system and find and "remember"
452
- * the newest SDK which is associated with an active plugin.
453
- *
454
- * @author Vova Feldman (@svovaf)
455
- * @since 1.1.6
456
- *
457
- * @global $fs_active_plugins
458
- */
459
- function fs_fallback_to_newest_active_sdk() {
460
- global $fs_active_plugins;
461
-
462
- /**
463
- * @var object $newest_sdk_data
464
- */
465
- $newest_sdk_data = null;
466
- $newest_sdk_path = null;
467
-
468
- foreach ( $fs_active_plugins->plugins as $sdk_relative_path => $data ) {
469
- if ( is_null( $newest_sdk_data ) || version_compare( $data->version, $newest_sdk_data->version, '>' )
470
- ) {
471
- // If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
472
- if ( 'plugin' === $data->type ) {
473
- $is_module_active = is_plugin_active( $data->plugin_path );
474
- } else {
475
- $active_theme = wp_get_theme();
476
- $is_module_active = ( $data->plugin_path === $active_theme->get_template() );
477
- }
478
-
479
- $is_sdk_exists = file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php' ) );
480
-
481
- if ( ! $is_module_active || ! $is_sdk_exists ) {
482
- unset( $fs_active_plugins->plugins[ $sdk_relative_path ] );
483
-
484
- // No need to store the data since it will be stored in fs_update_sdk_newest_version()
485
- // or explicitly with update_option().
486
- } else {
487
- $newest_sdk_data = $data;
488
- $newest_sdk_path = $sdk_relative_path;
489
- }
490
- }
491
- }
492
-
493
- if ( is_null( $newest_sdk_data ) ) {
494
- // Couldn't find any SDK reference.
495
- $fs_active_plugins = new stdClass();
496
- update_option( 'fs_active_plugins', $fs_active_plugins );
497
- } else {
498
- fs_update_sdk_newest_version( $newest_sdk_path, $newest_sdk_data->plugin_path );
499
- }
500
  }
1
+ <?php
2
+ /**
3
+ * IMPORTANT:
4
+ * This file will be loaded based on the order of the plugins/themes load.
5
+ * If there's a theme and a plugin using Freemius, the plugin's essential
6
+ * file will always load first.
7
+ *
8
+ * @package Freemius
9
+ * @copyright Copyright (c) 2015, Freemius, Inc.
10
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
11
+ * @since 1.1.5
12
+ */
13
+
14
+ if ( ! function_exists( 'fs_normalize_path' ) ) {
15
+ if ( function_exists( 'wp_normalize_path' ) ) {
16
+ /**
17
+ * Normalize a filesystem path.
18
+ *
19
+ * Replaces backslashes with forward slashes for Windows systems, and ensures
20
+ * no duplicate slashes exist.
21
+ *
22
+ * @param string $path Path to normalize.
23
+ *
24
+ * @return string Normalized path.
25
+ */
26
+ function fs_normalize_path( $path ) {
27
+ return wp_normalize_path( $path );
28
+ }
29
+ } else {
30
+ function fs_normalize_path( $path ) {
31
+ $path = str_replace( '\\', '/', $path );
32
+ $path = preg_replace( '|/+|', '/', $path );
33
+
34
+ return $path;
35
+ }
36
+ }
37
+ }
38
+
39
+ require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-2.2.1.php';
40
+
41
+ #region Core Redirect (copied from BuddyPress) -----------------------------------------
42
+
43
+ if ( ! function_exists( 'fs_redirect' ) ) {
44
+ /**
45
+ * Redirects to another page, with a workaround for the IIS Set-Cookie bug.
46
+ *
47
+ * @link http://support.microsoft.com/kb/q176113/
48
+ * @since 1.5.1
49
+ * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
50
+ *
51
+ * @param string $location The path to redirect to.
52
+ * @param bool $exit If true, exit after redirect (Since 1.2.1.5).
53
+ * @param int $status Status code to use.
54
+ *
55
+ * @return bool False if $location is not set
56
+ */
57
+ function fs_redirect( $location, $exit = true, $status = 302 ) {
58
+ global $is_IIS;
59
+
60
+ $file = '';
61
+ $line = '';
62
+ if ( headers_sent($file, $line) ) {
63
+ if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notices' ) ) {
64
+ $notices = FS_Admin_Notices::instance( 'global' );
65
+
66
+ $notices->add( "Freemius failed to redirect the page because the headers have been already sent from line <b><code>{$line}</code></b> in file <b><code>{$file}</code></b>. If it's unexpected, it usually happens due to invalid space and/or EOL character(s).", 'Oops...', 'error' );
67
+ }
68
+
69
+ return false;
70
+ }
71
+
72
+ if ( defined( 'DOING_AJAX' ) ) {
73
+ // Don't redirect on AJAX calls.
74
+ return false;
75
+ }
76
+
77
+ if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
78
+ {
79
+ return false;
80
+ }
81
+
82
+ $location = fs_sanitize_redirect( $location );
83
+
84
+ if ( $is_IIS ) {
85
+ header( "Refresh: 0;url=$location" );
86
+ } else {
87
+ if ( php_sapi_name() != 'cgi-fcgi' ) {
88
+ status_header( $status );
89
+ } // This causes problems on IIS and some FastCGI setups
90
+ header( "Location: $location" );
91
+ }
92
+
93
+ if ( $exit ) {
94
+ exit();
95
+ }
96
+
97
+ return true;
98
+ }
99
+
100
+ if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
101
+ /**
102
+ * Sanitizes a URL for use in a redirect.
103
+ *
104
+ * @since 2.3
105
+ *
106
+ * @param string $location
107
+ *
108
+ * @return string redirect-sanitized URL
109
+ */
110
+ function fs_sanitize_redirect( $location ) {
111
+ $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
112
+ $location = fs_kses_no_null( $location );
113
+
114
+ // remove %0d and %0a from location
115
+ $strip = array( '%0d', '%0a' );
116
+ $found = true;
117
+ while ( $found ) {
118
+ $found = false;
119
+ foreach ( (array) $strip as $val ) {
120
+ while ( strpos( $location, $val ) !== false ) {
121
+ $found = true;
122
+ $location = str_replace( $val, '', $location );
123
+ }
124
+ }
125
+ }
126
+
127
+ return $location;
128
+ }
129
+ }
130
+
131
+ if ( ! function_exists( 'fs_kses_no_null' ) ) {
132
+ /**
133
+ * Removes any NULL characters in $string.
134
+ *
135
+ * @since 1.0.0
136
+ *
137
+ * @param string $string
138
+ *
139
+ * @return string
140
+ */
141
+ function fs_kses_no_null( $string ) {
142
+ $string = preg_replace( '/\0+/', '', $string );
143
+ $string = preg_replace( '/(\\\\0)+/', '', $string );
144
+
145
+ return $string;
146
+ }
147
+ }
148
+ }
149
+
150
+ #endregion Core Redirect (copied from BuddyPress) -----------------------------------------
151
+
152
+ if ( ! function_exists( '__fs' ) ) {
153
+ global $fs_text_overrides;
154
+
155
+ if ( ! isset( $fs_text_overrides ) ) {
156
+ $fs_text_overrides = array();
157
+ }
158
+
159
+ /**
160
+ * Retrieve a translated text by key.
161
+ *
162
+ * @deprecated Use `fs_text()` instead since methods starting with `__` trigger warnings in Php 7.
163
+ * @todo Remove this method in the future.
164
+ *
165
+ * @author Vova Feldman (@svovaf)
166
+ * @since 1.1.4
167
+ *
168
+ * @param string $key
169
+ * @param string $slug
170
+ *
171
+ * @return string
172
+ *
173
+ * @global $fs_text, $fs_text_overrides
174
+ */
175
+ function __fs( $key, $slug = 'freemius' ) {
176
+ _deprecated_function( __FUNCTION__, '2.0.0', 'fs_text()' );
177
+
178
+ global $fs_text,
179
+ $fs_module_info_text,
180
+ $fs_text_overrides;
181
+
182
+ if ( isset( $fs_text_overrides[ $slug ] ) ) {
183
+ if ( isset( $fs_text_overrides[ $slug ][ $key ] ) ) {
184
+ return $fs_text_overrides[ $slug ][ $key ];
185
+ }
186
+
187
+ $lower_key = strtolower( $key );
188
+ if ( isset( $fs_text_overrides[ $slug ][ $lower_key ] ) ) {
189
+ return $fs_text_overrides[ $slug ][ $lower_key ];
190
+ }
191
+ }
192
+
193
+ if ( ! isset( $fs_text ) ) {
194
+ $dir = defined( 'WP_FS__DIR_INCLUDES' ) ?
195
+ WP_FS__DIR_INCLUDES :
196
+ dirname( __FILE__ );
197
+
198
+ require_once $dir . '/i18n.php';
199
+ }
200
+
201
+ if ( isset( $fs_text[ $key ] ) ) {
202
+ return $fs_text[ $key ];
203
+ }
204
+
205
+ if ( isset( $fs_module_info_text[ $key ] ) ) {
206
+ return $fs_module_info_text[ $key ];
207
+ }
208
+
209
+ return $key;
210
+ }
211
+
212
+ /**
213
+ * Output a translated text by key.
214
+ *
215
+ * @deprecated Use `fs_echo()` instead for consistency with `fs_text()`.
216
+ *
217
+ * @todo Remove this method in the future.
218
+ *
219
+ * @author Vova Feldman (@svovaf)
220
+ * @since 1.1.4
221
+ *
222
+ * @param string $key
223
+ * @param string $slug
224
+ */
225
+ function _efs( $key, $slug = 'freemius' ) {
226
+ fs_echo( $key, $slug );
227
+ }
228
+ }
229
+
230
+ if ( ! function_exists( 'fs_get_ip' ) ) {
231
+ /**
232
+ * Get client IP.
233
+ *
234
+ * @author Vova Feldman (@svovaf)
235
+ * @since 1.1.2
236
+ *
237
+ * @return string|null
238
+ */
239
+ function fs_get_ip() {
240
+ $fields = array(
241
+ 'HTTP_CF_CONNECTING_IP',
242
+ 'HTTP_CLIENT_IP',
243
+ 'HTTP_X_FORWARDED_FOR',
244
+ 'HTTP_X_FORWARDED',
245
+ 'HTTP_FORWARDED_FOR',
246
+ 'HTTP_FORWARDED',
247
+ 'REMOTE_ADDR',
248
+ );
249
+
250
+ foreach ( $fields as $ip_field ) {
251
+ if ( ! empty( $_SERVER[ $ip_field ] ) ) {
252
+ return $_SERVER[ $ip_field ];
253
+ }
254
+ }
255
+
256
+ return null;
257
+ }
258
+ }
259
+
260
+ /**
261
+ * Leverage backtrace to find caller plugin main file path.
262
+ *
263
+ * @author Vova Feldman (@svovaf)
264
+ * @since 1.0.6
265
+ *
266
+ * @return string
267
+ */
268
+ function fs_find_caller_plugin_file() {
269
+ /**
270
+ * All the code below will be executed once on activation.
271
+ * If the user changes the main plugin's file name, the file_exists()
272
+ * will catch it.
273
+ */
274
+ if ( ! function_exists( 'get_plugins' ) ) {
275
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
276
+ }
277
+
278
+ $all_plugins = fs_get_plugins( true );
279
+ $all_plugins_paths = array();
280
+
281
+ // Get active plugin's main files real full names (might be symlinks).
282
+ foreach ( $all_plugins as $relative_path => $data ) {
283
+ $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
284
+ }
285
+
286
+ $plugin_file = null;
287
+ for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
288
+ if ( empty( $bt[ $i ]['file'] ) ) {
289
+ continue;
290
+ }
291
+
292
+ if ( in_array( fs_normalize_path( $bt[ $i ]['file'] ), $all_plugins_paths ) ) {
293
+ $plugin_file = $bt[ $i ]['file'];
294
+ break;
295
+ }
296
+ }
297
+
298
+ if ( is_null( $plugin_file ) ) {
299
+ // Throw an error to the developer in case of some edge case dev environment.
300
+ wp_die(
301
+ 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
302
+ 'Error',
303
+ array( 'back_link' => true )
304
+ );
305
+ }
306
+
307
+ return $plugin_file;
308
+ }
309
+
310
+ require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-1.1.7.1.php';
311
+
312
+ /**
313
+ * Update SDK newest version reference.
314
+ *
315
+ * @author Vova Feldman (@svovaf)
316
+ * @since 1.1.6
317
+ *
318
+ * @param string $sdk_relative_path
319
+ * @param string|bool $plugin_file
320
+ *
321
+ * @global $fs_active_plugins
322
+ */
323
+ function fs_update_sdk_newest_version( $sdk_relative_path, $plugin_file = false ) {
324
+ /**
325
+ * If there is a plugin running an older version of FS (1.2.1 or below), the `fs_update_sdk_newest_version()`
326
+ * function in the older version will be used instead of this one. But since the older version is using
327
+ * the `is_plugin_active` function to check if a plugin is active, passing the theme's `plugin_path` to the
328
+ * `is_plugin_active` function will return false since the path is not a plugin path, so `in_activation` will be
329
+ * `true` for theme modules and the upgrading of the SDK version to 1.2.2 or newer version will work fine.
330
+ *
331
+ * Future versions that will call this function will use the proper logic here instead of just relying on the
332
+ * `is_plugin_active` function to fail for themes.
333
+ *
334
+ * @author Leo Fajardo (@leorw)
335
+ * @since 1.2.2
336
+ */
337
+
338
+ global $fs_active_plugins;
339
+
340
+ $newest_sdk = $fs_active_plugins->plugins[ $sdk_relative_path ];
341
+
342
+ if ( ! is_string( $plugin_file ) ) {
343
+ $plugin_file = plugin_basename( fs_find_caller_plugin_file() );
344
+ }
345
+
346
+ if ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) {
347
+ if ( ! function_exists( 'is_plugin_active' ) ) {
348
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
349
+ }
350
+
351
+ $in_activation = ( ! is_plugin_active( $plugin_file ) );
352
+ } else {
353
+ $theme = wp_get_theme();
354
+ $in_activation = ( $newest_sdk->plugin_path == $theme->stylesheet );
355
+ }
356
+
357
+ $fs_active_plugins->newest = (object) array(
358
+ 'plugin_path' => $plugin_file,
359
+ 'sdk_path' => $sdk_relative_path,
360
+ 'version' => $newest_sdk->version,
361
+ 'in_activation' => $in_activation,
362
+ 'timestamp' => time(),
363
+ );
364
+
365
+ // Update DB with latest SDK version and path.
366
+ update_option( 'fs_active_plugins', $fs_active_plugins );
367
+ }
368
+
369
+ /**
370
+ * Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
371
+ *
372
+ * @author Vova Feldman (@svovaf)
373
+ * @since 1.1.6
374
+ *
375
+ * @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
376
+ *
377
+ * @global $fs_active_plugins
378
+ */
379
+ function fs_newest_sdk_plugin_first() {
380
+ global $fs_active_plugins;
381
+
382
+ /**
383
+ * @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
384
+ *
385
+ * @link https://github.com/Freemius/wordpress-sdk/issues/26
386
+ */
387
+
388
+ $newest_sdk_plugin_path = $fs_active_plugins->newest->plugin_path;
389
+
390
+ $active_plugins = get_option( 'active_plugins', array() );
391
+ $updated_active_plugins = array( $newest_sdk_plugin_path );
392
+
393
+ $plugin_found = false;
394
+ $is_first_path = true;
395
+
396
+ foreach ( $active_plugins as $key => $plugin_path ) {
397
+ if ( $plugin_path === $newest_sdk_plugin_path ) {
398
+ if ( $is_first_path ) {
399
+ // if it's the first plugin already, no need to continue
400
+ return false;
401
+ }
402
+
403
+ $plugin_found = true;
404
+
405
+ // Skip the plugin (it is already added as the 1st item of $updated_active_plugins).
406
+ continue;
407
+ }
408
+
409
+ $updated_active_plugins[] = $plugin_path;
410
+
411
+ if ( $is_first_path ) {
412
+ $is_first_path = false;
413
+ }
414
+ }
415
+
416
+ if ( $plugin_found ) {
417
+ update_option( 'active_plugins', $updated_active_plugins );
418
+
419
+ return true;
420
+ }
421
+
422
+ if ( is_multisite() ) {
423
+ // Plugin is network active.
424
+ $network_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
425
+
426
+ if ( isset( $network_active_plugins[ $newest_sdk_plugin_path ] ) ) {
427
+ reset( $network_active_plugins );
428
+ if ( $newest_sdk_plugin_path === key( $network_active_plugins ) ) {
429
+ // Plugin is already activated first on the network level.
430
+ return false;
431
+ } else {
432
+ $time = $network_active_plugins[ $newest_sdk_plugin_path ];
433
+
434
+ // Remove plugin from its current position.
435
+ unset( $network_active_plugins[ $newest_sdk_plugin_path ] );
436
+
437
+ // Set it to be included first.
438
+ $network_active_plugins = array( $newest_sdk_plugin_path => $time ) + $network_active_plugins;
439
+
440
+ update_site_option( 'active_sitewide_plugins', $network_active_plugins );
441
+
442
+ return true;
443
+ }
444
+ }
445
+ }
446
+
447
+ return false;
448
+ }
449
+
450
+ /**
451
+ * Go over all Freemius SDKs in the system and find and "remember"
452
+ * the newest SDK which is associated with an active plugin.
453
+ *
454
+ * @author Vova Feldman (@svovaf)
455
+ * @since 1.1.6
456
+ *
457
+ * @global $fs_active_plugins
458
+ */
459
+ function fs_fallback_to_newest_active_sdk() {
460
+ global $fs_active_plugins;
461
+
462
+ /**
463
+ * @var object $newest_sdk_data
464
+ */
465
+ $newest_sdk_data = null;
466
+ $newest_sdk_path = null;
467
+
468
+ foreach ( $fs_active_plugins->plugins as $sdk_relative_path => $data ) {
469
+ if ( is_null( $newest_sdk_data ) || version_compare( $data->version, $newest_sdk_data->version, '>' )
470
+ ) {
471
+ // If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
472
+ if ( 'plugin' === $data->type ) {
473
+ $is_module_active = is_plugin_active( $data->plugin_path );
474
+ } else {
475
+ $active_theme = wp_get_theme();
476
+ $is_module_active = ( $data->plugin_path === $active_theme->get_template() );
477
+ }
478
+
479
+ $is_sdk_exists = file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php' ) );
480
+
481
+ if ( ! $is_module_active || ! $is_sdk_exists ) {
482
+ unset( $fs_active_plugins->plugins[ $sdk_relative_path ] );
483
+
484
+ // No need to store the data since it will be stored in fs_update_sdk_newest_version()
485
+ // or explicitly with update_option().
486
+ } else {
487
+ $newest_sdk_data = $data;
488
+ $newest_sdk_path = $sdk_relative_path;
489
+ }
490
+ }
491
+ }
492
+
493
+ if ( is_null( $newest_sdk_data ) ) {
494
+ // Couldn't find any SDK reference.
495
+ $fs_active_plugins = new stdClass();
496
+ update_option( 'fs_active_plugins', $fs_active_plugins );
497
+ } else {
498
+ fs_update_sdk_newest_version( $newest_sdk_path, $newest_sdk_data->plugin_path );
499
+ }
500
  }
freemius/includes/managers/class-fs-key-value-storage.php CHANGED
@@ -1,392 +1,392 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Key_Value_Storage
15
- *
16
- * @property int $install_timestamp
17
- * @property int $activation_timestamp
18
- * @property int $sync_timestamp
19
- * @property object $sync_cron
20
- * @property int $install_sync_timestamp
21
- * @property array $connectivity_test
22
- * @property array $is_on
23
- * @property object $trial_plan
24
- * @property bool $has_trial_plan
25
- * @property bool $trial_promotion_shown
26
- * @property string $sdk_version
27
- * @property string $sdk_last_version
28
- * @property bool $sdk_upgrade_mode
29
- * @property bool $sdk_downgrade_mode
30
- * @property bool $plugin_upgrade_mode
31
- * @property bool $plugin_downgrade_mode
32
- * @property string $plugin_version
33
- * @property string $plugin_last_version
34
- * @property bool $is_plugin_new_install
35
- * @property bool $was_plugin_loaded
36
- * @property object $plugin_main_file
37
- * @property bool $prev_is_premium
38
- * @property array $is_anonymous
39
- * @property bool $is_pending_activation
40
- * @property bool $sticky_optin_added
41
- * @property object $uninstall_reason
42
- * @property object $subscription
43
- */
44
- class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
45
- /**
46
- * @var string
47
- */
48
- protected $_id;
49
-
50
- /**
51
- * @since 1.2.2
52
- *
53
- * @var string
54
- */
55
- protected $_secondary_id;
56
-
57
- /**
58
- * @since 2.0.0
59
- * @var int The ID of the blog that is associated with the current site level options.
60
- */
61
- private $_blog_id = 0;
62
-
63
- /**
64
- * @since 2.0.0
65
- * @var bool
66
- */
67
- private $_is_multisite_storage;
68
-
69
- /**
70
- * @var array
71
- */
72
- protected $_data;
73
-
74
- /**
75
- * @var FS_Key_Value_Storage[]
76
- */
77
- private static $_instances = array();
78
-
79
- /**
80
- * @var FS_Logger
81
- */
82
- protected $_logger;
83
-
84
- /**
85
- * @param string $id
86
- * @param string $secondary_id
87
- * @param bool $network_level_or_blog_id
88
- *
89
- * @return FS_Key_Value_Storage
90
- */
91
- static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
92
- $key = $id . ':' . $secondary_id;
93
-
94
- if ( is_multisite() ) {
95
- if ( true === $network_level_or_blog_id ) {
96
- $key .= ':ms';
97
- } elseif ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
98
- $key .= ":{$network_level_or_blog_id}";
99
- } else {
100
- $network_level_or_blog_id = get_current_blog_id();
101
-
102
- $key .= ":{$network_level_or_blog_id}";
103
- }
104
- }
105
-
106
- if ( ! isset( self::$_instances[ $key ] ) ) {
107
- self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
108
- }
109
-
110
- return self::$_instances[ $key ];
111
- }
112
-
113
- protected function __construct( $id, $secondary_id, $network_level_or_blog_id = false ) {
114
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
115
-
116
- $this->_id = $id;
117
- $this->_secondary_id = $secondary_id;
118
-
119
- if ( is_multisite() ) {
120
- $this->_is_multisite_storage = ( true === $network_level_or_blog_id );
121
-
122
- if ( is_numeric( $network_level_or_blog_id ) ) {
123
- $this->_blog_id = $network_level_or_blog_id;
124
- }
125
- } else {
126
- $this->_is_multisite_storage = false;
127
- }
128
-
129
- $this->load();
130
- }
131
-
132
- protected function get_option_manager() {
133
- return FS_Option_Manager::get_manager(
134
- WP_FS__ACCOUNTS_OPTION_NAME,
135
- true,
136
- $this->_is_multisite_storage ?
137
- true :
138
- ( $this->_blog_id > 0 ? $this->_blog_id : false )
139
- );
140
- }
141
-
142
- protected function get_all_data() {
143
- return $this->get_option_manager()->get_option( $this->_id, array() );
144
- }
145
-
146
- /**
147
- * Load plugin data from local DB.
148
- *
149
- * @author Vova Feldman (@svovaf)
150
- * @since 1.0.7
151
- */
152
- function load() {
153
- $all_plugins_data = $this->get_all_data();
154
- $this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
155
- $all_plugins_data[ $this->_secondary_id ] :
156
- array();
157
- }
158
-
159
- /**
160
- * @author Vova Feldman (@svovaf)
161
- * @since 1.0.7
162
- *
163
- * @param string $key
164
- * @param mixed $value
165
- * @param bool $flush
166
- */
167
- function store( $key, $value, $flush = true ) {
168
- if ( $this->_logger->is_on() ) {
169
- $this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
170
- }
171
-
172
- if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
173
- // No need to store data if the value wasn't changed.
174
- return;
175
- }
176
-
177
- $all_data = $this->get_all_data();
178
-
179
- $this->_data[ $key ] = $value;
180
-
181
- $all_data[ $this->_secondary_id ] = $this->_data;
182
-
183
- $options_manager = $this->get_option_manager();
184
- $options_manager->set_option( $this->_id, $all_data, $flush );
185
- }
186
-
187
- /**
188
- * @author Vova Feldman (@svovaf)
189
- * @since 2.0.0
190
- */
191
- function save() {
192
- $this->get_option_manager()->store();
193
- }
194
-
195
- /**
196
- * @author Vova Feldman (@svovaf)
197
- * @since 1.0.7
198
- *
199
- * @param bool $store
200
- * @param string[] $exceptions Set of keys to keep and not clear.
201
- */
202
- function clear_all( $store = true, $exceptions = array() ) {
203
- $new_data = array();
204
- foreach ( $exceptions as $key ) {
205
- if ( isset( $this->_data[ $key ] ) ) {
206
- $new_data[ $key ] = $this->_data[ $key ];
207
- }
208
- }
209
-
210
- $this->_data = $new_data;
211
-
212
- if ( $store ) {
213
- $all_data = $this->get_all_data();
214
- $all_data[ $this->_secondary_id ] = $this->_data;
215
- $options_manager = $this->get_option_manager();
216
- $options_manager->set_option( $this->_id, $all_data, true );
217
- }
218
- }
219
-
220
- /**
221
- * Delete key-value storage.
222
- *
223
- * @author Vova Feldman (@svovaf)
224
- * @since 1.0.9
225
- */
226
- function delete() {
227
- $this->_data = array();
228
-
229
- $all_data = $this->get_all_data();
230
- unset( $all_data[ $this->_secondary_id ] );
231
- $options_manager = $this->get_option_manager();
232
- $options_manager->set_option( $this->_id, $all_data, true );
233
- }
234
-
235
- /**
236
- * @author Vova Feldman (@svovaf)
237
- * @since 1.0.7
238
- *
239
- * @param string $key
240
- * @param bool $store
241
- */
242
- function remove( $key, $store = true ) {
243
- if ( ! array_key_exists( $key, $this->_data ) ) {
244
- return;
245
- }
246
-
247
- unset( $this->_data[ $key ] );
248
-
249
- if ( $store ) {
250
- $all_data = $this->get_all_data();
251
- $all_data[ $this->_secondary_id ] = $this->_data;
252
- $options_manager = $this->get_option_manager();
253
- $options_manager->set_option( $this->_id, $all_data, true );
254
- }
255
- }
256
-
257
- /**
258
- * @author Vova Feldman (@svovaf)
259
- * @since 1.0.7
260
- *
261
- * @param string $key
262
- * @param mixed $default
263
- *
264
- * @return bool|\FS_Plugin
265
- */
266
- function get( $key, $default = false ) {
267
- return array_key_exists( $key, $this->_data ) ?
268
- $this->_data[ $key ] :
269
- $default;
270
- }
271
-
272
- /**
273
- * @author Vova Feldman (@svovaf)
274
- * @since 2.0.0
275
- *
276
- * @return string
277
- */
278
- function get_secondary_id() {
279
- return $this->_secondary_id;
280
- }
281
-
282
-
283
- /* ArrayAccess + Magic Access (better for refactoring)
284
- -----------------------------------------------------------------------------------*/
285
- function __set( $k, $v ) {
286
- $this->store( $k, $v );
287
- }
288
-
289
- function __isset( $k ) {
290
- return array_key_exists( $k, $this->_data );
291
- }
292
-
293
- function __unset( $k ) {
294
- $this->remove( $k );
295
- }
296
-
297
- function __get( $k ) {
298
- return $this->get( $k, null );
299
- }
300
-
301
- function offsetSet( $k, $v ) {
302
- if ( is_null( $k ) ) {
303
- throw new Exception( 'Can\'t append value to request params.' );
304
- } else {
305
- $this->{$k} = $v;
306
- }
307
- }
308
-
309
- function offsetExists( $k ) {
310
- return array_key_exists( $k, $this->_data );
311
- }
312
-
313
- function offsetUnset( $k ) {
314
- unset( $this->$k );
315
- }
316
-
317
- function offsetGet( $k ) {
318
- return $this->get( $k, null );
319
- }
320
-
321
- /**
322
- * (PHP 5 &gt;= 5.0.0)<br/>
323
- * Return the current element
324
- *
325
- * @link http://php.net/manual/en/iterator.current.php
326
- * @return mixed Can return any type.
327
- */
328
- public function current() {
329
- return current( $this->_data );
330
- }
331
-
332
- /**
333
- * (PHP 5 &gt;= 5.0.0)<br/>
334
- * Move forward to next element
335
- *
336
- * @link http://php.net/manual/en/iterator.next.php
337
- * @return void Any returned value is ignored.
338
- */
339
- public function next() {
340
- next( $this->_data );
341
- }
342
-
343
- /**
344
- * (PHP 5 &gt;= 5.0.0)<br/>
345
- * Return the key of the current element
346
- *
347
- * @link http://php.net/manual/en/iterator.key.php
348
- * @return mixed scalar on success, or null on failure.
349
- */
350
- public function key() {
351
- return key( $this->_data );
352
- }
353
-
354
- /**
355
- * (PHP 5 &gt;= 5.0.0)<br/>
356
- * Checks if current position is valid
357
- *
358
- * @link http://php.net/manual/en/iterator.valid.php
359
- * @return boolean The return value will be casted to boolean and then evaluated.
360
- * Returns true on success or false on failure.
361
- */
362
- public function valid() {
363
- $key = key( $this->_data );
364
-
365
- return ( $key !== null && $key !== false );
366
- }
367
-
368
- /**
369
- * (PHP 5 &gt;= 5.0.0)<br/>
370
- * Rewind the Iterator to the first element
371
- *
372
- * @link http://php.net/manual/en/iterator.rewind.php
373
- * @return void Any returned value is ignored.
374
- */
375
- public function rewind() {
376
- reset( $this->_data );
377
- }
378
-
379
- /**
380
- * (PHP 5 &gt;= 5.1.0)<br/>
381
- * Count elements of an object
382
- *
383
- * @link http://php.net/manual/en/countable.count.php
384
- * @return int The custom count as an integer.
385
- * </p>
386
- * <p>
387
- * The return value is cast to an integer.
388
- */
389
- public function count() {
390
- return count( $this->_data );
391
- }
392
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Key_Value_Storage
15
+ *
16
+ * @property int $install_timestamp
17
+ * @property int $activation_timestamp
18
+ * @property int $sync_timestamp
19
+ * @property object $sync_cron
20
+ * @property int $install_sync_timestamp
21
+ * @property array $connectivity_test
22
+ * @property array $is_on
23
+ * @property object $trial_plan
24
+ * @property bool $has_trial_plan
25
+ * @property bool $trial_promotion_shown
26
+ * @property string $sdk_version
27
+ * @property string $sdk_last_version
28
+ * @property bool $sdk_upgrade_mode
29
+ * @property bool $sdk_downgrade_mode
30
+ * @property bool $plugin_upgrade_mode
31
+ * @property bool $plugin_downgrade_mode
32
+ * @property string $plugin_version
33
+ * @property string $plugin_last_version
34
+ * @property bool $is_plugin_new_install
35
+ * @property bool $was_plugin_loaded
36
+ * @property object $plugin_main_file
37
+ * @property bool $prev_is_premium
38
+ * @property array $is_anonymous
39
+ * @property bool $is_pending_activation
40
+ * @property bool $sticky_optin_added
41
+ * @property object $uninstall_reason
42
+ * @property object $subscription
43
+ */
44
+ class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
45
+ /**
46
+ * @var string
47
+ */
48
+ protected $_id;
49
+
50
+ /**
51
+ * @since 1.2.2
52
+ *
53
+ * @var string
54
+ */
55
+ protected $_secondary_id;
56
+
57
+ /**
58
+ * @since 2.0.0
59
+ * @var int The ID of the blog that is associated with the current site level options.
60
+ */
61
+ private $_blog_id = 0;
62
+
63
+ /**
64
+ * @since 2.0.0
65
+ * @var bool
66
+ */
67
+ private $_is_multisite_storage;
68
+
69
+ /**
70
+ * @var array
71
+ */
72
+ protected $_data;
73
+
74
+ /**
75
+ * @var FS_Key_Value_Storage[]
76
+ */
77
+ private static $_instances = array();
78
+
79
+ /**
80
+ * @var FS_Logger
81
+ */
82
+ protected $_logger;
83
+
84
+ /**
85
+ * @param string $id
86
+ * @param string $secondary_id
87
+ * @param bool $network_level_or_blog_id
88
+ *
89
+ * @return FS_Key_Value_Storage
90
+ */
91
+ static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
92
+ $key = $id . ':' . $secondary_id;
93
+
94
+ if ( is_multisite() ) {
95
+ if ( true === $network_level_or_blog_id ) {
96
+ $key .= ':ms';
97
+ } elseif ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
98
+ $key .= ":{$network_level_or_blog_id}";
99
+ } else {
100
+ $network_level_or_blog_id = get_current_blog_id();
101
+
102
+ $key .= ":{$network_level_or_blog_id}";
103
+ }
104
+ }
105
+
106
+ if ( ! isset( self::$_instances[ $key ] ) ) {
107
+ self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
108
+ }
109
+
110
+ return self::$_instances[ $key ];
111
+ }
112
+
113
+ protected function __construct( $id, $secondary_id, $network_level_or_blog_id = false ) {
114
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
115
+
116
+ $this->_id = $id;
117
+ $this->_secondary_id = $secondary_id;
118
+
119
+ if ( is_multisite() ) {
120
+ $this->_is_multisite_storage = ( true === $network_level_or_blog_id );
121
+
122
+ if ( is_numeric( $network_level_or_blog_id ) ) {
123
+ $this->_blog_id = $network_level_or_blog_id;
124
+ }
125
+ } else {
126
+ $this->_is_multisite_storage = false;
127
+ }
128
+
129
+ $this->load();
130
+ }
131
+
132
+ protected function get_option_manager() {
133
+ return FS_Option_Manager::get_manager(
134
+ WP_FS__ACCOUNTS_OPTION_NAME,
135
+ true,
136
+ $this->_is_multisite_storage ?
137
+ true :
138
+ ( $this->_blog_id > 0 ? $this->_blog_id : false )
139
+ );
140
+ }
141
+
142
+ protected function get_all_data() {
143
+ return $this->get_option_manager()->get_option( $this->_id, array() );
144
+ }
145
+
146
+ /**
147
+ * Load plugin data from local DB.
148
+ *
149
+ * @author Vova Feldman (@svovaf)
150
+ * @since 1.0.7
151
+ */
152
+ function load() {
153
+ $all_plugins_data = $this->get_all_data();
154
+ $this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
155
+ $all_plugins_data[ $this->_secondary_id ] :
156
+ array();
157
+ }
158
+
159
+ /**
160
+ * @author Vova Feldman (@svovaf)
161
+ * @since 1.0.7
162
+ *
163
+ * @param string $key
164
+ * @param mixed $value
165
+ * @param bool $flush
166
+ */
167
+ function store( $key, $value, $flush = true ) {
168
+ if ( $this->_logger->is_on() ) {
169
+ $this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
170
+ }
171
+
172
+ if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
173
+ // No need to store data if the value wasn't changed.
174
+ return;
175
+ }
176
+
177
+ $all_data = $this->get_all_data();
178
+
179
+ $this->_data[ $key ] = $value;
180
+
181
+ $all_data[ $this->_secondary_id ] = $this->_data;
182
+
183
+ $options_manager = $this->get_option_manager();
184
+ $options_manager->set_option( $this->_id, $all_data, $flush );
185
+ }
186
+
187
+ /**
188
+ * @author Vova Feldman (@svovaf)
189
+ * @since 2.0.0
190
+ */
191
+ function save() {
192
+ $this->get_option_manager()->store();
193
+ }
194
+
195
+ /**
196
+ * @author Vova Feldman (@svovaf)
197
+ * @since 1.0.7
198
+ *
199
+ * @param bool $store
200
+ * @param string[] $exceptions Set of keys to keep and not clear.
201
+ */
202
+ function clear_all( $store = true, $exceptions = array() ) {
203
+ $new_data = array();
204
+ foreach ( $exceptions as $key ) {
205
+ if ( isset( $this->_data[ $key ] ) ) {
206
+ $new_data[ $key ] = $this->_data[ $key ];
207
+ }
208
+ }
209
+
210
+ $this->_data = $new_data;
211
+
212
+ if ( $store ) {
213
+ $all_data = $this->get_all_data();
214
+ $all_data[ $this->_secondary_id ] = $this->_data;
215
+ $options_manager = $this->get_option_manager();
216
+ $options_manager->set_option( $this->_id, $all_data, true );
217
+ }
218
+ }
219
+
220
+ /**
221
+ * Delete key-value storage.
222
+ *
223
+ * @author Vova Feldman (@svovaf)
224
+ * @since 1.0.9
225
+ */
226
+ function delete() {
227
+ $this->_data = array();
228
+
229
+ $all_data = $this->get_all_data();
230
+ unset( $all_data[ $this->_secondary_id ] );
231
+ $options_manager = $this->get_option_manager();
232
+ $options_manager->set_option( $this->_id, $all_data, true );
233
+ }
234
+
235
+ /**
236
+ * @author Vova Feldman (@svovaf)
237
+ * @since 1.0.7
238
+ *
239
+ * @param string $key
240
+ * @param bool $store
241
+ */
242
+ function remove( $key, $store = true ) {
243
+ if ( ! array_key_exists( $key, $this->_data ) ) {
244
+ return;
245
+ }
246
+
247
+ unset( $this->_data[ $key ] );
248
+
249
+ if ( $store ) {
250
+ $all_data = $this->get_all_data();
251
+ $all_data[ $this->_secondary_id ] = $this->_data;
252
+ $options_manager = $this->get_option_manager();
253
+ $options_manager->set_option( $this->_id, $all_data, true );
254
+ }
255
+ }
256
+
257
+ /**
258
+ * @author Vova Feldman (@svovaf)
259
+ * @since 1.0.7
260
+ *
261
+ * @param string $key
262
+ * @param mixed $default
263
+ *
264
+ * @return bool|\FS_Plugin
265
+ */
266
+ function get( $key, $default = false ) {
267
+ return array_key_exists( $key, $this->_data ) ?
268
+ $this->_data[ $key ] :
269
+ $default;
270
+ }
271
+
272
+ /**
273
+ * @author Vova Feldman (@svovaf)
274
+ * @since 2.0.0
275
+ *
276
+ * @return string
277
+ */
278
+ function get_secondary_id() {
279
+ return $this->_secondary_id;
280
+ }
281
+
282
+
283
+ /* ArrayAccess + Magic Access (better for refactoring)
284
+ -----------------------------------------------------------------------------------*/
285
+ function __set( $k, $v ) {
286
+ $this->store( $k, $v );
287
+ }
288
+
289
+ function __isset( $k ) {
290
+ return array_key_exists( $k, $this->_data );
291
+ }
292
+
293
+ function __unset( $k ) {
294
+ $this->remove( $k );
295
+ }
296
+
297
+ function __get( $k ) {
298
+ return $this->get( $k, null );
299
+ }
300
+
301
+ function offsetSet( $k, $v ) {
302
+ if ( is_null( $k ) ) {
303
+ throw new Exception( 'Can\'t append value to request params.' );
304
+ } else {
305
+ $this->{$k} = $v;
306
+ }
307
+ }
308
+
309
+ function offsetExists( $k ) {
310
+ return array_key_exists( $k, $this->_data );
311
+ }
312
+
313
+ function offsetUnset( $k ) {
314
+ unset( $this->$k );
315
+ }
316
+
317
+ function offsetGet( $k ) {
318
+ return $this->get( $k, null );
319
+ }
320
+
321
+ /**
322
+ * (PHP 5 &gt;= 5.0.0)<br/>
323
+ * Return the current element
324
+ *
325
+ * @link http://php.net/manual/en/iterator.current.php
326
+ * @return mixed Can return any type.
327
+ */
328
+ public function current() {
329
+ return current( $this->_data );
330
+ }
331
+
332
+ /**
333
+ * (PHP 5 &gt;= 5.0.0)<br/>
334
+ * Move forward to next element
335
+ *
336
+ * @link http://php.net/manual/en/iterator.next.php
337
+ * @return void Any returned value is ignored.
338
+ */
339
+ public function next() {
340
+ next( $this->_data );
341
+ }
342
+
343
+ /**
344
+ * (PHP 5 &gt;= 5.0.0)<br/>
345
+ * Return the key of the current element
346
+ *
347
+ * @link http://php.net/manual/en/iterator.key.php
348
+ * @return mixed scalar on success, or null on failure.
349
+ */
350
+ public function key() {
351
+ return key( $this->_data );
352
+ }
353
+
354
+ /**
355
+ * (PHP 5 &gt;= 5.0.0)<br/>
356
+ * Checks if current position is valid
357
+ *
358
+ * @link http://php.net/manual/en/iterator.valid.php
359
+ * @return boolean The return value will be casted to boolean and then evaluated.
360
+ * Returns true on success or false on failure.
361
+ */
362
+ public function valid() {
363
+ $key = key( $this->_data );
364
+
365
+ return ( $key !== null && $key !== false );
366
+ }
367
+
368
+ /**
369
+ * (PHP 5 &gt;= 5.0.0)<br/>
370
+ * Rewind the Iterator to the first element
371
+ *
372
+ * @link http://php.net/manual/en/iterator.rewind.php
373
+ * @return void Any returned value is ignored.
374
+ */
375
+ public function rewind() {
376
+ reset( $this->_data );
377
+ }
378
+
379
+ /**
380
+ * (PHP 5 &gt;= 5.1.0)<br/>
381
+ * Count elements of an object
382
+ *
383
+ * @link http://php.net/manual/en/countable.count.php
384
+ * @return int The custom count as an integer.
385
+ * </p>
386
+ * <p>
387
+ * The return value is cast to an integer.
388
+ */
389
+ public function count() {
390
+ return count( $this->_data );
391
+ }
392
  }
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
- exit;
8
- }
9
-
10
- if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
11
- class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
12
- }
13
- }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
+ exit;
8
+ }
9
+
10
+ if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
11
+ class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
12
+ }
13
+ }
freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -1,715 +1,715 @@
1
- <?php
2
- /**
3
- * Copyright 2016 Freemius, Inc.
4
- *
5
- * Licensed under the GPL v2 (the "License"); you may
6
- * not use this file except in compliance with the License. You may obtain
7
- * a copy of the License at
8
- *
9
- * http://choosealicense.com/licenses/gpl-v2/
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations
15
- * under the License.
16
- */
17
- if ( ! defined( 'ABSPATH' ) ) {
18
- exit;
19
- }
20
-
21
- require_once dirname( __FILE__ ) . '/FreemiusBase.php';
22
-
23
- if ( ! defined( 'FS_SDK__USER_AGENT' ) ) {
24
- define( 'FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION );
25
- }
26
-
27
- if ( ! defined( 'FS_SDK__SIMULATE_NO_CURL' ) ) {
28
- define( 'FS_SDK__SIMULATE_NO_CURL', false );
29
- }
30
-
31
- if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
32
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
33
- }
34
-
35
- if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
36
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
37
- }
38
-
39
- if ( ! defined( 'FS_SDK__HAS_CURL' ) ) {
40
- if ( FS_SDK__SIMULATE_NO_CURL ) {
41
- define( 'FS_SDK__HAS_CURL', false );
42
- } else {
43
- $curl_required_methods = array(
44
- 'curl_version',
45
- 'curl_exec',
46
- 'curl_init',
47
- 'curl_close',
48
- 'curl_setopt',
49
- 'curl_setopt_array',
50
- 'curl_error',
51
- );
52
-
53
- $has_curl = true;
54
- foreach ( $curl_required_methods as $m ) {
55
- if ( ! function_exists( $m ) ) {
56
- $has_curl = false;
57
- break;
58
- }
59
- }
60
-
61
- define( 'FS_SDK__HAS_CURL', $has_curl );
62
- }
63
- }
64
-
65
- if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
66
- define( 'FS_SDK__SSLVERIFY', false );
67
- }
68
-
69
- $curl_version = FS_SDK__HAS_CURL ?
70
- curl_version() :
71
- array( 'version' => '7.37' );
72
-
73
- if ( ! defined( 'FS_API__PROTOCOL' ) ) {
74
- define( 'FS_API__PROTOCOL', version_compare( $curl_version['version'], '7.37', '>=' ) ? 'https' : 'http' );
75
- }
76
-
77
- if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
78
- define( 'FS_API__LOGGER_ON', false );
79
- }
80
-
81
- if ( ! defined( 'FS_API__ADDRESS' ) ) {
82
- define( 'FS_API__ADDRESS', '://api.freemius.com' );
83
- }
84
- if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
85
- define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
86
- }
87
-
88
- if ( class_exists( 'Freemius_Api_WordPress' ) ) {
89
- return;
90
- }
91
-
92
- class Freemius_Api_WordPress extends Freemius_Api_Base {
93
- private static $_logger = array();
94
-
95
- /**
96
- * @param string $pScope 'app', 'developer', 'user' or 'install'.
97
- * @param number $pID Element's id.
98
- * @param string $pPublic Public key.
99
- * @param string|bool $pSecret Element's secret key.
100
- * @param bool $pSandbox Whether or not to run API in sandbox mode.
101
- */
102
- public function __construct( $pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false ) {
103
- // If secret key not provided, use public key encryption.
104
- if ( is_bool( $pSecret ) ) {
105
- $pSecret = $pPublic;
106
- }
107
-
108
- parent::Init( $pScope, $pID, $pPublic, $pSecret, $pSandbox );
109
- }
110
-
111
- public static function GetUrl( $pCanonizedPath = '', $pIsSandbox = false ) {
112
- $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
113
-
114
- if ( ':' === $address[0] ) {
115
- $address = self::$_protocol . $address;
116
- }
117
-
118
- return $address . $pCanonizedPath;
119
- }
120
-
121
- #----------------------------------------------------------------------------------
122
- #region Servers Clock Diff
123
- #----------------------------------------------------------------------------------
124
-
125
- /**
126
- * @var int Clock diff in seconds between current server to API server.
127
- */
128
- private static $_clock_diff = 0;
129
-
130
- /**
131
- * Set clock diff for all API calls.
132
- *
133
- * @since 1.0.3
134
- *
135
- * @param $pSeconds
136
- */
137
- public static function SetClockDiff( $pSeconds ) {
138
- self::$_clock_diff = $pSeconds;
139
- }
140
-
141
- /**
142
- * Find clock diff between current server to API server.
143
- *
144
- * @since 1.0.2
145
- * @return int Clock diff in seconds.
146
- */
147
- public static function FindClockDiff() {
148
- $time = time();
149
- $pong = self::Ping();
150
-
151
- return ( $time - strtotime( $pong->timestamp ) );
152
- }
153
-
154
- #endregion
155
-
156
- /**
157
- * @var string http or https
158
- */
159
- private static $_protocol = FS_API__PROTOCOL;
160
-
161
- /**
162
- * Set API connection protocol.
163
- *
164
- * @since 1.0.4
165
- */
166
- public static function SetHttp() {
167
- self::$_protocol = 'http';
168
- }
169
-
170
- /**
171
- * @since 1.0.4
172
- *
173
- * @return bool
174
- */
175
- public static function IsHttps() {
176
- return ( 'https' === self::$_protocol );
177
- }
178
-
179
- /**
180
- * Sign request with the following HTTP headers:
181
- * Content-MD5: MD5(HTTP Request body)
182
- * Date: Current date (i.e Sat, 14 Feb 2016 20:24:46 +0000)
183
- * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
184
- * {scope_entity_secret_key}))
185
- *
186
- * @param string $pResourceUrl
187
- * @param array $pWPRemoteArgs
188
- *
189
- * @return array
190
- */
191
- function SignRequest( $pResourceUrl, $pWPRemoteArgs ) {
192
- $auth = $this->GenerateAuthorizationParams(
193
- $pResourceUrl,
194
- $pWPRemoteArgs['method'],
195
- ! empty( $pWPRemoteArgs['body'] ) ? $pWPRemoteArgs['body'] : ''
196
- );
197
-
198
- $pWPRemoteArgs['headers']['Date'] = $auth['date'];
199
- $pWPRemoteArgs['headers']['Authorization'] = $auth['authorization'];
200
-
201
- if ( ! empty( $auth['content_md5'] ) ) {
202
- $pWPRemoteArgs['headers']['Content-MD5'] = $auth['content_md5'];
203
- }
204
-
205
- return $pWPRemoteArgs;
206
- }
207
-
208
- /**
209
- * Generate Authorization request headers:
210
- *
211
- * Content-MD5: MD5(HTTP Request body)
212
- * Date: Current date (i.e Sat, 14 Feb 2016 20:24:46 +0000)
213
- * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
214
- * {scope_entity_secret_key}))
215
- *
216
- * @author Vova Feldman
217
- *
218
- * @param string $pResourceUrl
219
- * @param string $pMethod
220
- * @param string $pPostParams
221
- *
222
- * @return array
223
- * @throws Freemius_Exception
224
- */
225
- function GenerateAuthorizationParams(
226
- $pResourceUrl,
227
- $pMethod = 'GET',
228
- $pPostParams = ''
229
- ) {
230
- $pMethod = strtoupper( $pMethod );
231
-
232
- $eol = "\n";
233
- $content_md5 = '';
234
- $content_type = '';
235
- $now = ( time() - self::$_clock_diff );
236
- $date = date( 'r', $now );
237
-
238
- if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
239
- $content_type = 'application/json';
240
-
241
- if ( ! empty( $pPostParams ) ) {
242
- $content_md5 = md5( $pPostParams );
243
- }
244
- }
245
-
246
- $string_to_sign = implode( $eol, array(
247
- $pMethod,
248
- $content_md5,
249
- $content_type,
250
- $date,
251
- $pResourceUrl
252
- ) );
253
-
254
- // If secret and public keys are identical, it means that
255
- // the signature uses public key hash encoding.
256
- $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
257
-
258
- $auth = array(
259
- 'date' => $date,
260
- 'authorization' => $auth_type . ' ' . $this->_id . ':' .
261
- $this->_public . ':' .
262
- self::Base64UrlEncode( hash_hmac(
263
- 'sha256', $string_to_sign, $this->_secret
264
- ) )
265
- );
266
-
267
- if ( ! empty( $content_md5 ) ) {
268
- $auth['content_md5'] = $content_md5;
269
- }
270
-
271
- return $auth;
272
- }
273
-
274
- /**
275
- * Get API request URL signed via query string.
276
- *
277
- * @since 1.2.3 Stopped using http_build_query(). Instead, use urlencode(). In some environments the encoding of http_build_query() can generate a URL that once used with a redirect, the `&` querystring separator is escaped to `&amp;` which breaks the URL (Added by @svovaf).
278
- *
279
- * @param string $pPath
280
- *
281
- * @throws Freemius_Exception
282
- *
283
- * @return string
284
- */
285
- function GetSignedUrl( $pPath ) {
286
- $resource = explode( '?', $this->CanonizePath( $pPath ) );
287
- $pResourceUrl = $resource[0];
288
-
289
- $auth = $this->GenerateAuthorizationParams( $pResourceUrl );
290
-
291
- return Freemius_Api_WordPress::GetUrl(
292
- $pResourceUrl . '?' .
293
- ( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
294
- 'authorization=' . urlencode( $auth['authorization'] ) .
295
- '&auth_date=' . urlencode( $auth['date'] )
296
- , $this->_isSandbox );
297
- }
298
-
299
- /**
300
- * @author Vova Feldman
301
- *
302
- * @param string $pUrl
303
- * @param array $pWPRemoteArgs
304
- *
305
- * @return mixed
306
- */
307
- private static function ExecuteRequest( $pUrl, &$pWPRemoteArgs ) {
308
- $start = microtime( true );
309
-
310
- $response = wp_remote_request( $pUrl, $pWPRemoteArgs );
311
-
312
- if ( FS_API__LOGGER_ON ) {
313
- $end = microtime( true );
314
-
315
- $has_body = ( isset( $pWPRemoteArgs['body'] ) && ! empty( $pWPRemoteArgs['body'] ) );
316
- $is_http_error = is_wp_error( $response );
317
-
318
- self::$_logger[] = array(
319
- 'id' => count( self::$_logger ),
320
- 'start' => $start,
321
- 'end' => $end,
322
- 'total' => ( $end - $start ),
323
- 'method' => $pWPRemoteArgs['method'],
324
- 'path' => $pUrl,
325
- 'body' => $has_body ? $pWPRemoteArgs['body'] : null,
326
- 'result' => ! $is_http_error ?
327
- $response['body'] :
328
- json_encode( $response->get_error_messages() ),
329
- 'code' => ! $is_http_error ? $response['response']['code'] : null,
330
- 'backtrace' => debug_backtrace(),
331
- );
332
- }
333
-
334
- return $response;
335
- }
336
-
337
- /**
338
- * @return array
339
- */
340
- static function GetLogger() {
341
- return self::$_logger;
342
- }
343
-
344
- /**
345
- * @param string $pCanonizedPath
346
- * @param string $pMethod
347
- * @param array $pParams
348
- * @param null|array $pWPRemoteArgs
349
- * @param bool $pIsSandbox
350
- * @param null|callable $pBeforeExecutionFunction
351
- *
352
- * @return object[]|object|null
353
- *
354
- * @throws \Freemius_Exception
355
- */
356
- private static function MakeStaticRequest(
357
- $pCanonizedPath,
358
- $pMethod = 'GET',
359
- $pParams = array(),
360
- $pWPRemoteArgs = null,
361
- $pIsSandbox = false,
362
- $pBeforeExecutionFunction = null
363
- ) {
364
- // Connectivity errors simulation.
365
- if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
366
- self::ThrowCloudFlareDDoSException();
367
- } elseif ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
368
- self::ThrowSquidAclException();
369
- }
370
-
371
- if ( empty( $pWPRemoteArgs ) ) {
372
- $user_agent = 'Freemius/WordPress-SDK/' . Freemius_Api_Base::VERSION . '; ' .
373
- home_url();
374
-
375
- $pWPRemoteArgs = array(
376
- 'method' => strtoupper( $pMethod ),
377
- 'connect_timeout' => 10,
378
- 'timeout' => 60,
379
- 'follow_redirects' => true,
380
- 'redirection' => 5,
381
- 'user-agent' => $user_agent,
382
- 'blocking' => true,
383
- );
384
- }
385
-
386
- if ( ! isset( $pWPRemoteArgs['headers'] ) ||
387
- ! is_array( $pWPRemoteArgs['headers'] )
388
- ) {
389
- $pWPRemoteArgs['headers'] = array();
390
- }
391
-
392
- if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
393
- $pWPRemoteArgs['headers']['Content-type'] = 'application/json';
394
-
395
- if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
396
- $pWPRemoteArgs['body'] = json_encode( $pParams );
397
- }
398
- }
399
-
400
- $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
401
-
402
- $resource = explode( '?', $pCanonizedPath );
403
-
404
- if ( FS_SDK__HAS_CURL ) {
405
- // Disable the 'Expect: 100-continue' behaviour. This causes cURL to wait
406
- // for 2 seconds if the server does not support this header.
407
- $pWPRemoteArgs['headers']['Expect'] = '';
408
- }
409
-
410
- if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
411
- $pWPRemoteArgs['sslverify'] = FS_SDK__SSLVERIFY;
412
- }
413
-
414
- if ( false !== $pBeforeExecutionFunction &&
415
- is_callable( $pBeforeExecutionFunction )
416
- ) {
417
- $pWPRemoteArgs = call_user_func( $pBeforeExecutionFunction, $resource[0], $pWPRemoteArgs );
418
- }
419
-
420
- $result = self::ExecuteRequest( $request_url, $pWPRemoteArgs );
421
-
422
- if ( is_wp_error( $result ) ) {
423
- /**
424
- * @var WP_Error $result
425
- */
426
- if ( self::IsCurlError( $result ) ) {
427
- /**
428
- * With dual stacked DNS responses, it's possible for a server to
429
- * have IPv6 enabled but not have IPv6 connectivity. If this is
430
- * the case, cURL will try IPv4 first and if that fails, then it will
431
- * fall back to IPv6 and the error EHOSTUNREACH is returned by the
432
- * operating system.
433
- */
434
- $matches = array();
435
- $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
436
- if ( preg_match( $regex, $result->get_error_message( 'http_request_failed' ), $matches ) ) {
437
- /**
438
- * Validate IP before calling `inet_pton()` to avoid PHP un-catchable warning.
439
- * @author Vova Feldman (@svovaf)
440
- */
441
- if ( filter_var( $matches[1], FILTER_VALIDATE_IP ) ) {
442
- if ( strlen( inet_pton( $matches[1] ) ) === 16 ) {
443
- // error_log('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
444
- // Hook to an action triggered just before cURL is executed to resolve the IP version to v4.
445
- add_action( 'http_api_curl', 'Freemius_Api_WordPress::CurlResolveToIPv4', 10, 1 );
446
-
447
- // Re-run request.
448
- $result = self::ExecuteRequest( $request_url, $pWPRemoteArgs );
449
- }
450
- }
451
- }
452
- }
453
-
454
- if ( is_wp_error( $result ) ) {
455
- self::ThrowWPRemoteException( $result );
456
- }
457
- }
458
-
459
- $response_body = $result['body'];
460
-
461
- if ( empty( $response_body ) ) {
462
- return null;
463
- }
464
-
465
- $decoded = json_decode( $response_body );
466
-
467
- if ( is_null( $decoded ) ) {
468
- if ( preg_match( '/Please turn JavaScript on/i', $response_body ) &&
469
- preg_match( '/text\/javascript/', $response_body )
470
- ) {
471
- self::ThrowCloudFlareDDoSException( $response_body );
472
- } elseif ( preg_match( '/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $response_body ) &&
473
- preg_match( '/squid/', $response_body )
474
- ) {
475
- self::ThrowSquidAclException( $response_body );
476
- } else {
477
- $decoded = (object) array(
478
- 'error' => (object) array(
479
- 'type' => 'Unknown',
480
- 'message' => $response_body,
481
- 'code' => 'unknown',
482
- 'http' => 402
483
- )
484
- );
485
- }
486
- }
487
-
488
- return $decoded;
489
- }
490
-
491
-
492
- /**
493
- * Makes an HTTP request. This method can be overridden by subclasses if
494
- * developers want to do fancier things or use something other than wp_remote_request()
495
- * to make the request.
496
- *
497
- * @param string $pCanonizedPath The URL to make the request to
498
- * @param string $pMethod HTTP method
499
- * @param array $pParams The parameters to use for the POST body
500
- * @param null|array $pWPRemoteArgs wp_remote_request options.
501
- *
502
- * @return object[]|object|null
503
- *
504
- * @throws Freemius_Exception
505
- */
506
- public function MakeRequest(
507
- $pCanonizedPath,
508
- $pMethod = 'GET',
509
- $pParams = array(),
510
- $pWPRemoteArgs = null
511
- ) {
512
- $resource = explode( '?', $pCanonizedPath );
513
-
514
- // Only sign request if not ping.json connectivity test.
515
- $sign_request = ( '/v1/ping.json' !== strtolower( substr( $resource[0], - strlen( '/v1/ping.json' ) ) ) );
516
-
517
- return self::MakeStaticRequest(
518
- $pCanonizedPath,
519
- $pMethod,
520
- $pParams,
521
- $pWPRemoteArgs,
522
- $this->_isSandbox,
523
- $sign_request ? array( &$this, 'SignRequest' ) : null
524
- );
525
- }
526
-
527
- /**
528
- * Sets CURLOPT_IPRESOLVE to CURL_IPRESOLVE_V4 for cURL-Handle provided as parameter
529
- *
530
- * @param resource $handle A cURL handle returned by curl_init()
531
- *
532
- * @return resource $handle A cURL handle returned by curl_init() with CURLOPT_IPRESOLVE set to
533
- * CURL_IPRESOLVE_V4
534
- *
535
- * @link https://gist.github.com/golderweb/3a2aaec2d56125cc004e
536
- */
537
- static function CurlResolveToIPv4( $handle ) {
538
- curl_setopt( $handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
539
-
540
- return $handle;
541
- }
542
-
543
- #----------------------------------------------------------------------------------
544
- #region Connectivity Test
545
- #----------------------------------------------------------------------------------
546
-
547
- /**
548
- * If successful connectivity to the API endpoint using ping.json endpoint.
549
- *
550
- * - OR -
551
- *
552
- * Validate if ping result object is valid.
553
- *
554
- * @param mixed $pPong
555
- *
556
- * @return bool
557
- */
558
- public static function Test( $pPong = null ) {
559
- $pong = is_null( $pPong ) ?
560
- self::Ping() :
561
- $pPong;
562
-
563
- return (
564
- is_object( $pong ) &&
565
- isset( $pong->api ) &&
566
- 'pong' === $pong->api
567
- );
568
- }
569
-
570
- /**
571
- * Ping API to test connectivity.
572
- *
573
- * @return object
574
- */
575
- public static function Ping() {
576
- try {
577
- $result = self::MakeStaticRequest( '/v' . FS_API__VERSION . '/ping.json' );
578
- } catch ( Freemius_Exception $e ) {
579
- // Map to error object.
580
- $result = (object) $e->getResult();
581
- } catch ( Exception $e ) {
582
- // Map to error object.
583
- $result = (object) array(
584
- 'error' => (object) array(
585
- 'type' => 'Unknown',
586
- 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
587
- 'code' => 'unknown',
588
- 'http' => 402
589
- )
590
- );
591
- }
592
-
593
- return $result;
594
- }
595
-
596
- #endregion
597
-
598
- #----------------------------------------------------------------------------------
599
- #region Connectivity Exceptions
600
- #----------------------------------------------------------------------------------
601
-
602
- /**
603
- * @param \WP_Error $pError
604
- *
605
- * @return bool
606
- */
607
- private static function IsCurlError( WP_Error $pError ) {
608
- $message = $pError->get_error_message( 'http_request_failed' );
609
-
610
- return ( 0 === strpos( $message, 'cURL' ) );
611
- }
612
-
613
- /**
614
- * @param WP_Error $pError
615
- *
616
- * @throws Freemius_Exception
617
- */
618
- private static function ThrowWPRemoteException( WP_Error $pError ) {
619
- if ( self::IsCurlError( $pError ) ) {
620
- $message = $pError->get_error_message( 'http_request_failed' );
621
-
622
- #region Check if there are any missing cURL methods.
623
-
624
- $curl_required_methods = array(
625
- 'curl_version',
626
- 'curl_exec',
627
- 'curl_init',
628
- 'curl_close',
629
- 'curl_setopt',
630
- 'curl_setopt_array',
631
- 'curl_error',
632
- );
633
-
634
- // Find all missing methods.
635
- $missing_methods = array();
636
- foreach ( $curl_required_methods as $m ) {
637
- if ( ! function_exists( $m ) ) {
638
- $missing_methods[] = $m;
639
- }
640
- }
641
-
642
- if ( ! empty( $missing_methods ) ) {
643
- throw new Freemius_Exception( array(
644
- 'error' => (object) array(
645
- 'type' => 'cUrlMissing',
646
- 'message' => $message,
647
- 'code' => 'curl_missing',
648
- 'http' => 402
649
- ),
650
- 'missing_methods' => $missing_methods,
651
- ) );
652
- }
653
-
654
- #endregion
655
-
656
- // cURL error - "cURL error {{errno}}: {{error}}".
657
- $parts = explode( ':', substr( $message, strlen( 'cURL error ' ) ), 2 );
658
-
659
- $code = ( 0 < count( $parts ) ) ? $parts[0] : 'http_request_failed';
660
- $message = ( 1 < count( $parts ) ) ? $parts[1] : $message;
661
-
662
- $e = new Freemius_Exception( array(
663
- 'error' => (object) array(
664
- 'code' => $code,
665
- 'message' => $message,
666
- 'type' => 'CurlException',
667
- ),
668
- ) );
669
- } else {
670
- $e = new Freemius_Exception( array(
671
- 'error' => (object) array(
672
- 'code' => $pError->get_error_code(),
673
- 'message' => $pError->get_error_message(),
674
- 'type' => 'WPRemoteException',
675
- ),
676
- ) );
677
- }
678
-
679
- throw $e;
680
- }
681
-
682
- /**
683
- * @param string $pResult
684
- *
685
- * @throws Freemius_Exception
686
- */
687
- private static function ThrowCloudFlareDDoSException( $pResult = '' ) {
688
- throw new Freemius_Exception( array(
689
- 'error' => (object) array(
690
- 'type' => 'CloudFlareDDoSProtection',
691
- 'message' => $pResult,
692
- 'code' => 'cloudflare_ddos_protection',
693
- 'http' => 402
694
- )
695
- ) );
696
- }
697
-
698
- /**
699
- * @param string $pResult
700
- *
701
- * @throws Freemius_Exception
702
- */
703
- private static function ThrowSquidAclException( $pResult = '' ) {
704
- throw new Freemius_Exception( array(
705
- 'error' => (object) array(
706
- 'type' => 'SquidCacheBlock',
707
- 'message' => $pResult,
708
- 'code' => 'squid_cache_block',
709
- 'http' => 402
710
- )
711
- ) );
712
- }
713
-
714
- #endregion
715
- }
1
+ <?php
2
+ /**
3
+ * Copyright 2016 Freemius, Inc.
4
+ *
5
+ * Licensed under the GPL v2 (the "License"); you may
6
+ * not use this file except in compliance with the License. You may obtain
7
+ * a copy of the License at
8
+ *
9
+ * http://choosealicense.com/licenses/gpl-v2/
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+ if ( ! defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
+
21
+ require_once dirname( __FILE__ ) . '/FreemiusBase.php';
22
+
23
+ if ( ! defined( 'FS_SDK__USER_AGENT' ) ) {
24
+ define( 'FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION );
25
+ }
26
+
27
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_CURL' ) ) {
28
+ define( 'FS_SDK__SIMULATE_NO_CURL', false );
29
+ }
30
+
31
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
32
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
33
+ }
34
+
35
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
36
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
37
+ }
38
+
39
+ if ( ! defined( 'FS_SDK__HAS_CURL' ) ) {
40
+ if ( FS_SDK__SIMULATE_NO_CURL ) {
41
+ define( 'FS_SDK__HAS_CURL', false );
42
+ } else {
43
+ $curl_required_methods = array(
44
+ 'curl_version',
45
+ 'curl_exec',
46
+ 'curl_init',
47
+ 'curl_close',
48
+ 'curl_setopt',
49
+ 'curl_setopt_array',
50
+ 'curl_error',
51
+ );
52
+
53
+ $has_curl = true;
54
+ foreach ( $curl_required_methods as $m ) {
55
+ if ( ! function_exists( $m ) ) {
56
+ $has_curl = false;
57
+ break;
58
+ }
59
+ }
60
+
61
+ define( 'FS_SDK__HAS_CURL', $has_curl );
62
+ }
63
+ }
64
+
65
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
66
+ define( 'FS_SDK__SSLVERIFY', false );
67
+ }
68
+
69
+ $curl_version = FS_SDK__HAS_CURL ?
70
+ curl_version() :
71
+ array( 'version' => '7.37' );
72
+
73
+ if ( ! defined( 'FS_API__PROTOCOL' ) ) {
74
+ define( 'FS_API__PROTOCOL', version_compare( $curl_version['version'], '7.37', '>=' ) ? 'https' : 'http' );
75
+ }
76
+
77
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
78
+ define( 'FS_API__LOGGER_ON', false );
79
+ }
80
+
81
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
82
+ define( 'FS_API__ADDRESS', '://api.freemius.com' );
83
+ }
84
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
85
+ define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
86
+ }
87
+
88
+ if ( class_exists( 'Freemius_Api_WordPress' ) ) {
89
+ return;
90
+ }
91
+
92
+ class Freemius_Api_WordPress extends Freemius_Api_Base {
93
+ private static $_logger = array();
94
+
95
+ /**
96
+ * @param string $pScope 'app', 'developer', 'user' or 'install'.
97
+ * @param number $pID Element's id.
98
+ * @param string $pPublic Public key.
99
+ * @param string|bool $pSecret Element's secret key.
100
+ * @param bool $pSandbox Whether or not to run API in sandbox mode.
101
+ */
102
+ public function __construct( $pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false ) {
103
+ // If secret key not provided, use public key encryption.
104
+ if ( is_bool( $pSecret ) ) {
105
+ $pSecret = $pPublic;
106
+ }
107
+
108
+ parent::Init( $pScope, $pID, $pPublic, $pSecret, $pSandbox );
109
+ }
110
+
111
+ public static function GetUrl( $pCanonizedPath = '', $pIsSandbox = false ) {
112
+ $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
113
+
114
+ if ( ':' === $address[0] ) {
115
+ $address = self::$_protocol . $address;
116
+ }
117
+
118
+ return $address . $pCanonizedPath;
119
+ }
120
+
121
+ #----------------------------------------------------------------------------------
122
+ #region Servers Clock Diff
123
+ #----------------------------------------------------------------------------------
124
+
125
+ /**
126
+ * @var int Clock diff in seconds between current server to API server.
127
+ */
128
+ private static $_clock_diff = 0;
129
+
130
+ /**
131
+ * Set clock diff for all API calls.
132
+ *
133
+ * @since 1.0.3
134
+ *
135
+ * @param $pSeconds
136
+ */
137
+ public static function SetClockDiff( $pSeconds ) {
138
+ self::$_clock_diff = $pSeconds;
139
+ }
140
+
141
+ /**
142
+ * Find clock diff between current server to API server.
143
+ *
144
+ * @since 1.0.2
145
+ * @return int Clock diff in seconds.
146
+ */
147
+ public static function FindClockDiff() {
148
+ $time = time();
149
+ $pong = self::Ping();
150
+
151
+ return ( $time - strtotime( $pong->timestamp ) );
152
+ }
153
+
154
+ #endregion
155
+
156
+ /**
157
+ * @var string http or https
158
+ */
159
+ private static $_protocol = FS_API__PROTOCOL;
160
+
161
+ /**
162
+ * Set API connection protocol.
163
+ *
164
+ * @since 1.0.4
165
+ */
166
+ public static function SetHttp() {
167
+ self::$_protocol = 'http';
168
+ }
169
+
170
+ /**
171
+ * @since 1.0.4
172
+ *
173
+ * @return bool
174
+ */
175
+ public static function IsHttps() {
176
+ return ( 'https' === self::$_protocol );
177
+ }
178
+
179
+ /**
180
+ * Sign request with the following HTTP headers:
181
+ * Content-MD5: MD5(HTTP Request body)
182
+ * Date: Current date (i.e Sat, 14 Feb 2016 20:24:46 +0000)
183
+ * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
184
+ * {scope_entity_secret_key}))
185
+ *
186
+ * @param string $pResourceUrl
187
+ * @param array $pWPRemoteArgs
188
+ *
189
+ * @return array
190
+ */
191
+ function SignRequest( $pResourceUrl, $pWPRemoteArgs ) {
192
+ $auth = $this->GenerateAuthorizationParams(
193
+ $pResourceUrl,
194
+ $pWPRemoteArgs['method'],
195
+ ! empty( $pWPRemoteArgs['body'] ) ? $pWPRemoteArgs['body'] : ''
196
+ );
197
+
198
+ $pWPRemoteArgs['headers']['Date'] = $auth['date'];
199
+ $pWPRemoteArgs['headers']['Authorization'] = $auth['authorization'];
200
+
201
+ if ( ! empty( $auth['content_md5'] ) ) {
202
+ $pWPRemoteArgs['headers']['Content-MD5'] = $auth['content_md5'];
203
+ }
204
+
205
+ return $pWPRemoteArgs;
206
+ }
207
+
208
+ /**
209
+ * Generate Authorization request headers:
210
+ *
211
+ * Content-MD5: MD5(HTTP Request body)
212
+ * Date: Current date (i.e Sat, 14 Feb 2016 20:24:46 +0000)
213
+ * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
214
+ * {scope_entity_secret_key}))
215
+ *
216
+ * @author Vova Feldman
217
+ *
218
+ * @param string $pResourceUrl
219
+ * @param string $pMethod
220
+ * @param string $pPostParams
221
+ *
222
+ * @return array
223
+ * @throws Freemius_Exception
224
+ */
225
+ function GenerateAuthorizationParams(
226
+ $pResourceUrl,
227
+ $pMethod = 'GET',
228
+ $pPostParams = ''
229
+ ) {
230
+ $pMethod = strtoupper( $pMethod );
231
+
232
+ $eol = "\n";
233
+ $content_md5 = '';
234
+ $content_type = '';
235
+ $now = ( time() - self::$_clock_diff );
236
+ $date = date( 'r', $now );
237
+
238
+ if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
239
+ $content_type = 'application/json';
240
+
241
+ if ( ! empty( $pPostParams ) ) {
242
+ $content_md5 = md5( $pPostParams );
243
+ }
244
+ }
245
+
246
+ $string_to_sign = implode( $eol, array(
247
+ $pMethod,
248
+ $content_md5,
249
+ $content_type,
250
+ $date,
251
+ $pResourceUrl
252
+ ) );
253
+
254
+ // If secret and public keys are identical, it means that
255
+ // the signature uses public key hash encoding.
256
+ $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
257
+
258
+ $auth = array(
259
+ 'date' => $date,
260
+ 'authorization' => $auth_type . ' ' . $this->_id . ':' .
261
+ $this->_public . ':' .
262
+ self::Base64UrlEncode( hash_hmac(
263
+ 'sha256', $string_to_sign, $this->_secret
264
+ ) )
265
+ );
266
+
267
+ if ( ! empty( $content_md5 ) ) {
268
+ $auth['content_md5'] = $content_md5;
269
+ }
270
+
271
+ return $auth;
272
+ }
273
+
274
+ /**
275
+ * Get API request URL signed via query string.
276
+ *
277
+ * @since 1.2.3 Stopped using http_build_query(). Instead, use urlencode(). In some environments the encoding of http_build_query() can generate a URL that once used with a redirect, the `&` querystring separator is escaped to `&amp;` which breaks the URL (Added by @svovaf).
278
+ *
279
+ * @param string $pPath
280
+ *
281
+ * @throws Freemius_Exception
282
+ *
283
+ * @return string
284
+ */
285
+ function GetSignedUrl( $pPath ) {
286
+ $resource = explode( '?', $this->CanonizePath( $pPath ) );
287
+ $pResourceUrl = $resource[0];
288
+
289
+ $auth = $this->GenerateAuthorizationParams( $pResourceUrl );
290
+
291
+ return Freemius_Api_WordPress::GetUrl(
292
+ $pResourceUrl . '?' .
293
+ ( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
294
+ 'authorization=' . urlencode( $auth['authorization'] ) .
295
+ '&auth_date=' . urlencode( $auth['date'] )
296
+ , $this->_isSandbox );
297
+ }
298
+
299
+ /**
300
+ * @author Vova Feldman
301
+ *
302
+ * @param string $pUrl
303
+ * @param array $pWPRemoteArgs
304
+ *
305
+ * @return mixed
306
+ */
307
+ private static function ExecuteRequest( $pUrl, &$pWPRemoteArgs ) {
308
+ $start = microtime( true );
309
+
310
+ $response = wp_remote_request( $pUrl, $pWPRemoteArgs );
311
+
312
+ if ( FS_API__LOGGER_ON ) {
313
+ $end = microtime( true );
314
+
315
+ $has_body = ( isset( $pWPRemoteArgs['body'] ) && ! empty( $pWPRemoteArgs['body'] ) );
316
+ $is_http_error = is_wp_error( $response );
317
+
318
+ self::$_logger[] = array(
319
+ 'id' => count( self::$_logger ),
320
+ 'start' => $start,
321
+ 'end' => $end,
322
+ 'total' => ( $end - $start ),
323
+ 'method' => $pWPRemoteArgs['method'],
324
+ 'path' => $pUrl,
325
+ 'body' => $has_body ? $pWPRemoteArgs['body'] : null,
326
+ 'result' => ! $is_http_error ?
327
+ $response['body'] :
328
+ json_encode( $response->get_error_messages() ),
329
+ 'code' => ! $is_http_error ? $response['response']['code'] : null,
330
+ 'backtrace' => debug_backtrace(),
331
+ );
332
+ }
333
+
334
+ return $response;
335
+ }
336
+
337
+ /**
338
+ * @return array
339
+ */
340
+ static function GetLogger() {
341
+ return self::$_logger;
342
+ }
343
+
344
+ /**
345
+ * @param string $pCanonizedPath
346
+ * @param string $pMethod
347
+ * @param array $pParams
348
+ * @param null|array $pWPRemoteArgs
349
+ * @param bool $pIsSandbox
350
+ * @param null|callable $pBeforeExecutionFunction
351
+ *
352
+ * @return object[]|object|null
353
+ *
354
+ * @throws \Freemius_Exception
355
+ */
356
+ private static function MakeStaticRequest(
357
+ $pCanonizedPath,
358
+ $pMethod = 'GET',
359
+ $pParams = array(),
360
+ $pWPRemoteArgs = null,
361
+ $pIsSandbox = false,
362
+ $pBeforeExecutionFunction = null
363
+ ) {
364
+ // Connectivity errors simulation.
365
+ if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
366
+ self::ThrowCloudFlareDDoSException();
367
+ } elseif ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
368
+ self::ThrowSquidAclException();
369
+ }
370
+
371
+ if ( empty( $pWPRemoteArgs ) ) {
372
+ $user_agent = 'Freemius/WordPress-SDK/' . Freemius_Api_Base::VERSION . '; ' .
373
+ home_url();
374
+
375
+ $pWPRemoteArgs = array(
376
+ 'method' => strtoupper( $pMethod ),
377
+ 'connect_timeout' => 10,
378
+ 'timeout' => 60,
379
+ 'follow_redirects' => true,
380
+ 'redirection' => 5,
381
+ 'user-agent' => $user_agent,
382
+ 'blocking' => true,
383
+ );
384
+ }
385
+
386
+ if ( ! isset( $pWPRemoteArgs['headers'] ) ||
387
+ ! is_array( $pWPRemoteArgs['headers'] )
388
+ ) {
389
+ $pWPRemoteArgs['headers'] = array();
390
+ }
391
+
392
+ if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
393
+ $pWPRemoteArgs['headers']['Content-type'] = 'application/json';
394
+
395
+ if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
396
+ $pWPRemoteArgs['body'] = json_encode( $pParams );
397
+ }
398
+ }
399
+
400
+ $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
401
+
402
+ $resource = explode( '?', $pCanonizedPath );
403
+
404
+ if ( FS_SDK__HAS_CURL ) {
405
+ // Disable the 'Expect: 100-continue' behaviour. This causes cURL to wait
406
+ // for 2 seconds if the server does not support this header.
407
+ $pWPRemoteArgs['headers']['Expect'] = '';
408
+ }
409
+
410
+ if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
411
+ $pWPRemoteArgs['sslverify'] = FS_SDK__SSLVERIFY;
412
+ }
413
+
414
+ if ( false !== $pBeforeExecutionFunction &&
415
+ is_callable( $pBeforeExecutionFunction )
416
+ ) {
417
+ $pWPRemoteArgs = call_user_func( $pBeforeExecutionFunction, $resource[0], $pWPRemoteArgs );
418
+ }
419
+
420
+ $result = self::ExecuteRequest( $request_url, $pWPRemoteArgs );
421
+
422
+ if ( is_wp_error( $result ) ) {
423
+ /**
424
+ * @var WP_Error $result
425
+ */
426
+ if ( self::IsCurlError( $result ) ) {
427
+ /**
428
+ * With dual stacked DNS responses, it's possible for a server to
429
+ * have IPv6 enabled but not have IPv6 connectivity. If this is
430
+ * the case, cURL will try IPv4 first and if that fails, then it will
431
+ * fall back to IPv6 and the error EHOSTUNREACH is returned by the
432
+ * operating system.
433
+ */
434
+ $matches = array();
435
+ $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
436
+ if ( preg_match( $regex, $result->get_error_message( 'http_request_failed' ), $matches ) ) {
437
+ /**
438
+ * Validate IP before calling `inet_pton()` to avoid PHP un-catchable warning.
439
+ * @author Vova Feldman (@svovaf)
440
+ */
441
+ if ( filter_var( $matches[1], FILTER_VALIDATE_IP ) ) {
442
+ if ( strlen( inet_pton( $matches[1] ) ) === 16 ) {
443
+ // error_log('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
444
+ // Hook to an action triggered just before cURL is executed to resolve the IP version to v4.
445
+ add_action( 'http_api_curl', 'Freemius_Api_WordPress::CurlResolveToIPv4', 10, 1 );
446
+
447
+ // Re-run request.
448
+ $result = self::ExecuteRequest( $request_url, $pWPRemoteArgs );
449
+ }
450
+ }
451
+ }
452
+ }
453
+
454
+ if ( is_wp_error( $result ) ) {
455
+ self::ThrowWPRemoteException( $result );
456
+ }
457
+ }
458
+
459
+ $response_body = $result['body'];
460
+
461
+ if ( empty( $response_body ) ) {
462
+ return null;
463
+ }
464
+
465
+ $decoded = json_decode( $response_body );
466
+
467
+ if ( is_null( $decoded ) ) {
468
+ if ( preg_match( '/Please turn JavaScript on/i', $response_body ) &&
469
+ preg_match( '/text\/javascript/', $response_body )
470
+ ) {
471
+ self::ThrowCloudFlareDDoSException( $response_body );
472
+ } elseif ( preg_match( '/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $response_body ) &&
473
+ preg_match( '/squid/', $response_body )
474
+ ) {
475
+ self::ThrowSquidAclException( $response_body );
476
+ } else {
477
+ $decoded = (object) array(
478
+ 'error' => (object) array(
479
+ 'type' => 'Unknown',
480
+ 'message' => $response_body,
481
+ 'code' => 'unknown',
482
+ 'http' => 402
483
+ )
484
+ );
485
+ }
486
+ }
487
+
488
+ return $decoded;
489
+ }
490
+
491
+
492
+ /**
493
+ * Makes an HTTP request. This method can be overridden by subclasses if
494
+ * developers want to do fancier things or use something other than wp_remote_request()
495
+ * to make the request.
496
+ *
497
+ * @param string $pCanonizedPath The URL to make the request to
498
+ * @param string $pMethod HTTP method
499
+ * @param array $pParams The parameters to use for the POST body
500
+ * @param null|array $pWPRemoteArgs wp_remote_request options.
501
+ *
502
+ * @return object[]|object|null
503
+ *
504
+ * @throws Freemius_Exception
505
+ */
506
+ public function MakeRequest(
507
+ $pCanonizedPath,
508
+ $pMethod = 'GET',
509
+ $pParams = array(),
510
+ $pWPRemoteArgs = null
511
+ ) {
512
+ $resource = explode( '?', $pCanonizedPath );
513
+
514
+ // Only sign request if not ping.json connectivity test.
515
+ $sign_request = ( '/v1/ping.json' !== strtolower( substr( $resource[0], - strlen( '/v1/ping.json' ) ) ) );
516
+
517
+ return self::MakeStaticRequest(
518
+ $pCanonizedPath,
519
+ $pMethod,
520
+ $pParams,
521
+ $pWPRemoteArgs,
522
+ $this->_isSandbox,
523
+ $sign_request ? array( &$this, 'SignRequest' ) : null
524
+ );
525
+ }
526
+
527
+ /**
528
+ * Sets CURLOPT_IPRESOLVE to CURL_IPRESOLVE_V4 for cURL-Handle provided as parameter
529
+ *
530
+ * @param resource $handle A cURL handle returned by curl_init()
531
+ *
532
+ * @return resource $handle A cURL handle returned by curl_init() with CURLOPT_IPRESOLVE set to
533
+ * CURL_IPRESOLVE_V4
534
+ *
535
+ * @link https://gist.github.com/golderweb/3a2aaec2d56125cc004e
536
+ */
537
+ static function CurlResolveToIPv4( $handle ) {
538
+ curl_setopt( $handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
539
+
540
+ return $handle;
541
+ }
542
+
543
+ #----------------------------------------------------------------------------------
544
+ #region Connectivity Test
545
+ #----------------------------------------------------------------------------------
546
+
547
+ /**
548
+ * If successful connectivity to the API endpoint using ping.json endpoint.
549
+ *
550
+ * - OR -
551
+ *
552
+ * Validate if ping result object is valid.
553
+ *
554
+ * @param mixed $pPong
555
+ *
556
+ * @return bool
557
+ */
558
+ public static function Test( $pPong = null ) {
559
+ $pong = is_null( $pPong ) ?
560
+ self::Ping() :
561
+ $pPong;
562
+
563
+ return (
564
+ is_object( $pong ) &&
565
+ isset( $pong->api ) &&
566
+ 'pong' === $pong->api
567
+ );
568
+ }
569
+
570
+ /**
571
+ * Ping API to test connectivity.
572
+ *
573
+ * @return object
574
+ */
575
+ public static function Ping() {
576
+ try {
577
+ $result = self::MakeStaticRequest( '/v' . FS_API__VERSION . '/ping.json' );
578
+ } catch ( Freemius_Exception $e ) {
579
+ // Map to error object.
580
+ $result = (object) $e->getResult();
581
+ } catch ( Exception $e ) {
582
+ // Map to error object.
583
+ $result = (object) array(
584
+ 'error' => (object) array(
585
+ 'type' => 'Unknown',
586
+ 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
587
+ 'code' => 'unknown',
588
+ 'http' => 402
589
+ )
590
+ );
591
+ }
592
+
593
+ return $result;
594
+ }
595
+
596
+ #endregion
597
+
598
+ #----------------------------------------------------------------------------------
599
+ #region Connectivity Exceptions
600
+ #----------------------------------------------------------------------------------
601
+
602
+ /**
603
+ * @param \WP_Error $pError
604
+ *
605
+ * @return bool
606
+ */
607
+ private static function IsCurlError( WP_Error $pError ) {
608
+ $message = $pError->get_error_message( 'http_request_failed' );
609
+
610
+ return ( 0 === strpos( $message, 'cURL' ) );
611
+ }
612
+
613
+ /**
614
+ * @param WP_Error $pError
615
+ *
616
+ * @throws Freemius_Exception
617
+ */
618
+ private static function ThrowWPRemoteException( WP_Error $pError ) {
619
+ if ( self::IsCurlError( $pError ) ) {
620
+ $message = $pError->get_error_message( 'http_request_failed' );
621
+
622
+ #region Check if there are any missing cURL methods.
623
+
624
+ $curl_required_methods = array(
625
+ 'curl_version',
626
+ 'curl_exec',
627
+ 'curl_init',
628
+ 'curl_close',
629
+ 'curl_setopt',
630
+ 'curl_setopt_array',
631
+ 'curl_error',
632
+ );
633
+
634
+ // Find all missing methods.
635
+ $missing_methods = array();
636
+ foreach ( $curl_required_methods as $m ) {
637
+ if ( ! function_exists( $m ) ) {
638
+ $missing_methods[] = $m;
639
+ }
640
+ }
641
+
642
+ if ( ! empty( $missing_methods ) ) {
643
+ throw new Freemius_Exception( array(
644
+ 'error' => (object) array(
645
+ 'type' => 'cUrlMissing',
646
+ 'message' => $message,
647
+ 'code' => 'curl_missing',
648
+ 'http' => 402
649
+ ),
650
+ 'missing_methods' => $missing_methods,
651
+ ) );
652
+ }
653
+
654
+ #endregion
655
+
656
+ // cURL error - "cURL error {{errno}}: {{error}}".
657
+ $parts = explode( ':', substr( $message, strlen( 'cURL error ' ) ), 2 );
658
+
659
+ $code = ( 0 < count( $parts ) ) ? $parts[0] : 'http_request_failed';
660
+ $message = ( 1 < count( $parts ) ) ? $parts[1] : $message;
661
+
662
+ $e = new Freemius_Exception( array(
663
+ 'error' => (object) array(
664
+ 'code' => $code,
665
+ 'message' => $message,
666
+ 'type' => 'CurlException',
667
+ ),
668
+ ) );
669
+ } else {
670
+ $e = new Freemius_Exception( array(
671
+ 'error' => (object) array(
672
+ 'code' => $pError->get_error_code(),
673
+ 'message' => $pError->get_error_message(),
674
+ 'type' => 'WPRemoteException',
675
+ ),
676
+ ) );
677
+ }
678
+
679
+ throw $e;
680
+ }
681
+
682
+ /**
683
+ * @param string $pResult
684
+ *
685
+ * @throws Freemius_Exception
686
+ */
687
+ private static function ThrowCloudFlareDDoSException( $pResult = '' ) {
688
+ throw new Freemius_Exception( array(
689
+ 'error' => (object) array(
690
+ 'type' => 'CloudFlareDDoSProtection',
691
+ 'message' => $pResult,
692
+ 'code' => 'cloudflare_ddos_protection',
693
+ 'http' => 402
694
+ )
695
+ ) );
696
+ }
697
+
698
+ /**
699
+ * @param string $pResult
700
+ *
701
+ * @throws Freemius_Exception
702
+ */
703
+ private static function ThrowSquidAclException( $pResult = '' ) {
704
+ throw new Freemius_Exception( array(
705
+ 'error' => (object) array(
706
+ 'type' => 'SquidCacheBlock',
707
+ 'message' => $pResult,
708
+ 'code' => 'squid_cache_block',
709
+ 'http' => 402
710
+ )
711
+ ) );
712
+ }
713
+
714
+ #endregion
715
+ }
freemius/templates/account.php CHANGED
@@ -1,1098 +1,1098 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- * @var Freemius $fs
16
- */
17
- $fs = freemius( $VARS['id'] );
18
-
19
- $slug = $fs->get_slug();
20
-
21
- /**
22
- * @var FS_Plugin_Tag $update
23
- */
24
- $update = $fs->has_release_on_freemius() ?
25
- $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 ) :
26
- null;
27
-
28
- if ( is_object($update) ) {
29
- /**
30
- * This logic is particularly required for multisite environment.
31
- * If a module is site activated (not network) and not on the main site,
32
- * the module will NOT be executed on the network level, therefore, the
33
- * custom updates logic will not be executed as well, so unless we force
34
- * the injection of the update into the updates transient, premium updates
35
- * will not work.
36
- *
37
- * @author Vova Feldman (@svovaf)
38
- * @since 2.0.0
39
- */
40
- $updater = FS_Plugin_Updater::instance( $fs );
41
- $updater->set_update_data( $update );
42
- }
43
-
44
- $is_paying = $fs->is_paying();
45
- $user = $fs->get_user();
46
- $site = $fs->get_site();
47
- $name = $user->get_name();
48
- $license = $fs->_get_license();
49
- $is_data_debug_mode = $fs->is_data_debug_mode();
50
- $is_whitelabeled = $fs->is_whitelabeled();
51
- $subscription = ( is_object( $license ) ?
52
- $fs->_get_subscription( $license->id ) :
53
- null );
54
- $plan = $fs->get_plan();
55
- $is_active_subscription = ( is_object( $subscription ) && $subscription->is_active() );
56
- $is_paid_trial = $fs->is_paid_trial();
57
- $has_paid_plan = $fs->apply_filters( 'has_paid_plan_account', $fs->has_paid_plan() );
58
- $show_upgrade = ( ! $is_whitelabeled && $has_paid_plan && ! $is_paying && ! $is_paid_trial );
59
- $trial_plan = $fs->get_trial_plan();
60
-
61
- if ( $has_paid_plan ) {
62
- $fs->_add_license_activation_dialog_box();
63
- }
64
-
65
- $ids_of_installs_activated_with_foreign_licenses = $fs->should_handle_user_change() ?
66
- $fs->get_installs_ids_with_foreign_licenses() :
67
- array();
68
-
69
- if ( ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) {
70
- $fs->_add_user_change_dialog_box( $ids_of_installs_activated_with_foreign_licenses );
71
- }
72
-
73
- if ( $fs->is_whitelabeled( true ) || $fs->is_data_debug_mode() ) {
74
- $fs->_add_data_debug_mode_dialog_box();
75
- }
76
-
77
- if ( fs_request_get_bool( 'auto_install' ) ) {
78
- $fs->_add_auto_installation_dialog_box();
79
- }
80
-
81
- if ( fs_request_get_bool( 'activate_license' ) ) {
82
- // Open the license activation dialog box on the account page.
83
- add_action( 'admin_footer', array(
84
- &$fs,
85
- '_open_license_activation_dialog_box'
86
- ) );
87
- }
88
-
89
- $payments = $fs->_fetch_payments();
90
-
91
- $show_billing = ( ! $is_whitelabeled && is_array( $payments ) && 0 < count( $payments ) );
92
-
93
-
94
- $has_tabs = $fs->_add_tabs_before_content();
95
-
96
- if ( $has_tabs ) {
97
- $query_params['tabs'] = 'true';
98
- }
99
-
100
- // Aliases.
101
- $download_latest_text = fs_text_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $slug );
102
- $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
103
- $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
104
- /* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
105
- $downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
106
- $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
107
- $cancel_trial_confirm_text = fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug );
108
- $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
109
- $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
110
- /* translators: %s: Plan title (e.g. "Professional") */
111
- $activate_plan_text = fs_text_inline( 'Activate %s Plan', 'activate-x-plan', $slug );
112
- $version_text = fs_text_x_inline( 'Version', 'product version', 'version', $slug );
113
- /* translators: %s: Time period (e.g. Auto renews in "2 months") */
114
- $renews_in_text = fs_text_inline( 'Auto renews in %s', 'renews-in', $slug );
115
- /* translators: %s: Time period (e.g. Expires in "2 months") */
116
- $expires_in_text = fs_text_inline( 'Expires in %s', 'expires-in', $slug );
117
- $sync_license_text = fs_text_x_inline( 'Sync License', 'as synchronize license', 'sync-license', $slug );
118
- $cancel_trial_text = fs_text_inline( 'Cancel Trial', 'cancel-trial', $slug );
119
- $change_plan_text = fs_text_inline( 'Change Plan', 'change-plan', $slug );
120
- $upgrade_text = fs_text_x_inline( 'Upgrade', 'verb', 'upgrade', $slug );
121
- $addons_text = fs_text_inline( 'Add-Ons', 'add-ons', $slug );
122
- $downgrade_text = fs_text_x_inline( 'Downgrade', 'verb', 'downgrade', $slug );
123
- $trial_text = fs_text_x_inline( 'Trial', 'trial period', 'trial', $slug );
124
- $free_text = fs_text_inline( 'Free', 'free', $slug );
125
- $activate_text = fs_text_inline( 'Activate', 'activate', $slug );
126
- $plan_text = fs_text_x_inline( 'Plan', 'as product pricing plan', 'plan', $slug );
127
- $bundle_plan_text = fs_text_inline( 'Bundle Plan', 'bundle-plan', $slug );
128
-
129
- $show_plan_row = true;
130
- $show_license_row = is_object( $license );
131
-
132
- $site_view_params = array();
133
-
134
- if ( fs_is_network_admin() ) {
135
- $sites = Freemius::get_sites();
136
- $all_installs_plan_id = null;
137
- $all_installs_license_id = ( $show_license_row ? $license->id : null );
138
- foreach ( $sites as $s ) {
139
- $site_info = $fs->get_site_info( $s );
140
- $install = $fs->get_install_by_blog_id( $site_info['blog_id'] );
141
- $view_params = array(
142
- 'freemius' => $fs,
143
- 'license' => $license,
144
- 'site' => $site_info,
145
- 'install' => $install,
146
- );
147
-
148
- $site_view_params[] = $view_params;
149
-
150
- if ( empty( $install ) ) {
151
- continue;
152
- }
153
-
154
- if ( $show_plan_row ) {
155
- if ( is_null( $all_installs_plan_id ) ) {
156
- $all_installs_plan_id = $install->plan_id;
157
- } elseif ( $all_installs_plan_id != $install->plan_id ) {
158
- $show_plan_row = false;
159
- }
160
- }
161
-
162
- if ( $show_license_row && $all_installs_license_id != $install->license_id ) {
163
- $show_license_row = false;
164
- }
165
- }
166
- }
167
-
168
- $has_bundle_license = false;
169
-
170
- if ( is_object( $license ) &&
171
- FS_Plugin_License::is_valid_id( $license->parent_license_id )
172
- ) {
173
- // Context license has a parent license, therefore, the account has a bundle license.
174
- $has_bundle_license = true;
175
- }
176
-
177
- $bundle_subscription = null;
178
- $is_bundle_first_payment_pending = false;
179
-
180
- if (
181
- $show_plan_row &&
182
- is_object( $license ) &&
183
- $has_bundle_license
184
- ) {
185
- $bundle_plan_title = strtoupper( $license->parent_plan_title );
186
- $bundle_subscription = $fs->_get_subscription( $license->parent_license_id );
187
- $is_bundle_first_payment_pending = $license->is_first_payment_pending();
188
- }
189
-
190
- $fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
191
- get_current_blog_id() :
192
- 0;
193
-
194
- $active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
195
-
196
- $is_premium = $fs->is_premium();
197
-
198
- $account_addons = $fs->get_updated_account_addons();
199
- $installed_addons = $fs->get_installed_addons();
200
- $installed_addons_ids = array();
201
-
202
- /**
203
- * Store the installed add-ons' IDs into a collection which will be used in determining the add-ons to show on the "Account" page, and at the same time try to find an add-on that is activated with a bundle license if the core product is not.
204
- *
205
- * @author Leo Fajardo
206
- *
207
- * @since 2.4.0
208
- */
209
- foreach ( $installed_addons as $fs_addon ) {
210
- $installed_addons_ids[] = $fs_addon->get_id();
211
-
212
- if ( $has_bundle_license ) {
213
- // We already have the context bundle license details, skip.
214
- continue;
215
- }
216
-
217
- if (
218
- $show_plan_row &&
219
- $fs_addon->has_active_valid_license()
220
- ) {
221
- $addon_license = $fs_addon->_get_license();
222
-
223
- if ( FS_Plugin_License::is_valid_id( $addon_license->parent_license_id ) ) {
224
- // Add-on's license is associated with a parent/bundle license.
225
- $has_bundle_license = true;
226
-
227
- $bundle_plan_title = strtoupper( $addon_license->parent_plan_title );
228
- $bundle_subscription = $fs_addon->_get_subscription( $addon_license->parent_license_id );
229
- $is_bundle_first_payment_pending = $addon_license->is_first_payment_pending();
230
- }
231
- }
232
- }
233
-
234
- $addons_to_show = array_unique( array_merge( $installed_addons_ids, $account_addons ) );
235
-
236
- $is_active_bundle_subscription = ( is_object( $bundle_subscription ) && $bundle_subscription->is_active() );
237
- ?>
238
- <div class="wrap fs-section">
239
- <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
240
- <h2 class="nav-tab-wrapper">
241
- <a href="<?php echo $fs->get_account_url() ?>"
242
- class="nav-tab nav-tab-active"><?php fs_esc_html_echo_inline( 'Account', 'account', $slug ) ?></a>
243
- <?php if ( $fs->has_addons() ) : ?>
244
- <a href="<?php echo $fs->_get_admin_page_url( 'addons' ) ?>"
245
- class="nav-tab"><?php echo esc_html( $addons_text ) ?></a>
246
- <?php endif ?>
247
- <?php if ( $show_upgrade ) : ?>
248
- <a href="<?php echo $fs->get_upgrade_url() ?>" class="nav-tab"><?php echo esc_html( $upgrade_text ) ?></a>
249
- <?php if ( $fs->apply_filters( 'show_trial', true ) && ! $fs->is_trial_utilized() && $fs->has_trial_plan() ) : ?>
250
- <a href="<?php echo $fs->get_trial_url() ?>" class="nav-tab"><?php fs_esc_html_echo_inline( 'Free Trial', 'free-trial', $slug ) ?></a>
251
- <?php endif ?>
252
- <?php endif ?>
253
- </h2>
254
- <?php endif ?>
255
-
256
- <div id="poststuff">
257
- <div id="fs_account">
258
- <div class="has-sidebar has-right-sidebar">
259
- <div class="has-sidebar-content">
260
- <div class="postbox">
261
- <h3><span class="dashicons dashicons-businessman"></span> <?php fs_esc_html_echo_inline( 'Account Details', 'account-details', $slug ) ?></h3>
262
- <div class="fs-header-actions">
263
- <ul>
264
- <?php if ( $fs->is_whitelabeled( true ) ) : ?>
265
- <li>
266
- <a href="#" class="debug-license-trigger"><i class="dashicons dashicons-<?php echo $is_whitelabeled ? 'editor-code' : 'controls-pause' ?>"></i> <span><?php
267
- if ( $is_whitelabeled ) {
268
- fs_esc_html_echo_inline( 'Start Debug', 'start-debug-license', $slug );
269
- } else {
270
- fs_esc_html_echo_inline( 'Stop Debug', 'stop-debug-license', $slug );
271
- }
272
- ?></span></a>
273
- </li>
274
- <li>&nbsp;&bull;&nbsp;</li>
275
- <?php endif ?>
276
- <?php if ( $show_billing ) : ?>
277
- <li><a href="#fs_billing"><i class="dashicons dashicons-portfolio"></i> <?php fs_esc_html_echo_inline( 'Billing & Invoices', 'billing-invoices', $slug ) ?></li>
278
- <li>&nbsp;&bull;&nbsp;</li>
279
- <?php endif ?>
280
- <?php if ( ! $is_whitelabeled ) : ?>
281
- <?php if ( ! $is_paying ) : ?>
282
- <li>
283
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
284
- <input type="hidden" name="fs_action" value="delete_account">
285
- <?php wp_nonce_field( 'delete_account' ) ?>
286
- <a class="fs-delete-account" href="#" onclick="if (confirm('<?php
287
- if ( $is_active_subscription ) {
288
- echo esc_attr( sprintf( fs_text_inline( 'Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the "Cancel" button, and first "Downgrade" your account. Are you sure you would like to continue with the deletion?', 'delete-account-x-confirm', $slug ), $plan->title ) );
289
- } else {
290
- echo esc_attr( sprintf( fs_text_inline( 'Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?', 'delete-account-confirm', $slug ), $fs->get_module_label( true ) ) );
291
- }
292
- ?>')) this.parentNode.submit(); return false;"><i
293
- class="dashicons dashicons-no"></i> <?php fs_esc_html_echo_inline( 'Delete Account', 'delete-account', $slug ) ?></a>
294
- </form>
295
- </li>
296
- <li>&nbsp;&bull;&nbsp;</li>
297
- <?php endif ?>
298
- <?php if ( $is_paying ) : ?>
299
- <?php if ( ! fs_is_network_admin() ) : ?>
300
- <li>
301
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
302
- <input type="hidden" name="fs_action" value="deactivate_license">
303
- <?php wp_nonce_field( 'deactivate_license' ) ?>
304
- <a href="#" class="fs-deactivate-license"><i
305
- class="dashicons dashicons-admin-network"></i> <?php fs_echo_inline( 'Deactivate License', 'deactivate-license', $slug ) ?>
306
- </a>
307
- </form>
308
- </li>
309
- <li>&nbsp;&bull;&nbsp;</li>
310
- <?php endif ?>
311
- <?php if ( ! $license->is_lifetime() &&
312
- $is_active_subscription
313
- ) : ?>
314
- <li>
315
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
316
- <input type="hidden" name="fs_action" value="downgrade_account">
317
- <?php wp_nonce_field( 'downgrade_account' ) ?>
318
- <a href="#"
319
- onclick="if ( confirm('<?php echo esc_attr( sprintf(
320
- $downgrade_x_confirm_text,
321
- ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
322
- $plan->title,
323
- human_time_diff( time(), strtotime( $license->expiration ) )
324
- ) ) ?> <?php if ( ! $license->is_block_features ) {
325
- echo esc_attr( sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) ) );
326
- } else {
327
- echo esc_attr( sprintf( $after_downgrade_blocking_text, $plan->title ) );
328
- }?> <?php echo esc_attr( $prices_increase_text ) ?> <?php fs_esc_attr_echo_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug ) ?>') ) this.parentNode.submit(); return false;"><i class="dashicons dashicons-download"></i> <?php echo esc_html( $fs->is_only_premium() ? fs_text_inline( 'Cancel Subscription', 'cancel-subscription', $slug ) : $downgrade_text ) ?></a>
329
- </form>
330
- </li>
331
- <li>&nbsp;&bull;&nbsp;</li>
332
- <?php endif ?>
333
- <?php if ( ! $fs->is_single_plan() ) : ?>
334
- <li>
335
- <a href="<?php echo $fs->get_upgrade_url() ?>"><i
336
- class="dashicons dashicons-grid-view"></i> <?php echo esc_html( $change_plan_text ) ?></a>
337
- </li>
338
- <li>&nbsp;&bull;&nbsp;</li>
339
- <?php endif ?>
340
- <?php elseif ( $is_paid_trial ) : ?>
341
- <li>
342
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
343
- <input type="hidden" name="fs_action" value="cancel_trial">
344
- <?php wp_nonce_field( 'cancel_trial' ) ?>
345
- <a href="#" class="fs-cancel-trial"><i
346
- class="dashicons dashicons-download"></i> <?php echo esc_html( $cancel_trial_text ) ?></a>
347
- </form>
348
- </li>
349
- <li>&nbsp;&bull;&nbsp;</li>
350
- <?php endif ?>
351
- <?php endif ?>
352
- <li>
353
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
354
- <input type="hidden" name="fs_action" value="<?php echo $fs->get_unique_affix() ?>_sync_license">
355
- <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
356
- <a href="#" onclick="this.parentNode.submit(); return false;"><i
357
- class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( 'Sync', 'as synchronize', 'sync', $slug ) ?></a>
358
- </form>
359
- </li>
360
- </ul>
361
- </div>
362
- <div class="inside">
363
- <table id="fs_account_details" cellspacing="0" class="fs-key-value-table">
364
- <?php
365
- $hide_license_key = ( ! $show_license_row || $fs->apply_filters( 'hide_license_key', false ) );
366
-
367
- $profile = array();
368
-
369
- if ( ! $is_whitelabeled ) {
370
- $profile[] = array(
371
- 'id' => 'user_name',
372
- 'title' => fs_text_inline( 'Name', 'name', $slug ),
373
- 'value' => $name
374
- );
375
- // if (isset($user->email) && false !== strpos($user->email, '@'))
376
- $profile[] = array(
377
- 'id' => 'email',
378
- 'title' => fs_text_inline( 'Email', 'email', $slug ),
379
- 'value' => $user->email
380
- );
381
-
382
- if ( is_numeric( $user->id ) ) {
383
- $profile[] = array(
384
- 'id' => 'user_id',
385
- 'title' => fs_text_inline( 'User ID', 'user-id', $slug ),
386
- 'value' => $user->id
387
- );
388
- }
389
- }
390
-
391
- $profile[] = array(
392
- 'id' => 'product',
393
- 'title' => ( $fs->is_plugin() ?
394
- fs_text_inline( 'Plugin', 'plugin', $slug ) :
395
- fs_text_inline( 'Theme', 'theme', $slug ) ),
396
- 'value' => $fs->get_plugin_title()
397
- );
398
-
399
- $profile[] = array(
400
- 'id' => 'product_id',
401
- 'title' => ( $fs->is_plugin() ?
402
- fs_text_inline( 'Plugin', 'plugin', $slug ) :
403
- fs_text_inline( 'Theme', 'theme', $slug ) ) . ' ' . fs_text_inline( 'ID', 'id', $slug ),
404
- 'value' => $fs->get_id()
405
- );
406
-
407
- if ( ! fs_is_network_admin()) {
408
- $profile[] = array(
409
- 'id' => 'site_id',
410
- 'title' => fs_text_inline( 'Site ID', 'site-id', $slug ),
411
- 'value' => is_string( $site->id ) ?
412
- $site->id :
413
- fs_text_inline( 'No ID', 'no-id', $slug )
414
- );
415
-
416
- $profile[] = array(
417
- 'id' => 'site_public_key',
418
- 'title' => fs_text_inline( 'Public Key', 'public-key', $slug ),
419
- 'value' => $site->public_key
420
- );
421
-
422
- $profile[] = array(
423
- 'id' => 'site_secret_key',
424
- 'title' => fs_text_inline( 'Secret Key', 'secret-key', $slug ),
425
- 'value' => ( ( is_string( $site->secret_key ) ) ?
426
- $site->secret_key :
427
- fs_text_x_inline( 'No Secret', 'as secret encryption key missing', 'no-secret', $slug )
428
- )
429
- );
430
- }
431
-
432
- $profile[] = array(
433
- 'id' => 'version',
434
- 'title' => $version_text,
435
- 'value' => $fs->get_plugin_version()
436
- );
437
-
438
- if ( ! fs_is_network_admin() && $is_premium && ! $is_whitelabeled ) {
439
- $profile[] = array(
440
- 'id' => 'beta_program',
441
- 'title' => '',
442
- 'value' => $site->is_beta
443
- );
444
- }
445
-
446
- if ( $has_paid_plan || $has_bundle_license ) {
447
- if ( $fs->is_trial() ) {
448
- if ( $show_plan_row ) {
449
- $profile[] = array(
450
- 'id' => 'plan',
451
- 'title' => $plan_text,
452
- 'value' => ( is_string( $trial_plan->name ) ?
453
- strtoupper( $trial_plan->title ) :
454
- fs_text_inline( 'Trial', 'trial', $slug ) )
455
- );
456
- }
457
- } else {
458
- if ( $show_plan_row ) {
459
- $profile[] = array(
460
- 'id' => 'plan',
461
- 'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
462
- 'value' => strtoupper( is_string( $plan->name ) ?
463
- $plan->title :
464
- strtoupper( $free_text )
465
- )
466
- );
467
-
468
- if ( $has_bundle_license ) {
469
- $profile[] = array(
470
- 'id' => 'bundle_plan',
471
- 'title' => $bundle_plan_text,
472
- 'value' => $bundle_plan_title
473
- );
474
- }
475
- }
476
-
477
- if ( is_object( $license ) ) {
478
- if ( ! $hide_license_key ) {
479
- $profile[] = array(
480
- 'id' => 'license_key',
481
- 'title' => fs_text_inline( 'License Key', $slug ),
482
- 'value' => $license->secret_key,
483
- );
484
- }
485
- }
486
- }
487
- }
488
- ?>
489
- <?php $odd = true;
490
- foreach ( $profile as $p ) : ?>
491
- <?php
492
- if ( 'plan' === $p['id'] && ! $has_paid_plan ) {
493
- // If plugin don't have any paid plans, there's no reason
494
- // to show current plan.
495
- continue;
496
- }
497
- ?>
498
- <tr class="fs-field-<?php echo $p['id'] ?><?php if ( $odd ) : ?> alternate<?php endif ?>">
499
- <td>
500
- <nobr><?php echo $p['title'] ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
501
- </td>
502
- <td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>>
503
- <?php if ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
504
- <code><?php echo FS_Plugin_License::mask_secret_key_for_html( $p['value'] ) ?></code>
505
- <?php if ( ! $is_whitelabeled ) : ?>
506
- <input type="text" value="<?php echo htmlspecialchars( $p['value'] ) ?>" style="display: none"
507
- readonly/>
508
- <?php endif ?>
509
- <?php elseif ( 'beta_program' === $p['id'] ) : ?>
510
- <label>
511
- <input type="checkbox" class="fs-toggle-beta-mode" <?php checked( true, $p['value'] ) ?>/><span><?php
512
- fs_esc_html_echo_inline( 'Join the Beta program', 'join-beta', $slug )
513
- ?></span></label>
514
- <?php else : ?>
515
- <code><?php echo htmlspecialchars( $p['value'] ) ?></code>
516
- <?php endif ?>
517
- <?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
518
- <label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'not verified', 'not-verified', $slug ) ?></label>
519
- <?php endif ?>
520
- <?php if ( 'plan' === $p['id'] ) : ?>
521
- <?php if ( $fs->is_trial() ) : ?>
522
- <label class="fs-tag fs-success"><?php echo esc_html( $trial_text ) ?></label>
523
- <?php endif ?>
524
- <?php if ( is_object( $license ) && ! $license->is_lifetime() ) : ?>
525
- <?php if ( ! $is_active_subscription && ! $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
526
- <?php $is_license_expired = $license->is_expired() ?>
527
- <?php $expired_ago_text = ( fs_text_inline( 'Expired', 'expired', $slug ) . ' ' . fs_text_x_inline( '%s ago', 'x-ago', $slug ) ) ?>
528
- <label
529
- class="fs-tag <?php echo $is_license_expired ? 'fs-error' : 'fs-warn' ?>"><?php
530
- echo esc_html( sprintf( $is_license_expired ? $expired_ago_text : $expires_in_text, human_time_diff( time(), strtotime( $license->expiration ) ) ) )
531
- ?></label>
532
- <?php elseif ( $is_active_subscription && ! $subscription->is_first_payment_pending() ) : ?>
533
- <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $subscription->next_payment ) ) ) ) ?></label>
534
- <?php endif ?>
535
- <?php elseif ( $fs->is_trial() ) : ?>
536
- <label class="fs-tag fs-warn"><?php echo esc_html( sprintf( $expires_in_text, human_time_diff( time(), strtotime( $site->trial_ends ) ) ) ) ?></label>
537
- <?php endif ?>
538
- <?php if ( ! $is_whitelabeled ) : ?>
539
- <div class="button-group">
540
- <?php $available_license = $fs->is_free_plan() && ! fs_is_network_admin() ? $fs->_get_available_premium_license( $site->is_localhost() ) : false ?>
541
- <?php if ( is_object( $available_license ) ) : ?>
542
- <?php $premium_plan = $fs->_get_plan_by_id( $available_license->plan_id ) ?>
543
- <?php
544
- $view_params = array(
545
- 'freemius' => $fs,
546
- 'slug' => $slug,
547
- 'license' => $available_license,
548
- 'plan' => $premium_plan,
549
- 'is_localhost' => $site->is_localhost(),
550
- 'install_id' => $site->id,
551
- 'class' => 'button-primary',
552
- );
553
- fs_require_template( 'account/partials/activate-license-button.php', $view_params ); ?>
554
- <?php else : ?>
555
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>"
556
- method="POST" class="button-group">
557
- <?php if ( $show_upgrade && $is_premium ) : ?>
558
- <a class="button activate-license-trigger <?php echo $fs->get_unique_affix() ?>" href="#"><?php fs_esc_html_echo_inline( 'Activate License', 'activate-license', $slug ) ?></a>
559
- <?php endif ?>
560
- <input type="submit" class="button"
561
- value="<?php echo esc_attr( $sync_license_text ) ?>">
562
- <input type="hidden" name="fs_action"
563
- value="<?php echo $fs->get_unique_affix() ?>_sync_license">
564
- <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
565
- <?php if ( $show_upgrade || ! $fs->is_single_plan() ) : ?>
566
- <a href="<?php echo $fs->get_upgrade_url() ?>"
567
- class="button<?php
568
- echo $show_upgrade ?
569
- ' button-primary fs-upgrade' :
570
- ' fs-change-plan'; ?> button-upgrade"><i
571
- class="dashicons dashicons-cart"></i> <?php echo esc_html( $show_upgrade ? $upgrade_text : $change_plan_text ) ?></a>
572
- <?php endif ?>
573
- </form>
574
- <?php endif ?>
575
- </div>
576
- <?php endif ?>
577
- <?php elseif ( 'bundle_plan' === $p['id'] ) : ?>
578
- <?php if ( is_object( $bundle_subscription ) ) : ?>
579
- <?php if ( $is_active_bundle_subscription && ! $is_bundle_first_payment_pending ) : ?>
580
- <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $bundle_subscription->next_payment ) ) ) ) ?></label>
581
- <?php endif ?>
582
- <?php endif ?>
583
- <?php elseif ( 'version' === $p['id'] && $has_paid_plan ) : ?>
584
- <?php if ( $fs->has_premium_version() ) : ?>
585
- <?php if ( $is_premium ) : ?>
586
- <label
587
- class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"><?php fs_esc_html_echo_inline( 'Premium version', 'premium-version', $slug ) ?></label>
588
- <?php elseif ( $fs->can_use_premium_code() ) : ?>
589
- <label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'Free version', 'free-version', $slug ) ?></label>
590
- <?php endif ?>
591
- <?php endif ?>
592
- <?php endif ?>
593
- </td>
594
- <?php if ( 'plan' !== $p['id'] && 'bundle_plan' !== $p['id'] ) : ?>
595
- <td class="fs-right">
596
- <?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
597
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
598
- <input type="hidden" name="fs_action" value="verify_email">
599
- <?php wp_nonce_field( 'verify_email' ) ?>
600
- <input type="submit" class="button button-small"
601
- value="<?php fs_esc_attr_echo_inline( 'Verify Email', 'verify-email', $slug ) ?>">
602
- </form>
603
- <?php endif ?>
604
- <?php if ( 'version' === $p['id'] ) : ?>
605
- <?php if ( $fs->has_release_on_freemius() ) : ?>
606
- <div class="button-group">
607
- <?php if ( $is_paying || $fs->is_trial() ) : ?>
608
- <?php if ( ! $fs->is_allowed_to_install() ) : ?>
609
- <a target="_blank" rel="noopener" class="button button-primary"
610
- href="<?php echo $fs->_get_latest_download_local_url() ?>"><?php
611
- $download_version_text_suffix = ( is_object( $update ) ? ' [' . $update->version . ']' : '' );
612
-
613
- $download_version_text = sprintf(
614
- /* translators: %s: plan name (e.g. Download "Professional" Version) */
615
- fs_text_inline( 'Download %s Version', 'download-x-version', $slug ),
616
- ( $fs->is_trial() ? $trial_plan->title : $plan->title )
617
- ) .
618
- $download_version_text_suffix;
619
-
620
- $download_version_text_length = function_exists( 'mb_strlen' ) ?
621
- mb_strlen( $download_version_text ) :
622
- strlen( $download_version_text );
623
-
624
- if ( $download_version_text_length > 31 ) {
625
- /**
626
- * Try to limit the number of characters to 31 for now.
627
- *
628
- * @author Leo Fajardo (@leorw)
629
- * @aince 2.3.2
630
- */
631
- $download_version_text = fs_text_inline( 'Download Paid Version', 'download-paid-version', $slug ) . $download_version_text_suffix;
632
- }
633
-
634
- echo $download_version_text;
635
- ?></a>
636
- <?php elseif ( is_object( $update ) ) : ?>
637
- <?php
638
- $module_type = $fs->get_module_type();
639
- ?>
640
- <a class="button button-primary"
641
- href="<?php echo wp_nonce_url( self_admin_url( "update.php?action=upgrade-{$module_type}&{$module_type}=" . $fs->get_plugin_basename() ), "upgrade-{$module_type}_" . $fs->get_plugin_basename() ) ?>"><?php echo fs_esc_html_inline( 'Install Update Now', 'install-update-now', $slug ) . ' [' . $update->version . ']' ?></a>
642
- <?php endif ?>
643
- <?php endif; ?>
644
- </div>
645
- <?php endif ?>
646
- <?php
647
- elseif ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
648
- <?php if ( ! $is_whitelabeled ) : ?>
649
- <button class="button button-small fs-toggle-visibility"><?php fs_esc_html_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?></button>
650
- <?php endif ?>
651
- <?php if ('license_key' === $p['id']) : ?>
652
- <button class="button button-small activate-license-trigger <?php echo $fs->get_unique_affix() ?>"><?php fs_esc_html_echo_inline( 'Change License', 'change-license', $slug ) ?></button>
653
- <?php endif ?>
654
- <?php
655
- elseif (/*in_array($p['id'], array('site_secret_key', 'site_id', 'site_public_key')) ||*/
656
- ( is_string( $user->secret_key ) && in_array( $p['id'], array(
657
- 'email',
658
- 'user_name'
659
- ) ) )
660
- ) : ?>
661
- <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"
662
- onsubmit="var val = prompt('<?php echo esc_attr( sprintf(
663
- /* translators: %s: User's account property (e.g. name, email) */
664
- fs_text_inline( 'What is your %s?', 'what-is-your-x', $slug ),
665
- $p['title']
666
- ) ) ?>', '<?php echo $p['value'] ?>'); if (null == val || '' === val) return false; jQuery('input[name=fs_<?php echo $p['id'] ?>_<?php echo $fs->get_unique_affix() ?>]').val(val); return true;">
667
- <input type="hidden" name="fs_action" value="update_<?php echo $p['id'] ?>">
668
- <input type="hidden" name="fs_<?php echo $p['id'] ?>_<?php echo $fs->get_unique_affix() ?>"
669
- value="">
670
- <?php wp_nonce_field( 'update_' . $p['id'] ) ?>
671
- <input type="submit" class="button button-small"
672
- value="<?php echo fs_esc_attr_x_inline( 'Edit', 'verb', 'edit', $slug ) ?>">
673
- </form>
674
- <?php elseif ( 'user_id' === $p['id'] && ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) : ?>
675
- <input id="fs_change_user" type="submit" class="button button-small"
676
- value="<?php echo fs_esc_attr_inline( 'Change User', 'change-user', $slug ) ?>">
677
- <?php endif ?>
678
- </td>
679
- <?php endif ?>
680
- </tr>
681
- <?php
682
- if ( 'version' === $p['id'] && $is_premium ) {
683
- /**
684
- * If there's a row for the beta program, keep its background color
685
- * the same as the version info row.
686
- *
687
- * @author Leo Fajardo (@leorw)
688
- * @since 2.3.0
689
- */
690
- continue;
691
- }
692
-
693
- $odd = ! $odd;
694
- endforeach ?>
695
- </table>
696
- </div>
697
- </div>
698
- <?php if ( fs_is_network_admin() ) : ?>
699
- <div id="fs_sites" class="postbox">
700
- <h3><span class="dashicons dashicons-networking"></span> <?php fs_esc_html_echo_inline( 'Sites', 'sites', $slug ) ?></h3>
701
- <div class="fs-header-actions">
702
- <?php if ( ! $is_whitelabeled ) : ?>
703
- <?php $has_license = is_object( $license ) ?>
704
- <?php if ( $has_license || ( $show_upgrade && $is_premium ) ) : ?>
705
- <?php
706
- $activate_license_button_text = $has_license ?
707
- fs_esc_html_inline( 'Change License', 'change-license', $slug ) :
708
- fs_esc_html_inline( 'Activate License', 'activate-license', $slug );
709
- ?>
710
- <a class="button<?php echo ( ! $has_license ? ' button-primary' : '' ) ?> activate-license-trigger <?php echo $fs->get_unique_affix() ?>" href="#"><?php echo $activate_license_button_text ?></a>
711
- <?php endif ?>
712
- <?php endif ?>
713
- <input class="fs-search" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Search by address', 'search-by-address', $slug ) ?>..."><span class="dashicons dashicons-search"></span>
714
- </div>
715
- <div class="inside">
716
- <div id="" class="fs-scrollable-table">
717
- <div class="fs-table-head">
718
- <table class="widefat">
719
- <thead>
720
- <tr>
721
- <td><?php fs_esc_html_echo_inline('ID', 'id', $slug) ?></td>
722
- <td><?php fs_esc_html_echo_inline('Address', 'address', $slug) ?></td>
723
- <td><?php fs_esc_html_echo_inline('License', 'license', $slug) ?></td>
724
- <td><?php fs_esc_html_echo_inline('Plan', 'plan', $slug) ?></td>
725
- <td></td>
726
- </tr>
727
- </thead>
728
- </table>
729
- </div>
730
- <div class="fs-table-body">
731
- <table class="widefat">
732
- <?php
733
- foreach ( $site_view_params as $view_params ) {
734
- fs_require_template(
735
- 'account/partials/site.php',
736
- $view_params
737
- );
738
- } ?>
739
- </table>
740
- </div>
741
- </div>
742
- </div>
743
- </div>
744
- <?php endif ?>
745
- <?php if ( 0 < count( $addons_to_show ) ) : ?>
746
- <!-- Add-Ons -->
747
- <div class="postbox">
748
- <div class="">
749
- <!-- <div class="inside">-->
750
- <table id="fs_addons" class="widefat">
751
- <thead>
752
- <tr>
753
- <th><h3><?php echo esc_html( $addons_text ) ?></h3></th>
754
- <th><?php fs_esc_html_echo_inline( 'ID', 'id', $slug ) ?></th>
755
- <th><?php echo esc_html( $version_text ) ?></th>
756
- <th><?php echo esc_html( $plan_text ) ?></th>
757
- <th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th>
758
- <th></th>
759
- <?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?>
760
- <th></th>
761
- <?php endif ?>
762
- </tr>
763
- </thead>
764
- <tbody>
765
- <?php
766
- $odd = true;
767
-
768
- $installed_addons_ids_map = array_flip( $installed_addons_ids );
769
-
770
- $addon_info_by_id = array();
771
- $hide_all_addons_data = false;
772
-
773
- if ( $fs->is_whitelabeled_by_flag() ) {
774
- $hide_all_addons_data = true;
775
-
776
- foreach ( $addons_to_show as $addon_id ) {
777
- $is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
778
- $addon_info = $fs->_get_addon_info( $addon_id, $is_addon_installed );
779
- $is_addon_connected = $addon_info['is_connected'];
780
-
781
- $fs_addon = ( $is_addon_connected && $is_addon_installed ) ?
782
- freemius( $addon_id ) :
783
- null;
784
-
785
- $is_whitelabeled = is_object( $fs_addon ) ?
786
- $fs_addon->is_whitelabeled( true ) :
787
- $addon_info['is_whitelabeled'];
788
-
789
- if ( ! $is_whitelabeled ) {
790
- $hide_all_addons_data = false;
791
- }
792
-
793
- if ( $is_data_debug_mode ) {
794
- $is_whitelabeled = false;
795
- }
796
-
797
- $addon_info_by_id[ $addon_id ] = $addon_info;
798
- }
799
- }
800
-
801
- foreach ( $addons_to_show as $addon_id ) {
802
- $is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
803
-
804
- if (
805
- $hide_all_addons_data &&
806
- ! $is_addon_installed &&
807
- ! file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs->get_addon_basename( $addon_id ) ) )
808
- ) {
809
- continue;
810
- }
811
-
812
- $addon_view_params = array(
813
- 'parent_fs' => $fs,
814
- 'addon_id' => $addon_id,
815
- 'odd' => $odd,
816
- 'fs_blog_id' => $fs_blog_id,
817
- 'active_plugins_directories_map' => &$active_plugins_directories_map,
818
- 'is_addon_installed' => $is_addon_installed,
819
- 'addon_info' => isset( $addon_info_by_id[ $addon_id ] ) ?
820
- $addon_info_by_id[ $addon_id ] :
821
- $fs->_get_addon_info( $addon_id, $is_addon_installed ),
822
- 'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode )
823
- );
824
-
825
- fs_require_template(
826
- 'account/partials/addon.php',
827
- $addon_view_params
828
- );
829
-
830
- $odd = ! $odd;
831
- } ?>
832
- </tbody>
833
- </table>
834
- </div>
835
- </div>
836
- <?php endif ?>
837
-
838
- <?php $fs->do_action( 'after_account_details' ) ?>
839
-
840
- <?php
841
- if ( $show_billing ) {
842
- $view_params = array( 'id' => $VARS['id'] );
843
- fs_require_once_template( 'account/billing.php', $view_params );
844
- fs_require_once_template( 'account/payments.php', $view_params );
845
- }
846
- ?>
847
- </div>
848
- </div>
849
- </div>
850
- </div>
851
- </div>
852
- <?php
853
- $subscription_cancellation_dialog_box_template_params = $fs->_get_subscription_cancellation_dialog_box_template_params( true );
854
- if ( ! empty( $subscription_cancellation_dialog_box_template_params ) ) {
855
- fs_require_template( 'forms/subscription-cancellation.php', $subscription_cancellation_dialog_box_template_params );
856
- }
857
- ?>
858
- <script type="text/javascript">
859
- (function ($) {
860
- var setLoading = function ($this, label) {
861
- // Set loading mode.
862
- $(document.body).css({'cursor': 'wait'});
863
-
864
- $this.css({'cursor': 'wait'});
865
-
866
- if ($this.is('input'))
867
- $this.val(label);
868
- else
869
- $this.html(label);
870
-
871
- setTimeout(function () {
872
- $this.attr('disabled', 'disabled');
873
- }, 200);
874
- };
875
-
876
- $('.fs-toggle-visibility').click(function () {
877
- var
878
- $this = $(this),
879
- $parent = $this.closest('tr'),
880
- $input = $parent.find('input');
881
-
882
- $parent.find('code').toggle();
883
- $input.toggle();
884
-
885
- if ($input.is(':visible')) {
886
- $this.html('<?php fs_esc_js_echo_x_inline( 'Hide', 'verb', 'hide', $slug ) ?>');
887
- setTimeout(function () {
888
- $input.select().focus();
889
- }, 100);
890
- }
891
- else {
892
- $this.html( '<?php fs_esc_js_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?>' );
893
- }
894
- });
895
-
896
- $('.fs-toggle-tracking').click(function () {
897
- setLoading(
898
- $(this),
899
- ($(this).data('is-disconnected') ?
900
- '<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>' :
901
- '<?php fs_esc_js_echo_inline('Opting out', 'opting-out' ) ?>') +
902
- '...'
903
- );
904
- });
905
-
906
- <?php
907
- $plugin_title = $fs->get_plugin_title();
908
- $processing_text = fs_esc_js_inline( 'Processing', 'processing' );
909
- $confirmation_message = sprintf(
910
- '%s %s',
911
- sprintf( fs_esc_attr_inline( 'Get updates for bleeding edge Beta versions of %s.', 'get-beta-versions', $slug ), $plugin_title ),
912
- sprintf( fs_esc_attr_inline( 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.', 'beta-version-update-caution', $slug ), $plugin_title )
913
- );
914
- ?>
915
-
916
- $( '.fs-toggle-beta-mode' ).click( function () {
917
- var $checkbox = $( this ),
918
- isChecked = $checkbox.is( ':checked' );
919
-
920
- if ( ! isChecked || confirm( '<?php echo $confirmation_message ?>' ) ) {
921
- $.ajax( {
922
- url : ajaxurl,
923
- method: 'POST',
924
- data : {
925
- action : '<?php echo $fs->get_ajax_action( 'set_beta_mode' ) ?>',
926
- security : '<?php echo $fs->get_ajax_security( 'set_beta_mode' ) ?>',
927
- is_beta : isChecked,
928
- module_id: <?php echo $fs->get_id() ?>
929
- },
930
- beforeSend: function () {
931
- $checkbox.prop( 'disabled', true );
932
- $checkbox.parent().find( 'span' ).text( '<?php echo $processing_text ?>' + '...' );
933
- },
934
- complete: function () {
935
- $checkbox.prop( 'disabled', false );
936
- $checkbox.parent().find( 'span' ).text( '<?php fs_esc_js_echo_inline( 'Join the Beta Program', 'join-beta', $slug ) ?>' );
937
- }
938
- } );
939
-
940
- return true;
941
- }
942
-
943
- return false;
944
- });
945
-
946
- $('.fs-opt-in').click(function () {
947
- setLoading($(this), '<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>...');
948
- });
949
-
950
- $( '#fs_downgrade' ).submit(function( event ) {
951
- event.preventDefault();
952
-
953
- setLoading( $( this ).find( '.button' ), '<?php fs_esc_js_echo_inline( 'Downgrading', 'downgrading' ) ?>...' );
954
- });
955
-
956
- $('.fs-activate-license').click(function () {
957
- setLoading($(this), '<?php fs_esc_js_echo_inline('Activating', 'activating' ) ?>...');
958
- });
959
-
960
- var $deactivateLicenseOrCancelTrial = $( '.fs-deactivate-license, .fs-cancel-trial' ),
961
- $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' );
962
-
963
- if ( 0 !== $subscriptionCancellationModal.length ) {
964
- $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
965
- setLoading(
966
- $deactivateLicenseOrCancelTrial,
967
- ( ! $deactivateLicenseOrCancelTrial.hasClass( 'fs-cancel-trial' ) ?
968
- '<?php fs_esc_js_echo_inline( 'Deactivating', 'deactivating', $slug ) ?>' :
969
- '<?php echo esc_html( sprintf( fs_text_inline( 'Cancelling %s', 'cancelling-x', $slug ), fs_text_inline( 'trial', 'trial', $slug ) ) ) ?>' ) + '...'
970
- );
971
-
972
- $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
973
- $deactivateLicenseOrCancelTrial.unbind( 'click' );
974
-
975
- if ( false === cancelSubscription || $deactivateLicenseOrCancelTrial.hasClass( 'fs-cancel-trial' ) ) {
976
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( $deactivateLicenseOrCancelTrial.text() );
977
-
978
- $deactivateLicenseOrCancelTrial[0].parentNode.submit();
979
- } else {
980
- var $form = $( 'input[value="downgrade_account"],input[value="cancel_trial"]' ).parent();
981
- $form.prepend( '<input type="hidden" name="deactivate_license" value="true" />' );
982
-
983
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js( sprintf(
984
- fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ),
985
- $is_paid_trial ?
986
- fs_text_inline( 'trial', 'trial', $slug ) :
987
- fs_text_inline( 'subscription', 'subscription', $slug )
988
- ) ) ?>' );
989
-
990
- $form.submit();
991
- }
992
- });
993
- }
994
-
995
- $deactivateLicenseOrCancelTrial.click(function() {
996
- var $this = $( this );
997
- if ( $this.hasClass( 'fs-cancel-trial' ) ) {
998
- $subscriptionCancellationModal.find( '.fs-modal-panel' ).find( 'ul.subscription-actions, .fs-price-increase-warning' ).remove();
999
- $subscriptionCancellationModal.find( '.fs-modal-panel > p' ).text( <?php echo json_encode( $cancel_trial_confirm_text ) ?> );
1000
- $subscriptionCancellationModal.trigger( 'showModal' );
1001
- } else if (confirm('<?php fs_esc_attr_echo_inline( 'Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?', 'deactivate-license-confirm', $slug ) ?>')) {
1002
- var $this = $(this);
1003
-
1004
- if ( 0 !== $subscriptionCancellationModal.length ) {
1005
- $subscriptionCancellationModal.trigger( 'showModal' );
1006
- } else {
1007
- setLoading( $this, '<?php fs_esc_js_echo_inline( 'Deactivating', 'deactivating', $slug ) ?>...' );
1008
- $this[0].parentNode.submit();
1009
- }
1010
- }
1011
-
1012
- return false;
1013
- });
1014
-
1015
- var $sitesSection = $('#fs_sites'),
1016
- $sitesTable = $sitesSection.find('.fs-scrollable-table'),
1017
- $sitesTableRows = $sitesTable.find('.fs-site-details');
1018
-
1019
- $('.fs-show-install-details').click(function(){
1020
- var installID = $(this).parents('.fs-site-details').attr('data-install-id');
1021
- $sitesSection.find('.fs-install-details[data-install-id=' + installID + ']').toggle();
1022
- });
1023
-
1024
-
1025
- var adjustColumnWidth = function($table) {
1026
- var $headerColumns = $table.find('.fs-table-head td'),
1027
- $bodyColumns = $table.find('.fs-table-body tr:first > td');
1028
-
1029
- for (var i = 0, len = $headerColumns.length; i < len; i++) {
1030
- $($headerColumns[i]).width($($bodyColumns[i]).width());
1031
- }
1032
- for (i = 0, len = $headerColumns.length; i < len; i++) {
1033
- $($bodyColumns[i]).width($($headerColumns[i]).width());
1034
- }
1035
- };
1036
-
1037
- adjustColumnWidth($sitesTable);
1038
-
1039
- $sitesSection.find('.fs-search').keyup(function(){
1040
- var search = $(this).val().trim();
1041
-
1042
- if ('' === search){
1043
- // Show all.
1044
- $sitesTableRows.show();
1045
- return;
1046
- }
1047
-
1048
- var url;
1049
-
1050
- $sitesTableRows.each(function(index){
1051
- url = $(this).find('.fs-field-url').html();
1052
-
1053
- if (-1 < url.indexOf(search)){
1054
- $(this).show();
1055
- } else {
1056
- $(this).hide();
1057
- }
1058
- });
1059
- });
1060
-
1061
- $( '.fs-toggle-whitelabel-mode' ).click( function () {
1062
- var $toggleLink = $( this );
1063
-
1064
- $.ajax( {
1065
- url : ajaxurl,
1066
- method: 'POST',
1067
- data : {
1068
- action : '<?php echo $fs->get_ajax_action( 'toggle_whitelabel_mode' ) ?>',
1069
- security : '<?php echo $fs->get_ajax_security( 'toggle_whitelabel_mode' ) ?>',
1070
- module_id: <?php echo $fs->get_id() ?>
1071
- },
1072
- beforeSend: function () {
1073
- $toggleLink.parent().text( '<?php
1074
- $is_whitelabeled ?
1075
- fs_esc_html_echo_inline( 'Disabling white-label mode', 'disabling-whitelabel-mode' ) :
1076
- fs_esc_html_echo_inline( 'Enabling white-label mode', 'enabling-whitelabel-mode' )
1077
- ?>' + '...' );
1078
- },
1079
- complete: function () {
1080
- location.reload();
1081
- }
1082
- } );
1083
- });
1084
- })(jQuery);
1085
- </script>
1086
- <?php
1087
- if ( $has_tabs ) {
1088
- $fs->_add_tabs_after_content();
1089
- }
1090
-
1091
- $params = array(
1092
- 'page' => 'account',
1093
- 'module_id' => $fs->get_id(),
1094
- 'module_type' => $fs->get_module_type(),
1095
- 'module_slug' => $slug,
1096
- 'module_version' => $fs->get_plugin_version(),
1097
- );
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ * @var Freemius $fs
16
+ */
17
+ $fs = freemius( $VARS['id'] );
18
+
19
+ $slug = $fs->get_slug();
20
+
21
+ /**
22
+ * @var FS_Plugin_Tag $update
23
+ */
24
+ $update = $fs->has_release_on_freemius() ?
25
+ $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 ) :
26
+ null;
27
+
28
+ if ( is_object($update) ) {
29
+ /**
30
+ * This logic is particularly required for multisite environment.
31
+ * If a module is site activated (not network) and not on the main site,
32
+ * the module will NOT be executed on the network level, therefore, the
33
+ * custom updates logic will not be executed as well, so unless we force
34
+ * the injection of the update into the updates transient, premium updates
35
+ * will not work.
36
+ *
37
+ * @author Vova Feldman (@svovaf)
38
+ * @since 2.0.0
39
+ */
40
+ $updater = FS_Plugin_Updater::instance( $fs );
41
+ $updater->set_update_data( $update );
42
+ }
43
+
44
+ $is_paying = $fs->is_paying();
45
+ $user = $fs->get_user();
46
+ $site = $fs->get_site();
47
+ $name = $user->get_name();
48
+ $license = $fs->_get_license();
49
+ $is_data_debug_mode = $fs->is_data_debug_mode();
50
+ $is_whitelabeled = $fs->is_whitelabeled();
51
+ $subscription = ( is_object( $license ) ?
52
+ $fs->_get_subscription( $license->id ) :
53
+ null );
54
+ $plan = $fs->get_plan();
55
+ $is_active_subscription = ( is_object( $subscription ) && $subscription->is_active() );
56
+ $is_paid_trial = $fs->is_paid_trial();
57
+ $has_paid_plan = $fs->apply_filters( 'has_paid_plan_account', $fs->has_paid_plan() );
58
+ $show_upgrade = ( ! $is_whitelabeled && $has_paid_plan && ! $is_paying && ! $is_paid_trial );
59
+ $trial_plan = $fs->get_trial_plan();
60
+
61
+ if ( $has_paid_plan ) {
62
+ $fs->_add_license_activation_dialog_box();
63
+ }
64
+
65
+ $ids_of_installs_activated_with_foreign_licenses = $fs->should_handle_user_change() ?
66
+ $fs->get_installs_ids_with_foreign_licenses() :
67
+ array();
68
+
69
+ if ( ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) {
70
+ $fs->_add_user_change_dialog_box( $ids_of_installs_activated_with_foreign_licenses );
71
+ }
72
+
73
+ if ( $fs->is_whitelabeled( true ) || $fs->is_data_debug_mode() ) {
74
+ $fs->_add_data_debug_mode_dialog_box();
75
+ }
76
+
77
+ if ( fs_request_get_bool( 'auto_install' ) ) {
78
+ $fs->_add_auto_installation_dialog_box();
79
+ }
80
+
81
+ if ( fs_request_get_bool( 'activate_license' ) ) {
82
+ // Open the license activation dialog box on the account page.
83
+ add_action( 'admin_footer', array(
84
+ &$fs,
85
+ '_open_license_activation_dialog_box'
86
+ ) );
87
+ }
88
+
89
+ $payments = $fs->_fetch_payments();
90
+
91
+ $show_billing = ( ! $is_whitelabeled && is_array( $payments ) && 0 < count( $payments ) );
92
+
93
+
94
+ $has_tabs = $fs->_add_tabs_before_content();
95
+
96
+ if ( $has_tabs ) {
97
+ $query_params['tabs'] = 'true';
98
+ }
99
+
100
+ // Aliases.
101
+ $download_latest_text = fs_text_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $slug );
102
+ $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
103
+ $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
104
+ /* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
105
+ $downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
106
+ $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
107
+ $cancel_trial_confirm_text = fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug );
108
+ $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
109
+ $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
110
+ /* translators: %s: Plan title (e.g. "Professional") */
111
+ $activate_plan_text = fs_text_inline( 'Activate %s Plan', 'activate-x-plan', $slug );
112
+ $version_text = fs_text_x_inline( 'Version', 'product version', 'version', $slug );
113
+ /* translators: %s: Time period (e.g. Auto renews in "2 months") */
114
+ $renews_in_text = fs_text_inline( 'Auto renews in %s', 'renews-in', $slug );
115
+ /* translators: %s: Time period (e.g. Expires in "2 months") */
116
+ $expires_in_text = fs_text_inline( 'Expires in %s', 'expires-in', $slug );
117
+ $sync_license_text = fs_text_x_inline( 'Sync License', 'as synchronize license', 'sync-license', $slug );
118
+ $cancel_trial_text = fs_text_inline( 'Cancel Trial', 'cancel-trial', $slug );
119
+ $change_plan_text = fs_text_inline( 'Change Plan', 'change-plan', $slug );
120
+ $upgrade_text = fs_text_x_inline( 'Upgrade', 'verb', 'upgrade', $slug );
121
+ $addons_text = fs_text_inline( 'Add-Ons', 'add-ons', $slug );
122
+ $downgrade_text = fs_text_x_inline( 'Downgrade', 'verb', 'downgrade', $slug );
123
+ $trial_text = fs_text_x_inline( 'Trial', 'trial period', 'trial', $slug );
124
+ $free_text = fs_text_inline( 'Free', 'free', $slug );
125
+ $activate_text = fs_text_inline( 'Activate', 'activate', $slug );
126
+ $plan_text = fs_text_x_inline( 'Plan', 'as product pricing plan', 'plan', $slug );
127
+ $bundle_plan_text = fs_text_inline( 'Bundle Plan', 'bundle-plan', $slug );
128
+
129
+ $show_plan_row = true;
130
+ $show_license_row = is_object( $license );
131
+
132
+ $site_view_params = array();
133
+
134
+ if ( fs_is_network_admin() ) {
135
+ $sites = Freemius::get_sites();
136
+ $all_installs_plan_id = null;
137
+ $all_installs_license_id = ( $show_license_row ? $license->id : null );
138
+ foreach ( $sites as $s ) {
139
+ $site_info = $fs->get_site_info( $s );
140
+ $install = $fs->get_install_by_blog_id( $site_info['blog_id'] );
141
+ $view_params = array(
142
+ 'freemius' => $fs,
143
+ 'license' => $license,
144
+ 'site' => $site_info,
145
+ 'install' => $install,
146
+ );
147
+
148
+ $site_view_params[] = $view_params;
149
+
150
+ if ( empty( $install ) ) {
151
+ continue;
152
+ }
153
+
154
+ if ( $show_plan_row ) {
155
+ if ( is_null( $all_installs_plan_id ) ) {
156
+ $all_installs_plan_id = $install->plan_id;
157
+ } elseif ( $all_installs_plan_id != $install->plan_id ) {
158
+ $show_plan_row = false;
159
+ }
160
+ }
161
+
162
+ if ( $show_license_row && $all_installs_license_id != $install->license_id ) {
163
+ $show_license_row = false;
164
+ }
165
+ }
166
+ }
167
+
168
+ $has_bundle_license = false;
169
+
170
+ if ( is_object( $license ) &&
171
+ FS_Plugin_License::is_valid_id( $license->parent_license_id )
172
+ ) {
173
+ // Context license has a parent license, therefore, the account has a bundle license.
174
+ $has_bundle_license = true;
175
+ }
176
+
177
+ $bundle_subscription = null;
178
+ $is_bundle_first_payment_pending = false;
179
+
180
+ if (
181
+ $show_plan_row &&
182
+ is_object( $license ) &&
183
+ $has_bundle_license
184
+ ) {
185
+ $bundle_plan_title = strtoupper( $license->parent_plan_title );
186
+ $bundle_subscription = $fs->_get_subscription( $license->parent_license_id );
187
+ $is_bundle_first_payment_pending = $license->is_first_payment_pending();
188
+ }
189
+
190
+ $fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
191
+ get_current_blog_id() :
192
+ 0;
193
+
194
+ $active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
195
+
196
+ $is_premium = $fs->is_premium();
197
+
198
+ $account_addons = $fs->get_updated_account_addons();
199
+ $installed_addons = $fs->get_installed_addons();
200
+ $installed_addons_ids = array();
201
+
202
+ /**
203
+ * Store the installed add-ons' IDs into a collection which will be used in determining the add-ons to show on the "Account" page, and at the same time try to find an add-on that is activated with a bundle license if the core product is not.
204
+ *
205
+ * @author Leo Fajardo
206
+ *
207
+ * @since 2.4.0
208
+ */
209
+ foreach ( $installed_addons as $fs_addon ) {
210
+ $installed_addons_ids[] = $fs_addon->get_id();
211
+
212
+ if ( $has_bundle_license ) {
213
+ // We already have the context bundle license details, skip.
214
+ continue;
215
+ }
216
+
217
+ if (
218
+ $show_plan_row &&
219
+ $fs_addon->has_active_valid_license()
220
+ ) {
221
+ $addon_license = $fs_addon->_get_license();
222
+
223
+ if ( FS_Plugin_License::is_valid_id( $addon_license->parent_license_id ) ) {
224
+ // Add-on's license is associated with a parent/bundle license.
225
+ $has_bundle_license = true;
226
+
227
+ $bundle_plan_title = strtoupper( $addon_license->parent_plan_title );
228
+ $bundle_subscription = $fs_addon->_get_subscription( $addon_license->parent_license_id );
229
+ $is_bundle_first_payment_pending = $addon_license->is_first_payment_pending();
230
+ }
231
+ }
232
+ }
233
+
234
+ $addons_to_show = array_unique( array_merge( $installed_addons_ids, $account_addons ) );
235
+
236
+ $is_active_bundle_subscription = ( is_object( $bundle_subscription ) && $bundle_subscription->is_active() );
237
+ ?>
238
+ <div class="wrap fs-section">
239
+ <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
240
+ <h2 class="nav-tab-wrapper">
241
+ <a href="<?php echo $fs->get_account_url() ?>"
242
+ class="nav-tab nav-tab-active"><?php fs_esc_html_echo_inline( 'Account', 'account', $slug ) ?></a>
243
+ <?php if ( $fs->has_addons() ) : ?>
244
+ <a href="<?php echo $fs->_get_admin_page_url( 'addons' ) ?>"
245
+ class="nav-tab"><?php echo esc_html( $addons_text ) ?></a>
246
+ <?php endif ?>
247
+ <?php if ( $show_upgrade ) : ?>
248
+ <a href="<?php echo $fs->get_upgrade_url() ?>" class="nav-tab"><?php echo esc_html( $upgrade_text ) ?></a>
249
+ <?php if ( $fs->apply_filters( 'show_trial', true ) && ! $fs->is_trial_utilized() && $fs->has_trial_plan() ) : ?>
250
+ <a href="<?php echo $fs->get_trial_url() ?>" class="nav-tab"><?php fs_esc_html_echo_inline( 'Free Trial', 'free-trial', $slug ) ?></a>
251
+ <?php endif ?>
252
+ <?php endif ?>
253
+ </h2>
254
+ <?php endif ?>
255
+
256
+ <div id="poststuff">
257
+ <div id="fs_account">
258
+ <div class="has-sidebar has-right-sidebar">
259
+ <div class="has-sidebar-content">
260
+ <div class="postbox">
261
+ <h3><span class="dashicons dashicons-businessman"></span> <?php fs_esc_html_echo_inline( 'Account Details', 'account-details', $slug ) ?></h3>
262
+ <div class="fs-header-actions">
263
+ <ul>
264
+ <?php if ( $fs->is_whitelabeled( true ) ) : ?>
265
+ <li>
266
+ <a href="#" class="debug-license-trigger"><i class="dashicons dashicons-<?php echo $is_whitelabeled ? 'editor-code' : 'controls-pause' ?>"></i> <span><?php
267
+ if ( $is_whitelabeled ) {
268
+ fs_esc_html_echo_inline( 'Start Debug', 'start-debug-license', $slug );
269
+ } else {
270
+ fs_esc_html_echo_inline( 'Stop Debug', 'stop-debug-license', $slug );
271
+ }
272
+ ?></span></a>
273
+ </li>
274
+ <li>&nbsp;&bull;&nbsp;</li>
275
+ <?php endif ?>
276
+ <?php if ( $show_billing ) : ?>
277
+ <li><a href="#fs_billing"><i class="dashicons dashicons-portfolio"></i> <?php fs_esc_html_echo_inline( 'Billing & Invoices', 'billing-invoices', $slug ) ?></li>
278
+ <li>&nbsp;&bull;&nbsp;</li>
279
+ <?php endif ?>
280
+ <?php if ( ! $is_whitelabeled ) : ?>
281
+ <?php if ( ! $is_paying ) : ?>
282
+ <li>
283
+ <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
284
+ <input type="hidden" name="fs_action" value="delete_account">
285
+ <?php wp_nonce_field( 'delete_account' ) ?>
286
+ <a class="fs-delete-account" href="#" onclick="if (confirm('<?php
287
+ if ( $is_active_subscription ) {
288
+ echo esc_attr( sprintf( fs_text_inline( 'Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the "Cancel" button, and first "Downgrade" your account. Are you sure you would like to continue with the deletion?', 'delete-account-x-confirm', $slug ), $plan->title ) );
289
+ } else {
290
+ echo esc_attr( sprintf( fs_text_inline( 'Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?', 'delete-account-confirm', $slug ), $fs->get_module_label( true ) ) );
291
+ }
292
+ ?>')) this.parentNode.submit(); return false;"><i
293
+ class="dashicons dashicons-no"></i> <?php fs_esc_html_echo_inline( 'Delete Account', 'delete-account', $slug ) ?></a>
294
+ </form>
295
+ </li>
296
+ <li>&nbsp;&bull;&nbsp;</li>
297
+ <?php endif ?>
298
+ <?php if ( $is_paying ) : ?>
299
+ <?php if ( ! fs_is_network_admin() ) : ?>
300
+ <li>
301
+ <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
302
+ <input type="hidden" name="fs_action" value="deactivate_license">
303
+ <?php wp_nonce_field( 'deactivate_license' ) ?>
304
+ <a href="#" class="fs-deactivate-license"><i
305
+ class="dashicons dashicons-admin-network"></i> <?php fs_echo_inline( 'Deactivate License', 'deactivate-license', $slug ) ?>
306
+ </a>
307
+ </form>
308
+ </li>
309
+ <li>&nbsp;&bull;&nbsp;</li>
310
+ <?php endif ?>
311
+ <?php if ( ! $license->is_lifetime() &&
312
+ $is_active_subscription
313
+ ) : ?>
314
+ <li>
315
+ <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
316
+ <input type="hidden" name="fs_action" value="downgrade_account">
317
+ <?php wp_nonce_field( 'downgrade_account' ) ?>
318
+ <a href="#"
319
+ onclick="if ( confirm('<?php echo esc_attr( sprintf(
320
+ $downgrade_x_confirm_text,
321
+ ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
322
+ $plan->title,
323
+ human_time_diff( time(), strtotime( $license->expiration ) )
324
+ ) ) ?> <?php if ( ! $license->is_block_features ) {
325
+ echo esc_attr( sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) ) );
326
+ } else {
327
+ echo esc_attr( sprintf( $after_downgrade_blocking_text, $plan->title ) );
328
+ }?> <?php echo esc_attr( $prices_increase_text ) ?> <?php fs_esc_attr_echo_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug ) ?>') ) this.parentNode.submit(); return false;"><i class="dashicons dashicons-download"></i> <?php echo esc_html( $fs->is_only_premium() ? fs_text_inline( 'Cancel Subscription', 'cancel-subscription', $slug ) : $downgrade_text ) ?></a>
329
+ </form>
330
+ </li>
331
+ <li>&nbsp;&bull;&nbsp;</li>
332
+ <?php endif ?>
333
+ <?php if ( ! $fs->is_single_plan() ) : ?>
334
+ <li>
335
+ <a href="<?php echo $fs->get_upgrade_url() ?>"><i
336
+ class="dashicons dashicons-grid-view"></i> <?php echo esc_html( $change_plan_text ) ?></a>
337
+ </li>
338
+ <li>&nbsp;&bull;&nbsp;</li>
339
+ <?php endif ?>
340
+ <?php elseif ( $is_paid_trial ) : ?>
341
+ <li>
342
+ <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
343
+ <input type="hidden" name="fs_action" value="cancel_trial">
344
+ <?php wp_nonce_field( 'cancel_trial' ) ?>
345
+ <a href="#" class="fs-cancel-trial"><i
346
+ class="dashicons dashicons-download"></i> <?php echo esc_html( $cancel_trial_text ) ?></a>
347
+ </form>
348
+ </li>
349
+ <li>&nbsp;&bull;&nbsp;</li>
350
+ <?php endif ?>
351
+ <?php endif ?>
352
+ <li>
353
+ <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
354
+ <input type="hidden" name="fs_action" value="<?php echo $fs->get_unique_affix() ?>_sync_license">
355
+ <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
356
+ <a href="#" onclick="this.parentNode.submit(); return false;"><i
357
+ class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( 'Sync', 'as synchronize', 'sync', $slug ) ?></a>
358
+ </form>
359
+ </li>
360
+ </ul>
361
+ </div>
362
+ <div class="inside">
363
+ <table id="fs_account_details" cellspacing="0" class="fs-key-value-table">
364
+ <?php
365
+ $hide_license_key = ( ! $show_license_row || $fs->apply_filters( 'hide_license_key', false ) );
366
+
367
+ $profile = array();
368
+
369
+ if ( ! $is_whitelabeled ) {
370
+ $profile[] = array(
371
+ 'id' => 'user_name',
372
+ 'title' => fs_text_inline( 'Name', 'name', $slug ),
373
+ 'value' => $name
374
+ );
375
+ // if (isset($user->email) && false !== strpos($user->email, '@'))
376
+ $profile[] = array(
377
+ 'id' => 'email',
378
+ 'title' => fs_text_inline( 'Email', 'email', $slug ),
379
+ 'value' => $user->email
380
+ );
381
+
382
+ if ( is_numeric( $user->id ) ) {
383
+ $profile[] = array(
384
+ 'id' => 'user_id',
385
+ 'title' => fs_text_inline( 'User ID', 'user-id', $slug ),
386
+ 'value' => $user->id
387
+ );
388
+ }
389
+ }
390
+
391
+ $profile[] = array(
392
+ 'id' => 'product',
393
+ 'title' => ( $fs->is_plugin() ?
394
+ fs_text_inline( 'Plugin', 'plugin', $slug ) :
395
+ fs_text_inline( 'Theme', 'theme', $slug ) ),
396
+ 'value' => $fs->get_plugin_title()
397
+ );
398
+
399
+ $profile[] = array(
400
+ 'id' => 'product_id',
401
+ 'title' => ( $fs->is_plugin() ?
402
+ fs_text_inline( 'Plugin', 'plugin', $slug ) :
403
+ fs_text_inline( 'Theme', 'theme', $slug ) ) . ' ' . fs_text_inline( 'ID', 'id', $slug ),
404
+ 'value' => $fs->get_id()
405
+ );
406
+
407
+ if ( ! fs_is_network_admin()) {
408
+ $profile[] = array(
409
+ 'id' => 'site_id',
410
+ 'title' => fs_text_inline( 'Site ID', 'site-id', $slug ),
411
+ 'value' => is_string( $site->id ) ?
412
+ $site->id :
413
+ fs_text_inline( 'No ID', 'no-id', $slug )
414
+ );
415
+
416
+ $profile[] = array(
417
+ 'id' => 'site_public_key',
418
+ 'title' => fs_text_inline( 'Public Key', 'public-key', $slug ),
419
+ 'value' => $site->public_key
420
+ );
421
+
422
+ $profile[] = array(
423
+ 'id' => 'site_secret_key',
424
+ 'title' => fs_text_inline( 'Secret Key', 'secret-key', $slug ),
425
+ 'value' => ( ( is_string( $site->secret_key ) ) ?
426
+ $site->secret_key :
427
+ fs_text_x_inline( 'No Secret', 'as secret encryption key missing', 'no-secret', $slug )
428
+ )
429
+ );
430
+ }
431
+
432
+ $profile[] = array(
433
+ 'id' => 'version',
434
+ 'title' => $version_text,
435
+ 'value' => $fs->get_plugin_version()
436
+ );
437
+
438
+ if ( ! fs_is_network_admin() && $is_premium && ! $is_whitelabeled ) {
439
+ $profile[] = array(
440
+ 'id' => 'beta_program',
441
+ 'title' => '',
442
+ 'value' => $site->is_beta
443
+ );
444
+ }
445
+
446
+ if ( $has_paid_plan || $has_bundle_license ) {
447
+ if ( $fs->is_trial() ) {
448
+ if ( $show_plan_row ) {
449
+ $profile[] = array(
450
+ 'id' => 'plan',
451
+ 'title' => $plan_text,
452
+ 'value' => ( is_string( $trial_plan->name ) ?
453
+ strtoupper( $trial_plan->title ) :
454
+ fs_text_inline( 'Trial', 'trial', $slug ) )
455
+ );
456
+ }
457
+ } else {
458
+ if ( $show_plan_row ) {
459
+ $profile[] = array(
460
+ 'id' => 'plan',
461
+ 'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
462
+ 'value' => strtoupper( is_string( $plan->name ) ?
463
+ $plan->title :
464
+ strtoupper( $free_text )
465
+ )
466
+ );
467
+
468
+ if ( $has_bundle_license ) {
469
+ $profile[] = array(
470
+ 'id' => 'bundle_plan',
471
+ 'title' => $bundle_plan_text,
472
+ 'value' => $bundle_plan_title
473
+ );
474
+ }
475
+ }
476
+
477
+ if ( is_object( $license ) ) {
478
+ if ( ! $hide_license_key ) {
479
+ $profile[] = array(
480
+ 'id' => 'license_key',
481
+ 'title' => fs_text_inline( 'License Key', $slug ),
482
+ 'value' => $license->secret_key,
483
+ );
484
+ }
485
+ }
486
+ }
487
+ }
488
+ ?>
489
+ <?php $odd = true;
490
+ foreach ( $profile as $p ) : ?>
491
+ <?php
492
+ if ( 'plan' === $p['id'] && ! $has_paid_plan ) {
493
+ // If plugin don't have any paid plans, there's no reason
494
+ // to show current plan.
495
+ continue;
496
+ }
497
+ ?>
498
+ <tr class="fs-field-<?php echo $p['id'] ?><?php if ( $odd ) : ?> alternate<?php endif ?>">
499
+ <td>
500
+ <nobr><?php echo $p['title'] ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
501
+ </td>
502
+ <td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>>
503
+ <?php if ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
504
+ <code><?php echo FS_Plugin_License::mask_secret_key_for_html( $p['value'] ) ?></code>
505
+ <?php if ( ! $is_whitelabeled ) : ?>
506
+ <input type="text" value="<?php echo htmlspecialchars( $p['value'] ) ?>" style="display: none"
507
+ readonly/>
508
+ <?php endif ?>
509
+ <?php elseif ( 'beta_program' === $p['id'] ) : ?>
510
+ <label>
511
+ <input type="checkbox" class="fs-toggle-beta-mode" <?php checked( true, $p['value'] ) ?>/><span><?php
512
+ fs_esc_html_echo_inline( 'Join the Beta program', 'join-beta', $slug )
513
+ ?></span></label>
514
+ <?php else : ?>
515
+ <code><?php echo htmlspecialchars( $p['value'] ) ?></code>
516
+ <?php endif ?>
517
+ <?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
518
+ <label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'not verified', 'not-verified', $slug ) ?></label>
519
+ <?php endif ?>
520
+ <?php if ( 'plan' === $p['id'] ) : ?>
521
+ <?php if ( $fs->is_trial() ) : ?>
522
+ <label class="fs-tag fs-success"><?php echo esc_html( $trial_text ) ?></label>
523
+ <?php endif ?>
524
+ <?php if ( is_object( $license ) && ! $license->is_lifetime() ) : ?>
525
+ <?php if ( ! $is_active_subscription && ! $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
526
+ <?php $is_license_expired = $license->is_expired() ?>
527
+ <?php $expired_ago_text = ( fs_text_inline( 'Expired', 'expired', $slug ) . ' ' . fs_text_x_inline( '%s ago', 'x-ago'