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.58

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.58
Comparing to
See all releases

Code changes from version 1.3.57 to 1.3.58

admin/import/class-wordpress-importer.php CHANGED
@@ -1,1378 +1,1378 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly.
5
- }
6
-
7
- if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
8
- return;
9
-
10
- /** Display verbose errors */
11
- define( 'IMPORT_DEBUG', false );
12
-
13
- // Load Importer API
14
- require_once ABSPATH . 'wp-admin/includes/import.php';
15
-
16
- if ( ! class_exists( 'WP_Importer' ) ) {
17
- $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
18
- if ( file_exists( $class_wp_importer ) )
19
- require $class_wp_importer;
20
- }
21
-
22
- // include WXR file parsers
23
- require WPR_ADDONS_PATH .'admin/import/class-parsers.php';
24
-
25
- class WP_Import extends WP_Importer {
26
- const DEFAULT_BUMP_REQUEST_TIMEOUT = 60;
27
- const DEFAULT_ALLOW_CREATE_USERS = true;
28
- const DEFAULT_IMPORT_ATTACHMENT_SIZE_LIMIT = 0; // 0 = unlimited.
29
-
30
- /**
31
- * @var string
32
- */
33
- private $requested_file_path;
34
-
35
- /**
36
- * @var array
37
- */
38
- private $args;
39
-
40
- /**
41
- * @var array
42
- */
43
- private $output = [
44
- 'status' => 'failed',
45
- 'errors' => [],
46
- ];
47
-
48
- /*
49
- * WXR attachment ID
50
- */
51
- private $id;
52
-
53
- // Information to import from WXR file.
54
- private $version;
55
- private $authors = [];
56
- private $posts = [];
57
- private $terms = [];
58
- private $categories = [];
59
- private $tags = [];
60
- private $base_url = '';
61
- private $page_on_front;
62
-
63
- // Mappings from old information to new.
64
- private $processed_authors = [];
65
- private $author_mapping = [];
66
- private $processed_terms = [];
67
- private $processed_posts = [];
68
- private $post_orphans = [];
69
- private $processed_menu_items = [];
70
- private $menu_item_orphans = [];
71
- private $missing_menu_items = [];
72
-
73
- private $fetch_attachments = false;
74
- private $url_remap = [];
75
- private $featured_images = [];
76
-
77
- /**
78
- * Parses filename from a Content-Disposition header value.
79
- *
80
- * As per RFC6266:
81
- *
82
- * content-disposition = "Content-Disposition" ":"
83
- * disposition-type *( ";" disposition-parm )
84
- *
85
- * disposition-type = "inline" | "attachment" | disp-ext-type
86
- * ; case-insensitive
87
- * disp-ext-type = token
88
- *
89
- * disposition-parm = filename-parm | disp-ext-parm
90
- *
91
- * filename-parm = "filename" "=" value
92
- * | "filename*" "=" ext-value
93
- *
94
- * disp-ext-parm = token "=" value
95
- * | ext-token "=" ext-value
96
- * ext-token = <the characters in token, followed by "*">
97
- *
98
- * @param string[] $disposition_header List of Content-Disposition header values.
99
- *
100
- * @return string|null Filename if available, or null if not found.
101
- * @link http://tools.ietf.org/html/rfc2388
102
- * @link http://tools.ietf.org/html/rfc6266
103
- *
104
- * @see WP_REST_Attachments_Controller::get_filename_from_disposition()
105
- *
106
- */
107
- protected static function get_filename_from_disposition( $disposition_header ) {
108
- // Get the filename.
109
- $filename = null;
110
-
111
- foreach ( $disposition_header as $value ) {
112
- $value = trim( $value );
113
-
114
- if ( strpos( $value, ';' ) === false ) {
115
- continue;
116
- }
117
-
118
- list( $type, $attr_parts ) = explode( ';', $value, 2 );
119
-
120
- $attr_parts = explode( ';', $attr_parts );
121
- $attributes = [];
122
-
123
- foreach ( $attr_parts as $part ) {
124
- if ( strpos( $part, '=' ) === false ) {
125
- continue;
126
- }
127
-
128
- list( $key, $value ) = explode( '=', $part, 2 );
129
-
130
- $attributes[ trim( $key ) ] = trim( $value );
131
- }
132
-
133
- if ( empty( $attributes['filename'] ) ) {
134
- continue;
135
- }
136
-
137
- $filename = trim( $attributes['filename'] );
138
-
139
- // Unquote quoted filename, but after trimming.
140
- if ( substr( $filename, 0, 1 ) === '"' && substr( $filename, -1, 1 ) === '"' ) {
141
- $filename = substr( $filename, 1, -1 );
142
- }
143
- }
144
-
145
- return $filename;
146
- }
147
-
148
- /**
149
- * Retrieves file extension by mime type.
150
- *
151
- * @param string $mime_type Mime type to search extension for.
152
- *
153
- * @return string|null File extension if available, or null if not found.
154
- */
155
- protected static function get_file_extension_by_mime_type( $mime_type ) {
156
- static $map = null;
157
-
158
- if ( is_array( $map ) ) {
159
- return isset( $map[ $mime_type ] ) ? $map[ $mime_type ] : null;
160
- }
161
-
162
- $mime_types = wp_get_mime_types();
163
- $map = array_flip( $mime_types );
164
-
165
- // Some types have multiple extensions, use only the first one.
166
- foreach ( $map as $type => $extensions ) {
167
- $map[ $type ] = strtok( $extensions, '|' );
168
- }
169
-
170
- return isset( $map[ $mime_type ] ) ? $map[ $mime_type ] : null;
171
- }
172
-
173
- /**
174
- * The main controller for the actual import stage.
175
- *
176
- * @param string $file Path to the WXR file for importing
177
- */
178
- private function import( $file ) {
179
- add_filter( 'import_post_meta_key', function ( $key ) {
180
- return $this->is_valid_meta_key( $key );
181
- } );
182
- add_filter( 'http_request_timeout', function () {
183
- return self::DEFAULT_BUMP_REQUEST_TIMEOUT;
184
- } );
185
-
186
- if ( ! $this->import_start( $file ) ) {
187
- return;
188
- }
189
-
190
- $this->set_author_mapping();
191
-
192
- wp_suspend_cache_invalidation( true );
193
- $imported_summary = [
194
- 'categories' => $this->process_categories(),
195
- 'tags' => $this->process_tags(),
196
- 'terms' => $this->process_terms(),
197
- 'posts' => $this->process_posts(),
198
- ];
199
- wp_suspend_cache_invalidation( false );
200
-
201
- // Update incorrect/missing information in the DB.
202
- $this->backfill_parents();
203
- $this->backfill_attachment_urls();
204
- $this->remap_featured_images();
205
-
206
- $this->import_end();
207
-
208
- $is_some_succeed = false;
209
- foreach ( $imported_summary as $item ) {
210
- if ( $item > 0 ) {
211
- $is_some_succeed = true;
212
- break;
213
- }
214
- }
215
-
216
- if ( $is_some_succeed ) {
217
- $this->output['status'] = 'success';
218
- $this->output['summary'] = $imported_summary;
219
- }
220
- }
221
-
222
- /**
223
- * Parses the WXR file and prepares us for the task of processing parsed data.
224
- *
225
- * @param string $file Path to the WXR file for importing
226
- */
227
- private function import_start( $file ) {
228
- if ( ! is_file( $file ) ) {
229
- $this->output['errors'] = [ esc_html__( 'The file does not exist, please try again.', 'wpr-addons' ) ];
230
-
231
- return false;
232
- }
233
-
234
- $import_data = $this->parse( $file );
235
-
236
- if ( is_wp_error( $import_data ) ) {
237
- $this->output['errors'] = [ $import_data->get_error_message() ];
238
-
239
- return false;
240
- }
241
-
242
- $this->version = $import_data['version'];
243
- $this->set_authors_from_import( $import_data );
244
- $this->posts = $import_data['posts'];
245
- $this->terms = $import_data['terms'];
246
- $this->categories = $import_data['categories'];
247
- $this->tags = $import_data['tags'];
248
- $this->base_url = esc_url( $import_data['base_url'] );
249
- $this->page_on_front = $import_data['page_on_front'];
250
-
251
- wp_defer_term_counting( true );
252
- wp_defer_comment_counting( true );
253
-
254
- do_action( 'import_start' );
255
-
256
- return true;
257
- }
258
-
259
- /**
260
- * Performs post-import cleanup of files and the cache
261
- */
262
- private function import_end() {
263
- wp_import_cleanup( $this->id );
264
-
265
- wp_cache_flush();
266
-
267
- foreach ( get_taxonomies() as $tax ) {
268
- delete_option( "{$tax}_children" );
269
- _get_term_hierarchy( $tax );
270
- }
271
-
272
- wp_defer_term_counting( false );
273
- wp_defer_comment_counting( false );
274
-
275
- do_action( 'import_end' );
276
- }
277
-
278
- /**
279
- * Retrieve authors from parsed WXR data and set it to `$this->>authors`.
280
- *
281
- * Uses the provided author information from WXR 1.1 files
282
- * or extracts info from each post for WXR 1.0 files
283
- *
284
- * @param array $import_data Data returned by a WXR parser
285
- */
286
- private function set_authors_from_import( $import_data ) {
287
- if ( ! empty( $import_data['authors'] ) ) {
288
- $this->authors = $import_data['authors'];
289
- // No author information, grab it from the posts.
290
- } else {
291
- foreach ( $import_data['posts'] as $post ) {
292
- $login = sanitize_user( $post['post_author'], true );
293
-
294
- if ( empty( $login ) ) {
295
- /* translators: %s: Post author. */
296
- $this->output['errors'][] = sprintf( esc_html__( 'Failed to import author %s. Their posts will be attributed to the current user.', 'wpr-addons' ), $post['post_author'] );
297
- continue;
298
- }
299
-
300
- if ( ! isset( $this->authors[ $login ] ) ) {
301
- $this->authors[ $login ] = [
302
- 'author_login' => $login,
303
- 'author_display_name' => $post['post_author'],
304
- ];
305
- }
306
- }
307
- }
308
- }
309
-
310
- /**
311
- * Map old author logins to local user IDs based on decisions made
312
- * in import options form. Can map to an existing user, create a new user
313
- * or falls back to the current user in case of error with either of the previous
314
- */
315
- private function set_author_mapping() {
316
- if ( ! isset( $this->args['imported_authors'] ) ) {
317
- return;
318
- }
319
-
320
- $create_users = apply_filters( 'import_allow_create_users', self::DEFAULT_ALLOW_CREATE_USERS );
321
-
322
- foreach ( (array) $this->args['imported_authors'] as $i => $old_login ) {
323
- // Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts.
324
- $santized_old_login = sanitize_user( $old_login, true );
325
- $old_id = isset( $this->authors[ $old_login ]['author_id'] ) ? intval( $this->authors[ $old_login ]['author_id'] ) : false;
326
-
327
- if ( ! empty( $this->args['user_map'][ $i ] ) ) {
328
- $user = get_userdata( intval( $this->args['user_map'][ $i ] ) );
329
- if ( isset( $user->ID ) ) {
330
- if ( $old_id ) {
331
- $this->processed_authors[ $old_id ] = $user->ID;
332
- }
333
- $this->author_mapping[ $santized_old_login ] = $user->ID;
334
- }
335
- } elseif ( $create_users ) {
336
- $user_id = 0;
337
- if ( ! empty( $this->args['user_new'][ $i ] ) ) {
338
- $user_id = wp_create_user( $this->args['user_new'][ $i ], wp_generate_password() );
339
- } elseif ( '1.0' !== $this->version ) {
340
- $user_data = [
341
- 'user_login' => $old_login,
342
- 'user_pass' => wp_generate_password(),
343
- 'user_email' => isset( $this->authors[ $old_login ]['author_email'] ) ? $this->authors[ $old_login ]['author_email'] : '',
344
- 'display_name' => $this->authors[ $old_login ]['author_display_name'],
345
- 'first_name' => isset( $this->authors[ $old_login ]['author_first_name'] ) ? $this->authors[ $old_login ]['author_first_name'] : '',
346
- 'last_name' => isset( $this->authors[ $old_login ]['author_last_name'] ) ? $this->authors[ $old_login ]['author_last_name'] : '',
347
- ];
348
- $user_id = wp_insert_user( $user_data );
349
- }
350
-
351
- if ( ! is_wp_error( $user_id ) ) {
352
- if ( $old_id ) {
353
- $this->processed_authors[ $old_id ] = $user_id;
354
- }
355
- $this->author_mapping[ $santized_old_login ] = $user_id;
356
- } else {
357
- /* translators: %s: Author display name. */
358
- $error = sprintf( esc_html__( 'Failed to create new user for %s. Their posts will be attributed to the current user.', 'wpr-addons' ), $this->authors[ $old_login ]['author_display_name'] );
359
-
360
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
361
- $error .= PHP_EOL . $user_id->get_error_message();
362
- }
363
-
364
- $this->output['errors'][] = $error;
365
- }
366
- }
367
-
368
- // Failsafe: if the user_id was invalid, default to the current user.
369
- if ( ! isset( $this->author_mapping[ $santized_old_login ] ) ) {
370
- if ( $old_id ) {
371
- $this->processed_authors[ $old_id ] = (int) get_current_user_id();
372
- }
373
- $this->author_mapping[ $santized_old_login ] = (int) get_current_user_id();
374
- }
375
- }
376
- }
377
-
378
- /**
379
- * Create new categories based on import information
380
- *
381
- * Doesn't create a new category if its slug already exists
382
- *
383
- * @return int number of imported categories.
384
- */
385
- private function process_categories() {
386
- $result = 0;
387
-
388
- $this->categories = apply_filters( 'wp_import_categories', $this->categories );
389
-
390
- if ( empty( $this->categories ) ) {
391
- return $result;
392
- }
393
-
394
- foreach ( $this->categories as $cat ) {
395
- // if the category already exists leave it alone
396
- $term_id = term_exists( $cat['category_nicename'], 'category' );
397
- if ( $term_id ) {
398
- if ( is_array( $term_id ) ) {
399
- $term_id = $term_id['term_id'];
400
- }
401
- if ( isset( $cat['term_id'] ) ) {
402
- $this->processed_terms[ intval( $cat['term_id'] ) ] = (int) $term_id;
403
- }
404
- continue;
405
- }
406
-
407
- $parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );
408
- $description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';
409
-
410
- $data = [
411
- 'category_nicename' => $cat['category_nicename'],
412
- 'category_parent' => $parent,
413
- 'cat_name' => wp_slash( $cat['cat_name'] ),
414
- 'category_description' => wp_slash( $description ),
415
- ];
416
-
417
- $id = wp_insert_category( $data );
418
- if ( ! is_wp_error( $id ) && $id > 0 ) {
419
- if ( isset( $cat['term_id'] ) ) {
420
- $this->processed_terms[ intval( $cat['term_id'] ) ] = $id;
421
- }
422
- $result++;
423
- } else {
424
- /* translators: %s: Category name. */
425
- $error = sprintf( esc_html__( 'Failed to import category %s', 'wpr-addons' ), $cat['category_nicename'] );
426
-
427
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
428
- $error .= PHP_EOL . $id->get_error_message();
429
- }
430
-
431
- $this->output['errors'][] = $error;
432
- continue;
433
- }
434
-
435
- $this->process_termmeta( $cat, $id );
436
- add_term_meta( $id, '_wpr_demo_import_item', true );
437
- }
438
-
439
- unset( $this->categories );
440
-
441
- return $result;
442
- }
443
-
444
- /**
445
- * Create new post tags based on import information
446
- *
447
- * Doesn't create a tag if its slug already exists
448
- *
449
- * @return int number of imported tags.
450
- */
451
- private function process_tags() {
452
- $result = 0;
453
-
454
- $this->tags = apply_filters( 'wp_import_tags', $this->tags );
455
-
456
- if ( empty( $this->tags ) ) {
457
- return $result;
458
- }
459
-
460
- foreach ( $this->tags as $tag ) {
461
- // if the tag already exists leave it alone
462
- $term_id = term_exists( $tag['tag_slug'], 'post_tag' );
463
- if ( $term_id ) {
464
- if ( is_array( $term_id ) ) {
465
- $term_id = $term_id['term_id'];
466
- }
467
- if ( isset( $tag['term_id'] ) ) {
468
- $this->processed_terms[ intval( $tag['term_id'] ) ] = (int) $term_id;
469
- }
470
- continue;
471
- }
472
-
473
- $description = isset( $tag['tag_description'] ) ? $tag['tag_description'] : '';
474
- $args = [
475
- 'slug' => $tag['tag_slug'],
476
- 'description' => wp_slash( $description ),
477
- ];
478
-
479
- $id = wp_insert_term( wp_slash( $tag['tag_name'] ), 'post_tag', $args );
480
- if ( ! is_wp_error( $id ) ) {
481
- if ( isset( $tag['term_id'] ) ) {
482
- $this->processed_terms[ intval( $tag['term_id'] ) ] = $id['term_id'];
483
- }
484
- $result++;
485
- } else {
486
- /* translators: %s: Tag name. */
487
- $error = sprintf( esc_html__( 'Failed to import post tag %s', 'wpr-addons' ), $tag['tag_name'] );
488
-
489
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
490
- $error .= PHP_EOL . $id->get_error_message();
491
- }
492
-
493
- $this->output['errors'][] = $error;
494
- continue;
495
- }
496
-
497
- $this->process_termmeta( $tag, $id['term_id'] );
498
- add_term_meta( $id['term_id'], '_wpr_demo_import_item', true );
499
- }
500
-
501
- unset( $this->tags );
502
-
503
- return $result;
504
- }
505
-
506
- /**
507
- * Create new terms based on import information
508
- *
509
- * Doesn't create a term its slug already exists
510
- *
511
- * @return int number of imported terms.
512
- */
513
- private function process_terms() {
514
- $result = 0;
515
-
516
- $this->terms = apply_filters( 'wp_import_terms', $this->terms );
517
-
518
- if ( empty( $this->terms ) ) {
519
- return $result;
520
- }
521
-
522
- foreach ( $this->terms as $term ) {
523
- // if the term already exists in the correct taxonomy leave it alone
524
- $term_id = term_exists( $term['slug'], $term['term_taxonomy'] );
525
- if ( $term_id ) {
526
- if ( is_array( $term_id ) ) {
527
- $term_id = $term_id['term_id'];
528
- }
529
- if ( isset( $term['term_id'] ) ) {
530
- $this->processed_terms[ intval( $term['term_id'] ) ] = (int) $term_id;
531
- }
532
- continue;
533
- }
534
-
535
- if ( empty( $term['term_parent'] ) ) {
536
- $parent = 0;
537
- } else {
538
- $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );
539
- if ( is_array( $parent ) ) {
540
- $parent = $parent['term_id'];
541
- }
542
- }
543
-
544
- $description = isset( $term['term_description'] ) ? $term['term_description'] : '';
545
- $args = [
546
- 'slug' => $term['slug'],
547
- 'description' => wp_slash( $description ),
548
- 'parent' => (int) $parent,
549
- ];
550
-
551
- $id = wp_insert_term( wp_slash( $term['term_name'] ), $term['term_taxonomy'], $args );
552
- if ( ! is_wp_error( $id ) ) {
553
- if ( isset( $term['term_id'] ) ) {
554
- $this->processed_terms[ intval( $term['term_id'] ) ] = $id['term_id'];
555
- }
556
- $result++;
557
- } else {
558
- /* translators: 1: Term taxonomy, 2: Term name. */
559
- $error = sprintf( esc_html__( 'Failed to import %1$s %2$s', 'wpr-addons' ), $term['term_taxonomy'], $term['term_name'] );
560
-
561
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
562
- $error .= PHP_EOL . $id->get_error_message();
563
- }
564
-
565
- $this->output['errors'][] = $error;
566
- continue;
567
- }
568
-
569
- $this->process_termmeta( $term, $id['term_id'] );
570
- add_term_meta( $id['term_id'], '_wpr_demo_import_item', true );
571
- }
572
-
573
- unset( $this->terms );
574
-
575
- return $result;
576
- }
577
-
578
- /**
579
- * Add metadata to imported term.
580
- *
581
- * @param array $term Term data from WXR import.
582
- * @param int $term_id ID of the newly created term.
583
- */
584
- private function process_termmeta( $term, $term_id ) {
585
- if ( ! function_exists( 'add_term_meta' ) ) {
586
- return;
587
- }
588
-
589
- if ( ! isset( $term['termmeta'] ) ) {
590
- $term['termmeta'] = [];
591
- }
592
-
593
- /**
594
- * Filters the metadata attached to an imported term.
595
- *
596
- * @param array $termmeta Array of term meta.
597
- * @param int $term_id ID of the newly created term.
598
- * @param array $term Term data from the WXR import.
599
- */
600
- $term['termmeta'] = apply_filters( 'wp_import_term_meta', $term['termmeta'], $term_id, $term );
601
-
602
- if ( empty( $term['termmeta'] ) ) {
603
- return;
604
- }
605
-
606
- foreach ( $term['termmeta'] as $meta ) {
607
- /**
608
- * Filters the meta key for an imported piece of term meta.
609
- *
610
- * @param string $meta_key Meta key.
611
- * @param int $term_id ID of the newly created term.
612
- * @param array $term Term data from the WXR import.
613
- */
614
- $key = apply_filters( 'import_term_meta_key', $meta['key'], $term_id, $term );
615
- if ( ! $key ) {
616
- continue;
617
- }
618
-
619
- // Export gets meta straight from the DB so could have a serialized string
620
- $value = maybe_unserialize( $meta['value'] );
621
-
622
- add_term_meta( $term_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
623
-
624
- /**
625
- * Fires after term meta is imported.
626
- *
627
- * @param int $term_id ID of the newly created term.
628
- * @param string $key Meta key.
629
- * @param mixed $value Meta value.
630
- */
631
- do_action( 'import_term_meta', $term_id, $key, $value );
632
- }
633
- }
634
-
635
- /**
636
- * Create new posts based on import information
637
- *
638
- * Posts marked as having a parent which doesn't exist will become top level items.
639
- * Doesn't create a new post if: the post type doesn't exist, the given post ID
640
- * is already noted as imported or a post with the same title and date already exists.
641
- * Note that new/updated terms, comments and meta are imported for the last of the above.
642
- *
643
- * @return array the ids of succeed/failed imported posts.
644
- */
645
- private function process_posts() {
646
- $result = [
647
- 'succeed' => [],
648
- 'failed' => [],
649
- ];
650
-
651
- $this->posts = apply_filters( 'wp_import_posts', $this->posts );
652
-
653
- foreach ( $this->posts as $post ) {
654
- $post = apply_filters( 'wp_import_post_data_raw', $post );
655
-
656
- if ( ! post_type_exists( $post['post_type'] ) ) {
657
- /* translators: 1: Post title, 2: Post type. */
658
- $this->output['errors'][] = sprintf( esc_html__( 'Failed to import %1$s: Invalid post type %2$s', 'wpr-addons' ), $post['post_title'], $post['post_type'] );
659
- do_action( 'wp_import_post_exists', $post );
660
- continue;
661
- }
662
-
663
- if ( isset( $this->processed_posts[ $post['post_id'] ] ) && ! empty( $post['post_id'] ) ) {
664
- continue;
665
- }
666
-
667
- if ( 'auto-draft' === $post['status'] ) {
668
- continue;
669
- }
670
-
671
- if ( 'nav_menu_item' === $post['post_type'] ) {
672
- $this->process_menu_item( $post );
673
- continue;
674
- }
675
-
676
- $post_type_object = get_post_type_object( $post['post_type'] );
677
-
678
- $post_parent = (int) $post['post_parent'];
679
- if ( $post_parent ) {
680
- // if we already know the parent, map it to the new local ID.
681
- if ( isset( $this->processed_posts[ $post_parent ] ) ) {
682
- $post_parent = $this->processed_posts[ $post_parent ];
683
- // otherwise record the parent for later.
684
- } else {
685
- $this->post_orphans[ intval( $post['post_id'] ) ] = $post_parent;
686
- $post_parent = 0;
687
- }
688
- }
689
-
690
- // Map the post author.
691
- $author = sanitize_user( $post['post_author'], true );
692
- if ( isset( $this->author_mapping[ $author ] ) ) {
693
- $author = $this->author_mapping[ $author ];
694
- } else {
695
- $author = (int) get_current_user_id();
696
- }
697
-
698
- $postdata = [
699
- 'import_id' => $post['post_id'],
700
- 'post_author' => $author,
701
- 'post_content' => $post['post_content'],
702
- 'post_excerpt' => $post['post_excerpt'],
703
- 'post_title' => $post['post_title'],
704
- 'post_status' => $post['status'],
705
- 'post_name' => $post['post_name'],
706
- 'comment_status' => $post['comment_status'],
707
- 'ping_status' => $post['ping_status'],
708
- 'guid' => $post['guid'],
709
- 'post_parent' => $post_parent,
710
- 'menu_order' => $post['menu_order'],
711
- 'post_type' => $post['post_type'],
712
- 'post_password' => $post['post_password'],
713
- 'post_date' => $post['post_date'],
714
- ];
715
-
716
- $original_post_id = $post['post_id'];
717
- $postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );
718
-
719
- $postdata = wp_slash( $postdata );
720
-
721
- if ( 'attachment' === $postdata['post_type'] ) {
722
- $remote_url = ! empty( $post['attachment_url'] ) ? $post['attachment_url'] : $post['guid'];
723
-
724
- // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
725
- // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
726
- $postdata['upload_date'] = $post['post_date'];
727
- if ( isset( $post['postmeta'] ) ) {
728
- foreach ( $post['postmeta'] as $meta ) {
729
- if ( '_wp_attached_file' === $meta['key'] ) {
730
- if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) ) {
731
- $postdata['upload_date'] = $matches[0];
732
- }
733
- break;
734
- }
735
- }
736
- }
737
-
738
- $post_id = $this->process_attachment( $postdata, $remote_url );
739
- $comment_post_id = $post_id;
740
- } else {
741
- $post_id = wp_insert_post( $postdata, true );
742
- $comment_post_id = $post_id;
743
- do_action( 'wp_import_insert_post', $post_id, $original_post_id, $postdata, $post );
744
- }
745
-
746
- if ( is_wp_error( $post_id ) ) {
747
- /* translators: 1: Post type singular label, 2: Post title. */
748
- $error = sprintf( __( 'Failed to import %1$s %2$s', 'wpr-addons' ), $post_type_object->labels->singular_name, $post['post_title'] );
749
-
750
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
751
- $error .= PHP_EOL . $post_id->get_error_message();
752
- }
753
-
754
- $result['failed'][] = $original_post_id;
755
-
756
- $this->output['errors'][] = $error;
757
-
758
- continue;
759
- }
760
-
761
- $result['succeed'][ $original_post_id ] = $post_id;
762
-
763
- if ( 1 === $post['is_sticky'] ) {
764
- stick_post( $post_id );
765
- }
766
-
767
- if ( $this->page_on_front === $original_post_id ) {
768
- update_option( 'page_on_front', $post_id );
769
- }
770
-
771
- // Map pre-import ID to local ID.
772
- $this->processed_posts[ intval( $post['post_id'] ) ] = (int) $post_id;
773
-
774
- if ( ! isset( $post['terms'] ) ) {
775
- $post['terms'] = [];
776
- }
777
-
778
- $post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );
779
-
780
- // add categories, tags and other terms
781
- if ( ! empty( $post['terms'] ) ) {
782
- $terms_to_set = [];
783
- foreach ( $post['terms'] as $term ) {
784
- // back compat with WXR 1.0 map 'tag' to 'post_tag'
785
- $taxonomy = ( 'tag' === $term['domain'] ) ? 'post_tag' : $term['domain'];
786
- $term_exists = term_exists( $term['slug'], $taxonomy );
787
- $term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;
788
- if ( ! $term_id ) {
789
- $t = wp_insert_term( $term['name'], $taxonomy, [ 'slug' => $term['slug'] ] );
790
- if ( ! is_wp_error( $t ) ) {
791
- $term_id = $t['term_id'];
792
- do_action( 'wp_import_insert_term', $t, $term, $post_id, $post );
793
- } else {
794
- /* translators: 1: Taxonomy name, 2: Term name. */
795
- $error = sprintf( esc_html__( 'Failed to import %1$s %2$s', 'wpr-addons' ), $taxonomy, $term['name'] );
796
-
797
- if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
798
- $error .= PHP_EOL . $t->get_error_message();
799
- }
800
-
801
- $this->output['errors'][] = $error;
802
-
803
- do_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );
804
- continue;
805
- }
806
- }
807
- $terms_to_set[ $taxonomy ][] = intval( $term_id );
808
- }
809
-
810
- foreach ( $terms_to_set as $tax => $ids ) {
811
- $tt_ids = wp_set_post_terms( $post_id, $ids, $tax );
812
- do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );
813
- }
814
- unset( $post['terms'], $terms_to_set );
815
- }
816
-
817
- if ( ! isset( $post['comments'] ) ) {
818
- $post['comments'] = [];
819
- }
820
-
821
- $post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );
822
-
823
- // Add/update comments.
824
- if ( ! empty( $post['comments'] ) ) {
825
- $num_comments = 0;
826
- $inserted_comments = [];
827
- foreach ( $post['comments'] as $comment ) {
828
- $comment_id = $comment['comment_id'];
829
- $newcomments[ $comment_id ]['comment_post_ID'] = $comment_post_id;
830
- $newcomments[ $comment_id ]['comment_author'] = $comment['comment_author'];
831
- $newcomments[ $comment_id ]['comment_author_email'] = $comment['comment_author_email'];
832
- $newcomments[ $comment_id ]['comment_author_IP'] = $comment['comment_author_IP'];
833
- $newcomments[ $comment_id ]['comment_author_url'] = $comment['comment_author_url'];
834
- $newcomments[ $comment_id ]['comment_date'] = $comment['comment_date'];
835
- $newcomments[ $comment_id ]['comment_date_gmt'] = $comment['comment_date_gmt'];
836
- $newcomments[ $comment_id ]['comment_content'] = $comment['comment_content'];
837
- $newcomments[ $comment_id ]['comment_approved'] = $comment['comment_approved'];
838
- $newcomments[ $comment_id ]['comment_type'] = $comment['comment_type'];
839
- $newcomments[ $comment_id ]['comment_parent'] = $comment['comment_parent'];
840
- $newcomments[ $comment_id ]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : [];
841
- if ( isset( $this->processed_authors[ $comment['comment_user_id'] ] ) ) {
842
- $newcomments[ $comment_id ]['user_id'] = $this->processed_authors[ $comment['comment_user_id'] ];
843
- }
844
- }
845
-
846
- ksort( $newcomments );
847
-
848
- foreach ( $newcomments as $key => $comment ) {
849
- if ( isset( $inserted_comments[ $comment['comment_parent'] ] ) ) {
850
- $comment['comment_parent'] = $inserted_comments[ $comment['comment_parent'] ];
851
- }
852
-
853
- $comment_data = wp_slash( $comment );
854
- unset( $comment_data['commentmeta'] ); // Handled separately, wp_insert_comment() also expects `comment_meta`.
855
- $comment_data = wp_filter_comment( $comment_data );
856
-
857
- $inserted_comments[ $key ] = wp_insert_comment( $comment_data );
858
-
859
- do_action( 'wp_import_insert_comment', $inserted_comments[ $key ], $comment, $comment_post_id, $post );
860
-
861
- foreach ( $comment['commentmeta'] as $meta ) {
862
- $value = maybe_unserialize( $meta['value'] );
863
-
864
- add_comment_meta( $inserted_comments[ $key ], wp_slash( $meta['key'] ), wp_slash_strings_only( $value ) );
865
- }
866
-
867
- $num_comments++;
868
- }
869
- unset( $newcomments, $inserted_comments, $post['comments'] );
870
- }
871
-
872
- if ( ! isset( $post['postmeta'] ) ) {
873
- $post['postmeta'] = [];
874
- }
875
-
876
- $post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );
877
-
878
- // Add/update post meta.
879
- if ( ! empty( $post['postmeta'] ) ) {
880
- foreach ( $post['postmeta'] as $meta ) {
881
- $key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );
882
- $value = false;
883
-
884
- if ( '_edit_last' === $key ) {
885
- if ( isset( $this->processed_authors[ intval( $meta['value'] ) ] ) ) {
886
- $value = $this->processed_authors[ intval( $meta['value'] ) ];
887
- } else {
888
- $key = false;
889
- }
890
- }
891
-
892
- if ( $key ) {
893
- // Export gets meta straight from the DB so could have a serialized string.
894
- if ( ! $value ) {
895
- $value = maybe_unserialize( $meta['value'] );
896
- }
897
-
898
- add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
899
-
900
- do_action( 'import_post_meta', $post_id, $key, $value );
901
-
902
- // If the post has a featured image, take note of this in case of remap.
903
- if ( '_thumbnail_id' === $key ) {
904
- $this->featured_images[ $post_id ] = (int) $value;
905
- }
906
- }
907
- }
908
- }
909
-
910
- // Mark items as WPR Imported
911
- add_post_meta( $post_id, '_wpr_demo_import_item', true );
912
-
913
- }
914
-
915
- unset( $this->posts );
916
-
917
- return $result;
918
- }
919
-
920
- /**
921
- * Attempt to create a new menu item from import data
922
- *
923
- * Fails for draft, orphaned menu items and those without an associated nav_menu
924
- * or an invalid nav_menu term. If the post type or term object which the menu item
925
- * represents doesn't exist then the menu item will not be imported (waits until the
926
- * end of the import to retry again before discarding).
927
- *
928
- * @param array $item Menu item details from WXR file
929
- */
930
- private function process_menu_item( $item ) {
931
- // Skip draft, orphaned menu items.
932
- if ( 'draft' === $item['status'] ) {
933
- return;
934
- }
935
-
936
- $menu_slug = false;
937
- if ( isset( $item['terms'] ) ) {
938
- // Loop through terms, assume first nav_menu term is correct menu.
939
- foreach ( $item['terms'] as $term ) {
940
- if ( 'nav_menu' === $term['domain'] ) {
941
- $menu_slug = $term['slug'];
942
- break;
943
- }
944
- }
945
- }
946
-
947
- // No nav_menu term associated with this menu item.
948
- if ( ! $menu_slug ) {
949
- $this->output['errors'][] = esc_html__( 'Menu item skipped due to missing menu slug', 'wpr-addons' );
950
-
951
- return;
952
- }
953
-
954
- $menu_id = term_exists( $menu_slug, 'nav_menu' );
955
- if ( ! $menu_id ) {
956
- /* translators: %s: Menu slug. */
957
- $this->output['errors'][] = sprintf( esc_html__( 'Menu item skipped due to invalid menu slug: %s', 'wpr-addons' ), $menu_slug );
958
-
959
- return;
960
- } else {
961
- $menu_id = is_array( $menu_id ) ? $menu_id['term_id'] : $menu_id;
962
- }
963
-
964
- $post_meta_key_value = [];
965
- foreach ( $item['postmeta'] as $meta ) {
966
- $post_meta_key_value[ $meta['key'] ] = $meta['value'];
967
- }
968
-
969
- // Duke - Import Menu Items Post Meta
970
- $backup_menu_item_meta = [];
971
- $backup_menu_item_meta['postmeta'] = $item['postmeta'];
972
-
973
- foreach ( $item['postmeta'] as $meta ) {
974
- ${$meta['key']} = $meta['value'];
975
- }
976
- // End.
977
-
978
- $_menu_item_object_id = $post_meta_key_value['_menu_item_object_id'];
979
- if ( 'taxonomy' === $post_meta_key_value['_menu_item_type'] && isset( $this->processed_terms[ intval( $_menu_item_object_id ) ] ) ) {
980
- $_menu_item_object_id = $this->processed_terms[ intval( $_menu_item_object_id ) ];
981
- } elseif ( 'post_type' === $post_meta_key_value['_menu_item_type'] && isset( $this->processed_posts[ intval( $_menu_item_object_id ) ] ) ) {
982
- $_menu_item_object_id = $this->processed_posts[ intval( $_menu_item_object_id ) ];
983
- } elseif ( 'custom' !== $post_meta_key_value['_menu_item_type'] ) {
984
- // Associated object is missing or not imported yet, we'll retry later.
985
- $this->missing_menu_items[] = $item;
986
-
987
- return;
988
- }
989
-
990
- $_menu_item_menu_item_parent = $post_meta_key_value['_menu_item_menu_item_parent']; // Duke - fix "_menu_item_menu_item_parent" dash was added
991
- if ( isset( $this->processed_menu_items[ intval( $_menu_item_menu_item_parent ) ] ) ) {
992
- $_menu_item_menu_item_parent = $this->processed_menu_items[ intval( $_menu_item_menu_item_parent ) ];
993
- } elseif ( $_menu_item_menu_item_parent ) {
994
- $this->menu_item_orphans[ intval( $item['post_id'] ) ] = (int) $_menu_item_menu_item_parent;
995
- $_menu_item_menu_item_parent = 0;
996
- }
997
-
998
- // wp_update_nav_menu_item expects CSS classes as a space separated string
999
- $_menu_item_classes = maybe_unserialize( $post_meta_key_value['_menu_item_classes'] );
1000
- if ( is_array( $_menu_item_classes ) ) {
1001
- $_menu_item_classes = implode( ' ', $_menu_item_classes );
1002
- }
1003
-
1004
- $args = [
1005
- 'menu-item-object-id' => $_menu_item_object_id,
1006
- 'menu-item-object' => $post_meta_key_value['_menu_item_object'],
1007
- 'menu-item-parent-id' => $_menu_item_menu_item_parent,
1008
- 'menu-item-position' => intval( $item['menu_order'] ),
1009
- 'menu-item-type' => $post_meta_key_value['_menu_item_type'],
1010
- 'menu-item-title' => $item['post_title'],
1011
- 'menu-item-url' => $post_meta_key_value['_menu_item_url'],
1012
- 'menu-item-description' => $item['post_content'],
1013
- 'menu-item-attr-title' => $item['post_excerpt'],
1014
- 'menu-item-target' => $post_meta_key_value['_menu_item_target'],
1015
- 'menu-item-classes' => $_menu_item_classes,
1016
- 'menu-item-xfn' => $post_meta_key_value['_menu_item_xfn'],
1017
- 'menu-item-status' => $item['status'],
1018
- ];
1019
-
1020
- $id = wp_update_nav_menu_item( $menu_id, 0, $args );
1021
- if ( $id && ! is_wp_error( $id ) ) {
1022
- // Duke - Import Menu Items Post Meta
1023
- $menu_item_db_id = $id;
1024
- $backup_menu_item_meta['postmeta'] = apply_filters('wordpress_importer_menu_items_meta_import', $backup_menu_item_meta['postmeta'], $id);
1025
- $skip_meta_items = [
1026
- '_menu_item_type',
1027
- '_menu_item_menu_item_parent',
1028
- '_menu_item_object_id',
1029
- '_menu_item_object',
1030
- '_menu_item_target',
1031
- '_menu_item_classes',
1032
- '_menu_item_xfn',
1033
- '_menu_item_url'
1034
- ];
1035
- if ( is_array($backup_menu_item_meta['postmeta']) && !empty($backup_menu_item_meta['postmeta']) ) {
1036
- foreach ( $backup_menu_item_meta['postmeta'] as $meta ) {
1037
- if ( !in_array($meta['key'], $skip_meta_items) ) {
1038
- update_post_meta( $menu_item_db_id, $meta['key'], maybe_unserialize($meta['value']));
1039
- }
1040
- }
1041
- }
1042
- // End.
1043
-
1044
- $this->processed_menu_items[ intval( $item['post_id'] ) ] = (int) $id;
1045
- }
1046
- }
1047
-
1048
- /**
1049
- * If fetching attachments is enabled then attempt to create a new attachment
1050
- *
1051
- * @param array $post Attachment post details from WXR
1052
- * @param string $url URL to fetch attachment from
1053
- *
1054
- * @return int|WP_Error Post ID on success, WP_Error otherwise
1055
- */
1056
- private function process_attachment( $post, $url ) {
1057
-
1058
- if ( ! $this->fetch_attachments ) {
1059
- return new WP_Error( 'attachment_processing_error', esc_html__( 'Fetching attachments is not enabled', 'wpr-addons' ) );
1060
- }
1061
-
1062
- // if the URL is absolute, but does not contain address, then upload it assuming base_site_url.
1063
- if ( preg_match( '|^/[\w\W]+$|', $url ) ) {
1064
- $url = rtrim( $this->base_url, '/' ) . $url;
1065
- }
1066
-
1067
- $upload = $this->fetch_remote_file( $url, $post );
1068
- if ( is_wp_error( $upload ) ) {
1069
- return $upload;
1070
- }
1071
-
1072
- $info = wp_check_filetype( $upload['file'] );
1073
- if ( $info ) {
1074
- $post['post_mime_type'] = $info['type'];
1075
- } else {
1076
- return new WP_Error( 'attachment_processing_error', esc_html__( 'Invalid file type', 'wpr-addons' ) );
1077
- }
1078
-
1079
- $post['guid'] = $upload['url'];
1080
-
1081
- // As per wp-admin/includes/upload.php.
1082
- $post_id = wp_insert_attachment( $post, $upload['file'] );
1083
- wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
1084
- add_post_meta( $post_id, '_wpr_demo_import_item', true );
1085
-
1086
- // Remap resized image URLs, works by stripping the extension and remapping the URL stub.
1087
- if ( preg_match( '!^image/!', $info['type'] ) ) {
1088
- $parts = pathinfo( $url );
1089
- $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
1090
-
1091
- $parts_new = pathinfo( $upload['url'] );
1092
- $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
1093
-
1094
- $this->url_remap[ $parts['dirname'] . '/' . $name ] = $parts_new['dirname'] . '/' . $name_new;
1095
- }
1096
-
1097
- return $post_id;
1098
- }
1099
-
1100
- /**
1101
- * Attempt to download a remote file attachment
1102
- *
1103
- * @param string $url URL of item to fetch
1104
- * @param array $post Attachment details
1105
- *
1106
- * @return array|WP_Error Local file location details on success, WP_Error otherwise
1107
- */
1108
- private function fetch_remote_file( $url, $post ) {
1109
- // Extract the file name from the URL.
1110
- $file_name = basename( parse_url( $url, PHP_URL_PATH ) );
1111
-
1112
- if ( ! $file_name ) {
1113
- $file_name = md5( $url );
1114
- }
1115
-
1116
- $tmp_file_name = wp_tempnam( $file_name );
1117
- if ( ! $tmp_file_name ) {
1118
- return new WP_Error( 'import_no_file', esc_html__( 'Could not create temporary file.', 'wpr-addons' ) );
1119
- }
1120
-
1121
- // Fetch the remote URL and write it to the placeholder file.
1122
- $remote_response = wp_safe_remote_get( $url, [
1123
- 'timeout' => 300,
1124
- 'stream' => true,
1125
- 'filename' => $tmp_file_name,
1126
- 'headers' => [
1127
- 'Accept-Encoding' => 'identity',
1128
- ],
1129
- ] );
1130
-
1131
- if ( is_wp_error( $remote_response ) ) {
1132
- @unlink( $tmp_file_name );
1133
-
1134
- return new WP_Error( 'import_file_error', sprintf( /* translators: 1: WordPress error message, 2: WordPress error code. */ esc_html__( 'Request failed due to an error: %1$s (%2$s)', 'wpr-addons' ), esc_html( $remote_response->get_error_message() ), esc_html( $remote_response->get_error_code() ) ) );
1135
- }
1136
-
1137
- $remote_response_code = (int) wp_remote_retrieve_response_code( $remote_response );
1138
-
1139
- // Make sure the fetch was successful.
1140
- if ( 200 !== $remote_response_code ) {
1141
- @unlink( $tmp_file_name );
1142
-
1143
- return new WP_Error( 'import_file_error', sprintf( /* translators: 1: HTTP error message, 2: HTTP error code. */ esc_html__( 'Remote server returned the following unexpected result: %1$s (%2$s)', 'wpr-addons' ), get_status_header_desc( $remote_response_code ), esc_html( $remote_response_code ) ) );
1144
- }
1145
-
1146
- $headers = wp_remote_retrieve_headers( $remote_response );
1147
-
1148
- // Request failed.
1149
- if ( ! $headers ) {
1150
- @unlink( $tmp_file_name );
1151
-
1152
- return new WP_Error( 'import_file_error', esc_html__( 'Remote server did not respond', 'wpr-addons' ) );
1153
- }
1154
-
1155
- $filesize = (int) filesize( $tmp_file_name );
1156
-
1157
- if ( 0 === $filesize ) {
1158
- @unlink( $tmp_file_name );
1159
-
1160
- return new WP_Error( 'import_file_error', esc_html__( 'Zero size file downloaded', 'wpr-addons' ) );
1161
- }
1162
-
1163
- if ( ! isset( $headers['content-encoding'] ) && isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
1164
- @unlink( $tmp_file_name );
1165
-
1166
- return new WP_Error( 'import_file_error', esc_html__( 'Downloaded file has incorrect size', 'wpr-addons' ) );
1167
- }
1168
-
1169
- $max_size = (int) apply_filters( 'import_attachment_size_limit', self::DEFAULT_IMPORT_ATTACHMENT_SIZE_LIMIT );
1170
- if ( ! empty( $max_size ) && $filesize > $max_size ) {
1171
- @unlink( $tmp_file_name );
1172
-
1173
- /* translators: %s: Max file size. */
1174
- return new WP_Error( 'import_file_error', sprintf( esc_html__( 'Remote file is too large, limit is %s', 'wpr-addons' ), size_format( $max_size ) ) );
1175
- }
1176
-
1177
- // Override file name with Content-Disposition header value.
1178
- if ( ! empty( $headers['content-disposition'] ) ) {
1179
- $file_name_from_disposition = self::get_filename_from_disposition( (array) $headers['content-disposition'] );
1180
- if ( $file_name_from_disposition ) {
1181
- $file_name = $file_name_from_disposition;
1182
- }
1183
- }
1184
-
1185
- // Set file extension if missing.
1186
- $file_ext = pathinfo( $file_name, PATHINFO_EXTENSION );
1187
- if ( ! $file_ext && ! empty( $headers['content-type'] ) ) {
1188
- $extension = self::get_file_extension_by_mime_type( $headers['content-type'] );
1189
- if ( $extension ) {
1190
- $file_name = "{$file_name}.{$extension}";
1191
- }
1192
- }
1193
-
1194
- // Handle the upload like _wp_handle_upload() does.
1195
- $wp_filetype = wp_check_filetype_and_ext( $tmp_file_name, $file_name );
1196
- $ext = empty( $wp_filetype['ext'] ) ? '' : $wp_filetype['ext'];
1197
- $type = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type'];
1198
- $proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename'];
1199
-
1200
- // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect.
1201
- if ( $proper_filename ) {
1202
- $file_name = $proper_filename;
1203
- }
1204
-
1205
- if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {
1206
- return new WP_Error( 'import_file_error', esc_html__( 'Sorry, this file type is not permitted for security reasons.', 'wpr-addons' ) );
1207
- }
1208
-
1209
- $uploads = wp_upload_dir( $post['upload_date'] );
1210
- if ( ! ( $uploads && false === $uploads['error'] ) ) {
1211
- return new WP_Error( 'upload_dir_error', $uploads['error'] );
1212
- }
1213
-
1214
- // Move the file to the uploads dir.
1215
- $file_name = wp_unique_filename( $uploads['path'], $file_name );
1216
- $new_file = $uploads['path'] . "/$file_name";
1217
- $move_new_file = copy( $tmp_file_name, $new_file );
1218
-
1219
- if ( ! $move_new_file ) {
1220
- @unlink( $tmp_file_name );
1221
-
1222
- return new WP_Error( 'import_file_error', esc_html__( 'The uploaded file could not be moved', 'wpr-addons' ) );
1223
- }
1224
-
1225
- // Set correct file permissions.
1226
- $stat = stat( dirname( $new_file ) );
1227
- $perms = $stat['mode'] & 0000666;
1228
- chmod( $new_file, $perms );
1229
-
1230
- $upload = [
1231
- 'file' => $new_file,
1232
- 'url' => $uploads['url'] . "/$file_name",
1233
- 'type' => $wp_filetype['type'],
1234
- 'error' => false,
1235
- ];
1236
-
1237
- // Keep track of the old and new urls so we can substitute them later.
1238
- $this->url_remap[ $url ] = $upload['url'];
1239
- $this->url_remap[ $post['guid'] ] = $upload['url']; // r13735, really needed?
1240
- // Keep track of the destination if the remote url is redirected somewhere else.
1241
- if ( isset( $headers['x-final-location'] ) && $headers['x-final-location'] !== $url ) {
1242
- $this->url_remap[ $headers['x-final-location'] ] = $upload['url'];
1243
- }
1244
-
1245
- return $upload;
1246
- }
1247
-
1248
- /**
1249
- * Attempt to associate posts and menu items with previously missing parents
1250
- *
1251
- * An imported post's parent may not have been imported when it was first created
1252
- * so try again. Similarly for child menu items and menu items which were missing
1253
- * the object (e.g. post) they represent in the menu
1254
- */
1255
- private function backfill_parents() {
1256
- global $wpdb;
1257
-
1258
- // Find parents for post orphans.
1259
- foreach ( $this->post_orphans as $child_id => $parent_id ) {
1260
- $local_child_id = false;
1261
- $local_parent_id = false;
1262
-
1263
- if ( isset( $this->processed_posts[ $child_id ] ) ) {
1264
- $local_child_id = $this->processed_posts[ $child_id ];
1265
- }
1266
- if ( isset( $this->processed_posts[ $parent_id ] ) ) {
1267
- $local_parent_id = $this->processed_posts[ $parent_id ];
1268
- }
1269
-
1270
- if ( $local_child_id && $local_parent_id ) {
1271
- $wpdb->update( $wpdb->posts, [ 'post_parent' => $local_parent_id ], [ 'ID' => $local_child_id ], '%d', '%d' );
1272
- clean_post_cache( $local_child_id );
1273
- }
1274
- }
1275
-
1276
- // All other posts/terms are imported, retry menu items with missing associated object.
1277
- $missing_menu_items = $this->missing_menu_items;
1278
- foreach ( $missing_menu_items as $item ) {
1279
- $this->process_menu_item( $item );
1280
- }
1281
-
1282
- // Find parents for menu item orphans.
1283
- foreach ( $this->menu_item_orphans as $child_id => $parent_id ) {
1284
- $local_child_id = 0;
1285
- $local_parent_id = 0;
1286
- if ( isset( $this->processed_menu_items[ $child_id ] ) ) {
1287
- $local_child_id = $this->processed_menu_items[ $child_id ];
1288
- }
1289
- if ( isset( $this->processed_menu_items[ $parent_id ] ) ) {
1290
- $local_parent_id = $this->processed_menu_items[ $parent_id ];
1291
- }
1292
-
1293
- if ( $local_child_id && $local_parent_id ) {
1294
- update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );
1295
- }
1296
- }
1297
- }
1298
-
1299
- /**
1300
- * Use stored mapping information to update old attachment URLs
1301
- */
1302
- private function backfill_attachment_urls() {
1303
- global $wpdb;
1304
- // Make sure we do the longest urls first, in case one is a substring of another.
1305
- uksort( $this->url_remap, function ( $a, $b ) {
1306
- // Return the difference in length between two strings.
1307
- return strlen( $b ) - strlen( $a );
1308
- } );
1309
-
1310
- foreach ( $this->url_remap as $from_url => $to_url ) {
1311
- // Remap urls in post_content.
1312
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ) );
1313
- // Remap enclosure urls.
1314
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ) );
1315
- }
1316
- }
1317
-
1318
- /**
1319
- * Update _thumbnail_id meta to new, imported attachment IDs
1320
- */
1321
- private function remap_featured_images() {
1322
- // Cycle through posts that have a featured image.
1323
- foreach ( $this->featured_images as $post_id => $value ) {
1324
- if ( isset( $this->processed_posts[ $value ] ) ) {
1325
- $new_id = $this->processed_posts[ $value ];
1326
- // Only update if there's a difference.
1327
- if ( $new_id !== $value ) {
1328
- update_post_meta( $post_id, '_thumbnail_id', $new_id );
1329
- }
1330
- }
1331
- }
1332
- }
1333
-
1334
- /**
1335
- * Parse a WXR file
1336
- *
1337
- * @param string $file Path to WXR file for parsing
1338
- *
1339
- * @return array Information gathered from the WXR file
1340
- */
1341
- private function parse( $file ) {
1342
- $parser = new WXR_Parser();
1343
-
1344
- return $parser->parse( $file );
1345
- }
1346
-
1347
- /**
1348
- * Decide if the given meta key maps to information we will want to import
1349
- *
1350
- * @param string $key The meta key to check
1351
- *
1352
- * @return string|bool The key if we do want to import, false if not
1353
- */
1354
- private function is_valid_meta_key( $key ) {
1355
- // Skip attachment metadata since we'll regenerate it from scratch.
1356
- // Skip _edit_lock as not relevant for import
1357
- if ( in_array( $key, [ '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ] ) ) {
1358
- return false;
1359
- }
1360
-
1361
- return $key;
1362
- }
1363
-
1364
- public function run() {
1365
- $this->import( $this->requested_file_path );
1366
-
1367
- return $this->output;
1368
- }
1369
-
1370
- public function __construct( $file, $args = [] ) {
1371
- $this->requested_file_path = $file;
1372
- $this->args = $args;
1373
-
1374
- if ( ! empty( $this->args['fetch_attachments'] ) ) {
1375
- $this->fetch_attachments = true;
1376
- }
1377
- }
1378
- }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
+ }
6
+
7
+ if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
8
+ return;
9
+
10
+ /** Display verbose errors */
11
+ define( 'IMPORT_DEBUG', false );
12
+
13
+ // Load Importer API
14
+ require_once ABSPATH . 'wp-admin/includes/import.php';
15
+
16
+ if ( ! class_exists( 'WP_Importer' ) ) {
17
+ $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
18
+ if ( file_exists( $class_wp_importer ) )
19
+ require $class_wp_importer;
20
+ }
21
+
22
+ // include WXR file parsers
23
+ require WPR_ADDONS_PATH .'admin/import/class-parsers.php';
24
+
25
+ class WP_Import extends WP_Importer {
26
+ const DEFAULT_BUMP_REQUEST_TIMEOUT = 60;
27
+ const DEFAULT_ALLOW_CREATE_USERS = true;
28
+ const DEFAULT_IMPORT_ATTACHMENT_SIZE_LIMIT = 0; // 0 = unlimited.
29
+
30
+ /**
31
+ * @var string
32
+ */
33
+ private $requested_file_path;
34
+
35
+ /**
36
+ * @var array
37
+ */
38
+ private $args;
39
+
40
+ /**
41
+ * @var array
42
+ */
43
+ private $output = [
44
+ 'status' => 'failed',
45
+ 'errors' => [],
46
+ ];
47
+
48
+ /*
49
+ * WXR attachment ID
50
+ */
51
+ private $id;
52
+
53
+ // Information to import from WXR file.
54
+ private $version;
55
+ private $authors = [];
56
+ private $posts = [];
57
+ private $terms = [];
58
+ private $categories = [];
59
+ private $tags = [];
60
+ private $base_url = '';
61
+ private $page_on_front;
62
+
63
+ // Mappings from old information to new.
64
+ private $processed_authors = [];
65
+ private $author_mapping = [];
66
+ private $processed_terms = [];
67
+ private $processed_posts = [];
68
+ private $post_orphans = [];
69
+ private $processed_menu_items = [];
70
+ private $menu_item_orphans = [];
71
+ private $missing_menu_items = [];
72
+
73
+ private $fetch_attachments = false;
74
+ private $url_remap = [];
75
+ private $featured_images = [];
76
+
77
+ /**
78
+ * Parses filename from a Content-Disposition header value.
79
+ *
80
+ * As per RFC6266:
81
+ *
82
+ * content-disposition = "Content-Disposition" ":"
83
+ * disposition-type *( ";" disposition-parm )
84
+ *
85
+ * disposition-type = "inline" | "attachment" | disp-ext-type
86
+ * ; case-insensitive
87
+ * disp-ext-type = token
88
+ *
89
+ * disposition-parm = filename-parm | disp-ext-parm
90
+ *
91
+ * filename-parm = "filename" "=" value
92
+ * | "filename*" "=" ext-value
93
+ *
94
+ * disp-ext-parm = token "=" value
95
+ * | ext-token "=" ext-value
96
+ * ext-token = <the characters in token, followed by "*">
97
+ *
98
+ * @param string[] $disposition_header List of Content-Disposition header values.
99
+ *
100
+ * @return string|null Filename if available, or null if not found.
101
+ * @link http://tools.ietf.org/html/rfc2388
102
+ * @link http://tools.ietf.org/html/rfc6266
103
+ *
104
+ * @see WP_REST_Attachments_Controller::get_filename_from_disposition()
105
+ *
106
+ */
107
+ protected static function get_filename_from_disposition( $disposition_header ) {
108
+ // Get the filename.
109
+ $filename = null;
110
+
111
+ foreach ( $disposition_header as $value ) {
112
+ $value = trim( $value );
113
+
114
+ if ( strpos( $value, ';' ) === false ) {
115
+ continue;
116
+ }
117
+
118
+ list( $type, $attr_parts ) = explode( ';', $value, 2 );
119
+
120
+ $attr_parts = explode( ';', $attr_parts );
121
+ $attributes = [];
122
+
123
+ foreach ( $attr_parts as $part ) {
124
+ if ( strpos( $part, '=' ) === false ) {
125
+ continue;
126
+ }
127
+
128
+ list( $key, $value ) = explode( '=', $part, 2 );
129
+
130
+ $attributes[ trim( $key ) ] = trim( $value );
131
+ }
132
+
133
+ if ( empty( $attributes['filename'] ) ) {
134
+ continue;
135
+ }
136
+
137
+ $filename = trim( $attributes['filename'] );
138
+
139
+ // Unquote quoted filename, but after trimming.
140
+ if ( substr( $filename, 0, 1 ) === '"' && substr( $filename, -1, 1 ) === '"' ) {
141
+ $filename = substr( $filename, 1, -1 );
142
+ }
143
+ }
144
+
145
+ return $filename;
146
+ }
147
+
148
+ /**
149
+ * Retrieves file extension by mime type.
150
+ *
151
+ * @param string $mime_type Mime type to search extension for.
152
+ *
153
+ * @return string|null File extension if available, or null if not found.
154
+ */
155
+ protected static function get_file_extension_by_mime_type( $mime_type ) {
156
+ static $map = null;
157
+
158
+ if ( is_array( $map ) ) {
159
+ return isset( $map[ $mime_type ] ) ? $map[ $mime_type ] : null;
160
+ }
161
+
162
+ $mime_types = wp_get_mime_types();
163
+ $map = array_flip( $mime_types );
164
+
165
+ // Some types have multiple extensions, use only the first one.
166
+ foreach ( $map as $type => $extensions ) {
167
+ $map[ $type ] = strtok( $extensions, '|' );
168
+ }
169
+
170
+ return isset( $map[ $mime_type ] ) ? $map[ $mime_type ] : null;
171
+ }
172
+
173
+ /**
174
+ * The main controller for the actual import stage.
175
+ *
176
+ * @param string $file Path to the WXR file for importing
177
+ */
178
+ private function import( $file ) {
179
+ add_filter( 'import_post_meta_key', function ( $key ) {
180
+ return $this->is_valid_meta_key( $key );
181
+ } );
182
+ add_filter( 'http_request_timeout', function () {
183
+ return self::DEFAULT_BUMP_REQUEST_TIMEOUT;
184
+ } );
185
+
186
+ if ( ! $this->import_start( $file ) ) {
187
+ return;
188
+ }
189
+
190
+ $this->set_author_mapping();
191
+
192
+ wp_suspend_cache_invalidation( true );
193
+ $imported_summary = [
194
+ 'categories' => $this->process_categories(),
195
+ 'tags' => $this->process_tags(),
196
+ 'terms' => $this->process_terms(),
197
+ 'posts' => $this->process_posts(),
198
+ ];
199
+ wp_suspend_cache_invalidation( false );
200
+
201
+ // Update incorrect/missing information in the DB.
202
+ $this->backfill_parents();
203
+ $this->backfill_attachment_urls();
204
+ $this->remap_featured_images();
205
+
206
+ $this->import_end();
207
+
208
+ $is_some_succeed = false;
209
+ foreach ( $imported_summary as $item ) {
210
+ if ( $item > 0 ) {
211
+ $is_some_succeed = true;
212
+ break;
213
+ }
214
+ }
215
+
216
+ if ( $is_some_succeed ) {
217
+ $this->output['status'] = 'success';
218
+ $this->output['summary'] = $imported_summary;
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Parses the WXR file and prepares us for the task of processing parsed data.
224
+ *
225
+ * @param string $file Path to the WXR file for importing
226
+ */
227
+ private function import_start( $file ) {
228
+ if ( ! is_file( $file ) ) {
229
+ $this->output['errors'] = [ esc_html__( 'The file does not exist, please try again.', 'wpr-addons' ) ];
230
+
231
+ return false;
232
+ }
233
+
234
+ $import_data = $this->parse( $file );
235
+
236
+ if ( is_wp_error( $import_data ) ) {
237
+ $this->output['errors'] = [ $import_data->get_error_message() ];
238
+
239
+ return false;
240
+ }
241
+
242
+ $this->version = $import_data['version'];
243
+ $this->set_authors_from_import( $import_data );
244
+ $this->posts = $import_data['posts'];
245
+ $this->terms = $import_data['terms'];
246
+ $this->categories = $import_data['categories'];
247
+ $this->tags = $import_data['tags'];
248
+ $this->base_url = esc_url( $import_data['base_url'] );
249
+ $this->page_on_front = $import_data['page_on_front'];
250
+
251
+ wp_defer_term_counting( true );
252
+ wp_defer_comment_counting( true );
253
+
254
+ do_action( 'import_start' );
255
+
256
+ return true;
257
+ }
258
+
259
+ /**
260
+ * Performs post-import cleanup of files and the cache
261
+ */
262
+ private function import_end() {
263
+ wp_import_cleanup( $this->id );
264
+
265
+ wp_cache_flush();
266
+
267
+ foreach ( get_taxonomies() as $tax ) {
268
+ delete_option( "{$tax}_children" );
269
+ _get_term_hierarchy( $tax );
270
+ }
271
+
272
+ wp_defer_term_counting( false );
273
+ wp_defer_comment_counting( false );
274
+
275
+ do_action( 'import_end' );
276
+ }
277
+
278
+ /**
279
+ * Retrieve authors from parsed WXR data and set it to `$this->>authors`.
280
+ *
281
+ * Uses the provided author information from WXR 1.1 files
282
+ * or extracts info from each post for WXR 1.0 files
283
+ *
284
+ * @param array $import_data Data returned by a WXR parser
285
+ */
286
+ private function set_authors_from_import( $import_data ) {
287
+ if ( ! empty( $import_data['authors'] ) ) {
288
+ $this->authors = $import_data['authors'];
289
+ // No author information, grab it from the posts.
290
+ } else {
291
+ foreach ( $import_data['posts'] as $post ) {
292
+ $login = sanitize_user( $post['post_author'], true );
293
+
294
+ if ( empty( $login ) ) {
295
+ /* translators: %s: Post author. */
296
+ $this->output['errors'][] = sprintf( esc_html__( 'Failed to import author %s. Their posts will be attributed to the current user.', 'wpr-addons' ), $post['post_author'] );
297
+ continue;
298
+ }
299
+
300
+ if ( ! isset( $this->authors[ $login ] ) ) {
301
+ $this->authors[ $login ] = [
302
+ 'author_login' => $login,
303
+ 'author_display_name' => $post['post_author'],
304
+ ];
305
+ }
306
+ }
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Map old author logins to local user IDs based on decisions made
312
+ * in import options form. Can map to an existing user, create a new user
313
+ * or falls back to the current user in case of error with either of the previous
314
+ */
315
+ private function set_author_mapping() {
316
+ if ( ! isset( $this->args['imported_authors'] ) ) {
317
+ return;
318
+ }
319
+
320
+ $create_users = apply_filters( 'import_allow_create_users', self::DEFAULT_ALLOW_CREATE_USERS );
321
+
322
+ foreach ( (array) $this->args['imported_authors'] as $i => $old_login ) {
323
+ // Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts.
324
+ $santized_old_login = sanitize_user( $old_login, true );
325
+ $old_id = isset( $this->authors[ $old_login ]['author_id'] ) ? intval( $this->authors[ $old_login ]['author_id'] ) : false;
326
+
327
+ if ( ! empty( $this->args['user_map'][ $i ] ) ) {
328
+ $user = get_userdata( intval( $this->args['user_map'][ $i ] ) );
329
+ if ( isset( $user->ID ) ) {
330
+ if ( $old_id ) {
331
+ $this->processed_authors[ $old_id ] = $user->ID;
332
+ }
333
+ $this->author_mapping[ $santized_old_login ] = $user->ID;
334
+ }
335
+ } elseif ( $create_users ) {
336
+ $user_id = 0;
337
+ if ( ! empty( $this->args['user_new'][ $i ] ) ) {
338
+ $user_id = wp_create_user( $this->args['user_new'][ $i ], wp_generate_password() );
339
+ } elseif ( '1.0' !== $this->version ) {
340
+ $user_data = [
341
+ 'user_login' => $old_login,
342
+ 'user_pass' => wp_generate_password(),
343
+ 'user_email' => isset( $this->authors[ $old_login ]['author_email'] ) ? $this->authors[ $old_login ]['author_email'] : '',
344
+ 'display_name' => $this->authors[ $old_login ]['author_display_name'],
345
+ 'first_name' => isset( $this->authors[ $old_login ]['author_first_name'] ) ? $this->authors[ $old_login ]['author_first_name'] : '',
346
+ 'last_name' => isset( $this->authors[ $old_login ]['author_last_name'] ) ? $this->authors[ $old_login ]['author_last_name'] : '',
347
+ ];
348
+ $user_id = wp_insert_user( $user_data );
349
+ }
350
+
351
+ if ( ! is_wp_error( $user_id ) ) {
352
+ if ( $old_id ) {
353
+ $this->processed_authors[ $old_id ] = $user_id;
354
+ }
355
+ $this->author_mapping[ $santized_old_login ] = $user_id;
356
+ } else {
357
+ /* translators: %s: Author display name. */
358
+ $error = sprintf( esc_html__( 'Failed to create new user for %s. Their posts will be attributed to the current user.', 'wpr-addons' ), $this->authors[ $old_login ]['author_display_name'] );
359
+
360
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
361
+ $error .= PHP_EOL . $user_id->get_error_message();
362
+ }
363
+
364
+ $this->output['errors'][] = $error;
365
+ }
366
+ }
367
+
368
+ // Failsafe: if the user_id was invalid, default to the current user.
369
+ if ( ! isset( $this->author_mapping[ $santized_old_login ] ) ) {
370
+ if ( $old_id ) {
371
+ $this->processed_authors[ $old_id ] = (int) get_current_user_id();
372
+ }
373
+ $this->author_mapping[ $santized_old_login ] = (int) get_current_user_id();
374
+ }
375
+ }
376
+ }
377
+
378
+ /**
379
+ * Create new categories based on import information
380
+ *
381
+ * Doesn't create a new category if its slug already exists
382
+ *
383
+ * @return int number of imported categories.
384
+ */
385
+ private function process_categories() {
386
+ $result = 0;
387
+
388
+ $this->categories = apply_filters( 'wp_import_categories', $this->categories );
389
+
390
+ if ( empty( $this->categories ) ) {
391
+ return $result;
392
+ }
393
+
394
+ foreach ( $this->categories as $cat ) {
395
+ // if the category already exists leave it alone
396
+ $term_id = term_exists( $cat['category_nicename'], 'category' );
397
+ if ( $term_id ) {
398
+ if ( is_array( $term_id ) ) {
399
+ $term_id = $term_id['term_id'];
400
+ }
401
+ if ( isset( $cat['term_id'] ) ) {
402
+ $this->processed_terms[ intval( $cat['term_id'] ) ] = (int) $term_id;
403
+ }
404
+ continue;
405
+ }
406
+
407
+ $parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );
408
+ $description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';
409
+
410
+ $data = [
411
+ 'category_nicename' => $cat['category_nicename'],
412
+ 'category_parent' => $parent,
413
+ 'cat_name' => wp_slash( $cat['cat_name'] ),
414
+ 'category_description' => wp_slash( $description ),
415
+ ];
416
+
417
+ $id = wp_insert_category( $data );
418
+ if ( ! is_wp_error( $id ) && $id > 0 ) {
419
+ if ( isset( $cat['term_id'] ) ) {
420
+ $this->processed_terms[ intval( $cat['term_id'] ) ] = $id;
421
+ }
422
+ $result++;
423
+ } else {
424
+ /* translators: %s: Category name. */
425
+ $error = sprintf( esc_html__( 'Failed to import category %s', 'wpr-addons' ), $cat['category_nicename'] );
426
+
427
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
428
+ $error .= PHP_EOL . $id->get_error_message();
429
+ }
430
+
431
+ $this->output['errors'][] = $error;
432
+ continue;
433
+ }
434
+
435
+ $this->process_termmeta( $cat, $id );
436
+ add_term_meta( $id, '_wpr_demo_import_item', true );
437
+ }
438
+
439
+ unset( $this->categories );
440
+
441
+ return $result;
442
+ }
443
+
444
+ /**
445
+ * Create new post tags based on import information
446
+ *
447
+ * Doesn't create a tag if its slug already exists
448
+ *
449
+ * @return int number of imported tags.
450
+ */
451
+ private function process_tags() {
452
+ $result = 0;
453
+
454
+ $this->tags = apply_filters( 'wp_import_tags', $this->tags );
455
+
456
+ if ( empty( $this->tags ) ) {
457
+ return $result;
458
+ }
459
+
460
+ foreach ( $this->tags as $tag ) {
461
+ // if the tag already exists leave it alone
462
+ $term_id = term_exists( $tag['tag_slug'], 'post_tag' );
463
+ if ( $term_id ) {
464
+ if ( is_array( $term_id ) ) {
465
+ $term_id = $term_id['term_id'];
466
+ }
467
+ if ( isset( $tag['term_id'] ) ) {
468
+ $this->processed_terms[ intval( $tag['term_id'] ) ] = (int) $term_id;
469
+ }
470
+ continue;
471
+ }
472
+
473
+ $description = isset( $tag['tag_description'] ) ? $tag['tag_description'] : '';
474
+ $args = [
475
+ 'slug' => $tag['tag_slug'],
476
+ 'description' => wp_slash( $description ),
477
+ ];
478
+
479
+ $id = wp_insert_term( wp_slash( $tag['tag_name'] ), 'post_tag', $args );
480
+ if ( ! is_wp_error( $id ) ) {
481
+ if ( isset( $tag['term_id'] ) ) {
482
+ $this->processed_terms[ intval( $tag['term_id'] ) ] = $id['term_id'];
483
+ }
484
+ $result++;
485
+ } else {
486
+ /* translators: %s: Tag name. */
487
+ $error = sprintf( esc_html__( 'Failed to import post tag %s', 'wpr-addons' ), $tag['tag_name'] );
488
+
489
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
490
+ $error .= PHP_EOL . $id->get_error_message();
491
+ }
492
+
493
+ $this->output['errors'][] = $error;
494
+ continue;
495
+ }
496
+
497
+ $this->process_termmeta( $tag, $id['term_id'] );
498
+ add_term_meta( $id['term_id'], '_wpr_demo_import_item', true );
499
+ }
500
+
501
+ unset( $this->tags );
502
+
503
+ return $result;
504
+ }
505
+
506
+ /**
507
+ * Create new terms based on import information
508
+ *
509
+ * Doesn't create a term its slug already exists
510
+ *
511
+ * @return int number of imported terms.
512
+ */
513
+ private function process_terms() {
514
+ $result = 0;
515
+
516
+ $this->terms = apply_filters( 'wp_import_terms', $this->terms );
517
+
518
+ if ( empty( $this->terms ) ) {
519
+ return $result;
520
+ }
521
+
522
+ foreach ( $this->terms as $term ) {
523
+ // if the term already exists in the correct taxonomy leave it alone
524
+ $term_id = term_exists( $term['slug'], $term['term_taxonomy'] );
525
+ if ( $term_id ) {
526
+ if ( is_array( $term_id ) ) {
527
+ $term_id = $term_id['term_id'];
528
+ }
529
+ if ( isset( $term['term_id'] ) ) {
530
+ $this->processed_terms[ intval( $term['term_id'] ) ] = (int) $term_id;
531
+ }
532
+ continue;
533
+ }
534
+
535
+ if ( empty( $term['term_parent'] ) ) {
536
+ $parent = 0;
537
+ } else {
538
+ $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );
539
+ if ( is_array( $parent ) ) {
540
+ $parent = $parent['term_id'];
541
+ }
542
+ }
543
+
544
+ $description = isset( $term['term_description'] ) ? $term['term_description'] : '';
545
+ $args = [
546
+ 'slug' => $term['slug'],
547
+ 'description' => wp_slash( $description ),
548
+ 'parent' => (int) $parent,
549
+ ];
550
+
551
+ $id = wp_insert_term( wp_slash( $term['term_name'] ), $term['term_taxonomy'], $args );
552
+ if ( ! is_wp_error( $id ) ) {
553
+ if ( isset( $term['term_id'] ) ) {
554
+ $this->processed_terms[ intval( $term['term_id'] ) ] = $id['term_id'];
555
+ }
556
+ $result++;
557
+ } else {
558
+ /* translators: 1: Term taxonomy, 2: Term name. */
559
+ $error = sprintf( esc_html__( 'Failed to import %1$s %2$s', 'wpr-addons' ), $term['term_taxonomy'], $term['term_name'] );
560
+
561
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
562
+ $error .= PHP_EOL . $id->get_error_message();
563
+ }
564
+
565
+ $this->output['errors'][] = $error;
566
+ continue;
567
+ }
568
+
569
+ $this->process_termmeta( $term, $id['term_id'] );
570
+ add_term_meta( $id['term_id'], '_wpr_demo_import_item', true );
571
+ }
572
+
573
+ unset( $this->terms );
574
+
575
+ return $result;
576
+ }
577
+
578
+ /**
579
+ * Add metadata to imported term.
580
+ *
581
+ * @param array $term Term data from WXR import.
582
+ * @param int $term_id ID of the newly created term.
583
+ */
584
+ private function process_termmeta( $term, $term_id ) {
585
+ if ( ! function_exists( 'add_term_meta' ) ) {
586
+ return;
587
+ }
588
+
589
+ if ( ! isset( $term['termmeta'] ) ) {
590
+ $term['termmeta'] = [];
591
+ }
592
+
593
+ /**
594
+ * Filters the metadata attached to an imported term.
595
+ *
596
+ * @param array $termmeta Array of term meta.
597
+ * @param int $term_id ID of the newly created term.
598
+ * @param array $term Term data from the WXR import.
599
+ */
600
+ $term['termmeta'] = apply_filters( 'wp_import_term_meta', $term['termmeta'], $term_id, $term );
601
+
602
+ if ( empty( $term['termmeta'] ) ) {
603
+ return;
604
+ }
605
+
606
+ foreach ( $term['termmeta'] as $meta ) {
607
+ /**
608
+ * Filters the meta key for an imported piece of term meta.
609
+ *
610
+ * @param string $meta_key Meta key.
611
+ * @param int $term_id ID of the newly created term.
612
+ * @param array $term Term data from the WXR import.
613
+ */
614
+ $key = apply_filters( 'import_term_meta_key', $meta['key'], $term_id, $term );
615
+ if ( ! $key ) {
616
+ continue;
617
+ }
618
+
619
+ // Export gets meta straight from the DB so could have a serialized string
620
+ $value = maybe_unserialize( $meta['value'] );
621
+
622
+ add_term_meta( $term_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
623
+
624
+ /**
625
+ * Fires after term meta is imported.
626
+ *
627
+ * @param int $term_id ID of the newly created term.
628
+ * @param string $key Meta key.
629
+ * @param mixed $value Meta value.
630
+ */
631
+ do_action( 'import_term_meta', $term_id, $key, $value );
632
+ }
633
+ }
634
+
635
+ /**
636
+ * Create new posts based on import information
637
+ *
638
+ * Posts marked as having a parent which doesn't exist will become top level items.
639
+ * Doesn't create a new post if: the post type doesn't exist, the given post ID
640
+ * is already noted as imported or a post with the same title and date already exists.
641
+ * Note that new/updated terms, comments and meta are imported for the last of the above.
642
+ *
643
+ * @return array the ids of succeed/failed imported posts.
644
+ */
645
+ private function process_posts() {
646
+ $result = [
647
+ 'succeed' => [],
648
+ 'failed' => [],
649
+ ];
650
+
651
+ $this->posts = apply_filters( 'wp_import_posts', $this->posts );
652
+
653
+ foreach ( $this->posts as $post ) {
654
+ $post = apply_filters( 'wp_import_post_data_raw', $post );
655
+
656
+ if ( ! post_type_exists( $post['post_type'] ) ) {
657
+ /* translators: 1: Post title, 2: Post type. */
658
+ $this->output['errors'][] = sprintf( esc_html__( 'Failed to import %1$s: Invalid post type %2$s', 'wpr-addons' ), $post['post_title'], $post['post_type'] );
659
+ do_action( 'wp_import_post_exists', $post );
660
+ continue;
661
+ }
662
+
663
+ if ( isset( $this->processed_posts[ $post['post_id'] ] ) && ! empty( $post['post_id'] ) ) {
664
+ continue;
665
+ }
666
+
667
+ if ( 'auto-draft' === $post['status'] ) {
668
+ continue;
669
+ }
670
+
671
+ if ( 'nav_menu_item' === $post['post_type'] ) {
672
+ $this->process_menu_item( $post );
673
+ continue;
674
+ }
675
+
676
+ $post_type_object = get_post_type_object( $post['post_type'] );
677
+
678
+ $post_parent = (int) $post['post_parent'];
679
+ if ( $post_parent ) {
680
+ // if we already know the parent, map it to the new local ID.
681
+ if ( isset( $this->processed_posts[ $post_parent ] ) ) {
682
+ $post_parent = $this->processed_posts[ $post_parent ];
683
+ // otherwise record the parent for later.
684
+ } else {
685
+ $this->post_orphans[ intval( $post['post_id'] ) ] = $post_parent;
686
+ $post_parent = 0;
687
+ }
688
+ }
689
+
690
+ // Map the post author.
691
+ $author = sanitize_user( $post['post_author'], true );
692
+ if ( isset( $this->author_mapping[ $author ] ) ) {
693
+ $author = $this->author_mapping[ $author ];
694
+ } else {
695
+ $author = (int) get_current_user_id();
696
+ }
697
+
698
+ $postdata = [
699
+ 'import_id' => $post['post_id'],
700
+ 'post_author' => $author,
701
+ 'post_content' => $post['post_content'],
702
+ 'post_excerpt' => $post['post_excerpt'],
703
+ 'post_title' => $post['post_title'],
704
+ 'post_status' => $post['status'],
705
+ 'post_name' => $post['post_name'],
706
+ 'comment_status' => $post['comment_status'],
707
+ 'ping_status' => $post['ping_status'],
708
+ 'guid' => $post['guid'],
709
+ 'post_parent' => $post_parent,
710
+ 'menu_order' => $post['menu_order'],
711
+ 'post_type' => $post['post_type'],
712
+ 'post_password' => $post['post_password'],
713
+ 'post_date' => $post['post_date'],
714
+ ];
715
+
716
+ $original_post_id = $post['post_id'];
717
+ $postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );
718
+
719
+ $postdata = wp_slash( $postdata );
720
+
721
+ if ( 'attachment' === $postdata['post_type'] ) {
722
+ $remote_url = ! empty( $post['attachment_url'] ) ? $post['attachment_url'] : $post['guid'];
723
+
724
+ // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
725
+ // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
726
+ $postdata['upload_date'] = $post['post_date'];
727
+ if ( isset( $post['postmeta'] ) ) {
728
+ foreach ( $post['postmeta'] as $meta ) {
729
+ if ( '_wp_attached_file' === $meta['key'] ) {
730
+ if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) ) {
731
+ $postdata['upload_date'] = $matches[0];
732
+ }
733
+ break;
734
+ }
735
+ }
736
+ }
737
+
738
+ $post_id = $this->process_attachment( $postdata, $remote_url );
739
+ $comment_post_id = $post_id;
740
+ } else {
741
+ $post_id = wp_insert_post( $postdata, true );
742
+ $comment_post_id = $post_id;
743
+ do_action( 'wp_import_insert_post', $post_id, $original_post_id, $postdata, $post );
744
+ }
745
+
746
+ if ( is_wp_error( $post_id ) ) {
747
+ /* translators: 1: Post type singular label, 2: Post title. */
748
+ $error = sprintf( __( 'Failed to import %1$s %2$s', 'wpr-addons' ), $post_type_object->labels->singular_name, $post['post_title'] );
749
+
750
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
751
+ $error .= PHP_EOL . $post_id->get_error_message();
752
+ }
753
+
754
+ $result['failed'][] = $original_post_id;
755
+
756
+ $this->output['errors'][] = $error;
757
+
758
+ continue;
759
+ }
760
+
761
+ $result['succeed'][ $original_post_id ] = $post_id;
762
+
763
+ if ( 1 === $post['is_sticky'] ) {
764
+ stick_post( $post_id );
765
+ }
766
+
767
+ if ( $this->page_on_front === $original_post_id ) {
768
+ update_option( 'page_on_front', $post_id );
769
+ }
770
+
771
+ // Map pre-import ID to local ID.
772
+ $this->processed_posts[ intval( $post['post_id'] ) ] = (int) $post_id;
773
+
774
+ if ( ! isset( $post['terms'] ) ) {
775
+ $post['terms'] = [];
776
+ }
777
+
778
+ $post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );
779
+
780
+ // add categories, tags and other terms
781
+ if ( ! empty( $post['terms'] ) ) {
782
+ $terms_to_set = [];
783
+ foreach ( $post['terms'] as $term ) {
784
+ // back compat with WXR 1.0 map 'tag' to 'post_tag'
785
+ $taxonomy = ( 'tag' === $term['domain'] ) ? 'post_tag' : $term['domain'];
786
+ $term_exists = term_exists( $term['slug'], $taxonomy );
787
+ $term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;
788
+ if ( ! $term_id ) {
789
+ $t = wp_insert_term( $term['name'], $taxonomy, [ 'slug' => $term['slug'] ] );
790
+ if ( ! is_wp_error( $t ) ) {
791
+ $term_id = $t['term_id'];
792
+ do_action( 'wp_import_insert_term', $t, $term, $post_id, $post );
793
+ } else {
794
+ /* translators: 1: Taxonomy name, 2: Term name. */
795
+ $error = sprintf( esc_html__( 'Failed to import %1$s %2$s', 'wpr-addons' ), $taxonomy, $term['name'] );
796
+
797
+ if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
798
+ $error .= PHP_EOL . $t->get_error_message();
799
+ }
800
+
801
+ $this->output['errors'][] = $error;
802
+
803
+ do_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );
804
+ continue;
805
+ }
806
+ }
807
+ $terms_to_set[ $taxonomy ][] = intval( $term_id );
808
+ }
809
+
810
+ foreach ( $terms_to_set as $tax => $ids ) {
811
+ $tt_ids = wp_set_post_terms( $post_id, $ids, $tax );
812
+ do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );
813
+ }
814
+ unset( $post['terms'], $terms_to_set );
815
+ }
816
+
817
+ if ( ! isset( $post['comments'] ) ) {
818
+ $post['comments'] = [];
819
+ }
820
+
821
+ $post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );
822
+
823
+ // Add/update comments.
824
+ if ( ! empty( $post['comments'] ) ) {
825
+ $num_comments = 0;
826
+ $inserted_comments = [];
827
+ foreach ( $post['comments'] as $comment ) {
828
+ $comment_id = $comment['comment_id'];
829
+ $newcomments[ $comment_id ]['comment_post_ID'] = $comment_post_id;
830
+ $newcomments[ $comment_id ]['comment_author'] = $comment['comment_author'];
831
+ $newcomments[ $comment_id ]['comment_author_email'] = $comment['comment_author_email'];
832
+ $newcomments[ $comment_id ]['comment_author_IP'] = $comment['comment_author_IP'];
833
+ $newcomments[ $comment_id ]['comment_author_url'] = $comment['comment_author_url'];
834
+ $newcomments[ $comment_id ]['comment_date'] = $comment['comment_date'];
835
+ $newcomments[ $comment_id ]['comment_date_gmt'] = $comment['comment_date_gmt'];
836
+ $newcomments[ $comment_id ]['comment_content'] = $comment['comment_content'];
837
+ $newcomments[ $comment_id ]['comment_approved'] = $comment['comment_approved'];
838
+ $newcomments[ $comment_id ]['comment_type'] = $comment['comment_type'];
839
+ $newcomments[ $comment_id ]['comment_parent'] = $comment['comment_parent'];
840
+ $newcomments[ $comment_id ]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : [];
841
+ if ( isset( $this->processed_authors[ $comment['comment_user_id'] ] ) ) {
842
+ $newcomments[ $comment_id ]['user_id'] = $this->processed_authors[ $comment['comment_user_id'] ];
843
+ }
844
+ }
845
+
846
+ ksort( $newcomments );
847
+
848
+ foreach ( $newcomments as $key => $comment ) {
849
+ if ( isset( $inserted_comments[ $comment['comment_parent'] ] ) ) {
850
+ $comment['comment_parent'] = $inserted_comments[ $comment['comment_parent'] ];
851
+ }
852
+
853
+ $comment_data = wp_slash( $comment );
854
+ unset( $comment_data['commentmeta'] ); // Handled separately, wp_insert_comment() also expects `comment_meta`.
855
+ $comment_data = wp_filter_comment( $comment_data );
856
+
857
+ $inserted_comments[ $key ] = wp_insert_comment( $comment_data );
858
+
859
+ do_action( 'wp_import_insert_comment', $inserted_comments[ $key ], $comment, $comment_post_id, $post );
860
+
861
+ foreach ( $comment['commentmeta'] as $meta ) {
862
+ $value = maybe_unserialize( $meta['value'] );
863
+
864
+ add_comment_meta( $inserted_comments[ $key ], wp_slash( $meta['key'] ), wp_slash_strings_only( $value ) );
865
+ }
866
+
867
+ $num_comments++;
868
+ }
869
+ unset( $newcomments, $inserted_comments, $post['comments'] );
870
+ }
871
+
872
+ if ( ! isset( $post['postmeta'] ) ) {
873
+ $post['postmeta'] = [];
874
+ }
875
+
876
+ $post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );
877
+
878
+ // Add/update post meta.
879
+ if ( ! empty( $post['postmeta'] ) ) {
880
+ foreach ( $post['postmeta'] as $meta ) {
881
+ $key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );
882
+ $value = false;
883
+
884
+ if ( '_edit_last' === $key ) {
885
+ if ( isset( $this->processed_authors[ intval( $meta['value'] ) ] ) ) {
886
+ $value = $this->processed_authors[ intval( $meta['value'] ) ];
887
+ } else {
888
+ $key = false;
889
+ }
890
+ }
891
+
892
+ if ( $key ) {
893
+ // Export gets meta straight from the DB so could have a serialized string.
894
+ if ( ! $value ) {
895
+ $value = maybe_unserialize( $meta['value'] );
896
+ }
897
+
898
+ add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
899
+
900
+ do_action( 'import_post_meta', $post_id, $key, $value );
901
+
902
+ // If the post has a featured image, take note of this in case of remap.
903
+ if ( '_thumbnail_id' === $key ) {
904
+ $this->featured_images[ $post_id ] = (int) $value;
905
+ }
906
+ }
907
+ }
908
+ }
909
+
910
+ // Mark items as WPR Imported
911
+ add_post_meta( $post_id, '_wpr_demo_import_item', true );
912
+
913
+ }
914
+
915
+ unset( $this->posts );
916
+
917
+ return $result;
918
+ }
919
+
920
+ /**
921
+ * Attempt to create a new menu item from import data
922
+ *
923
+ * Fails for draft, orphaned menu items and those without an associated nav_menu
924
+ * or an invalid nav_menu term. If the post type or term object which the menu item
925
+ * represents doesn't exist then the menu item will not be imported (waits until the
926
+ * end of the import to retry again before discarding).
927
+ *
928
+ * @param array $item Menu item details from WXR file
929
+ */
930
+ private function process_menu_item( $item ) {
931
+ // Skip draft, orphaned menu items.
932
+ if ( 'draft' === $item['status'] ) {
933
+ return;
934
+ }
935
+
936
+ $menu_slug = false;
937
+ if ( isset( $item['terms'] ) ) {
938
+ // Loop through terms, assume first nav_menu term is correct menu.
939
+ foreach ( $item['terms'] as $term ) {
940
+ if ( 'nav_menu' === $term['domain'] ) {
941
+ $menu_slug = $term['slug'];
942
+ break;
943
+ }
944
+ }
945
+ }
946
+
947
+ // No nav_menu term associated with this menu item.
948
+ if ( ! $menu_slug ) {
949
+ $this->output['errors'][] = esc_html__( 'Menu item skipped due to missing menu slug', 'wpr-addons' );
950
+
951
+ return;
952
+ }
953
+
954
+ $menu_id = term_exists( $menu_slug, 'nav_menu' );
955
+ if ( ! $menu_id ) {
956
+ /* translators: %s: Menu slug. */
957
+ $this->output['errors'][] = sprintf( esc_html__( 'Menu item skipped due to invalid menu slug: %s', 'wpr-addons' ), $menu_slug );
958
+
959
+ return;
960
+ } else {
961
+ $menu_id = is_array( $menu_id ) ? $menu_id['term_id'] : $menu_id;
962
+ }
963
+
964
+ $post_meta_key_value = [];
965
+ foreach ( $item['postmeta'] as $meta ) {
966
+ $post_meta_key_value[ $meta['key'] ] = $meta['value'];
967
+ }
968
+
969
+ // Duke - Import Menu Items Post Meta
970
+ $backup_menu_item_meta = [];
971
+ $backup_menu_item_meta['postmeta'] = $item['postmeta'];
972
+
973
+ foreach ( $item['postmeta'] as $meta ) {
974
+ ${$meta['key']} = $meta['value'];
975
+ }
976
+ // End.
977
+
978
+ $_menu_item_object_id = $post_meta_key_value['_menu_item_object_id'];
979
+ if ( 'taxonomy' === $post_meta_key_value['_menu_item_type'] && isset( $this->processed_terms[ intval( $_menu_item_object_id ) ] ) ) {
980
+ $_menu_item_object_id = $this->processed_terms[ intval( $_menu_item_object_id ) ];
981
+ } elseif ( 'post_type' === $post_meta_key_value['_menu_item_type'] && isset( $this->processed_posts[ intval( $_menu_item_object_id ) ] ) ) {
982
+ $_menu_item_object_id = $this->processed_posts[ intval( $_menu_item_object_id ) ];
983
+ } elseif ( 'custom' !== $post_meta_key_value['_menu_item_type'] ) {
984
+ // Associated object is missing or not imported yet, we'll retry later.
985
+ $this->missing_menu_items[] = $item;
986
+
987
+ return;
988
+ }
989
+
990
+ $_menu_item_menu_item_parent = $post_meta_key_value['_menu_item_menu_item_parent']; // Duke - fix "_menu_item_menu_item_parent" dash was added
991
+ if ( isset( $this->processed_menu_items[ intval( $_menu_item_menu_item_parent ) ] ) ) {
992
+ $_menu_item_menu_item_parent = $this->processed_menu_items[ intval( $_menu_item_menu_item_parent ) ];
993
+ } elseif ( $_menu_item_menu_item_parent ) {
994
+ $this->menu_item_orphans[ intval( $item['post_id'] ) ] = (int) $_menu_item_menu_item_parent;
995
+ $_menu_item_menu_item_parent = 0;
996
+ }
997
+
998
+ // wp_update_nav_menu_item expects CSS classes as a space separated string
999
+ $_menu_item_classes = maybe_unserialize( $post_meta_key_value['_menu_item_classes'] );
1000
+ if ( is_array( $_menu_item_classes ) ) {
1001
+ $_menu_item_classes = implode( ' ', $_menu_item_classes );
1002
+ }
1003
+
1004
+ $args = [
1005
+ 'menu-item-object-id' => $_menu_item_object_id,
1006
+ 'menu-item-object' => $post_meta_key_value['_menu_item_object'],
1007
+ 'menu-item-parent-id' => $_menu_item_menu_item_parent,
1008
+ 'menu-item-position' => intval( $item['menu_order'] ),
1009
+ 'menu-item-type' => $post_meta_key_value['_menu_item_type'],
1010
+ 'menu-item-title' => $item['post_title'],
1011
+ 'menu-item-url' => $post_meta_key_value['_menu_item_url'],
1012
+ 'menu-item-description' => $item['post_content'],
1013
+ 'menu-item-attr-title' => $item['post_excerpt'],
1014
+ 'menu-item-target' => $post_meta_key_value['_menu_item_target'],
1015
+ 'menu-item-classes' => $_menu_item_classes,
1016
+ 'menu-item-xfn' => $post_meta_key_value['_menu_item_xfn'],
1017
+ 'menu-item-status' => $item['status'],
1018
+ ];
1019
+
1020
+ $id = wp_update_nav_menu_item( $menu_id, 0, $args );
1021
+ if ( $id && ! is_wp_error( $id ) ) {
1022
+ // Duke - Import Menu Items Post Meta
1023
+ $menu_item_db_id = $id;
1024
+ $backup_menu_item_meta['postmeta'] = apply_filters('wordpress_importer_menu_items_meta_import', $backup_menu_item_meta['postmeta'], $id);
1025
+ $skip_meta_items = [
1026
+ '_menu_item_type',
1027
+ '_menu_item_menu_item_parent',
1028
+ '_menu_item_object_id',
1029
+ '_menu_item_object',
1030
+ '_menu_item_target',
1031
+ '_menu_item_classes',
1032
+ '_menu_item_xfn',
1033
+ '_menu_item_url'
1034
+ ];
1035
+ if ( is_array($backup_menu_item_meta['postmeta']) && !empty($backup_menu_item_meta['postmeta']) ) {
1036
+ foreach ( $backup_menu_item_meta['postmeta'] as $meta ) {
1037
+ if ( !in_array($meta['key'], $skip_meta_items) ) {
1038
+ update_post_meta( $menu_item_db_id, $meta['key'], maybe_unserialize($meta['value']));
1039
+ }
1040
+ }
1041
+ }
1042
+ // End.
1043
+
1044
+ $this->processed_menu_items[ intval( $item['post_id'] ) ] = (int) $id;
1045
+ }
1046
+ }
1047
+
1048
+ /**
1049
+ * If fetching attachments is enabled then attempt to create a new attachment
1050
+ *
1051
+ * @param array $post Attachment post details from WXR
1052
+ * @param string $url URL to fetch attachment from
1053
+ *
1054
+ * @return int|WP_Error Post ID on success, WP_Error otherwise
1055
+ */
1056
+ private function process_attachment( $post, $url ) {
1057
+
1058
+ if ( ! $this->fetch_attachments ) {
1059
+ return new WP_Error( 'attachment_processing_error', esc_html__( 'Fetching attachments is not enabled', 'wpr-addons' ) );
1060
+ }
1061
+
1062
+ // if the URL is absolute, but does not contain address, then upload it assuming base_site_url.
1063
+ if ( preg_match( '|^/[\w\W]+$|', $url ) ) {
1064
+ $url = rtrim( $this->base_url, '/' ) . $url;
1065
+ }
1066
+
1067
+ $upload = $this->fetch_remote_file( $url, $post );
1068
+ if ( is_wp_error( $upload ) ) {
1069
+ return $upload;
1070
+ }
1071
+
1072
+ $info = wp_check_filetype( $upload['file'] );
1073
+ if ( $info ) {
1074
+ $post['post_mime_type'] = $info['type'];
1075
+ } else {
1076
+ return new WP_Error( 'attachment_processing_error', esc_html__( 'Invalid file type', 'wpr-addons' ) );
1077
+ }
1078
+
1079
+ $post['guid'] = $upload['url'];
1080
+
1081
+ // As per wp-admin/includes/upload.php.
1082
+ $post_id = wp_insert_attachment( $post, $upload['file'] );
1083
+ wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
1084
+ add_post_meta( $post_id, '_wpr_demo_import_item', true );
1085
+
1086
+ // Remap resized image URLs, works by stripping the extension and remapping the URL stub.
1087
+ if ( preg_match( '!^image/!', $info['type'] ) ) {
1088
+ $parts = pathinfo( $url );
1089
+ $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
1090
+
1091
+ $parts_new = pathinfo( $upload['url'] );
1092
+ $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
1093
+
1094
+ $this->url_remap[ $parts['dirname'] . '/' . $name ] = $parts_new['dirname'] . '/' . $name_new;
1095
+ }
1096
+
1097
+ return $post_id;
1098
+ }
1099
+
1100
+ /**
1101
+ * Attempt to download a remote file attachment
1102
+ *
1103
+ * @param string $url URL of item to fetch
1104
+ * @param array $post Attachment details
1105
+ *
1106
+ * @return array|WP_Error Local file location details on success, WP_Error otherwise
1107
+ */
1108
+ private function fetch_remote_file( $url, $post ) {
1109
+ // Extract the file name from the URL.
1110
+ $file_name = basename( parse_url( $url, PHP_URL_PATH ) );
1111
+
1112
+ if ( ! $file_name ) {
1113
+ $file_name = md5( $url );
1114
+ }
1115
+
1116
+ $tmp_file_name = wp_tempnam( $file_name );
1117
+ if ( ! $tmp_file_name ) {
1118
+ return new WP_Error( 'import_no_file', esc_html__( 'Could not create temporary file.', 'wpr-addons' ) );
1119
+ }
1120
+
1121
+ // Fetch the remote URL and write it to the placeholder file.
1122
+ $remote_response = wp_safe_remote_get( $url, [
1123
+ 'timeout' => 300,
1124
+ 'stream' => true,
1125
+ 'filename' => $tmp_file_name,
1126
+ 'headers' => [
1127
+ 'Accept-Encoding' => 'identity',
1128
+ ],
1129
+ ] );
1130
+
1131
+ if ( is_wp_error( $remote_response ) ) {
1132
+ @unlink( $tmp_file_name );
1133
+
1134
+ return new WP_Error( 'import_file_error', sprintf( /* translators: 1: WordPress error message, 2: WordPress error code. */ esc_html__( 'Request failed due to an error: %1$s (%2$s)', 'wpr-addons' ), esc_html( $remote_response->get_error_message() ), esc_html( $remote_response->get_error_code() ) ) );
1135
+ }
1136
+
1137
+ $remote_response_code = (int) wp_remote_retrieve_response_code( $remote_response );
1138
+
1139
+ // Make sure the fetch was successful.
1140
+ if ( 200 !== $remote_response_code ) {
1141
+ @unlink( $tmp_file_name );
1142
+
1143
+ return new WP_Error( 'import_file_error', sprintf( /* translators: 1: HTTP error message, 2: HTTP error code. */ esc_html__( 'Remote server returned the following unexpected result: %1$s (%2$s)', 'wpr-addons' ), get_status_header_desc( $remote_response_code ), esc_html( $remote_response_code ) ) );
1144
+ }
1145
+
1146
+ $headers = wp_remote_retrieve_headers( $remote_response );
1147
+
1148
+ // Request failed.
1149
+ if ( ! $headers ) {
1150
+ @unlink( $tmp_file_name );
1151
+
1152
+ return new WP_Error( 'import_file_error', esc_html__( 'Remote server did not respond', 'wpr-addons' ) );
1153
+ }
1154
+
1155
+ $filesize = (int) filesize( $tmp_file_name );
1156
+
1157
+ if ( 0 === $filesize ) {
1158
+ @unlink( $tmp_file_name );
1159
+
1160
+ return new WP_Error( 'import_file_error', esc_html__( 'Zero size file downloaded', 'wpr-addons' ) );
1161
+ }
1162
+
1163
+ if ( ! isset( $headers['content-encoding'] ) && isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
1164
+ @unlink( $tmp_file_name );
1165
+
1166
+ return new WP_Error( 'import_file_error', esc_html__( 'Downloaded file has incorrect size', 'wpr-addons' ) );
1167
+ }
1168
+
1169
+ $max_size = (int) apply_filters( 'import_attachment_size_limit', self::DEFAULT_IMPORT_ATTACHMENT_SIZE_LIMIT );
1170
+ if ( ! empty( $max_size ) && $filesize > $max_size ) {
1171
+ @unlink( $tmp_file_name );
1172
+
1173
+ /* translators: %s: Max file size. */
1174
+ return new WP_Error( 'import_file_error', sprintf( esc_html__( 'Remote file is too large, limit is %s', 'wpr-addons' ), size_format( $max_size ) ) );
1175
+ }
1176
+
1177
+ // Override file name with Content-Disposition header value.
1178
+ if ( ! empty( $headers['content-disposition'] ) ) {
1179
+ $file_name_from_disposition = self::get_filename_from_disposition( (array) $headers['content-disposition'] );
1180
+ if ( $file_name_from_disposition ) {
1181
+ $file_name = $file_name_from_disposition;
1182
+ }
1183
+ }
1184
+
1185
+ // Set file extension if missing.
1186
+ $file_ext = pathinfo( $file_name, PATHINFO_EXTENSION );
1187
+ if ( ! $file_ext && ! empty( $headers['content-type'] ) ) {
1188
+ $extension = self::get_file_extension_by_mime_type( $headers['content-type'] );
1189
+ if ( $extension ) {
1190
+ $file_name = "{$file_name}.{$extension}";
1191
+ }
1192
+ }
1193
+
1194
+ // Handle the upload like _wp_handle_upload() does.
1195
+ $wp_filetype = wp_check_filetype_and_ext( $tmp_file_name, $file_name );
1196
+ $ext = empty( $wp_filetype['ext'] ) ? '' : $wp_filetype['ext'];
1197
+ $type = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type'];
1198
+ $proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename'];
1199
+
1200
+ // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect.
1201
+ if ( $proper_filename ) {
1202
+ $file_name = $proper_filename;
1203
+ }
1204
+
1205
+ if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {
1206
+ return new WP_Error( 'import_file_error', esc_html__( 'Sorry, this file type is not permitted for security reasons.', 'wpr-addons' ) );
1207
+ }
1208
+
1209
+ $uploads = wp_upload_dir( $post['upload_date'] );
1210
+ if ( ! ( $uploads && false === $uploads['error'] ) ) {
1211
+ return new WP_Error( 'upload_dir_error', $uploads['error'] );
1212
+ }
1213
+
1214
+ // Move the file to the uploads dir.
1215
+ $file_name = wp_unique_filename( $uploads['path'], $file_name );
1216
+ $new_file = $uploads['path'] . "/$file_name";
1217
+ $move_new_file = copy( $tmp_file_name, $new_file );
1218
+
1219
+ if ( ! $move_new_file ) {
1220
+ @unlink( $tmp_file_name );
1221
+
1222
+ return new WP_Error( 'import_file_error', esc_html__( 'The uploaded file could not be moved', 'wpr-addons' ) );
1223
+ }
1224
+
1225
+ // Set correct file permissions.
1226
+ $stat = stat( dirname( $new_file ) );
1227
+ $perms = $stat['mode'] & 0000666;
1228
+ chmod( $new_file, $perms );
1229
+
1230
+ $upload = [
1231
+ 'file' => $new_file,
1232
+ 'url' => $uploads['url'] . "/$file_name",
1233
+ 'type' => $wp_filetype['type'],
1234
+ 'error' => false,
1235
+ ];
1236
+
1237
+ // Keep track of the old and new urls so we can substitute them later.
1238
+ $this->url_remap[ $url ] = $upload['url'];
1239
+ $this->url_remap[ $post['guid'] ] = $upload['url']; // r13735, really needed?
1240
+ // Keep track of the destination if the remote url is redirected somewhere else.
1241
+ if ( isset( $headers['x-final-location'] ) && $headers['x-final-location'] !== $url ) {
1242
+ $this->url_remap[ $headers['x-final-location'] ] = $upload['url'];
1243
+ }
1244
+
1245
+ return $upload;
1246
+ }
1247
+
1248
+ /**
1249
+ * Attempt to associate posts and menu items with previously missing parents
1250
+ *
1251
+ * An imported post's parent may not have been imported when it was first created
1252
+ * so try again. Similarly for child menu items and menu items which were missing
1253
+ * the object (e.g. post) they represent in the menu
1254
+ */
1255
+ private function backfill_parents() {
1256
+ global $wpdb;
1257
+
1258
+ // Find parents for post orphans.
1259
+ foreach ( $this->post_orphans as $child_id => $parent_id ) {
1260
+ $local_child_id = false;
1261
+ $local_parent_id = false;
1262
+
1263
+ if ( isset( $this->processed_posts[ $child_id ] ) ) {
1264
+ $local_child_id = $this->processed_posts[ $child_id ];
1265
+ }
1266
+ if ( isset( $this->processed_posts[ $parent_id ] ) ) {
1267
+ $local_parent_id = $this->processed_posts[ $parent_id ];
1268
+ }
1269
+
1270
+ if ( $local_child_id && $local_parent_id ) {
1271
+ $wpdb->update( $wpdb->posts, [ 'post_parent' => $local_parent_id ], [ 'ID' => $local_child_id ], '%d', '%d' );
1272
+ clean_post_cache( $local_child_id );
1273
+ }
1274
+ }
1275
+
1276
+ // All other posts/terms are imported, retry menu items with missing associated object.
1277
+ $missing_menu_items = $this->missing_menu_items;
1278
+ foreach ( $missing_menu_items as $item ) {
1279
+ $this->process_menu_item( $item );
1280
+ }
1281
+
1282
+ // Find parents for menu item orphans.
1283
+ foreach ( $this->menu_item_orphans as $child_id => $parent_id ) {
1284
+ $local_child_id = 0;
1285
+ $local_parent_id = 0;
1286
+ if ( isset( $this->processed_menu_items[ $child_id ] ) ) {
1287
+ $local_child_id = $this->processed_menu_items[ $child_id ];
1288
+ }
1289
+ if ( isset( $this->processed_menu_items[ $parent_id ] ) ) {
1290
+ $local_parent_id = $this->processed_menu_items[ $parent_id ];
1291
+ }
1292
+
1293
+ if ( $local_child_id && $local_parent_id ) {
1294
+ update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );
1295
+ }
1296
+ }
1297
+ }
1298
+
1299
+ /**
1300
+ * Use stored mapping information to update old attachment URLs
1301
+ */
1302
+ private function backfill_attachment_urls() {
1303
+ global $wpdb;
1304
+ // Make sure we do the longest urls first, in case one is a substring of another.
1305
+ uksort( $this->url_remap, function ( $a, $b ) {
1306
+ // Return the difference in length between two strings.
1307
+ return strlen( $b ) - strlen( $a );
1308
+ } );
1309
+
1310
+ foreach ( $this->url_remap as $from_url => $to_url ) {
1311
+ // Remap urls in post_content.
1312
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ) );
1313
+ // Remap enclosure urls.
1314
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ) );
1315
+ }
1316
+ }
1317
+
1318
+ /**
1319
+ * Update _thumbnail_id meta to new, imported attachment IDs
1320
+ */
1321
+ private function remap_featured_images() {
1322
+ // Cycle through posts that have a featured image.
1323
+ foreach ( $this->featured_images as $post_id => $value ) {
1324
+ if ( isset( $this->processed_posts[ $value ] ) ) {
1325
+ $new_id = $this->processed_posts[ $value ];
1326
+ // Only update if there's a difference.
1327
+ if ( $new_id !== $value ) {
1328
+ update_post_meta( $post_id, '_thumbnail_id', $new_id );
1329
+ }
1330
+ }
1331
+ }
1332
+ }
1333
+
1334
+ /**
1335
+ * Parse a WXR file
1336
+ *
1337
+ * @param string $file Path to WXR file for parsing
1338
+ *
1339
+ * @return array Information gathered from the WXR file
1340
+ */
1341
+ private function parse( $file ) {
1342
+ $parser = new WXR_Parser();
1343
+
1344
+ return $parser->parse( $file );
1345
+ }
1346
+
1347
+ /**
1348
+ * Decide if the given meta key maps to information we will want to import
1349
+ *
1350
+ * @param string $key The meta key to check
1351
+ *
1352
+ * @return string|bool The key if we do want to import, false if not
1353
+ */
1354
+ private function is_valid_meta_key( $key ) {
1355
+ // Skip attachment metadata since we'll regenerate it from scratch.
1356
+ // Skip _edit_lock as not relevant for import
1357
+ if ( in_array( $key, [ '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ] ) ) {
1358
+ return false;
1359
+ }
1360
+
1361
+ return $key;
1362
+ }
1363
+
1364
+ public function run() {
1365
+ $this->import( $this->requested_file_path );
1366
+
1367
+ return $this->output;
1368
+ }
1369
+
1370
+ public function __construct( $file, $args = [] ) {
1371
+ $this->requested_file_path = $file;
1372
+ $this->args = $args;
1373
+
1374
+ if ( ! empty( $this->args['fetch_attachments'] ) ) {
1375
+ $this->fetch_attachments = true;
1376
+ }
1377
+ }
1378
+ }
admin/includes/wpr-render-templates.php CHANGED
@@ -1,251 +1,251 @@
1
- <?php
2
- namespace WprAddons\Admin\Includes;
3
-
4
- use WprAddons\Classes\Utilities;
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit; // Exit if accessed directly.
8
- }
9
-
10
- /**
11
- * WPR_Render_Templates setup
12
- *
13
- * @since 1.0
14
- */
15
- class WPR_Render_Templates {
16
-
17
- /**
18
- ** Instance of Elemenntor Frontend class.
19
- *
20
- ** @var \Elementor\Frontend()
21
- */
22
- private static $elementor_instance;
23
-
24
- /**
25
- ** Get Current Theme.
26
- */
27
- public $current_theme;
28
-
29
- /**
30
- ** Royal Themes Array.
31
- */
32
- public $royal_themes;
33
-
34
-
35
- /**
36
- ** Constructor
37
- */
38
- public function __construct( $only_hf = false ) {
39
-
40
- // Elementor Frontend
41
- self::$elementor_instance = \Elementor\Plugin::instance();
42
-
43
- // Ative Theme
44
- $this->current_theme = get_template();
45
-
46
- // Royal Themes
47
- $this->royal_themes = ['ashe', 'ashe-pro', 'ashe-pro-premium', 'bard', 'bard-pro', 'bard-pro-premium'];
48
-
49
- // Popular Themes
50
- if ( 'astra' === $this->current_theme ) {
51
- require_once(__DIR__ . '/../templates/views/astra/class-astra-compat.php');
52
-
53
- } elseif ( 'generatepress' === $this->current_theme ) {
54
- require_once(__DIR__ . '/../templates/views/generatepress/class-generatepress-compat.php');
55
-
56
- } elseif ( 'oceanwp' === $this->current_theme ) {
57
- require_once(__DIR__ . '/../templates/views/oceanwp/class-oceanwp-compat.php');
58
-
59
- } elseif ( 'storefront' === $this->current_theme ) {
60
- require_once(__DIR__ . '/../templates/views/storefront/class-storefront-compat.php');
61
-
62
- // Other Themes
63
- } else {
64
- add_action( 'wp', [ $this, 'global_compatibility' ] );
65
- }
66
-
67
- // Scripts and Styles
68
- add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
69
-
70
- // Theme Builder
71
- if ( !$only_hf ) { // Prevent Loading in Header or Footer Templates
72
- add_filter( 'template_include', [ $this, 'convert_to_canvas' ], 12 ); // 12 after WP Pages and WooCommerce.
73
- add_action( 'elementor/page_templates/canvas/wpr_print_content', [ $this, 'canvas_page_content_display' ] );
74
- }
75
- }
76
-
77
- public function global_compatibility() {
78
- add_action( 'get_header', [ $this, 'replace_header' ] );
79
- add_action( 'elementor/page_templates/canvas/before_content', [ $this, 'add_canvas_header' ] );
80
-
81
- add_action( 'get_footer', [ $this, 'replace_footer' ] );
82
- add_action( 'elementor/page_templates/canvas/after_content', [ $this, 'add_canvas_footer' ], 9 );
83
- }
84
-
85
- /**
86
- ** Check if a Template has Conditions
87
- */
88
- public function is_template_available( $type ) {
89
- if ( 'content' === $type ) {
90
- return !is_null(WPR_Conditions_Manager::canvas_page_content_display_conditions()) ? true : false;
91
- } else {
92
- $conditions = json_decode( get_option('wpr_'. $type .'_conditions', '[]'), true );
93
- $template = WPR_Conditions_Manager::header_footer_display_conditions( $conditions );
94
- return (!empty( $conditions ) && !is_null($template)) ? true : false;
95
- }
96
- }
97
-
98
- /**
99
- ** Header
100
- */
101
- public function replace_header() {
102
- if ( $this->is_template_available('header') ) {
103
- if ( ! in_array($this->current_theme, $this->royal_themes) ) {
104
- require __DIR__ . '/../templates/views/theme-header.php';
105
- } else {
106
- require __DIR__ . '/../templates/views/royal/theme-header-royal.php';
107
- }
108
-
109
- $templates = [];
110
- $templates[] = 'header.php';
111
-
112
- remove_all_actions( 'wp_head' ); // Avoid running wp_head hooks again.
113
-
114
- ob_start();
115
- locate_template( $templates, true );
116
- ob_get_clean();
117
- }
118
- }
119
-
120
- public function add_canvas_header() {
121
- if ( $this->is_template_available('header') ) {
122
- $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
123
- $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
124
- $template_id = Utilities::get_template_id($template_slug);
125
- $show_on_canvas = get_post_meta($template_id, 'wpr_header_show_on_canvas', true);
126
-
127
- if ( !empty($show_on_canvas) && 'true' === $show_on_canvas && 0 === strpos($template_slug, 'user-header-') ) {
128
- Utilities::render_elementor_template($template_slug);
129
- }
130
- }
131
- }
132
-
133
- /**
134
- ** Footer
135
- */
136
- public function replace_footer() {
137
- if ( $this->is_template_available('footer') ) {
138
- if ( ! in_array($this->current_theme, $this->royal_themes) ) {
139
- require __DIR__ . '/../templates/views/theme-footer.php';
140
- } else {
141
- require __DIR__ . '/../templates/views/royal/theme-footer-royal.php';
142
- }
143
-
144
- $templates = [];
145
- $templates[] = 'footer.php';
146
-
147
- remove_all_actions( 'wp_footer' ); // Avoid running wp_footer hooks again.
148
-
149
- ob_start();
150
- locate_template( $templates, true );
151
- ob_get_clean();
152
- }
153
- }
154
-
155
- public function add_canvas_footer() {
156
- if ( $this->is_template_available('footer') ) {
157
- $conditions = json_decode( get_option('wpr_footer_conditions', '[]'), true );
158
- $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
159
- $template_id = Utilities::get_template_id($template_slug);
160
- $show_on_canvas = get_post_meta($template_id, 'wpr_footer_show_on_canvas', true);
161
-
162
- if ( !empty($show_on_canvas) && 'true' === $show_on_canvas && 0 === strpos($template_slug, 'user-footer-') ) {
163
- Utilities::render_elementor_template($template_slug);
164
- }
165
- }
166
- }
167
-
168
- public function convert_to_canvas( $template ) {
169
- $is_theme_builder_edit = \Elementor\Plugin::$instance->preview->is_preview_mode() && Utilities::is_theme_builder_template() ? true : false;
170
- $_wp_page_template = get_post_meta(get_the_ID(), '_wp_page_template', true);
171
-
172
- if ( $this->is_template_available('content') || $is_theme_builder_edit ) {
173
- if ( (is_page() || is_single()) && 'elementor_canvas' === $_wp_page_template && !$is_theme_builder_edit ) {
174
- return $template;
175
- } else {
176
- return WPR_ADDONS_PATH . 'admin/templates/wpr-canvas.php';
177
- }
178
- } else {
179
- return $template;
180
- }
181
- }
182
-
183
- /**
184
- ** Theme Builder Content Display
185
- */
186
- public function canvas_page_content_display() {
187
- // Get Template
188
- $template = WPR_Conditions_Manager::canvas_page_content_display_conditions();
189
-
190
- // Display Template
191
- Utilities::render_elementor_template( $template );
192
- }
193
-
194
- /**
195
- * Enqueue styles and scripts.
196
- */
197
- public function enqueue_scripts() {
198
-
199
- if ( class_exists( '\Elementor\Plugin' ) ) {
200
- $elementor = \Elementor\Plugin::instance();
201
- $elementor->frontend->enqueue_styles();
202
- }
203
-
204
- if ( class_exists( '\ElementorPro\Plugin' ) ) {
205
- $elementor_pro = \ElementorPro\Plugin::instance();
206
- $elementor_pro->enqueue_styles();
207
- }
208
-
209
- // Load Header Template CSS File
210
- $heder_conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
211
- $header_template_id = Utilities::get_template_id(WPR_Conditions_Manager::header_footer_display_conditions($heder_conditions));
212
-
213
- if ( false !== $header_template_id ) {
214
- if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
215
- $header_css_file = new \Elementor\Core\Files\CSS\Post( $header_template_id );
216
- } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
217
- $header_css_file = new \Elementor\Post_CSS_File( $header_template_id );
218
- }
219
-
220
- $header_css_file->enqueue();
221
- }
222
-
223
- // Load Footer Template CSS File
224
- $footer_conditions = json_decode( get_option('wpr_footer_conditions', '[]'), true );
225
- $footer_template_id = Utilities::get_template_id(WPR_Conditions_Manager::header_footer_display_conditions($footer_conditions));
226
-
227
- if ( false !== $footer_template_id ) {
228
- if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
229
- $footer_css_file = new \Elementor\Core\Files\CSS\Post( $footer_template_id );
230
- } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
231
- $footer_css_file = new \Elementor\Post_CSS_File( $footer_template_id );
232
- }
233
-
234
- $footer_css_file->enqueue();
235
- }
236
-
237
- // Load Canvas Content Template CSS File
238
- $canvas_template_id = Utilities::get_template_id(WPR_Conditions_Manager::canvas_page_content_display_conditions());
239
-
240
- if ( false !== $canvas_template_id ) {
241
- if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
242
- $footer_css_file = new \Elementor\Core\Files\CSS\Post( $canvas_template_id );
243
- } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
244
- $footer_css_file = new \Elementor\Post_CSS_File( $canvas_template_id );
245
- }
246
-
247
- $footer_css_file->enqueue();
248
- }
249
- }
250
-
251
  }
1
+ <?php
2
+ namespace WprAddons\Admin\Includes;
3
+
4
+ use WprAddons\Classes\Utilities;
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+ /**
11
+ * WPR_Render_Templates setup
12
+ *
13
+ * @since 1.0
14
+ */
15
+ class WPR_Render_Templates {
16
+
17
+ /**
18
+ ** Instance of Elemenntor Frontend class.
19
+ *
20
+ ** @var \Elementor\Frontend()
21
+ */
22
+ private static $elementor_instance;
23
+
24
+ /**
25
+ ** Get Current Theme.
26
+ */
27
+ public $current_theme;
28
+
29
+ /**
30
+ ** Royal Themes Array.
31
+ */
32
+ public $royal_themes;
33
+
34
+
35
+ /**
36
+ ** Constructor
37
+ */
38
+ public function __construct( $only_hf = false ) {
39
+
40
+ // Elementor Frontend
41
+ self::$elementor_instance = \Elementor\Plugin::instance();
42
+
43
+ // Ative Theme
44
+ $this->current_theme = get_template();
45
+
46
+ // Royal Themes
47
+ $this->royal_themes = ['ashe', 'ashe-pro', 'ashe-pro-premium', 'bard', 'bard-pro', 'bard-pro-premium'];
48
+
49
+ // Popular Themes
50
+ if ( 'astra' === $this->current_theme ) {
51
+ require_once(__DIR__ . '/../templates/views/astra/class-astra-compat.php');
52
+
53
+ } elseif ( 'generatepress' === $this->current_theme ) {
54
+ require_once(__DIR__ . '/../templates/views/generatepress/class-generatepress-compat.php');
55
+
56
+ } elseif ( 'oceanwp' === $this->current_theme ) {
57
+ require_once(__DIR__ . '/../templates/views/oceanwp/class-oceanwp-compat.php');
58
+
59
+ } elseif ( 'storefront' === $this->current_theme ) {
60
+ require_once(__DIR__ . '/../templates/views/storefront/class-storefront-compat.php');
61
+
62
+ // Other Themes
63
+ } else {
64
+ add_action( 'wp', [ $this, 'global_compatibility' ] );
65
+ }
66
+
67
+ // Scripts and Styles
68
+ add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
69
+
70
+ // Theme Builder
71
+ if ( !$only_hf ) { // Prevent Loading in Header or Footer Templates
72
+ add_filter( 'template_include', [ $this, 'convert_to_canvas' ], 12 ); // 12 after WP Pages and WooCommerce.
73
+ add_action( 'elementor/page_templates/canvas/wpr_print_content', [ $this, 'canvas_page_content_display' ] );
74
+ }
75
+ }
76
+
77
+ public function global_compatibility() {
78
+ add_action( 'get_header', [ $this, 'replace_header' ] );
79
+ add_action( 'elementor/page_templates/canvas/before_content', [ $this, 'add_canvas_header' ] );
80
+
81
+ add_action( 'get_footer', [ $this, 'replace_footer' ] );
82
+ add_action( 'elementor/page_templates/canvas/after_content', [ $this, 'add_canvas_footer' ], 9 );
83
+ }
84
+
85
+ /**
86
+ ** Check if a Template has Conditions
87
+ */
88
+ public function is_template_available( $type ) {
89
+ if ( 'content' === $type ) {
90
+ return !is_null(WPR_Conditions_Manager::canvas_page_content_display_conditions()) ? true : false;
91
+ } else {
92
+ $conditions = json_decode( get_option('wpr_'. $type .'_conditions', '[]'), true );
93
+ $template = WPR_Conditions_Manager::header_footer_display_conditions( $conditions );
94
+ return (!empty( $conditions ) && !is_null($template)) ? true : false;
95
+ }
96
+ }
97
+
98
+ /**
99
+ ** Header
100
+ */
101
+ public function replace_header() {
102
+ if ( $this->is_template_available('header') ) {
103
+ if ( ! in_array($this->current_theme, $this->royal_themes) ) {
104
+ require __DIR__ . '/../templates/views/theme-header.php';
105
+ } else {
106
+ require __DIR__ . '/../templates/views/royal/theme-header-royal.php';
107
+ }
108
+
109
+ $templates = [];
110
+ $templates[] = 'header.php';
111
+
112
+ remove_all_actions( 'wp_head' ); // Avoid running wp_head hooks again.
113
+
114
+ ob_start();
115
+ locate_template( $templates, true );
116
+ ob_get_clean();
117
+ }
118
+ }
119
+
120
+ public function add_canvas_header() {
121
+ if ( $this->is_template_available('header') ) {
122
+ $conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
123
+ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
124
+ $template_id = Utilities::get_template_id($template_slug);
125
+ $show_on_canvas = get_post_meta($template_id, 'wpr_header_show_on_canvas', true);
126
+
127
+ if ( !empty($show_on_canvas) && 'true' === $show_on_canvas && 0 === strpos($template_slug, 'user-header-') ) {
128
+ Utilities::render_elementor_template($template_slug);
129
+ }
130
+ }
131
+ }
132
+
133
+ /**
134
+ ** Footer
135
+ */
136
+ public function replace_footer() {
137
+ if ( $this->is_template_available('footer') ) {
138
+ if ( ! in_array($this->current_theme, $this->royal_themes) ) {
139
+ require __DIR__ . '/../templates/views/theme-footer.php';
140
+ } else {
141
+ require __DIR__ . '/../templates/views/royal/theme-footer-royal.php';
142
+ }
143
+
144
+ $templates = [];
145
+ $templates[] = 'footer.php';
146
+
147
+ remove_all_actions( 'wp_footer' ); // Avoid running wp_footer hooks again.
148
+
149
+ ob_start();
150
+ locate_template( $templates, true );
151
+ ob_get_clean();
152
+ }
153
+ }
154
+
155
+ public function add_canvas_footer() {
156
+ if ( $this->is_template_available('footer') ) {
157
+ $conditions = json_decode( get_option('wpr_footer_conditions', '[]'), true );
158
+ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($conditions);
159
+ $template_id = Utilities::get_template_id($template_slug);
160
+ $show_on_canvas = get_post_meta($template_id, 'wpr_footer_show_on_canvas', true);
161
+
162
+ if ( !empty($show_on_canvas) && 'true' === $show_on_canvas && 0 === strpos($template_slug, 'user-footer-') ) {
163
+ Utilities::render_elementor_template($template_slug);
164
+ }
165
+ }
166
+ }
167
+
168
+ public function convert_to_canvas( $template ) {
169
+ $is_theme_builder_edit = \Elementor\Plugin::$instance->preview->is_preview_mode() && Utilities::is_theme_builder_template() ? true : false;
170
+ $_wp_page_template = get_post_meta(get_the_ID(), '_wp_page_template', true);
171
+
172
+ if ( $this->is_template_available('content') || $is_theme_builder_edit ) {
173
+ if ( (is_page() || is_single()) && 'elementor_canvas' === $_wp_page_template && !$is_theme_builder_edit ) {
174
+ return $template;
175
+ } else {
176
+ return WPR_ADDONS_PATH . 'admin/templates/wpr-canvas.php';
177
+ }
178
+ } else {
179
+ return $template;
180
+ }
181
+ }
182
+
183
+ /**
184
+ ** Theme Builder Content Display
185
+ */
186
+ public function canvas_page_content_display() {
187
+ // Get Template
188
+ $template = WPR_Conditions_Manager::canvas_page_content_display_conditions();
189
+
190
+ // Display Template
191
+ Utilities::render_elementor_template( $template );
192
+ }
193
+
194
+ /**
195
+ * Enqueue styles and scripts.
196
+ */
197
+ public function enqueue_scripts() {
198
+
199
+ if ( class_exists( '\Elementor\Plugin' ) ) {
200
+ $elementor = \Elementor\Plugin::instance();
201
+ $elementor->frontend->enqueue_styles();
202
+ }
203
+
204
+ if ( class_exists( '\ElementorPro\Plugin' ) ) {
205
+ $elementor_pro = \ElementorPro\Plugin::instance();
206
+ $elementor_pro->enqueue_styles();
207
+ }
208
+
209
+ // Load Header Template CSS File
210
+ $heder_conditions = json_decode( get_option('wpr_header_conditions', '[]'), true );
211
+ $header_template_id = Utilities::get_template_id(WPR_Conditions_Manager::header_footer_display_conditions($heder_conditions));
212
+
213
+ if ( false !== $header_template_id ) {
214
+ if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
215
+ $header_css_file = new \Elementor\Core\Files\CSS\Post( $header_template_id );
216
+ } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
217
+ $header_css_file = new \Elementor\Post_CSS_File( $header_template_id );
218
+ }
219
+
220
+ $header_css_file->enqueue();
221
+ }
222
+
223
+ // Load Footer Template CSS File
224
+ $footer_conditions = json_decode( get_option('wpr_footer_conditions', '[]'), true );
225
+ $footer_template_id = Utilities::get_template_id(WPR_Conditions_Manager::header_footer_display_conditions($footer_conditions));
226
+
227
+ if ( false !== $footer_template_id ) {
228
+ if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
229
+ $footer_css_file = new \Elementor\Core\Files\CSS\Post( $footer_template_id );
230
+ } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
231
+ $footer_css_file = new \Elementor\Post_CSS_File( $footer_template_id );
232
+ }
233
+
234
+ $footer_css_file->enqueue();
235
+ }
236
+
237
+ // Load Canvas Content Template CSS File
238
+ $canvas_template_id = Utilities::get_template_id(WPR_Conditions_Manager::canvas_page_content_display_conditions());
239
+
240
+ if ( false !== $canvas_template_id ) {
241
+ if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) {
242
+ $footer_css_file = new \Elementor\Core\Files\CSS\Post( $canvas_template_id );
243
+ } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) {
244
+ $footer_css_file = new \Elementor\Post_CSS_File( $canvas_template_id );
245
+ }
246
+
247
+ $footer_css_file->enqueue();
248
+ }
249
+ }
250
+
251
  }
admin/includes/wpr-templates-library.php CHANGED
@@ -9,8 +9,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
  /**
@@ -45,12 +45,12 @@ class WPR_Templates_Library {
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
 
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_Pages;
13
+ use WprAddons\Admin\Templates\WPR_Templates_Library_Popups;
14
  use WprAddons\Classes\Utilities;
15
 
16
  /**
45
  // Add Blocks to Library
46
  new WPR_Templates_Library_Blocks();
47
 
 
 
 
48
  // Add Pages to Library
49
  // new WPR_Templates_Library_Pages();
50
 
51
+ // Add Popups to Library
52
+ new WPR_Templates_Library_Popups();
53
+
54
  // Enable Elementor for 'wpr_templates'
55
  $this->add_elementor_cpt_support();
56
 
admin/includes/wpr-templates-shortcode.php CHANGED
@@ -1,51 +1,51 @@
1
- <?php
2
-
3
- namespace WprAddons\Admin\Includes;
4
-
5
- use Elementor;
6
-
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit; // Exit if accessed directly.
9
- }
10
-
11
- /**
12
- * WPR_Templates_Shortcode setup
13
- *
14
- * @since 1.0
15
- */
16
- class WPR_Templates_Shortcode {
17
-
18
- public function __construct() {
19
- add_shortcode( 'wpr-template', [ $this, 'shortcode' ] );
20
-
21
- add_action('elementor/element/after_section_start', [ $this, 'extend_shortcode' ], 10, 3 );
22
- }
23
-
24
- public function shortcode( $attributes = [] ) {
25
- if ( empty( $attributes['id'] ) ) {
26
- return '';
27
- }
28
-
29
- $edit_link = '<span class="wpr-template-edit-btn" data-permalink="'. esc_url(get_permalink($attributes['id'])) .'">Edit Template</span>';
30
-
31
- $type = get_post_meta(get_the_ID(), '_wpr_template_type', true);
32
- $has_css = 'internal' === get_option( 'elementor_css_print_method' ) || '' !== $type;
33
-
34
- return Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $attributes['id'], $has_css ) . $edit_link;
35
- }
36
-
37
- public function extend_shortcode( $section, $section_id, $args ) {
38
- if ( $section->get_name() == 'shortcode' && $section_id == 'section_shortcode' ) {
39
- $section->add_control(
40
- 'select_template' ,
41
- [
42
- 'label' => esc_html__( 'Select Template', 'wpr-addons' ),
43
- 'type' => 'wpr-ajax-select2',
44
- 'options' => 'ajaxselect2/get_elementor_templates',
45
- 'label_block' => true,
46
- ]
47
- );
48
- }
49
- }
50
-
51
  }
1
+ <?php
2
+
3
+ namespace WprAddons\Admin\Includes;
4
+
5
+ use Elementor;
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit; // Exit if accessed directly.
9
+ }
10
+
11
+ /**
12
+ * WPR_Templates_Shortcode setup
13
+ *
14
+ * @since 1.0
15
+ */
16
+ class WPR_Templates_Shortcode {
17
+
18
+ public function __construct() {
19
+ add_shortcode( 'wpr-template', [ $this, 'shortcode' ] );
20
+
21
+ add_action('elementor/element/after_section_start', [ $this, 'extend_shortcode' ], 10, 3 );
22
+ }
23
+
24
+ public function shortcode( $attributes = [] ) {
25
+ if ( empty( $attributes['id'] ) ) {
26
+ return '';
27
+ }
28
+
29
+ $edit_link = '<span class="wpr-template-edit-btn" data-permalink="'. esc_url(get_permalink($attributes['id'])) .'">Edit Template</span>';
30
+
31
+ $type = get_post_meta(get_the_ID(), '_wpr_template_type', true);
32
+ $has_css = 'internal' === get_option( 'elementor_css_print_method' ) || '' !== $type;
33
+
34
+ return Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $attributes['id'], $has_css ) . $edit_link;
35
+ }
36
+
37
+ public function extend_shortcode( $section, $section_id, $args ) {
38
+ if ( $section->get_name() == 'shortcode' && $section_id == 'section_shortcode' ) {
39
+ $section->add_control(
40
+ 'select_template' ,
41
+ [
42
+ 'label' => esc_html__( 'Select Template', 'wpr-addons' ),
43
+ 'type' => 'wpr-ajax-select2',
44
+ 'options' => 'ajaxselect2/get_elementor_templates',
45
+ 'label_block' => true,
46
+ ]
47
+ );
48
+ }
49
+ }
50
+
51
  }
admin/mega-menu.php CHANGED
@@ -1,376 +1,376 @@
1
- <?php
2
- use WprAddons\Plugin;
3
-
4
- // Register Post Type
5
- function register_mega_menu_cpt() {
6
- $args = array(
7
- 'label' => esc_html__( 'Royal Mega Menu', 'wpr-addons' ),
8
- 'public' => true,
9
- 'publicly_queryable' => true,
10
- 'rewrite' => false,
11
- 'show_ui' => true,
12
- 'show_in_menu' => false,
13
- 'show_in_nav_menus' => false,
14
- 'exclude_from_search' => true,
15
- 'capability_type' => 'post',
16
- 'supports' => array( 'title', 'editor', 'elementor' ),
17
- 'hierarchical' => false,
18
- );
19
-
20
- register_post_type( 'wpr_mega_menu', $args );
21
- }
22
-
23
- // Convert to Canvas Template
24
- function convert_to_canvas_template( $template ) {
25
- if ( is_singular('wpr_mega_menu') ) {
26
- $template = WPR_ADDONS_PATH . 'admin/templates/wpr-canvas.php';
27
- }
28
-
29
- return $template;
30
- }
31
-
32
- // Init Mega Menu
33
- function init_mega_menu() {
34
- register_mega_menu_cpt();
35
- add_action( 'template_include', 'convert_to_canvas_template', 9999 );
36
- }
37
-
38
- add_action('init', 'init_mega_menu', 999);
39
-
40
-
41
- // Confinue only for Dashboard Screen
42
- if ( !is_admin() ) return;
43
-
44
- // Init Actions
45
- add_filter( 'option_elementor_cpt_support', 'add_mega_menu_cpt_support' );
46
- add_filter( 'default_option_elementor_cpt_support', 'add_mega_menu_cpt_support' );
47
- add_action( 'admin_footer', 'render_settings_popup', 10 );
48
- add_action( 'wp_ajax_wpr_create_mega_menu_template', 'wpr_create_mega_menu_template' );
49
- add_action( 'wp_ajax_wpr_save_mega_menu_settings', 'wpr_save_mega_menu_settings' );
50
- add_action( 'admin_enqueue_scripts', 'enqueue_scripts' );
51
-
52
- // Add Elementor Editor Support
53
- function add_mega_menu_cpt_support( $value ) {
54
- if ( empty( $value ) ) {
55
- $value = [];
56
- }
57
-
58
- return array_merge( $value, ['wpr_mega_menu'] );
59
- }
60
-
61
- // Create Menu Template
62
- function wpr_create_mega_menu_template() {
63
- if ( ! current_user_can( 'manage_options' ) ) {
64
- return;
65
- }
66
-
67
- // $menu_id = intval( $_REQUEST['menu'] );
68
- // $menu_item_id = intval( $_REQUEST['item'] );
69
- $menu_item_id = intval( $_POST['item_id'] );
70
- $mega_menu_id = get_post_meta( $menu_item_id, 'wpr-mega-menu-item', true );
71
-
72
- if ( ! $mega_menu_id ) {
73
-
74
- $mega_menu_id = wp_insert_post( array(
75
- 'post_title' => 'wpr-mega-menu-item-' . $menu_item_id,
76
- 'post_status' => 'publish',
77
- 'post_type' => 'wpr_mega_menu',
78
- ) );
79
-
80
- update_post_meta( $menu_item_id, 'wpr-mega-menu-item', $mega_menu_id );
81
-
82
- }
83
-
84
- $edit_link = add_query_arg(
85
- array(
86
- 'post' => $mega_menu_id,
87
- 'action' => 'elementor',
88
- ),
89
- admin_url( 'post.php' )
90
- );
91
-
92
- wp_send_json([
93
- 'data' => [
94
- 'edit_link' => $edit_link
95
- ]
96
- ]);
97
- }
98
-
99
- // Render Settings Popup
100
- function render_settings_popup() {
101
- $screen = get_current_screen();
102
-
103
- if ( 'nav-menus' !== $screen->base ) {
104
- return;
105
- }
106
-
107
- ?>
108
-
109
- <div class="wpr-mm-settings-popup-wrap">
110
- <div class="wpr-mm-settings-popup">
111
- <div class="wpr-mm-settings-popup-header">
112
- <span class="wpr-mm-popup-logo" style="background:url('<?php echo WPR_ADDONS_ASSETS_URL .'img/logo-40x40.png'; ?>') no-repeat center center / contain;">RE</span>
113
- <span><?php esc_html_e('Royal Mega Menu', 'wpr-addons'); ?></span>
114
- <span class="wpr-mm-popup-title"><?php esc_html_e('Menu Item: ', 'wpr-addons'); ?><span></span></span>
115
- <span class="dashicons dashicons-no-alt wpr-mm-settings-close-popup-btn"></span>
116
- </div>
117
-
118
- <?php $pro_active = wpr_fs()->can_use_premium_code() ? 'data-pro-active="true"' : 'data-pro-active="false"'; ?>
119
-
120
- <div class="wpr-mm-settings-wrap" <?php echo $pro_active; ?>>
121
- <h4><?php esc_html_e('General', 'wpr-addons'); ?></h4>
122
- <div class="wpr-mm-setting wpr-mm-setting-switcher">
123
- <h4><?php esc_html_e('Enable Mega Menu', 'wpr-addons'); ?></h4>
124
- <input type="checkbox" id="wpr_mm_enable">
125
- <label for="wpr_mm_enable"></label>
126
- </div>
127
- <div class="wpr-mm-setting">
128
- <h4><?php esc_html_e('Mega Menu Content', 'wpr-addons'); ?></h4>
129
- <button class="button button-primary wpr-edit-mega-menu-btn">
130
- <i class="eicon-elementor-square" aria-hidden="true"></i>
131
- <?php esc_html_e('Edit with Elementor', 'wpr-addons'); ?>
132
- </button>
133
- </div>
134
- <div class="wpr-mm-setting">
135
- <h4><?php esc_html_e('Dropdown Position', 'wpr-addons'); ?></h4>
136
- <select id="wpr_mm_position">
137
- <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
138
- <option value="relative"><?php esc_html_e('Relative', 'wpr-addons'); ?></option>
139
- </select>
140
- </div>
141
- <div class="wpr-mm-setting">
142
- <h4><?php esc_html_e('Dropdown Width', 'wpr-addons'); ?></h4>
143
- <select id="wpr_mm_width">
144
- <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
145
- <?php if ( ! wpr_fs()->can_use_premium_code() ) : ?>
146
- <option value="pro-st"><?php esc_html_e('Fit to Section (Pro)', 'wpr-addons'); ?></option>
147
- <?php else: ?>
148
- <option value="stretch"><?php esc_html_e('Fit to Section', 'wpr-addons'); ?></option>
149
- <?php endif; ?>
150
- <option value="full"><?php esc_html_e('Full Width', 'wpr-addons'); ?></option>
151
- <option value="custom"><?php esc_html_e('Custom', 'wpr-addons'); ?></option>
152
- </select>
153
- </div>
154
- <div class="wpr-mm-setting">
155
- <h4><?php esc_html_e('Custom Width (px)', 'wpr-addons'); ?></h4>
156
- <input type="number" id="wpr_mm_custom_width" value="600">
157
- </div>
158
- <div class="wpr-mm-setting <?php echo !wpr_fs()->can_use_premium_code() ? 'wpr-mm-pro-setting' : ''; ?>">
159
- <h4><?php esc_html_e('Mobile Sub Content', 'wpr-addons'); ?></h4>
160
- <div>
161
- <select id="wpr_mm_mobile_content">
162
- <option value="mega"><?php esc_html_e('Mega Menu', 'wpr-addons'); ?></option>
163
- <option value="wp-sub"><?php esc_html_e('WordPress Sub Items', 'wpr-addons'); ?></option>
164
- </select>
165
-
166
- <div class="wpr-mm-pro-radio">
167
- <input type="radio" name="mc" checked="checked">
168
- <label>Mega Menu</label><br>
169
- <input type="radio" name="mc">
170
- <label>WordPress Sub Items</label>
171
- </div>
172
- </div>
173
- </div>
174
- <div class="wpr-mm-setting <?php echo !wpr_fs()->can_use_premium_code() ? 'wpr-mm-pro-setting' : ''; ?>">
175
- <h4><?php esc_html_e('Mobile Sub Render', 'wpr-addons'); ?></h4>
176
- <div>
177
- <select id="wpr_mm_render">
178
- <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
179
- <option value="ajax"><?php esc_html_e('Load with AJAX', 'wpr-addons'); ?></option>
180
- </select>
181
-
182
- <div class="wpr-mm-pro-radio">
183
- <input type="radio" name="mr" checked="checked">
184
- <label>Default</label><br>
185
- <input type="radio" name="mr">
186
- <label>Load with AJAX</label>
187
- </div>
188
- </div>
189
- </div>
190
-
191
- <br>
192
-
193
- <h4 <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-heading"' : ''; ?>>
194
- <?php esc_html_e('Icon', 'wpr-addons'); ?>
195
- </h4>
196
- <div <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-section"' : ''; ?>>
197
- <div class="wpr-mm-setting wpr-mm-setting-icon">
198
- <h4><?php esc_html_e('Icon Select', 'wpr-addons'); ?></h4>
199
- <div><span class="wpr-mm-active-icon"><i class="fas fa-ban"></i></span><span><i class="fas fa-angle-down"></i></span></div>
200
- <input type="text" id="wpr_mm_icon_picker" data-alpha="true" value="">
201
- </div>
202
- <div class="wpr-mm-setting wpr-mm-setting-color">
203
- <h4><?php esc_html_e('Icon Color', 'wpr-addons'); ?></h4>
204
- <input type="text" id="wpr_mm_icon_color" data-alpha="true" value="rgba(0,0,0,0.6);">
205
- </div>
206
- <div class="wpr-mm-setting">
207
- <h4><?php esc_html_e('Icon Size (px)', 'wpr-addons'); ?></h4>
208
- <input type="number" id="wpr_mm_icon_size" value="14">
209
- </div>
210
- </div>
211
-
212
- <br>
213
-
214
- <h4 <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-heading"' : ''; ?>>
215
- <?php esc_html_e('Badge', 'wpr-addons'); ?>
216
- </h4>
217
- <div <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-section"' : ''; ?>>
218
- <div class="wpr-mm-setting">
219
- <h4><?php esc_html_e('Badge Text', 'wpr-addons'); ?></h4>
220
- <input type="text" id="wpr_mm_badge_text" value="">
221
- </div>
222
- <div class="wpr-mm-setting wpr-mm-setting-color">
223
- <h4><?php esc_html_e('Badge Text Color', 'wpr-addons'); ?></h4>
224
- <input type="text" id="wpr_mm_badge_color" data-alpha="true" value="rgba(0,0,0,0.6);">
225
- </div>
226
- <div class="wpr-mm-setting wpr-mm-setting-color">
227
- <h4><?php esc_html_e('Badge Background Color', 'wpr-addons'); ?></h4>
228
- <input type="text" id="wpr_mm_badge_bg_color" data-alpha="true" value="rgba(0,0,0,0.6);">
229
- </div>
230
- <div class="wpr-mm-setting wpr-mm-setting-switcher">
231
- <h4><?php esc_html_e('Enable Animation', 'wpr-addons'); ?></h4>
232
- <input type="checkbox" id="wpr_mm_badge_animation">
233
- <label for="wpr_mm_badge_animation"></label>
234
- </div>
235
- </div>
236
- </div>
237
-
238
- <div class="wpr-mm-settings-popup-footer">
239
- <button class="button wpr-save-mega-menu-btn"><?php esc_html_e('Save', 'wpr-addons'); ?></button>
240
- </div>
241
- </div>
242
- </div>
243
-
244
- <!-- Iframe Popup -->
245
- <div class="wpr-mm-editor-popup-wrap">
246
- <div class="wpr-mm-editor-close-popup-btn"><span class="dashicons dashicons-no-alt"></span></div>
247
- <div class="wpr-mm-editor-popup-iframe"></div>
248
- </div>
249
- <?php
250
- }
251
-
252
- // Save Mega Menu Settings
253
- function wpr_save_mega_menu_settings() {
254
- if ( isset($_POST['item_settings']) ) {
255
- update_post_meta( $_POST['item_id'], 'wpr-mega-menu-settings', $_POST['item_settings'] );
256
- }
257
-
258
- wp_send_json_success($_POST['item_settings']);
259
- }
260
-
261
- // Get Menu Items Data
262
- function get_menu_items_data( $menu_id = false ) {
263
-
264
- if ( ! $menu_id ) {
265
- return false;
266
- }
267
-
268
- $menu = wp_get_nav_menu_object( $menu_id );
269
-
270
- $menu_items = wp_get_nav_menu_items( $menu );
271
-
272
- if ( ! $menu_items ) {
273
- return false;
274
- }
275
-
276
- return $menu_items;
277
- }
278
-
279
- // Get Mega Menu Item Settings
280
- function get_menu_items_settings() {
281
- $menu_items = get_menu_items_data( get_selected_menu_id() );
282
-
283
- $settings = [];
284
-
285
- if ( ! $menu_items ) {
286
- return [];
287
- } else {
288
- foreach ( $menu_items as $key => $item_object ) {
289
- $item_id = $item_object->ID;
290
-
291
- $item_meta = get_post_meta( $item_id, 'wpr-mega-menu-settings', true );
292
-
293
- if ( !empty($item_meta) ) {
294
- $settings[ $item_id ] = $item_meta;
295
- } else {
296
- $settings[ $item_id ] = [];
297
- }
298
- }
299
-
300
- return $settings;
301
- }
302
- }
303
-
304
- /**
305
- * Get the Selected menu ID
306
- * @author Tom Hemsley (https://wordpress.org/plugins/megamenu/)
307
- */
308
- function get_selected_menu_id() {
309
- $nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
310
- $menu_count = count( $nav_menus );
311
- $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
312
- $add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;
313
-
314
- $current_menu_id = $nav_menu_selected_id;
315
-
316
- // If we have one theme location, and zero menus, we take them right into editing their first menu
317
- $page_count = wp_count_posts( 'page' );
318
- $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
319
-
320
- // Get recently edited nav menu
321
- $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) );
322
- if ( empty( $recently_edited ) && is_nav_menu( $current_menu_id ) ) {
323
- $recently_edited = $current_menu_id;
324
- }
325
-
326
- // Use $recently_edited if none are selected
327
- if ( empty( $current_menu_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) {
328
- $current_menu_id = $recently_edited;
329
- }
330
-
331
- // On deletion of menu, if another menu exists, show it
332
- if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) {
333
- $current_menu_id = $nav_menus[0]->term_id;
334
- }
335
-
336
- // Set $current_menu_id to 0 if no menus
337
- if ( $one_theme_location_no_menus ) {
338
- $current_menu_id = 0;
339
- } elseif ( empty( $current_menu_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) {
340
- // if we have no selection yet, and we have menus, set to the first one in the list
341
- $current_menu_id = $nav_menus[0]->term_id;
342
- }
343
-
344
- return $current_menu_id;
345
-
346
- }
347
-
348
- // Enqueue Scripts and Styles
349
- function enqueue_scripts( $hook ) {
350
-
351
- // Get Plugin Version
352
- $version = Plugin::instance()->get_version();
353
-
354
- // Deny if NOT a Menu Page
355
- if ( 'nav-menus.php' == $hook ) {
356
-
357
- // Color Picker
358
- wp_enqueue_style( 'wp-color-picker' );
359
- wp_enqueue_script( 'wp-color-picker-alpha', WPR_ADDONS_URL .'assets/js/admin/lib/wp-color-picker-alpha.min.js', ['jquery', 'wp-color-picker'], $version, true );
360
-
361
- // Icon Picker
362
- wp_enqueue_script( 'wpr-iconpicker-js', WPR_ADDONS_URL .'assets/js/admin/lib/iconpicker/fontawesome-iconpicker.min.js', ['jquery'], $version, true );
363
- wp_enqueue_style( 'wpr-iconpicker-css', WPR_ADDONS_URL .'assets/js/admin/lib/iconpicker/fontawesome-iconpicker.min.css', $version, true );
364
- wp_enqueue_style( 'wpr-el-fontawesome-css', ELEMENTOR_URL .'assets/lib/font-awesome/css/all.min.css', [], $version );
365
-
366
- // enqueue CSS
367
- wp_enqueue_style( 'wpr-mega-menu-css', WPR_ADDONS_URL .'assets/css/admin/mega-menu.css', [], $version );
368
-
369
- // enqueue JS
370
- wp_enqueue_script( 'wpr-mega-menu-js', WPR_ADDONS_URL .'assets/js/admin/mega-menu.js', ['jquery'], $version );
371
-
372
- wp_localize_script( 'wpr-mega-menu-js', 'WprMegaMenuSettingsData', get_menu_items_settings() );
373
-
374
- }
375
-
376
  }
1
+ <?php
2
+ use WprAddons\Plugin;
3
+
4
+ // Register Post Type
5
+ function register_mega_menu_cpt() {
6
+ $args = array(
7
+ 'label' => esc_html__( 'Royal Mega Menu', 'wpr-addons' ),
8
+ 'public' => true,
9
+ 'publicly_queryable' => true,
10
+ 'rewrite' => false,
11
+ 'show_ui' => true,
12
+ 'show_in_menu' => false,
13
+ 'show_in_nav_menus' => false,
14
+ 'exclude_from_search' => true,
15
+ 'capability_type' => 'post',
16
+ 'supports' => array( 'title', 'editor', 'elementor' ),
17
+ 'hierarchical' => false,
18
+ );
19
+
20
+ register_post_type( 'wpr_mega_menu', $args );
21
+ }
22
+
23
+ // Convert to Canvas Template
24
+ function convert_to_canvas_template( $template ) {
25
+ if ( is_singular('wpr_mega_menu') ) {
26
+ $template = WPR_ADDONS_PATH . 'admin/templates/wpr-canvas.php';
27
+ }
28
+
29
+ return $template;
30
+ }
31
+
32
+ // Init Mega Menu
33
+ function init_mega_menu() {
34
+ register_mega_menu_cpt();
35
+ add_action( 'template_include', 'convert_to_canvas_template', 9999 );
36
+ }
37
+
38
+ add_action('init', 'init_mega_menu', 999);
39
+
40
+
41
+ // Confinue only for Dashboard Screen
42
+ if ( !is_admin() ) return;
43
+
44
+ // Init Actions
45
+ add_filter( 'option_elementor_cpt_support', 'add_mega_menu_cpt_support' );
46
+ add_filter( 'default_option_elementor_cpt_support', 'add_mega_menu_cpt_support' );
47
+ add_action( 'admin_footer', 'render_settings_popup', 10 );
48
+ add_action( 'wp_ajax_wpr_create_mega_menu_template', 'wpr_create_mega_menu_template' );
49
+ add_action( 'wp_ajax_wpr_save_mega_menu_settings', 'wpr_save_mega_menu_settings' );
50
+ add_action( 'admin_enqueue_scripts', 'enqueue_scripts' );
51
+
52
+ // Add Elementor Editor Support
53
+ function add_mega_menu_cpt_support( $value ) {
54
+ if ( empty( $value ) ) {
55
+ $value = [];
56
+ }
57
+
58
+ return array_merge( $value, ['wpr_mega_menu'] );
59
+ }
60
+
61
+ // Create Menu Template
62
+ function wpr_create_mega_menu_template() {
63
+ if ( ! current_user_can( 'manage_options' ) ) {
64
+ return;
65
+ }
66
+
67
+ // $menu_id = intval( $_REQUEST['menu'] );
68
+ // $menu_item_id = intval( $_REQUEST['item'] );
69
+ $menu_item_id = intval( $_POST['item_id'] );
70
+ $mega_menu_id = get_post_meta( $menu_item_id, 'wpr-mega-menu-item', true );
71
+
72
+ if ( ! $mega_menu_id ) {
73
+
74
+ $mega_menu_id = wp_insert_post( array(
75
+ 'post_title' => 'wpr-mega-menu-item-' . $menu_item_id,
76
+ 'post_status' => 'publish',
77
+ 'post_type' => 'wpr_mega_menu',
78
+ ) );
79
+
80
+ update_post_meta( $menu_item_id, 'wpr-mega-menu-item', $mega_menu_id );
81
+
82
+ }
83
+
84
+ $edit_link = add_query_arg(
85
+ array(
86
+ 'post' => $mega_menu_id,
87
+ 'action' => 'elementor',
88
+ ),
89
+ admin_url( 'post.php' )
90
+ );
91
+
92
+ wp_send_json([
93
+ 'data' => [
94
+ 'edit_link' => $edit_link
95
+ ]
96
+ ]);
97
+ }
98
+
99
+ // Render Settings Popup
100
+ function render_settings_popup() {
101
+ $screen = get_current_screen();
102
+
103
+ if ( 'nav-menus' !== $screen->base ) {
104
+ return;
105
+ }
106
+
107
+ ?>
108
+
109
+ <div class="wpr-mm-settings-popup-wrap">
110
+ <div class="wpr-mm-settings-popup">
111
+ <div class="wpr-mm-settings-popup-header">
112
+ <span class="wpr-mm-popup-logo" style="background:url('<?php echo WPR_ADDONS_ASSETS_URL .'img/logo-40x40.png'; ?>') no-repeat center center / contain;">RE</span>
113
+ <span><?php esc_html_e('Royal Mega Menu', 'wpr-addons'); ?></span>
114
+ <span class="wpr-mm-popup-title"><?php esc_html_e('Menu Item: ', 'wpr-addons'); ?><span></span></span>
115
+ <span class="dashicons dashicons-no-alt wpr-mm-settings-close-popup-btn"></span>
116
+ </div>
117
+
118
+ <?php $pro_active = wpr_fs()->can_use_premium_code() ? 'data-pro-active="true"' : 'data-pro-active="false"'; ?>
119
+
120
+ <div class="wpr-mm-settings-wrap" <?php echo $pro_active; ?>>
121
+ <h4><?php esc_html_e('General', 'wpr-addons'); ?></h4>
122
+ <div class="wpr-mm-setting wpr-mm-setting-switcher">
123
+ <h4><?php esc_html_e('Enable Mega Menu', 'wpr-addons'); ?></h4>
124
+ <input type="checkbox" id="wpr_mm_enable">
125
+ <label for="wpr_mm_enable"></label>
126
+ </div>
127
+ <div class="wpr-mm-setting">
128
+ <h4><?php esc_html_e('Mega Menu Content', 'wpr-addons'); ?></h4>
129
+ <button class="button button-primary wpr-edit-mega-menu-btn">
130
+ <i class="eicon-elementor-square" aria-hidden="true"></i>
131
+ <?php esc_html_e('Edit with Elementor', 'wpr-addons'); ?>
132
+ </button>
133
+ </div>
134
+ <div class="wpr-mm-setting">
135
+ <h4><?php esc_html_e('Dropdown Position', 'wpr-addons'); ?></h4>
136
+ <select id="wpr_mm_position">
137
+ <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
138
+ <option value="relative"><?php esc_html_e('Relative', 'wpr-addons'); ?></option>
139
+ </select>
140
+ </div>
141
+ <div class="wpr-mm-setting">
142
+ <h4><?php esc_html_e('Dropdown Width', 'wpr-addons'); ?></h4>
143
+ <select id="wpr_mm_width">
144
+ <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
145
+ <?php if ( ! wpr_fs()->can_use_premium_code() ) : ?>
146
+ <option value="pro-st"><?php esc_html_e('Fit to Section (Pro)', 'wpr-addons'); ?></option>
147
+ <?php else: ?>
148
+ <option value="stretch"><?php esc_html_e('Fit to Section', 'wpr-addons'); ?></option>
149
+ <?php endif; ?>
150
+ <option value="full"><?php esc_html_e('Full Width', 'wpr-addons'); ?></option>
151
+ <option value="custom"><?php esc_html_e('Custom', 'wpr-addons'); ?></option>
152
+ </select>
153
+ </div>
154
+ <div class="wpr-mm-setting">
155
+ <h4><?php esc_html_e('Custom Width (px)', 'wpr-addons'); ?></h4>
156
+ <input type="number" id="wpr_mm_custom_width" value="600">
157
+ </div>
158
+ <div class="wpr-mm-setting <?php echo !wpr_fs()->can_use_premium_code() ? 'wpr-mm-pro-setting' : ''; ?>">
159
+ <h4><?php esc_html_e('Mobile Sub Content', 'wpr-addons'); ?></h4>
160
+ <div>
161
+ <select id="wpr_mm_mobile_content">
162
+ <option value="mega"><?php esc_html_e('Mega Menu', 'wpr-addons'); ?></option>
163
+ <option value="wp-sub"><?php esc_html_e('WordPress Sub Items', 'wpr-addons'); ?></option>
164
+ </select>
165
+
166
+ <div class="wpr-mm-pro-radio">
167
+ <input type="radio" name="mc" checked="checked">
168
+ <label>Mega Menu</label><br>
169
+ <input type="radio" name="mc">
170
+ <label>WordPress Sub Items</label>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ <div class="wpr-mm-setting <?php echo !wpr_fs()->can_use_premium_code() ? 'wpr-mm-pro-setting' : ''; ?>">
175
+ <h4><?php esc_html_e('Mobile Sub Render', 'wpr-addons'); ?></h4>
176
+ <div>
177
+ <select id="wpr_mm_render">
178
+ <option value="default"><?php esc_html_e('Default', 'wpr-addons'); ?></option>
179
+ <option value="ajax"><?php esc_html_e('Load with AJAX', 'wpr-addons'); ?></option>
180
+ </select>
181
+
182
+ <div class="wpr-mm-pro-radio">
183
+ <input type="radio" name="mr" checked="checked">
184
+ <label>Default</label><br>
185
+ <input type="radio" name="mr">
186
+ <label>Load with AJAX</label>
187
+ </div>
188
+ </div>
189
+ </div>
190
+
191
+ <br>
192
+
193
+ <h4 <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-heading"' : ''; ?>>
194
+ <?php esc_html_e('Icon', 'wpr-addons'); ?>
195
+ </h4>
196
+ <div <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-section"' : ''; ?>>
197
+ <div class="wpr-mm-setting wpr-mm-setting-icon">
198
+ <h4><?php esc_html_e('Icon Select', 'wpr-addons'); ?></h4>
199
+ <div><span class="wpr-mm-active-icon"><i class="fas fa-ban"></i></span><span><i class="fas fa-angle-down"></i></span></div>
200
+ <input type="text" id="wpr_mm_icon_picker" data-alpha="true" value="">
201
+ </div>
202
+ <div class="wpr-mm-setting wpr-mm-setting-color">
203
+ <h4><?php esc_html_e('Icon Color', 'wpr-addons'); ?></h4>
204
+ <input type="text" id="wpr_mm_icon_color" data-alpha="true" value="rgba(0,0,0,0.6);">
205
+ </div>
206
+ <div class="wpr-mm-setting">
207
+ <h4><?php esc_html_e('Icon Size (px)', 'wpr-addons'); ?></h4>
208
+ <input type="number" id="wpr_mm_icon_size" value="14">
209
+ </div>
210
+ </div>
211
+
212
+ <br>
213
+
214
+ <h4 <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-heading"' : ''; ?>>
215
+ <?php esc_html_e('Badge', 'wpr-addons'); ?>
216
+ </h4>
217
+ <div <?php echo !wpr_fs()->can_use_premium_code() ? 'class="wpr-mm-pro-section"' : ''; ?>>
218
+ <div class="wpr-mm-setting">
219
+ <h4><?php esc_html_e('Badge Text', 'wpr-addons'); ?></h4>
220
+ <input type="text" id="wpr_mm_badge_text" value="">
221
+ </div>
222
+ <div class="wpr-mm-setting wpr-mm-setting-color">
223
+ <h4><?php esc_html_e('Badge Text Color', 'wpr-addons'); ?></h4>
224
+ <input type="text" id="wpr_mm_badge_color" data-alpha="true" value="rgba(0,0,0,0.6);">
225
+ </div>
226
+ <div class="wpr-mm-setting wpr-mm-setting-color">
227
+ <h4><?php esc_html_e('Badge Background Color', 'wpr-addons'); ?></h4>
228
+ <input type="text" id="wpr_mm_badge_bg_color" data-alpha="true" value="rgba(0,0,0,0.6);">
229
+ </div>
230
+ <div class="wpr-mm-setting wpr-mm-setting-switcher">
231
+ <h4><?php esc_html_e('Enable Animation', 'wpr-addons'); ?></h4>
232
+ <input type="checkbox" id="wpr_mm_badge_animation">
233
+ <label for="wpr_mm_badge_animation"></label>
234
+ </div>
235
+ </div>
236
+ </div>
237
+
238
+ <div class="wpr-mm-settings-popup-footer">
239
+ <button class="button wpr-save-mega-menu-btn"><?php esc_html_e('Save', 'wpr-addons'); ?></button>
240
+ </div>
241
+ </div>
242
+ </div>
243
+
244
+ <!-- Iframe Popup -->
245
+ <div class="wpr-mm-editor-popup-wrap">
246
+ <div class="wpr-mm-editor-close-popup-btn"><span class="dashicons dashicons-no-alt"></span></div>
247
+ <div class="wpr-mm-editor-popup-iframe"></div>
248
+ </div>
249
+ <?php
250
+ }
251
+
252
+ // Save Mega Menu Settings
253
+ function wpr_save_mega_menu_settings() {
254
+ if ( isset($_POST['item_settings']) ) {
255
+ update_post_meta( $_POST['item_id'], 'wpr-mega-menu-settings', $_POST['item_settings'] );
256
+ }
257
+
258
+ wp_send_json_success($_POST['item_settings']);
259
+ }
260
+
261
+ // Get Menu Items Data
262
+ function get_menu_items_data( $menu_id = false ) {
263
+
264
+ if ( ! $menu_id ) {
265
+ return false;
266
+ }
267
+
268
+ $menu = wp_get_nav_menu_object( $menu_id );
269
+
270
+ $menu_items = wp_get_nav_menu_items( $menu );
271
+
272
+ if ( ! $menu_items ) {
273
+ return false;
274
+ }
275
+
276
+ return $menu_items;
277
+ }
278
+
279
+ // Get Mega Menu Item Settings
280
+ function get_menu_items_settings() {
281
+ $menu_items = get_menu_items_data( get_selected_menu_id() );
282
+
283
+ $settings = [];
284
+
285
+ if ( ! $menu_items ) {
286
+ return [];
287
+ } else {
288
+ foreach ( $menu_items as $key => $item_object ) {
289
+ $item_id = $item_object->ID;
290
+
291
+ $item_meta = get_post_meta( $item_id, 'wpr-mega-menu-settings', true );
292
+
293
+ if ( !empty($item_meta) ) {
294
+ $settings[ $item_id ] = $item_meta;
295
+ } else {
296
+ $settings[ $item_id ] = [];
297
+ }
298
+ }
299
+
300
+ return $settings;
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Get the Selected menu ID
306
+ * @author Tom Hemsley (https://wordpress.org/plugins/megamenu/)
307
+ */
308
+ function get_selected_menu_id() {
309
+ $nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
310
+ $menu_count = count( $nav_menus );
311
+ $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
312
+ $add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;
313
+
314
+ $current_menu_id = $nav_menu_selected_id;
315
+
316
+ // If we have one theme location, and zero menus, we take them right into editing their first menu
317
+ $page_count = wp_count_posts( 'page' );
318
+ $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
319
+
320
+ // Get recently edited nav menu
321
+ $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) );
322
+ if ( empty( $recently_edited ) && is_nav_menu( $current_menu_id ) ) {
323
+ $recently_edited = $current_menu_id;
324
+ }
325
+
326
+ // Use $recently_edited if none are selected
327
+ if ( empty( $current_menu_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) {
328
+ $current_menu_id = $recently_edited;
329
+ }
330
+
331
+ // On deletion of menu, if another menu exists, show it
332
+ if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) {
333
+ $current_menu_id = $nav_menus[0]->term_id;
334
+ }
335
+
336
+ // Set $current_menu_id to 0 if no menus
337
+ if ( $one_theme_location_no_menus ) {
338
+ $current_menu_id = 0;
339
+ } elseif ( empty( $current_menu_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) {
340
+ // if we have no selection yet, and we have menus, set to the first one in the list
341
+ $current_menu_id = $nav_menus[0]->term_id;
342
+ }
343
+
344
+ return $current_menu_id;
345
+
346
+ }
347
+
348
+ // Enqueue Scripts and Styles
349
+ function enqueue_scripts( $hook ) {
350
+
351
+ // Get Plugin Version
352
+ $version = Plugin::instance()->get_version();
353
+
354
+ // Deny if NOT a Menu Page
355
+ if ( 'nav-menus.php' == $hook ) {
356
+
357
+ // Color Picker
358
+ wp_enqueue_style( 'wp-color-picker' );
359
+ wp_enqueue_script( 'wp-color-picker-alpha', WPR_ADDONS_URL .'assets/js/admin/lib/wp-color-picker-alpha.min.js', ['jquery', 'wp-color-picker'], $version, true );
360
+
361
+ // Icon Picker
362
+ wp_enqueue_script( 'wpr-iconpicker-js', WPR_ADDONS_URL .'assets/js/admin/lib/iconpicker/fontawesome-iconpicker.min.js', ['jquery'], $version, true );
363
+ wp_enqueue_style( 'wpr-iconpicker-css', WPR_ADDONS_URL .'assets/js/admin/lib/iconpicker/fontawesome-iconpicker.min.css', $version, true );
364
+ wp_enqueue_style( 'wpr-el-fontawesome-css', ELEMENTOR_URL .'assets/lib/font-awesome/css/all.min.css', [], $version );
365
+
366
+ // enqueue CSS
367
+ wp_enqueue_style( 'wpr-mega-menu-css', WPR_ADDONS_URL .'assets/css/admin/mega-menu.css', [], $version );
368
+
369
+ // enqueue JS
370
+ wp_enqueue_script( 'wpr-mega-menu-js', WPR_ADDONS_URL .'assets/js/admin/mega-menu.js', ['jquery'], $version );
371
+
372
+ wp_localize_script( 'wpr-mega-menu-js', 'WprMegaMenuSettingsData', get_menu_items_settings() );
373
+
374
+ }
375
+
376
  }
admin/plugin-options.php CHANGED
@@ -1,571 +1,571 @@
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 WprAddonsPro\Admin\Wpr_White_Label;
9
- use WprAddons\Classes\Utilities;
10
-
11
- // Register Menus
12
- function wpr_addons_add_admin_menu() {
13
- $menu_icon = !empty(get_option('wpr_wl_plugin_logo')) ? 'dashicons-admin-generic' : 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTciIGhlaWdodD0iNzUiIHZpZXdCb3g9IjAgMCA5NyA3NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuMDM2NDA4NiAyMy4yODlDLTAuNTc1NDkgMTguNTIxIDYuNjg4NzMgMTYuMzY2NiA5LjU0OSAyMC40Njc4TDQyLjgzNjUgNjguMTk3MkM0NC45MTgxIDcxLjE4MiA0Mi40NDk0IDc1IDM4LjQzNzggNzVIMTEuMjc1NkM4LjY1NDc1IDc1IDYuNDUyNjQgNzMuMjg1NSA2LjE2MTcgNzEuMDE4NEwwLjAzNjQwODYgMjMuMjg5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTk2Ljk2MzYgMjMuMjg5Qzk3LjU3NTUgMTguNTIxIDkwLjMxMTMgMTYuMzY2NiA4Ny40NTEgMjAuNDY3OEw1NC4xNjM1IDY4LjE5NzJDNTIuMDgxOCA3MS4xODIgNTQuNTUwNiA3NSA1OC41NjIyIDc1SDg1LjcyNDRDODguMzQ1MiA3NSA5MC41NDc0IDczLjI4NTUgOTAuODM4MyA3MS4wMTg0TDk2Ljk2MzYgMjMuMjg5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTUzLjI0MTIgNC40ODUyN0M1My4yNDEyIC0wLjI3MDc2MSA0NS44NDg1IC0xLjc0ODAzIDQzLjQ2NTEgMi41MzE3NEw2LjY4OTkxIDY4LjU2NzdDNS4wMzM0OSA3MS41NDIxIDcuNTIyNzIgNzUgMTEuMzIwMyA3NUg0OC4wOTU1QzUwLjkzNzQgNzUgNTMuMjQxMiA3Mi45OTQ4IDUzLjI0MTIgNzAuNTIxMlY0LjQ4NTI3WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTQzLjc1ODggNC40ODUyN0M0My43NTg4IC0wLjI3MDc2MSA1MS4xNTE1IC0xLjc0ODAzIDUzLjUzNDkgMi41MzE3NEw5MC4zMTAxIDY4LjU2NzdDOTEuOTY2NSA3MS41NDIxIDg5LjQ3NzMgNzUgODUuNjc5NyA3NUg0OC45MDQ1QzQ2LjA2MjYgNzUgNDMuNzU4OCA3Mi45OTQ4IDQzLjc1ODggNzAuNTIxMlY0LjQ4NTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==';
14
- add_menu_page( Utilities::get_plugin_name(), Utilities::get_plugin_name(), 'manage_options', 'wpr-addons', 'wpr_addons_settings_page', $menu_icon, '58.6' );
15
-
16
- add_action( 'admin_init', 'wpr_register_addons_settings' );
17
- add_filter( 'plugin_action_links_'. WPR_ADDONS_PLUGIN_BASE, 'wpr_settings_link' );
18
- }
19
- add_action( 'admin_menu', 'wpr_addons_add_admin_menu' );
20
-
21
- // Add Settings page link to plugins screen
22
- function wpr_settings_link( $links ) {
23
- $settings_link = '<a href="admin.php?page=wpr-addons">Settings</a>';
24
- array_push( $links, $settings_link );
25
-
26
- if ( !is_plugin_installed('wpr-addons-pro/wpr-addons-pro.php') ) {
27
- $links[] = '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-wpplugindashboard-upgrade-pro#purchasepro" style="color:#93003c;font-weight:700" target="_blank">' . esc_html__('Go Pro', 'wpr-addons') . '</a>';
28
- }
29
-
30
- return $links;
31
- }
32
-
33
- function is_plugin_installed($file) {
34
- $installed_plugins = [];
35
-
36
- foreach( get_plugins() as $slug => $plugin_info ) {
37
- array_push($installed_plugins, $slug);
38
- }
39
-
40
- if ( in_array($file, $installed_plugins) ) {
41
- return true;
42
- } else {
43
- return false;
44
- }
45
- }
46
-
47
- // Register Settings
48
- function wpr_register_addons_settings() {
49
- // WooCommerce
50
- register_setting( 'wpr-settings', 'wpr_override_woo_templates' );
51
- register_setting( 'wpr-settings', 'wpr_enable_product_image_zoom' );
52
- register_setting( 'wpr-settings', 'wpr_enable_woo_flexslider_navigation' );
53
- register_setting( 'wpr-settings', 'wpr_woo_shop_ppp' );
54
- register_setting( 'wpr-settings', 'wpr_woo_shop_cat_ppp' );
55
- register_setting( 'wpr-settings', 'wpr_woo_shop_tag_ppp' );
56
-
57
- // Integrations
58
- register_setting( 'wpr-settings', 'wpr_google_map_api_key' );
59
- register_setting( 'wpr-settings', 'wpr_mailchimp_api_key' );
60
-
61
- // Lightbox
62
- register_setting( 'wpr-settings', 'wpr_lb_bg_color' );
63
- register_setting( 'wpr-settings', 'wpr_lb_toolbar_color' );
64
- register_setting( 'wpr-settings', 'wpr_lb_caption_color' );
65
- register_setting( 'wpr-settings', 'wpr_lb_gallery_color' );
66
- register_setting( 'wpr-settings', 'wpr_lb_pb_color' );
67
- register_setting( 'wpr-settings', 'wpr_lb_ui_color' );
68
- register_setting( 'wpr-settings', 'wpr_lb_ui_hr_color' );
69
- register_setting( 'wpr-settings', 'wpr_lb_text_color' );
70
- register_setting( 'wpr-settings', 'wpr_lb_icon_size' );
71
- register_setting( 'wpr-settings', 'wpr_lb_arrow_size' );
72
- register_setting( 'wpr-settings', 'wpr_lb_text_size' );
73
-
74
- // White Label
75
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_logo' );
76
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_name' );
77
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_desc' );
78
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_author' );
79
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_website' );
80
- register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_links' );
81
- register_setting( 'wpr-wh-settings', 'wpr_wl_hide_elements_tab' );
82
- register_setting( 'wpr-wh-settings', 'wpr_wl_hide_extensions_tab' );
83
- register_setting( 'wpr-wh-settings', 'wpr_wl_hide_settings_tab' );
84
- register_setting( 'wpr-wh-settings', 'wpr_wl_hide_white_label_tab' );
85
-
86
- // Extensions
87
- register_setting('wpr-extension-settings', 'wpr-particles');
88
- register_setting('wpr-extension-settings', 'wpr-parallax-background');
89
- register_setting('wpr-extension-settings', 'wpr-parallax-multi-layer');
90
- register_setting('wpr-extension-settings', 'wpr-sticky-section');
91
-
92
- // Element Toggle
93
- register_setting( 'wpr-elements-settings', 'wpr-element-toggle-all', [ 'default' => 'on' ] );
94
-
95
- // Widgets
96
- foreach ( Utilities::get_registered_modules() as $title => $data ) {
97
- $slug = $data[0];
98
- register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
99
- }
100
-
101
- // Theme Builder
102
- foreach ( Utilities::get_theme_builder_modules() as $title => $data ) {
103
- $slug = $data[0];
104
- register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
105
- }
106
-
107
-
108
- // WooCommerce Builder
109
- foreach ( Utilities::get_woocommerce_builder_modules() as $title => $data ) {
110
- $slug = $data[0];
111
- register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
112
- }
113
-
114
- }
115
-
116
- function wpr_addons_settings_page() {
117
-
118
- ?>
119
-
120
- <div class="wrap wpr-settings-page-wrap">
121
-
122
- <div class="wpr-settings-page-header">
123
- <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
124
- <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
125
-
126
- <?php if ( empty(get_option('wpr_wl_plugin_links')) ) : ?>
127
- <div class="wpr-preview-buttons">
128
- <a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-plugin-prev-btn#widgets" target="_blank" class="button wpr-options-button">
129
- <span><?php echo esc_html__( 'View Plugin Demo', 'wpr-addons' ); ?></span>
130
- <span class="dashicons dashicons-external"></span>
131
- </a>
132
-
133
- <a href="https://www.youtube.com/watch?v=rkYQfn3tUc0" class="wpr-options-button button" target="_blank">
134
- <?php echo esc_html__( 'How to use Widgets', 'wpr-addons' ); ?>
135
- <span class="dashicons dashicons-video-alt3"></span>
136
- </a>
137
-
138
- <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank">
139
- <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
140
- <span class="dashicons dashicons-star-empty"></span>
141
- </a>
142
- </div>
143
- <?php endif; ?>
144
- </div>
145
-
146
- <div class="wpr-settings-page">
147
- <form method="post" action="options.php">
148
- <?php
149
-
150
- // Active Tab
151
- if ( empty(get_option('wpr_wl_hide_elements_tab')) ) {
152
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_elements';
153
- } elseif ( empty(get_option('wpr_wl_hide_extensions_tab')) ) {
154
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_extensions';
155
- } elseif ( empty(get_option('wpr_wl_hide_settings_tab')) ) {
156
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_settings';
157
- } elseif ( empty(get_option('wpr_wl_hide_white_label_tab')) ) {
158
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_white_label';
159
- }
160
-
161
-
162
- // Render Create Templte Popup
163
- WPR_Templates_Loop::render_create_template_popup();
164
-
165
- ?>
166
-
167
- <!-- Tabs -->
168
- <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
169
- <?php if ( empty(get_option('wpr_wl_hide_elements_tab')) ) : ?>
170
- <a href="?page=wpr-addons&tab=wpr_tab_elements" data-title="Elements" class="nav-tab <?php echo ($active_tab == 'wpr_tab_elements') ? 'nav-tab-active' : ''; ?>">
171
- <?php esc_html_e( 'Widgets', 'wpr-addons' ); ?>
172
- </a>
173
- <?php endif; ?>
174
-
175
- <?php if ( empty(get_option('wpr_wl_hide_extensions_tab')) ) : ?>
176
- <a href="?page=wpr-addons&tab=wpr_tab_extensions" data-title="Extensions" class="nav-tab <?php echo ($active_tab == 'wpr_tab_extensions') ? 'nav-tab-active' : ''; ?>">
177
- <?php esc_html_e( 'Extensions', 'wpr-addons' ); ?>
178
- </a>
179
- <?php endif; ?>
180
-
181
- <?php if ( empty(get_option('wpr_wl_hide_settings_tab')) ) : ?>
182
- <a href="?page=wpr-addons&tab=wpr_tab_settings" data-title="Settings" class="nav-tab <?php echo ($active_tab == 'wpr_tab_settings') ? 'nav-tab-active' : ''; ?>">
183
- <?php esc_html_e( 'Settings', 'wpr-addons' ); ?>
184
- </a>
185
- <?php endif; ?>
186
-
187
- <?php // White Label
188
- echo !empty(get_option('wpr_wl_hide_white_label_tab')) ? '<div style="display: none;">' : '<div>';
189
- do_action('wpr_white_label_tab');
190
- echo '</div>';
191
- ?>
192
- </div>
193
-
194
- <?php if ( $active_tab == 'wpr_tab_elements' ) : ?>
195
-
196
- <?php
197
-
198
- // Settings
199
- settings_fields( 'wpr-elements-settings' );
200
- do_settings_sections( 'wpr-elements-settings' );
201
-
202
- ?>
203
-
204
- <div class="wpr-elements-toggle">
205
- <div>
206
- <h3><?php esc_html_e( 'Toggle all Widgets', 'wpr-addons' ); ?></h3>
207
- <input type="checkbox" name="wpr-element-toggle-all" id="wpr-element-toggle-all" <?php checked( get_option('wpr-element-toggle-all', 'on'), 'on', true ); ?>>
208
- <label for="wpr-element-toggle-all"></label>
209
- </div>
210
- <p><?php esc_html_e( 'You can disable some widgets for faster page speed.', 'wpr-addons' ); ?></p>
211
- </div>
212
- <div class="wpr-elements">
213
- <?php
214
- foreach ( Utilities::get_registered_modules() as $title => $data ) {
215
- $slug = $data[0];
216
- $url = $data[1];
217
- $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
218
- $class = 'new' === $data[3] ? ' wpr-new-element' : '';
219
-
220
- echo '<div class="wpr-element'. esc_attr($class) .'">';
221
- echo '<div class="wpr-element-info">';
222
- echo '<h3>'. esc_html($title) .'</h3>';
223
- echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
224
- echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
225
- echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
226
- echo '</div>';
227
- echo '</div>';
228
- }
229
- ?>
230
- </div>
231
-
232
- <div class="wpr-elements-heading">
233
- <h3><?php esc_html_e( 'Theme Builder Widgets', 'wpr-addons' ); ?></h3>
234
- <p><?php esc_html_e( 'Post (CPT) Archive Pages, Post (CPT) Single Pages', 'wpr-addons' ); ?></p>
235
- </div>
236
- <div class="wpr-elements">
237
- <?php
238
- foreach ( Utilities::get_theme_builder_modules() as $title => $data ) {
239
- $slug = $data[0];
240
- $url = $data[1];
241
- $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
242
- $class = 'new' === $data[3] ? ' wpr-new-element' : '';
243
-
244
- echo '<div class="wpr-element'. esc_attr($class) .'">';
245
- echo '<div class="wpr-element-info">';
246
- echo '<h3>'. esc_html($title) .'</h3>';
247
- echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
248
- echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
249
- echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
250
- echo '</div>';
251
- echo '</div>';
252
- }
253
- ?>
254
- </div>
255
-
256
- <div class="wpr-elements-heading">
257
- <h3><?php esc_html_e( 'WooCommerce Builder Widgets', 'wpr-addons' ); ?></h3>
258
- <p><?php esc_html_e( 'Product Archive Pages, Product Single Pages. Cart, Checkout and My Account Pages', 'wpr-addons' ); ?></p>
259
- <?php if (!class_exists('WooCommerce')) : ?>
260
- <p class='wpr-install-activate-woocommerce'><span class="dashicons dashicons-info-outline"></span> <?php esc_html_e( 'Install/Activate WooCommerce to use these widgets', 'wpr-addons' ); ?></p>
261
- <?php endif; ?>
262
- </div>
263
- <div class="wpr-elements">
264
- <?php
265
- $woocommerce_builder_modules = Utilities::get_woocommerce_builder_modules();
266
- $premium_woo_modules = [
267
- 'Product Filters' => ['product-filters-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-prodfilter-widgets-pro#purchasepro', '', 'pro'],
268
- 'Product Breadcrumbs' => ['product-breadcrumbs-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-breadcru-widgets-pro#purchasepro', '', 'pro'],
269
- 'Page My Account' => ['page-my-account-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-myacc-widgets-pro#purchasepro', '', 'pro'],
270
- 'Woo Category Grid' => ['woo-category-grid-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-catgrid-widgets-pro#purchasepro', '', 'pro'],
271
- ];
272
-
273
- foreach ( array_merge($woocommerce_builder_modules, $premium_woo_modules) as $title => $data ) {
274
- $slug = $data[0];
275
- $url = $data[1];
276
- $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[1];
277
- $class = 'new' === $data[3] ? 'wpr-new-element' : '';
278
- $class = ('pro' === $data[3] && !wpr_fs()->can_use_premium_code()) ? 'wpr-pro-element' : '';
279
- $default_value = class_exists( 'WooCommerce' ) ? 'on' : 'off';
280
-
281
- if ( 'wpr-pro-element' === $class ) {
282
- $default_value = 'off';
283
- $reff = '';
284
- }
285
-
286
- echo '<div class="wpr-element '. esc_attr($class) .'">';
287
- echo '<a href="'. esc_url($url . $reff) .'" target="_blank"></a>';
288
- echo '<div class="wpr-element-info">';
289
- echo '<h3>'. esc_html($title) .'</h3>';
290
- echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, $default_value), 'on', false ) .'>';
291
- echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
292
- // echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
293
- echo '</div>';
294
- echo '</div>';
295
- }
296
- ?>
297
- </div>
298
-
299
- <?php submit_button( '', 'wpr-options-button' ); ?>
300
-
301
- <?php elseif ( $active_tab == 'wpr_tab_settings' ) : ?>
302
-
303
- <?php
304
-
305
- // Settings
306
- settings_fields( 'wpr-settings' );
307
- do_settings_sections( 'wpr-settings' );
308
-
309
- ?>
310
-
311
- <div class="wpr-settings">
312
-
313
- <?php submit_button( '', 'wpr-options-button' ); ?>
314
-
315
- <div class="wpr-settings-group wpr-settings-group-woo">
316
- <h3 class="wpr-settings-group-title"><?php esc_html_e( 'WooCommerce', 'wpr-addons' ); ?></h3>
317
-
318
- <div class="wpr-settings-group-inner">
319
-
320
- <?php if ( !wpr_fs()->can_use_premium_code() ) : ?>
321
- <a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-settings-woo-pro#purchasepro" class="wpr-settings-pro-overlay" target="_blank">
322
- <span class="dashicons dashicons-lock"></span>
323
- <span class="dashicons dashicons-unlock"></span>
324
- <span><?php esc_html_e( 'Upgrade to Pro', 'wpr-addons' ); ?></span>
325
- </a>
326
- <div class="wpr-setting">
327
- <h4>
328
- <span><?php esc_html_e( 'Shop Page: Products Per Page', 'wpr-addons' ); ?></span>
329
- <br>
330
- </h4>
331
- <input type="text" value="9">
332
- </div>
333
- <div class="wpr-setting">
334
- <h4>
335
- <span><?php esc_html_e( 'Product Category: Products Per Page', 'wpr-addons' ); ?></span>
336
- <br>
337
- </h4>
338
- <input type="text" value="9">
339
- </div>
340
- <div class="wpr-setting">
341
- <h4>
342
- <span><?php esc_html_e( 'Product Tag: Products Per Page', 'wpr-addons' ); ?></span>
343
- <br>
344
- </h4>
345
- <input type="text" value="9">
346
- </div>
347
- <?php else: ?>
348
- <?php do_action('wpr_woocommerce_settings'); ?>
349
- <?php endif; ?>
350
-
351
- </div>
352
-
353
- <div class="wpr-woo-template-info">
354
- <div class="wpr-woo-template-title">
355
- <h4>Royal Templates</h4>
356
- <span>Enable/Disable Royal addons Cart, Minicart, Notifications Templates, Product Lightbox</span>
357
- </div>
358
- <input type="checkbox" name="wpr_override_woo_templates" id="wpr_override_woo_templates" <?php echo checked( get_option('wpr_override_woo_templates', 'on'), 'on', false ); ?>>
359
- <label for="wpr_override_woo_templates"></label>
360
- </div>
361
-
362
- <div class="wpr-woo-template-info">
363
- <div class="wpr-woo-template-title">
364
- <h4>Product Image Zoom</h4>
365
- <span>Enable/Disable Image Zoom Effect on Woocommerce products</span>
366
- </div>
367
- <input type="checkbox" name="wpr_enable_product_image_zoom" id="wpr_enable_product_image_zoom" <?php echo checked( get_option('wpr_enable_product_image_zoom', 'on'), 'on', false ); ?>>
368
- <label for="wpr_enable_product_image_zoom"></label>
369
- </div>
370
-
371
- <div class="wpr-woo-template-info">
372
- <div class="wpr-woo-template-title">
373
- <h4>Product Slider Nav</h4>
374
- <span>Enable/Disable Navigation Arrows on Woocommerce products slider</span>
375
- </div>
376
- <input type="checkbox" name="wpr_enable_woo_flexslider_navigation" id="wpr_enable_woo_flexslider_navigation" <?php echo checked( get_option('wpr_enable_woo_flexslider_navigation', 'on'), 'on', false ); ?>>
377
- <label for="wpr_enable_woo_flexslider_navigation"></label>
378
- </div>
379
-
380
- </div>
381
-
382
- <div class="wpr-settings-group">
383
- <h3 class="wpr-settings-group-title"><?php esc_html_e( 'Integrations', 'wpr-addons' ); ?></h3>
384
-
385
- <div class="wpr-setting">
386
- <h4>
387
- <span><?php esc_html_e( 'Google Map API Key', 'wpr-addons' ); ?></span>
388
- <br>
389
- <a href="https://www.youtube.com/watch?v=O5cUoVpVUjU" target="_blank"><?php esc_html_e( 'How to get Google Map API Key?', 'wpr-addons' ); ?></a>
390
- </h4>
391
-
392
- <input type="text" name="wpr_google_map_api_key" id="wpr_google_map_api_key" value="<?php echo esc_attr(get_option('wpr_google_map_api_key')); ?>">
393
- </div>
394
-
395
- <div class="wpr-setting">
396
- <h4>
397
- <span><?php esc_html_e( 'MailChimp API Key', 'wpr-addons' ); ?></span>
398
- <br>
399
- <a href="https://mailchimp.com/help/about-api-keys/" target="_blank"><?php esc_html_e( 'How to get MailChimp API Key?', 'wpr-addons' ); ?></a>
400
- </h4>
401
-
402
- <input type="text" name="wpr_mailchimp_api_key" id="wpr_mailchimp_api_key" value="<?php echo esc_attr(get_option('wpr_mailchimp_api_key')); ?>">
403
- </div>
404
- </div>
405
-
406
- <div class="wpr-settings-group">
407
- <h3 class="wpr-settings-group-title"><?php esc_html_e( 'Lightbox', 'wpr-addons' ); ?></h3>
408
-
409
- <div class="wpr-setting">
410
- <h4><?php esc_html_e( 'Background Color', 'wpr-addons' ); ?></h4>
411
- <input type="text" name="wpr_lb_bg_color" id="wpr_lb_bg_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_bg_color','rgba(0,0,0,0.6)')); ?>">
412
- </div>
413
-
414
- <div class="wpr-setting">
415
- <h4><?php esc_html_e( 'Toolbar BG Color', 'wpr-addons' ); ?></h4>
416
- <input type="text" name="wpr_lb_toolbar_color" id="wpr_lb_toolbar_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_toolbar_color','rgba(0,0,0,0.8)')); ?>">
417
- </div>
418
-
419
- <div class="wpr-setting">
420
- <h4><?php esc_html_e( 'Caption BG Color', 'wpr-addons' ); ?></h4>
421
- <input type="text" name="wpr_lb_caption_color" id="wpr_lb_caption_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_caption_color','rgba(0,0,0,0.8)')); ?>">
422
- </div>
423
-
424
- <div class="wpr-setting">
425
- <h4><?php esc_html_e( 'Gallery BG Color', 'wpr-addons' ); ?></h4>
426
- <input type="text" name="wpr_lb_gallery_color" id="wpr_lb_gallery_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_gallery_color','#444444')); ?>">
427
- </div>
428
-
429
- <div class="wpr-setting">
430
- <h4><?php esc_html_e( 'Progress Bar Color', 'wpr-addons' ); ?></h4>
431
- <input type="text" name="wpr_lb_pb_color" id="wpr_lb_pb_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_pb_color','#a90707')); ?>">
432
- </div>
433
-
434
- <div class="wpr-setting">
435
- <h4><?php esc_html_e( 'UI Color', 'wpr-addons' ); ?></h4>
436
- <input type="text" name="wpr_lb_ui_color" id="wpr_lb_ui_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_ui_color','#efefef')); ?>">
437
- </div>
438
-
439
- <div class="wpr-setting">
440
- <h4><?php esc_html_e( 'UI Hover Color', 'wpr-addons' ); ?></h4>
441
- <input type="text" name="wpr_lb_ui_hr_color" id="wpr_lb_ui_hr_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_ui_hr_color','#ffffff')); ?>">
442
- </div>
443
-
444
- <div class="wpr-setting">
445
- <h4><?php esc_html_e( 'Text Color', 'wpr-addons' ); ?></h4>
446
- <input type="text" name="wpr_lb_text_color" id="wpr_lb_text_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_text_color','#efefef')); ?>">
447
- </div>
448
-
449
- <div class="wpr-setting">
450
- <h4><?php esc_html_e( 'UI Icon Size', 'wpr-addons' ); ?></h4>
451
- <input type="number" name="wpr_lb_icon_size" id="wpr_lb_icon_size" value="<?php echo esc_attr(get_option('wpr_lb_icon_size','20')); ?>">
452
- </div>
453
-
454
- <div class="wpr-setting">
455
- <h4><?php esc_html_e( 'Navigation Arrow Size', 'wpr-addons' ); ?></h4>
456
- <input type="number" name="wpr_lb_arrow_size" id="wpr_lb_arrow_size" value="<?php echo esc_attr(get_option('wpr_lb_arrow_size','35')); ?>">
457
- </div>
458
-
459
- <div class="wpr-setting">
460
- <h4><?php esc_html_e( 'Text Size', 'wpr-addons' ); ?></h4>
461
- <input type="number" name="wpr_lb_text_size" id="wpr_lb_text_size" value="<?php echo esc_attr(get_option('wpr_lb_text_size','14')); ?>">
462
- </div>
463
- </div>
464
-
465
- <?php submit_button( '', 'wpr-options-button' ); ?>
466
-
467
- </div>
468
-
469
- <?php elseif ( $active_tab == 'wpr_tab_extensions' ) :
470
-
471
- // Extensions
472
- settings_fields( 'wpr-extension-settings' );
473
- do_settings_sections( 'wpr-extension-settings' );
474
-
475
- global $new_allowed_options;
476
-
477
- // array of option names
478
- $option_names = $new_allowed_options[ 'wpr-extension-settings' ];
479
-
480
- echo '<div class="wpr-elements">';
481
-
482
- foreach ($option_names as $option_name) {
483
- $option_title = ucwords( preg_replace( '/-/i', ' ', preg_replace('/wpr-||-toggle/i', '', $option_name ) ));
484
-
485
- echo '<div class="wpr-element">';
486
- echo '<div class="wpr-element-info">';
487
- echo '<h3>'. esc_html($option_title) .'</h3>';
488
- echo '<input type="checkbox" name="'. esc_attr($option_name) .'" id="'. esc_attr($option_name) .'" '. checked( get_option(''. $option_name .'', 'on'), 'on', false ) .'>';
489
- echo '<label for="'. esc_attr($option_name) .'"></label>';
490
-
491
- if ( 'wpr-parallax-background' === $option_name ) {
492
- echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
493
- echo '<a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial</a>';
494
- } elseif ( 'wpr-parallax-multi-layer' === $option_name ) {
495
- echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
496
- echo '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial</a>';
497
- } elseif ( 'wpr-particles' === $option_name ) {
498
- echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
499
- echo '<a href="https://www.youtube.com/watch?v=8OdnaoFSj94" target="_blank">Watch Video Tutorial</a>';
500
- } elseif ( 'wpr-sticky-section' === $option_name ) {
501
- echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
502
- echo '<a href="https://www.youtube.com/watch?v=at0CPKtklF0&t=375s" target="_blank">Watch Video Tutorial</a>';
503
- }
504
-
505
- // echo '<a href="https://royal-elementor-addons.com/elementor-particle-effects/?ref=rea-plugin-backend-extentions-prev">'. esc_html('View Extension Demo', 'wpr-addons') .'</a>';
506
- echo '</div>';
507
- echo '</div>';
508
- }
509
-
510
- echo '</div>';
511
-
512
- submit_button( '', 'wpr-options-button' );
513
-
514
- elseif ( $active_tab == 'wpr_tab_white_label' ) :
515
-
516
- do_action('wpr_white_label_tab_content');
517
-
518
- endif; ?>
519
-
520
- </form>
521
- </div>
522
-
523
- </div>
524
-
525
-
526
- <?php
527
-
528
- } // End wpr_addons_settings_page()
529
-
530
-
531
-
532
- // Add Support Sub Menu item that will redirect to wp.org
533
- function wpr_addons_add_support_menu() {
534
- add_submenu_page( 'wpr-addons', 'Support', 'Support', 'manage_options', 'wpr-support', 'wpr_addons_support_page', 99 );
535
- }
536
- add_action( 'admin_menu', 'wpr_addons_add_support_menu', 99 );
537
-
538
- function wpr_addons_support_page() {}
539
-
540
- function wpr_redirect_support_page() {
541
- ?>
542
- <script type="text/javascript">
543
- jQuery(document).ready( function($) {
544
- $( 'ul#adminmenu a[href*="page=wpr-support"]' ).attr('href', 'https://wordpress.org/support/plugin/royal-elementor-addons/').attr( 'target', '_blank' );
545
- });
546
- </script>
547
- <?php
548
- }
549
- add_action( 'admin_head', 'wpr_redirect_support_page' );
550
-
551
-
552
- // Add Upgrade Sub Menu item that will redirect to royal-elementor-addons.com
553
- function wpr_addons_add_upgrade_menu() {
554
- if ( defined('WPR_ADDONS_PRO_VERSION') ) return;
555
- add_submenu_page( 'wpr-addons', 'Upgrade', 'Upgrade', 'manage_options', 'wpr-upgrade', 'wpr_addons_upgrade_page', 99 );
556
- }
557
- add_action( 'admin_menu', 'wpr_addons_add_upgrade_menu', 99 );
558
-
559
- function wpr_addons_upgrade_page() {}
560
-
561
- function wpr_redirect_upgrade_page() {
562
- ?>
563
- <script type="text/javascript">
564
- jQuery(document).ready( function($) {
565
- $( 'ul#adminmenu a[href*="page=wpr-upgrade"]' ).attr('href', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-menu-upgrade-pro#purchasepro').attr( 'target', '_blank' );
566
- $( 'ul#adminmenu a[href*="#purchasepro"]' ).css('color', 'greenyellow');
567
- });
568
- </script>
569
- <?php
570
- }
571
  add_action( 'admin_head', 'wpr_redirect_upgrade_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 WprAddonsPro\Admin\Wpr_White_Label;
9
+ use WprAddons\Classes\Utilities;
10
+
11
+ // Register Menus
12
+ function wpr_addons_add_admin_menu() {
13
+ $menu_icon = !empty(get_option('wpr_wl_plugin_logo')) ? 'dashicons-admin-generic' : 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTciIGhlaWdodD0iNzUiIHZpZXdCb3g9IjAgMCA5NyA3NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuMDM2NDA4NiAyMy4yODlDLTAuNTc1NDkgMTguNTIxIDYuNjg4NzMgMTYuMzY2NiA5LjU0OSAyMC40Njc4TDQyLjgzNjUgNjguMTk3MkM0NC45MTgxIDcxLjE4MiA0Mi40NDk0IDc1IDM4LjQzNzggNzVIMTEuMjc1NkM4LjY1NDc1IDc1IDYuNDUyNjQgNzMuMjg1NSA2LjE2MTcgNzEuMDE4NEwwLjAzNjQwODYgMjMuMjg5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTk2Ljk2MzYgMjMuMjg5Qzk3LjU3NTUgMTguNTIxIDkwLjMxMTMgMTYuMzY2NiA4Ny40NTEgMjAuNDY3OEw1NC4xNjM1IDY4LjE5NzJDNTIuMDgxOCA3MS4xODIgNTQuNTUwNiA3NSA1OC41NjIyIDc1SDg1LjcyNDRDODguMzQ1MiA3NSA5MC41NDc0IDczLjI4NTUgOTAuODM4MyA3MS4wMTg0TDk2Ljk2MzYgMjMuMjg5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTUzLjI0MTIgNC40ODUyN0M1My4yNDEyIC0wLjI3MDc2MSA0NS44NDg1IC0xLjc0ODAzIDQzLjQ2NTEgMi41MzE3NEw2LjY4OTkxIDY4LjU2NzdDNS4wMzM0OSA3MS41NDIxIDcuNTIyNzIgNzUgMTEuMzIwMyA3NUg0OC4wOTU1QzUwLjkzNzQgNzUgNTMuMjQxMiA3Mi45OTQ4IDUzLjI0MTIgNzAuNTIxMlY0LjQ4NTI3WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTQzLjc1ODggNC40ODUyN0M0My43NTg4IC0wLjI3MDc2MSA1MS4xNTE1IC0xLjc0ODAzIDUzLjUzNDkgMi41MzE3NEw5MC4zMTAxIDY4LjU2NzdDOTEuOTY2NSA3MS41NDIxIDg5LjQ3NzMgNzUgODUuNjc5NyA3NUg0OC45MDQ1QzQ2LjA2MjYgNzUgNDMuNzU4OCA3Mi45OTQ4IDQzLjc1ODggNzAuNTIxMlY0LjQ4NTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==';
14
+ add_menu_page( Utilities::get_plugin_name(), Utilities::get_plugin_name(), 'manage_options', 'wpr-addons', 'wpr_addons_settings_page', $menu_icon, '58.6' );
15
+
16
+ add_action( 'admin_init', 'wpr_register_addons_settings' );
17
+ add_filter( 'plugin_action_links_'. WPR_ADDONS_PLUGIN_BASE, 'wpr_settings_link' );
18
+ }
19
+ add_action( 'admin_menu', 'wpr_addons_add_admin_menu' );
20
+
21
+ // Add Settings page link to plugins screen
22
+ function wpr_settings_link( $links ) {
23
+ $settings_link = '<a href="admin.php?page=wpr-addons">Settings</a>';
24
+ array_push( $links, $settings_link );
25
+
26
+ if ( !is_plugin_installed('wpr-addons-pro/wpr-addons-pro.php') ) {
27
+ $links[] = '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-wpplugindashboard-upgrade-pro#purchasepro" style="color:#93003c;font-weight:700" target="_blank">' . esc_html__('Go Pro', 'wpr-addons') . '</a>';
28
+ }
29
+
30
+ return $links;
31
+ }
32
+
33
+ function is_plugin_installed($file) {
34
+ $installed_plugins = [];
35
+
36
+ foreach( get_plugins() as $slug => $plugin_info ) {
37
+ array_push($installed_plugins, $slug);
38
+ }
39
+
40
+ if ( in_array($file, $installed_plugins) ) {
41
+ return true;
42
+ } else {
43
+ return false;
44
+ }
45
+ }
46
+
47
+ // Register Settings
48
+ function wpr_register_addons_settings() {
49
+ // WooCommerce
50
+ register_setting( 'wpr-settings', 'wpr_override_woo_templates' );
51
+ register_setting( 'wpr-settings', 'wpr_enable_product_image_zoom' );
52
+ register_setting( 'wpr-settings', 'wpr_enable_woo_flexslider_navigation' );
53
+ register_setting( 'wpr-settings', 'wpr_woo_shop_ppp' );
54
+ register_setting( 'wpr-settings', 'wpr_woo_shop_cat_ppp' );
55
+ register_setting( 'wpr-settings', 'wpr_woo_shop_tag_ppp' );
56
+
57
+ // Integrations
58
+ register_setting( 'wpr-settings', 'wpr_google_map_api_key' );
59
+ register_setting( 'wpr-settings', 'wpr_mailchimp_api_key' );
60
+
61
+ // Lightbox
62
+ register_setting( 'wpr-settings', 'wpr_lb_bg_color' );
63
+ register_setting( 'wpr-settings', 'wpr_lb_toolbar_color' );
64
+ register_setting( 'wpr-settings', 'wpr_lb_caption_color' );
65
+ register_setting( 'wpr-settings', 'wpr_lb_gallery_color' );
66
+ register_setting( 'wpr-settings', 'wpr_lb_pb_color' );
67
+ register_setting( 'wpr-settings', 'wpr_lb_ui_color' );
68
+ register_setting( 'wpr-settings', 'wpr_lb_ui_hr_color' );
69
+ register_setting( 'wpr-settings', 'wpr_lb_text_color' );
70
+ register_setting( 'wpr-settings', 'wpr_lb_icon_size' );
71
+ register_setting( 'wpr-settings', 'wpr_lb_arrow_size' );
72
+ register_setting( 'wpr-settings', 'wpr_lb_text_size' );
73
+
74
+ // White Label
75
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_logo' );
76
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_name' );
77
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_desc' );
78
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_author' );
79
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_website' );
80
+ register_setting( 'wpr-wh-settings', 'wpr_wl_plugin_links' );
81
+ register_setting( 'wpr-wh-settings', 'wpr_wl_hide_elements_tab' );
82
+ register_setting( 'wpr-wh-settings', 'wpr_wl_hide_extensions_tab' );
83
+ register_setting( 'wpr-wh-settings', 'wpr_wl_hide_settings_tab' );
84
+ register_setting( 'wpr-wh-settings', 'wpr_wl_hide_white_label_tab' );
85
+
86
+ // Extensions
87
+ register_setting('wpr-extension-settings', 'wpr-particles');
88
+ register_setting('wpr-extension-settings', 'wpr-parallax-background');
89
+ register_setting('wpr-extension-settings', 'wpr-parallax-multi-layer');
90
+ register_setting('wpr-extension-settings', 'wpr-sticky-section');
91
+
92
+ // Element Toggle
93
+ register_setting( 'wpr-elements-settings', 'wpr-element-toggle-all', [ 'default' => 'on' ] );
94
+
95
+ // Widgets
96
+ foreach ( Utilities::get_registered_modules() as $title => $data ) {
97
+ $slug = $data[0];
98
+ register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
99
+ }
100
+
101
+ // Theme Builder
102
+ foreach ( Utilities::get_theme_builder_modules() as $title => $data ) {
103
+ $slug = $data[0];
104
+ register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
105
+ }
106
+
107
+
108
+ // WooCommerce Builder
109
+ foreach ( Utilities::get_woocommerce_builder_modules() as $title => $data ) {
110
+ $slug = $data[0];
111
+ register_setting( 'wpr-elements-settings', 'wpr-element-'. $slug, [ 'default' => 'on' ] );
112
+ }
113
+
114
+ }
115
+
116
+ function wpr_addons_settings_page() {
117
+
118
+ ?>
119
+
120
+ <div class="wrap wpr-settings-page-wrap">
121
+
122
+ <div class="wpr-settings-page-header">
123
+ <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
124
+ <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
125
+
126
+ <?php if ( empty(get_option('wpr_wl_plugin_links')) ) : ?>
127
+ <div class="wpr-preview-buttons">
128
+ <a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-plugin-prev-btn#widgets" target="_blank" class="button wpr-options-button">
129
+ <span><?php echo esc_html__( 'View Plugin Demo', 'wpr-addons' ); ?></span>
130
+ <span class="dashicons dashicons-external"></span>
131
+ </a>
132
+
133
+ <a href="https://www.youtube.com/watch?v=rkYQfn3tUc0" class="wpr-options-button button" target="_blank">
134
+ <?php echo esc_html__( 'How to use Widgets', 'wpr-addons' ); ?>
135
+ <span class="dashicons dashicons-video-alt3"></span>
136
+ </a>
137
+
138
+ <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank">
139
+ <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
140
+ <span class="dashicons dashicons-star-empty"></span>
141
+ </a>
142
+ </div>
143
+ <?php endif; ?>
144
+ </div>
145
+
146
+ <div class="wpr-settings-page">
147
+ <form method="post" action="options.php">
148
+ <?php
149
+
150
+ // Active Tab
151
+ if ( empty(get_option('wpr_wl_hide_elements_tab')) ) {
152
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_elements';
153
+ } elseif ( empty(get_option('wpr_wl_hide_extensions_tab')) ) {
154
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_extensions';
155
+ } elseif ( empty(get_option('wpr_wl_hide_settings_tab')) ) {
156
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_settings';
157
+ } elseif ( empty(get_option('wpr_wl_hide_white_label_tab')) ) {
158
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_white_label';
159
+ }
160
+
161
+
162
+ // Render Create Templte Popup
163
+ WPR_Templates_Loop::render_create_template_popup();
164
+
165
+ ?>
166
+
167
+ <!-- Tabs -->
168
+ <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
169
+ <?php if ( empty(get_option('wpr_wl_hide_elements_tab')) ) : ?>
170
+ <a href="?page=wpr-addons&tab=wpr_tab_elements" data-title="Elements" class="nav-tab <?php echo ($active_tab == 'wpr_tab_elements') ? 'nav-tab-active' : ''; ?>">
171
+ <?php esc_html_e( 'Widgets', 'wpr-addons' ); ?>
172
+ </a>
173
+ <?php endif; ?>
174
+
175
+ <?php if ( empty(get_option('wpr_wl_hide_extensions_tab')) ) : ?>
176
+ <a href="?page=wpr-addons&tab=wpr_tab_extensions" data-title="Extensions" class="nav-tab <?php echo ($active_tab == 'wpr_tab_extensions') ? 'nav-tab-active' : ''; ?>">
177
+ <?php esc_html_e( 'Extensions', 'wpr-addons' ); ?>
178
+ </a>
179
+ <?php endif; ?>
180
+
181
+ <?php if ( empty(get_option('wpr_wl_hide_settings_tab')) ) : ?>
182
+ <a href="?page=wpr-addons&tab=wpr_tab_settings" data-title="Settings" class="nav-tab <?php echo ($active_tab == 'wpr_tab_settings') ? 'nav-tab-active' : ''; ?>">
183
+ <?php esc_html_e( 'Settings', 'wpr-addons' ); ?>
184
+ </a>
185
+ <?php endif; ?>
186
+
187
+ <?php // White Label
188
+ echo !empty(get_option('wpr_wl_hide_white_label_tab')) ? '<div style="display: none;">' : '<div>';
189
+ do_action('wpr_white_label_tab');
190
+ echo '</div>';
191
+ ?>
192
+ </div>
193
+
194
+ <?php if ( $active_tab == 'wpr_tab_elements' ) : ?>
195
+
196
+ <?php
197
+
198
+ // Settings
199
+ settings_fields( 'wpr-elements-settings' );
200
+ do_settings_sections( 'wpr-elements-settings' );
201
+
202
+ ?>
203
+
204
+ <div class="wpr-elements-toggle">
205
+ <div>
206
+ <h3><?php esc_html_e( 'Toggle all Widgets', 'wpr-addons' ); ?></h3>
207
+ <input type="checkbox" name="wpr-element-toggle-all" id="wpr-element-toggle-all" <?php checked( get_option('wpr-element-toggle-all', 'on'), 'on', true ); ?>>
208
+ <label for="wpr-element-toggle-all"></label>
209
+ </div>
210
+ <p><?php esc_html_e( 'You can disable some widgets for faster page speed.', 'wpr-addons' ); ?></p>
211
+ </div>
212
+ <div class="wpr-elements">
213
+ <?php
214
+ foreach ( Utilities::get_registered_modules() as $title => $data ) {
215
+ $slug = $data[0];
216
+ $url = $data[1];
217
+ $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
218
+ $class = 'new' === $data[3] ? ' wpr-new-element' : '';
219
+
220
+ echo '<div class="wpr-element'. esc_attr($class) .'">';
221
+ echo '<div class="wpr-element-info">';
222
+ echo '<h3>'. esc_html($title) .'</h3>';
223
+ echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
224
+ echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
225
+ echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
226
+ echo '</div>';
227
+ echo '</div>';
228
+ }
229
+ ?>
230
+ </div>
231
+
232
+ <div class="wpr-elements-heading">
233
+ <h3><?php esc_html_e( 'Theme Builder Widgets', 'wpr-addons' ); ?></h3>
234
+ <p><?php esc_html_e( 'Post (CPT) Archive Pages, Post (CPT) Single Pages', 'wpr-addons' ); ?></p>
235
+ </div>
236
+ <div class="wpr-elements">
237
+ <?php
238
+ foreach ( Utilities::get_theme_builder_modules() as $title => $data ) {
239
+ $slug = $data[0];
240
+ $url = $data[1];
241
+ $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
242
+ $class = 'new' === $data[3] ? ' wpr-new-element' : '';
243
+
244
+ echo '<div class="wpr-element'. esc_attr($class) .'">';
245
+ echo '<div class="wpr-element-info">';
246
+ echo '<h3>'. esc_html($title) .'</h3>';
247
+ echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
248
+ echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
249
+ echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
250
+ echo '</div>';
251
+ echo '</div>';
252
+ }
253
+ ?>
254
+ </div>
255
+
256
+ <div class="wpr-elements-heading">
257
+ <h3><?php esc_html_e( 'WooCommerce Builder Widgets', 'wpr-addons' ); ?></h3>
258
+ <p><?php esc_html_e( 'Product Archive Pages, Product Single Pages. Cart, Checkout and My Account Pages', 'wpr-addons' ); ?></p>
259
+ <?php if (!class_exists('WooCommerce')) : ?>
260
+ <p class='wpr-install-activate-woocommerce'><span class="dashicons dashicons-info-outline"></span> <?php esc_html_e( 'Install/Activate WooCommerce to use these widgets', 'wpr-addons' ); ?></p>
261
+ <?php endif; ?>
262
+ </div>
263
+ <div class="wpr-elements">
264
+ <?php
265
+ $woocommerce_builder_modules = Utilities::get_woocommerce_builder_modules();
266
+ $premium_woo_modules = [
267
+ 'Product Filters' => ['product-filters-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-prodfilter-widgets-pro#purchasepro', '', 'pro'],
268
+ 'Product Breadcrumbs' => ['product-breadcrumbs-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-breadcru-widgets-pro#purchasepro', '', 'pro'],
269
+ 'Page My Account' => ['page-my-account-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-myacc-widgets-pro#purchasepro', '', 'pro'],
270
+ 'Woo Category Grid' => ['woo-category-grid-pro', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-elements-woo-catgrid-widgets-pro#purchasepro', '', 'pro'],
271
+ ];
272
+
273
+ foreach ( array_merge($woocommerce_builder_modules, $premium_woo_modules) as $title => $data ) {
274
+ $slug = $data[0];
275
+ $url = $data[1];
276
+ $reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[1];
277
+ $class = 'new' === $data[3] ? 'wpr-new-element' : '';
278
+ $class = ('pro' === $data[3] && !wpr_fs()->can_use_premium_code()) ? 'wpr-pro-element' : '';
279
+ $default_value = class_exists( 'WooCommerce' ) ? 'on' : 'off';
280
+
281
+ if ( 'wpr-pro-element' === $class ) {
282
+ $default_value = 'off';
283
+ $reff = '';
284
+ }
285
+
286
+ echo '<div class="wpr-element '. esc_attr($class) .'">';
287
+ echo '<a href="'. esc_url($url . $reff) .'" target="_blank"></a>';
288
+ echo '<div class="wpr-element-info">';
289
+ echo '<h3>'. esc_html($title) .'</h3>';
290
+ echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, $default_value), 'on', false ) .'>';
291
+ echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
292
+ // echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
293
+ echo '</div>';
294
+ echo '</div>';
295
+ }
296
+ ?>
297
+ </div>
298
+
299
+ <?php submit_button( '', 'wpr-options-button' ); ?>
300
+
301
+ <?php elseif ( $active_tab == 'wpr_tab_settings' ) : ?>
302
+
303
+ <?php
304
+
305
+ // Settings
306
+ settings_fields( 'wpr-settings' );
307
+ do_settings_sections( 'wpr-settings' );
308
+
309
+ ?>
310
+
311
+ <div class="wpr-settings">
312
+
313
+ <?php submit_button( '', 'wpr-options-button' ); ?>
314
+
315
+ <div class="wpr-settings-group wpr-settings-group-woo">
316
+ <h3 class="wpr-settings-group-title"><?php esc_html_e( 'WooCommerce', 'wpr-addons' ); ?></h3>
317
+
318
+ <div class="wpr-settings-group-inner">
319
+
320
+ <?php if ( !wpr_fs()->can_use_premium_code() ) : ?>
321
+ <a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-settings-woo-pro#purchasepro" class="wpr-settings-pro-overlay" target="_blank">
322
+ <span class="dashicons dashicons-lock"></span>
323
+ <span class="dashicons dashicons-unlock"></span>
324
+ <span><?php esc_html_e( 'Upgrade to Pro', 'wpr-addons' ); ?></span>
325
+ </a>
326
+ <div class="wpr-setting">
327
+ <h4>
328
+ <span><?php esc_html_e( 'Shop Page: Products Per Page', 'wpr-addons' ); ?></span>
329
+ <br>
330
+ </h4>
331
+ <input type="text" value="9">
332
+ </div>
333
+ <div class="wpr-setting">
334
+ <h4>
335
+ <span><?php esc_html_e( 'Product Category: Products Per Page', 'wpr-addons' ); ?></span>
336
+ <br>
337
+ </h4>
338
+ <input type="text" value="9">
339
+ </div>
340
+ <div class="wpr-setting">
341
+ <h4>
342
+ <span><?php esc_html_e( 'Product Tag: Products Per Page', 'wpr-addons' ); ?></span>
343
+ <br>
344
+ </h4>
345
+ <input type="text" value="9">
346
+ </div>
347
+ <?php else: ?>
348
+ <?php do_action('wpr_woocommerce_settings'); ?>
349
+ <?php endif; ?>
350
+
351
+ </div>
352
+
353
+ <div class="wpr-woo-template-info">
354
+ <div class="wpr-woo-template-title">
355
+ <h4>Royal Templates</h4>
356
+ <span>Enable/Disable Royal addons Cart, Minicart, Notifications Templates, Product Lightbox</span>
357
+ </div>
358
+ <input type="checkbox" name="wpr_override_woo_templates" id="wpr_override_woo_templates" <?php echo checked( get_option('wpr_override_woo_templates', 'on'), 'on', false ); ?>>
359
+ <label for="wpr_override_woo_templates"></label>
360
+ </div>
361
+
362
+ <div class="wpr-woo-template-info">
363
+ <div class="wpr-woo-template-title">
364
+ <h4>Product Image Zoom</h4>
365
+ <span>Enable/Disable Image Zoom Effect on Woocommerce products</span>
366
+ </div>
367
+ <input type="checkbox" name="wpr_enable_product_image_zoom" id="wpr_enable_product_image_zoom" <?php echo checked( get_option('wpr_enable_product_image_zoom', 'on'), 'on', false ); ?>>
368
+ <label for="wpr_enable_product_image_zoom"></label>
369
+ </div>
370
+
371
+ <div class="wpr-woo-template-info">
372
+ <div class="wpr-woo-template-title">
373
+ <h4>Product Slider Nav</h4>
374
+ <span>Enable/Disable Navigation Arrows on Woocommerce products slider</span>
375
+ </div>
376
+ <input type="checkbox" name="wpr_enable_woo_flexslider_navigation" id="wpr_enable_woo_flexslider_navigation" <?php echo checked( get_option('wpr_enable_woo_flexslider_navigation', 'on'), 'on', false ); ?>>
377
+ <label for="wpr_enable_woo_flexslider_navigation"></label>
378
+ </div>
379
+
380
+ </div>
381
+
382
+ <div class="wpr-settings-group">
383
+ <h3 class="wpr-settings-group-title"><?php esc_html_e( 'Integrations', 'wpr-addons' ); ?></h3>
384
+
385
+ <div class="wpr-setting">
386
+ <h4>
387
+ <span><?php esc_html_e( 'Google Map API Key', 'wpr-addons' ); ?></span>
388
+ <br>
389
+ <a href="https://www.youtube.com/watch?v=O5cUoVpVUjU" target="_blank"><?php esc_html_e( 'How to get Google Map API Key?', 'wpr-addons' ); ?></a>
390
+ </h4>
391
+
392
+ <input type="text" name="wpr_google_map_api_key" id="wpr_google_map_api_key" value="<?php echo esc_attr(get_option('wpr_google_map_api_key')); ?>">
393
+ </div>
394
+
395
+ <div class="wpr-setting">
396
+ <h4>
397
+ <span><?php esc_html_e( 'MailChimp API Key', 'wpr-addons' ); ?></span>
398
+ <br>
399
+ <a href="https://mailchimp.com/help/about-api-keys/" target="_blank"><?php esc_html_e( 'How to get MailChimp API Key?', 'wpr-addons' ); ?></a>
400
+ </h4>
401
+
402
+ <input type="text" name="wpr_mailchimp_api_key" id="wpr_mailchimp_api_key" value="<?php echo esc_attr(get_option('wpr_mailchimp_api_key')); ?>">
403
+ </div>
404
+ </div>
405
+
406
+ <div class="wpr-settings-group">
407
+ <h3 class="wpr-settings-group-title"><?php esc_html_e( 'Lightbox', 'wpr-addons' ); ?></h3>
408
+
409
+ <div class="wpr-setting">
410
+ <h4><?php esc_html_e( 'Background Color', 'wpr-addons' ); ?></h4>
411
+ <input type="text" name="wpr_lb_bg_color" id="wpr_lb_bg_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_bg_color','rgba(0,0,0,0.6)')); ?>">
412
+ </div>
413
+
414
+ <div class="wpr-setting">
415
+ <h4><?php esc_html_e( 'Toolbar BG Color', 'wpr-addons' ); ?></h4>
416
+ <input type="text" name="wpr_lb_toolbar_color" id="wpr_lb_toolbar_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_toolbar_color','rgba(0,0,0,0.8)')); ?>">
417
+ </div>
418
+
419
+ <div class="wpr-setting">
420
+ <h4><?php esc_html_e( 'Caption BG Color', 'wpr-addons' ); ?></h4>
421
+ <input type="text" name="wpr_lb_caption_color" id="wpr_lb_caption_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_caption_color','rgba(0,0,0,0.8)')); ?>">
422
+ </div>
423
+
424
+ <div class="wpr-setting">
425
+ <h4><?php esc_html_e( 'Gallery BG Color', 'wpr-addons' ); ?></h4>
426
+ <input type="text" name="wpr_lb_gallery_color" id="wpr_lb_gallery_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_gallery_color','#444444')); ?>">
427
+ </div>
428
+
429
+ <div class="wpr-setting">
430
+ <h4><?php esc_html_e( 'Progress Bar Color', 'wpr-addons' ); ?></h4>
431
+ <input type="text" name="wpr_lb_pb_color" id="wpr_lb_pb_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_pb_color','#a90707')); ?>">
432
+ </div>
433
+
434
+ <div class="wpr-setting">
435
+ <h4><?php esc_html_e( 'UI Color', 'wpr-addons' ); ?></h4>
436
+ <input type="text" name="wpr_lb_ui_color" id="wpr_lb_ui_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_ui_color','#efefef')); ?>">
437
+ </div>
438
+
439
+ <div class="wpr-setting">
440
+ <h4><?php esc_html_e( 'UI Hover Color', 'wpr-addons' ); ?></h4>
441
+ <input type="text" name="wpr_lb_ui_hr_color" id="wpr_lb_ui_hr_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_ui_hr_color','#ffffff')); ?>">
442
+ </div>
443
+
444
+ <div class="wpr-setting">
445
+ <h4><?php esc_html_e( 'Text Color', 'wpr-addons' ); ?></h4>
446
+ <input type="text" name="wpr_lb_text_color" id="wpr_lb_text_color" data-alpha="true" value="<?php echo esc_attr(get_option('wpr_lb_text_color','#efefef')); ?>">
447
+ </div>
448
+
449
+ <div class="wpr-setting">
450
+ <h4><?php esc_html_e( 'UI Icon Size', 'wpr-addons' ); ?></h4>
451
+ <input type="number" name="wpr_lb_icon_size" id="wpr_lb_icon_size" value="<?php echo esc_attr(get_option('wpr_lb_icon_size','20')); ?>">
452
+ </div>
453
+
454
+ <div class="wpr-setting">
455
+ <h4><?php esc_html_e( 'Navigation Arrow Size', 'wpr-addons' ); ?></h4>
456
+ <input type="number" name="wpr_lb_arrow_size" id="wpr_lb_arrow_size" value="<?php echo esc_attr(get_option('wpr_lb_arrow_size','35')); ?>">
457
+ </div>
458
+
459
+ <div class="wpr-setting">
460
+ <h4><?php esc_html_e( 'Text Size', 'wpr-addons' ); ?></h4>
461
+ <input type="number" name="wpr_lb_text_size" id="wpr_lb_text_size" value="<?php echo esc_attr(get_option('wpr_lb_text_size','14')); ?>">
462
+ </div>
463
+ </div>
464
+
465
+ <?php submit_button( '', 'wpr-options-button' ); ?>
466
+
467
+ </div>
468
+
469
+ <?php elseif ( $active_tab == 'wpr_tab_extensions' ) :
470
+
471
+ // Extensions
472
+ settings_fields( 'wpr-extension-settings' );
473
+ do_settings_sections( 'wpr-extension-settings' );
474
+
475
+ global $new_allowed_options;
476
+
477
+ // array of option names
478
+ $option_names = $new_allowed_options[ 'wpr-extension-settings' ];
479
+
480
+ echo '<div class="wpr-elements">';
481
+
482
+ foreach ($option_names as $option_name) {
483
+ $option_title = ucwords( preg_replace( '/-/i', ' ', preg_replace('/wpr-||-toggle/i', '', $option_name ) ));
484
+
485
+ echo '<div class="wpr-element">';
486
+ echo '<div class="wpr-element-info">';
487
+ echo '<h3>'. esc_html($option_title) .'</h3>';
488
+ echo '<input type="checkbox" name="'. esc_attr($option_name) .'" id="'. esc_attr($option_name) .'" '. checked( get_option(''. $option_name .'', 'on'), 'on', false ) .'>';
489
+ echo '<label for="'. esc_attr($option_name) .'"></label>';
490
+
491
+ if ( 'wpr-parallax-background' === $option_name ) {
492
+ echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
493
+ echo '<a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial</a>';
494
+ } elseif ( 'wpr-parallax-multi-layer' === $option_name ) {
495
+ echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
496
+ echo '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial</a>';
497
+ } elseif ( 'wpr-particles' === $option_name ) {
498
+ echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
499
+ echo '<a href="https://www.youtube.com/watch?v=8OdnaoFSj94" target="_blank">Watch Video Tutorial</a>';
500
+ } elseif ( 'wpr-sticky-section' === $option_name ) {
501
+ echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
502
+ echo '<a href="https://www.youtube.com/watch?v=at0CPKtklF0&t=375s" target="_blank">Watch Video Tutorial</a>';
503
+ }
504
+
505
+ // echo '<a href="https://royal-elementor-addons.com/elementor-particle-effects/?ref=rea-plugin-backend-extentions-prev">'. esc_html('View Extension Demo', 'wpr-addons') .'</a>';
506
+ echo '</div>';
507
+ echo '</div>';
508
+ }
509
+
510
+ echo '</div>';
511
+
512
+ submit_button( '', 'wpr-options-button' );
513
+
514
+ elseif ( $active_tab == 'wpr_tab_white_label' ) :
515
+
516
+ do_action('wpr_white_label_tab_content');
517
+
518
+ endif; ?>
519
+
520
+ </form>
521
+ </div>
522
+
523
+ </div>
524
+
525
+
526
+ <?php
527
+
528
+ } // End wpr_addons_settings_page()
529
+
530
+
531
+
532
+ // Add Support Sub Menu item that will redirect to wp.org
533
+ function wpr_addons_add_support_menu() {
534
+ add_submenu_page( 'wpr-addons', 'Support', 'Support', 'manage_options', 'wpr-support', 'wpr_addons_support_page', 99 );
535
+ }
536
+ add_action( 'admin_menu', 'wpr_addons_add_support_menu', 99 );
537
+
538
+ function wpr_addons_support_page() {}
539
+
540
+ function wpr_redirect_support_page() {
541
+ ?>
542
+ <script type="text/javascript">
543
+ jQuery(document).ready( function($) {
544
+ $( 'ul#adminmenu a[href*="page=wpr-support"]' ).attr('href', 'https://wordpress.org/support/plugin/royal-elementor-addons/').attr( 'target', '_blank' );
545
+ });
546
+ </script>
547
+ <?php
548
+ }
549
+ add_action( 'admin_head', 'wpr_redirect_support_page' );
550
+
551
+
552
+ // Add Upgrade Sub Menu item that will redirect to royal-elementor-addons.com
553
+ function wpr_addons_add_upgrade_menu() {
554
+ if ( defined('WPR_ADDONS_PRO_VERSION') ) return;
555
+ add_submenu_page( 'wpr-addons', 'Upgrade', 'Upgrade', 'manage_options', 'wpr-upgrade', 'wpr_addons_upgrade_page', 99 );
556
+ }
557
+ add_action( 'admin_menu', 'wpr_addons_add_upgrade_menu', 99 );
558
+
559
+ function wpr_addons_upgrade_page() {}
560
+
561
+ function wpr_redirect_upgrade_page() {
562
+ ?>
563
+ <script type="text/javascript">
564
+ jQuery(document).ready( function($) {
565
+ $( 'ul#adminmenu a[href*="page=wpr-upgrade"]' ).attr('href', 'https://royal-elementor-addons.com/?ref=rea-plugin-backend-menu-upgrade-pro#purchasepro').attr( 'target', '_blank' );
566
+ $( 'ul#adminmenu a[href*="#purchasepro"]' ).css('color', 'greenyellow');
567
+ });
568
+ </script>
569
+ <?php
570
+ }
571
  add_action( 'admin_head', 'wpr_redirect_upgrade_page' );
admin/popups.php CHANGED
@@ -1,87 +1,87 @@
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_popups_menu() {
12
- add_submenu_page( 'wpr-addons', 'Popups', 'Popups', 'manage_options', 'wpr-popups', 'wpr_addons_popups_page' );
13
- }
14
- add_action( 'admin_menu', 'wpr_addons_add_popups_menu' );
15
-
16
- function wpr_addons_popups_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=TbKTNpuXM68" class="wpr-options-button button" target="_blank" style="padding: 10px 22px;">
34
- <?php echo esc_html__( 'How to use Popups', 'wpr-addons' ); ?>
35
- <span class="dashicons dashicons-video-alt3"></span>
36
- </a>
37
-
38
- <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
39
- <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
40
- <span class="dashicons dashicons-star-empty"></span>
41
- </a>
42
- </div>
43
- </div>
44
-
45
- <div class="wpr-settings-page">
46
- <form method="post" action="options.php">
47
- <?php
48
-
49
- // Active Tab
50
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_popups';
51
-
52
- ?>
53
-
54
- <!-- Template ID Holder -->
55
- <input type="hidden" name="wpr_template" id="wpr_template" value="">
56
-
57
- <!-- Conditions Popup -->
58
- <?php WPR_Templates_Loop::render_conditions_popup(); ?>
59
-
60
- <!-- Create Templte Popup -->
61
- <?php WPR_Templates_Loop::render_create_template_popup(); ?>
62
-
63
- <!-- Tabs -->
64
- <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
65
- <a href="?page=wpr-theme-builder&tab=wpr_tab_popups" data-title="popup" class="nav-tab <?php echo ($active_tab == 'wpr_tab_popups') ? 'nav-tab-active' : ''; ?>">
66
- <?php esc_html_e( 'Popups', 'wpr-addons' ); ?>
67
- </a>
68
- </div>
69
-
70
- <?php if ( $active_tab == 'wpr_tab_popups' ) : ?>
71
-
72
- <!-- Save Conditions -->
73
- <input type="hidden" name="wpr_popup_conditions" id="wpr_popup_conditions" value="<?php echo esc_attr(get_option('wpr_popup_conditions', '[]')); ?>">
74
-
75
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'popup' ); ?>
76
-
77
- <?php endif; ?>
78
-
79
- </form>
80
- </div>
81
-
82
- </div>
83
-
84
-
85
- <?php
86
-
87
  } // End wpr_addons_popups_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_popups_menu() {
12
+ add_submenu_page( 'wpr-addons', 'Popups', 'Popups', 'manage_options', 'wpr-popups', 'wpr_addons_popups_page' );
13
+ }
14
+ add_action( 'admin_menu', 'wpr_addons_add_popups_menu' );
15
+
16
+ function wpr_addons_popups_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=TbKTNpuXM68" class="wpr-options-button button" target="_blank" style="padding: 10px 22px;">
34
+ <?php echo esc_html__( 'How to use Popups', 'wpr-addons' ); ?>
35
+ <span class="dashicons dashicons-video-alt3"></span>
36
+ </a>
37
+
38
+ <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
39
+ <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
40
+ <span class="dashicons dashicons-star-empty"></span>
41
+ </a>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="wpr-settings-page">
46
+ <form method="post" action="options.php">
47
+ <?php
48
+
49
+ // Active Tab
50
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_popups';
51
+
52
+ ?>
53
+
54
+ <!-- Template ID Holder -->
55
+ <input type="hidden" name="wpr_template" id="wpr_template" value="">
56
+
57
+ <!-- Conditions Popup -->
58
+ <?php WPR_Templates_Loop::render_conditions_popup(); ?>
59
+
60
+ <!-- Create Templte Popup -->
61
+ <?php WPR_Templates_Loop::render_create_template_popup(); ?>
62
+
63
+ <!-- Tabs -->
64
+ <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
65
+ <a href="?page=wpr-theme-builder&tab=wpr_tab_popups" data-title="popup" class="nav-tab <?php echo ($active_tab == 'wpr_tab_popups') ? 'nav-tab-active' : ''; ?>">
66
+ <?php esc_html_e( 'Popups', 'wpr-addons' ); ?>
67
+ </a>
68
+ </div>
69
+
70
+ <?php if ( $active_tab == 'wpr_tab_popups' ) : ?>
71
+
72
+ <!-- Save Conditions -->
73
+ <input type="hidden" name="wpr_popup_conditions" id="wpr_popup_conditions" value="<?php echo esc_attr(get_option('wpr_popup_conditions', '[]')); ?>">
74
+
75
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'popup' ); ?>
76
+
77
+ <?php endif; ?>
78
+
79
+ </form>
80
+ </div>
81
+
82
+ </div>
83
+
84
+
85
+ <?php
86
+
87
  } // End wpr_addons_popups_page()
admin/premade-blocks.php CHANGED
@@ -1,39 +1,39 @@
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\Admin\Templates\WPR_Templates_Library_Blocks;
9
- use WprAddons\Classes\Utilities;
10
- use Elementor\Plugin;
11
-
12
- // Register Menus
13
- function wpr_addons_add_premade_blocks_menu() {
14
- add_submenu_page( 'wpr-addons', 'Premade Blocks', 'Premade Blocks', 'manage_options', 'wpr-premade-blocks', 'wpr_addons_premade_blocks_page' );
15
- }
16
- add_action( 'admin_menu', 'wpr_addons_add_premade_blocks_menu' );
17
-
18
- /**
19
- ** Render Premade Blocks Page
20
- */
21
- function wpr_addons_premade_blocks_page() {
22
-
23
- ?>
24
-
25
- <div class="wpr-premade-blocks-page">
26
-
27
- <div class="wpr-settings-page-header">
28
- <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
29
- <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
30
- </div>
31
-
32
- <?php WPR_Templates_Library_Blocks::render_library_templates_blocks(); ?>
33
-
34
- </div>
35
-
36
-
37
- <?php
38
-
39
- } // End wpr_addons_premade_blocks_page()
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\Admin\Templates\WPR_Templates_Library_Blocks;
9
+ use WprAddons\Classes\Utilities;
10
+ use Elementor\Plugin;
11
+
12
+ // Register Menus
13
+ function wpr_addons_add_premade_blocks_menu() {
14
+ add_submenu_page( 'wpr-addons', 'Premade Blocks', 'Premade Blocks', 'manage_options', 'wpr-premade-blocks', 'wpr_addons_premade_blocks_page' );
15
+ }
16
+ add_action( 'admin_menu', 'wpr_addons_add_premade_blocks_menu' );
17
+
18
+ /**
19
+ ** Render Premade Blocks Page
20
+ */
21
+ function wpr_addons_premade_blocks_page() {
22
+
23
+ ?>
24
+
25
+ <div class="wpr-premade-blocks-page">
26
+
27
+ <div class="wpr-settings-page-header">
28
+ <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
29
+ <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
30
+ </div>
31
+
32
+ <?php WPR_Templates_Library_Blocks::render_library_templates_blocks(); ?>
33
+
34
+ </div>
35
+
36
+
37
+ <?php
38
+
39
+ } // End wpr_addons_premade_blocks_page()
admin/templates-kit.php CHANGED
@@ -1,707 +1,787 @@
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_activate_required_theme', 'wpr_activate_required_theme' );
19
- add_action( 'wp_ajax_wpr_activate_required_plugins', 'wpr_activate_required_plugins' );
20
- add_action( 'wp_ajax_wpr_fix_royal_compatibility', 'wpr_fix_royal_compatibility' );
21
- add_action( 'wp_ajax_wpr_reset_previous_import', 'wpr_reset_previous_import' );
22
- add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' );
23
- add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' );
24
- add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
25
- add_action( 'init', 'disable_default_woo_pages_creation', 2 );
26
-
27
-
28
- /**
29
- ** Render Templates Kit Page
30
- */
31
- function wpr_addons_templates_kit_page() {
32
-
33
- ?>
34
-
35
- <div class="wpr-templates-kit-page">
36
-
37
- <header>
38
- <div class="wpr-templates-kit-logo">
39
- <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>
40
- <div class="back-btn"><?php printf( esc_html__('%s Back to Library', 'wpr-addons'), '<span class="dashicons dashicons-arrow-left-alt2"></span>'); ?></div>
41
- </div>
42
-
43
- <div class="wpr-templates-kit-search">
44
- <input type="text" autocomplete="off" placeholder="<?php esc_html_e('Search Templates Kit...', 'wpr-addons'); ?>">
45
- <span class="dashicons dashicons-search"></span>
46
- </div>
47
-
48
- <div class="wpr-templates-kit-price-filter">
49
- <span data-price="mixed"><?php esc_html_e('Price: Mixed', 'wpr-addons'); ?></span>
50
- <span class="dashicons dashicons-arrow-down-alt2"></span>
51
- <ul>
52
- <li><?php esc_html_e('Mixed', 'wpr-addons'); ?></li>
53
- <li><?php esc_html_e('Free', 'wpr-addons'); ?></li>
54
- <li><?php esc_html_e('Premium', 'wpr-addons'); ?></li>
55
- </ul>
56
- </div>
57
-
58
- <div class="wpr-templates-kit-filters">
59
- <div>Filter: All</div>
60
- <ul>
61
- <li data-filter="all">Blog</li>
62
- <li data-filter="blog">Blog</li>
63
- <li data-filter="business">Business</li>
64
- <li data-filter="ecommerce">eCommerce</li>
65
- <li data-filter="beauty">Beauty</li>
66
- </ul>
67
- </div>
68
- </header>
69
-
70
- <div class="wpr-templates-kit-page-title">
71
- <h1><?php esc_html_e('Royal Elementor Templates Kit', 'wpr-addons'); ?></h1>
72
- <p><?php esc_html_e('Import any Templates Kit with just a Single click', 'wpr-addons'); ?></p>
73
- <p>
74
- <a href="https://www.youtube.com/watch?v=kl2xBoWW81o" class="wpr-options-button button" target="_blank">
75
- <?php esc_html_e('Video Tutorial', 'wpr-addons'); ?>
76
- <span class="dashicons dashicons-video-alt3"></span>
77
- </a>
78
- </p>
79
- </div>
80
-
81
- <div class="wpr-templates-kit-grid main-grid" data-theme-status="<?php echo esc_attr(get_theme_status()); ?>">
82
- <?php
83
- $kits = WPR_Templates_Data::get_available_kits();
84
- $sorted_kits = [];
85
-
86
- foreach ($kits as $slug => $kit) {
87
- foreach ($kit as $version => $data ) {
88
- $sorted_kits[$slug .'-'. $version] = $data;
89
- }
90
- }
91
-
92
- // Sort by Priority
93
- uasort($sorted_kits, function ($item1, $item2) {
94
- if ($item1['priority'] == $item2['priority']) return 0;
95
- return $item1['priority'] < $item2['priority'] ? -1 : 1;
96
- });
97
-
98
- // Loop
99
- foreach ($sorted_kits as $kit_id => $data) {
100
- 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']) .'">';
101
- echo '<div class="image-wrap">';
102
- echo '<img src="'. esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit_id .'/home.jpg') .'">';
103
- echo '<div class="image-overlay"><span class="dashicons dashicons-search"></span></div>';
104
- echo '</div>';
105
- echo '<footer>';
106
- echo '<h3>'. esc_html($data['name']) .'</h3>';
107
- if ( $data['woo-builder'] ) {
108
- echo '<span class="wpr-woo-builder-label">'. esc_html__( 'Woo Builder', 'wpr-addons' ) .'</span>';
109
- } elseif ( $data['theme-builder'] ) {
110
- echo '<span class="wpr-theme-builder-label">'. esc_html__( 'Theme Builder', 'wpr-addons' ) .'</span>';
111
- }
112
- echo '</footer>';
113
- echo '</div>';
114
- }
115
-
116
- ?>
117
-
118
- </div>
119
-
120
- <div class="wpr-templates-kit-single">
121
- <div class="wpr-templates-kit-grid single-grid"></div>
122
-
123
- <footer class="action-buttons-wrap">
124
- <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>
125
-
126
- <div class="import-template-buttons">
127
- <?php
128
- echo '<button class="import-kit button">'. esc_html__('Import Templates Kit', 'wpr-addons') .' <span class="dashicons dashicons-download"></span></button>';
129
- 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>';
130
- ?>
131
- <button class="import-template button"><?php printf( esc_html__( 'Import %s Template', 'wpr-addons' ), '<strong></strong>' ); ?></button>
132
-
133
- </div>
134
- </footer>
135
- </div>
136
-
137
- <div class="wpr-import-kit-popup-wrap">
138
- <div class="overlay"></div>
139
- <div class="wpr-import-kit-popup">
140
- <header>
141
- <h3><?php esc_html_e('Template Kit is being imported', 'wpr-addons'); ?><span>.</span></h3>
142
- <span class="dashicons dashicons-no-alt close-btn"></span>
143
- </header>
144
- <div class="content">
145
- <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>
146
- <p><?php esc_html_e('Please do NOT close this browser window until import is completed.', 'wpr-addons'); ?></p>
147
-
148
- <div class="progress-wrap">
149
- <div class="progress-bar"></div>
150
- <strong></strong>
151
- </div>
152
-
153
- <div class="wpr-import-help">
154
- <a href="https://royal-elementor-addons.com/contactus/?ref=rea-plugin-backend-templates-import-screen" target="_blank">Having trouble with template import?&nbsp;&nbsp;Get help <span class="dashicons dashicons-sos"></span></a>
155
- </div>
156
- </div>
157
- </div>
158
- </div>
159
-
160
- <div class="wpr-templates-kit-not-found">
161
- <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/not-found.png'); ?>">
162
- <h1><?php esc_html_e('No Search Results Found.', 'wpr-addons'); ?></h1>
163
- <p><?php esc_html_e('Cant find a Templates Kit you are looking for?', 'wpr-addons'); ?></p>
164
- <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>
165
- </div>
166
-
167
- </div>
168
-
169
-
170
- <?php
171
-
172
- } // End wpr_addons_templates_kit_page()
173
-
174
- /**
175
- ** Get Theme Status
176
- */
177
- function get_theme_status() {
178
- $theme = wp_get_theme();
179
-
180
- // Theme installed and activate.
181
- if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
182
- return 'req-theme-active';
183
- }
184
-
185
- // Theme installed but not activate.
186
- foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
187
- if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
188
- return 'req-theme-inactive';
189
- }
190
- }
191
-
192
- return 'req-theme-not-installed';
193
- }
194
-
195
- /**
196
- ** Install/Activate Required Theme
197
- */
198
- function wpr_activate_required_theme() {
199
- // Get Current Theme
200
- $theme = get_option('stylesheet');
201
-
202
- // Activate Royal Elementor Kit Theme
203
- if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
204
- && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
205
- switch_theme( 'royal-elementor-kit' );
206
- set_transient( 'royal-elementor-kit_activation_notice', true );
207
- }
208
-
209
- // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
210
- }
211
-
212
- /**
213
- ** Activate Required Plugins
214
- */
215
- function wpr_activate_required_plugins() {
216
- if ( isset($_POST['plugin']) ) {
217
- if ( 'contact-form-7' == $_POST['plugin'] ) {
218
- if ( !is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
219
- activate_plugin( 'contact-form-7/wp-contact-form-7.php' );
220
- }
221
- } elseif ( 'woocommerce' == $_POST['plugin'] ) {
222
- if ( !is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
223
- activate_plugin( 'woocommerce/woocommerce.php' );
224
- }
225
- } elseif ( 'media-library-assistant' == $_POST['plugin'] ) {
226
- if ( !is_plugin_active( 'media-library-assistant/index.php' ) ) {
227
- activate_plugin( 'media-library-assistant/index.php' );
228
- }
229
- }
230
- }
231
- }
232
-
233
- /**
234
- ** Deactivate Extra Plugins
235
- */
236
- function wpr_fix_royal_compatibility() {
237
- // Get currently active plugins
238
- $active_plugins = (array) get_option( 'active_plugins', array() );
239
- $active_plugins = array_values($active_plugins);
240
- $required_plugins = [
241
- 'elementor/elementor.php',
242
- 'royal-elementor-addons/wpr-addons.php',
243
- 'royal-elementor-addons-pro/wpr-addons-pro.php',
244
- 'wpr-addons-pro/wpr-addons-pro.php',
245
- 'contact-form-7/wp-contact-form-7.php',
246
- 'woocommerce/woocommerce.php',
247
- 'really-simple-ssl/rlrsssl-really-simple-ssl.php',
248
- 'wp-mail-smtp/wp_mail_smtp.php',
249
- 'updraftplus/updraftplus.php'
250
- ];
251
-
252
- // Deactivate Extra Import Plugins
253
- foreach ( $active_plugins as $key => $value ) {
254
- if ( ! in_array($value, $required_plugins) ) {
255
- $active_key = array_search($value, $active_plugins);;
256
- unset($active_plugins[$active_key]);
257
- }
258
- }
259
-
260
- // Set Active Plugins
261
- update_option( 'active_plugins', array_values($active_plugins) );
262
-
263
- // Get Current Theme
264
- $theme = get_option('stylesheet');
265
-
266
- // Activate Royal Elementor Kit Theme
267
- if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
268
- && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
269
- switch_theme( 'royal-elementor-kit' );
270
- set_transient( 'royal-elementor-kit_activation_notice', true );
271
- }
272
- }
273
-
274
- /**
275
- ** Import Template Kit
276
- */
277
- function wpr_import_templates_kit() {
278
-
279
- // Temp Define Importers
280
- if ( ! defined('WP_LOAD_IMPORTERS') ) {
281
- define('WP_LOAD_IMPORTERS', true);
282
- }
283
-
284
- // Include if Class Does NOT Exist
285
- if ( ! class_exists( 'WP_Import' ) ) {
286
- $class_wp_importer = WPR_ADDONS_PATH .'admin/import/class-wordpress-importer.php';
287
- if ( file_exists( $class_wp_importer ) ) {
288
- require $class_wp_importer;
289
- }
290
- }
291
-
292
- if ( class_exists( 'WP_Import' ) ) {
293
- $kit = isset($_POST['wpr_templates_kit']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit'])) : '';
294
- $file = isset($_POST['wpr_templates_kit_single']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit_single'])) : '';
295
-
296
- // Tmp
297
- update_option( 'wpr-import-kit-id', $kit );
298
-
299
- // No Limit for Execution
300
- set_time_limit(0);
301
-
302
- // Download Import File
303
- $local_file_path = download_template( $kit, $file );
304
-
305
- // Prepare for Import
306
- $wp_import = new WP_Import( $local_file_path, ['fetch_attachments' => true] );
307
-
308
- // Import
309
- ob_start();
310
- $wp_import->run();
311
- ob_end_clean();
312
-
313
- // Delete Import File
314
- unlink( $local_file_path );
315
-
316
- // Send to JS
317
- echo esc_html(serialize( $wp_import ));
318
- }
319
-
320
- }
321
-
322
- /**
323
- ** Download Template
324
- */
325
- function download_template( $kit, $file ) {
326
- $file = ! $file ? 'main' : $file;
327
-
328
- // Avoid Cache
329
- $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
330
-
331
- // Remote and Local Files
332
- $remote_file_url = 'https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
333
-
334
- // If the function it's not available, require it.
335
- if ( ! function_exists( 'download_url' ) ) {
336
- require_once ABSPATH . 'wp-admin/includes/file.php';
337
- }
338
-
339
- $tmp_file = download_url( $remote_file_url );
340
-
341
- // WP Error.
342
- if ( is_wp_error( $tmp_file ) ) {
343
- wp_send_json_error([
344
- 'error' => esc_html__('Error: Import File download failed.', 'wpr-addons'),
345
- 'help' => esc_html__('Please contact Customer Support and send this Error.', 'wpr-addons')
346
- ]);
347
- return false;
348
- }
349
-
350
- // Array based on $_FILE as seen in PHP file uploads.
351
- $file_args = [
352
- 'name' => 'main.xml',
353
- 'tmp_name' => $tmp_file,
354
- 'error' => 0,
355
- 'size' => filesize( $tmp_file ),
356
- ];
357
-
358
- $defaults = array(
359
- 'test_form' => false,
360
- 'test_size' => true,
361
- 'test_upload' => true,
362
- 'mimes' => [
363
- 'xml' => 'text/xml',
364
- 'json' => 'text/plain',
365
- ],
366
- 'wp_handle_sideload' => 'upload',
367
- );
368
-
369
- // Move the temporary file into the uploads directory.
370
- $local_file = wp_handle_sideload( $file_args, $defaults );
371
-
372
- if ( isset( $local_file['error'] ) ) {
373
- wp_send_json_error([
374
- 'error' => esc_html__('Error: Import File upload failed.', 'wpr-addons'),
375
- 'help' => esc_html__('Please contact Customer Support and send this Error.', 'wpr-addons')
376
- ]);
377
- return false;
378
- }
379
-
380
- // Success.
381
- return $local_file['file'];
382
- }
383
-
384
- /**
385
- ** Reset Previous Import
386
- */
387
- function wpr_reset_previous_import() {
388
- $args = [
389
- 'post_type' => [
390
- 'page',
391
- 'post',
392
- 'product',
393
- 'wpr_mega_menu',
394
- 'wpr_templates',
395
- 'elementor_library',
396
- 'attachment'
397
- ],
398
- 'post_status' => 'any',
399
- 'posts_per_page' => '-1',
400
- 'meta_key' => '_wpr_demo_import_item'
401
- ];
402
-
403
- $imported_items = new WP_Query ( $args );
404
-
405
- if ( $imported_items->have_posts() ) {
406
- while ( $imported_items->have_posts() ) {
407
- $imported_items->the_post();
408
-
409
- // Dont Delete Elementor Kit
410
- if ( 'Default Kit' == get_the_title() ) {
411
- continue;
412
- }
413
-
414
- // Delete Posts
415
- wp_delete_post( get_the_ID(), true );
416
- }
417
-
418
- // Reset
419
- wp_reset_query();
420
-
421
- $imported_terms = get_terms([
422
- 'meta_key' => '_wpr_demo_import_item',
423
- 'posts_per_page' => -1,
424
- 'hide_empty' => false,
425
- ]);
426
-
427
- if ( !empty($imported_terms) ) {
428
- foreach( $imported_terms as $imported_term ) {
429
- // Delete Terms
430
- wp_delete_term( $imported_term->term_id, $imported_term->taxonomy );
431
- }
432
- }
433
-
434
- wp_send_json_success( esc_html__('Previous Import Files have been successfully Reset.', 'wpr-addons') );
435
- } else {
436
- wp_send_json_success( esc_html__('There is no Data for Reset.', 'wpr-addons') );
437
- }
438
- }
439
-
440
- /**
441
- ** Import Elementor Site Settings
442
- */
443
- function import_elementor_site_settings( $kit ) {
444
- // Avoid Cache
445
- // $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
446
-
447
- // Get Remote File
448
- $site_settings = @file_get_contents('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/site-settings.json');
449
-
450
- if ( false !== $site_settings ) {
451
- $site_settings = json_decode($site_settings, true);
452
-
453
- if ( ! empty($site_settings['settings']) ) {
454
- $default_kit = \Elementor\Plugin::$instance->documents->get_doc_for_frontend( get_option( 'elementor_active_kit' ) );
455
-
456
- $kit_settings = $default_kit->get_settings();
457
- $new_settings = $site_settings['settings'];
458
- $settings = array_merge($kit_settings, $new_settings);
459
-
460
- $default_kit->save( [ 'settings' => $settings ] );
461
- }
462
- }
463
- }
464
-
465
- /**
466
- ** Setup WPR Templates
467
- */
468
- function setup_wpr_templates( $kit ) {
469
- $kit = isset($kit) ? sanitize_text_field(wp_unslash($kit)) : '';
470
-
471
- // Check if kit has Theme Builder templates
472
- $kit_name = substr($kit, 0, strripos($kit, '-v'));
473
- $kit_version = substr($kit, (strripos($kit, '-v') + 1), strlen($kit));
474
- $get_available_kits = WPR_Templates_Data::get_available_kits();
475
- $has_theme_builder = $get_available_kits[$kit_name][$kit_version]['theme-builder'];
476
- $has_woo_builder = $get_available_kits[$kit_name][$kit_version]['woo-builder'];
477
- $has_off_canvas = $get_available_kits[$kit_name][$kit_version]['off-canvas'];
478
-
479
- // Set Home & Blog Pages
480
- $home_page = get_page_by_path('home-'. $kit);
481
- $blog_page = get_page_by_path('blog-'. $kit);
482
-
483
- if ( $home_page ) {
484
- update_option( 'show_on_front', 'page' );
485
- update_option( 'page_on_front', $home_page->ID );
486
-
487
- if ( $blog_page ) {
488
- update_option( 'page_for_posts', $blog_page->ID );
489
- }
490
- }
491
-
492
- // Set Headers and Footers
493
- update_option('wpr_header_conditions', '{"user-header-'. $kit .'-header":["global"]}');
494
- update_post_meta( Utilities::get_template_id('user-header-'. $kit), 'wpr_header_show_on_canvas', 'true' );
495
- update_option('wpr_footer_conditions', '{"user-footer-'. $kit .'-footer":["global"]}');
496
- update_post_meta( Utilities::get_template_id('user-footer-'. $kit), 'wpr_footer_show_on_canvas', 'true' );
497
-
498
- // Theme Builder
499
- if ( $has_theme_builder ) {
500
- 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"]}');
501
- 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"]}');
502
- }
503
-
504
- // WooCommerce Builder
505
- if ( $has_woo_builder ) {
506
- update_option('wpr_product_archive_conditions', '{"user-product_archive-'. $kit .'-shop":["product_archive/products"],"user-product_archive-'. $kit .'-product-category-tag":["product_archive/product_cat/all","product_archive/product_tag/all"]}');
507
- update_option('wpr_product_single_conditions', '{"user-product_single-'. $kit .'-product":["product_single/product"]}');
508
-
509
- $shop_id = get_page_by_path('shop-'. $kit) ? get_page_by_path('shop-'. $kit)->ID : '';
510
- $cart_id = get_page_by_path('cart-'. $kit) ? get_page_by_path('cart-'. $kit)->ID : '';
511
- $checkout_id = get_page_by_path('checkout-'. $kit) ? get_page_by_path('checkout-'. $kit)->ID : '';
512
- $myaccount_id = get_page_by_path('my-account-'. $kit) ? get_page_by_path('my-account-'. $kit)->ID : '';
513
-
514
- update_option('woocommerce_shop_page_id', $shop_id);
515
- update_option('woocommerce_cart_page_id', $cart_id);
516
- update_option('woocommerce_checkout_page_id', $checkout_id);
517
-
518
- if ( '' !== $myaccount_id ) {
519
- update_option('woocommerce_myaccount_page_id', $myaccount_id);
520
- }
521
-
522
- // Update Options
523
- update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
524
-
525
- // Enable Elementor Builder for WooCommerce CPT
526
- // $cpt_support = get_option( 'elementor_cpt_support' );
527
-
528
- // if ( ! in_array( 'product', $cpt_support ) ) {
529
- // $cpt_support[] = 'product';
530
- // update_option( 'elementor_cpt_support', $cpt_support );
531
- // }
532
- }
533
-
534
- // Set Popups
535
- if ( $has_off_canvas ) {
536
- update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-off-canvas":["global"],"user-popup-'. $kit .'-popup":["global"]}');
537
- } else {
538
- update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-popup":["global"]}');
539
- }
540
- }
541
-
542
- /**
543
- ** Fix Elementor Images
544
- */
545
- function wpr_fix_elementor_images() {
546
- $args = array(
547
- 'post_type' => ['wpr_templates', 'wpr_mega_menu', 'page'],
548
- 'posts_per_page' => '-1',
549
- 'meta_key' => '_elementor_version'
550
- );
551
- $elementor_pages = new WP_Query ( $args );
552
-
553
- // Check that we have query results.
554
- if ( $elementor_pages->have_posts() ) {
555
-
556
- // Start looping over the query results.
557
- while ( $elementor_pages->have_posts() ) {
558
-
559
- $elementor_pages->the_post();
560
-
561
- // Replace Demo with Current
562
- $site_url = get_site_url();
563
- $site_url = str_replace( '/', '\/', $site_url );
564
- $demo_site_url = 'https://demosites.royal-elementor-addons.com/'. get_option('wpr-import-kit-id');
565
- $demo_site_url = str_replace( '/', '\/', $demo_site_url );
566
-
567
- // Elementor Data
568
- $data = get_post_meta( get_the_ID(), '_elementor_data', true );
569
-
570
- if ( ! empty( $data ) ) {
571
- $data = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $data);
572
- $data = str_replace( $demo_site_url, $site_url, $data );
573
- $data = json_decode( $data, true );
574
- }
575
-
576
- update_metadata( 'post', get_the_ID(), '_elementor_data', $data );
577
-
578
- // Elementor Page Settings
579
- $page_settings = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
580
- $page_settings = json_encode($page_settings);
581
-
582
- if ( ! empty( $page_settings ) ) {
583
- $page_settings = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $page_settings);
584
- $page_settings = str_replace( $demo_site_url, $site_url, $page_settings );
585
- $page_settings = json_decode( $page_settings, true );
586
- }
587
-
588
- update_metadata( 'post', get_the_ID(), '_elementor_page_settings', $page_settings );
589
-
590
- }
591
-
592
- }
593
-
594
- // Clear Elementor Cache
595
- Plugin::$instance->files_manager->clear_cache();
596
- }
597
-
598
- /**
599
- ** Final Settings Setup
600
- */
601
- function wpr_final_settings_setup() {
602
- $kit = !empty(get_option('wpr-import-kit-id')) ? esc_html(get_option('wpr-import-kit-id')) : '';
603
-
604
- // Elementor Site Settings
605
- import_elementor_site_settings($kit);
606
-
607
- // Setup WPR Templates
608
- setup_wpr_templates($kit);
609
-
610
- // Fix Elementor Images
611
- wpr_fix_elementor_images();
612
-
613
- // Track Kit
614
- wpr_track_imported_kit( $kit );
615
-
616
- // Clear DB
617
- delete_option('wpr-import-kit-id');
618
-
619
- // Delete Hello World Post
620
- $post = get_page_by_path('hello-world', OBJECT, 'post');
621
- if ( $post ) {
622
- wp_delete_post($post->ID,true);
623
- }
624
- }
625
-
626
- /**
627
- ** Prevent WooCommerce creating default pages
628
- */
629
- function disable_default_woo_pages_creation() {
630
- add_filter( 'woocommerce_create_pages', '__return_empty_array' );
631
- }
632
-
633
- /**
634
- ** Add .xml and .svg files as supported format in the uploader.
635
- */
636
- function custom_upload_mimes( $mimes ) {
637
- // Allow SVG files.
638
- $mimes['svg'] = 'image/svg+xml';
639
- $mimes['svgz'] = 'image/svg+xml';
640
-
641
- // Allow XML files.
642
- $mimes['xml'] = 'text/xml';
643
-
644
- // Allow JSON files.
645
- $mimes['json'] = 'application/json';
646
-
647
- return $mimes;
648
- }
649
-
650
- add_filter( 'upload_mimes', 'custom_upload_mimes', 99 );
651
-
652
- function real_mime_types_5_1_0( $defaults, $file, $filename, $mimes, $real_mime ) {
653
- return real_mimes( $defaults, $filename );
654
- }
655
-
656
- function real_mime_types( $defaults, $file, $filename, $mimes ) {
657
- return real_mimes( $defaults, $filename );
658
- }
659
-
660
- function real_mimes( $defaults, $filename ) {
661
- if ( strpos( $filename, 'main' ) !== false ) {
662
- $defaults['ext'] = 'xml';
663
- $defaults['type'] = 'text/xml';
664
- }
665
-
666
- return $defaults;
667
- }
668
-
669
- if ( version_compare( get_bloginfo( 'version' ), '5.1.0', '>=' ) ) {
670
- add_filter( 'wp_check_filetype_and_ext', 'real_mime_types_5_1_0', 10, 5, 99 );
671
- } else {
672
- add_filter( 'wp_check_filetype_and_ext', 'real_mime_types', 10, 4 );
673
- }
674
-
675
- /**
676
- ** Search Query Results
677
- */
678
- function wpr_search_query_results() {
679
- // Freemius OptIn
680
- if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
681
- return;
682
- }
683
-
684
- $search_query = isset($_POST['search_query']) ? sanitize_text_field(wp_unslash($_POST['search_query'])) : '';
685
-
686
- wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-search/data', [
687
- 'body' => [
688
- 'search_query' => $search_query
689
- ]
690
- ] );
691
- }
692
-
693
- /**
694
- ** Search Query Results
695
- */
696
- function wpr_track_imported_kit( $kit ) {
697
- // Freemius OptIn
698
- if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
699
- return;
700
- }
701
-
702
- wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-import/data', [
703
- 'body' => [
704
- 'imported_kit' => $kit
705
- ]
706
- ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  }
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_activate_required_theme', 'wpr_activate_required_theme' );
19
+ add_action( 'wp_ajax_wpr_activate_required_plugins', 'wpr_activate_required_plugins' );
20
+ add_action( 'wp_ajax_wpr_fix_royal_compatibility', 'wpr_fix_royal_compatibility' );
21
+ add_action( 'wp_ajax_wpr_reset_previous_import', 'wpr_reset_previous_import' );
22
+ add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' );
23
+ add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' );
24
+ add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
25
+ add_action( 'init', 'disable_default_woo_pages_creation', 2 );
26
+
27
+ // Set Image Timeout
28
+ if ( version_compare( get_bloginfo( 'version' ), '5.1.0', '>=' ) ) {
29
+ add_filter( 'http_request_timeout', 'set_image_request_timeout', 10, 2 );
30
+ }
31
+
32
+ /**
33
+ ** Render Templates Kit Page
34
+ */
35
+ function wpr_addons_templates_kit_page() {
36
+
37
+ ?>
38
+
39
+ <div class="wpr-templates-kit-page">
40
+
41
+ <header>
42
+ <div class="wpr-templates-kit-logo">
43
+ <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>
44
+ <div class="back-btn"><?php printf( esc_html__('%s Back to Library', 'wpr-addons'), '<span class="dashicons dashicons-arrow-left-alt2"></span>'); ?></div>
45
+ </div>
46
+
47
+ <div class="wpr-templates-kit-search">
48
+ <input type="text" autocomplete="off" placeholder="<?php esc_html_e('Search Templates Kit...', 'wpr-addons'); ?>">
49
+ <span class="dashicons dashicons-search"></span>
50
+ </div>
51
+
52
+ <div class="wpr-templates-kit-price-filter">
53
+ <span data-price="mixed"><?php esc_html_e('Price: Mixed', 'wpr-addons'); ?></span>
54
+ <span class="dashicons dashicons-arrow-down-alt2"></span>
55
+ <ul>
56
+ <li><?php esc_html_e('Mixed', 'wpr-addons'); ?></li>
57
+ <li><?php esc_html_e('Free', 'wpr-addons'); ?></li>
58
+ <li><?php esc_html_e('Premium', 'wpr-addons'); ?></li>
59
+ </ul>
60
+ </div>
61
+
62
+ <div class="wpr-templates-kit-filters">
63
+ <div>Filter: All</div>
64
+ <ul>
65
+ <li data-filter="all">Blog</li>
66
+ <li data-filter="blog">Blog</li>
67
+ <li data-filter="business">Business</li>
68
+ <li data-filter="ecommerce">eCommerce</li>
69
+ <li data-filter="beauty">Beauty</li>
70
+ </ul>
71
+ </div>
72
+ </header>
73
+
74
+ <div class="wpr-templates-kit-page-title">
75
+ <h1><?php esc_html_e('Royal Elementor Templates Kit', 'wpr-addons'); ?></h1>
76
+ <p><?php esc_html_e('Import any Templates Kit with just a Single click', 'wpr-addons'); ?></p>
77
+ <p>
78
+ <a href="https://www.youtube.com/watch?v=kl2xBoWW81o" class="wpr-options-button button" target="_blank">
79
+ <?php esc_html_e('Video Tutorial', 'wpr-addons'); ?>
80
+ <span class="dashicons dashicons-video-alt3"></span>
81
+ </a>
82
+ </p>
83
+ </div>
84
+
85
+ <div class="wpr-templates-kit-grid main-grid" data-theme-status="<?php echo esc_attr(get_theme_status()); ?>">
86
+ <?php
87
+ $kits = WPR_Templates_Data::get_available_kits();
88
+ $sorted_kits = [];
89
+
90
+ foreach ($kits as $slug => $kit) {
91
+ foreach ($kit as $version => $data ) {
92
+ $sorted_kits[$slug .'-'. $version] = $data;
93
+ }
94
+ }
95
+
96
+ // Sort by Priority
97
+ uasort($sorted_kits, function ($item1, $item2) {
98
+ if ($item1['priority'] == $item2['priority']) return 0;
99
+ return $item1['priority'] < $item2['priority'] ? -1 : 1;
100
+ });
101
+
102
+ // Loop
103
+ foreach ($sorted_kits as $kit_id => $data) {
104
+ 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']) .'">';
105
+ echo '<div class="image-wrap">';
106
+ echo '<img src="'. esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit_id .'/home.jpg') .'">';
107
+ echo '<div class="image-overlay"><span class="dashicons dashicons-search"></span></div>';
108
+ echo '</div>';
109
+ echo '<footer>';
110
+ echo '<h3>'. esc_html($data['name']) .'</h3>';
111
+ if ( $data['woo-builder'] ) {
112
+ echo '<span class="wpr-woo-builder-label">'. esc_html__( 'Woo Builder', 'wpr-addons' ) .'</span>';
113
+ } elseif ( $data['theme-builder'] ) {
114
+ echo '<span class="wpr-theme-builder-label">'. esc_html__( 'Theme Builder', 'wpr-addons' ) .'</span>';
115
+ }
116
+ echo '</footer>';
117
+ echo '</div>';
118
+ }
119
+
120
+ ?>
121
+
122
+ </div>
123
+
124
+ <div class="wpr-templates-kit-single">
125
+ <div class="wpr-templates-kit-grid single-grid"></div>
126
+
127
+ <footer class="action-buttons-wrap">
128
+ <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>
129
+
130
+ <div class="import-template-buttons">
131
+ <?php
132
+ echo '<button class="import-kit button">'. esc_html__('Import Templates Kit', 'wpr-addons') .' <span class="dashicons dashicons-download"></span></button>';
133
+ 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>';
134
+ ?>
135
+ <button class="import-template button"><?php printf( esc_html__( 'Import %s Template', 'wpr-addons' ), '<strong></strong>' ); ?></button>
136
+
137
+ </div>
138
+ </footer>
139
+ </div>
140
+
141
+ <div class="wpr-import-kit-popup-wrap">
142
+ <div class="overlay"></div>
143
+ <div class="wpr-import-kit-popup">
144
+ <header>
145
+ <h3><?php esc_html_e('Template Kit is being imported', 'wpr-addons'); ?><span>.</span></h3>
146
+ <span class="dashicons dashicons-no-alt close-btn"></span>
147
+ </header>
148
+ <div class="content">
149
+ <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>
150
+ <p><?php esc_html_e('Please do NOT close this browser window until import is completed.', 'wpr-addons'); ?></p>
151
+
152
+ <div class="progress-wrap">
153
+ <div class="progress-bar"></div>
154
+ <strong></strong>
155
+ </div>
156
+
157
+ <div class="wpr-import-help">
158
+ <a href="https://royal-elementor-addons.com/contactus/?ref=rea-plugin-backend-templates-import-screen" target="_blank">Having trouble with template import?&nbsp;&nbsp;Get help <span class="dashicons dashicons-sos"></span></a>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+
164
+ <div class="wpr-templates-kit-not-found">
165
+ <img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/not-found.png'); ?>">
166
+ <h1><?php esc_html_e('No Search Results Found.', 'wpr-addons'); ?></h1>
167
+ <p><?php esc_html_e('Cant find a Templates Kit you are looking for?', 'wpr-addons'); ?></p>
168
+ <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>
169
+ </div>
170
+
171
+ </div>
172
+
173
+
174
+ <?php
175
+
176
+ } // End wpr_addons_templates_kit_page()
177
+
178
+ /**
179
+ ** Get Theme Status
180
+ */
181
+ function get_theme_status() {
182
+ $theme = wp_get_theme();
183
+
184
+ // Theme installed and activate.
185
+ if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
186
+ return 'req-theme-active';
187
+ }
188
+
189
+ // Theme installed but not activate.
190
+ foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
191
+ if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
192
+ return 'req-theme-inactive';
193
+ }
194
+ }
195
+
196
+ return 'req-theme-not-installed';
197
+ }
198
+
199
+ /**
200
+ ** Install/Activate Required Theme
201
+ */
202
+ function wpr_activate_required_theme() {
203
+ // Get Current Theme
204
+ $theme = get_option('stylesheet');
205
+
206
+ // Activate Royal Elementor Kit Theme
207
+ if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
208
+ && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
209
+ switch_theme( 'royal-elementor-kit' );
210
+ set_transient( 'royal-elementor-kit_activation_notice', true );
211
+ }
212
+
213
+ // TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
214
+ }
215
+
216
+ /**
217
+ ** Activate Required Plugins
218
+ */
219
+ function wpr_activate_required_plugins() {
220
+ if ( isset($_POST['plugin']) ) {
221
+ if ( 'contact-form-7' == $_POST['plugin'] ) {
222
+ if ( !is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
223
+ activate_plugin( 'contact-form-7/wp-contact-form-7.php' );
224
+ }
225
+ } elseif ( 'woocommerce' == $_POST['plugin'] ) {
226
+ if ( !is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
227
+ activate_plugin( 'woocommerce/woocommerce.php' );
228
+ }
229
+ } elseif ( 'media-library-assistant' == $_POST['plugin'] ) {
230
+ if ( !is_plugin_active( 'media-library-assistant/index.php' ) ) {
231
+ activate_plugin( 'media-library-assistant/index.php' );
232
+ }
233
+ }
234
+ }
235
+ }
236
+
237
+ /**
238
+ ** Deactivate Extra Plugins
239
+ */
240
+ function wpr_fix_royal_compatibility() {
241
+ // Get currently active plugins
242
+ $active_plugins = (array) get_option( 'active_plugins', array() );
243
+ $active_plugins = array_values($active_plugins);
244
+ $required_plugins = [
245
+ 'elementor/elementor.php',
246
+ 'royal-elementor-addons/wpr-addons.php',
247
+ 'royal-elementor-addons-pro/wpr-addons-pro.php',
248
+ 'wpr-addons-pro/wpr-addons-pro.php',
249
+ 'contact-form-7/wp-contact-form-7.php',
250
+ 'woocommerce/woocommerce.php',
251
+ 'really-simple-ssl/rlrsssl-really-simple-ssl.php',
252
+ 'wp-mail-smtp/wp_mail_smtp.php',
253
+ 'updraftplus/updraftplus.php',
254
+ 'temporary-login-without-password/temporary-login-without-password.php',
255
+ 'wp-reset/wp-reset.php'
256
+ ];
257
+
258
+ // Deactivate Extra Import Plugins
259
+ foreach ( $active_plugins as $key => $value ) {
260
+ if ( ! in_array($value, $required_plugins) ) {
261
+ $active_key = array_search($value, $active_plugins);;
262
+ unset($active_plugins[$active_key]);
263
+ }
264
+ }
265
+
266
+ // Set Active Plugins
267
+ update_option( 'active_plugins', array_values($active_plugins) );
268
+
269
+ // Get Current Theme
270
+ $theme = get_option('stylesheet');
271
+
272
+ // Activate Royal Elementor Kit Theme
273
+ if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
274
+ && 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
275
+ switch_theme( 'royal-elementor-kit' );
276
+ set_transient( 'royal-elementor-kit_activation_notice', true );
277
+ }
278
+ }
279
+
280
+ /**
281
+ ** Import Template Kit
282
+ */
283
+ function wpr_import_templates_kit() {
284
+
285
+ // Temp Define Importers
286
+ if ( ! defined('WP_LOAD_IMPORTERS') ) {
287
+ define('WP_LOAD_IMPORTERS', true);
288
+ }
289
+
290
+ // Include if Class Does NOT Exist
291
+ if ( ! class_exists( 'WP_Import' ) ) {
292
+ $class_wp_importer = WPR_ADDONS_PATH .'admin/import/class-wordpress-importer.php';
293
+ if ( file_exists( $class_wp_importer ) ) {
294
+ require $class_wp_importer;
295
+ }
296
+ }
297
+
298
+ if ( class_exists( 'WP_Import' ) ) {
299
+ $kit = isset($_POST['wpr_templates_kit']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit'])) : '';
300
+ $file = isset($_POST['wpr_templates_kit_single']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit_single'])) : '';
301
+
302
+ // Tmp
303
+ update_option( 'wpr-import-kit-id', $kit );
304
+
305
+ // Regenerate Extra Image Sizes
306
+ add_filter( 'intermediate_image_sizes_advanced', 'disable_extra_image_sizes', 10, 3 );
307
+
308
+ // No Limit for Execution
309
+ set_time_limit(0);
310
+
311
+ // Download Import File
312
+ $local_file_path = download_template( $kit, $file );
313
+
314
+ // Prepare for Import
315
+ $wp_import = new WP_Import( $local_file_path, ['fetch_attachments' => true] );
316
+
317
+ // Import
318
+ ob_start();
319
+ $wp_import->run();
320
+ ob_end_clean();
321
+
322
+ // Delete Import File
323
+ unlink( $local_file_path );
324
+
325
+ // Send to JS
326
+ echo esc_html(serialize( $wp_import ));
327
+ }
328
+
329
+ }
330
+
331
+ /**
332
+ ** Download Template
333
+ */
334
+ function download_template( $kit, $file ) {
335
+ $file = ! $file ? 'main' : $file;
336
+
337
+ // Avoid Cache
338
+ $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
339
+
340
+ // Remote and Local Files
341
+ $remote_file_url = 'https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
342
+
343
+ // If the function it's not available, require it.
344
+ if ( ! function_exists( 'download_url' ) ) {
345
+ require_once ABSPATH . 'wp-admin/includes/file.php';
346
+ }
347
+
348
+ $tmp_file = download_url( $remote_file_url );
349
+
350
+ // WP Error.
351
+ if ( is_wp_error( $tmp_file ) ) {
352
+ // Fallback URL
353
+ $remote_file_url = 'https://mysitetutorial.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
354
+ $tmp_file = download_url( $remote_file_url );
355
+
356
+ if ( is_wp_error( $tmp_file ) ) {
357
+ wp_send_json_error([
358
+ 'error' => esc_html__('Error: Import File download failed.', 'wpr-addons'),
359
+ 'help' => esc_html__('Please contact Customer Support and send this Error.', 'wpr-addons')
360
+ ]);
361
+ return false;
362
+ }
363
+ }
364
+
365
+ // Array based on $_FILE as seen in PHP file uploads.
366
+ $file_args = [
367
+ 'name' => 'main.xml',
368
+ 'tmp_name' => $tmp_file,
369
+ 'error' => 0,
370
+ 'size' => filesize( $tmp_file ),
371
+ ];
372
+
373
+ $defaults = array(
374
+ 'test_form' => false,
375
+ 'test_size' => true,
376
+ 'test_upload' => true,
377
+ 'mimes' => [
378
+ 'xml' => 'text/xml',
379
+ 'json' => 'text/plain',
380
+ ],
381
+ 'wp_handle_sideload' => 'upload',
382
+ );
383
+
384
+ // Move the temporary file into the uploads directory.
385
+ $local_file = wp_handle_sideload( $file_args, $defaults );
386
+
387
+ if ( isset( $local_file['error'] ) ) {
388
+ wp_send_json_error([
389
+ 'error' => esc_html__('Error: Import File upload failed.', 'wpr-addons'),
390
+ 'help' => esc_html__('Please contact Customer Support and send this Error.', 'wpr-addons')
391
+ ]);
392
+ return false;
393
+ }
394
+
395
+ // Success.
396
+ return $local_file['file'];
397
+ }
398
+
399
+ /**
400
+ ** Reset Previous Import
401
+ */
402
+ function wpr_reset_previous_import() {
403
+ $args = [
404
+ 'post_type' => [
405
+ 'page',
406
+ 'post',
407
+ 'product',
408
+ 'wpr_mega_menu',
409
+ 'wpr_templates',
410
+ 'elementor_library',
411
+ 'attachment'
412
+ ],
413
+ 'post_status' => 'any',
414
+ 'posts_per_page' => '-1',
415
+ 'meta_key' => '_wpr_demo_import_item'
416
+ ];
417
+
418
+ $imported_items = new WP_Query ( $args );
419
+
420
+ if ( $imported_items->have_posts() ) {
421
+ while ( $imported_items->have_posts() ) {
422
+ $imported_items->the_post();
423
+
424
+ // Dont Delete Elementor Kit
425
+ if ( 'Default Kit' == get_the_title() ) {
426
+ continue;
427
+ }
428
+
429
+ // Delete Posts
430
+ wp_delete_post( get_the_ID(), true );
431
+ }
432
+
433
+ // Reset
434
+ wp_reset_query();
435
+
436
+ $imported_terms = get_terms([
437
+ 'meta_key' => '_wpr_demo_import_item',
438
+ 'posts_per_page' => -1,
439
+ 'hide_empty' => false,
440
+ ]);
441
+
442
+ if ( !empty($imported_terms) ) {
443
+ foreach( $imported_terms as $imported_term ) {
444
+ // Delete Terms
445
+ wp_delete_term( $imported_term->term_id, $imported_term->taxonomy );
446
+ }
447
+ }
448
+
449
+ wp_send_json_success( esc_html__('Previous Import Files have been successfully Reset.', 'wpr-addons') );
450
+ } else {
451
+ wp_send_json_success( esc_html__('There is no Data for Reset.', 'wpr-addons') );
452
+ }
453
+ }
454
+
455
+ /**
456
+ ** Import Elementor Site Settings
457
+ */
458
+ function import_elementor_site_settings( $kit ) {
459
+ // Avoid Cache
460
+ // $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
461
+
462
+ // Get Remote File
463
+ $site_settings = @file_get_contents('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/site-settings.json');
464
+
465
+ if ( false !== $site_settings ) {
466
+ $site_settings = json_decode($site_settings, true);
467
+
468
+ if ( ! empty($site_settings['settings']) ) {
469
+ $default_kit = \Elementor\Plugin::$instance->documents->get_doc_for_frontend( get_option( 'elementor_active_kit' ) );
470
+
471
+ $kit_settings = $default_kit->get_settings();
472
+ $new_settings = $site_settings['settings'];
473
+ $settings = array_merge($kit_settings, $new_settings);
474
+
475
+ $default_kit->save( [ 'settings' => $settings ] );
476
+ }
477
+ }
478
+ }
479
+
480
+ /**
481
+ ** Setup WPR Templates
482
+ */
483
+ function setup_wpr_templates( $kit ) {
484
+ $kit = isset($kit) ? sanitize_text_field(wp_unslash($kit)) : '';
485
+
486
+ // Check if kit has Theme Builder templates
487
+ $kit_name = substr($kit, 0, strripos($kit, '-v'));
488
+ $kit_version = substr($kit, (strripos($kit, '-v') + 1), strlen($kit));
489
+ $get_available_kits = WPR_Templates_Data::get_available_kits();
490
+ $has_theme_builder = $get_available_kits[$kit_name][$kit_version]['theme-builder'];
491
+ $has_woo_builder = $get_available_kits[$kit_name][$kit_version]['woo-builder'];
492
+ $has_off_canvas = $get_available_kits[$kit_name][$kit_version]['off-canvas'];
493
+
494
+ // Set Home & Blog Pages
495
+ $home_page = get_page_by_path('home-'. $kit);
496
+ $blog_page = get_page_by_path('blog-'. $kit);
497
+
498
+ if ( $home_page ) {
499
+ update_option( 'show_on_front', 'page' );
500
+ update_option( 'page_on_front', $home_page->ID );
501
+
502
+ if ( $blog_page ) {
503
+ update_option( 'page_for_posts', $blog_page->ID );
504
+ }
505
+ }
506
+
507
+ // Set Headers and Footers
508
+ update_option('wpr_header_conditions', '{"user-header-'. $kit .'-header":["global"]}');
509
+ update_post_meta( Utilities::get_template_id('user-header-'. $kit), 'wpr_header_show_on_canvas', 'true' );
510
+ update_option('wpr_footer_conditions', '{"user-footer-'. $kit .'-footer":["global"]}');
511
+ update_post_meta( Utilities::get_template_id('user-footer-'. $kit), 'wpr_footer_show_on_canvas', 'true' );
512
+
513
+ // Theme Builder
514
+ if ( $has_theme_builder ) {
515
+ 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"]}');
516
+ 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"]}');
517
+ }
518
+
519
+ // WooCommerce Builder
520
+ if ( $has_woo_builder ) {
521
+ update_option('wpr_product_archive_conditions', '{"user-product_archive-'. $kit .'-shop":["product_archive/products"],"user-product_archive-'. $kit .'-product-category-tag":["product_archive/product_cat/all","product_archive/product_tag/all"]}');
522
+ update_option('wpr_product_single_conditions', '{"user-product_single-'. $kit .'-product":["product_single/product"]}');
523
+
524
+ $shop_id = get_page_by_path('shop-'. $kit) ? get_page_by_path('shop-'. $kit)->ID : '';
525
+ $cart_id = get_page_by_path('cart-'. $kit) ? get_page_by_path('cart-'. $kit)->ID : '';
526
+ $checkout_id = get_page_by_path('checkout-'. $kit) ? get_page_by_path('checkout-'. $kit)->ID : '';
527
+ $myaccount_id = get_page_by_path('my-account-'. $kit) ? get_page_by_path('my-account-'. $kit)->ID : '';
528
+
529
+ update_option('woocommerce_shop_page_id', $shop_id);
530
+ update_option('woocommerce_cart_page_id', $cart_id);
531
+ update_option('woocommerce_checkout_page_id', $checkout_id);
532
+
533
+ if ( '' !== $myaccount_id ) {
534
+ update_option('woocommerce_myaccount_page_id', $myaccount_id);
535
+ }
536
+
537
+ // Update Options
538
+ update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
539
+
540
+ // Enable Elementor Builder for WooCommerce CPT
541
+ // $cpt_support = get_option( 'elementor_cpt_support' );
542
+
543
+ // if ( ! in_array( 'product', $cpt_support ) ) {
544
+ // $cpt_support[] = 'product';
545
+ // update_option( 'elementor_cpt_support', $cpt_support );
546
+ // }
547
+ }
548
+
549
+ // Set Popups
550
+ if ( $has_off_canvas ) {
551
+ update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-off-canvas":["global"],"user-popup-'. $kit .'-popup":["global"]}');
552
+ } else {
553
+ update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-popup":["global"]}');
554
+ }
555
+ }
556
+
557
+ /**
558
+ ** Fix Elementor Images
559
+ */
560
+ function wpr_fix_elementor_images() {
561
+ $args = array(
562
+ 'post_type' => ['wpr_templates', 'wpr_mega_menu', 'page'],
563
+ 'posts_per_page' => '-1',
564
+ 'meta_key' => '_elementor_version'
565
+ );
566
+ $elementor_pages = new WP_Query ( $args );
567
+
568
+ // Check that we have query results.
569
+ if ( $elementor_pages->have_posts() ) {
570
+
571
+ // Start looping over the query results.
572
+ while ( $elementor_pages->have_posts() ) {
573
+
574
+ $elementor_pages->the_post();
575
+
576
+ // Replace Demo with Current
577
+ $site_url = get_site_url();
578
+ $site_url = str_replace( '/', '\/', $site_url );
579
+ $demo_site_url = 'https://demosites.royal-elementor-addons.com/'. get_option('wpr-import-kit-id');
580
+ $demo_site_url = str_replace( '/', '\/', $demo_site_url );
581
+
582
+ // Elementor Data
583
+ $data = get_post_meta( get_the_ID(), '_elementor_data', true );
584
+
585
+ if ( ! empty( $data ) ) {
586
+ $data = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $data);
587
+ $data = str_replace( $demo_site_url, $site_url, $data );
588
+ $data = json_decode( $data, true );
589
+ }
590
+
591
+ update_metadata( 'post', get_the_ID(), '_elementor_data', $data );
592
+
593
+ // Elementor Page Settings
594
+ $page_settings = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
595
+ $page_settings = json_encode($page_settings);
596
+
597
+ if ( ! empty( $page_settings ) ) {
598
+ $page_settings = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $page_settings);
599
+ $page_settings = str_replace( $demo_site_url, $site_url, $page_settings );
600
+ $page_settings = json_decode( $page_settings, true );
601
+ }
602
+
603
+ update_metadata( 'post', get_the_ID(), '_elementor_page_settings', $page_settings );
604
+
605
+ }
606
+
607
+ }
608
+
609
+ // Clear Elementor Cache
610
+ Plugin::$instance->files_manager->clear_cache();
611
+ }
612
+
613
+ /**
614
+ ** Final Settings Setup
615
+ */
616
+ function wpr_final_settings_setup() {
617
+ $kit = !empty(get_option('wpr-import-kit-id')) ? esc_html(get_option('wpr-import-kit-id')) : '';
618
+
619
+ // Elementor Site Settings
620
+ import_elementor_site_settings($kit);
621
+
622
+ // Setup WPR Templates
623
+ setup_wpr_templates($kit);
624
+
625
+ // Fix Elementor Images
626
+ wpr_fix_elementor_images();
627
+
628
+ // Track Kit
629
+ wpr_track_imported_kit( $kit );
630
+
631
+ // Clear DB
632
+ delete_option('wpr-import-kit-id');
633
+
634
+ // Delete Hello World Post
635
+ $post = get_page_by_path('hello-world', OBJECT, 'post');
636
+ if ( $post ) {
637
+ wp_delete_post($post->ID,true);
638
+ }
639
+
640
+ // Regenerate Extra Image Sizes
641
+ regenerate_extra_image_sizes();
642
+ }
643
+
644
+ /**
645
+ ** Regenerate Extra Image Sizes
646
+ */
647
+ function disable_extra_image_sizes( $new_sizes, $image_meta, $attachment_id ) {
648
+ $all_attachments = get_option( 'st_attachments', array() );
649
+
650
+ // If the cron job is already scheduled, bail.
651
+ if ( in_array( $attachment_id, $all_attachments, true ) ) {
652
+ return $new_sizes;
653
+ }
654
+
655
+ $all_attachments[] = $attachment_id;
656
+
657
+ update_option( 'st_attachments', $all_attachments, 'no' );
658
+
659
+ // Return blank array of sizes to not generate any sizes in this request.
660
+ return array();
661
+ }
662
+
663
+ /**
664
+ ** Regenerate Extra Image Sizes
665
+ */
666
+ function regenerate_extra_image_sizes() {
667
+ $all_attachments = get_option( 'st_attachments', array() );
668
+
669
+ if ( empty( $all_attachments ) ) {
670
+ return;
671
+ }
672
+
673
+ foreach ( $all_attachments as $attachment_id ) {
674
+ $file = get_attached_file( $attachment_id );
675
+ if ( false !== $file ) {
676
+ wp_generate_attachment_metadata( $attachment_id, $file );
677
+ }
678
+ }
679
+ update_option( 'st_attachments', array(), 'no' );
680
+ }
681
+
682
+ /**
683
+ ** Validate Image Extension
684
+ */
685
+ function wpr_validate_image_ext( $link = '' ) {
686
+ return preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-\@]+\.(jpg|png|gif|jpeg|svg)\/?$/i', $link );
687
+ }
688
+
689
+ /**
690
+ ** Set Timeout for Image Request
691
+ */
692
+ function set_image_request_timeout( $timeout_value, $url ) {
693
+ if ( strpos( $url, 'https://royal-elementor-addons.com/' ) === false ) {
694
+ return $timeout_value;
695
+ }
696
+
697
+ $valid_ext = preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-\@]+\.(jpg|png|gif|jpeg|svg)\/?$/i', $url );
698
+
699
+ if ( $valid_ext ) {
700
+ $timeout_value = 300;
701
+ }
702
+
703
+ return $timeout_value;
704
+ }
705
+
706
+ /**
707
+ ** Prevent WooCommerce creating default pages
708
+ */
709
+ function disable_default_woo_pages_creation() {
710
+ add_filter( 'woocommerce_create_pages', '__return_empty_array' );
711
+ }
712
+
713
+ /**
714
+ ** Add .xml and .svg files as supported format in the uploader.
715
+ */
716
+ function custom_upload_mimes( $mimes ) {
717
+ // Allow SVG files.
718
+ $mimes['svg'] = 'image/svg+xml';
719
+ $mimes['svgz'] = 'image/svg+xml';
720
+
721
+ // Allow XML files.
722
+ $mimes['xml'] = 'text/xml';
723
+
724
+ // Allow JSON files.
725
+ $mimes['json'] = 'application/json';
726
+
727
+ return $mimes;
728
+ }
729
+
730
+ add_filter( 'upload_mimes', 'custom_upload_mimes', 99 );
731
+
732
+ function real_mime_types_5_1_0( $defaults, $file, $filename, $mimes, $real_mime ) {
733
+ return real_mimes( $defaults, $filename );
734
+ }
735
+
736
+ function real_mime_types( $defaults, $file, $filename, $mimes ) {
737
+ return real_mimes( $defaults, $filename );
738
+ }
739
+
740
+ function real_mimes( $defaults, $filename ) {
741
+ if ( strpos( $filename, 'main' ) !== false ) {
742
+ $defaults['ext'] = 'xml';
743
+ $defaults['type'] = 'text/xml';
744
+ }
745
+
746
+ return $defaults;
747
+ }
748
+
749
+ if ( version_compare( get_bloginfo( 'version' ), '5.1.0', '>=' ) ) {
750
+ add_filter( 'wp_check_filetype_and_ext', 'real_mime_types_5_1_0', 10, 5, 99 );
751
+ } else {
752
+ add_filter( 'wp_check_filetype_and_ext', 'real_mime_types', 10, 4 );
753
+ }
754
+
755
+ /**
756
+ ** Search Query Results
757
+ */
758
+ function wpr_search_query_results() {
759
+ // Freemius OptIn
760
+ if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
761
+ return;
762
+ }
763
+
764
+ $search_query = isset($_POST['search_query']) ? sanitize_text_field(wp_unslash($_POST['search_query'])) : '';
765
+
766
+ wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-search/data', [
767
+ 'body' => [
768
+ 'search_query' => $search_query
769
+ ]
770
+ ] );
771
+ }
772
+
773
+ /**
774
+ ** Search Query Results
775
+ */
776
+ function wpr_track_imported_kit( $kit ) {
777
+ // Freemius OptIn
778
+ if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
779
+ return;
780
+ }
781
+
782
+ wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-import/data', [
783
+ 'body' => [
784
+ 'imported_kit' => $kit
785
+ ]
786
+ ] );
787
  }
admin/templates/views/astra/class-astra-compat.php CHANGED
@@ -1,84 +1,84 @@
1
- <?php
2
-
3
- use WprAddons\Admin\Includes\WPR_Render_Templates;
4
-
5
- /**
6
- * Wpr_Astra_Compat setup
7
- *
8
- */
9
-
10
- /**
11
- * Astra theme compatibility.
12
- */
13
- class Wpr_Astra_Compat {
14
-
15
- /**
16
- * Instance of Wpr_Astra_Compat.
17
- *
18
- * @var Wpr_Astra_Compat
19
- */
20
- private static $instance;
21
-
22
- /**
23
- * WPR_Render_Templates() Class
24
- */
25
- private $render_templates;
26
-
27
- /**
28
- * Initiator
29
- */
30
- public static function instance() {
31
- if ( ! isset( self::$instance ) ) {
32
- self::$instance = new Wpr_Astra_Compat();
33
-
34
- add_action( 'wp', [ self::$instance, 'hooks' ] );
35
- }
36
-
37
- return self::$instance;
38
- }
39
-
40
- /**
41
- * Run all the Actions / Filters.
42
- */
43
- public function hooks() {
44
- $this->render_templates = new WPR_Render_Templates( true );
45
-
46
- if ( $this->render_templates->is_template_available('header') ) {
47
- add_action( 'template_redirect', [ $this, 'astra_setup_header' ], 10 );
48
- add_action( 'astra_header', [$this->render_templates, 'replace_header'] );
49
- add_action( 'elementor/page_templates/canvas/before_content', [ $this->render_templates, 'add_canvas_header' ] );
50
- }
51
-
52
- if ( $this->render_templates->is_template_available('footer') ) {
53
- add_action( 'template_redirect', [ $this, 'astra_setup_footer' ], 10 );
54
- add_action( 'astra_footer', [$this->render_templates, 'replace_footer'] );
55
- add_action( 'elementor/page_templates/canvas/after_content', [ $this->render_templates, 'add_canvas_footer' ] );
56
- }
57
- }
58
-
59
- /**
60
- * Disable header from the theme.
61
- */
62
- public function astra_setup_header() {
63
- remove_action( 'astra_header', 'astra_header_markup' );
64
-
65
- // Remove the new header builder action.
66
- if ( class_exists( '\Astra_Builder_Helper' ) && \Astra_Builder_Helper::$is_header_footer_builder_active ) {
67
- remove_action( 'astra_header', [ Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ] );
68
- }
69
- }
70
-
71
- /**
72
- * Disable footer from the theme.
73
- */
74
- public function astra_setup_footer() {
75
- remove_action( 'astra_footer', 'astra_footer_markup' );
76
-
77
- // Remove the new footer builder action.
78
- if ( class_exists( '\Astra_Builder_Helper' ) && \Astra_Builder_Helper::$is_header_footer_builder_active ) {
79
- remove_action( 'astra_footer', [ Astra_Builder_Footer::get_instance(), 'footer_markup' ] );
80
- }
81
- }
82
- }
83
-
84
- Wpr_Astra_Compat::instance();
1
+ <?php
2
+
3
+ use WprAddons\Admin\Includes\WPR_Render_Templates;
4
+
5
+ /**
6
+ * Wpr_Astra_Compat setup
7
+ *
8
+ */
9
+
10
+ /**
11
+ * Astra theme compatibility.
12
+ */
13
+ class Wpr_Astra_Compat {
14
+
15
+ /**
16
+ * Instance of Wpr_Astra_Compat.
17
+ *
18
+ * @var Wpr_Astra_Compat
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * WPR_Render_Templates() Class
24
+ */
25
+ private $render_templates;
26
+
27
+ /**
28
+ * Initiator
29
+ */
30
+ public static function instance() {
31
+ if ( ! isset( self::$instance ) ) {
32
+ self::$instance = new Wpr_Astra_Compat();
33
+
34
+ add_action( 'wp', [ self::$instance, 'hooks' ] );
35
+ }
36
+
37
+ return self::$instance;
38
+ }
39
+
40
+ /**
41
+ * Run all the Actions / Filters.
42
+ */
43
+ public function hooks() {
44
+ $this->render_templates = new WPR_Render_Templates( true );
45
+
46
+ if ( $this->render_templates->is_template_available('header') ) {
47
+ add_action( 'template_redirect', [ $this, 'astra_setup_header' ], 10 );
48
+ add_action( 'astra_header', [$this->render_templates, 'replace_header'] );
49
+ add_action( 'elementor/page_templates/canvas/before_content', [ $this->render_templates, 'add_canvas_header' ] );
50
+ }
51
+
52
+ if ( $this->render_templates->is_template_available('footer') ) {
53
+ add_action( 'template_redirect', [ $this, 'astra_setup_footer' ], 10 );
54
+ add_action( 'astra_footer', [$this->render_templates, 'replace_footer'] );
55
+ add_action( 'elementor/page_templates/canvas/after_content', [ $this->render_templates, 'add_canvas_footer' ] );
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Disable header from the theme.
61
+ */
62
+ public function astra_setup_header() {
63
+ remove_action( 'astra_header', 'astra_header_markup' );
64
+
65
+ // Remove the new header builder action.
66
+ if ( class_exists( '\Astra_Builder_Helper' ) && \Astra_Builder_Helper::$is_header_footer_builder_active ) {
67
+ remove_action( 'astra_header', [ Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ] );
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Disable footer from the theme.
73
+ */
74
+ public function astra_setup_footer() {
75
+ remove_action( 'astra_footer', 'astra_footer_markup' );
76
+
77
+ // Remove the new footer builder action.
78
+ if ( class_exists( '\Astra_Builder_Helper' ) && \Astra_Builder_Helper::$is_header_footer_builder_active ) {
79
+ remove_action( 'astra_footer', [ Astra_Builder_Footer::get_instance(), 'footer_markup' ] );
80
+ }
81
+ }
82
+ }
83
+
84
+ Wpr_Astra_Compat::instance();
admin/templates/views/generatepress/class-generatepress-compat.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
-
3
- use WprAddons\Admin\Includes\WPR_Render_Templates;
4
-
5
- /**
6
- * Wpr_GeneratePress_Compat setup
7
- *
8
- * @since 1.0
9
- */
10
- class Wpr_GeneratePress_Compat {
11
-
12
- /**
13
- * Instance of Wpr_GeneratePress_Compat
14
- *
15
- * @var Wpr_GeneratePress_Compat
16
- */
17
- private static $instance;
18
-
19
- /**
20
- * WPR_Render_Templates() Class
21
- */
22
- private $render_templates;
23
-
24
- /**
25
- * Initiator
26
- */
27
- public static function instance() {
28
- if ( ! isset( self::$instance ) ) {
29
- self::$instance = new Wpr_GeneratePress_Compat();
30
-
31
- add_action( 'wp', [ self::$instance, 'hooks' ] );
32
- }
33
-
34
- return self::$instance;
35
- }
36
-
37
- /**
38
- * Run all the Actions / Filters.
39
- */
40
- public function hooks() {
41
- $this->render_templates = new WPR_Render_Templates( true );
42
-
43
- if ( $this->render_templates->is_template_available('header') ) {
44
- add_action( 'template_redirect', [ $this, 'generatepress_setup_header' ] );
45
- add_action( 'generate_header', [$this->render_templates, 'replace_header'] );
46
- add_action( 'elementor/page_templates/canvas/before_content', [ $this->render_templates, 'add_canvas_header' ] );
47
- }
48
-
49
- if ( $this->render_templates->is_template_available('footer') ) {
50
- add_action( 'template_redirect', [ $this, 'generatepress_setup_footer' ] );
51
- add_action( 'generate_footer', [$this->render_templates, 'replace_footer'] );
52
- add_action( 'elementor/page_templates/canvas/after_content', [ $this->render_templates, 'add_canvas_footer' ] );
53
- }
54
- }
55
-
56
- /**
57
- * Disable header from the theme.
58
- */
59
- public function generatepress_setup_header() {
60
- remove_action( 'generate_header', 'generate_construct_header' );
61
- }
62
-
63
- /**
64
- * Disable footer from the theme.
65
- */
66
- public function generatepress_setup_footer() {
67
- remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
68
- remove_action( 'generate_footer', 'generate_construct_footer' );
69
- }
70
-
71
- }
72
-
73
- Wpr_GeneratePress_Compat::instance();
1
+ <?php
2
+
3
+ use WprAddons\Admin\Includes\WPR_Render_Templates;
4
+
5
+ /**
6
+ * Wpr_GeneratePress_Compat setup
7
+ *
8
+ * @since 1.0
9
+ */
10
+ class Wpr_GeneratePress_Compat {
11
+
12
+ /**
13
+ * Instance of Wpr_GeneratePress_Compat
14
+ *
15
+ * @var Wpr_GeneratePress_Compat
16
+ */
17
+ private static $instance;
18
+
19
+ /**
20
+ * WPR_Render_Templates() Class
21
+ */
22
+ private $render_templates;
23
+
24
+ /**
25
+ * Initiator
26
+ */
27
+ public static function instance() {
28
+ if ( ! isset( self::$instance ) ) {
29
+ self::$instance = new Wpr_GeneratePress_Compat();
30
+
31
+ add_action( 'wp', [ self::$instance, 'hooks' ] );
32
+ }
33
+
34
+ return self::$instance;
35
+ }
36
+
37
+ /**
38
+ * Run all the Actions / Filters.
39
+ */
40
+ public function hooks() {
41
+ $this->render_templates = new WPR_Render_Templates( true );
42
+
43
+ if ( $this->render_templates->is_template_available('header') ) {
44
+ add_action( 'template_redirect', [ $this, 'generatepress_setup_header' ] );
45
+ add_action( 'generate_header', [$this->render_templates, 'replace_header'] );
46
+ add_action( 'elementor/page_templates/canvas/before_content', [ $this->render_templates, 'add_canvas_header' ] );
47
+ }
48
+
49
+ if ( $this->render_templates->is_template_available('footer') ) {
50
+ add_action( 'template_redirect', [ $this, 'generatepress_setup_footer' ] );
51
+ add_action( 'generate_footer', [$this->render_templates, 'replace_footer'] );
52
+ add_action( 'elementor/page_templates/canvas/after_content', [ $this->render_templates, 'add_canvas_footer' ] );
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Disable header from the theme.
58
+ */
59
+ public function generatepress_setup_header() {
60
+ remove_action( 'generate_header', 'generate_construct_header' );
61
+ }
62
+
63
+ /**
64
+ * Disable footer from the theme.
65
+ */
66
+ public function generatepress_setup_footer() {
67
+ remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
68
+ remove_action( 'generate_footer', 'generate_construct_footer' );
69
+ }
70
+
71
+ }
72
+
73
+ Wpr_GeneratePress_Compat::instance();
admin/templates/views/storefront/class-storefront-compat.php CHANGED
@@ -3,7 +3,7 @@
3
  use WprAddons\Admin\Includes\WPR_Render_Templates;
4
 
5
  /**
6
- * Astra theme compatibility.
7
  */
8
  class Wpr_Storefront_Compat {
9
 
3
  use WprAddons\Admin\Includes\WPR_Render_Templates;
4
 
5
  /**
6
+ * Storefront theme compatibility.
7
  */
8
  class Wpr_Storefront_Compat {
9
 
admin/templates/wpr-templates-library-blocks.php CHANGED
@@ -1,167 +1,167 @@
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_Blocks setup
12
- *
13
- * @since 1.0
14
- */
15
- class WPR_Templates_Library_Blocks {
16
-
17
- /**
18
- ** Constructor
19
- */
20
- public function __construct() {
21
-
22
- // Template Library Popup
23
- add_action( 'wp_ajax_render_library_templates_blocks', [ $this, 'render_library_templates_blocks' ] );
24
-
25
- }
26
-
27
- /**
28
- ** Template Library Popup
29
- */
30
- public static function render_library_templates_blocks() {
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 data-filter="all"><?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
-
50
- <li data-filter="all"><?php esc_html_e( 'All', 'wpr-addons' ) ?></li>
51
-
52
- <?php
53
-
54
- $modules = Utilities::get_available_modules( Utilities::get_registered_modules() );
55
-
56
- $exclude_widgets = [
57
- 'logo',
58
- 'mega-menu',
59
- 'forms',
60
- 'phone-call',
61
- 'back-to-top',
62
- 'popup-trigger',
63
- 'lottie-animations',
64
- 'taxonomy-list',
65
- 'page-list',
66
- 'elementor-template',
67
- 'flip-carousel',
68
- 'feature-list',
69
- 'dual-color-heading',
70
- 'reading-progress-bar',
71
- 'image-accordion',
72
- 'advanced-accordion',
73
- 'charts',
74
- ];
75
-
76
- foreach ($modules as $title => $slug) {
77
- if ( ! in_array($slug[0], $exclude_widgets) ) {
78
- echo '<li data-filter="'. esc_attr($slug[0]) .'">'. esc_html($title) .'</li>';
79
- }
80
- }
81
-
82
- ?>
83
- </ul>
84
- </div>
85
- </div>
86
-
87
- <div class="wpr-tplib-sub-filters">
88
- <ul>
89
- <li data-sub-filter="all" class="wpr-tplib-activ-filter"><?php esc_html_e( 'All', 'wpr-addons' ); ?></li>
90
- <li data-sub-filter="grid"><?php esc_html_e( 'Grid', 'wpr-addons' ) ?></li>
91
- <li data-sub-filter="slider"><?php esc_html_e( 'Slider', 'wpr-addons' ) ?></li>
92
- <li data-sub-filter="carousel"><?php esc_html_e( 'Carousel', 'wpr-addons' ) ?></li>
93
- </ul>
94
- </div>
95
- </div>
96
- </div>
97
-
98
- <div class="wpr-tplib-template-gird elementor-clearfix">
99
- <div class="wpr-tplib-template-gird-inner">
100
-
101
- <?php
102
-
103
- foreach ($modules as $title => $data) :
104
- $module_slug = $data[0];
105
- $blocks = WPR_Templates_Data::get_available_blocks();
106
-
107
- if ( !isset($blocks[$module_slug]) ) {
108
- continue;
109
- }
110
-
111
- for ( $i=0; $i < count($blocks[$module_slug]); $i++ ) :
112
-
113
- $template_slug = array_keys($blocks[$module_slug])[$i];
114
- $template_sub = isset($blocks[$module_slug][$template_slug]['sub']) ? $blocks[$module_slug][$template_slug]['sub'] : '';
115
- $template_title = $title .' '. $template_slug;
116
- $preview_type = $blocks[$module_slug][$template_slug]['type'];
117
- $preview_url = $blocks[$module_slug][$template_slug]['url'];
118
- $template_class = (strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code()) || (strpos($template_slug, 'zzz') && !wpr_fs()->can_use_premium_code()) ? ' wpr-tplib-pro-wrap' : '';
119
-
120
- if (defined('WPR_ADDONS_PRO_VERSION') && wpr_fs()->can_use_premium_code()) {
121
- $template_class .= ' wpr-tplib-pro-active';
122
- }
123
-
124
- $template_slug_for_image = strpos($template_slug, 'zzz') ? substr($template_slug, 0, -4) : $template_slug;
125
-
126
- ?>
127
-
128
- <div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
129
- <div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($module_slug); ?>" data-sub-filter="<?php echo esc_attr($template_sub); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
130
- <div class="wpr-tplib-template-media">
131
- <img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/'. $module_slug .'/'. $template_slug_for_image .'.jpg'); ?>">
132
- <div class="wpr-tplib-template-media-overlay">
133
- <i class="eicon-eye"></i>
134
- </div>
135
- </div>
136
- <div class="wpr-tplib-template-footer elementor-clearfix">
137
- <?php if ( !defined('WPR_ADDONS_PRO_VERSION') && ! wpr_fs()->can_use_premium_code() ) : ?>
138
- <h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', ' Pro', $template_title)) : esc_html(str_replace('-zzz', ' Pro', $template_title)); ?></h3>
139
- <?php else : ?>
140
- <h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', '', $template_title)) : esc_html(str_replace('-zzz', '', $template_title)); ?></h3>
141
- <?php endif; ?>
142
-
143
- <?php if ( ( strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code() ) || ( strpos($template_slug, 'zzz') ) && !wpr_fs()->can_use_premium_code() ) : ?>
144
- <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>
145
- <?php else : ?>
146
- <span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
147
- <?php endif; ?>
148
- </div>
149
- </div>
150
- </div>
151
-
152
- <?php endfor; ?>
153
- <?php endforeach;?>
154
-
155
- </div>
156
- </div>
157
-
158
- <?php
159
-
160
- $current_screen = get_current_screen();
161
-
162
- if ( !(isset($current_screen) && 'royal-addons_page_wpr-premade-blocks' === $current_screen->id) ) {
163
- exit;
164
- }
165
- }
166
-
167
- }
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_Blocks setup
12
+ *
13
+ * @since 1.0
14
+ */
15
+ class WPR_Templates_Library_Blocks {
16
+
17
+ /**
18
+ ** Constructor
19
+ */
20
+ public function __construct() {
21
+
22
+ // Template Library Popup
23
+ add_action( 'wp_ajax_render_library_templates_blocks', [ $this, 'render_library_templates_blocks' ] );
24
+
25
+ }
26
+
27
+ /**
28
+ ** Template Library Popup
29
+ */
30
+ public static function render_library_templates_blocks() {
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 data-filter="all"><?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
+
50
+ <li data-filter="all"><?php esc_html_e( 'All', 'wpr-addons' ) ?></li>
51
+
52
+ <?php
53
+
54
+ $modules = Utilities::get_available_modules( Utilities::get_registered_modules() );
55
+
56
+ $exclude_widgets = [
57
+ 'logo',
58
+ 'mega-menu',
59
+ 'forms',
60
+ 'phone-call',
61
+ 'back-to-top',
62
+ 'popup-trigger',
63
+ 'lottie-animations',
64
+ 'taxonomy-list',
65
+ 'page-list',
66
+ 'elementor-template',
67
+ 'flip-carousel',
68
+ 'feature-list',
69
+ 'dual-color-heading',
70
+ 'reading-progress-bar',
71
+ 'image-accordion',
72
+ 'advanced-accordion',
73
+ 'charts',
74
+ ];
75
+
76
+ foreach ($modules as $title => $slug) {
77
+ if ( ! in_array($slug[0], $exclude_widgets) ) {
78
+ echo '<li data-filter="'. esc_attr($slug[0]) .'">'. esc_html($title) .'</li>';
79
+ }
80
+ }
81
+
82
+ ?>
83
+ </ul>
84
+ </div>
85
+ </div>
86
+
87
+ <div class="wpr-tplib-sub-filters">
88
+ <ul>
89
+ <li data-sub-filter="all" class="wpr-tplib-activ-filter"><?php esc_html_e( 'All', 'wpr-addons' ); ?></li>
90
+ <li data-sub-filter="grid"><?php esc_html_e( 'Grid', 'wpr-addons' ) ?></li>
91
+ <li data-sub-filter="slider"><?php esc_html_e( 'Slider', 'wpr-addons' ) ?></li>
92
+ <li data-sub-filter="carousel"><?php esc_html_e( 'Carousel', 'wpr-addons' ) ?></li>
93
+ </ul>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
98
+ <div class="wpr-tplib-template-gird elementor-clearfix">
99
+ <div class="wpr-tplib-template-gird-inner">
100
+
101
+ <?php
102
+
103
+ foreach ($modules as $title => $data) :
104
+ $module_slug = $data[0];
105
+ $blocks = WPR_Templates_Data::get_available_blocks();
106
+
107
+ if ( !isset($blocks[$module_slug]) ) {
108
+ continue;
109
+ }
110
+
111
+ for ( $i=0; $i < count($blocks[$module_slug]); $i++ ) :
112
+
113
+ $template_slug = array_keys($blocks[$module_slug])[$i];
114
+ $template_sub = isset($blocks[$module_slug][$template_slug]['sub']) ? $blocks[$module_slug][$template_slug]['sub'] : '';
115
+ $template_title = $title .' '. $template_slug;
116
+ $preview_type = $blocks[$module_slug][$template_slug]['type'];
117
+ $preview_url = $blocks[$module_slug][$template_slug]['url'];
118
+ $template_class = (strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code()) || (strpos($template_slug, 'zzz') && !wpr_fs()->can_use_premium_code()) ? ' wpr-tplib-pro-wrap' : '';
119
+
120
+ if (defined('WPR_ADDONS_PRO_VERSION') && wpr_fs()->can_use_premium_code()) {
121
+ $template_class .= ' wpr-tplib-pro-active';
122
+ }
123
+
124
+ $template_slug_for_image = strpos($template_slug, 'zzz') ? substr($template_slug, 0, -4) : $template_slug;
125
+
126
+ ?>
127
+
128
+ <div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
129
+ <div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($module_slug); ?>" data-sub-filter="<?php echo esc_attr($template_sub); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
130
+ <div class="wpr-tplib-template-media">
131
+ <img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/'. $module_slug .'/'. $template_slug_for_image .'.jpg'); ?>">
132
+ <div class="wpr-tplib-template-media-overlay">
133
+ <i class="eicon-eye"></i>
134
+ </div>
135
+ </div>
136
+ <div class="wpr-tplib-template-footer elementor-clearfix">
137
+ <?php if ( !defined('WPR_ADDONS_PRO_VERSION') && ! wpr_fs()->can_use_premium_code() ) : ?>
138
+ <h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', ' Pro', $template_title)) : esc_html(str_replace('-zzz', ' Pro', $template_title)); ?></h3>
139
+ <?php else : ?>
140
+ <h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', '', $template_title)) : esc_html(str_replace('-zzz', '', $template_title)); ?></h3>
141
+ <?php endif; ?>
142
+
143
+ <?php if ( ( strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code() ) || ( strpos($template_slug, 'zzz') ) && !wpr_fs()->can_use_premium_code() ) : ?>
144
+ <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>
145
+ <?php else : ?>
146
+ <span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
147
+ <?php endif; ?>
148
+ </div>
149
+ </div>
150
+ </div>
151
+
152
+ <?php endfor; ?>
153
+ <?php endforeach;?>
154
+
155
+ </div>
156
+ </div>
157
+
158
+ <?php
159
+
160
+ $current_screen = get_current_screen();
161
+
162
+ if ( !(isset($current_screen) && 'royal-addons_page_wpr-premade-blocks' === $current_screen->id) ) {
163
+ exit;
164
+ }
165
+ }
166
+
167
+ }
admin/templates/wpr-templates-library-pages.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_Pages setup
12
+ *
13
+ * @since 1.0
14
+ */
15
+ class WPR_Templates_Library_Pages {
16
+
17
+ /**
18
+ ** Constructor
19
+ */
20
+ public function __construct() {
21
+
22
+ // Template Library Popup
23
+ add_action( 'wp_ajax_render_library_templates_pages', [ $this, 'render_library_templates_pages' ] );
24
+
25
+ }
26
+
27
+ /**
28
+ ** Template Library Popup
29
+ */
30
+ public static function render_library_templates_pages() {
31
+ $kits = WPR_Templates_Data::get_available_kits_for_pages();
32
+
33
+ ?>
34
+
35
+ <div class="wpr-tplib-template-gird elementor-clearfix">
36
+ <div class="wpr-tplib-template-gird-inner">
37
+
38
+ <?php
39
+
40
+ foreach( $kits as $kit => $data ) :
41
+
42
+ $template_title = $data['name'];
43
+ $template_class = (strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code()) ? ' wpr-tplib-pro-wrap' : '';
44
+
45
+ foreach( $data['pages'] as $page ) :
46
+
47
+ ?>
48
+
49
+ <div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
50
+ <div class="wpr-tplib-template" data-slug="<?php echo esc_attr($kit); ?>" data-filter="<?php echo esc_attr($kit); ?>">
51
+ <div class="wpr-tplib-template-media">
52
+ <img src="<?php echo esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/'. $page .'.jpg'); ?>">
53
+ <div class="wpr-tplib-template-media-overlay">
54
+ <i class="eicon-eye"></i>
55
+ </div>
56
+ </div>
57
+ <div class="wpr-tplib-template-footer elementor-clearfix">
58
+ <h3><?php echo esc_html($template_title); ?></h3>
59
+
60
+ <?php if ( strpos($kit, 'pro') && !wpr_fs()->can_use_premium_code() ) : ?>
61
+ <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>
62
+ <?php else : ?>
63
+ <span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
64
+ <?php endif; ?>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <?php endforeach; ?>
70
+
71
+ <?php endforeach; ?>
72
+
73
+ </div>
74
+ </div>
75
+
76
+ <?php
77
+
78
+ wp_die();
79
+ }
80
+
81
+ }
admin/templates/wpr-templates-pages.php CHANGED
@@ -1,52 +1,52 @@
1
- <?php
2
- namespace WprAddons\Admin\Templates;
3
-
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit; // Exit if accessed directly.
6
- }
7
-
8
- /**
9
- * WPR_Templates_Library_Pages setup
10
- *
11
- * @since 1.0
12
- */
13
- class WPR_Templates_Library_Pages {
14
-
15
- /**
16
- ** Constructor
17
- */
18
- public function __construct() {
19
-
20
- // Template Library Popup
21
- add_action( 'wp_ajax_render_library_templates_pages', [ $this, 'render_library_templates_pages' ] );
22
-
23
- }
24
-
25
- /**
26
- ** Template Library Popup
27
- */
28
- public function render_library_templates_pages() {
29
- ?>
30
-
31
- <div class="wpr-tplib-sidebar">
32
- <ul>
33
- <li>Home</li>
34
- <li>Blog</li>
35
- <li>Landing</li>
36
- </ul>
37
- </div>
38
-
39
- <div class="wpr-tplib-template-gird">
40
- <div class="wpr-tplib-template" data-slug="page-1">Page 1</div>
41
- <div class="wpr-tplib-template" data-slug="page-2">Page 2</div>
42
- <div class="wpr-tplib-template">Page 3</div>
43
- <div class="wpr-tplib-template">Page 4</div>
44
- <div class="wpr-tplib-template">Page 5</div>
45
- <div class="wpr-tplib-template">Page 6</div>
46
- </div>
47
-
48
-
49
- <?php exit();
50
- }
51
-
52
  }
1
+ <?php
2
+ namespace WprAddons\Admin\Templates;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * WPR_Templates_Library_Pages setup
10
+ *
11
+ * @since 1.0
12
+ */
13
+ class WPR_Templates_Library_Pages {
14
+
15
+ /**
16
+ ** Constructor
17
+ */
18
+ public function __construct() {
19
+
20
+ // Template Library Popup
21
+ add_action( 'wp_ajax_render_library_templates_pages', [ $this, 'render_library_templates_pages' ] );
22
+
23
+ }
24
+
25
+ /**
26
+ ** Template Library Popup
27
+ */
28
+ public function render_library_templates_pages() {
29
+ ?>
30
+
31
+ <div class="wpr-tplib-sidebar">
32
+ <ul>
33
+ <li>Home</li>
34
+ <li>Blog</li>
35
+ <li>Landing</li>
36
+ </ul>
37
+ </div>
38
+
39
+ <div class="wpr-tplib-template-gird">
40
+ <div class="wpr-tplib-template" data-slug="page-1">Page 1</div>
41
+ <div class="wpr-tplib-template" data-slug="page-2">Page 2</div>
42
+ <div class="wpr-tplib-template">Page 3</div>
43
+ <div class="wpr-tplib-template">Page 4</div>
44
+ <div class="wpr-tplib-template">Page 5</div>
45
+ <div class="wpr-tplib-template">Page 6</div>
46
+ </div>
47
+
48
+
49
+ <?php exit();
50
+ }
51
+
52
  }
admin/theme-builder.php CHANGED
@@ -1,164 +1,164 @@
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
-
32
- <?php
33
- if ( ! class_exists( 'WooCommerce' ) && ('wpr_tab_product_archive' === $_GET['tab'] || 'wpr_tab_product_single' === $_GET['tab'] )) {
34
- echo '<div></div>';
35
- }
36
- ?>
37
- </div>
38
-
39
- <a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-how-to-use-theme-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
40
- <?php echo esc_html__( 'How to use Theme Builder', 'wpr-addons' ); ?>
41
- <span class="dashicons dashicons-video-alt3"></span>
42
- </a>
43
- <a href="https://www.youtube.com/watch?v=f_3tNiBC3dw" class="wpr-how-to-use-woo-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
44
- <?php echo esc_html__( 'How to use WooCommerce Builder', 'wpr-addons' ); ?>
45
- <span class="dashicons dashicons-video-alt3"></span>
46
- </a>
47
-
48
- <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
49
- <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
50
- <span class="dashicons dashicons-star-empty"></span>
51
- </a>
52
- </div>
53
- </div>
54
-
55
- <div class="wpr-settings-page">
56
- <form method="post" action="options.php">
57
- <?php
58
-
59
- // Active Tab
60
- $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
61
-
62
- ?>
63
-
64
- <!-- Template ID Holder -->
65
- <input type="hidden" name="wpr_template" id="wpr_template" value="">
66
-
67
- <!-- Conditions Popup -->
68
- <?php WPR_Templates_Loop::render_conditions_popup(true); ?>
69
-
70
- <!-- Create Templte Popup -->
71
- <?php WPR_Templates_Loop::render_create_template_popup(); ?>
72
-
73
- <!-- Tabs -->
74
- <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
75
- <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' : ''; ?>">
76
- <?php esc_html_e( 'Header', 'wpr-addons' ); ?>
77
- </a>
78
- <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' : ''; ?>">
79
- <?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
80
- </a>
81
- <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' : ''; ?>">
82
- <?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
83
- </a>
84
- <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' : ''; ?>">
85
- <?php esc_html_e( 'Single', 'wpr-addons' ); ?>
86
- </a>
87
-
88
- <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' : ''; ?>">
89
- <?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
90
- </a>
91
- <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' : ''; ?>">
92
- <?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
93
- </a>
94
-
95
- <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' : ''; ?>">
96
- <?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
97
- </a>
98
- </div>
99
-
100
- <?php if ( $active_tab == 'wpr_tab_header' ) : ?>
101
-
102
- <!-- Save Conditions -->
103
- <input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
104
-
105
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
106
-
107
- <?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
108
-
109
- <!-- Save Conditions -->
110
- <input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
111
-
112
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
113
-
114
- <?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
115
-
116
- <!-- Save Conditions -->
117
- <input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
118
-
119
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
120
-
121
- <?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
122
-
123
- <!-- Save Conditions -->
124
- <input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
125
-
126
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
127
-
128
- <?php elseif ( $active_tab == 'wpr_tab_product_archive' ) : ?>
129
-
130
- <?php if ( class_exists( 'WooCommerce' ) ) : ?>
131
- <!-- Save Conditions -->
132
- <input type="hidden" name="wpr_product_archive_conditions" id="wpr_product_archive_conditions" value="<?php echo esc_attr(get_option('wpr_product_archive_conditions', '[]')); ?>">
133
-
134
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'product_archive' ); ?>
135
- <?php else : ?>
136
- <div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product archive templates!</div>
137
- <?php endif; ?>
138
-
139
- <?php elseif ( $active_tab == 'wpr_tab_product_single' ) : ?>
140
-
141
- <?php if ( class_exists( 'WooCommerce' ) ) : ?>
142
- <!-- Save Conditions -->
143
- <input type="hidden" name="wpr_product_single_conditions" id="wpr_product_single_conditions" value="<?php echo esc_attr(get_option('wpr_product_single_conditions', '[]')); ?>">
144
-
145
- <?php WPR_Templates_Loop::render_theme_builder_templates( 'product_single' ); ?>
146
- <?php else : ?>
147
- <div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product single templates!</div>
148
- <?php endif ; ?>
149
-
150
- <?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
151
-
152
- <?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
153
-
154
- <?php endif; ?>
155
-
156
- </form>
157
- </div>
158
-
159
- </div>
160
-
161
-
162
- <?php
163
-
164
  } // 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
+
32
+ <?php
33
+ if ( ! class_exists( 'WooCommerce' ) && ('wpr_tab_product_archive' === $_GET['tab'] || 'wpr_tab_product_single' === $_GET['tab'] )) {
34
+ echo '<div></div>';
35
+ }
36
+ ?>
37
+ </div>
38
+
39
+ <a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-how-to-use-theme-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
40
+ <?php echo esc_html__( 'How to use Theme Builder', 'wpr-addons' ); ?>
41
+ <span class="dashicons dashicons-video-alt3"></span>
42
+ </a>
43
+ <a href="https://www.youtube.com/watch?v=f_3tNiBC3dw" class="wpr-how-to-use-woo-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
44
+ <?php echo esc_html__( 'How to use WooCommerce Builder', 'wpr-addons' ); ?>
45
+ <span class="dashicons dashicons-video-alt3"></span>
46
+ </a>
47
+
48
+ <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
49
+ <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
50
+ <span class="dashicons dashicons-star-empty"></span>
51
+ </a>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="wpr-settings-page">
56
+ <form method="post" action="options.php">
57
+ <?php
58
+
59
+ // Active Tab
60
+ $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
61
+
62
+ ?>
63
+
64
+ <!-- Template ID Holder -->
65
+ <input type="hidden" name="wpr_template" id="wpr_template" value="">
66
+
67
+ <!-- Conditions Popup -->
68
+ <?php WPR_Templates_Loop::render_conditions_popup(true); ?>
69
+
70
+ <!-- Create Templte Popup -->
71
+ <?php WPR_Templates_Loop::render_create_template_popup(); ?>
72
+
73
+ <!-- Tabs -->
74
+ <div class="nav-tab-wrapper wpr-nav-tab-wrapper">
75
+ <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' : ''; ?>">
76
+ <?php esc_html_e( 'Header', 'wpr-addons' ); ?>
77
+ </a>
78
+ <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' : ''; ?>">
79
+ <?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
80
+ </a>
81
+ <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' : ''; ?>">
82
+ <?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
83
+ </a>
84
+ <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' : ''; ?>">
85
+ <?php esc_html_e( 'Single', 'wpr-addons' ); ?>
86
+ </a>
87
+
88
+ <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' : ''; ?>">
89
+ <?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
90
+ </a>
91
+ <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' : ''; ?>">
92
+ <?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
93
+ </a>
94
+
95
+ <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' : ''; ?>">
96
+ <?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
97
+ </a>
98
+ </div>
99
+
100
+ <?php if ( $active_tab == 'wpr_tab_header' ) : ?>
101
+
102
+ <!-- Save Conditions -->
103
+ <input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
104
+
105
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
106
+
107
+ <?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
108
+
109
+ <!-- Save Conditions -->
110
+ <input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
111
+
112
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
113
+
114
+ <?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
115
+
116
+ <!-- Save Conditions -->
117
+ <input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
118
+
119
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
120
+
121
+ <?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
122
+
123
+ <!-- Save Conditions -->
124
+ <input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
125
+
126
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
127
+
128
+ <?php elseif ( $active_tab == 'wpr_tab_product_archive' ) : ?>
129
+
130
+ <?php if ( class_exists( 'WooCommerce' ) ) : ?>
131
+ <!-- Save Conditions -->
132
+ <input type="hidden" name="wpr_product_archive_conditions" id="wpr_product_archive_conditions" value="<?php echo esc_attr(get_option('wpr_product_archive_conditions', '[]')); ?>">
133
+
134
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'product_archive' ); ?>
135
+ <?php else : ?>
136
+ <div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product archive templates!</div>
137
+ <?php endif; ?>
138
+
139
+ <?php elseif ( $active_tab == 'wpr_tab_product_single' ) : ?>
140
+
141
+ <?php if ( class_exists( 'WooCommerce' ) ) : ?>
142
+ <!-- Save Conditions -->
143
+ <input type="hidden" name="wpr_product_single_conditions" id="wpr_product_single_conditions" value="<?php echo esc_attr(get_option('wpr_product_single_conditions', '[]')); ?>">
144
+
145
+ <?php WPR_Templates_Loop::render_theme_builder_templates( 'product_single' ); ?>
146
+ <?php else : ?>
147
+ <div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product single templates!</div>
148
+ <?php endif ; ?>
149
+
150
+ <?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
151
+
152
+ <?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
153
+
154
+ <?php endif; ?>
155
+
156
+ </form>
157
+ </div>
158
+
159
+ </div>
160
+
161
+
162
+ <?php
163
+
164
  } // End wpr_addons_theme_builder_page()
assets/css/admin/mega-menu.css CHANGED
@@ -1,444 +1,444 @@
1
- .wpr-mm-settings-btn {
2
- visibility: hidden;
3
- opacity: 0;
4
- }
5
-
6
- .menu-item-depth-0:hover .wpr-mm-settings-btn {
7
- visibility: visible;
8
- opacity: 1;
9
- }
10
-
11
- .wpr-mm-settings-btn {
12
- position: absolute;
13
- top: 5px;
14
- left: 260px;
15
- display: -webkit-box;
16
- display: -ms-flexbox;
17
- display: flex;
18
- -webkit-box-align: center;
19
- -ms-flex-align: center;
20
- align-items: center;
21
- padding: 5px 14px 7px;
22
- color: #fff;
23
- background: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
24
- background: -o-linear-gradient(#6A4BFF, #7E94FE);
25
- background: linear-gradient(#6A4BFF, #7E94FE);
26
- font-weight: 500;
27
- border-radius: 3px;
28
- cursor: pointer;
29
- }
30
-
31
- .wpr-mm-settings-btn span {
32
- content: 'R';
33
- display: inline-block;
34
- font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
35
- font-size: 8px;
36
- font-weight: bold;
37
- text-align: center;
38
- color: #ffffff;
39
- background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
40
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
41
- background-image: linear-gradient(#6A4BFF, #7E94FE);
42
- -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
43
- box-shadow: 0 0 2px 2px #b8c7ff;
44
- width: 16px;
45
- height: 16px;
46
- line-height: 16px;
47
- border-radius: 15px;
48
- margin-right: 7px;
49
- }
50
-
51
- .wpr-mm-settings-popup-wrap {
52
- display: none;
53
- position: absolute;
54
- top: 0;
55
- left: 0;
56
- right: 0;
57
- bottom: 0;
58
- z-index: 9999999;
59
- background-color: rgba(0,0,0,0.3);
60
- }
61
-
62
- .wpr-mm-settings-popup {
63
- position: fixed;
64
- top: 50%;
65
- left: 50%;
66
- -webkit-transform: translate(-50%,-50%);
67
- -ms-transform: translate(-50%,-50%);
68
- transform: translate(-50%,-50%);
69
- width: 100%;
70
- max-width: 700px;
71
- margin-left: 80px;
72
- background-color: #fff;
73
- -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
74
- box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
75
- }
76
-
77
- .wpr-mm-popup-title {
78
- margin-left: auto;
79
- margin-right: 10px;
80
- border: 1px solid #dcdcde;
81
- background-color: #f6f7f7;
82
- padding: 2px 10px 4px;
83
- }
84
-
85
- .wpr-mm-settings-close-popup-btn {
86
- cursor: pointer;
87
- }
88
-
89
- .wpr-mm-settings-popup-header {
90
- display: -webkit-box;
91
- display: -ms-flexbox;
92
- display: flex;
93
- -webkit-box-align: center;
94
- -ms-flex-align: center;
95
- align-items: center;
96
- padding: 10px;
97
- border-bottom: 1px solid #e8e8e8;
98
- font-weight: 500;
99
- }
100
-
101
- .wpr-mm-popup-logo {
102
- padding: 3px;
103
- margin-right: 10px;
104
- border-radius: 50%;
105
- color: transparent;
106
- font-family: Arial,Helvetica,sans-serif;
107
- font-size: 14px;
108
- font-weight: bold;
109
- letter-spacing: 0.3px;
110
- }
111
-
112
- .wpr-mm-settings-popup-footer {
113
- display: -webkit-box;
114
- display: -ms-flexbox;
115
- display: flex;
116
- -webkit-box-pack: end;
117
- -ms-flex-pack: end;
118
- justify-content: flex-end;
119
- padding: 10px;
120
- border-top: 1px solid #e8e8e8;
121
- }
122
-
123
- .button.wpr-save-mega-menu-btn {
124
- min-height: 0;
125
- padding: 6px 18px 7px;
126
- color: #fff;
127
- background: #6A4BFF;
128
- border-radius: 3px;
129
- font-size: 12px;
130
- text-transform: uppercase;
131
- letter-spacing: 0.5px;
132
- font-weight: 600;
133
- cursor: pointer;
134
- line-height: 1;
135
- -webkit-box-shadow: none !important;
136
- box-shadow: none !important;
137
- }
138
-
139
- .button.wpr-save-mega-menu-btn:hover {
140
- color: #fff;
141
- background: #5537e1;
142
- }
143
-
144
- .wpr-save-mega-menu-btn .dashicons {
145
- display: inline;
146
- line-height: 8px;
147
- font-size: 14px;
148
- vertical-align: sub;
149
- }
150
-
151
- .wpr-mm-settings-wrap {
152
- height: 60vh;
153
- overflow-y: scroll;
154
- padding: 20px;
155
- }
156
-
157
- .wpr-mm-settings-wrap > h4 {
158
- padding: 5px 10px 7px;
159
- background-color: #f5f3f3;
160
- margin: 5px 0;
161
- }
162
-
163
- .wpr-mm-setting {
164
- display: -webkit-box;
165
- display: -ms-flexbox;
166
- display: flex;
167
- -webkit-box-align: center;
168
- -ms-flex-align: center;
169
- align-items: center;
170
- padding: 10px;
171
- }
172
-
173
- .wpr-mm-setting h4 {
174
- width: 200px;
175
- margin: 0;
176
- }
177
-
178
- .wpr-mm-setting > div,
179
- .wpr-mm-setting select,
180
- .wpr-mm-setting input[type="text"] {
181
- width: 168px;
182
- }
183
-
184
- .wpr-mm-setting input[type="number"] {
185
- width: 103px;
186
- }
187
-
188
- .wpr-mm-setting-switcher input {
189
- position: absolute;
190
- z-index: -1000;
191
- left: -1000px;
192
- overflow: hidden;
193
- clip: rect(0 0 0 0);
194
- height: 1px;
195
- width: 1px;
196
- margin: -1px;
197
- padding: 0;
198
- border: 0;
199
- }
200
-
201
- .wpr-mm-setting-switcher label {
202
- position: relative;
203
- display: block;
204
- width: 45px;
205
- height: 23px;
206
- border-radius: 20px;
207
- background: #e8e8e8;
208
- cursor: pointer;
209
- -webkit-touch-callout: none;
210
- -webkit-user-select: none;
211
- -moz-user-select: none;
212
- -ms-user-select: none;
213
- user-select: none;
214
- -webkit-transition: all 0.2s ease-in;
215
- -o-transition: all 0.2s ease-in;
216
- transition: all 0.2s ease-in;
217
- }
218
-
219
- .wpr-mm-setting-switcher input + label:after {
220
- content: ' ';
221
- display: block;
222
- position: absolute;
223
- top: 3px;
224
- left: 3px;
225
- width: 17px;
226
- height: 17px;
227
- border-radius: 50%;
228
- background: #fff;
229
- -webkit-transition: all 0.2s ease-in;
230
- -o-transition: all 0.2s ease-in;
231
- transition: all 0.2s ease-in;
232
- }
233
-
234
- .wpr-mm-setting-switcher input:checked + label {
235
- background: #6A4BFF;
236
- }
237
-
238
- .wpr-mm-setting-switcher input:checked + label:after {
239
- left: 24px;
240
- }
241
-
242
- button.wpr-edit-mega-menu-btn {
243
- padding: 3px 22px !important;
244
- font-size: 12px !important;
245
- }
246
-
247
- .wpr-edit-mega-menu-btn i {
248
- font-size: 125%;
249
- margin-right: 3px;
250
- }
251
-
252
- .wpr-mm-editor-popup-wrap {
253
- display: none;
254
- position: fixed;
255
- top: 0;
256
- left: 0;
257
- width: 100%;
258
- height: 100%;
259
- background: rgba(0,0,0,0.5);
260
- z-index: 99999999;
261
- }
262
-
263
- .wpr-mm-editor-popup-iframe {
264
- width: calc(100vw - 70px);
265
- height: calc(100vh - 70px);
266
- margin: 35px 25px;
267
- background-color: #f9f9f9;
268
- -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
269
- box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
270
- }
271
-
272
- .wpr-mm-editor-close-popup-btn {
273
- position: absolute;
274
- top: 40px;
275
- right: 55px;
276
- font-size: 50px !important;
277
- }
278
-
279
- .wpr-mm-editor-close-popup-btn span {
280
- color: #444;
281
- font-size: 25px;
282
- cursor: pointer;
283
- }
284
-
285
- .wpr-mm-editor-close-popup-btn span:hover {
286
- color: #888;
287
- }
288
-
289
- .wpr-mm-setting-radius div {
290
- display: -webkit-box;
291
- display: -ms-flexbox;
292
- display: flex;
293
- }
294
-
295
- .wpr-mm-setting-icon div span {
296
- display: -webkit-inline-box;
297
- display: -ms-inline-flexbox;
298
- display: inline-flex;
299
- -webkit-box-align: center;
300
- -ms-flex-align: center;
301
- align-items: center;
302
- -webkit-box-pack: center;
303
- -ms-flex-pack: center;
304
- justify-content: center;
305
- width: 30px;
306
- height: 30px;
307
- border: 1px solid #a4afb7;
308
- cursor: pointer;
309
- }
310
-
311
- .wpr-mm-setting-icon div span.wpr-mm-active-icon {
312
- background-color: #a4afb7;
313
- color: #fff;
314
- }
315
-
316
- .wpr-mm-setting-icon div span:first-child {
317
- border-radius: 3px 0 0 3px;
318
- }
319
-
320
- .wpr-mm-setting-icon div span:last-child {
321
- border-radius: 0 3px 3px 0;
322
- }
323
-
324
- .wpr-mm-setting-icon input[type="text"] {
325
- width: 0;
326
- padding: 0;
327
- border: 0;
328
- -webkit-box-shadow: none !important;
329
- box-shadow: none !important;
330
- margin-left: -15px;
331
- }
332
-
333
- .wpr-mm-setting.iconpicker-container .iconpicker-popover {
334
- padding: 5px;
335
- }
336
-
337
- .wpr-mm-setting.iconpicker-container .popover-title {
338
- padding: 0;
339
- }
340
-
341
- .wpr-mm-setting.iconpicker-container input[type="search"] {
342
- padding: 5px 10px;
343
- margin: 0 !important;
344
- border: 0;
345
- width: 100%;
346
- }
347
-
348
- .wpr-mm-setting.iconpicker-container .arrow {
349
- border-bottom-color: #f7f7f7 !important;
350
- top: -8px !important;
351
- }
352
-
353
- .wp-picker-input-wrap .wp-picker-container {
354
- display: none;
355
- }
356
-
357
- .wpr-mm-setting select,
358
- .wpr-mm-setting input:not(.iconpicker-input),
359
- .wpr-mm-setting button {
360
- border: 1px solid #e5e5e5 !important;
361
- }
362
-
363
- /* Pro Options */
364
- .wpr-mm-pro-setting h4:after,
365
- h4.wpr-mm-pro-heading:after {
366
- content: 'PRO';
367
- margin-left: 5px;
368
- padding: 1px 7px 2px;
369
- color: #fff;
370
- background-color: #f44;
371
- border-radius: 3px;
372
- font-size: 10px;
373
- font-weight: bold;
374
- letter-spacing: 1px;
375
- }
376
-
377
- .wpr-mm-pro-section,
378
- .wpr-mm-pro-setting > div {
379
- position: relative;
380
- }
381
-
382
- .wpr-mm-pro-section:before,
383
- .wpr-mm-pro-setting > div:before {
384
- content: 'Please upgrade to the Pro Version to access this options.';
385
- display: none;
386
- position: absolute;
387
- left: -20px;
388
- top: -65px;
389
- z-index: 2;
390
- width: 210px;
391
- padding: 10px;
392
- font-size: 12px;
393
- background-color: #fff;
394
- -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
395
- box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
396
- border: 1px solid #e8e8e8;
397
- border-radius: 4px;
398
- text-align: center;
399
- }
400
-
401
- .wpr-mm-pro-section:before {
402
- content: 'Please upgrade to the Pro Version to access these options.';
403
- top: 50%;
404
- left: 50%;
405
- -webkit-transform: translateX(-50%) translateY(-50%);
406
- -ms-transform: translateX(-50%) translateY(-50%);
407
- transform: translateX(-50%) translateY(-50%);
408
- padding: 20px 30px;
409
- font-size: 13px;
410
- }
411
-
412
- .wpr-mm-pro-section:hover:before,
413
- .wpr-mm-pro-setting > div:hover:before {
414
- display: block;
415
- }
416
-
417
- .wpr-mm-pro-setting > div:after,
418
- .wpr-mm-pro-section:after {
419
- content: '';
420
- position: absolute;
421
- top: 0;
422
- left: 0;
423
- z-index: 1;
424
- width: 100%;
425
- height: 100%;
426
- background: rgba(0,0,0,0.1);
427
- }
428
-
429
- .wpr-mm-pro-setting select {
430
- display: none;
431
- }
432
-
433
- .wpr-mm-pro-setting .wpr-mm-pro-radio {
434
- display: block;
435
- }
436
-
437
- .wpr-mm-pro-radio {
438
- display: none;
439
- padding: 5px 10px;
440
- }
441
-
442
- .wpr-mm-setting select option[value*="pro-"] {
443
- background-color: rgba(0,0,0,0.2);
444
  }
1
+ .wpr-mm-settings-btn {
2
+ visibility: hidden;
3
+ opacity: 0;
4
+ }
5
+
6
+ .menu-item-depth-0:hover .wpr-mm-settings-btn {
7
+ visibility: visible;
8
+ opacity: 1;
9
+ }
10
+
11
+ .wpr-mm-settings-btn {
12
+ position: absolute;
13
+ top: 5px;
14
+ left: 260px;
15
+ display: -webkit-box;
16
+ display: -ms-flexbox;
17
+ display: flex;
18
+ -webkit-box-align: center;
19
+ -ms-flex-align: center;
20
+ align-items: center;
21
+ padding: 5px 14px 7px;
22
+ color: #fff;
23
+ background: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
24
+ background: -o-linear-gradient(#6A4BFF, #7E94FE);
25
+ background: linear-gradient(#6A4BFF, #7E94FE);
26
+ font-weight: 500;
27
+ border-radius: 3px;
28
+ cursor: pointer;
29
+ }
30
+
31
+ .wpr-mm-settings-btn span {
32
+ content: 'R';
33
+ display: inline-block;
34
+ font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
35
+ font-size: 8px;
36
+ font-weight: bold;
37
+ text-align: center;
38
+ color: #ffffff;
39
+ background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
40
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
41
+ background-image: linear-gradient(#6A4BFF, #7E94FE);
42
+ -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
43
+ box-shadow: 0 0 2px 2px #b8c7ff;
44
+ width: 16px;
45
+ height: 16px;
46
+ line-height: 16px;
47
+ border-radius: 15px;
48
+ margin-right: 7px;
49
+ }
50
+
51
+ .wpr-mm-settings-popup-wrap {
52
+ display: none;
53
+ position: absolute;
54
+ top: 0;
55
+ left: 0;
56
+ right: 0;
57
+ bottom: 0;
58
+ z-index: 9999999;
59
+ background-color: rgba(0,0,0,0.3);
60
+ }
61
+
62
+ .wpr-mm-settings-popup {
63
+ position: fixed;
64
+ top: 50%;
65
+ left: 50%;
66
+ -webkit-transform: translate(-50%,-50%);
67
+ -ms-transform: translate(-50%,-50%);
68
+ transform: translate(-50%,-50%);
69
+ width: 100%;
70
+ max-width: 700px;
71
+ margin-left: 80px;
72
+ background-color: #fff;
73
+ -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
74
+ box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
75
+ }
76
+
77
+ .wpr-mm-popup-title {
78
+ margin-left: auto;
79
+ margin-right: 10px;
80
+ border: 1px solid #dcdcde;
81
+ background-color: #f6f7f7;
82
+ padding: 2px 10px 4px;
83
+ }
84
+
85
+ .wpr-mm-settings-close-popup-btn {
86
+ cursor: pointer;
87
+ }
88
+
89
+ .wpr-mm-settings-popup-header {
90
+ display: -webkit-box;
91
+ display: -ms-flexbox;
92
+ display: flex;
93
+ -webkit-box-align: center;
94
+ -ms-flex-align: center;
95
+ align-items: center;
96
+ padding: 10px;
97
+ border-bottom: 1px solid #e8e8e8;
98
+ font-weight: 500;
99
+ }
100
+
101
+ .wpr-mm-popup-logo {
102
+ padding: 3px;
103
+ margin-right: 10px;
104
+ border-radius: 50%;
105
+ color: transparent;
106
+ font-family: Arial,Helvetica,sans-serif;
107
+ font-size: 14px;
108
+ font-weight: bold;
109
+ letter-spacing: 0.3px;
110
+ }
111
+
112
+ .wpr-mm-settings-popup-footer {
113
+ display: -webkit-box;
114
+ display: -ms-flexbox;
115
+ display: flex;
116
+ -webkit-box-pack: end;
117
+ -ms-flex-pack: end;
118
+ justify-content: flex-end;
119
+ padding: 10px;
120
+ border-top: 1px solid #e8e8e8;
121
+ }
122
+
123
+ .button.wpr-save-mega-menu-btn {
124
+ min-height: 0;
125
+ padding: 6px 18px 7px;
126
+ color: #fff;
127
+ background: #6A4BFF;
128
+ border-radius: 3px;
129
+ font-size: 12px;
130
+ text-transform: uppercase;
131
+ letter-spacing: 0.5px;
132
+ font-weight: 600;
133
+ cursor: pointer;
134
+ line-height: 1;
135
+ -webkit-box-shadow: none !important;
136
+ box-shadow: none !important;
137
+ }
138
+
139
+ .button.wpr-save-mega-menu-btn:hover {
140
+ color: #fff;
141
+ background: #5537e1;
142
+ }
143
+
144
+ .wpr-save-mega-menu-btn .dashicons {
145
+ display: inline;
146
+ line-height: 8px;
147
+ font-size: 14px;
148
+ vertical-align: sub;
149
+ }
150
+
151
+ .wpr-mm-settings-wrap {
152
+ height: 60vh;
153
+ overflow-y: scroll;
154
+ padding: 20px;
155
+ }
156
+
157
+ .wpr-mm-settings-wrap > h4 {
158
+ padding: 5px 10px 7px;
159
+ background-color: #f5f3f3;
160
+ margin: 5px 0;
161
+ }
162
+
163
+ .wpr-mm-setting {
164
+ display: -webkit-box;
165
+ display: -ms-flexbox;
166
+ display: flex;
167
+ -webkit-box-align: center;
168
+ -ms-flex-align: center;
169
+ align-items: center;
170
+ padding: 10px;
171
+ }
172
+
173
+ .wpr-mm-setting h4 {
174
+ width: 200px;
175
+ margin: 0;
176
+ }
177
+
178
+ .wpr-mm-setting > div,
179
+ .wpr-mm-setting select,
180
+ .wpr-mm-setting input[type="text"] {
181
+ width: 168px;
182
+ }
183
+
184
+ .wpr-mm-setting input[type="number"] {
185
+ width: 103px;
186
+ }
187
+
188
+ .wpr-mm-setting-switcher input {
189
+ position: absolute;
190
+ z-index: -1000;
191
+ left: -1000px;
192
+ overflow: hidden;
193
+ clip: rect(0 0 0 0);
194
+ height: 1px;
195
+ width: 1px;
196
+ margin: -1px;
197
+ padding: 0;
198
+ border: 0;
199
+ }
200
+
201
+ .wpr-mm-setting-switcher label {
202
+ position: relative;
203
+ display: block;
204
+ width: 45px;
205
+ height: 23px;
206
+ border-radius: 20px;
207
+ background: #e8e8e8;
208
+ cursor: pointer;
209
+ -webkit-touch-callout: none;
210
+ -webkit-user-select: none;
211
+ -moz-user-select: none;
212
+ -ms-user-select: none;
213
+ user-select: none;
214
+ -webkit-transition: all 0.2s ease-in;
215
+ -o-transition: all 0.2s ease-in;
216
+ transition: all 0.2s ease-in;
217
+ }
218
+
219
+ .wpr-mm-setting-switcher input + label:after {
220
+ content: ' ';
221
+ display: block;
222
+ position: absolute;
223
+ top: 3px;
224
+ left: 3px;
225
+ width: 17px;
226
+ height: 17px;
227
+ border-radius: 50%;
228
+ background: #fff;
229
+ -webkit-transition: all 0.2s ease-in;
230
+ -o-transition: all 0.2s ease-in;
231
+ transition: all 0.2s ease-in;
232
+ }
233
+
234
+ .wpr-mm-setting-switcher input:checked + label {
235
+ background: #6A4BFF;
236
+ }
237
+
238
+ .wpr-mm-setting-switcher input:checked + label:after {
239
+ left: 24px;
240
+ }
241
+
242
+ button.wpr-edit-mega-menu-btn {
243
+ padding: 3px 22px !important;
244
+ font-size: 12px !important;
245
+ }
246
+
247
+ .wpr-edit-mega-menu-btn i {
248
+ font-size: 125%;
249
+ margin-right: 3px;
250
+ }
251
+
252
+ .wpr-mm-editor-popup-wrap {
253
+ display: none;
254
+ position: fixed;
255
+ top: 0;
256
+ left: 0;
257
+ width: 100%;
258
+ height: 100%;
259
+ background: rgba(0,0,0,0.5);
260
+ z-index: 99999999;
261
+ }
262
+
263
+ .wpr-mm-editor-popup-iframe {
264
+ width: calc(100vw - 70px);
265
+ height: calc(100vh - 70px);
266
+ margin: 35px 25px;
267
+ background-color: #f9f9f9;
268
+ -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
269
+ box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
270
+ }
271
+
272
+ .wpr-mm-editor-close-popup-btn {
273
+ position: absolute;
274
+ top: 40px;
275
+ right: 55px;
276
+ font-size: 50px !important;
277
+ }
278
+
279
+ .wpr-mm-editor-close-popup-btn span {
280
+ color: #444;
281
+ font-size: 25px;
282
+ cursor: pointer;
283
+ }
284
+
285
+ .wpr-mm-editor-close-popup-btn span:hover {
286
+ color: #888;
287
+ }
288
+
289
+ .wpr-mm-setting-radius div {
290
+ display: -webkit-box;
291
+ display: -ms-flexbox;
292
+ display: flex;
293
+ }
294
+
295
+ .wpr-mm-setting-icon div span {
296
+ display: -webkit-inline-box;
297
+ display: -ms-inline-flexbox;
298
+ display: inline-flex;
299
+ -webkit-box-align: center;
300
+ -ms-flex-align: center;
301
+ align-items: center;
302
+ -webkit-box-pack: center;
303
+ -ms-flex-pack: center;
304
+ justify-content: center;
305
+ width: 30px;
306
+ height: 30px;
307
+ border: 1px solid #a4afb7;
308
+ cursor: pointer;
309
+ }
310
+
311
+ .wpr-mm-setting-icon div span.wpr-mm-active-icon {
312
+ background-color: #a4afb7;
313
+ color: #fff;
314
+ }
315
+
316
+ .wpr-mm-setting-icon div span:first-child {
317
+ border-radius: 3px 0 0 3px;
318
+ }
319
+
320
+ .wpr-mm-setting-icon div span:last-child {
321
+ border-radius: 0 3px 3px 0;
322
+ }
323
+
324
+ .wpr-mm-setting-icon input[type="text"] {
325
+ width: 0;
326
+ padding: 0;
327
+ border: 0;
328
+ -webkit-box-shadow: none !important;
329
+ box-shadow: none !important;
330
+ margin-left: -15px;
331
+ }
332
+
333
+ .wpr-mm-setting.iconpicker-container .iconpicker-popover {
334
+ padding: 5px;
335
+ }
336
+
337
+ .wpr-mm-setting.iconpicker-container .popover-title {
338
+ padding: 0;
339
+ }
340
+
341
+ .wpr-mm-setting.iconpicker-container input[type="search"] {
342
+ padding: 5px 10px;
343
+ margin: 0 !important;
344
+ border: 0;
345
+ width: 100%;
346
+ }
347
+
348
+ .wpr-mm-setting.iconpicker-container .arrow {
349
+ border-bottom-color: #f7f7f7 !important;
350
+ top: -8px !important;
351
+ }
352
+
353
+ .wp-picker-input-wrap .wp-picker-container {
354
+ display: none;
355
+ }
356
+
357
+ .wpr-mm-setting select,
358
+ .wpr-mm-setting input:not(.iconpicker-input),
359
+ .wpr-mm-setting button {
360
+ border: 1px solid #e5e5e5 !important;
361
+ }
362
+
363
+ /* Pro Options */
364
+ .wpr-mm-pro-setting h4:after,
365
+ h4.wpr-mm-pro-heading:after {
366
+ content: 'PRO';
367
+ margin-left: 5px;
368
+ padding: 1px 7px 2px;
369
+ color: #fff;
370
+ background-color: #f44;
371
+ border-radius: 3px;
372
+ font-size: 10px;
373
+ font-weight: bold;
374
+ letter-spacing: 1px;
375
+ }
376
+
377
+ .wpr-mm-pro-section,
378
+ .wpr-mm-pro-setting > div {
379
+ position: relative;
380
+ }
381
+
382
+ .wpr-mm-pro-section:before,
383
+ .wpr-mm-pro-setting > div:before {
384
+ content: 'Please upgrade to the Pro Version to access this options.';
385
+ display: none;
386
+ position: absolute;
387
+ left: -20px;
388
+ top: -65px;
389
+ z-index: 2;
390
+ width: 210px;
391
+ padding: 10px;
392
+ font-size: 12px;
393
+ background-color: #fff;
394
+ -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
395
+ box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
396
+ border: 1px solid #e8e8e8;
397
+ border-radius: 4px;
398
+ text-align: center;
399
+ }
400
+
401
+ .wpr-mm-pro-section:before {
402
+ content: 'Please upgrade to the Pro Version to access these options.';
403
+ top: 50%;
404
+ left: 50%;
405
+ -webkit-transform: translateX(-50%) translateY(-50%);
406
+ -ms-transform: translateX(-50%) translateY(-50%);
407
+ transform: translateX(-50%) translateY(-50%);
408
+ padding: 20px 30px;
409
+ font-size: 13px;
410
+ }
411
+
412
+ .wpr-mm-pro-section:hover:before,
413
+ .wpr-mm-pro-setting > div:hover:before {
414
+ display: block;
415
+ }
416
+
417
+ .wpr-mm-pro-setting > div:after,
418
+ .wpr-mm-pro-section:after {
419
+ content: '';
420
+ position: absolute;
421
+ top: 0;
422
+ left: 0;
423
+ z-index: 1;
424
+ width: 100%;
425
+ height: 100%;
426
+ background: rgba(0,0,0,0.1);
427
+ }
428
+
429
+ .wpr-mm-pro-setting select {
430
+ display: none;
431
+ }
432
+
433
+ .wpr-mm-pro-setting .wpr-mm-pro-radio {
434
+ display: block;
435
+ }
436
+
437
+ .wpr-mm-pro-radio {
438
+ display: none;
439
+ padding: 5px 10px;
440
+ }
441
+
442
+ .wpr-mm-setting select option[value*="pro-"] {
443
+ background-color: rgba(0,0,0,0.2);
444
  }
assets/css/admin/plugin-options.css CHANGED
@@ -1,1132 +1,1132 @@
1
- #wpwrap {
2
- background: #fff;
3
- }
4
-
5
- #wpcontent {
6
- padding: 0;
7
- }
8
-
9
- .wpr-settings-page-wrap {
10
- margin: 0;
11
- }
12
-
13
- .wpr-settings-page-header {
14
- display: -webkit-box;
15
- display: -ms-flexbox;
16
- display: flex;
17
- -webkit-box-orient: vertical;
18
- -webkit-box-direction: normal;
19
- -ms-flex-direction: column;
20
- flex-direction: column;
21
- padding: 10px 30px 130px;
22
- background: #f6f6f6
23
- }
24
-
25
- .wpr-settings-page-header h1,
26
- .wpr-settings-page-header p,
27
- .wpr-settings-page-header .wpr-preview-buttons,
28
- .wpr-settings-page-header .wpr-user-template {
29
- -webkit-box-ordinal-group: 3;
30
- -ms-flex-order: 2;
31
- order: 2;
32
- }
33
-
34
- .wpr-settings-page-header .wpr-options-button {
35
- -ms-flex-item-align: start;
36
- align-self: flex-start;
37
- }
38
-
39
- .button.wpr-options-button .dashicons {
40
- line-height: 30px;
41
- font-size: 16px;
42
- }
43
-
44
- .wpr-preview-buttons a:last-child,
45
- .wpr-preview-buttons a.wpr-how-to-use-theme-builder {
46
- background-color: transparent;
47
- border: 2px solid #6A4BFF !important;
48
- color: #6A4BFF;
49
- padding: 5px 22px;
50
- }
51
-
52
- .wpr-preview-buttons a.wpr-how-to-use-woo-builder {
53
- background-color: transparent !important;
54
- border: 2px solid #96588a !important;
55
- color: #96588a !important;
56
- padding: 5px 22px;
57
- }
58
-
59
- .wpr-preview-buttons a.wpr-how-to-use-woo-builder:hover,
60
- .wpr-preview-buttons a.wpr-how-to-use-woo-builder:focus {
61
- color: #fff !important;
62
- background: #96588a !important;
63
- padding: 8px 22px !important;
64
- }
65
-
66
- .wpr-settings-page-header h1 {
67
- font-size: 42px;
68
- }
69
-
70
- .wpr-settings-page-header p {
71
- margin-top: 5px;
72
- color: #5a5a5a;
73
- font-size: 16px;
74
- margin-bottom: 30px;
75
- }
76
-
77
- .wpr-user-template {
78
- position: relative;
79
- -webkit-box-sizing: border-box;
80
- box-sizing: border-box;
81
- overflow: hidden;
82
- display: inline-block;
83
- width: 220px;
84
- height: 50px;
85
- line-height: 50px;
86
- padding: 0 20px;
87
- color: #fff;
88
- background: #6A4BFF;
89
- font-size: 15px;
90
- -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
91
- box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
92
- border-radius: 5px;
93
- cursor: pointer;
94
- }
95
-
96
- .wpr-user-template .plus-icon {
97
- float: right;
98
- display: block;
99
- width: 30px;
100
- height: 30px;
101
- line-height: 28px;
102
- margin-top: 10px;
103
- border-radius: 50%;
104
- color: #333;
105
- background-color: #fff;
106
- font-size: 18px;
107
- text-align: center;
108
- }
109
-
110
- .wpr-user-template > div {
111
- position: absolute;
112
- top: 0;
113
- left: 0;
114
- width: 100%;
115
- height: 100%;
116
- background: rgba(0,0,0,0.5);
117
- }
118
-
119
- .royal-addons_page_wpr-theme-builder .wpr-preview-buttons {
120
- display: -webkit-box;
121
- display: -ms-flexbox;
122
- display: flex;
123
- -webkit-box-orient: horizontal;
124
- -webkit-box-direction: reverse;
125
- -ms-flex-direction: row-reverse;
126
- flex-direction: row-reverse;
127
- }
128
-
129
- .royal-addons_page_wpr-theme-builder .wpr-user-template {
130
- margin-right: auto;
131
- }
132
-
133
- .wpr-settings-page {
134
- padding: 0 30px;
135
- }
136
-
137
- .wpr-nav-tab-wrapper {
138
- padding-top: 0;
139
- border-bottom: 0;
140
- -webkit-transform: translateY(-100%);
141
- -ms-transform: translateY(-100%);
142
- transform: translateY(-100%);
143
- }
144
-
145
- .wpr-nav-tab-wrapper a {
146
- border: 0 !important;
147
- padding: 13px 35px;
148
- background-color: transparent;
149
- font-size: 16px;
150
- margin-left: 0;
151
- margin-right: 15px;
152
- border-radius: 3px 4px 0 0;
153
- color: #333;
154
- }
155
-
156
- .wpr-nav-tab-wrapper a:hover {
157
- color: #6A4BFF;
158
- background: #fff;
159
- }
160
-
161
- .wpr-nav-tab-wrapper .nav-tab-active {
162
- color: #6A4BFF;
163
- background: #fff;
164
- -webkit-box-shadow: 3px -2px 5px rgba(0,0,0,0.03);
165
- box-shadow: 3px -2px 5px rgba(0,0,0,0.03);
166
- }
167
-
168
- .wpr-nav-tab-wrapper a:focus {
169
- -webkit-box-shadow: none;
170
- box-shadow: none;
171
- }
172
-
173
- .button.wpr-options-button {
174
- padding: 7px 22px;
175
- border: 0;
176
- color: #fff;
177
- background: #6A4BFF;
178
- -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
179
- box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
180
- font-size: 14px;
181
- }
182
-
183
- .button.wpr-options-button:hover,
184
- .button.wpr-options-button:focus {
185
- color: #fff;
186
- background: #6A4BFF;
187
- border: none;
188
- }
189
-
190
- @media screen and (max-width: 1355px) {
191
- .wpr-nav-tab-wrapper a {
192
- padding: 13px 25px;
193
- font-size: 14px;
194
- }
195
- }
196
-
197
-
198
- /*--------------------------------------------------------------
199
- == Elements
200
- --------------------------------------------------------------*/
201
- .wpr-elements-toggle {
202
- overflow: hidden;
203
- text-align: center;
204
- }
205
-
206
- .wpr-elements-toggle > div {
207
- display: inline-block;
208
- }
209
-
210
- .wpr-elements-toggle h3 {
211
- float: left;
212
- font-size: 18px;
213
- margin: 0 20px 0 0;
214
- }
215
-
216
- .wpr-elements-toggle p {
217
- margin: 10px 0 60px 0;
218
- }
219
-
220
- .wpr-elements-heading {
221
- text-align: center;
222
- margin-bottom: 30px;
223
- }
224
-
225
- .wpr-elements-heading h3 {
226
- font-size: 18px;
227
- text-align: center;
228
- margin-bottom: 0;
229
- }
230
-
231
- .wpr-elements-heading .wpr-install-activate-woocommerce {
232
- color: red;
233
- font-weight: 700;
234
- }
235
-
236
- .wpr-install-activate-woocommerce .dashicons {
237
- font-size: 18px;
238
- }
239
-
240
- .wpr-woo-templates,
241
- .wpr-elements {
242
- display: -webkit-box;
243
- display: -ms-flexbox;
244
- display: flex;
245
- -ms-flex-wrap: wrap;
246
- flex-wrap: wrap;
247
- width: 100%;
248
- margin-bottom: 50px;
249
- }
250
-
251
- .wpr-woo-templates {
252
- margin-bottom: 0;
253
- }
254
-
255
- .wpr-woo-template,
256
- .wpr-element {
257
- -webkit-box-sizing: border-box;
258
- box-sizing: border-box;
259
- position: relative;
260
- width: 24%;
261
- padding: 22px 30px;
262
- margin-right: 1%;
263
- margin-bottom: 20px;
264
- -webkit-box-shadow: 0 0 15px rgba(0,0,0,0.05);
265
- box-shadow: 0 0 15px rgba(0,0,0,0.05);
266
- border-radius: 4px;
267
- }
268
-
269
- .wpr-woo-template {
270
- width: 100%;
271
- }
272
-
273
- .wpr-woo-template-info {
274
- display: -webkit-box;
275
- display: -ms-flexbox;
276
- display: flex;
277
- -webkit-box-pack: justify;
278
- -ms-flex-pack: justify;
279
- justify-content: space-between;
280
- margin-top: 10px;
281
- }
282
-
283
- .wpr-woo-template-info .wpr-woo-template-title {
284
- display: -webkit-inline-box;
285
- display: -ms-inline-flexbox;
286
- display: inline-flex;
287
- -webkit-box-orient: vertical;
288
- -webkit-box-direction: normal;
289
- -ms-flex-direction: column;
290
- flex-direction: column;
291
- }
292
-
293
- .wpr-woo-template-title h3 {
294
- font-weight: 600 !important;
295
- font-size: 13px !important;
296
- color: #3c434a !important;
297
- }
298
-
299
- .wpr-woo-template-title p {
300
- margin: 0;
301
- font-size: 12px;
302
- }
303
-
304
- .wpr-woo-template-info h4 {
305
- font-size: 1em !important;
306
- font-weight: 600 !important;
307
- margin: 0;
308
- }
309
-
310
- .wpr-element-info h3 {
311
- float: left;
312
- margin: 0;
313
- color: #3a3a3a;
314
- font-size: 16px;
315
- }
316
-
317
- .wpr-woo-template-info label {
318
- min-width: 45px;
319
- }
320
-
321
- .wpr-woo-template-info label,
322
- .wpr-element-info label,
323
- .wpr-elements-toggle label {
324
- float: right;
325
- }
326
-
327
- .wpr-woo-template-info span,
328
- .wpr-element-info span {
329
- display: block;
330
- margin-top: 3px;
331
- color: #999;
332
- font-style: normal;
333
- font-size: 12px;
334
- }
335
-
336
- .wpr-woo-template-info a,
337
- .wpr-element-info a {
338
- display: block;
339
- clear: both;
340
- font-size: 12px;
341
- -webkit-box-shadow: none !important;
342
- box-shadow: none !important;
343
- }
344
-
345
- .wpr-woo-template-info input,
346
- .wpr-element-info input,
347
- .wpr-elements-toggle input,
348
- .wpr-setting-custom-ckbox input {
349
- position: absolute;
350
- z-index: -1000;
351
- left: -1000px;
352
- overflow: hidden;
353
- clip: rect(0 0 0 0);
354
- height: 1px;
355
- width: 1px;
356
- margin: -1px;
357
- padding: 0;
358
- border: 0;
359
- }
360
-
361
- .wpr-woo-template-info label,
362
- .wpr-element-info label,
363
- .wpr-elements-toggle label,
364
- .wpr-setting-custom-ckbox label {
365
- position: relative;
366
- display: block;
367
- width: 45px;
368
- height: 23px;
369
- border-radius: 20px;
370
- background: #e8e8e8;
371
- cursor: pointer;
372
- -webkit-touch-callout: none;
373
- -webkit-user-select: none;
374
- -moz-user-select: none;
375
- -ms-user-select: none;
376
- user-select: none;
377
- -webkit-transition: all 0.2s ease-in;
378
- -o-transition: all 0.2s ease-in;
379
- transition: all 0.2s ease-in;
380
- }
381
-
382
- .wpr-woo-template-info input + label:after,
383
- .wpr-element-info input + label:after,
384
- .wpr-elements-toggle input + label:after,
385
- .wpr-setting-custom-ckbox input + label:after {
386
- content: ' ';
387
- display: block;
388
- position: absolute;
389
- top: 3px;
390
- left: 3px;
391
- width: 17px;
392
- height: 17px;
393
- border-radius: 50%;
394
- background: #fff;
395
- -webkit-transition: all 0.2s ease-in;
396
- -o-transition: all 0.2s ease-in;
397
- transition: all 0.2s ease-in;
398
- }
399
-
400
- .wpr-woo-template-info input:checked + label,
401
- .wpr-element-info input:checked + label,
402
- .wpr-elements-toggle input:checked + label,
403
- .wpr-setting-custom-ckbox input:checked + label {
404
- background: #6A4BFF;
405
- }
406
-
407
- .wpr-woo-template-info input:checked + label:after,
408
- .wpr-element-info input:checked + label:after,
409
- .wpr-elements-toggle input:checked + label:after,
410
- .wpr-setting-custom-ckbox input:checked + label:after {
411
- left: 24px;
412
- }
413
-
414
- .wpr-new-element:before {
415
- content: 'NEW';
416
- position: absolute;
417
- top: -10px;
418
- left: 28px;
419
- padding: 1px 7px;
420
- color: #fff;
421
- background-color: #f44;
422
- border-radius: 3px;
423
- font-size: 10px;
424
- font-weight: bold;
425
- letter-spacing: 1px;
426
- }
427
-
428
- .wpr-pro-element:before {
429
- content: 'PRO';
430
- position: absolute;
431
- top: -10px;
432
- left: 28px;
433
- z-index: 10;
434
- padding: 1px 7px;
435
- color: #fff;
436
- background-color: #f44;
437
- border-radius: 3px;
438
- font-size: 10px;
439
- font-weight: bold;
440
- letter-spacing: 1px;
441
- }
442
-
443
- .wpr-pro-element > a {
444
- display: block;
445
- position: absolute;
446
- top: 0;
447
- left: 0;
448
- z-index: 1;
449
- width: 100%;
450
- height: 100%;
451
- background: rgba(0,0,0,0.1);
452
- }
453
-
454
- /*--------------------------------------------------------------
455
- == My Templates
456
- --------------------------------------------------------------*/
457
- .wpr-my-templates-list {
458
- width: 65%;
459
- }
460
-
461
- @media screen and (max-width: 1400px) {
462
- .wpr-my-templates-list {
463
- width: 100%;
464
- }
465
- }
466
-
467
- .wpr-activate-woo-notice,
468
- .wpr-my-templates-list li {
469
- overflow: hidden;
470
- padding: 20px 35px;
471
- margin-bottom: 15px;
472
- -webkit-box-shadow: 0 0 2px rgba(0,0,0,0.2);
473
- box-shadow: 0 0 2px rgba(0,0,0,0.2);
474
- }
475
-
476
- .wpr-my-templates-list li h3 {
477
- float: left;
478
- margin: 0;
479
- color: #555;
480
- font-size: 16px;
481
- line-height: 34px;
482
- text-transform: capitalize;
483
- }
484
-
485
- .wpr-my-templates-list .wpr-action-buttons {
486
- float: right;
487
- }
488
-
489
- .wpr-my-templates-list .wpr-template-conditions {
490
- background: #b3b3b3;
491
- }
492
-
493
- .wpr-active-conditions-template .wpr-template-conditions {
494
- background: #7a5ffd;
495
- }
496
-
497
- .wpr-my-templates-list .wpr-template-conditions:hover,
498
- .wpr-active-conditions-template .wpr-template-conditions:hover {
499
- background: #6A4BFF;
500
- }
501
-
502
- .wpr-my-templates-list .wpr-edit-template {
503
- background: #646464;
504
- }
505
-
506
- .wpr-my-templates-list .wpr-edit-template:hover {
507
- background: #535353;
508
- }
509
-
510
- .wpr-edit-template:focus {
511
- -webkit-box-shadow: none !important;
512
- box-shadow: none !important;
513
- }
514
-
515
- .wpr-my-templates-list .wpr-delete-template {
516
- background: #ff5a4b;
517
- }
518
-
519
- .wpr-my-templates-list .wpr-delete-template:hover {
520
- background: #FF4635;
521
- }
522
-
523
- .wpr-my-templates-list .wpr-action-buttons > * {
524
- display: inline-block;
525
- padding: 3px 20px;
526
- margin-right: 10px;
527
- border: 0;
528
- letter-spacing: 0.5px;
529
- }
530
-
531
- .wpr-my-templates-list .wpr-action-buttons > *:last-child {
532
- margin-right: 0;
533
- }
534
-
535
- .wpr-my-templates-list .wpr-action-buttons .dashicons {
536
- font-size: 16px;
537
- line-height: 30px;
538
- }
539
-
540
- .wpr-active-conditions-template {
541
- border-left: 5px solid #6A4BFF;
542
- background: #F6F7F7;
543
- }
544
-
545
- .wpr-my-templates-list .wpr-no-templates {
546
- background: #fff !important;
547
- }
548
-
549
-
550
- /*--------------------------------------------------------------
551
- == Settings
552
- --------------------------------------------------------------*/
553
- .wpr-settings-group:first-of-type {
554
- margin-top: 50px;
555
- }
556
-
557
- .wpr-settings-group {
558
- position: relative;
559
- width: 35%;
560
- background: #f9f9f9;
561
- padding: 30px;
562
- margin-bottom: 80px;
563
- -webkit-box-shadow: 1px 2px 3px rgba(0,0,0,0.1);
564
- box-shadow: 1px 2px 3px rgba(0,0,0,0.1);
565
- border-radius: 0 3px 3px 3px;
566
- }
567
-
568
- .wpr-settings-group-inner {
569
- position: relative;
570
- }
571
-
572
- .wpr-settings-group-title {
573
- position: absolute;
574
- top: 0;
575
- left: 0;
576
- -webkit-transform: translateY(-100%);
577
- -ms-transform: translateY(-100%);
578
- transform: translateY(-100%);
579
- padding: 10px 30px;
580
- background: #f9f9f9;
581
- margin: 0;
582
- -webkit-box-shadow: 0 -2px 3px rgba(0,0,0,0.05);
583
- box-shadow: 0 -2px 3px rgba(0,0,0,0.05);
584
- border-radius: 3px 3px 0 0;
585
- color: #6A4BFF;
586
- font-size: 14px;
587
- }
588
-
589
- .wpr-setting {
590
- margin-bottom: 20px;
591
- }
592
-
593
- .wpr-setting h4 {
594
- margin-bottom: 8px;
595
- }
596
-
597
- .wpr-setting input:not(input[type='checkbox']) {
598
- border: 1px solid #e8e8e8;
599
- width: 100%;
600
- padding: 5px 15px;
601
- }
602
-
603
- .wpr-setting input[type='checkbox'] {
604
- margin-right: 8px;
605
- }
606
-
607
- .wpr-settings .submit:first-of-type {
608
- margin-top: 0;
609
- padding-top: 0;
610
- margin-bottom: 70px;
611
- }
612
-
613
- .wp-picker-clear {
614
- width: 100px !important;
615
- }
616
-
617
- /*--------------------------------------------------------------
618
- == Conditions
619
- --------------------------------------------------------------*/
620
- .wpr-admin-popup-wrap {
621
- display: none;
622
- position: fixed;
623
- top: 0;
624
- left: 0;
625
- z-index: 9999;
626
- background-color: rgba(0, 0, 0, 0.6);
627
- width: 100%;
628
- height: 100%;
629
- }
630
-
631
- .wpr-admin-popup {
632
- display: -webkit-box;
633
- display: -ms-flexbox;
634
- display: flex;
635
- -ms-flex-pack: distribute;
636
- justify-content: space-around;
637
- -webkit-box-align: center;
638
- -ms-flex-align: center;
639
- align-items: center;
640
- -webkit-box-orient: vertical;
641
- -webkit-box-direction: normal;
642
- -ms-flex-direction: column;
643
- flex-direction: column;
644
- position: absolute;
645
- top: 50%;
646
- left: 50%;
647
- -webkit-transform: translate(-50%,-50%);
648
- -ms-transform: translate(-50%,-50%);
649
- transform: translate(-50%,-50%);
650
- width: 80%;
651
- max-width: 850px;
652
- padding: 70px 20px 20px 20px;
653
- background-color: #F1F3F5;
654
- }
655
-
656
-
657
- .wpr-admin-popup .close-popup {
658
- position: absolute;
659
- top: 10px;
660
- right: 15px;
661
- font-size: 26px;
662
- cursor: pointer;
663
- color: #59626a;
664
- }
665
-
666
- .wpr-conditions.wpr-tab-archive .global-condition-select,
667
- .wpr-conditions.wpr-tab-archive .singles-condition-select,
668
- .wpr-conditions.wpr-tab-product_archive .global-condition-select,
669
- .wpr-conditions.wpr-tab-product_archive .singles-condition-select,
670
- .wpr-conditions.wpr-tab-single .global-condition-select,
671
- .wpr-conditions.wpr-tab-single .archives-condition-select,
672
- .wpr-conditions.wpr-tab-product_single .global-condition-select,
673
- .wpr-conditions.wpr-tab-product_single .archives-condition-select {
674
- display: none !important;
675
- }
676
-
677
- .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(1),
678
- .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(2),
679
- .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(3) {
680
- /*display: none;*/
681
- }
682
-
683
- .wpr-conditions.wpr-tab-archive .archives-condition-select,
684
- .wpr-conditions.wpr-tab-product_archive .archives-condition-select,
685
- .wpr-conditions.wpr-tab-single .singles-condition-select,
686
- .wpr-conditions.wpr-tab-product_single .singles-condition-select {
687
- display: block !important;
688
- }
689
-
690
- .wpr-conditions-sample {
691
- display: none !important;
692
- }
693
-
694
- .wpr-conditions {
695
- position: relative;
696
- display: -webkit-box;
697
- display: -ms-flexbox;
698
- display: flex;
699
- -webkit-box-align: center;
700
- -ms-flex-align: center;
701
- align-items: center;
702
- margin-top: 10px;
703
- width: 600px;
704
- border-radius: 3px;
705
- border: 1px solid #e8e8e8;
706
- background: #fff;
707
- }
708
-
709
- .wpr-admin-popup header {
710
- margin-top: 0;
711
- margin-bottom: 20px;
712
- text-align: center;
713
- }
714
-
715
- .wpr-admin-popup header h2 {
716
- margin: 25px auto;
717
- font-size: 26px;
718
- color: #59626a;
719
- }
720
-
721
- .wpr-admin-popup header p {
722
- margin-top: 0;
723
- margin-bottom: 0;
724
- color: #7f8b96;
725
- }
726
-
727
- .wpr-conditions select {
728
- height: 35px;
729
- height: 100%;
730
- padding-top: 5px;
731
- padding-bottom: 5px;
732
- border-radius: 0;
733
- border: none;
734
- -webkit-box-flex: 1;
735
- -ms-flex-positive: 1;
736
- flex-grow: 1;
737
- border-right: 1px solid #e8e8e8 !important;
738
- background-size: 14px 14px;
739
- }
740
-
741
- span.wpr-add-conditions {
742
- margin-top: 30px;
743
- background: #A4AFB7;
744
- color: #fff;
745
- font-weight: 600;
746
- letter-spacing: 1px;
747
- text-transform: uppercase;
748
- padding: 8px 20px;
749
- border-radius: 3px;
750
- cursor: pointer;
751
- }
752
-
753
- span.wpr-add-conditions:hover {
754
- background: #848c92;
755
- }
756
-
757
- input.wpr-condition-input-ids {
758
- display: none;
759
- padding: 5px;
760
- outline: none;
761
- border: none;
762
- border-radius: 0;
763
- }
764
-
765
- input.wpr-condition-input-ids,
766
- .wpr-conditions select {
767
- -ms-flex-negative: 0;
768
- flex-shrink: 0;
769
- -webkit-box-flex: 1;
770
- -ms-flex-positive: 1;
771
- flex-grow: 1;
772
- max-width: none;
773
- border: none;
774
- -webkit-box-shadow: none !important;
775
- box-shadow: none !important;
776
- outline: none;
777
- margin: 0;
778
- text-indent: 5px;
779
- }
780
-
781
- .wpr-canvas-condition {
782
- display: none;
783
- margin-top: 20px;
784
- }
785
-
786
- .wpr-canvas-condition label {
787
- display: inline-block;
788
- }
789
-
790
- .wpr-canvas-condition span {
791
- margin-right: 20px;
792
- }
793
-
794
- #wpr-woo-products-per-page {
795
- width: 40px;
796
- border: 1px solid #e8e8e8;
797
- text-align: center;
798
- -webkit-box-shadow: none !important;
799
- box-shadow: none !important;
800
- margin-left: 10px;
801
- }
802
-
803
- .wpr-delete-template-conditions {
804
- margin-left: auto;
805
- position: absolute;
806
- right: -30px;
807
- color: #C2CBD2;
808
- font-size: 22px;
809
- cursor: pointer;
810
- }
811
-
812
- .wpr-delete-template-conditions:hover {
813
- color: #81868a;
814
- }
815
-
816
- .wpr-save-conditions {
817
- padding: 8px 20px;
818
- color: #fff;
819
- background: #6A4BFF;
820
- margin-left: auto;
821
- border-radius: 3px;
822
- margin-top: 80px;
823
- text-transform: uppercase;
824
- letter-spacing: 0.5px;
825
- font-weight: 600;
826
- cursor: pointer;
827
- }
828
-
829
- .wpr-user-template-popup {
830
- padding-top: 40px;
831
- }
832
-
833
- .wpr-user-template-popup header {
834
- margin-bottom: 27px;
835
- }
836
-
837
- .wpr-user-template-popup .wpr-create-template {
838
- padding: 11px 20px;
839
- margin: 25px auto;
840
- color: #fff;
841
- background: #6A4BFF;
842
- border-radius: 3px;
843
- cursor: pointer;
844
- }
845
-
846
- .wpr-user-template-popup p {
847
- max-width: 70%;
848
- margin: auto;
849
- }
850
-
851
- input.wpr-user-template-title {
852
- width: 350px;
853
- border: 1px solid #d1d1d1;
854
- padding: 5px 10px;
855
- border-radius: 3px;
856
- }
857
-
858
- input.wpr-user-template-title::-webkit-input-placeholder,
859
- input.wpr-condition-input-ids::-webkit-input-placeholder {
860
- color: #9a9a9a;
861
- }
862
-
863
- input.wpr-user-template-title::-moz-placeholder,
864
- input.wpr-condition-input-ids::-moz-placeholder {
865
- color: #9a9a9a;
866
- }
867
-
868
- input.wpr-user-template-title:-ms-input-placeholder,
869
- input.wpr-condition-input-ids:-ms-input-placeholder {
870
- color: #9a9a9a;
871
- }
872
-
873
- input.wpr-user-template-title::-ms-input-placeholder,
874
- input.wpr-condition-input-ids::-ms-input-placeholder {
875
- color: #9a9a9a;
876
- }
877
-
878
- input.wpr-user-template-title::-webkit-input-placeholder, input.wpr-condition-input-ids::-webkit-input-placeholder {
879
- color: #9a9a9a;
880
- }
881
-
882
- input.wpr-user-template-title::-moz-placeholder, input.wpr-condition-input-ids::-moz-placeholder {
883
- color: #9a9a9a;
884
- }
885
-
886
- input.wpr-user-template-title:-ms-input-placeholder, input.wpr-condition-input-ids:-ms-input-placeholder {
887
- color: #9a9a9a;
888
- }
889
-
890
- input.wpr-user-template-title::-ms-input-placeholder, input.wpr-condition-input-ids::-ms-input-placeholder {
891
- color: #9a9a9a;
892
- }
893
-
894
- input.wpr-user-template-title::placeholder,
895
- input.wpr-condition-input-ids::placeholder {
896
- color: #9a9a9a;
897
- }
898
-
899
- input.wpr-user-template-title:focus {
900
- border-color: #6A4BFF;
901
- -webkit-box-shadow: none;
902
- box-shadow: none;
903
- }
904
-
905
- /*--------------------------------------------------------------
906
- == White Label
907
- --------------------------------------------------------------*/
908
- .wpr-wl-tab-content {
909
- display: -webkit-box;
910
- display: -ms-flexbox;
911
- display: flex;
912
- -webkit-box-align: start;
913
- -ms-flex-align: start;
914
- align-items: flex-start;
915
- }
916
-
917
- .wpr-wl-tab-content .wpr-settings-group:last-of-type {
918
- margin-top: 50px;
919
- margin-left: 50px;
920
- }
921
-
922
- .wpr-setting-custom-img-upload div button {
923
- display: -webkit-box;
924
- display: -ms-flexbox;
925
- display: flex;
926
- -webkit-box-align: center;
927
- -ms-flex-align: center;
928
- align-items: center;
929
- margin-top: 10px;
930
- padding: 10px 20px;
931
- background: #ffffff;
932
- border: 1px solid #e8e8e8;
933
- border-radius: 3px;
934
- font-weight: bold;
935
- cursor: pointer;
936
- }
937
-
938
- .wpr-setting-custom-img-upload div button span {
939
- margin-left: 5px;
940
- }
941
-
942
- .wpr-setting-custom-img-upload div button img {
943
- width: 50px;
944
- }
945
-
946
- .wpr-setting-custom-ckbox h4 {
947
- display: -webkit-box;
948
- display: -ms-flexbox;
949
- display: flex;
950
- -webkit-box-orient: horizontal;
951
- -webkit-box-direction: normal;
952
- -ms-flex-direction: row;
953
- flex-direction: row;
954
- -webkit-box-pack: justify;
955
- -ms-flex-pack: justify;
956
- justify-content: space-between;
957
- }
958
-
959
- .wpr-setting-custom-ckbox label {
960
- background: #dddbdb;
961
- }
962
-
963
- .wpr-setting-custom-ckbox p {
964
- color: #a09f9f;
965
- }
966
-
967
- /*--------------------------------------------------------------
968
- == Freemius
969
- --------------------------------------------------------------*/
970
- #fs_connect {
971
- margin: 40px !important;
972
- width: 615px !important;
973
- border-top: 3px solid #2271B1 !important;
974
- }
975
-
976
- #fs_connect .fs-content {
977
- padding: 25px 20px 35px 20px !important;
978
- }
979
-
980
- #fs_connect .fs-visual {
981
- background: transparent !important;
982
- }
983
-
984
- #fs_connect .fs-visual .fs-site-icon,
985
- #fs_connect .fs-visual .fs-plugin-icon,
986
- #fs_connect .fs-visual .fs-connect-logo {
987
- top: 20px !important;
988
- }
989
-
990
- #fs_connect .fs-visual .fs-plugin-icon,
991
- #fs_connect .fs-visual .fs-connect-logo,
992
- #fs_connect .fs-visual .fs-site-icon {
993
- border: none !important;
994
- }
995
-
996
- #fs_connect .fs-visual .fs-site-icon i,
997
- #fs_connect .fs-visual img{
998
- overflow: hidden !important;
999
- border-radius: 100px !important;
1000
- }
1001
-
1002
- #fs_connect .fs-actions {
1003
- border-top: 1px solid #F2F2F2 !important;
1004
- background: #F2F2F2 !important;
1005
- }
1006
-
1007
- #fs_connect .fs-actions .button {
1008
- font-size: 14px !important;
1009
- }
1010
-
1011
- #fs_connect .fs-actions .button.button-secondary {
1012
- padding: 0 25px !important;
1013
- }
1014
-
1015
- #fs_connect .fs-permissions {
1016
- margin-top: 20px !important;
1017
- }
1018
-
1019
- #fs_connect .fs-permissions>.fs-trigger {
1020
- -webkit-box-shadow: none !important;
1021
- box-shadow: none !important;
1022
- }
1023
-
1024
- #fs_connect .fs-permissions.fs-open ul {
1025
- margin: 30px 20px !important;
1026
- }
1027
-
1028
- #fs_connect .fs-permissions ul li {
1029
- margin-bottom: 20px !important;
1030
- }
1031
-
1032
- #fs_connect .fs-permissions ul li .fs-permission-description span {
1033
- font-size: 12px !important;
1034
- text-transform: capitalize !important;
1035
- }
1036
-
1037
- #fs_connect .fs-permissions ul li .fs-permission-description p {
1038
- font-size: 11px !important;
1039
- margin-top: 0 !important;
1040
- }
1041
-
1042
- #fs_connect .fs-license-key-container {
1043
- width: 100% !important;
1044
- margin-top: 20px;
1045
- }
1046
-
1047
- #pframe,
1048
- #fs_connect.require-license-key .fs-permissions,
1049
- #fs_connect.require-license-key .fs-terms,
1050
- #fs_connect .fs-freemium-licensing,
1051
- #license_issues_link {
1052
- display: none !important;
1053
- }
1054
-
1055
- /*--------------------------------------------------------------
1056
- == Settings: Pro Options
1057
- --------------------------------------------------------------*/
1058
- .wpr-settings-pro-overlay {
1059
- display: -webkit-box;
1060
- display: -ms-flexbox;
1061
- display: flex;
1062
- -webkit-box-orient: vertical;
1063
- -webkit-box-direction: normal;
1064
- -ms-flex-direction: column;
1065
- flex-direction: column;
1066
- -webkit-box-align: center;
1067
- -ms-flex-align: center;
1068
- align-items: center;
1069
- -webkit-box-pack: center;
1070
- -ms-flex-pack: center;
1071
- justify-content: center;
1072
- position: absolute;
1073
- top: 0;
1074
- left: 0;
1075
- width: 100%;
1076
- height: 100%;
1077
- background: rgba(0,0,0,0.4);
1078
- color: #f9f9f9;
1079
- font-size: 16px;
1080
- text-decoration: none;
1081
- text-transform: uppercase;
1082
- font-weight: bold;
1083
-
1084
- text-shadow: 1px 1px 1px #000;
1085
- -webkit-box-shadow: 1px 1px 15px rgba(0,0,0,0.3);
1086
- box-shadow: 1px 1px 15px rgba(0,0,0,0.3);
1087
- }
1088
-
1089
- .wpr-settings-pro-overlay:hover,
1090
- .wpr-settings-pro-overlay:focus{
1091
- color: #f9f9f9;
1092
- }
1093
-
1094
- .wpr-settings-pro-overlay .dashicons {
1095
- font-size: 50px;
1096
- line-height: 50px;
1097
- margin-bottom: 40px;
1098
- -webkit-transform: translateX(-50%);
1099
- -ms-transform: translateX(-50%);
1100
- transform: translateX(-50%);
1101
- }
1102
-
1103
- .wpr-settings-pro-overlay .dashicons:nth-child(2) {
1104
- display: none;
1105
- }
1106
-
1107
- .wpr-settings-pro-overlay:hover .dashicons:nth-child(2) {
1108
- display: block;
1109
- }
1110
-
1111
- .wpr-settings-pro-overlay:hover .dashicons:nth-child(1) {
1112
- display: none;
1113
- }.example {
1114
- display: -ms-grid;
1115
- display: grid;
1116
- -webkit-transition: all .5s;
1117
- -o-transition: all .5s;
1118
- transition: all .5s;
1119
- -webkit-user-select: none;
1120
- -moz-user-select: none;
1121
- -ms-user-select: none;
1122
- user-select: none;
1123
- background: -webkit-gradient(linear, left top, left bottom, from(white), to(black));
1124
- background: -o-linear-gradient(top, white, black);
1125
- background: linear-gradient(to bottom, white, black);
1126
- }
1127
-
1128
- /* Disable Notices */
1129
- .notice:not(.wpr-plugin-update-notice),
1130
- div.fs-notice.updated, div.fs-notice.success {
1131
- display: none !important;
1132
  }
1
+ #wpwrap {
2
+ background: #fff;
3
+ }
4
+
5
+ #wpcontent {
6
+ padding: 0;
7
+ }
8
+
9
+ .wpr-settings-page-wrap {
10
+ margin: 0;
11
+ }
12
+
13
+ .wpr-settings-page-header {
14
+ display: -webkit-box;
15
+ display: -ms-flexbox;
16
+ display: flex;
17
+ -webkit-box-orient: vertical;
18
+ -webkit-box-direction: normal;
19
+ -ms-flex-direction: column;
20
+ flex-direction: column;
21
+ padding: 10px 30px 130px;
22
+ background: #f6f6f6
23
+ }
24
+
25
+ .wpr-settings-page-header h1,
26
+ .wpr-settings-page-header p,
27
+ .wpr-settings-page-header .wpr-preview-buttons,
28
+ .wpr-settings-page-header .wpr-user-template {
29
+ -webkit-box-ordinal-group: 3;
30
+ -ms-flex-order: 2;
31
+ order: 2;
32
+ }
33
+
34
+ .wpr-settings-page-header .wpr-options-button {
35
+ -ms-flex-item-align: start;
36
+ align-self: flex-start;
37
+ }
38
+
39
+ .button.wpr-options-button .dashicons {
40
+ line-height: 30px;
41
+ font-size: 16px;
42
+ }
43
+
44
+ .wpr-preview-buttons a:last-child,
45
+ .wpr-preview-buttons a.wpr-how-to-use-theme-builder {
46
+ background-color: transparent;
47
+ border: 2px solid #6A4BFF !important;
48
+ color: #6A4BFF;
49
+ padding: 5px 22px;
50
+ }
51
+
52
+ .wpr-preview-buttons a.wpr-how-to-use-woo-builder {
53
+ background-color: transparent !important;
54
+ border: 2px solid #96588a !important;
55
+ color: #96588a !important;
56
+ padding: 5px 22px;
57
+ }
58
+
59
+ .wpr-preview-buttons a.wpr-how-to-use-woo-builder:hover,
60
+ .wpr-preview-buttons a.wpr-how-to-use-woo-builder:focus {
61
+ color: #fff !important;
62
+ background: #96588a !important;
63
+ padding: 8px 22px !important;
64
+ }
65
+
66
+ .wpr-settings-page-header h1 {
67
+ font-size: 42px;
68
+ }
69
+
70
+ .wpr-settings-page-header p {
71
+ margin-top: 5px;
72
+ color: #5a5a5a;
73
+ font-size: 16px;
74
+ margin-bottom: 30px;
75
+ }
76
+
77
+ .wpr-user-template {
78
+ position: relative;
79
+ -webkit-box-sizing: border-box;
80
+ box-sizing: border-box;
81
+ overflow: hidden;
82
+ display: inline-block;
83
+ width: 220px;
84
+ height: 50px;
85
+ line-height: 50px;
86
+ padding: 0 20px;
87
+ color: #fff;
88
+ background: #6A4BFF;
89
+ font-size: 15px;
90
+ -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
91
+ box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
92
+ border-radius: 5px;
93
+ cursor: pointer;
94
+ }
95
+
96
+ .wpr-user-template .plus-icon {
97
+ float: right;
98
+ display: block;
99
+ width: 30px;
100
+ height: 30px;
101
+ line-height: 28px;
102
+ margin-top: 10px;
103
+ border-radius: 50%;
104
+ color: #333;
105
+ background-color: #fff;
106
+ font-size: 18px;
107
+ text-align: center;
108
+ }
109
+
110
+ .wpr-user-template > div {
111
+ position: absolute;
112
+ top: 0;
113
+ left: 0;
114
+ width: 100%;
115
+ height: 100%;
116
+ background: rgba(0,0,0,0.5);
117
+ }
118
+
119
+ .royal-addons_page_wpr-theme-builder .wpr-preview-buttons {
120
+ display: -webkit-box;
121
+ display: -ms-flexbox;
122
+ display: flex;
123
+ -webkit-box-orient: horizontal;
124
+ -webkit-box-direction: reverse;
125
+ -ms-flex-direction: row-reverse;
126
+ flex-direction: row-reverse;
127
+ }
128
+
129
+ .royal-addons_page_wpr-theme-builder .wpr-user-template {
130
+ margin-right: auto;
131
+ }
132
+
133
+ .wpr-settings-page {
134
+ padding: 0 30px;
135
+ }
136
+
137
+ .wpr-nav-tab-wrapper {
138
+ padding-top: 0;
139
+ border-bottom: 0;
140
+ -webkit-transform: translateY(-100%);
141
+ -ms-transform: translateY(-100%);
142
+ transform: translateY(-100%);
143
+ }
144
+
145
+ .wpr-nav-tab-wrapper a {
146
+ border: 0 !important;
147
+ padding: 13px 35px;
148
+ background-color: transparent;
149
+ font-size: 16px;
150
+ margin-left: 0;
151
+ margin-right: 15px;
152
+ border-radius: 3px 4px 0 0;
153
+ color: #333;
154
+ }
155
+
156
+ .wpr-nav-tab-wrapper a:hover {
157
+ color: #6A4BFF;
158
+ background: #fff;
159
+ }
160
+
161
+ .wpr-nav-tab-wrapper .nav-tab-active {
162
+ color: #6A4BFF;
163
+ background: #fff;
164
+ -webkit-box-shadow: 3px -2px 5px rgba(0,0,0,0.03);
165
+ box-shadow: 3px -2px 5px rgba(0,0,0,0.03);
166
+ }
167
+
168
+ .wpr-nav-tab-wrapper a:focus {
169
+ -webkit-box-shadow: none;
170
+ box-shadow: none;
171
+ }
172
+
173
+ .button.wpr-options-button {
174
+ padding: 7px 22px;
175
+ border: 0;
176
+ color: #fff;
177
+ background: #6A4BFF;
178
+ -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
179
+ box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
180
+ font-size: 14px;
181
+ }
182
+
183
+ .button.wpr-options-button:hover,
184
+ .button.wpr-options-button:focus {
185
+ color: #fff;
186
+ background: #6A4BFF;
187
+ border: none;
188
+ }
189
+
190
+ @media screen and (max-width: 1355px) {
191
+ .wpr-nav-tab-wrapper a {
192
+ padding: 13px 25px;
193
+ font-size: 14px;
194
+ }
195
+ }
196
+
197
+
198
+ /*--------------------------------------------------------------
199
+ == Elements
200
+ --------------------------------------------------------------*/
201
+ .wpr-elements-toggle {
202
+ overflow: hidden;
203
+ text-align: center;
204
+ }
205
+
206
+ .wpr-elements-toggle > div {
207
+ display: inline-block;
208
+ }
209
+
210
+ .wpr-elements-toggle h3 {
211
+ float: left;
212
+ font-size: 18px;
213
+ margin: 0 20px 0 0;
214
+ }
215
+
216
+ .wpr-elements-toggle p {
217
+ margin: 10px 0 60px 0;
218
+ }
219
+
220
+ .wpr-elements-heading {
221
+ text-align: center;
222
+ margin-bottom: 30px;
223
+ }
224
+
225
+ .wpr-elements-heading h3 {
226
+ font-size: 18px;
227
+ text-align: center;
228
+ margin-bottom: 0;
229
+ }
230
+
231
+ .wpr-elements-heading .wpr-install-activate-woocommerce {
232
+ color: red;
233
+ font-weight: 700;
234
+ }
235
+
236
+ .wpr-install-activate-woocommerce .dashicons {
237
+ font-size: 18px;
238
+ }
239
+
240
+ .wpr-woo-templates,
241
+ .wpr-elements {
242
+ display: -webkit-box;
243
+ display: -ms-flexbox;
244
+ display: flex;
245
+ -ms-flex-wrap: wrap;
246
+ flex-wrap: wrap;
247
+ width: 100%;
248
+ margin-bottom: 50px;
249
+ }
250
+
251
+ .wpr-woo-templates {
252
+ margin-bottom: 0;
253
+ }
254
+
255
+ .wpr-woo-template,
256
+ .wpr-element {
257
+ -webkit-box-sizing: border-box;
258
+ box-sizing: border-box;
259
+ position: relative;
260
+ width: 24%;
261
+ padding: 22px 30px;
262
+ margin-right: 1%;
263
+ margin-bottom: 20px;
264
+ -webkit-box-shadow: 0 0 15px rgba(0,0,0,0.05);
265
+ box-shadow: 0 0 15px rgba(0,0,0,0.05);
266
+ border-radius: 4px;
267
+ }
268
+
269
+ .wpr-woo-template {
270
+ width: 100%;
271
+ }
272
+
273
+ .wpr-woo-template-info {
274
+ display: -webkit-box;
275
+ display: -ms-flexbox;
276
+ display: flex;
277
+ -webkit-box-pack: justify;
278
+ -ms-flex-pack: justify;
279
+ justify-content: space-between;
280
+ margin-top: 10px;
281
+ }
282
+
283
+ .wpr-woo-template-info .wpr-woo-template-title {
284
+ display: -webkit-inline-box;
285
+ display: -ms-inline-flexbox;
286
+ display: inline-flex;
287
+ -webkit-box-orient: vertical;
288
+ -webkit-box-direction: normal;
289
+ -ms-flex-direction: column;
290
+ flex-direction: column;
291
+ }
292
+
293
+ .wpr-woo-template-title h3 {
294
+ font-weight: 600 !important;
295
+ font-size: 13px !important;
296
+ color: #3c434a !important;
297
+ }
298
+
299
+ .wpr-woo-template-title p {
300
+ margin: 0;
301
+ font-size: 12px;
302
+ }
303
+
304
+ .wpr-woo-template-info h4 {
305
+ font-size: 1em !important;
306
+ font-weight: 600 !important;
307
+ margin: 0;
308
+ }
309
+
310
+ .wpr-element-info h3 {
311
+ float: left;
312
+ margin: 0;
313
+ color: #3a3a3a;
314
+ font-size: 16px;
315
+ }
316
+
317
+ .wpr-woo-template-info label {
318
+ min-width: 45px;
319
+ }
320
+
321
+ .wpr-woo-template-info label,
322
+ .wpr-element-info label,
323
+ .wpr-elements-toggle label {
324
+ float: right;
325
+ }
326
+
327
+ .wpr-woo-template-info span,
328
+ .wpr-element-info span {
329
+ display: block;
330
+ margin-top: 3px;
331
+ color: #999;
332
+ font-style: normal;
333
+ font-size: 12px;
334
+ }
335
+
336
+ .wpr-woo-template-info a,
337
+ .wpr-element-info a {
338
+ display: block;
339
+ clear: both;
340
+ font-size: 12px;
341
+ -webkit-box-shadow: none !important;
342
+ box-shadow: none !important;
343
+ }
344
+
345
+ .wpr-woo-template-info input,
346
+ .wpr-element-info input,
347
+ .wpr-elements-toggle input,
348
+ .wpr-setting-custom-ckbox input {
349
+ position: absolute;
350
+ z-index: -1000;
351
+ left: -1000px;
352
+ overflow: hidden;
353
+ clip: rect(0 0 0 0);
354
+ height: 1px;
355
+ width: 1px;
356
+ margin: -1px;
357
+ padding: 0;
358
+ border: 0;
359
+ }
360
+
361
+ .wpr-woo-template-info label,
362
+ .wpr-element-info label,
363
+ .wpr-elements-toggle label,
364
+ .wpr-setting-custom-ckbox label {
365
+ position: relative;
366
+ display: block;
367
+ width: 45px;
368
+ height: 23px;
369
+ border-radius: 20px;
370
+ background: #e8e8e8;
371
+ cursor: pointer;
372
+ -webkit-touch-callout: none;
373
+ -webkit-user-select: none;
374
+ -moz-user-select: none;
375
+ -ms-user-select: none;
376
+ user-select: none;
377
+ -webkit-transition: all 0.2s ease-in;
378
+ -o-transition: all 0.2s ease-in;
379
+ transition: all 0.2s ease-in;
380
+ }
381
+
382
+ .wpr-woo-template-info input + label:after,
383
+ .wpr-element-info input + label:after,
384
+ .wpr-elements-toggle input + label:after,
385
+ .wpr-setting-custom-ckbox input + label:after {
386
+ content: ' ';
387
+ display: block;
388
+ position: absolute;
389
+ top: 3px;
390
+ left: 3px;
391
+ width: 17px;
392
+ height: 17px;
393
+ border-radius: 50%;
394
+ background: #fff;
395
+ -webkit-transition: all 0.2s ease-in;
396
+ -o-transition: all 0.2s ease-in;
397
+ transition: all 0.2s ease-in;
398
+ }
399
+
400
+ .wpr-woo-template-info input:checked + label,
401
+ .wpr-element-info input:checked + label,
402
+ .wpr-elements-toggle input:checked + label,
403
+ .wpr-setting-custom-ckbox input:checked + label {
404
+ background: #6A4BFF;
405
+ }
406
+
407
+ .wpr-woo-template-info input:checked + label:after,
408
+ .wpr-element-info input:checked + label:after,
409
+ .wpr-elements-toggle input:checked + label:after,
410
+ .wpr-setting-custom-ckbox input:checked + label:after {
411
+ left: 24px;
412
+ }
413
+
414
+ .wpr-new-element:before {
415
+ content: 'NEW';
416
+ position: absolute;
417
+ top: -10px;
418
+ left: 28px;
419
+ padding: 1px 7px;
420
+ color: #fff;
421
+ background-color: #f44;
422
+ border-radius: 3px;
423
+ font-size: 10px;
424
+ font-weight: bold;
425
+ letter-spacing: 1px;
426
+ }
427
+
428
+ .wpr-pro-element:before {
429
+ content: 'PRO';
430
+ position: absolute;
431
+ top: -10px;
432
+ left: 28px;
433
+ z-index: 10;
434
+ padding: 1px 7px;
435
+ color: #fff;
436
+ background-color: #f44;
437
+ border-radius: 3px;
438
+ font-size: 10px;
439
+ font-weight: bold;
440
+ letter-spacing: 1px;
441
+ }
442
+
443
+ .wpr-pro-element > a {
444
+ display: block;
445
+ position: absolute;
446
+ top: 0;
447
+ left: 0;
448
+ z-index: 1;
449
+ width: 100%;
450
+ height: 100%;
451
+ background: rgba(0,0,0,0.1);
452
+ }
453
+
454
+ /*--------------------------------------------------------------
455
+ == My Templates
456
+ --------------------------------------------------------------*/
457
+ .wpr-my-templates-list {
458
+ width: 65%;
459
+ }
460
+
461
+ @media screen and (max-width: 1400px) {
462
+ .wpr-my-templates-list {
463
+ width: 100%;
464
+ }
465
+ }
466
+
467
+ .wpr-activate-woo-notice,
468
+ .wpr-my-templates-list li {
469
+ overflow: hidden;
470
+ padding: 20px 35px;
471
+ margin-bottom: 15px;
472
+ -webkit-box-shadow: 0 0 2px rgba(0,0,0,0.2);
473
+ box-shadow: 0 0 2px rgba(0,0,0,0.2);
474
+ }
475
+
476
+ .wpr-my-templates-list li h3 {
477
+ float: left;
478
+ margin: 0;
479
+ color: #555;
480
+ font-size: 16px;
481
+ line-height: 34px;
482
+ text-transform: capitalize;
483
+ }
484
+
485
+ .wpr-my-templates-list .wpr-action-buttons {
486
+ float: right;
487
+ }
488
+
489
+ .wpr-my-templates-list .wpr-template-conditions {
490
+ background: #b3b3b3;
491
+ }
492
+
493
+ .wpr-active-conditions-template .wpr-template-conditions {
494
+ background: #7a5ffd;
495
+ }
496
+
497
+ .wpr-my-templates-list .wpr-template-conditions:hover,
498
+ .wpr-active-conditions-template .wpr-template-conditions:hover {
499
+ background: #6A4BFF;
500
+ }
501
+
502
+ .wpr-my-templates-list .wpr-edit-template {
503
+ background: #646464;
504
+ }
505
+
506
+ .wpr-my-templates-list .wpr-edit-template:hover {
507
+ background: #535353;
508
+ }
509
+
510
+ .wpr-edit-template:focus {
511
+ -webkit-box-shadow: none !important;
512
+ box-shadow: none !important;
513
+ }
514
+
515
+ .wpr-my-templates-list .wpr-delete-template {
516
+ background: #ff5a4b;
517
+ }
518
+
519
+ .wpr-my-templates-list .wpr-delete-template:hover {
520
+ background: #FF4635;
521
+ }
522
+
523
+ .wpr-my-templates-list .wpr-action-buttons > * {
524
+ display: inline-block;
525
+ padding: 3px 20px;
526
+ margin-right: 10px;
527
+ border: 0;
528
+ letter-spacing: 0.5px;
529
+ }
530
+
531
+ .wpr-my-templates-list .wpr-action-buttons > *:last-child {
532
+ margin-right: 0;
533
+ }
534
+
535
+ .wpr-my-templates-list .wpr-action-buttons .dashicons {
536
+ font-size: 16px;
537
+ line-height: 30px;
538
+ }
539
+
540
+ .wpr-active-conditions-template {
541
+ border-left: 5px solid #6A4BFF;
542
+ background: #F6F7F7;
543
+ }
544
+
545
+ .wpr-my-templates-list .wpr-no-templates {
546
+ background: #fff !important;
547
+ }
548
+
549
+
550
+ /*--------------------------------------------------------------
551
+ == Settings
552
+ --------------------------------------------------------------*/
553
+ .wpr-settings-group:first-of-type {
554
+ margin-top: 50px;
555
+ }
556
+
557
+ .wpr-settings-group {
558
+ position: relative;
559
+ width: 35%;
560
+ background: #f9f9f9;
561
+ padding: 30px;
562
+ margin-bottom: 80px;
563
+ -webkit-box-shadow: 1px 2px 3px rgba(0,0,0,0.1);
564
+ box-shadow: 1px 2px 3px rgba(0,0,0,0.1);
565
+ border-radius: 0 3px 3px 3px;
566
+ }
567
+
568
+ .wpr-settings-group-inner {
569
+ position: relative;
570
+ }
571
+
572
+ .wpr-settings-group-title {
573
+ position: absolute;
574
+ top: 0;
575
+ left: 0;
576
+ -webkit-transform: translateY(-100%);
577
+ -ms-transform: translateY(-100%);
578
+ transform: translateY(-100%);
579
+ padding: 10px 30px;
580
+ background: #f9f9f9;
581
+ margin: 0;
582
+ -webkit-box-shadow: 0 -2px 3px rgba(0,0,0,0.05);
583
+ box-shadow: 0 -2px 3px rgba(0,0,0,0.05);
584
+ border-radius: 3px 3px 0 0;
585
+ color: #6A4BFF;
586
+ font-size: 14px;
587
+ }
588
+
589
+ .wpr-setting {
590
+ margin-bottom: 20px;
591
+ }
592
+
593
+ .wpr-setting h4 {
594
+ margin-bottom: 8px;
595
+ }
596
+
597
+ .wpr-setting input:not(input[type='checkbox']) {
598
+ border: 1px solid #e8e8e8;
599
+ width: 100%;
600
+ padding: 5px 15px;
601
+ }
602
+
603
+ .wpr-setting input[type='checkbox'] {
604
+ margin-right: 8px;
605
+ }
606
+
607
+ .wpr-settings .submit:first-of-type {
608
+ margin-top: 0;
609
+ padding-top: 0;
610
+ margin-bottom: 70px;
611
+ }
612
+
613
+ .wp-picker-clear {
614
+ width: 100px !important;
615
+ }
616
+
617
+ /*--------------------------------------------------------------
618
+ == Conditions
619
+ --------------------------------------------------------------*/
620
+ .wpr-admin-popup-wrap {
621
+ display: none;
622
+ position: fixed;
623
+ top: 0;
624
+ left: 0;
625
+ z-index: 9999;
626
+ background-color: rgba(0, 0, 0, 0.6);
627
+ width: 100%;
628
+ height: 100%;
629
+ }
630
+
631
+ .wpr-admin-popup {
632
+ display: -webkit-box;
633
+ display: -ms-flexbox;
634
+ display: flex;
635
+ -ms-flex-pack: distribute;
636
+ justify-content: space-around;
637
+ -webkit-box-align: center;
638
+ -ms-flex-align: center;
639
+ align-items: center;
640
+ -webkit-box-orient: vertical;
641
+ -webkit-box-direction: normal;
642
+ -ms-flex-direction: column;
643
+ flex-direction: column;
644
+ position: absolute;
645
+ top: 50%;
646
+ left: 50%;
647
+ -webkit-transform: translate(-50%,-50%);
648
+ -ms-transform: translate(-50%,-50%);
649
+ transform: translate(-50%,-50%);
650
+ width: 80%;
651
+ max-width: 850px;
652
+ padding: 70px 20px 20px 20px;
653
+ background-color: #F1F3F5;
654
+ }
655
+
656
+
657
+ .wpr-admin-popup .close-popup {
658
+ position: absolute;
659
+ top: 10px;
660
+ right: 15px;
661
+ font-size: 26px;
662
+ cursor: pointer;
663
+ color: #59626a;
664
+ }
665
+
666
+ .wpr-conditions.wpr-tab-archive .global-condition-select,
667
+ .wpr-conditions.wpr-tab-archive .singles-condition-select,
668
+ .wpr-conditions.wpr-tab-product_archive .global-condition-select,
669
+ .wpr-conditions.wpr-tab-product_archive .singles-condition-select,
670
+ .wpr-conditions.wpr-tab-single .global-condition-select,
671
+ .wpr-conditions.wpr-tab-single .archives-condition-select,
672
+ .wpr-conditions.wpr-tab-product_single .global-condition-select,
673
+ .wpr-conditions.wpr-tab-product_single .archives-condition-select {
674
+ display: none !important;
675
+ }
676
+
677
+ .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(1),
678
+ .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(2),
679
+ .wpr-conditions-wrap.blog-posts .singles-condition-select option:nth-child(3) {
680
+ /*display: none;*/
681
+ }
682
+
683
+ .wpr-conditions.wpr-tab-archive .archives-condition-select,
684
+ .wpr-conditions.wpr-tab-product_archive .archives-condition-select,
685
+ .wpr-conditions.wpr-tab-single .singles-condition-select,
686
+ .wpr-conditions.wpr-tab-product_single .singles-condition-select {
687
+ display: block !important;
688
+ }
689
+
690
+ .wpr-conditions-sample {
691
+ display: none !important;
692
+ }
693
+
694
+ .wpr-conditions {
695
+ position: relative;
696
+ display: -webkit-box;
697
+ display: -ms-flexbox;
698
+ display: flex;
699
+ -webkit-box-align: center;
700
+ -ms-flex-align: center;
701
+ align-items: center;
702
+ margin-top: 10px;
703
+ width: 600px;
704
+ border-radius: 3px;
705
+ border: 1px solid #e8e8e8;
706
+ background: #fff;
707
+ }
708
+
709
+ .wpr-admin-popup header {
710
+ margin-top: 0;
711
+ margin-bottom: 20px;
712
+ text-align: center;
713
+ }
714
+
715
+ .wpr-admin-popup header h2 {
716
+ margin: 25px auto;
717
+ font-size: 26px;
718
+ color: #59626a;
719
+ }
720
+
721
+ .wpr-admin-popup header p {
722
+ margin-top: 0;
723
+ margin-bottom: 0;
724
+ color: #7f8b96;
725
+ }
726
+
727
+ .wpr-conditions select {
728
+ height: 35px;
729
+ height: 100%;
730
+ padding-top: 5px;
731
+ padding-bottom: 5px;
732
+ border-radius: 0;
733
+ border: none;
734
+ -webkit-box-flex: 1;
735
+ -ms-flex-positive: 1;
736
+ flex-grow: 1;
737
+ border-right: 1px solid #e8e8e8 !important;
738
+ background-size: 14px 14px;
739
+ }
740
+
741
+ span.wpr-add-conditions {
742
+ margin-top: 30px;
743
+ background: #A4AFB7;
744
+ color: #fff;
745
+ font-weight: 600;
746
+ letter-spacing: 1px;
747
+ text-transform: uppercase;
748
+ padding: 8px 20px;
749
+ border-radius: 3px;
750
+ cursor: pointer;
751
+ }
752
+
753
+ span.wpr-add-conditions:hover {
754
+ background: #848c92;
755
+ }
756
+
757
+ input.wpr-condition-input-ids {
758
+ display: none;
759
+ padding: 5px;
760
+ outline: none;
761
+ border: none;
762
+ border-radius: 0;
763
+ }
764
+
765
+ input.wpr-condition-input-ids,
766
+ .wpr-conditions select {
767
+ -ms-flex-negative: 0;
768
+ flex-shrink: 0;
769
+ -webkit-box-flex: 1;
770
+ -ms-flex-positive: 1;
771
+ flex-grow: 1;
772
+ max-width: none;
773
+ border: none;
774
+ -webkit-box-shadow: none !important;
775
+ box-shadow: none !important;
776
+ outline: none;
777
+ margin: 0;
778
+ text-indent: 5px;
779
+ }
780
+
781
+ .wpr-canvas-condition {
782
+ display: none;
783
+ margin-top: 20px;
784
+ }
785
+
786
+ .wpr-canvas-condition label {
787
+ display: inline-block;
788
+ }
789
+
790
+ .wpr-canvas-condition span {
791
+ margin-right: 20px;
792
+ }
793
+
794
+ #wpr-woo-products-per-page {
795
+ width: 40px;
796
+ border: 1px solid #e8e8e8;
797
+ text-align: center;
798
+ -webkit-box-shadow: none !important;
799
+ box-shadow: none !important;
800
+ margin-left: 10px;
801
+ }
802
+
803
+ .wpr-delete-template-conditions {
804
+ margin-left: auto;
805
+ position: absolute;
806
+ right: -30px;
807
+ color: #C2CBD2;
808
+ font-size: 22px;
809
+ cursor: pointer;
810
+ }
811
+
812
+ .wpr-delete-template-conditions:hover {
813
+ color: #81868a;
814
+ }
815
+
816
+ .wpr-save-conditions {
817
+ padding: 8px 20px;
818
+ color: #fff;
819
+ background: #6A4BFF;
820
+ margin-left: auto;
821
+ border-radius: 3px;
822
+ margin-top: 80px;
823
+ text-transform: uppercase;
824
+ letter-spacing: 0.5px;
825
+ font-weight: 600;
826
+ cursor: pointer;
827
+ }
828
+
829
+ .wpr-user-template-popup {
830
+ padding-top: 40px;
831
+ }
832
+
833
+ .wpr-user-template-popup header {
834
+ margin-bottom: 27px;
835
+ }
836
+
837
+ .wpr-user-template-popup .wpr-create-template {
838
+ padding: 11px 20px;
839
+ margin: 25px auto;
840
+ color: #fff;
841
+ background: #6A4BFF;
842
+ border-radius: 3px;
843
+ cursor: pointer;
844
+ }
845
+
846
+ .wpr-user-template-popup p {
847
+ max-width: 70%;
848
+ margin: auto;
849
+ }
850
+
851
+ input.wpr-user-template-title {
852
+ width: 350px;
853
+ border: 1px solid #d1d1d1;
854
+ padding: 5px 10px;
855
+ border-radius: 3px;
856
+ }
857
+
858
+ input.wpr-user-template-title::-webkit-input-placeholder,
859
+ input.wpr-condition-input-ids::-webkit-input-placeholder {
860
+ color: #9a9a9a;
861
+ }
862
+
863
+ input.wpr-user-template-title::-moz-placeholder,
864
+ input.wpr-condition-input-ids::-moz-placeholder {
865
+ color: #9a9a9a;
866
+ }
867
+
868
+ input.wpr-user-template-title:-ms-input-placeholder,
869
+ input.wpr-condition-input-ids:-ms-input-placeholder {
870
+ color: #9a9a9a;
871
+ }
872
+
873
+ input.wpr-user-template-title::-ms-input-placeholder,
874
+ input.wpr-condition-input-ids::-ms-input-placeholder {
875
+ color: #9a9a9a;
876
+ }
877
+
878
+ input.wpr-user-template-title::-webkit-input-placeholder, input.wpr-condition-input-ids::-webkit-input-placeholder {
879
+ color: #9a9a9a;
880
+ }
881
+
882
+ input.wpr-user-template-title::-moz-placeholder, input.wpr-condition-input-ids::-moz-placeholder {
883
+ color: #9a9a9a;
884
+ }
885
+
886
+ input.wpr-user-template-title:-ms-input-placeholder, input.wpr-condition-input-ids:-ms-input-placeholder {
887
+ color: #9a9a9a;
888
+ }
889
+
890
+ input.wpr-user-template-title::-ms-input-placeholder, input.wpr-condition-input-ids::-ms-input-placeholder {
891
+ color: #9a9a9a;
892
+ }
893
+
894
+ input.wpr-user-template-title::placeholder,
895
+ input.wpr-condition-input-ids::placeholder {
896
+ color: #9a9a9a;
897
+ }
898
+
899
+ input.wpr-user-template-title:focus {
900
+ border-color: #6A4BFF;
901
+ -webkit-box-shadow: none;
902
+ box-shadow: none;
903
+ }
904
+
905
+ /*--------------------------------------------------------------
906
+ == White Label
907
+ --------------------------------------------------------------*/
908
+ .wpr-wl-tab-content {
909
+ display: -webkit-box;
910
+ display: -ms-flexbox;
911
+ display: flex;
912
+ -webkit-box-align: start;
913
+ -ms-flex-align: start;
914
+ align-items: flex-start;
915
+ }
916
+
917
+ .wpr-wl-tab-content .wpr-settings-group:last-of-type {
918
+ margin-top: 50px;
919
+ margin-left: 50px;
920
+ }
921
+
922
+ .wpr-setting-custom-img-upload div button {
923
+ display: -webkit-box;
924
+ display: -ms-flexbox;
925
+ display: flex;
926
+ -webkit-box-align: center;
927
+ -ms-flex-align: center;
928
+ align-items: center;
929
+ margin-top: 10px;
930
+ padding: 10px 20px;
931
+ background: #ffffff;
932
+ border: 1px solid #e8e8e8;
933
+ border-radius: 3px;
934
+ font-weight: bold;
935
+ cursor: pointer;
936
+ }
937
+
938
+ .wpr-setting-custom-img-upload div button span {
939
+ margin-left: 5px;
940
+ }
941
+
942
+ .wpr-setting-custom-img-upload div button img {
943
+ width: 50px;
944
+ }
945
+
946
+ .wpr-setting-custom-ckbox h4 {
947
+ display: -webkit-box;
948
+ display: -ms-flexbox;
949
+ display: flex;
950
+ -webkit-box-orient: horizontal;
951
+ -webkit-box-direction: normal;
952
+ -ms-flex-direction: row;
953
+ flex-direction: row;
954
+ -webkit-box-pack: justify;
955
+ -ms-flex-pack: justify;
956
+ justify-content: space-between;
957
+ }
958
+
959
+ .wpr-setting-custom-ckbox label {
960
+ background: #dddbdb;
961
+ }
962
+
963
+ .wpr-setting-custom-ckbox p {
964
+ color: #a09f9f;
965
+ }
966
+
967
+ /*--------------------------------------------------------------
968
+ == Freemius
969
+ --------------------------------------------------------------*/
970
+ #fs_connect {
971
+ margin: 40px !important;
972
+ width: 615px !important;
973
+ border-top: 3px solid #2271B1 !important;
974
+ }
975
+
976
+ #fs_connect .fs-content {
977
+ padding: 25px 20px 35px 20px !important;
978
+ }
979
+
980
+ #fs_connect .fs-visual {
981
+ background: transparent !important;
982
+ }
983
+
984
+ #fs_connect .fs-visual .fs-site-icon,
985
+ #fs_connect .fs-visual .fs-plugin-icon,
986
+ #fs_connect .fs-visual .fs-connect-logo {
987
+ top: 20px !important;
988
+ }
989
+
990
+ #fs_connect .fs-visual .fs-plugin-icon,
991
+ #fs_connect .fs-visual .fs-connect-logo,
992
+ #fs_connect .fs-visual .fs-site-icon {
993
+ border: none !important;
994
+ }
995
+
996
+ #fs_connect .fs-visual .fs-site-icon i,
997
+ #fs_connect .fs-visual img{
998
+ overflow: hidden !important;
999
+ border-radius: 100px !important;
1000
+ }
1001
+
1002
+ #fs_connect .fs-actions {
1003
+ border-top: 1px solid #F2F2F2 !important;
1004
+ background: #F2F2F2 !important;
1005
+ }
1006
+
1007
+ #fs_connect .fs-actions .button {
1008
+ font-size: 14px !important;
1009
+ }
1010
+
1011
+ #fs_connect .fs-actions .button.button-secondary {
1012
+ padding: 0 25px !important;
1013
+ }
1014
+
1015
+ #fs_connect .fs-permissions {
1016
+ margin-top: 20px !important;
1017
+ }
1018
+
1019
+ #fs_connect .fs-permissions>.fs-trigger {
1020
+ -webkit-box-shadow: none !important;
1021
+ box-shadow: none !important;
1022
+ }
1023
+
1024
+ #fs_connect .fs-permissions.fs-open ul {
1025
+ margin: 30px 20px !important;
1026
+ }
1027
+
1028
+ #fs_connect .fs-permissions ul li {
1029
+ margin-bottom: 20px !important;
1030
+ }
1031
+
1032
+ #fs_connect .fs-permissions ul li .fs-permission-description span {
1033
+ font-size: 12px !important;
1034
+ text-transform: capitalize !important;
1035
+ }
1036
+
1037
+ #fs_connect .fs-permissions ul li .fs-permission-description p {
1038
+ font-size: 11px !important;
1039
+ margin-top: 0 !important;
1040
+ }
1041
+
1042
+ #fs_connect .fs-license-key-container {
1043
+ width: 100% !important;
1044
+ margin-top: 20px;
1045
+ }
1046
+
1047
+ #pframe,
1048
+ #fs_connect.require-license-key .fs-permissions,
1049
+ #fs_connect.require-license-key .fs-terms,
1050
+ #fs_connect .fs-freemium-licensing,
1051
+ #license_issues_link {
1052
+ display: none !important;
1053
+ }
1054
+
1055
+ /*--------------------------------------------------------------
1056
+ == Settings: Pro Options
1057
+ --------------------------------------------------------------*/
1058
+ .wpr-settings-pro-overlay {
1059
+ display: -webkit-box;
1060
+ display: -ms-flexbox;
1061
+ display: flex;
1062
+ -webkit-box-orient: vertical;
1063
+ -webkit-box-direction: normal;
1064
+ -ms-flex-direction: column;
1065
+ flex-direction: column;
1066
+ -webkit-box-align: center;
1067
+ -ms-flex-align: center;
1068
+ align-items: center;
1069
+ -webkit-box-pack: center;
1070
+ -ms-flex-pack: center;
1071
+ justify-content: center;
1072
+ position: absolute;
1073
+ top: 0;
1074
+ left: 0;
1075
+ width: 100%;
1076
+ height: 100%;
1077
+ background: rgba(0,0,0,0.4);
1078
+ color: #f9f9f9;
1079
+ font-size: 16px;
1080
+ text-decoration: none;
1081
+ text-transform: uppercase;
1082
+ font-weight: bold;
1083
+
1084
+ text-shadow: 1px 1px 1px #000;
1085
+ -webkit-box-shadow: 1px 1px 15px rgba(0,0,0,0.3);
1086
+ box-shadow: 1px 1px 15px rgba(0,0,0,0.3);
1087
+ }
1088
+
1089
+ .wpr-settings-pro-overlay:hover,
1090
+ .wpr-settings-pro-overlay:focus{
1091
+ color: #f9f9f9;
1092
+ }
1093
+
1094
+ .wpr-settings-pro-overlay .dashicons {
1095
+ font-size: 50px;
1096
+ line-height: 50px;
1097
+ margin-bottom: 40px;
1098
+ -webkit-transform: translateX(-50%);
1099
+ -ms-transform: translateX(-50%);
1100
+ transform: translateX(-50%);
1101
+ }
1102
+
1103
+ .wpr-settings-pro-overlay .dashicons:nth-child(2) {
1104
+ display: none;
1105
+ }
1106
+
1107
+ .wpr-settings-pro-overlay:hover .dashicons:nth-child(2) {
1108
+ display: block;
1109
+ }
1110
+
1111
+ .wpr-settings-pro-overlay:hover .dashicons:nth-child(1) {
1112
+ display: none;
1113
+ }.example {
1114
+ display: -ms-grid;
1115
+ display: grid;
1116
+ -webkit-transition: all .5s;
1117
+ -o-transition: all .5s;
1118
+ transition: all .5s;
1119
+ -webkit-user-select: none;
1120
+ -moz-user-select: none;
1121
+ -ms-user-select: none;
1122
+ user-select: none;
1123
+ background: -webkit-gradient(linear, left top, left bottom, from(white), to(black));
1124
+ background: -o-linear-gradient(top, white, black);
1125
+ background: linear-gradient(to bottom, white, black);
1126
+ }
1127
+
1128
+ /* Disable Notices */
1129
+ .notice:not(.wpr-plugin-update-notice),
1130
+ div.fs-notice.updated, div.fs-notice.success {
1131
+ display: none !important;
1132
  }
assets/css/admin/templates-kit.css CHANGED
@@ -1,643 +1,643 @@
1
- .royal-addons_page_wpr-templates-kit #wpwrap {
2
- background: #F6F6F6;
3
- }
4
-
5
- .royal-addons_page_wpr-templates-kit #wpcontent {
6
- padding: 0;
7
- }
8
-
9
- img {
10
- display: block;
11
- max-width: 100%;
12
- width: 100%;
13
- }
14
-
15
- .wpr-templates-kit-page > header {
16
- position: sticky;
17
- top: 32px;
18
- z-index: 99;
19
- display: -webkit-box;
20
- display: -ms-flexbox;
21
- display: flex;
22
- -webkit-box-pack: justify;
23
- -ms-flex-pack: justify;
24
- justify-content: space-between;
25
- background: #fff;
26
- -webkit-box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
27
- box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
28
- }
29
-
30
- .wpr-templates-kit-logo {
31
- display: -webkit-box;
32
- display: -ms-flexbox;
33
- display: flex;
34
- }
35
-
36
- .wpr-templates-kit-logo div {
37
- padding: 20px;
38
- border-right: 1px solid #e8e8e8;
39
- }
40
-
41
- .wpr-templates-kit-logo .back-btn {
42
- display: none;
43
- -webkit-box-align: center;
44
- -ms-flex-align: center;
45
- align-items: center;
46
- font-weight: bold;
47
- color: #6d7882;
48
- cursor: pointer;
49
- }
50
-
51
- .wpr-templates-kit-logo .back-btn:hover {
52
- color: #222;
53
- }
54
-
55
- .wpr-templates-kit-search {
56
- display: -webkit-box;
57
- display: -ms-flexbox;
58
- display: flex;
59
- -webkit-box-align: center;
60
- -ms-flex-align: center;
61
- align-items: center;
62
- position: absolute;
63
- top: 20px;
64
- left: 50%;
65
- -webkit-transform: translateX(-50%);
66
- -ms-transform: translateX(-50%);
67
- transform: translateX(-50%);
68
- }
69
-
70
- .wpr-templates-kit-search input {
71
- width: 500px;
72
- height: 45px;
73
- padding-left: 15px;
74
- border: 2px solid #e8e8e8 !important;
75
- -webkit-box-shadow: none !important;
76
- box-shadow: none !important;
77
- }
78
-
79
- .wpr-templates-kit-search .dashicons {
80
- margin-left: -32px;
81
- color: #777;
82
- }
83
-
84
- .wpr-templates-kit-price-filter {
85
- position: relative;
86
- width: 110px;
87
- height: 40px;
88
- margin: 20px;
89
- border: 2px solid #e8e8e8;
90
- line-height: 40px;
91
- padding: 0 20px;
92
- border-radius: 3px;
93
- font-size: 14px;
94
- cursor: pointer;
95
- }
96
-
97
- .wpr-templates-kit-price-filter .dashicons {
98
- position: absolute;
99
- right: 12px;
100
- line-height: 40px;
101
- font-size: 14px;
102
- }
103
-
104
- .wpr-templates-kit-price-filter:hover ul {
105
- display: block;
106
- }
107
-
108
- .wpr-templates-kit-price-filter ul {
109
- display: none;
110
- background: #fff;
111
- position: absolute;
112
- width: 100%;
113
- top: 26px;
114
- left: -2px;
115
- padding: 0;
116
- border: 2px solid #e8e8e8;
117
- }
118
-
119
- .wpr-templates-kit-price-filter ul li {
120
- padding: 0 20px;
121
- line-height: 32px;
122
- margin-bottom: 0 !important;
123
- border-bottom: 1px solid #e8e8e8;
124
- }
125
-
126
- .wpr-templates-kit-price-filter ul li:last-child {
127
- border-bottom: 0;
128
- }
129
-
130
- .wpr-templates-kit-price-filter ul li:hover {
131
- background: #e8e8e8;
132
- }
133
-
134
- .wpr-templates-kit-filters {
135
- display: none;
136
- padding: 20px;
137
- }
138
-
139
- .wpr-templates-kit-filters div {
140
- padding: 10px 20px;
141
- border: 2px solid #e8e8e8;
142
- border-radius: 3px;
143
- font-size: 16px;
144
- }
145
-
146
- .wpr-templates-kit-filters ul {
147
- display: none;
148
- }
149
-
150
- .wpr-templates-kit-page-title {
151
- text-align: center;
152
- margin-top: 65px;
153
- margin-bottom: 35px;
154
- }
155
-
156
- .wpr-templates-kit-page-title h1 {
157
- font-size: 35px;
158
- color: #555;
159
- }
160
-
161
- .button.wpr-options-button {
162
- padding: 3px 18px;
163
- border: 0;
164
- color: #fff;
165
- background: #6A4BFF;
166
- -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
167
- box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
168
- font-size: 14px;
169
- }
170
-
171
- .button.wpr-options-button:hover,
172
- .button.wpr-options-button:focus {
173
- color: #fff;
174
- background: #6A4BFF;
175
- border: none;
176
- }
177
-
178
- .button.wpr-options-button .dashicons {
179
- font-size: 16px;
180
- line-height: 32px;
181
- }
182
-
183
- .wpr-templates-kit-grid {
184
- display: -ms-grid;
185
- display: grid;
186
- -ms-grid-columns: 1fr 20px 1fr 20px 1fr 20px 1fr;
187
- grid-template-columns: repeat(4, 1fr);
188
- grid-column-gap: 30px;
189
- grid-row-gap: 30px;
190
- padding: 30px;
191
- }
192
-
193
-
194
- @media screen and (max-width: 1400px) {
195
- .wpr-templates-kit-grid {
196
- grid-template-columns: repeat(3, 1fr);
197
- }
198
- }
199
-
200
- .wpr-templates-kit-grid .grid-item {
201
- position: relative;
202
- overflow: hidden;
203
- border: 1px solid #e8e8e8;
204
- -webkit-box-shadow: 0 0 3px 0 rgba(0,0,0,0.1);
205
- box-shadow: 0 0 3px 0 rgba(0,0,0,0.1);
206
- background: #fff;
207
- }
208
-
209
-
210
- .wpr-templates-kit-grid .grid-item[data-price="pro"]:before {
211
- content: 'Premium';
212
- display: block;
213
- position: absolute;
214
- top: 20px;
215
- right: -30px;
216
- z-index: 10;
217
- -webkit-transform: rotate(45deg);
218
- -ms-transform: rotate(45deg);
219
- transform: rotate(45deg);
220
- padding: 7px 40px;
221
- font-size: 13px;
222
- letter-spacing: .4px;
223
- background: #6a4bff;
224
- color: #fff;
225
- -webkit-box-shadow: 0 0 5px 0 rgb(0 0 0 / 70%);
226
- box-shadow: 0 0 5px 0 rgb(0 0 0 / 70%);
227
- }
228
-
229
- .wpr-templates-kit-grid .image-wrap {
230
- position: relative;
231
- border-bottom: 1px solid #e8e8e8;
232
- }
233
-
234
- .wpr-templates-kit-grid .image-wrap:hover .image-overlay {
235
- opacity: 1;
236
- }
237
-
238
- .wpr-templates-kit-grid .image-overlay {
239
- opacity: 0;
240
- display: -webkit-box;
241
- display: -ms-flexbox;
242
- display: flex;
243
- -webkit-box-align: center;
244
- -ms-flex-align: center;
245
- align-items: center;
246
- -webkit-box-pack: center;
247
- -ms-flex-pack: center;
248
- justify-content: center;
249
- position: absolute;
250
- top: 0;
251
- left: 0;
252
- width: 100%;
253
- height: 100%;
254
- background: rgba(0,0,0,0.2);
255
- cursor: pointer;
256
- -webkit-transition: opacity 0.2s ease-in;
257
- -o-transition: opacity 0.2s ease-in;
258
- transition: opacity 0.2s ease-in;
259
- }
260
-
261
- .wpr-templates-kit-grid .image-overlay .dashicons {
262
- font-size: 30px;
263
- color: #fff;
264
- }
265
-
266
- .wpr-templates-kit-grid .grid-item footer {
267
- display: -webkit-box;
268
- display: -ms-flexbox;
269
- display: flex;
270
- padding: 15px;
271
- -webkit-box-pack: justify;
272
- -ms-flex-pack: justify;
273
- justify-content: space-between;
274
- }
275
-
276
- .wpr-templates-kit-grid .grid-item footer h3 {
277
- margin: 0;
278
- font-size: 16px;
279
- text-transform: capitalize;
280
- }
281
-
282
- .wpr-templates-kit-grid .grid-item footer span {
283
- position: relative;
284
- min-width: 77px;
285
- height: 20px;
286
- background-color: #5130ef;
287
- color: #fff;
288
- font-size: 12px;
289
- padding: 2px 10px;
290
- border-radius: 3px;
291
- }
292
-
293
- span.wpr-woo-builder-label {
294
- background-color: #7B51AD !important;
295
- text-align: center;
296
- }
297
-
298
- .wpr-templates-kit-grid .grid-item footer span:after {
299
- display: none;
300
- width: 125px;
301
- position: absolute;
302
- top: -50px;
303
- left: 30%;
304
- -webkit-transform: translateX(-50%);
305
- -ms-transform: translateX(-50%);
306
- transform: translateX(-50%);
307
- padding: 7px 10px;
308
- border-radius: 3px;
309
- background-color: #333;
310
- font-size: 12px;
311
- line-height: 15px;
312
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.4);
313
- box-shadow: 0 0 5px rgba(0,0,0,0.4);
314
- }
315
-
316
- .wpr-templates-kit-grid .grid-item footer span.wpr-theme-builder-label:after {
317
- content: "This Kit includes Theme Builder templates.";
318
- }
319
-
320
- .wpr-templates-kit-grid .grid-item footer span.wpr-woo-builder-label:after {
321
- content: "This Kit includes WooCommerce Builder templates.";
322
- }
323
-
324
- .wpr-templates-kit-grid .grid-item footer span:hover:after {
325
- display: block;
326
- }
327
-
328
- .wpr-templates-kit-single {
329
- display: none;
330
- }
331
-
332
- .wpr-templates-kit-single .grid-item a {
333
- text-decoration: none;
334
- }
335
-
336
- .wpr-templates-kit-single .action-buttons-wrap {
337
- display: -webkit-box;
338
- display: -ms-flexbox;
339
- display: flex;
340
- -webkit-box-pack: justify;
341
- -ms-flex-pack: justify;
342
- justify-content: space-between;
343
- position: fixed;
344
- bottom: 0;
345
- left: 0;
346
- right: 0;
347
- z-index: 10;
348
- padding: 25px 30px;
349
- background: #fff;
350
- -webkit-box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
351
- box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
352
- }
353
-
354
- .action-buttons-wrap a,
355
- .action-buttons-wrap button {
356
- padding: 5px 25px !important;
357
- }
358
-
359
- .wpr-templates-kit-single .preview-demo .dashicons {
360
- font-size: 14px;
361
- line-height: 28px;
362
- }
363
-
364
- .wpr-templates-kit-single .import-kit,
365
- .wpr-templates-kit-single .get-access {
366
- background: #6A4BFF;
367
- color: #fff;
368
- }
369
-
370
- .wpr-templates-kit-single .import-kit:hover,
371
- .wpr-templates-kit-single .import-kit:focus,
372
- .wpr-templates-kit-single .get-access:hover,
373
- .wpr-templates-kit-single .get-access:focus {
374
- background: #5130ef;
375
- color: #fff;
376
- -webkit-box-shadow: none !important;
377
- box-shadow: none !important;
378
- }
379
-
380
- .wpr-templates-kit-single .import-kit .dashicons,
381
- .wpr-templates-kit-single .get-access .dashicons {
382
- font-size: 14px;
383
- line-height: 30px;
384
- }
385
-
386
- .wpr-templates-kit-single .selected-template {
387
- border: 1px solid #2271B1;
388
- -webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
389
- box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
390
- }
391
-
392
- .import-template-buttons .import-template {
393
- display: none;
394
- }
395
-
396
- .wpr-templates-kit-single .import-template strong {
397
- text-transform: capitalize;
398
- }
399
-
400
- .wpr-import-kit-popup-wrap {
401
- display: none;
402
- position: relative;
403
- z-index: 9999999;
404
- }
405
-
406
- .wpr-import-kit-popup-wrap .overlay {
407
- position: fixed;
408
- top: 0;
409
- left: 0;
410
- z-index: 9999999;
411
- width: 100%;
412
- height: 100%;
413
- background: rgba(0,0,0,0.5);
414
- }
415
-
416
- .wpr-import-help {
417
- margin-top: 20px;
418
- text-align: right;
419
- }
420
-
421
- .wpr-import-help a {
422
- width: 50%;
423
- font-size: 12px;
424
- text-align: right;
425
- text-decoration: none;
426
- color: #8F5D64;
427
- }
428
-
429
- .wpr-import-help a:hover {
430
- text-decoration: underline;
431
- }
432
-
433
- .wpr-import-help a span {
434
- vertical-align: middle;
435
- margin-bottom: 2px;
436
- font-size: 12px !important;
437
- width: 12px !important;
438
- height: 12px !important;
439
- text-decoration: none !important
440
- }
441
-
442
- .wpr-import-kit-popup {
443
- overflow: hidden;
444
- position: fixed;
445
- top: 50%;
446
- left: 50%;
447
- -webkit-transform: translate(-50%,-50%);
448
- -ms-transform: translate(-50%,-50%);
449
- transform: translate(-50%,-50%);
450
- z-index: 9999999;
451
- width: 555px;
452
- background: #f5f5f5;
453
- border-radius: 3px;
454
- }
455
-
456
- .wpr-import-kit-popup header {
457
- display: -webkit-box;
458
- display: -ms-flexbox;
459
- display: flex;
460
- -webkit-box-pack: justify;
461
- -ms-flex-pack: justify;
462
- justify-content: space-between;
463
- padding-left: 25px;
464
- -webkit-box-shadow: 2px 0 5px 0 rgba(0,0,0,0.2);
465
- box-shadow: 2px 0 5px 0 rgba(0,0,0,0.2);
466
- }
467
-
468
- .wpr-import-kit-popup .close-btn {
469
- display: none;
470
- height: 50px;
471
- line-height: 50px;
472
- width: 50px;
473
- cursor: pointer;
474
- border-left: 1px solid #eee;
475
- color: #aaa;
476
- font-size: 22px;
477
- }
478
-
479
- .wpr-import-kit-popup .content {
480
- padding: 25px;
481
- }
482
-
483
- .wpr-import-kit-popup .content p:first-child {
484
- margin-top: 0;
485
- }
486
-
487
- .wpr-import-kit-popup .progress-wrap {
488
- background: #fff;
489
- border-radius: 3px;
490
- margin-top: 25px;
491
- }
492
-
493
- .wpr-import-kit-popup .progress-wrap strong {
494
- padding: 10px;
495
- display: block;
496
- }
497
-
498
- .wpr-import-kit-popup .progress-bar {
499
- width: 30px;
500
- height: 4px;
501
- background: #2271B1;
502
- }
503
-
504
- .dot-flashing {
505
- display: inline-block;
506
- margin-left: 10px;
507
- margin-bottom: -1px;
508
- position: relative;
509
- width: 3px;
510
- height: 3px;
511
- border-radius: 10px;
512
- background-color: #3c434a;
513
- color: #3c434a;
514
- -webkit-animation: dotFlashing 1s infinite linear alternate;
515
- animation: dotFlashing 1s infinite linear alternate;
516
- -webkit-animation-delay: .5s;
517
- animation-delay: .5s;
518
- }
519
-
520
- .dot-flashing::before, .dot-flashing::after {
521
- content: '';
522
- display: inline-block;
523
- position: absolute;
524
- top: 0;
525
- }
526
-
527
- .dot-flashing::before {
528
- left: -6px;
529
- width: 3px;
530
- height: 3px;
531
- border-radius: 10px;
532
- background-color: #3c434a;
533
- color: #3c434a;
534
- -webkit-animation: dotFlashing 1s infinite alternate;
535
- animation: dotFlashing 1s infinite alternate;
536
- -webkit-animation-delay: 0s;
537
- animation-delay: 0s;
538
- }
539
-
540
- .dot-flashing::after {
541
- left: 6px;
542
- width: 3px;
543
- height: 3px;
544
- border-radius: 10px;
545
- background-color: #3c434a;
546
- color: #3c434a;
547
- -webkit-animation: dotFlashing 1s infinite alternate;
548
- animation: dotFlashing 1s infinite alternate;
549
- -webkit-animation-delay: 1s;
550
- animation-delay: 1s;
551
- }
552
-
553
- @-webkit-keyframes dotFlashing {
554
- 0% {
555
- background-color: #3c434a;
556
- }
557
- 50%,
558
- 100% {
559
- background-color: #ebe6ff;
560
- }
561
- }
562
-
563
- @keyframes dotFlashing {
564
- 0% {
565
- background-color: #3c434a;
566
- }
567
- 50%,
568
- 100% {
569
- background-color: #ebe6ff;
570
- }
571
- }
572
-
573
- .wpr-templates-kit-not-found {
574
- display: none;
575
- -webkit-box-orient: vertical;
576
- -webkit-box-direction: normal;
577
- -ms-flex-direction: column;
578
- flex-direction: column;
579
- -webkit-box-align: center;
580
- -ms-flex-align: center;
581
- align-items: center
582
- }
583
-
584
- .wpr-templates-kit-not-found img {
585
- width: 180px;
586
- }
587
-
588
- .wpr-templates-kit-not-found h1 {
589
- margin: 0;
590
- }
591
-
592
- .wpr-templates-kit-not-found a {
593
- display: inline-block;
594
- padding: 10px 25px;
595
- margin-top: 15px;
596
- background: #6A4BFF;
597
- color: #fff;
598
- text-decoration: none;
599
- border-radius: 3px;
600
- }
601
-
602
- .wpr-templates-kit-not-found a:hover {
603
- background: #5836fd;
604
- }
605
-
606
- /* Disable Notices */
607
- .notice:not(.wpr-plugin-update-notice),
608
- div.fs-notice.updated, div.fs-notice.success {
609
- display: none !important;
610
- }
611
-
612
- /* Impot Error */
613
- .progress-wrap.import-error .progress-bar {
614
- width: 100% !important;
615
- background-color: #ff6060;
616
- }
617
-
618
- .progress-wrap.import-error strong span {
619
- font-weight: normal;
620
- font-style: italic;
621
- color: #888;
622
- }
623
-
624
- .wpr-import-help.import-error {
625
- text-align: center;
626
- }
627
-
628
- .wpr-import-help.import-error a {
629
- width: auto;
630
- display: inline-block;
631
- color: #fff;
632
- background-color: #2271B1;
633
- font-size: 14px;
634
- padding: 5px 15px 6px;
635
- text-decoration: none;
636
- border-radius: 3px;
637
- }
638
-
639
- .wpr-import-help.import-error a span {
640
- font-size: 14px !important;
641
- width: 14px !important;
642
- height: 14px !important;
643
  }
1
+ .royal-addons_page_wpr-templates-kit #wpwrap {
2
+ background: #F6F6F6;
3
+ }
4
+
5
+ .royal-addons_page_wpr-templates-kit #wpcontent {
6
+ padding: 0;
7
+ }
8
+
9
+ img {
10
+ display: block;
11
+ max-width: 100%;
12
+ width: 100%;
13
+ }
14
+
15
+ .wpr-templates-kit-page > header {
16
+ position: sticky;
17
+ top: 32px;
18
+ z-index: 99;
19
+ display: -webkit-box;
20
+ display: -ms-flexbox;
21
+ display: flex;
22
+ -webkit-box-pack: justify;
23
+ -ms-flex-pack: justify;
24
+ justify-content: space-between;
25
+ background: #fff;
26
+ -webkit-box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
27
+ box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
28
+ }
29
+
30
+ .wpr-templates-kit-logo {
31
+ display: -webkit-box;
32
+ display: -ms-flexbox;
33
+ display: flex;
34
+ }
35
+
36
+ .wpr-templates-kit-logo div {
37
+ padding: 20px;
38
+ border-right: 1px solid #e8e8e8;
39
+ }
40
+
41
+ .wpr-templates-kit-logo .back-btn {
42
+ display: none;
43
+ -webkit-box-align: center;
44
+ -ms-flex-align: center;
45
+ align-items: center;
46
+ font-weight: bold;
47
+ color: #6d7882;
48
+ cursor: pointer;
49
+ }
50
+
51
+ .wpr-templates-kit-logo .back-btn:hover {
52
+ color: #222;
53
+ }
54
+
55
+ .wpr-templates-kit-search {
56
+ display: -webkit-box;
57
+ display: -ms-flexbox;
58
+ display: flex;
59
+ -webkit-box-align: center;
60
+ -ms-flex-align: center;
61
+ align-items: center;
62
+ position: absolute;
63
+ top: 20px;
64
+ left: 50%;
65
+ -webkit-transform: translateX(-50%);
66
+ -ms-transform: translateX(-50%);
67
+ transform: translateX(-50%);
68
+ }
69
+
70
+ .wpr-templates-kit-search input {
71
+ width: 500px;
72
+ height: 45px;
73
+ padding-left: 15px;
74
+ border: 2px solid #e8e8e8 !important;
75
+ -webkit-box-shadow: none !important;
76
+ box-shadow: none !important;
77
+ }
78
+
79
+ .wpr-templates-kit-search .dashicons {
80
+ margin-left: -32px;
81
+ color: #777;
82
+ }
83
+
84
+ .wpr-templates-kit-price-filter {
85
+ position: relative;
86
+ width: 110px;
87
+ height: 40px;
88
+ margin: 20px;
89
+ border: 2px solid #e8e8e8;
90
+ line-height: 40px;
91
+ padding: 0 20px;
92
+ border-radius: 3px;
93
+ font-size: 14px;
94
+ cursor: pointer;
95
+ }
96
+
97
+ .wpr-templates-kit-price-filter .dashicons {
98
+ position: absolute;
99
+ right: 12px;
100
+ line-height: 40px;
101
+ font-size: 14px;
102
+ }
103
+
104
+ .wpr-templates-kit-price-filter:hover ul {
105
+ display: block;
106
+ }
107
+
108
+ .wpr-templates-kit-price-filter ul {
109
+ display: none;
110
+ background: #fff;
111
+ position: absolute;
112
+ width: 100%;
113
+ top: 26px;
114
+ left: -2px;
115
+ padding: 0;
116
+ border: 2px solid #e8e8e8;
117
+ }
118
+
119
+ .wpr-templates-kit-price-filter ul li {
120
+ padding: 0 20px;
121
+ line-height: 32px;
122
+ margin-bottom: 0 !important;
123
+ border-bottom: 1px solid #e8e8e8;
124
+ }
125
+
126
+ .wpr-templates-kit-price-filter ul li:last-child {
127
+ border-bottom: 0;
128
+ }
129
+
130
+ .wpr-templates-kit-price-filter ul li:hover {
131
+ background: #e8e8e8;
132
+ }
133
+
134
+ .wpr-templates-kit-filters {
135
+ display: none;
136
+ padding: 20px;
137
+ }
138
+
139
+ .wpr-templates-kit-filters div {
140
+ padding: 10px 20px;
141
+ border: 2px solid #e8e8e8;
142
+ border-radius: 3px;
143
+ font-size: 16px;
144
+ }
145
+
146
+ .wpr-templates-kit-filters ul {
147
+ display: none;
148
+ }
149
+
150
+ .wpr-templates-kit-page-title {
151
+ text-align: center;
152
+ margin-top: 65px;
153
+ margin-bottom: 35px;
154
+ }
155
+
156
+ .wpr-templates-kit-page-title h1 {
157
+ font-size: 35px;
158
+ color: #555;
159
+ }
160
+
161
+ .button.wpr-options-button {
162
+ padding: 3px 18px;
163
+ border: 0;
164
+ color: #fff;
165
+ background: #6A4BFF;
166
+ -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
167
+ box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
168
+ font-size: 14px;
169
+ }
170
+
171
+ .button.wpr-options-button:hover,
172
+ .button.wpr-options-button:focus {
173
+ color: #fff;
174
+ background: #6A4BFF;
175
+ border: none;
176
+ }
177
+
178
+ .button.wpr-options-button .dashicons {
179
+ font-size: 16px;
180
+ line-height: 32px;
181
+ }
182
+
183
+ .wpr-templates-kit-grid {
184
+ display: -ms-grid;
185
+ display: grid;
186
+ -ms-grid-columns: 1fr 20px 1fr 20px 1fr 20px 1fr;
187
+ grid-template-columns: repeat(4, 1fr);
188
+ grid-column-gap: 30px;
189
+ grid-row-gap: 30px;
190
+ padding: 30px;
191
+ }
192
+
193
+
194
+ @media screen and (max-width: 1400px) {
195
+ .wpr-templates-kit-grid {
196
+ grid-template-columns: repeat(3, 1fr);
197
+ }
198
+ }
199
+
200
+ .wpr-templates-kit-grid .grid-item {
201
+ position: relative;
202
+ overflow: hidden;
203
+ border: 1px solid #e8e8e8;
204
+ -webkit-box-shadow: 0 0 3px 0 rgba(0,0,0,0.1);
205
+ box-shadow: 0 0 3px 0 rgba(0,0,0,0.1);
206
+ background: #fff;
207
+ }
208
+
209
+
210
+ .wpr-templates-kit-grid .grid-item[data-price="pro"]:before {
211
+ content: 'Premium';
212
+ display: block;
213
+ position: absolute;
214
+ top: 20px;
215
+ right: -30px;
216
+ z-index: 10;
217
+ -webkit-transform: rotate(45deg);
218
+ -ms-transform: rotate(45deg);
219
+ transform: rotate(45deg);
220
+ padding: 7px 40px;
221
+ font-size: 13px;
222
+ letter-spacing: .4px;
223
+ background: #6a4bff;
224
+ color: #fff;
225
+ -webkit-box-shadow: 0 0 5px 0 rgb(0 0 0 / 70%);
226
+ box-shadow: 0 0 5px 0 rgb(0 0 0 / 70%);
227
+ }
228
+
229
+ .wpr-templates-kit-grid .image-wrap {
230
+ position: relative;
231
+ border-bottom: 1px solid #e8e8e8;
232
+ }
233
+
234
+ .wpr-templates-kit-grid .image-wrap:hover .image-overlay {
235
+ opacity: 1;
236
+ }
237
+
238
+ .wpr-templates-kit-grid .image-overlay {
239
+ opacity: 0;
240
+ display: -webkit-box;
241
+ display: -ms-flexbox;
242
+ display: flex;
243
+ -webkit-box-align: center;
244
+ -ms-flex-align: center;
245
+ align-items: center;
246
+ -webkit-box-pack: center;
247
+ -ms-flex-pack: center;
248
+ justify-content: center;
249
+ position: absolute;
250
+ top: 0;
251
+ left: 0;
252
+ width: 100%;
253
+ height: 100%;
254
+ background: rgba(0,0,0,0.2);
255
+ cursor: pointer;
256
+ -webkit-transition: opacity 0.2s ease-in;
257
+ -o-transition: opacity 0.2s ease-in;
258
+ transition: opacity 0.2s ease-in;
259
+ }
260
+
261
+ .wpr-templates-kit-grid .image-overlay .dashicons {
262
+ font-size: 30px;
263
+ color: #fff;
264
+ }
265
+
266
+ .wpr-templates-kit-grid .grid-item footer {
267
+ display: -webkit-box;
268
+ display: -ms-flexbox;
269
+ display: flex;
270
+ padding: 15px;
271
+ -webkit-box-pack: justify;
272
+ -ms-flex-pack: justify;
273
+ justify-content: space-between;
274
+ }
275
+
276
+ .wpr-templates-kit-grid .grid-item footer h3 {
277
+ margin: 0;
278
+ font-size: 16px;
279
+ text-transform: capitalize;
280
+ }
281
+
282
+ .wpr-templates-kit-grid .grid-item footer span {
283
+ position: relative;
284
+ min-width: 77px;
285
+ height: 20px;
286
+ background-color: #5130ef;
287
+ color: #fff;
288
+ font-size: 12px;
289
+ padding: 2px 10px;
290
+ border-radius: 3px;
291
+ }
292
+
293
+ span.wpr-woo-builder-label {
294
+ background-color: #7B51AD !important;
295
+ text-align: center;
296
+ }
297
+
298
+ .wpr-templates-kit-grid .grid-item footer span:after {
299
+ display: none;
300
+ width: 125px;
301
+ position: absolute;
302
+ top: -50px;
303
+ left: 30%;
304
+ -webkit-transform: translateX(-50%);
305
+ -ms-transform: translateX(-50%);
306
+ transform: translateX(-50%);
307
+ padding: 7px 10px;
308
+ border-radius: 3px;
309
+ background-color: #333;
310
+ font-size: 12px;
311
+ line-height: 15px;
312
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.4);
313
+ box-shadow: 0 0 5px rgba(0,0,0,0.4);
314
+ }
315
+
316
+ .wpr-templates-kit-grid .grid-item footer span.wpr-theme-builder-label:after {
317
+ content: "This Kit includes Theme Builder templates.";
318
+ }
319
+
320
+ .wpr-templates-kit-grid .grid-item footer span.wpr-woo-builder-label:after {
321
+ content: "This Kit includes WooCommerce Builder templates.";
322
+ }
323
+
324
+ .wpr-templates-kit-grid .grid-item footer span:hover:after {
325
+ display: block;
326
+ }
327
+
328
+ .wpr-templates-kit-single {
329
+ display: none;
330
+ }
331
+
332
+ .wpr-templates-kit-single .grid-item a {
333
+ text-decoration: none;
334
+ }
335
+
336
+ .wpr-templates-kit-single .action-buttons-wrap {
337
+ display: -webkit-box;
338
+ display: -ms-flexbox;
339
+ display: flex;
340
+ -webkit-box-pack: justify;
341
+ -ms-flex-pack: justify;
342
+ justify-content: space-between;
343
+ position: fixed;
344
+ bottom: 0;
345
+ left: 0;
346
+ right: 0;
347
+ z-index: 10;
348
+ padding: 25px 30px;
349
+ background: #fff;
350
+ -webkit-box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
351
+ box-shadow: 0 0 7px 0 rgba(0,0,0,0.2);
352
+ }
353
+
354
+ .action-buttons-wrap a,
355
+ .action-buttons-wrap button {
356
+ padding: 5px 25px !important;
357
+ }
358
+
359
+ .wpr-templates-kit-single .preview-demo .dashicons {
360
+ font-size: 14px;
361
+ line-height: 28px;
362
+ }
363
+
364
+ .wpr-templates-kit-single .import-kit,
365
+ .wpr-templates-kit-single .get-access {
366
+ background: #6A4BFF;
367
+ color: #fff;
368
+ }
369
+
370
+ .wpr-templates-kit-single .import-kit:hover,
371
+ .wpr-templates-kit-single .import-kit:focus,
372
+ .wpr-templates-kit-single .get-access:hover,
373
+ .wpr-templates-kit-single .get-access:focus {
374
+ background: #5130ef;
375
+ color: #fff;
376
+ -webkit-box-shadow: none !important;
377
+ box-shadow: none !important;
378
+ }
379
+
380
+ .wpr-templates-kit-single .import-kit .dashicons,
381
+ .wpr-templates-kit-single .get-access .dashicons {
382
+ font-size: 14px;
383
+ line-height: 30px;
384
+ }
385
+
386
+ .wpr-templates-kit-single .selected-template {
387
+ border: 1px solid #2271B1;
388
+ -webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
389
+ box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
390
+ }
391
+
392
+ .import-template-buttons .import-template {
393
+ display: none;
394
+ }
395
+
396
+ .wpr-templates-kit-single .import-template strong {
397
+ text-transform: capitalize;
398
+ }
399
+
400
+ .wpr-import-kit-popup-wrap {
401
+ display: none;
402
+ position: relative;
403
+ z-index: 9999999;
404
+ }
405
+
406
+ .wpr-import-kit-popup-wrap .overlay {
407
+ position: fixed;
408
+ top: 0;
409
+ left: 0;
410
+ z-index: 9999999;
411
+ width: 100%;
412
+ height: 100%;
413
+ background: rgba(0,0,0,0.5);
414
+ }
415
+
416
+ .wpr-import-help {
417
+ margin-top: 20px;
418
+ text-align: right;
419
+ }
420
+
421
+ .wpr-import-help a {
422
+ width: 50%;
423
+ font-size: 12px;
424
+ text-align: right;
425
+ text-decoration: none;
426
+ color: #8F5D64;
427
+ }
428
+
429
+ .wpr-import-help a:hover {
430
+ text-decoration: underline;
431
+ }
432
+
433
+ .wpr-import-help a span {
434
+ vertical-align: middle;
435
+ margin-bottom: 2px;
436
+ font-size: 12px !important;
437
+ width: 12px !important;
438
+ height: 12px !important;
439
+ text-decoration: none !important
440
+ }
441
+
442
+ .wpr-import-kit-popup {
443
+ overflow: hidden;
444
+ position: fixed;
445
+ top: 50%;
446
+ left: 50%;
447
+ -webkit-transform: translate(-50%,-50%);
448
+ -ms-transform: translate(-50%,-50%);
449
+ transform: translate(-50%,-50%);
450
+ z-index: 9999999;
451
+ width: 555px;
452
+ background: #f5f5f5;
453
+ border-radius: 3px;
454
+ }
455
+
456
+ .wpr-import-kit-popup header {
457
+ display: -webkit-box;
458
+ display: -ms-flexbox;
459
+ display: flex;
460
+ -webkit-box-pack: justify;
461
+ -ms-flex-pack: justify;
462
+ justify-content: space-between;
463
+ padding-left: 25px;
464
+ -webkit-box-shadow: 2px 0 5px 0 rgba(0,0,0,0.2);
465
+ box-shadow: 2px 0 5px 0 rgba(0,0,0,0.2);
466
+ }
467
+
468
+ .wpr-import-kit-popup .close-btn {
469
+ display: none;
470
+ height: 50px;
471
+ line-height: 50px;
472
+ width: 50px;
473
+ cursor: pointer;
474
+ border-left: 1px solid #eee;
475
+ color: #aaa;
476
+ font-size: 22px;
477
+ }
478
+
479
+ .wpr-import-kit-popup .content {
480
+ padding: 25px;
481
+ }
482
+
483
+ .wpr-import-kit-popup .content p:first-child {
484
+ margin-top: 0;
485
+ }
486
+
487
+ .wpr-import-kit-popup .progress-wrap {
488
+ background: #fff;
489
+ border-radius: 3px;
490
+ margin-top: 25px;
491
+ }
492
+
493
+ .wpr-import-kit-popup .progress-wrap strong {
494
+ padding: 10px;
495
+ display: block;
496
+ }
497
+
498
+ .wpr-import-kit-popup .progress-bar {
499
+ width: 30px;
500
+ height: 4px;
501
+ background: #2271B1;
502
+ }
503
+
504
+ .dot-flashing {
505
+ display: inline-block;
506
+ margin-left: 10px;
507
+ margin-bottom: -1px;
508
+ position: relative;
509
+ width: 3px;
510
+ height: 3px;
511
+ border-radius: 10px;
512
+ background-color: #3c434a;
513
+ color: #3c434a;
514
+ -webkit-animation: dotFlashing 1s infinite linear alternate;
515
+ animation: dotFlashing 1s infinite linear alternate;
516
+ -webkit-animation-delay: .5s;
517
+ animation-delay: .5s;
518
+ }
519
+
520
+ .dot-flashing::before, .dot-flashing::after {
521
+ content: '';
522
+ display: inline-block;
523
+ position: absolute;
524
+ top: 0;
525
+ }
526
+
527
+ .dot-flashing::before {
528
+ left: -6px;
529
+ width: 3px;
530
+ height: 3px;
531
+ border-radius: 10px;
532
+ background-color: #3c434a;
533
+ color: #3c434a;
534
+ -webkit-animation: dotFlashing 1s infinite alternate;
535
+ animation: dotFlashing 1s infinite alternate;
536
+ -webkit-animation-delay: 0s;
537
+ animation-delay: 0s;
538
+ }
539
+
540
+ .dot-flashing::after {
541
+ left: 6px;
542
+ width: 3px;
543
+ height: 3px;
544
+ border-radius: 10px;
545
+ background-color: #3c434a;
546
+ color: #3c434a;
547
+ -webkit-animation: dotFlashing 1s infinite alternate;
548
+ animation: dotFlashing 1s infinite alternate;
549
+ -webkit-animation-delay: 1s;
550
+ animation-delay: 1s;
551
+ }
552
+
553
+ @-webkit-keyframes dotFlashing {
554
+ 0% {
555
+ background-color: #3c434a;
556
+ }
557
+ 50%,
558
+ 100% {
559
+ background-color: #ebe6ff;
560
+ }
561
+ }
562
+
563
+ @keyframes dotFlashing {
564
+ 0% {
565
+ background-color: #3c434a;
566
+ }
567
+ 50%,
568
+ 100% {
569
+ background-color: #ebe6ff;
570
+ }
571
+ }
572
+
573
+ .wpr-templates-kit-not-found {
574
+ display: none;
575
+ -webkit-box-orient: vertical;
576
+ -webkit-box-direction: normal;
577
+ -ms-flex-direction: column;
578
+ flex-direction: column;
579
+ -webkit-box-align: center;
580
+ -ms-flex-align: center;
581
+ align-items: center
582
+ }
583
+
584
+ .wpr-templates-kit-not-found img {
585
+ width: 180px;
586
+ }
587
+
588
+ .wpr-templates-kit-not-found h1 {
589
+ margin: 0;
590
+ }
591
+
592
+ .wpr-templates-kit-not-found a {
593
+ display: inline-block;
594
+ padding: 10px 25px;
595
+ margin-top: 15px;
596
+ background: #6A4BFF;
597
+ color: #fff;
598
+ text-decoration: none;
599
+ border-radius: 3px;
600
+ }
601
+
602
+ .wpr-templates-kit-not-found a:hover {
603
+ background: #5836fd;
604
+ }
605
+
606
+ /* Disable Notices */
607
+ .notice:not(.wpr-plugin-update-notice),
608
+ div.fs-notice.updated, div.fs-notice.success {
609
+ display: none !important;
610
+ }
611
+
612
+ /* Impot Error */
613
+ .progress-wrap.import-error .progress-bar {
614
+ width: 100% !important;
615
+ background-color: #ff6060;
616
+ }
617
+
618
+ .progress-wrap.import-error strong span {
619
+ font-weight: normal;
620
+ font-style: italic;
621
+ color: #888;
622
+ }
623
+
624
+ .wpr-import-help.import-error {
625
+ text-align: center;
626
+ }
627
+
628
+ .wpr-import-help.import-error a {
629
+ width: auto;
630
+ display: inline-block;
631
+ color: #fff;
632
+ background-color: #2271B1;
633
+ font-size: 14px;
634
+ padding: 5px 15px 6px;
635
+ text-decoration: none;
636
+ border-radius: 3px;
637
+ }
638
+
639
+ .wpr-import-help.import-error a span {
640
+ font-size: 14px !important;
641
+ width: 14px !important;
642
+ height: 14px !important;
643
  }
assets/css/admin/wporg-theme-notice.css CHANGED
@@ -1,3 +1,3 @@
1
- .rek-notice {
2
- display: none !important;
3
  }
1
+ .rek-notice {
2
+ display: none !important;
3
  }
assets/css/editor.min.css CHANGED
@@ -1,1004 +1,1004 @@
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-element--promotion .wpr-icon:after {
45
- top: 22px;
46
- right: -1px;
47
- opacity: 0.7;
48
- }
49
-
50
- #elementor-element--promotion__dialog .dialog-button {
51
- text-align: center;
52
- }
53
-
54
- .elementor-control-type-section[class*="elementor-control-wpr_section_"]:after {
55
- content: 'R';
56
- display: block;
57
- position: absolute;
58
- top: 7px;
59
- right: 7px;
60
- font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
61
- font-size: 10px;
62
- font-weight: bold;
63
- color: #ffffff;
64
- background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
65
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
66
- background-image: linear-gradient(#6A4BFF, #7E94FE);
67
- -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
68
- box-shadow: 0 0 2px 2px #b8c7ff;
69
- width: 19px;
70
- height: 19px;
71
- line-height: 19px;
72
- border-radius: 15px;
73
- margin: 3px;
74
- text-align: center;
75
- }
76
-
77
- /*--------------------------------------------------------------
78
- == Adjustments
79
- --------------------------------------------------------------*/
80
- .elementor-control-element_select,
81
- .elementor-control-element_align_hr,
82
- .elementor-control-element_read_more_text,
83
- .elementor-control-element_tax_sep,
84
- .elementor-control-element_sharing_icon_6,
85
- .elementor-control-element_sharing_trigger_direction,
86
- .elementor-control-element_sharing_icon_display,
87
- .elementor-control-element_sharing_tooltip,
88
- .elementor-control-element_custom_field_wrapper_html,
89
- .elementor-control-slider_item_bg_size,
90
- .elementor-control-element_addcart_variable_txt,
91
- .elementor-control-type,
92
- .elementor-control-show_last_update_date {
93
- margin-bottom: 15px;
94
- }
95
-
96
- .elementor-control-slider_content_bg_color,
97
- .elementor-control-slider_nav_border_border,
98
- .elementor-control-slider_nav_border_radius,
99
- .elementor-control-scroll_btn_vr,
100
- .elementor-control-pagination_load_more_text,
101
- .elementor-control-pagination_finish_text,
102
- .elementor-control-pagination_prev_next,
103
- .elementor-control-author_transition_duration,
104
- .elementor-control-comments_transition_duration,
105
- .elementor-control-likes_transition_duration,
106
- .elementor-control-sharing_transition_duration,
107
- .elementor-control-lightbox_transition_duration,
108
- .elementor-control-custom_field1_transition_duration,
109
- .elementor-control-custom_field2_transition_duration,
110
- .elementor-control-custom_field3_transition_duration,
111
- .elementor-control-custom_field4_transition_duration,
112
- .elementor-control-filters_transition_duration,
113
- .elementor-control-pagination_transition_duration,
114
- .elementor-control-element_extra_text_pos,
115
- .elementor-control-element_custom_field_wrapper,
116
- .elementor-control-overlay_post_link,
117
- .elementor-control-read_more_animation_height,
118
- .elementor-control-archive_link_transition_duration,
119
- .elementor-control-post_info_tax_select,
120
- .elementor-control-post_info_link_wrap,
121
- .elementor-control-post_info_modified_time,
122
- .elementor-control-tabs_sharing_custom_colors,
123
- .elementor-control-post_info_show_avatar,
124
- .elementor-control-post_info_cf,
125
- .elementor-control-pricing_items .elementor-control-price,
126
- .elementor-control-pricing_items .elementor-control-feature_text,
127
- .elementor-control-pricing_items .elementor-control-btn_text,
128
- .elementor-control-divider_style,
129
- .elementor-control-filters_pointer,
130
- .elementor-control-title_transition_duration,
131
- .elementor-control-tax1_transition_duration,
132
- .elementor-control-tax2_transition_duration,
133
- .elementor-control-filters_transition_duration,
134
- .elementor-control-pagination_older_text,
135
- .elementor-control-tooltip_position,
136
- .elementor-control-post_info_comments_text_1,
137
- .elementor-control-element_letter_count {
138
- padding-top: 15px !important;
139
- }
140
-
141
- .elementor-control-post_info_custom_field_video_tutorial {
142
- margin-top: 15px;
143
- }
144
-
145
- .elementor-control-title_pointer_animation + .elementor-control-title_transition_duration,
146
- .elementor-control-tax1_pointer_animation + .elementor-control-tax1_transition_duration,
147
- .elementor-control-tax2_pointer_animation + .elementor-control-tax2_transition_duration,
148
- .elementor-control-filters_pointer_animation + .elementor-control-filters_transition_duration {
149
- padding-top: 0 !important;
150
- }
151
-
152
- .elementor-control-pagination_load_more_text {
153
- padding-bottom: 0 !important;
154
- }
155
-
156
- .elementor-control-filters_transition_duration,
157
- .elementor-control-show_last_update_date {
158
- padding-top: 0 !important;
159
- }
160
-
161
- .elementor-control-animation_divider,
162
- .elementor-control-overlay_divider,
163
- .elementor-control-slider_item_btn_1_divider,
164
- .elementor-control-slider_item_btn_2_divider,
165
- .elementor-control-slider_btn_typography_1_divider,
166
- .elementor-control-slider_btn_box_shadow_1_divider,
167
- .elementor-control-slider_btn_typography_2_divider,
168
- .elementor-control-slider_btn_box_shadow_2_divider,
169
- .elementor-control-testimonial_title_divider,
170
- .elementor-control-social_media_divider,
171
- .elementor-control-social_divider_1,
172
- .elementor-control-social_divider_2,
173
- .elementor-control-social_divider_3,
174
- .elementor-control-social_divider_4,
175
- .elementor-control-social_divider_5,
176
- .elementor-control-custom_field_wrapper_html_divider1,
177
- .elementor-control-custom_field_wrapper_html_divider2,
178
- .elementor-control-lightbox_shadow_divider {
179
- padding: 0 !important;
180
- }
181
-
182
- .elementor-control-custom_field_wrapper_html_divider1 hr,
183
- .elementor-control-lightbox_shadow_divider hr {
184
- height: 1px !important;
185
- }
186
-
187
- .elementor-control-element_show_on {
188
- padding-top: 15px !important;
189
- border-top: 1px solid #d5dadf;
190
- }
191
-
192
- [class*="wpr__section_"] ~ .elementor-control-type-number .elementor-control-input-wrapper,
193
- [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-number .elementor-control-input-wrapper {
194
- max-width: 30% !important;
195
- margin-left: auto !important;
196
- }
197
-
198
- [class*="wpr__section_"] ~ .elementor-control-type-select .elementor-control-input-wrapper,
199
- [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-select .elementor-control-input-wrapper {
200
- width: auto !important;
201
- min-width: 30% !important;
202
- margin-left: auto !important;
203
- }
204
-
205
- .elementor-control-submit_preview_changes .elementor-control-input-wrapper {
206
- text-align: center !important;
207
- }
208
-
209
- .elementor-control-query_manual_related,
210
- .elementor-control-query_manual_current {
211
- display: none !important;
212
- }
213
-
214
- /* Fix Select Inputs */
215
- .elementor-control-button_hover_animation .elementor-control-input-wrapper,
216
- .elementor-control-front_btn_animation .elementor-control-input-wrapper,
217
- .elementor-control-back_btn_animation .elementor-control-input-wrapper {
218
- width: 135px !important;
219
- }
220
-
221
- .elementor-control-type-repeater .elementor-control-content > label {
222
- display: none !important;
223
- }
224
-
225
-
226
- /*--------------------------------------------------------------
227
- == Notification
228
- --------------------------------------------------------------*/
229
- #wpr-template-settings-notification {
230
- position: fixed;
231
- left: 40px;
232
- bottom: 5px;
233
- z-index: 9999;
234
- padding: 13px 25px;
235
- background: #fff;
236
- color: #222;
237
- -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
238
- box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
239
- border-radius: 3px;
240
- }
241
-
242
- #wpr-template-settings-notification:before {
243
- content: "";
244
- position: absolute;
245
- left: -6px;
246
- bottom: 10px;
247
- width: 0;
248
- height: 0;
249
- border-top: 6px solid transparent;
250
- border-bottom: 6px solid transparent;
251
- border-right-style: solid;
252
- border-right-width: 6px;
253
- border-right-color: #fff;
254
- }
255
-
256
- #wpr-template-settings-notification h4 {
257
- margin-bottom: 10px;
258
- }
259
-
260
- #wpr-template-settings-notification h4 span {
261
- font-size: 14px;
262
- vertical-align: super;
263
- color: #5f5f5f;
264
- }
265
-
266
- #wpr-template-settings-notification h4 i {
267
- margin-right: 10px;
268
- color: #3db050;
269
- font-size: 24px;
270
- }
271
-
272
- #wpr-template-settings-notification p {
273
- color: #666;
274
- font-size: 12px;
275
- line-height: 1.5;
276
- }
277
-
278
- #wpr-template-settings-notification > i {
279
- position: absolute;
280
- top: 7px;
281
- right: 7px;
282
- cursor: pointer;
283
- color: #999;
284
- }
285
-
286
- .elementor-control-cf7_notice,
287
- .elementor-control-wpforms_notice,
288
- .elementor-control-ninja_forms_notice,
289
- .elementor-control-caldera_notice {
290
- color: red;
291
- }
292
-
293
- /* Help Button - select with referrals - [href^="https://royal-elementor-addons.com/contact/"] */
294
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] {
295
- display: inline-block;
296
- padding: 12px 35px;
297
- font-size: 13px;
298
- font-weight: normal;
299
- color: #fff;
300
- background: #6A65FF;
301
- border-radius: 3px;
302
- -webkit-box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
303
- box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
304
- letter-spacing: 0.3px;
305
- -webkit-transition: all 0.2s ease-in;
306
- -o-transition: all 0.2s ease-in;
307
- transition: all 0.2s ease-in;
308
- }
309
-
310
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover {
311
- color: #fff;
312
- background: #6A4BFF;
313
- }
314
-
315
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] i {
316
- color: #fff;
317
- font-size: 14px;
318
- vertical-align: top;
319
- }
320
-
321
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i {
322
- color: #fff;
323
- }
324
-
325
- #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i:before {
326
- content: '\e942' !important;
327
- }
328
-
329
- .elementor-control-posts_slider_notice .elementor-control-raw-html {
330
- font-style: normal !important;
331
- }
332
-
333
- .elementor-control-product_notice_widget_info .elementor-control-raw-html {
334
- color: red;
335
- }
336
-
337
-
338
- /*--------------------------------------------------------------
339
- == Modal Popup Editor
340
- --------------------------------------------------------------*/
341
- .elementor-editor-wpr-popups .elementor-control-document_settings,
342
- .elementor-editor-wpr-popups .elementor-control-post_title,
343
- .elementor-editor-wpr-popups .elementor-control-post_status {
344
- display: none !important;
345
- }
346
-
347
-
348
- /*--------------------------------------------------------------
349
- == Elementor Editor Popup
350
- --------------------------------------------------------------*/
351
- #wpr-template-editor-popup .dialog-widget-content {
352
- width: 90vw;
353
- height: 90vh;
354
- }
355
-
356
- #wpr-template-editor-popup .dialog-message {
357
- padding: 0;
358
- width: 100%;
359
- height: 100%;
360
- }
361
-
362
- #wpr-template-editor-popup .dialog-close-button {
363
- font-size: 24px;
364
- color: #222;
365
- }
366
-
367
- #wpr-template-editor-popup .dialog-header {
368
- display: none;
369
- }
370
-
371
- #wpr-template-editor-loading {
372
- position: absolute;
373
- top: 0;
374
- left: 0;
375
- width: 100%;
376
- height: 100%;
377
- background: #f1f3f5;
378
- z-index: 9999;
379
- -webkit-transform: translateZ(0);
380
- transform: translateZ(0);
381
- display: -webkit-box;
382
- display: -ms-flexbox;
383
- display: flex;
384
- -webkit-box-pack: center;
385
- -ms-flex-pack: center;
386
- justify-content: center;
387
- -webkit-box-align: center;
388
- -ms-flex-align: center;
389
- align-items: center;
390
- }
391
-
392
- #wpr-template-editor-loading .elementor-loader-wrapper {
393
- top: auto;
394
- left: auto;
395
- -webkit-transform: none;
396
- -ms-transform: none;
397
- transform: none;
398
- }
399
-
400
- /* Disable Transitions on Responsive Preview */
401
- #elementor-preview-responsive-wrapper {
402
- -webkit-transition: none !important;
403
- -o-transition: none !important;
404
- transition: none !important;
405
- }
406
-
407
-
408
- /*--------------------------------------------------------------
409
- == Magazine Grid Layout
410
- --------------------------------------------------------------*/
411
- .elementor-control-layout_select.elementor-control .elementor-control-field {
412
- -webkit-box-orient: vertical !important;
413
- -webkit-box-direction: normal !important;
414
- -ms-flex-direction: column !important;
415
- flex-direction: column !important;
416
- -webkit-box-align: start;
417
- -ms-flex-align: start;
418
- align-items: flex-start;
419
- }
420
-
421
- .elementor-control-layout_select.elementor-control .elementor-control-input-wrapper {
422
- display: -webkit-box;
423
- display: -ms-flexbox;
424
- display: flex;
425
- width: 100% !important;
426
- margin-top: 10px;
427
- }
428
-
429
- .elementor-control-layout_select.elementor-control .elementor-choices {
430
- -ms-flex-wrap: wrap;
431
- flex-wrap: wrap;
432
- -webkit-box-align: stretch;
433
- -ms-flex-align: stretch;
434
- align-items: stretch;
435
- width: 100% !important;
436
- height: auto;
437
- border: 1px solid #dfd5d5;
438
- }
439
-
440
- .elementor-control-layout_select.elementor-control .elementor-choices label {
441
- width: 33.3%;
442
- height: 50px;
443
- background-size: 75%;
444
- background-position: center center;
445
- background-repeat: no-repeat;
446
- }
447
-
448
- .elementor-control-layout_select input[type="radio"]:checked + label {
449
- border: 2px solid #D30C5C;
450
- border-radius: 0 !important;
451
- background-color: #ffffff;
452
- }
453
-
454
- .elementor-control-layout_select label:nth-child(2) {
455
- 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");
456
- }
457
-
458
- .elementor-control-layout_select label:nth-child(4) {
459
- 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");
460
- }
461
-
462
- .elementor-control-layout_select label:nth-child(6) {
463
- 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");
464
- }
465
-
466
- .elementor-control-layout_select label:nth-child(8) {
467
- 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");
468
- }
469
-
470
- .elementor-control-layout_select label:nth-child(10) {
471
- 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");
472
- }
473
-
474
- .elementor-control-layout_select label:nth-child(12) {
475
- 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");
476
- }
477
-
478
- .elementor-control-layout_select label:nth-child(14) {
479
- 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");
480
- }
481
-
482
- .elementor-control-layout_select label:nth-child(16) {
483
- 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");
484
- }
485
-
486
- .elementor-control-layout_select label:nth-child(18) {
487
- 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");
488
- }
489
-
490
- .elementor-control-layout_select label:nth-child(20) {
491
- 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");
492
- }
493
-
494
- .elementor-control-layout_select label:nth-child(22) {
495
- 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");
496
- }
497
-
498
- .elementor-control-layout_select label:nth-child(24) {
499
- 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");
500
- }
501
-
502
- /*--------------------------------------------------------------
503
- == Widget Preview and Library buttons
504
- --------------------------------------------------------------*/
505
-
506
- .elementor-control-wpr_library_buttons .wpr-forms a:last-child,
507
- .elementor-control-wpr_library_buttons .wpr-phone-call a:last-child,
508
- .elementor-control-wpr_library_buttons .wpr-back-to-top a:last-child,
509
- .elementor-control-wpr_library_buttons .wpr-lottie-animations a:last-child,
510
- .elementor-control-wpr_library_buttons .wpr-feature-list a:last-child,
511
- .elementor-control-wpr_library_buttons .wpr-reading-progress-bar a:last-child,
512
- .elementor-control-wpr_library_buttons .wpr-dual-color-heading a:last-child,
513
- .elementor-control-wpr_library_buttons .wpr-flip-carousel a:last-child,
514
- .elementor-control-wpr_library_buttons .wpr-advanced-accordion a:last-child,
515
- .elementor-control-wpr_library_buttons .wpr-image-accordion a:last-child,
516
- .elementor-control-wpr_library_buttons .wpr-mega-menu a:last-child,
517
- .elementor-control-wpr_library_buttons .wpr-charts a:last-child {
518
- display: none;
519
- }
520
-
521
- .elementor-control-wpr_library_buttons {
522
- height: 60px;
523
- padding: 0;
524
- }
525
-
526
- .elementor-control-wpr_library_buttons .elementor-control-raw-html {
527
- padding: 0 10px 10px 10px;
528
- border-bottom: 1px solid #efefef;
529
- }
530
-
531
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div {
532
- display: -webkit-box;
533
- display: -ms-flexbox;
534
- display: flex;
535
- -webkit-box-pack: center;
536
- -ms-flex-pack: center;
537
- justify-content: center;
538
- }
539
-
540
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a {
541
- -webkit-box-flex: 1;
542
- -ms-flex-positive: 1;
543
- flex-grow: 1;
544
- padding: 10px 15px;
545
- border-radius: 3px;
546
- /*box-shadow: 1px 2px 5px 0 rgba(0,0,0,0.2);*/
547
- white-space: nowrap;
548
- overflow: hidden;
549
- -o-text-overflow: ellipsis;
550
- text-overflow: ellipsis;
551
- text-align: center;
552
- }
553
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child {
554
- background-color: #1CB4E4;
555
- color: #fff;
556
- margin-right: 3px;
557
- }
558
- .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child {
559
- margin-left: 3px;
560
- background-color: #6A65FF;
561
- color: #fff;
562
- }
563
-
564
- .elementor-control-wpr_library_buttons .elementor-control-raw-html > a {
565
- display: block;
566
- margin-top: 10px;
567
- line-height: 20px;
568
- color: #777;
569
- border: none !important;
570
- }
571
-
572
- .elementor-section-title > a {
573
- top: 10px;
574
- right: 20px;
575
- position: absolute;
576
- line-height: 20px;
577
- font-size: 12px;
578
- }
579
-
580
- .elementor-section-title > a:hover {
581
- border-color: transparent;
582
- }
583
-
584
- .elementor-section-title > a .dashicons {
585
- font-size: 16px;
586
- vertical-align: middle;
587
- }
588
-
589
-
590
- /*--------------------------------------------------------------
591
- == Apply Changes Button
592
- --------------------------------------------------------------*/
593
- .editor-wpr-preview-update {
594
- margin: 0;
595
- display: -webkit-box;
596
- display: -ms-flexbox;
597
- display: flex;
598
- -webkit-box-pack: justify;
599
- -ms-flex-pack: justify;
600
- justify-content: space-between;
601
- }
602
-
603
- .editor-wpr-preview-update button {
604
- font-size: 13px;
605
- padding: 5px 10px;
606
- }
607
-
608
-
609
- /*--------------------------------------------------------------
610
- == Free/Pro Options
611
- --------------------------------------------------------------*/
612
- .elementor-control select option[value*=pro-] {
613
- background: #f0f0f0;
614
- }
615
-
616
- .elementor-control[class*="pro_notice"] {
617
- padding: 5px 0 15px 0 !important;
618
- }
619
-
620
- .wpr-pro-notice {
621
- padding: 20px;
622
- border-top: 1px solid #e6e9ec;
623
- border-bottom: 1px solid #e6e9ec;
624
- background-color: #f2fbff;
625
- line-height: 1.4;
626
- text-align: center;
627
- }
628
-
629
- .wpr-pro-notice-video {
630
- display: block;
631
- margin-top: 7px;
632
- line-height: 20px;
633
- border: none !important;
634
- }
635
-
636
- #elementor-controls .elementor-control-slider_section_pro_notice {
637
- margin-top: -16px;
638
- padding-bottom: 0 !important;
639
- }
640
-
641
- .elementor-control-layout_select_pro_notice + div,
642
- .elementor-control-element_align_pro_notice + div {
643
- padding-top: 15px;
644
- }
645
-
646
- .elementor-control-layout_select .elementor-choices label {
647
- position: relative;
648
- }
649
-
650
- .elementor-control-layout_select .elementor-choices label:nth-child(2):after,
651
- .elementor-control-layout_select .elementor-choices label:nth-child(4):after,
652
- .elementor-control-layout_select .elementor-choices label:nth-child(6):after,
653
- .elementor-control-layout_select .elementor-choices label:nth-child(8):after,
654
- .elementor-control-layout_select .elementor-choices label:nth-child(10):after,
655
- .elementor-control-layout_select .elementor-choices label:nth-child(12):after {
656
- content: ' ';
657
- display: block;
658
- width: 100%;
659
- height: 100%;
660
- position: absolute;
661
- top: 0;
662
- left: 0;
663
- background: rgba(0,0,0,0.2);
664
- }
665
-
666
- /* Adjustments */
667
- .elementor-control.elementor-control-element_align_pro_notice,
668
- .elementor-control.elementor-control-search_pro_notice,
669
- .elementor-control.elementor-control-layout_select_pro_notice,
670
- .elementor-control.elementor-control-grid_columns_pro_notice,
671
- .elementor-control.elementor-control-slider_content_type_pro_notice,
672
- .elementor-control.elementor-control-slider_repeater_pro_notice,
673
- .elementor-control.elementor-control-slider_dots_layout_pro_notice,
674
- .elementor-control.elementor-control-testimonial_repeater_pro_notice,
675
- .elementor-control.elementor-control-testimonial_icon_pro_notice,
676
- .elementor-control.elementor-control-menu_layout_pro_notice,
677
- .elementor-control.elementor-control-menu_items_submenu_entrance_pro_notice,
678
- .elementor-control.elementor-control-switcher_label_style_pro_notice,
679
- .elementor-control.elementor-control-countdown_type_pro_notice,
680
- .elementor-control.elementor-control-layout_pro_notice,
681
- .elementor-control.elementor-control-anim_timing_pro_notice,
682
- .elementor-control.elementor-control-tab_content_type_pro_notice,
683
- .elementor-control.elementor-control-tabs_repeater_pro_notice,
684
- .elementor-control.elementor-control-tabs_align_pro_notice,
685
- .elementor-control.elementor-control-front_trigger_pro_notice,
686
- .elementor-control.elementor-control-back_link_type_pro_notice,
687
- .elementor-control.elementor-control-box_anim_timing_pro_notice,
688
- .elementor-control.elementor-control-image_style_pro_notice,
689
- .elementor-control.elementor-control-image_animation_timing_pro_notice,
690
- .elementor-control.elementor-control-label_display_pro_notice,
691
- .elementor-control.elementor-control-post_type_pro_notice,
692
- .elementor-control.elementor-control-type_select_pro_notice,
693
- .elementor-control.elementor-control-icon_style_pro_notice,
694
- .elementor-control.elementor-control-dual_button_pro_notice,
695
- .elementor-control.elementor-control-team_member_pro_notice,
696
- .elementor-control.elementor-control-price_list_pro_notice,
697
- .elementor-control.elementor-control-business_hours_pro_notice,
698
- .elementor-control.elementor-control-sharing_columns_pro_notice,
699
- .elementor-control.elementor-control-popup_trigger_pro_notice,
700
- .elementor-control.elementor-control-popup_show_again_delay_pro_notice,
701
- .elementor-control.elementor-control-group_popup_settings_pro_notice,
702
- .elementor-control.elementor-control-which_particle_pro_notice,
703
- .elementor-control.elementor-control-paralax_repeater_pro_notice,
704
- .elementor-control.elementor-control-opnepage_pro_notice,
705
- .elementor-control.elementor-control-timeline_repeater_pro_notice,
706
- .elementor-control.elementor-control-limit_grid_items_pro_notice,
707
- .elementor-control.elementor-control-post_nav_layout_pro_notice,
708
- .elementor-control.elementor-control-author_name_links_to_pro_notice,
709
- .elementor-control.elementor-control-author_title_links_to_pro_notice,
710
- .elementor-control.elementor-control-comments_form_layout_pro_notice,
711
- .elementor-control.elementor-control-sharing_repeater_pro_notice,
712
- .elementor-control.elementor-control-mini_cart_style_pro_notice,
713
- .elementor-control.elementor-control-tabs_position_pro_notice,
714
- .elementor-control.elementor-control-choose_table_type_pro_notice,
715
- .elementor-control.elementor-control-accordion_repeater_pro_notice,
716
- .elementor-control.elementor-control-acc_repeater_pro_notice,
717
- .elementor-control.elementor-control-data_source_pro_notice,
718
- .elementor-control.elementor-control-charts_repeater_pro_notice,
719
- .elementor-control.elementor-control-mob_menu_display_as_pro_notice {
720
- padding-bottom: 0 !important;
721
- }
722
-
723
- .elementor-control-search_pro_notice .wpr-pro-notice,
724
- .elementor-control-grid_columns_pro_notice .wpr-pro-notice,
725
- .elementor-control-slider_content_type_pro_notice .wpr-pro-notice,
726
- .elementor-control-slider_repeater_pro_notice .wpr-pro-notice,
727
- .elementor-control-slider_dots_layout_pro_notice .wpr-pro-notice,
728
- .elementor-control-testimonial_repeater_pro_notice .wpr-pro-notice,
729
- .elementor-control-testimonial_icon_pro_notice .wpr-pro-notice,
730
- .elementor-control-menu_layout_pro_notice .wpr-pro-notice,
731
- .elementor-control-menu_items_submenu_entrance_pro_notice .wpr-pro-notice,
732
- .elementor-control-switcher_label_style_pro_notice .wpr-pro-notice,
733
- .elementor-control-countdown_type_pro_notice .wpr-pro-notice,
734
- .elementor-control-layout_pro_notice .wpr-pro-notice,
735
- .elementor-control-anim_timing_pro_notice .wpr-pro-notice,
736
- .elementor-control-tab_content_type_pro_notice .wpr-pro-notice,
737
- .elementor-control-tabs_repeater_pro_notice .wpr-pro-notice,
738
- .elementor-control-tabs_align_pro_notice .wpr-pro-notice,
739
- .elementor-control-front_trigger_pro_notice .wpr-pro-notice,
740
- .elementor-control-back_link_type_pro_notice .wpr-pro-notice,
741
- .elementor-control-box_anim_timing_pro_notice .wpr-pro-notice,
742
- .elementor-control-image_style_pro_notice .wpr-pro-notice,
743
- .elementor-control-image_animation_timing_pro_notice .wpr-pro-notice,
744
- .elementor-control-label_display_pro_notice .wpr-pro-notice,
745
- .elementor-control-post_type_pro_notice .wpr-pro-notice,
746
- .elementor-control-type_select_pro_notice .wpr-pro-notice,
747
- .elementor-control-icon_style_pro_notice .wpr-pro-notice,
748
- .elementor-control-dual_button_pro_notice .wpr-pro-notice,
749
- .elementor-control-team_member_pro_notice .wpr-pro-notice,
750
- .elementor-control-price_list_pro_notice .wpr-pro-notice,
751
- .elementor-control-business_hours_pro_notice .wpr-pro-notice,
752
- .elementor-control-sharing_columns_pro_notice .wpr-pro-notice,
753
- .elementor-control-popup_trigger_pro_notice .wpr-pro-notice,
754
- .elementor-control-popup_show_again_delay_pro_notice .wpr-pro-notice,
755
- .elementor-control-group_popup_settings_pro_notice .wpr-pro-notice,
756
- .elementor-control-post_nav_layout_pro_notice .wpr-pro-notice,
757
- .elementor-control-author_name_links_to_pro_notice .wpr-pro-notice,
758
- .elementor-control-author_title_links_to_pro_notice .wpr-pro-notice,
759
- .elementor-control-comments_form_layout_pro_notice .wpr-pro-notice,
760
- .elementor-control-sharing_repeater_pro_notice .wpr-pro-notice,
761
- .elementor-control-mini_cart_style_pro_notice .wpr-pro-notice,
762
- .elementor-control-tabs_position_pro_notice .wpr-pro-notice,
763
- .elementor-control-choose_table_type_pro_notice .wpr-pro-notice,
764
- .elementor-control-accordion_repeater_pro_notice .wpr-pro-notice,
765
- .elementor-control.elementor-control-data_source_pro_notice .wpr-pro-notice,
766
- .elementor-control.elementor-control-mob_menu_display_as_pro_notice .wpr-pro-notice {
767
- border-bottom: none !important;
768
- }
769
-
770
- /* Both */
771
- .elementor-control.elementor-control-pagination_type_pro_notice,
772
- .elementor-control.elementor-control-tooltip_trigger_pro_notice,
773
- .elementor-control.elementor-control-post_info_select_pro_notice {
774
- padding-top: 0 !important;
775
- padding-bottom: 0 !important;
776
- }
777
-
778
- .elementor-control-pagination_type_pro_notice .wpr-pro-notice {
779
- border-top: none !important;
780
- border-bottom: none !important;
781
- }
782
-
783
- .elementor-control-pro_features_section .elementor-section-toggle,
784
- .elementor-control-pro_features_section .elementor-section-title {
785
- color: #f54;
786
- }
787
-
788
- .elementor-control-pro_features_section .elementor-section-title {
789
- line-height: 20px;
790
- }
791
- .elementor-control-pro_features_section .elementor-section-title .dashicons {
792
- line-height: 20px;
793
- font-size: 13px;
794
- }
795
-
796
- .wpr-pro-features-list {
797
- text-align: center;
798
- }
799
-
800
- .wpr-pro-features-list ul {
801
- text-align: left;
802
- }
803
-
804
- .wpr-pro-features-list ul li {
805
- position: relative;
806
- line-height: 22px;
807
- padding-left: 20px;
808
- }
809
-
810
- .wpr-pro-features-list ul li::before {
811
- content: '.';
812
- font-size: 38px;
813
- position: absolute;
814
- top: -11px;
815
- left: 0;
816
- }
817
-
818
- .wpr-pro-features-list ul + a {
819
- display: inline-block;
820
- background-color: #f54;
821
- color: #fff;
822
- margin: 15px 15px 10px 0;
823
- padding: 7px 12px;
824
- border-radius: 3px;
825
- }
826
-
827
- .wpr-pro-features-list ul + a:hover {
828
- color: #fff;
829
- }
830
-
831
- /* Video Tutorial Link */
832
- .elementor-control[class*="video_tutorial"] {
833
- padding-top: 0 !important;
834
- padding-bottom: 5px !important;
835
- }
836
-
837
- .elementor-control.elementor-control-woo_grid_notice_video_tutorial,
838
- .elementor-control-show_last_update_date {
839
- padding-bottom: 15px !important;
840
- }
841
-
842
- .elementor-control.elementor-control-woo_grid_notice_video_tutorial a {
843
- display: inline-block;
844
- margin-top: 5px;
845
- }
846
-
847
- .elementor-control[class*="video_tutorial"] a {
848
- line-height: 16px;
849
- font-size: 12px;
850
- }
851
-
852
- .elementor-control[class*="video_tutorial"] a .dashicons {
853
- font-size: 16px;
854
- }
855
-
856
- /* Pro Control Class */
857
- .elementor-control.wpr-pro-control label i {
858
- color: #aeaeae;
859
- font-size: 14px;
860
- margin-left: 3px;
861
- }
862
-
863
- .elementor-control.wpr-pro-control .elementor-control-content:before {
864
- content: '';
865
- position: absolute;
866
- width: 100%;
867
- height: 100%;
868
- z-index: 9;
869
- background: transparent;
870
- }
871
-
872
- .elementor-control.wpr-pro-control .elementor-control-content:after {
873
- content: "This option is available in the Pro Version.";
874
- visibility: hidden;
875
- opacity: 0;
876
- position: absolute;
877
- top: 30px;
878
- padding: 15px;
879
- z-index: 99;
880
- margin-top: 10px;
881
- font-size: 12px;
882
- color: #93003c;
883
- background-color: #ffffff;
884
- border-radius: 5px;
885
- -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.2);
886
- box-shadow: 1px 1px 5px rgba(0,0,0,0.2);
887
- border: 1px solid #e6e9ec;
888
- -webkit-transition: all 0.2s ease-in;
889
- -o-transition: all 0.2s ease-in;
890
- transition: all 0.2s ease-in;
891
- }
892
-
893
- .elementor-repeater-fields .elementor-control.wpr-pro-control .elementor-control-content:after {
894
- content: "This is available in the Pro Version.";
895
- }
896
-
897
- .elementor-control.wpr-pro-control.no-distance .elementor-control-content:after {
898
- margin: 0;
899
- }
900
-
901
- .elementor-control.wpr-pro-control .elementor-control-content:hover:after {
902
- visibility: visible;
903
- opacity: 1;
904
- }
905
-
906
- /*--------------------------------------------------------------
907
- == Request New Feature
908
- --------------------------------------------------------------*/
909
- .elementor-control-section_request_new_feature .elementor-section-toggle,
910
- .elementor-control-section_request_new_feature .elementor-section-title {
911
- color: #1CB4E4;
912
- line-height: 20px;
913
- }
914
-
915
- .elementor-control-section_request_new_feature .elementor-section-title .dashicons {
916
- line-height: 20px;
917
- font-size: 13px;
918
- }
919
-
920
- .elementor-control-request_new_feature {
921
- line-height: 20px;
922
- }
923
-
924
- .elementor-control-request_new_feature a {
925
- display: block;
926
- padding: 10px 15px;
927
- border-radius: 3px;
928
- margin-top: 15px;
929
- text-align: center;
930
- text-decoration: none;
931
- background-color: #1CB4E4;
932
- color: #fff;
933
- font-size: 13px;
934
- font-weight: 500;
935
- }
936
-
937
- .elementor-control-request_new_feature a:hover {
938
- color: #fff;
939
- background-color: #1589ad;
940
- }
941
-
942
- .elementor-control-request_new_feature a .dashicons {
943
- font-size: 13px;
944
- line-height: 18px;
945
- }
946
-
947
-
948
- /*--------------------------------------------------------------
949
- == Theme Builder Widgets
950
- --------------------------------------------------------------*/
951
- #elementor-panel-categories {
952
- display: -webkit-box;
953
- display: -ms-flexbox;
954
- display: flex;
955
- -webkit-box-orient: vertical;
956
- -webkit-box-direction: normal;
957
- -ms-flex-direction: column;
958
- flex-direction: column;
959
- }
960
-
961
- #elementor-panel-categories > div {
962
- -webkit-box-ordinal-group: 3;
963
- -ms-flex-order: 2;
964
- order: 2;
965
- }
966
-
967
- #elementor-panel-category-wpr-theme-builder-widgets,
968
- #elementor-panel-category-wpr-woocommerce-builder-widgets {
969
- -webkit-box-ordinal-group: 2 !important;
970
- -ms-flex-order: 1 !important;
971
- order: 1 !important;
972
- }
973
-
974
- .elementor-editor-wpr-theme-builder #elementor-panel-footer-saver-preview {
975
- display: none !important;
976
- }
977
-
978
-
979
- /*--------------------------------------------------------------
980
- == Elementor Search Notice
981
- --------------------------------------------------------------*/
982
- .wpr-elementor-search-notice {
983
- background: #fff;
984
- font-size: 13px;
985
- padding: 20px;
986
- line-height: 18px;
987
- margin: 10px;
988
- border-left: 3px solid #71d7f7;
989
- -webkit-box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
990
- box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
991
- }
992
-
993
-
994
- /*--------------------------------------------------------------
995
- == Debug
996
- --------------------------------------------------------------*/
997
- pre.xdebug-var-dump {
998
- position: absolute;
999
- z-index: 999999;
1000
- background: #fff;
1001
- border: 2px solid #000;
1002
- padding: 20px;
1003
- left: 300px;
1004
  }
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-element--promotion .wpr-icon:after {
45
+ top: 22px;
46
+ right: -1px;
47
+ opacity: 0.7;
48
+ }
49
+
50
+ #elementor-element--promotion__dialog .dialog-button {
51
+ text-align: center;
52
+ }
53
+
54
+ .elementor-control-type-section[class*="elementor-control-wpr_section_"]:after {
55
+ content: 'R';
56
+ display: block;
57
+ position: absolute;
58
+ top: 7px;
59
+ right: 7px;
60
+ font-family: Roboto,Arial,Helvetica,Verdana,sans-serif;
61
+ font-size: 10px;
62
+ font-weight: bold;
63
+ color: #ffffff;
64
+ background-image: -o-linear-gradient(#6A4BFF, #7E94FE);
65
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#6A4BFF), to(#7E94FE));
66
+ background-image: linear-gradient(#6A4BFF, #7E94FE);
67
+ -webkit-box-shadow: 0 0 2px 2px #b8c7ff;
68
+ box-shadow: 0 0 2px 2px #b8c7ff;
69
+ width: 19px;
70
+ height: 19px;
71
+ line-height: 19px;
72
+ border-radius: 15px;
73
+ margin: 3px;
74
+ text-align: center;
75
+ }
76
+
77
+ /*--------------------------------------------------------------
78
+ == Adjustments
79
+ --------------------------------------------------------------*/
80
+ .elementor-control-element_select,
81
+ .elementor-control-element_align_hr,
82
+ .elementor-control-element_read_more_text,
83
+ .elementor-control-element_tax_sep,
84
+ .elementor-control-element_sharing_icon_6,
85
+ .elementor-control-element_sharing_trigger_direction,
86
+ .elementor-control-element_sharing_icon_display,
87
+ .elementor-control-element_sharing_tooltip,
88
+ .elementor-control-element_custom_field_wrapper_html,
89
+ .elementor-control-slider_item_bg_size,
90
+ .elementor-control-element_addcart_variable_txt,
91
+ .elementor-control-type,
92
+ .elementor-control-show_last_update_date {
93
+ margin-bottom: 15px;
94
+ }
95
+
96
+ .elementor-control-slider_content_bg_color,
97
+ .elementor-control-slider_nav_border_border,
98
+ .elementor-control-slider_nav_border_radius,
99
+ .elementor-control-scroll_btn_vr,
100
+ .elementor-control-pagination_load_more_text,
101
+ .elementor-control-pagination_finish_text,
102
+ .elementor-control-pagination_prev_next,
103
+ .elementor-control-author_transition_duration,
104
+ .elementor-control-comments_transition_duration,
105
+ .elementor-control-likes_transition_duration,
106
+ .elementor-control-sharing_transition_duration,
107
+ .elementor-control-lightbox_transition_duration,
108
+ .elementor-control-custom_field1_transition_duration,
109
+ .elementor-control-custom_field2_transition_duration,
110
+ .elementor-control-custom_field3_transition_duration,
111
+ .elementor-control-custom_field4_transition_duration,
112
+ .elementor-control-filters_transition_duration,
113
+ .elementor-control-pagination_transition_duration,
114
+ .elementor-control-element_extra_text_pos,
115
+ .elementor-control-element_custom_field_wrapper,
116
+ .elementor-control-overlay_post_link,
117
+ .elementor-control-read_more_animation_height,
118
+ .elementor-control-archive_link_transition_duration,
119
+ .elementor-control-post_info_tax_select,
120
+ .elementor-control-post_info_link_wrap,
121
+ .elementor-control-post_info_modified_time,
122
+ .elementor-control-tabs_sharing_custom_colors,
123
+ .elementor-control-post_info_show_avatar,
124
+ .elementor-control-post_info_cf,
125
+ .elementor-control-pricing_items .elementor-control-price,
126
+ .elementor-control-pricing_items .elementor-control-feature_text,
127
+ .elementor-control-pricing_items .elementor-control-btn_text,
128
+ .elementor-control-divider_style,
129
+ .elementor-control-filters_pointer,
130
+ .elementor-control-title_transition_duration,
131
+ .elementor-control-tax1_transition_duration,
132
+ .elementor-control-tax2_transition_duration,
133
+ .elementor-control-filters_transition_duration,
134
+ .elementor-control-pagination_older_text,
135
+ .elementor-control-tooltip_position,
136
+ .elementor-control-post_info_comments_text_1,
137
+ .elementor-control-element_letter_count {
138
+ padding-top: 15px !important;
139
+ }
140
+
141
+ .elementor-control-post_info_custom_field_video_tutorial {
142
+ margin-top: 15px;
143
+ }
144
+
145
+ .elementor-control-title_pointer_animation + .elementor-control-title_transition_duration,
146
+ .elementor-control-tax1_pointer_animation + .elementor-control-tax1_transition_duration,
147
+ .elementor-control-tax2_pointer_animation + .elementor-control-tax2_transition_duration,
148
+ .elementor-control-filters_pointer_animation + .elementor-control-filters_transition_duration {
149
+ padding-top: 0 !important;
150
+ }
151
+
152
+ .elementor-control-pagination_load_more_text {
153
+ padding-bottom: 0 !important;
154
+ }
155
+
156
+ .elementor-control-filters_transition_duration,
157
+ .elementor-control-show_last_update_date {
158
+ padding-top: 0 !important;
159
+ }
160
+
161
+ .elementor-control-animation_divider,
162
+ .elementor-control-overlay_divider,
163
+ .elementor-control-slider_item_btn_1_divider,
164
+ .elementor-control-slider_item_btn_2_divider,
165
+ .elementor-control-slider_btn_typography_1_divider,
166
+ .elementor-control-slider_btn_box_shadow_1_divider,
167
+ .elementor-control-slider_btn_typography_2_divider,
168
+ .elementor-control-slider_btn_box_shadow_2_divider,
169
+ .elementor-control-testimonial_title_divider,
170
+ .elementor-control-social_media_divider,
171
+ .elementor-control-social_divider_1,
172
+ .elementor-control-social_divider_2,
173
+ .elementor-control-social_divider_3,
174
+ .elementor-control-social_divider_4,
175
+ .elementor-control-social_divider_5,
176
+ .elementor-control-custom_field_wrapper_html_divider1,
177
+ .elementor-control-custom_field_wrapper_html_divider2,
178
+ .elementor-control-lightbox_shadow_divider {
179
+ padding: 0 !important;
180
+ }
181
+
182
+ .elementor-control-custom_field_wrapper_html_divider1 hr,
183
+ .elementor-control-lightbox_shadow_divider hr {
184
+ height: 1px !important;
185
+ }
186
+
187
+ .elementor-control-element_show_on {
188
+ padding-top: 15px !important;
189
+ border-top: 1px solid #d5dadf;
190
+ }
191
+
192
+ [class*="wpr__section_"] ~ .elementor-control-type-number .elementor-control-input-wrapper,
193
+ [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-number .elementor-control-input-wrapper {
194
+ max-width: 30% !important;
195
+ margin-left: auto !important;
196
+ }
197
+
198
+ [class*="wpr__section_"] ~ .elementor-control-type-select .elementor-control-input-wrapper,
199
+ [class*="wpr__section_"] ~ .elementor-control-type-repeater .elementor-control-type-select .elementor-control-input-wrapper {
200
+ width: auto !important;
201
+ min-width: 30% !important;
202
+ margin-left: auto !important;
203
+ }
204
+
205
+ .elementor-control-submit_preview_changes .elementor-control-input-wrapper {
206
+ text-align: center !important;
207
+ }
208
+
209
+ .elementor-control-query_manual_related,
210
+ .elementor-control-query_manual_current {
211
+ display: none !important;
212
+ }
213
+
214
+ /* Fix Select Inputs */
215
+ .elementor-control-button_hover_animation .elementor-control-input-wrapper,
216
+ .elementor-control-front_btn_animation .elementor-control-input-wrapper,
217
+ .elementor-control-back_btn_animation .elementor-control-input-wrapper {
218
+ width: 135px !important;
219
+ }
220
+
221
+ .elementor-control-type-repeater .elementor-control-content > label {
222
+ display: none !important;
223
+ }
224
+
225
+
226
+ /*--------------------------------------------------------------
227
+ == Notification
228
+ --------------------------------------------------------------*/
229
+ #wpr-template-settings-notification {
230
+ position: fixed;
231
+ left: 40px;
232
+ bottom: 5px;
233
+ z-index: 9999;
234
+ padding: 13px 25px;
235
+ background: #fff;
236
+ color: #222;
237
+ -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
238
+ box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
239
+ border-radius: 3px;
240
+ }
241
+
242
+ #wpr-template-settings-notification:before {
243
+ content: "";
244
+ position: absolute;
245
+ left: -6px;
246
+ bottom: 10px;
247
+ width: 0;
248
+ height: 0;
249
+ border-top: 6px solid transparent;
250
+ border-bottom: 6px solid transparent;
251
+ border-right-style: solid;
252
+ border-right-width: 6px;
253
+ border-right-color: #fff;
254
+ }
255
+
256
+ #wpr-template-settings-notification h4 {
257
+ margin-bottom: 10px;
258
+ }
259
+
260
+ #wpr-template-settings-notification h4 span {
261
+ font-size: 14px;
262
+ vertical-align: super;
263
+ color: #5f5f5f;
264
+ }
265
+
266
+ #wpr-template-settings-notification h4 i {
267
+ margin-right: 10px;
268
+ color: #3db050;
269
+ font-size: 24px;
270
+ }
271
+
272
+ #wpr-template-settings-notification p {
273
+ color: #666;
274
+ font-size: 12px;
275
+ line-height: 1.5;
276
+ }
277
+
278
+ #wpr-template-settings-notification > i {
279
+ position: absolute;
280
+ top: 7px;
281
+ right: 7px;
282
+ cursor: pointer;
283
+ color: #999;
284
+ }
285
+
286
+ .elementor-control-cf7_notice,
287
+ .elementor-control-wpforms_notice,
288
+ .elementor-control-ninja_forms_notice,
289
+ .elementor-control-caldera_notice {
290
+ color: red;
291
+ }
292
+
293
+ /* Help Button - select with referrals - [href^="https://royal-elementor-addons.com/contact/"] */
294
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] {
295
+ display: inline-block;
296
+ padding: 12px 35px;
297
+ font-size: 13px;
298
+ font-weight: normal;
299
+ color: #fff;
300
+ background: #6A65FF;
301
+ border-radius: 3px;
302
+ -webkit-box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
303
+ box-shadow: 0 2px 7px 0 rgba(0,0,0,0.3);
304
+ letter-spacing: 0.3px;
305
+ -webkit-transition: all 0.2s ease-in;
306
+ -o-transition: all 0.2s ease-in;
307
+ transition: all 0.2s ease-in;
308
+ }
309
+
310
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover {
311
+ color: #fff;
312
+ background: #6A4BFF;
313
+ }
314
+
315
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"] i {
316
+ color: #fff;
317
+ font-size: 14px;
318
+ vertical-align: top;
319
+ }
320
+
321
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i {
322
+ color: #fff;
323
+ }
324
+
325
+ #elementor-panel__editor__help__link[href^="https://wordpress.org/support/plugin/royal-elementor-addons/"]:hover i:before {
326
+ content: '\e942' !important;
327
+ }
328
+
329
+ .elementor-control-posts_slider_notice .elementor-control-raw-html {
330
+ font-style: normal !important;
331
+ }
332
+
333
+ .elementor-control-product_notice_widget_info .elementor-control-raw-html {
334
+ color: red;
335
+ }
336
+
337
+
338
+ /*--------------------------------------------------------------
339
+ == Modal Popup Editor
340
+ --------------------------------------------------------------*/
341
+ .elementor-editor-wpr-popups .elementor-control-document_settings,
342
+ .elementor-editor-wpr-popups .elementor-control-post_title,
343
+ .elementor-editor-wpr-popups .elementor-control-post_status {
344
+ display: none !important;
345
+ }
346
+
347
+
348
+ /*--------------------------------------------------------------
349
+ == Elementor Editor Popup
350
+ --------------------------------------------------------------*/
351
+ #wpr-template-editor-popup .dialog-widget-content {
352
+ width: 90vw;
353
+ height: 90vh;
354
+ }
355
+
356
+ #wpr-template-editor-popup .dialog-message {
357
+ padding: 0;
358
+ width: 100%;
359
+ height: 100%;
360
+ }
361
+
362
+ #wpr-template-editor-popup .dialog-close-button {
363
+ font-size: 24px;
364
+ color: #222;
365
+ }
366
+
367
+ #wpr-template-editor-popup .dialog-header {
368
+ display: none;
369
+ }
370
+
371
+ #wpr-template-editor-loading {
372
+ position: absolute;
373
+ top: 0;
374
+ left: 0;
375
+ width: 100%;
376
+ height: 100%;
377
+ background: #f1f3f5;
378
+ z-index: 9999;
379
+ -webkit-transform: translateZ(0);
380
+ transform: translateZ(0);
381
+ display: -webkit-box;
382
+ display: -ms-flexbox;
383
+ display: flex;
384
+ -webkit-box-pack: center;
385
+ -ms-flex-pack: center;
386
+ justify-content: center;
387
+ -webkit-box-align: center;
388
+ -ms-flex-align: center;
389
+ align-items: center;
390
+ }
391
+
392
+ #wpr-template-editor-loading .elementor-loader-wrapper {
393
+ top: auto;
394
+ left: auto;
395
+ -webkit-transform: none;
396
+ -ms-transform: none;
397
+ transform: none;
398
+ }
399
+
400
+ /* Disable Transitions on Responsive Preview */
401
+ #elementor-preview-responsive-wrapper {
402
+ -webkit-transition: none !important;
403
+ -o-transition: none !important;
404
+ transition: none !important;
405
+ }
406
+
407
+
408
+ /*--------------------------------------------------------------
409
+ == Magazine Grid Layout
410
+ --------------------------------------------------------------*/
411
+ .elementor-control-layout_select.elementor-control .elementor-control-field {
412
+ -webkit-box-orient: vertical !important;
413
+ -webkit-box-direction: normal !important;
414
+ -ms-flex-direction: column !important;
415
+ flex-direction: column !important;
416
+ -webkit-box-align: start;
417
+ -ms-flex-align: start;
418
+ align-items: flex-start;
419
+ }
420
+
421
+ .elementor-control-layout_select.elementor-control .elementor-control-input-wrapper {
422
+ display: -webkit-box;
423
+ display: -ms-flexbox;
424
+ display: flex;
425
+ width: 100% !important;
426
+ margin-top: 10px;
427
+ }
428
+
429
+ .elementor-control-layout_select.elementor-control .elementor-choices {
430
+ -ms-flex-wrap: wrap;
431
+ flex-wrap: wrap;
432
+ -webkit-box-align: stretch;
433
+ -ms-flex-align: stretch;
434
+ align-items: stretch;
435
+ width: 100% !important;
436
+ height: auto;
437
+ border: 1px solid #dfd5d5;
438
+ }
439
+
440
+ .elementor-control-layout_select.elementor-control .elementor-choices label {
441
+ width: 33.3%;
442
+ height: 50px;
443
+ background-size: 75%;
444
+ background-position: center center;
445
+ background-repeat: no-repeat;
446
+ }
447
+
448
+ .elementor-control-layout_select input[type="radio"]:checked + label {
449
+ border: 2px solid #D30C5C;
450
+ border-radius: 0 !important;
451
+ background-color: #ffffff;
452
+ }
453
+
454
+ .elementor-control-layout_select label:nth-child(2) {
455
+ 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");
456
+ }
457
+
458
+ .elementor-control-layout_select label:nth-child(4) {
459
+ 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");
460
+ }
461
+
462
+ .elementor-control-layout_select label:nth-child(6) {
463
+ 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");
464
+ }
465
+
466
+ .elementor-control-layout_select label:nth-child(8) {
467
+ 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");
468
+ }
469
+
470
+ .elementor-control-layout_select label:nth-child(10) {
471
+ 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");
472
+ }
473
+
474
+ .elementor-control-layout_select label:nth-child(12) {
475
+ 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");
476
+ }
477
+
478
+ .elementor-control-layout_select label:nth-child(14) {
479
+ 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");
480
+ }
481
+
482
+ .elementor-control-layout_select label:nth-child(16) {
483
+ 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");
484
+ }
485
+
486
+ .elementor-control-layout_select label:nth-child(18) {
487
+ 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");
488
+ }
489
+
490
+ .elementor-control-layout_select label:nth-child(20) {
491
+ 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");
492
+ }
493
+
494
+ .elementor-control-layout_select label:nth-child(22) {
495
+ 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");
496
+ }
497
+
498
+ .elementor-control-layout_select label:nth-child(24) {
499
+ 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");
500
+ }
501
+
502
+ /*--------------------------------------------------------------
503
+ == Widget Preview and Library buttons
504
+ --------------------------------------------------------------*/
505
+
506
+ .elementor-control-wpr_library_buttons .wpr-forms a:last-child,
507
+ .elementor-control-wpr_library_buttons .wpr-phone-call a:last-child,
508
+ .elementor-control-wpr_library_buttons .wpr-back-to-top a:last-child,
509
+ .elementor-control-wpr_library_buttons .wpr-lottie-animations a:last-child,
510
+ .elementor-control-wpr_library_buttons .wpr-feature-list a:last-child,
511
+ .elementor-control-wpr_library_buttons .wpr-reading-progress-bar a:last-child,
512
+ .elementor-control-wpr_library_buttons .wpr-dual-color-heading a:last-child,
513
+ .elementor-control-wpr_library_buttons .wpr-flip-carousel a:last-child,
514
+ .elementor-control-wpr_library_buttons .wpr-advanced-accordion a:last-child,
515
+ .elementor-control-wpr_library_buttons .wpr-image-accordion a:last-child,
516
+ .elementor-control-wpr_library_buttons .wpr-mega-menu a:last-child,
517
+ .elementor-control-wpr_library_buttons .wpr-charts a:last-child {
518
+ display: none;
519
+ }
520
+
521
+ .elementor-control-wpr_library_buttons {
522
+ height: 60px;
523
+ padding: 0;
524
+ }
525
+
526
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html {
527
+ padding: 0 10px 10px 10px;
528
+ border-bottom: 1px solid #efefef;
529
+ }
530
+
531
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div {
532
+ display: -webkit-box;
533
+ display: -ms-flexbox;
534
+ display: flex;
535
+ -webkit-box-pack: center;
536
+ -ms-flex-pack: center;
537
+ justify-content: center;
538
+ }
539
+
540
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a {
541
+ -webkit-box-flex: 1;
542
+ -ms-flex-positive: 1;
543
+ flex-grow: 1;
544
+ padding: 10px 15px;
545
+ border-radius: 3px;
546
+ /*box-shadow: 1px 2px 5px 0 rgba(0,0,0,0.2);*/
547
+ white-space: nowrap;
548
+ overflow: hidden;
549
+ -o-text-overflow: ellipsis;
550
+ text-overflow: ellipsis;
551
+ text-align: center;
552
+ }
553
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child {
554
+ background-color: #1CB4E4;
555
+ color: #fff;
556
+ margin-right: 3px;
557
+ }
558
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child {
559
+ margin-left: 3px;
560
+ background-color: #6A65FF;
561
+ color: #fff;
562
+ }
563
+
564
+ .elementor-control-wpr_library_buttons .elementor-control-raw-html > a {
565
+ display: block;
566
+ margin-top: 10px;
567
+ line-height: 20px;
568
+ color: #777;
569
+ border: none !important;
570
+ }
571
+
572
+ .elementor-section-title > a {
573
+ top: 10px;
574
+ right: 20px;
575
+ position: absolute;
576
+ line-height: 20px;
577
+ font-size: 12px;
578
+ }
579
+
580
+ .elementor-section-title > a:hover {
581
+ border-color: transparent;
582
+ }
583
+
584
+ .elementor-section-title > a .dashicons {
585
+ font-size: 16px;
586
+ vertical-align: middle;
587
+ }
588
+
589
+
590
+ /*--------------------------------------------------------------
591
+ == Apply Changes Button
592
+ --------------------------------------------------------------*/
593
+ .editor-wpr-preview-update {
594
+ margin: 0;
595
+ display: -webkit-box;
596
+ display: -ms-flexbox;
597
+ display: flex;
598
+ -webkit-box-pack: justify;
599
+ -ms-flex-pack: justify;
600
+ justify-content: space-between;
601
+ }
602
+
603
+ .editor-wpr-preview-update button {
604
+ font-size: 13px;
605
+ padding: 5px 10px;
606
+ }
607
+
608
+
609
+ /*--------------------------------------------------------------
610
+ == Free/Pro Options
611
+ --------------------------------------------------------------*/
612
+ .elementor-control select option[value*=pro-] {
613
+ background: #f0f0f0;
614
+ }
615
+
616
+ .elementor-control[class*="pro_notice"] {
617
+ padding: 5px 0 15px 0 !important;
618
+ }
619
+
620
+ .wpr-pro-notice {
621
+ padding: 20px;
622
+ border-top: 1px solid #e6e9ec;
623
+ border-bottom: 1px solid #e6e9ec;
624
+ background-color: #f2fbff;
625
+ line-height: 1.4;
626
+ text-align: center;
627
+ }
628
+
629
+ .wpr-pro-notice-video {
630
+ display: block;
631
+ margin-top: 7px;
632
+ line-height: 20px;
633
+ border: none !important;
634
+ }
635
+
636
+ #elementor-controls .elementor-control-slider_section_pro_notice {
637
+ margin-top: -16px;
638
+ padding-bottom: 0 !important;
639
+ }
640
+
641
+ .elementor-control-layout_select_pro_notice + div,
642
+ .elementor-control-element_align_pro_notice + div {
643
+ padding-top: 15px;
644
+ }
645
+
646
+ .elementor-control-layout_select .elementor-choices label {
647
+ position: relative;
648
+ }
649
+
650
+ .elementor-control-layout_select .elementor-choices label:nth-child(2):after,
651
+ .elementor-control-layout_select .elementor-choices label:nth-child(4):after,
652
+ .elementor-control-layout_select .elementor-choices label:nth-child(6):after,
653
+ .elementor-control-layout_select .elementor-choices label:nth-child(8):after,
654
+ .elementor-control-layout_select .elementor-choices label:nth-child(10):after,
655
+ .elementor-control-layout_select .elementor-choices label:nth-child(12):after {
656
+ content: ' ';
657
+ display: block;
658
+ width: 100%;
659
+ height: 100%;
660
+ position: absolute;
661
+ top: 0;
662
+ left: 0;
663
+ background: rgba(0,0,0,0.2);
664
+ }
665
+
666
+ /* Adjustments */
667
+ .elementor-control.elementor-control-element_align_pro_notice,
668
+ .elementor-control.elementor-control-search_pro_notice,
669
+ .elementor-control.elementor-control-layout_select_pro_notice,
670
+ .elementor-control.elementor-control-grid_columns_pro_notice,
671
+ .elementor-control.elementor-control-slider_content_type_pro_notice,
672
+ .elementor-control.elementor-control-slider_repeater_pro_notice,
673
+ .elementor-control.elementor-control-slider_dots_layout_pro_notice,
674
+ .elementor-control.elementor-control-testimonial_repeater_pro_notice,
675
+ .elementor-control.elementor-control-testimonial_icon_pro_notice,
676
+ .elementor-control.elementor-control-menu_layout_pro_notice,
677
+ .elementor-control.elementor-control-menu_items_submenu_entrance_pro_notice,
678
+ .elementor-control.elementor-control-switcher_label_style_pro_notice,
679
+ .elementor-control.elementor-control-countdown_type_pro_notice,
680
+ .elementor-control.elementor-control-layout_pro_notice,
681
+ .elementor-control.elementor-control-anim_timing_pro_notice,
682
+ .elementor-control.elementor-control-tab_content_type_pro_notice,
683
+ .elementor-control.elementor-control-tabs_repeater_pro_notice,
684
+ .elementor-control.elementor-control-tabs_align_pro_notice,
685
+ .elementor-control.elementor-control-front_trigger_pro_notice,
686
+ .elementor-control.elementor-control-back_link_type_pro_notice,
687
+ .elementor-control.elementor-control-box_anim_timing_pro_notice,
688
+ .elementor-control.elementor-control-image_style_pro_notice,
689
+ .elementor-control.elementor-control-image_animation_timing_pro_notice,
690
+ .elementor-control.elementor-control-label_display_pro_notice,
691
+ .elementor-control.elementor-control-post_type_pro_notice,
692
+ .elementor-control.elementor-control-type_select_pro_notice,
693
+ .elementor-control.elementor-control-icon_style_pro_notice,
694
+ .elementor-control.elementor-control-dual_button_pro_notice,
695
+ .elementor-control.elementor-control-team_member_pro_notice,
696
+ .elementor-control.elementor-control-price_list_pro_notice,
697
+ .elementor-control.elementor-control-business_hours_pro_notice,
698
+ .elementor-control.elementor-control-sharing_columns_pro_notice,
699
+ .elementor-control.elementor-control-popup_trigger_pro_notice,
700
+ .elementor-control.elementor-control-popup_show_again_delay_pro_notice,
701
+ .elementor-control.elementor-control-group_popup_settings_pro_notice,
702
+ .elementor-control.elementor-control-which_particle_pro_notice,
703
+ .elementor-control.elementor-control-paralax_repeater_pro_notice,
704
+ .elementor-control.elementor-control-opnepage_pro_notice,
705
+ .elementor-control.elementor-control-timeline_repeater_pro_notice,
706
+ .elementor-control.elementor-control-limit_grid_items_pro_notice,
707
+ .elementor-control.elementor-control-post_nav_layout_pro_notice,
708
+ .elementor-control.elementor-control-author_name_links_to_pro_notice,
709
+ .elementor-control.elementor-control-author_title_links_to_pro_notice,
710
+ .elementor-control.elementor-control-comments_form_layout_pro_notice,
711
+ .elementor-control.elementor-control-sharing_repeater_pro_notice,
712
+ .elementor-control.elementor-control-mini_cart_style_pro_notice,
713
+ .elementor-control.elementor-control-tabs_position_pro_notice,
714
+ .elementor-control.elementor-control-choose_table_type_pro_notice,
715
+ .elementor-control.elementor-control-accordion_repeater_pro_notice,
716
+ .elementor-control.elementor-control-acc_repeater_pro_notice,
717
+ .elementor-control.elementor-control-data_source_pro_notice,
718
+ .elementor-control.elementor-control-charts_repeater_pro_notice,
719
+ .elementor-control.elementor-control-mob_menu_display_as_pro_notice {
720
+ padding-bottom: 0 !important;
721
+ }
722
+
723
+ .elementor-control-search_pro_notice .wpr-pro-notice,
724
+ .elementor-control-grid_columns_pro_notice .wpr-pro-notice,
725
+ .elementor-control-slider_content_type_pro_notice .wpr-pro-notice,
726
+ .elementor-control-slider_repeater_pro_notice .wpr-pro-notice,
727
+ .elementor-control-slider_dots_layout_pro_notice .wpr-pro-notice,
728
+ .elementor-control-testimonial_repeater_pro_notice .wpr-pro-notice,
729
+ .elementor-control-testimonial_icon_pro_notice .wpr-pro-notice,
730
+ .elementor-control-menu_layout_pro_notice .wpr-pro-notice,
731
+ .elementor-control-menu_items_submenu_entrance_pro_notice .wpr-pro-notice,
732
+ .elementor-control-switcher_label_style_pro_notice .wpr-pro-notice,
733
+ .elementor-control-countdown_type_pro_notice .wpr-pro-notice,
734
+ .elementor-control-layout_pro_notice .wpr-pro-notice,
735
+ .elementor-control-anim_timing_pro_notice .wpr-pro-notice,
736
+ .elementor-control-tab_content_type_pro_notice .wpr-pro-notice,
737
+ .elementor-control-tabs_repeater_pro_notice .wpr-pro-notice,
738
+ .elementor-control-tabs_align_pro_notice .wpr-pro-notice,
739
+ .elementor-control-front_trigger_pro_notice .wpr-pro-notice,
740
+ .elementor-control-back_link_type_pro_notice .wpr-pro-notice,
741
+ .elementor-control-box_anim_timing_pro_notice .wpr-pro-notice,
742
+ .elementor-control-image_style_pro_notice .wpr-pro-notice,
743
+ .elementor-control-image_animation_timing_pro_notice .wpr-pro-notice,
744
+ .elementor-control-label_display_pro_notice .wpr-pro-notice,
745
+ .elementor-control-post_type_pro_notice .wpr-pro-notice,
746
+ .elementor-control-type_select_pro_notice .wpr-pro-notice,
747
+ .elementor-control-icon_style_pro_notice .wpr-pro-notice,
748
+ .elementor-control-dual_button_pro_notice .wpr-pro-notice,
749
+ .elementor-control-team_member_pro_notice .wpr-pro-notice,
750
+ .elementor-control-price_list_pro_notice .wpr-pro-notice,
751
+ .elementor-control-business_hours_pro_notice .wpr-pro-notice,
752
+ .elementor-control-sharing_columns_pro_notice .wpr-pro-notice,
753
+ .elementor-control-popup_trigger_pro_notice .wpr-pro-notice,
754
+ .elementor-control-popup_show_again_delay_pro_notice .wpr-pro-notice,
755
+ .elementor-control-group_popup_settings_pro_notice .wpr-pro-notice,
756
+ .elementor-control-post_nav_layout_pro_notice .wpr-pro-notice,
757
+ .elementor-control-author_name_links_to_pro_notice .wpr-pro-notice,
758
+ .elementor-control-author_title_links_to_pro_notice .wpr-pro-notice,
759
+ .elementor-control-comments_form_layout_pro_notice .wpr-pro-notice,
760
+ .elementor-control-sharing_repeater_pro_notice .wpr-pro-notice,
761
+ .elementor-control-mini_cart_style_pro_notice .wpr-pro-notice,
762
+ .elementor-control-tabs_position_pro_notice .wpr-pro-notice,
763
+ .elementor-control-choose_table_type_pro_notice .wpr-pro-notice,
764
+ .elementor-control-accordion_repeater_pro_notice .wpr-pro-notice,
765
+ .elementor-control.elementor-control-data_source_pro_notice .wpr-pro-notice,
766
+ .elementor-control.elementor-control-mob_menu_display_as_pro_notice .wpr-pro-notice {
767
+ border-bottom: none !important;
768
+ }
769
+
770
+ /* Both */
771
+ .elementor-control.elementor-control-pagination_type_pro_notice,
772
+ .elementor-control.elementor-control-tooltip_trigger_pro_notice,
773
+ .elementor-control.elementor-control-post_info_select_pro_notice {
774
+ padding-top: 0 !important;
775
+ padding-bottom: 0 !important;
776
+ }
777
+
778
+ .elementor-control-pagination_type_pro_notice .wpr-pro-notice {
779
+ border-top: none !important;
780
+ border-bottom: none !important;
781
+ }
782
+
783
+ .elementor-control-pro_features_section .elementor-section-toggle,
784
+ .elementor-control-pro_features_section .elementor-section-title {
785
+ color: #f54;
786
+ }
787
+
788
+ .elementor-control-pro_features_section .elementor-section-title {
789
+ line-height: 20px;
790
+ }
791
+ .elementor-control-pro_features_section .elementor-section-title .dashicons {
792
+ line-height: 20px;
793
+ font-size: 13px;
794
+ }
795
+
796
+ .wpr-pro-features-list {
797
+ text-align: center;
798
+ }
799
+
800
+ .wpr-pro-features-list ul {
801
+ text-align: left;
802
+ }
803
+
804
+ .wpr-pro-features-list ul li {
805
+ position: relative;
806
+ line-height: 22px;
807
+ padding-left: 20px;
808
+ }
809
+
810
+ .wpr-pro-features-list ul li::before {
811
+ content: '.';
812
+ font-size: 38px;
813
+ position: absolute;
814
+ top: -11px;
815
+ left: 0;
816
+ }
817
+
818
+ .wpr-pro-features-list ul + a {
819
+ display: inline-block;
820
+ background-color: #f54;
821
+ color: #fff;
822
+ margin: 15px 15px 10px 0;
823
+ padding: 7px 12px;
824
+ border-radius: 3px;
825
+ }
826
+
827
+ .wpr-pro-features-list ul + a:hover {
828
+ color: #fff;
829
+ }
830
+
831
+ /* Video Tutorial Link */
832
+ .elementor-control[class*="video_tutorial"] {
833
+ padding-top: 0 !important;
834
+ padding-bottom: 5px !important;
835
+ }
836
+
837
+ .elementor-control.elementor-control-woo_grid_notice_video_tutorial,
838
+ .elementor-control-show_last_update_date {
839
+ padding-bottom: 15px !important;
840
+ }
841
+
842
+ .elementor-control.elementor-control-woo_grid_notice_video_tutorial a {
843
+ display: inline-block;
844
+ margin-top: 5px;
845
+ }
846
+
847
+ .elementor-control[class*="video_tutorial"] a {
848
+ line-height: 16px;
849
+ font-size: 12px;
850
+ }
851
+
852
+ .elementor-control[class*="video_tutorial"] a .dashicons {
853
+ font-size: 16px;
854
+ }
855
+
856
+ /* Pro Control Class */
857
+ .elementor-control.wpr-pro-control label i {
858
+ color: #aeaeae;
859
+ font-size: 14px;
860
+ margin-left: 3px;
861
+ }
862
+
863
+ .elementor-control.wpr-pro-control .elementor-control-content:before {
864
+ content: '';
865
+ position: absolute;
866
+ width: 100%;
867
+ height: 100%;
868
+ z-index: 9;
869
+ background: transparent;
870
+ }
871
+
872
+ .elementor-control.wpr-pro-control .elementor-control-content:after {
873
+ content: "This option is available in the Pro Version.";
874
+ visibility: hidden;
875
+ opacity: 0;
876
+ position: absolute;
877
+ top: 30px;
878
+ padding: 15px;
879
+ z-index: 99;
880
+ margin-top: 10px;
881
+ font-size: 12px;
882
+ color: #93003c;
883
+ background-color: #ffffff;
884
+ border-radius: 5px;
885
+ -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.2);
886
+ box-shadow: 1px 1px 5px rgba(0,0,0,0.2);
887
+ border: 1px solid #e6e9ec;
888
+ -webkit-transition: all 0.2s ease-in;
889
+ -o-transition: all 0.2s ease-in;
890
+ transition: all 0.2s ease-in;
891
+ }
892
+
893
+ .elementor-repeater-fields .elementor-control.wpr-pro-control .elementor-control-content:after {
894
+ content: "This is available in the Pro Version.";
895
+ }
896
+
897
+ .elementor-control.wpr-pro-control.no-distance .elementor-control-content:after {
898
+ margin: 0;
899
+ }
900
+
901
+ .elementor-control.wpr-pro-control .elementor-control-content:hover:after {
902
+ visibility: visible;
903
+ opacity: 1;
904
+ }
905
+
906
+ /*--------------------------------------------------------------
907
+ == Request New Feature
908
+ --------------------------------------------------------------*/
909
+ .elementor-control-section_request_new_feature .elementor-section-toggle,
910
+ .elementor-control-section_request_new_feature .elementor-section-title {
911
+ color: #1CB4E4;
912
+ line-height: 20px;
913
+ }
914
+
915
+ .elementor-control-section_request_new_feature .elementor-section-title .dashicons {
916
+ line-height: 20px;
917
+ font-size: 13px;
918
+ }
919
+
920
+ .elementor-control-request_new_feature {
921
+ line-height: 20px;
922
+ }
923
+
924
+ .elementor-control-request_new_feature a {
925
+ display: block;
926
+ padding: 10px 15px;
927
+ border-radius: 3px;
928
+ margin-top: 15px;
929
+ text-align: center;
930
+ text-decoration: none;
931
+ background-color: #1CB4E4;
932
+ color: #fff;
933
+ font-size: 13px;
934
+ font-weight: 500;
935
+ }
936
+
937
+ .elementor-control-request_new_feature a:hover {
938
+ color: #fff;
939
+ background-color: #1589ad;
940
+ }
941
+
942
+ .elementor-control-request_new_feature a .dashicons {
943
+ font-size: 13px;
944
+ line-height: 18px;
945
+ }
946
+
947
+
948
+ /*--------------------------------------------------------------
949
+ == Theme Builder Widgets
950
+ --------------------------------------------------------------*/
951
+ #elementor-panel-categories {
952
+ display: -webkit-box;
953
+ display: -ms-flexbox;
954
+ display: flex;
955
+ -webkit-box-orient: vertical;
956
+ -webkit-box-direction: normal;
957
+ -ms-flex-direction: column;
958
+ flex-direction: column;
959
+ }
960
+
961
+ #elementor-panel-categories > div {
962
+ -webkit-box-ordinal-group: 3;
963
+ -ms-flex-order: 2;
964
+ order: 2;
965
+ }
966
+
967
+ #elementor-panel-category-wpr-theme-builder-widgets,
968
+ #elementor-panel-category-wpr-woocommerce-builder-widgets {
969
+ -webkit-box-ordinal-group: 2 !important;
970
+ -ms-flex-order: 1 !important;
971
+ order: 1 !important;
972
+ }
973
+
974
+ .elementor-editor-wpr-theme-builder #elementor-panel-footer-saver-preview {
975
+ display: none !important;
976
+ }
977
+
978
+
979
+ /*--------------------------------------------------------------
980
+ == Elementor Search Notice
981
+ --------------------------------------------------------------*/
982
+ .wpr-elementor-search-notice {
983
+ background: #fff;
984
+ font-size: 13px;
985
+ padding: 20px;
986
+ line-height: 18px;
987
+ margin: 10px;
988
+ border-left: 3px solid #71d7f7;
989
+ -webkit-box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
990
+ box-shadow: 0 1px 4px 0 rgb(0 0 0 / 7%);
991
+ }
992
+
993
+
994
+ /*--------------------------------------------------------------
995
+ == Debug
996
+ --------------------------------------------------------------*/
997
+ pre.xdebug-var-dump {
998
+ position: absolute;
999
+ z-index: 999999;
1000
+ background: #fff;
1001
+ border: 2px solid #000;
1002
+ padding: 20px;
1003
+ left: 300px;
1004
  }
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/text-animations.css CHANGED
@@ -1,843 +1,843 @@
1
- /*--------------------------------------------------------------
2
- == General
3
- --------------------------------------------------------------*/
4
-
5
- .wpr-anim-text-inner {
6
- display: inline-block;
7
- position: relative;
8
- text-align: left;
9
- }
10
-
11
- .wpr-anim-text-inner b {
12
- display: inline-block;
13
- position: absolute;
14
- white-space: nowrap;
15
- left: 0;
16
- top: 0;
17
- }
18
-
19
- .wpr-anim-text-inner b.wpr-anim-text-visible {
20
- position: relative;
21
- }
22
-
23
-
24
- /*--------------------------------------------------------------
25
- == Rotate 1
26
- --------------------------------------------------------------*/
27
-
28
- .wpr-anim-text.wpr-anim-text-type-rotate-1 .wpr-anim-text-inner {
29
- -webkit-perspective: 300px;
30
- perspective: 300px;
31
- }
32
-
33
- .wpr-anim-text.wpr-anim-text-type-rotate-1 b {
34
- opacity: 0;
35
- -webkit-transform-origin: 50% 100%;
36
- -ms-transform-origin: 50% 100%;
37
- transform-origin: 50% 100%;
38
- -webkit-transform: rotateX(180deg);
39
- -ms-transform: rotateX(180deg);
40
- transform: rotateX(180deg);
41
- }
42
-
43
- .wpr-anim-text.wpr-anim-text-type-rotate-1 b.wpr-anim-text-visible {
44
- opacity: 1;
45
- -webkit-transform: rotateX(0deg);
46
- -ms-transform: rotateX(0deg);
47
- transform: rotateX(0deg);
48
- -webkit-animation: wpr-anim-text-rotate-1-in 1.2s;
49
- animation: wpr-anim-text-rotate-1-in 1.2s;
50
- }
51
-
52
- .wpr-anim-text.wpr-anim-text-type-rotate-1 b.wpr-anim-text-hidden {
53
- -webkit-transform: rotateX(180deg);
54
- -ms-transform: rotateX(180deg);
55
- transform: rotateX(180deg);
56
- -webkit-animation: wpr-anim-text-rotate-1-out 1.2s;
57
- animation: wpr-anim-text-rotate-1-out 1.2s;
58
- }
59
-
60
- @-webkit-keyframes wpr-anim-text-rotate-1-in {
61
- 0% {
62
- -webkit-transform: rotateX(180deg);
63
- opacity: 0;
64
- }
65
- 35% {
66
- -webkit-transform: rotateX(120deg);
67
- opacity: 0;
68
- }
69
- 65% {
70
- opacity: 0;
71
- }
72
- 100% {
73
- -webkit-transform: rotateX(360deg);
74
- opacity: 1;
75
- }
76
- }
77
-
78
- @keyframes wpr-anim-text-rotate-1-in {
79
- 0% {
80
- -webkit-transform: rotateX(180deg);
81
- -ms-transform: rotateX(180deg);
82
- transform: rotateX(180deg);
83
- opacity: 0;
84
- }
85
- 35% {
86
- -webkit-transform: rotateX(120deg);
87
- -ms-transform: rotateX(120deg);
88
- transform: rotateX(120deg);
89
- opacity: 0;
90
- }
91
- 65% {
92
- opacity: 0;
93
- }
94
- 100% {
95
- -webkit-transform: rotateX(360deg);
96
- -ms-transform: rotateX(360deg);
97
- transform: rotateX(360deg);
98
- opacity: 1;
99
- }
100
- }
101
-
102
- @-webkit-keyframes wpr-anim-text-rotate-1-out {
103
- 0% {
104
- -webkit-transform: rotateX(0deg);
105
- opacity: 1;
106
- }
107
- 35% {
108
- -webkit-transform: rotateX(-40deg);
109
- opacity: 1;
110
- }
111
- 65% {
112
- opacity: 0;
113
- }
114
- 100% {
115
- -webkit-transform: rotateX(180deg);
116
- opacity: 0;
117
- }
118
- }
119
-
120
- @keyframes wpr-anim-text-rotate-1-out {
121
- 0% {
122
- -webkit-transform: rotateX(0deg);
123
- -ms-transform: rotateX(0deg);
124
- transform: rotateX(0deg);
125
- opacity: 1;
126
- }
127
- 35% {
128
- -webkit-transform: rotateX(-40deg);
129
- -ms-transform: rotateX(-40deg);
130
- transform: rotateX(-40deg);
131
- opacity: 1;
132
- }
133
- 65% {
134
- opacity: 0;
135
- }
136
- 100% {
137
- -webkit-transform: rotateX(180deg);
138
- -ms-transform: rotateX(180deg);
139
- transform: rotateX(180deg);
140
- opacity: 0;
141
- }
142
- }
143
-
144
-
145
- /*--------------------------------------------------------------
146
- == Typing
147
- --------------------------------------------------------------*/
148
-
149
- .wpr-anim-text.wpr-anim-text-type-typing .wpr-anim-text-inner {
150
- vertical-align: top;
151
- overflow: hidden;
152
- }
153
-
154
- .wpr-anim-text.wpr-anim-text-type-typing b {
155
- visibility: hidden;
156
- }
157
-
158
- .wpr-anim-text.wpr-anim-text-type-typing b.wpr-anim-text-visible {
159
- visibility: visible;
160
- }
161
-
162
- .wpr-anim-text.wpr-anim-text-type-typing i {
163
- position: absolute;
164
- visibility: hidden;
165
- }
166
-
167
- .wpr-anim-text.wpr-anim-text-type-typing i.wpr-anim-text-in {
168
- position: relative;
169
- visibility: visible;
170
- }
171
-
172
- @-webkit-keyframes wpr-anim-text-pulse {
173
- 0% {
174
- -webkit-transform: translateY(-50%) scale(1);
175
- opacity: 1;
176
- }
177
- 40% {
178
- -webkit-transform: translateY(-50%) scale(0.9);
179
- opacity: 0;
180
- }
181
- 100% {
182
- -webkit-transform: translateY(-50%) scale(0);
183
- opacity: 0;
184
- }
185
- }
186
-
187
- @keyframes wpr-anim-text-pulse {
188
- 0% {
189
- -webkit-transform: translateY(-50%) scale(1);
190
- -ms-transform: translateY(-50%) scale(1);
191
- transform: translateY(-50%) scale(1);
192
- opacity: 1;
193
- }
194
- 40% {
195
- -webkit-transform: translateY(-50%) scale(0.9);
196
- -ms-transform: translateY(-50%) scale(0.9);
197
- transform: translateY(-50%) scale(0.9);
198
- opacity: 0;
199
- }
200
- 100% {
201
- -webkit-transform: translateY(-50%) scale(0);
202
- -ms-transform: translateY(-50%) scale(0);
203
- transform: translateY(-50%) scale(0);
204
- opacity: 0;
205
- }
206
- }
207
-
208
-
209
- /*--------------------------------------------------------------
210
- == Rotate 2
211
- --------------------------------------------------------------*/
212
-
213
- .wpr-anim-text.wpr-anim-text-type-rotate-2 .wpr-anim-text-inner {
214
- -webkit-perspective: 300px;
215
- perspective: 300px;
216
- }
217
-
218
- .wpr-anim-text.wpr-anim-text-type-rotate-2 i,
219
- .wpr-anim-text.wpr-anim-text-type-rotate-2 em {
220
- display: inline-block;
221
- -webkit-backface-visibility: hidden;
222
- backface-visibility: hidden;
223
- }
224
-
225
- .wpr-anim-text.wpr-anim-text-type-rotate-2 b {
226
- opacity: 0;
227
- }
228
-
229
- .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
230
- -webkit-transform-style: preserve-3d;
231
- transform-style: preserve-3d;
232
- -webkit-transform: translateZ(-20px) rotateX(90deg);
233
- -ms-transform: translateZ(-20px) rotateX(90deg);
234
- transform: translateZ(-20px) rotateX(90deg);
235
- opacity: 0;
236
- }
237
-
238
- .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
239
- opacity: 1;
240
- }
241
-
242
- .wpr-anim-text.wpr-anim-text-type-rotate-2 i.wpr-anim-text-in {
243
- -webkit-animation: wpr-anim-text-rotate-2-in 0.4s forwards;
244
- animation: wpr-anim-text-rotate-2-in 0.4s forwards;
245
- }
246
-
247
- .wpr-anim-text.wpr-anim-text-type-rotate-2 i.wpr-anim-text-out {
248
- -webkit-animation: wpr-anim-text-rotate-2-out 0.4s forwards;
249
- animation: wpr-anim-text-rotate-2-out 0.4s forwards;
250
- }
251
-
252
- .wpr-anim-text.wpr-anim-text-type-rotate-2 em {
253
- -webkit-transform: translateZ(20px);
254
- -ms-transform: translateZ(20px);
255
- transform: translateZ(20px);
256
- }
257
-
258
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
259
- -webkit-transform: rotateX(0deg);
260
- -ms-transform: rotateX(0deg);
261
- transform: rotateX(0deg);
262
- opacity: 0;
263
- }
264
-
265
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 i em {
266
- -webkit-transform: scale(1);
267
- -ms-transform: scale(1);
268
- transform: scale(1);
269
- }
270
-
271
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 .wpr-anim-text-visible i {
272
- opacity: 1;
273
- }
274
-
275
- @-webkit-keyframes wpr-anim-text-rotate-2-in {
276
- 0% {
277
- opacity: 0;
278
- -webkit-transform: translateZ(-20px) rotateX(90deg);
279
- }
280
- 60% {
281
- opacity: 1;
282
- -webkit-transform: translateZ(-20px) rotateX(-10deg);
283
- }
284
- 100% {
285
- opacity: 1;
286
- -webkit-transform: translateZ(-20px) rotateX(0deg);
287
- }
288
- }
289
-
290
- @keyframes wpr-anim-text-rotate-2-in {
291
- 0% {
292
- opacity: 0;
293
- -webkit-transform: translateZ(-20px) rotateX(90deg);
294
- -ms-transform: translateZ(-20px) rotateX(90deg);
295
- transform: translateZ(-20px) rotateX(90deg);
296
- }
297
- 60% {
298
- opacity: 1;
299
- -webkit-transform: translateZ(-20px) rotateX(-10deg);
300
- -ms-transform: translateZ(-20px) rotateX(-10deg);
301
- transform: translateZ(-20px) rotateX(-10deg);
302
- }
303
- 100% {
304
- opacity: 1;
305
- -webkit-transform: translateZ(-20px) rotateX(0deg);
306
- -ms-transform: translateZ(-20px) rotateX(0deg);
307
- transform: translateZ(-20px) rotateX(0deg);
308
- }
309
- }
310
-
311
- @-webkit-keyframes wpr-anim-text-rotate-2-out {
312
- 0% {
313
- opacity: 1;
314
- -webkit-transform: translateZ(-20px) rotateX(0);
315
- }
316
- 60% {
317
- opacity: 0;
318
- -webkit-transform: translateZ(-20px) rotateX(-100deg);
319
- }
320
- 100% {
321
- opacity: 0;
322
- -webkit-transform: translateZ(-20px) rotateX(-90deg);
323
- }
324
- }
325
-
326
- @keyframes wpr-anim-text-rotate-2-out {
327
- 0% {
328
- opacity: 1;
329
- -webkit-transform: translateZ(-20px) rotateX(0);
330
- -ms-transform: translateZ(-20px) rotateX(0);
331
- transform: translateZ(-20px) rotateX(0);
332
- }
333
- 60% {
334
- opacity: 0;
335
- -webkit-transform: translateZ(-20px) rotateX(-100deg);
336
- -ms-transform: translateZ(-20px) rotateX(-100deg);
337
- transform: translateZ(-20px) rotateX(-100deg);
338
- }
339
- 100% {
340
- opacity: 0;
341
- -webkit-transform: translateZ(-20px) rotateX(-90deg);
342
- -ms-transform: translateZ(-20px) rotateX(-90deg);
343
- transform: translateZ(-20px) rotateX(-90deg);
344
- }
345
- }
346
-
347
-
348
- /*--------------------------------------------------------------
349
- == Slide
350
- --------------------------------------------------------------*/
351
-
352
- .wpr-anim-text.wpr-anim-text-type-slide span {
353
- display: inline-block;
354
- padding: .2em 0;
355
- }
356
-
357
- .wpr-anim-text.wpr-anim-text-type-slide .wpr-anim-text-inner {
358
- overflow: hidden;
359
- vertical-align: top;
360
- }
361
-
362
- .wpr-anim-text.wpr-anim-text-type-slide b {
363
- opacity: 0;
364
- top: .2em;
365
- }
366
-
367
- .wpr-anim-text.wpr-anim-text-type-slide b.wpr-anim-text-visible {
368
- top: 0;
369
- opacity: 1;
370
- -webkit-animation: wpr-anim-text-slide-in 0.6s;
371
- animation: wpr-anim-text-slide-in 0.6s;
372
- }
373
-
374
- .wpr-anim-text.wpr-anim-text-type-slide b.wpr-anim-text-hidden {
375
- -webkit-animation: wpr-anim-text-slide-out 0.6s;
376
- animation: wpr-anim-text-slide-out 0.6s;
377
- }
378
-
379
- @-webkit-keyframes wpr-anim-text-slide-in {
380
- 0% {
381
- opacity: 0;
382
- -webkit-transform: translateY(-100%);
383
- }
384
- 60% {
385
- opacity: 1;
386
- -webkit-transform: translateY(20%);
387
- }
388
- 100% {
389
- opacity: 1;
390
- -webkit-transform: translateY(0);
391
- }
392
- }
393
-
394
- @keyframes wpr-anim-text-slide-in {
395
- 0% {
396
- opacity: 0;
397
- -webkit-transform: translateY(-100%);
398
- -ms-transform: translateY(-100%);
399
- transform: translateY(-100%);
400
- }
401
- 60% {
402
- opacity: 1;
403
- -webkit-transform: translateY(20%);
404
- -ms-transform: translateY(20%);
405
- transform: translateY(20%);
406
- }
407
- 100% {
408
- opacity: 1;
409
- -webkit-transform: translateY(0);
410
- -ms-transform: translateY(0);
411
- transform: translateY(0);
412
- }
413
- }
414
-
415
- @-webkit-keyframes wpr-anim-text-slide-out {
416
- 0% {
417
- opacity: 1;
418
- -webkit-transform: translateY(0);
419
- }
420
- 60% {
421
- opacity: 0;
422
- -webkit-transform: translateY(120%);
423
- }
424
- 100% {
425
- opacity: 0;
426
- -webkit-transform: translateY(100%);
427
- }
428
- }
429
-
430
- @keyframes wpr-anim-text-slide-out {
431
- 0% {
432
- opacity: 1;
433
- -webkit-transform: translateY(0);
434
- -ms-transform: translateY(0);
435
- transform: translateY(0);
436
- }
437
- 60% {
438
- opacity: 0;
439
- -webkit-transform: translateY(120%);
440
- -ms-transform: translateY(120%);
441
- transform: translateY(120%);
442
- }
443
- 100% {
444
- opacity: 0;
445
- -webkit-transform: translateY(100%);
446
- -ms-transform: translateY(100%);
447
- transform: translateY(100%);
448
- }
449
- }
450
-
451
-
452
- /*--------------------------------------------------------------
453
- == Clip
454
- --------------------------------------------------------------*/
455
-
456
- .wpr-anim-text.wpr-anim-text-type-clip span {
457
- display: inline-block;
458
- padding: .2em 0;
459
- }
460
-
461
- .wpr-anim-text.wpr-anim-text-type-clip .wpr-anim-text-inner {
462
- overflow: hidden;
463
- vertical-align: top;
464
- }
465
-
466
- .wpr-anim-text.wpr-anim-text-type-clip b {
467
- opacity: 0;
468
- }
469
-
470
- .wpr-anim-text.wpr-anim-text-type-clip b.wpr-anim-text-visible {
471
- opacity: 1;
472
- }
473
-
474
-
475
- /*--------------------------------------------------------------
476
- == Zoom
477
- --------------------------------------------------------------*/
478
-
479
- .wpr-anim-text.wpr-anim-text-type-zoom .wpr-anim-text-inner {
480
- -webkit-perspective: 300px;
481
- perspective: 300px;
482
- }
483
-
484
- .wpr-anim-text.wpr-anim-text-type-zoom b {
485
- opacity: 0;
486
- }
487
-
488
- .wpr-anim-text.wpr-anim-text-type-zoom b.wpr-anim-text-visible {
489
- opacity: 1;
490
- -webkit-animation: wpr-anim-text-zoom-in 0.8s;
491
- animation: wpr-anim-text-zoom-in 0.8s;
492
- }
493
-
494
- .wpr-anim-text.wpr-anim-text-type-zoom b.wpr-anim-text-hidden {
495
- -webkit-animation: wpr-anim-text-zoom-out 0.8s;
496
- animation: wpr-anim-text-zoom-out 0.8s;
497
- }
498
-
499
- @-webkit-keyframes wpr-anim-text-zoom-in {
500
- 0% {
501
- opacity: 0;
502
- -webkit-transform: translateZ(100px);
503
- }
504
- 100% {
505
- opacity: 1;
506
- -webkit-transform: translateZ(0);
507
- }
508
- }
509
-
510
- @keyframes wpr-anim-text-zoom-in {
511
- 0% {
512
- opacity: 0;
513
- -webkit-transform: translateZ(100px);
514
- -ms-transform: translateZ(100px);
515
- transform: translateZ(100px);
516
- }
517
- 100% {
518
- opacity: 1;
519
- -webkit-transform: translateZ(0);
520
- -ms-transform: translateZ(0);
521
- transform: translateZ(0);
522
- }
523
- }
524
-
525
- @-webkit-keyframes wpr-anim-text-zoom-out {
526
- 0% {
527
- opacity: 1;
528
- -webkit-transform: translateZ(0);
529
- }
530
- 100% {
531
- opacity: 0;
532
- -webkit-transform: translateZ(-100px);
533
- }
534
- }
535
-
536
- @keyframes wpr-anim-text-zoom-out {
537
- 0% {
538
- opacity: 1;
539
- -webkit-transform: translateZ(0);
540
- -ms-transform: translateZ(0);
541
- transform: translateZ(0);
542
- }
543
- 100% {
544
- opacity: 0;
545
- -webkit-transform: translateZ(-100px);
546
- -ms-transform: translateZ(-100px);
547
- transform: translateZ(-100px);
548
- }
549
- }
550
-
551
-
552
- /*--------------------------------------------------------------
553
- == Rotate-3
554
- --------------------------------------------------------------*/
555
-
556
- .wpr-anim-text.wpr-anim-text-type-rotate-3 .wpr-anim-text-inner {
557
- -webkit-perspective: 300px;
558
- perspective: 300px;
559
- }
560
-
561
- .wpr-anim-text.wpr-anim-text-type-rotate-3 b {
562
- opacity: 0;
563
- }
564
-
565
- .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
566
- display: inline-block;
567
- -webkit-transform: rotateY(180deg);
568
- -ms-transform: rotateY(180deg);
569
- transform: rotateY(180deg);
570
- -webkit-backface-visibility: hidden;
571
- backface-visibility: hidden;
572
- }
573
-
574
- .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
575
- -webkit-transform: rotateY(0deg);
576
- -ms-transform: rotateY(0deg);
577
- transform: rotateY(0deg);
578
- }
579
-
580
- .wpr-anim-text.wpr-anim-text-type-rotate-3 i.wpr-anim-text-in {
581
- -webkit-animation: wpr-anim-text-rotate-3-in 0.6s forwards;
582
- animation: wpr-anim-text-rotate-3-in 0.6s forwards;
583
- }
584
-
585
- .wpr-anim-text.wpr-anim-text-type-rotate-3 i.wpr-anim-text-out {
586
- -webkit-animation: wpr-anim-text-rotate-3-out 0.6s forwards;
587
- animation: wpr-anim-text-rotate-3-out 0.6s forwards;
588
- }
589
-
590
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
591
- -webkit-transform: rotateY(0deg);
592
- -ms-transform: rotateY(0deg);
593
- transform: rotateY(0deg);
594
- opacity: 0;
595
- }
596
-
597
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-3 .wpr-anim-text-visible i {
598
- opacity: 1;
599
- }
600
-
601
- @-webkit-keyframes wpr-anim-text-rotate-3-in {
602
- 0% {
603
- -webkit-transform: rotateY(180deg);
604
- }
605
- 100% {
606
- -webkit-transform: rotateY(0deg);
607
- }
608
- }
609
-
610
- @keyframes wpr-anim-text-rotate-3-in {
611
- 0% {
612
- -webkit-transform: rotateY(180deg);
613
- -ms-transform: rotateY(180deg);
614
- transform: rotateY(180deg);
615
- }
616
- 100% {
617
- -webkit-transform: rotateY(0deg);
618
- -ms-transform: rotateY(0deg);
619
- transform: rotateY(0deg);
620
- }
621
- }
622
-
623
- @-webkit-keyframes wpr-anim-text-rotate-3-out {
624
- 0% {
625
- -webkit-transform: rotateY(0);
626
- }
627
- 100% {
628
- -webkit-transform: rotateY(-180deg);
629
- }
630
- }
631
-
632
- @keyframes wpr-anim-text-rotate-3-out {
633
- 0% {
634
- -webkit-transform: rotateY(0);
635
- -ms-transform: rotateY(0);
636
- transform: rotateY(0);
637
- }
638
- 100% {
639
- -webkit-transform: rotateY(-180deg);
640
- -ms-transform: rotateY(-180deg);
641
- transform: rotateY(-180deg);
642
- }
643
- }
644
-
645
-
646
- /*--------------------------------------------------------------
647
- == Scale
648
- --------------------------------------------------------------*/
649
-
650
- .wpr-anim-text.wpr-anim-text-type-scale b {
651
- opacity: 0;
652
- }
653
-
654
- .wpr-anim-text.wpr-anim-text-type-scale i {
655
- display: inline-block;
656
- opacity: 0;
657
- -webkit-transform: scale(0);
658
- -ms-transform: scale(0);
659
- transform: scale(0);
660
- }
661
-
662
- .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-scale i {
663
- opacity: 1;
664
- }
665
-
666
- .wpr-anim-text.wpr-anim-text-type-scale i.wpr-anim-text-in {
667
- -webkit-animation: wpr-anim-text-scale-up 0.6s forwards;
668
- animation: wpr-anim-text-scale-up 0.6s forwards;
669
- }
670
-
671
- .wpr-anim-text.wpr-anim-text-type-scale i.wpr-anim-text-out {
672
- -webkit-animation: wpr-anim-text-scale-down 0.6s forwards;
673
- animation: wpr-anim-text-scale-down 0.6s forwards;
674
- }
675
-
676
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-scale i {
677
- -webkit-transform: scale(1);
678
- -ms-transform: scale(1);
679
- transform: scale(1);
680
- opacity: 0;
681
- }
682
-
683
- .no-csstransitions .wpr-anim-text.wpr-anim-text-type-scale .wpr-anim-text-visible i {
684
- opacity: 1;
685
- }
686
-
687
- @-webkit-keyframes wpr-anim-text-scale-up {
688
- 0% {
689
- -webkit-transform: scale(0);
690
- opacity: 0;
691
- }
692
- 60% {
693
- -webkit-transform: scale(1.2);
694
- opacity: 1;
695
- }
696
- 100% {
697
- -webkit-transform: scale(1);
698
- opacity: 1;
699
- }
700
- }
701
-
702
- @keyframes wpr-anim-text-scale-up {
703
- 0% {
704
- -webkit-transform: scale(0);
705
- -ms-transform: scale(0);
706
- transform: scale(0);
707
- opacity: 0;
708
- }
709
- 60% {
710
- -webkit-transform: scale(1.2);
711
- -ms-transform: scale(1.2);
712
- transform: scale(1.2);
713
- opacity: 1;
714
- }
715
- 100% {
716
- -webkit-transform: scale(1);
717
- -ms-transform: scale(1);
718
- transform: scale(1);
719
- opacity: 1;
720
- }
721
- }
722
-
723
- @-webkit-keyframes wpr-anim-text-scale-down {
724
- 0% {
725
- -webkit-transform: scale(1);
726
- opacity: 1;
727
- }
728
- 60% {
729
- -webkit-transform: scale(0);
730
- opacity: 0;
731
- }
732
- }
733
-
734
- @keyframes wpr-anim-text-scale-down {
735
- 0% {
736
- -webkit-transform: scale(1);
737
- -ms-transform: scale(1);
738
- transform: scale(1);
739
- opacity: 1;
740
- }
741
- 60% {
742
- -webkit-transform: scale(0);
743
- -ms-transform: scale(0);
744
- transform: scale(0);
745
- opacity: 0;
746
- }
747
- }
748
-
749
-
750
- /*--------------------------------------------------------------
751
- == Push
752
- --------------------------------------------------------------*/
753
- .wpr-anim-text-type-push {
754
- overflow: hidden;
755
- }
756
-
757
- .wpr-anim-text.wpr-anim-text-type-push b {
758
- opacity: 0;
759
- }
760
-
761
- .wpr-anim-text.wpr-anim-text-type-push b.wpr-anim-text-visible {
762
- opacity: 1;
763
- -webkit-animation: wpr-anim-text-push-in 0.6s;
764
- animation: wpr-anim-text-push-in 0.6s;
765
- }
766
-
767
- .wpr-anim-text.wpr-anim-text-type-push b.wpr-anim-text-hidden {
768
- -webkit-animation: wpr-anim-text-push-out 0.6s;
769
- animation: wpr-anim-text-push-out 0.6s;
770
- }
771
-
772
- @-webkit-keyframes wpr-anim-text-push-in {
773
- 0% {
774
- opacity: 0;
775
- -webkit-transform: translateX(-100%);
776
- }
777
- 60% {
778
- opacity: 1;
779
- -webkit-transform: translateX(10%);
780
- }
781
- 100% {
782
- opacity: 1;
783
- -webkit-transform: translateX(0);
784
- }
785
- }
786
-
787
- @keyframes wpr-anim-text-push-in {
788
- 0% {
789
- opacity: 0;
790
- -webkit-transform: translateX(-100%);
791
- -ms-transform: translateX(-100%);
792
- transform: translateX(-100%);
793
- }
794
- 60% {
795
- opacity: 1;
796
- -webkit-transform: translateX(10%);
797
- -ms-transform: translateX(10%);
798
- transform: translateX(10%);
799
- }
800
- 100% {
801
- opacity: 1;
802
- -webkit-transform: translateX(0);
803
- -ms-transform: translateX(0);
804
- transform: translateX(0);
805
- }
806
- }
807
-
808
- @-webkit-keyframes wpr-anim-text-push-out {
809
- 0% {
810
- opacity: 1;
811
- -webkit-transform: translateX(0);
812
- }
813
- 60% {
814
- opacity: 0;
815
- -webkit-transform: translateX(110%);
816
- }
817
- 100% {
818
- opacity: 0;
819
- -webkit-transform: translateX(100%);
820
- }
821
- }
822
-
823
- @keyframes wpr-anim-text-push-out {
824
- 0% {
825
- opacity: 1;
826
- -webkit-transform: translateX(0);
827
- -ms-transform: translateX(0);
828
- transform: translateX(0);
829
- }
830
- 60% {
831
- opacity: 0;
832
- -webkit-transform: translateX(110%);
833
- -ms-transform: translateX(110%);
834
- transform: translateX(110%);
835
- }
836
- 100% {
837
- opacity: 0;
838
- -webkit-transform: translateX(100%);
839
- -ms-transform: translateX(100%);
840
- transform: translateX(100%);
841
- }
842
- }
843
-
1
+ /*--------------------------------------------------------------
2
+ == General
3
+ --------------------------------------------------------------*/
4
+
5
+ .wpr-anim-text-inner {
6
+ display: inline-block;
7
+ position: relative;
8
+ text-align: left;
9
+ }
10
+
11
+ .wpr-anim-text-inner b {
12
+ display: inline-block;
13
+ position: absolute;
14
+ white-space: nowrap;
15
+ left: 0;
16
+ top: 0;
17
+ }
18
+
19
+ .wpr-anim-text-inner b.wpr-anim-text-visible {
20
+ position: relative;
21
+ }
22
+
23
+
24
+ /*--------------------------------------------------------------
25
+ == Rotate 1
26
+ --------------------------------------------------------------*/
27
+
28
+ .wpr-anim-text.wpr-anim-text-type-rotate-1 .wpr-anim-text-inner {
29
+ -webkit-perspective: 300px;
30
+ perspective: 300px;
31
+ }
32
+
33
+ .wpr-anim-text.wpr-anim-text-type-rotate-1 b {
34
+ opacity: 0;
35
+ -webkit-transform-origin: 50% 100%;
36
+ -ms-transform-origin: 50% 100%;
37
+ transform-origin: 50% 100%;
38
+ -webkit-transform: rotateX(180deg);
39
+ -ms-transform: rotateX(180deg);
40
+ transform: rotateX(180deg);
41
+ }
42
+
43
+ .wpr-anim-text.wpr-anim-text-type-rotate-1 b.wpr-anim-text-visible {
44
+ opacity: 1;
45
+ -webkit-transform: rotateX(0deg);
46
+ -ms-transform: rotateX(0deg);
47
+ transform: rotateX(0deg);
48
+ -webkit-animation: wpr-anim-text-rotate-1-in 1.2s;
49
+ animation: wpr-anim-text-rotate-1-in 1.2s;
50
+ }
51
+
52
+ .wpr-anim-text.wpr-anim-text-type-rotate-1 b.wpr-anim-text-hidden {
53
+ -webkit-transform: rotateX(180deg);
54
+ -ms-transform: rotateX(180deg);
55
+ transform: rotateX(180deg);
56
+ -webkit-animation: wpr-anim-text-rotate-1-out 1.2s;
57
+ animation: wpr-anim-text-rotate-1-out 1.2s;
58
+ }
59
+
60
+ @-webkit-keyframes wpr-anim-text-rotate-1-in {
61
+ 0% {
62
+ -webkit-transform: rotateX(180deg);
63
+ opacity: 0;
64
+ }
65
+ 35% {
66
+ -webkit-transform: rotateX(120deg);
67
+ opacity: 0;
68
+ }
69
+ 65% {
70
+ opacity: 0;
71
+ }
72
+ 100% {
73
+ -webkit-transform: rotateX(360deg);
74
+ opacity: 1;
75
+ }
76
+ }
77
+
78
+ @keyframes wpr-anim-text-rotate-1-in {
79
+ 0% {
80
+ -webkit-transform: rotateX(180deg);
81
+ -ms-transform: rotateX(180deg);
82
+ transform: rotateX(180deg);
83
+ opacity: 0;
84
+ }
85
+ 35% {
86
+ -webkit-transform: rotateX(120deg);
87
+ -ms-transform: rotateX(120deg);
88
+ transform: rotateX(120deg);
89
+ opacity: 0;
90
+ }
91
+ 65% {
92
+ opacity: 0;
93
+ }
94
+ 100% {
95
+ -webkit-transform: rotateX(360deg);
96
+ -ms-transform: rotateX(360deg);
97
+ transform: rotateX(360deg);
98
+ opacity: 1;
99
+ }
100
+ }
101
+
102
+ @-webkit-keyframes wpr-anim-text-rotate-1-out {
103
+ 0% {
104
+ -webkit-transform: rotateX(0deg);
105
+ opacity: 1;
106
+ }
107
+ 35% {
108
+ -webkit-transform: rotateX(-40deg);
109
+ opacity: 1;
110
+ }
111
+ 65% {
112
+ opacity: 0;
113
+ }
114
+ 100% {
115
+ -webkit-transform: rotateX(180deg);
116
+ opacity: 0;
117
+ }
118
+ }
119
+
120
+ @keyframes wpr-anim-text-rotate-1-out {
121
+ 0% {
122
+ -webkit-transform: rotateX(0deg);
123
+ -ms-transform: rotateX(0deg);
124
+ transform: rotateX(0deg);
125
+ opacity: 1;
126
+ }
127
+ 35% {
128
+ -webkit-transform: rotateX(-40deg);
129
+ -ms-transform: rotateX(-40deg);
130
+ transform: rotateX(-40deg);
131
+ opacity: 1;
132
+ }
133
+ 65% {
134
+ opacity: 0;
135
+ }
136
+ 100% {
137
+ -webkit-transform: rotateX(180deg);
138
+ -ms-transform: rotateX(180deg);
139
+ transform: rotateX(180deg);
140
+ opacity: 0;
141
+ }
142
+ }
143
+
144
+
145
+ /*--------------------------------------------------------------
146
+ == Typing
147
+ --------------------------------------------------------------*/
148
+
149
+ .wpr-anim-text.wpr-anim-text-type-typing .wpr-anim-text-inner {
150
+ vertical-align: top;
151
+ overflow: hidden;
152
+ }
153
+
154
+ .wpr-anim-text.wpr-anim-text-type-typing b {
155
+ visibility: hidden;
156
+ }
157
+
158
+ .wpr-anim-text.wpr-anim-text-type-typing b.wpr-anim-text-visible {
159
+ visibility: visible;
160
+ }
161
+
162
+ .wpr-anim-text.wpr-anim-text-type-typing i {
163
+ position: absolute;
164
+ visibility: hidden;
165
+ }
166
+
167
+ .wpr-anim-text.wpr-anim-text-type-typing i.wpr-anim-text-in {
168
+ position: relative;
169
+ visibility: visible;
170
+ }
171
+
172
+ @-webkit-keyframes wpr-anim-text-pulse {
173
+ 0% {
174
+ -webkit-transform: translateY(-50%) scale(1);
175
+ opacity: 1;
176
+ }
177
+ 40% {
178
+ -webkit-transform: translateY(-50%) scale(0.9);
179
+ opacity: 0;
180
+ }
181
+ 100% {
182
+ -webkit-transform: translateY(-50%) scale(0);
183
+ opacity: 0;
184
+ }
185
+ }
186
+
187
+ @keyframes wpr-anim-text-pulse {
188
+ 0% {
189
+ -webkit-transform: translateY(-50%) scale(1);
190
+ -ms-transform: translateY(-50%) scale(1);
191
+ transform: translateY(-50%) scale(1);
192
+ opacity: 1;
193
+ }
194
+ 40% {
195
+ -webkit-transform: translateY(-50%) scale(0.9);
196
+ -ms-transform: translateY(-50%) scale(0.9);
197
+ transform: translateY(-50%) scale(0.9);
198
+ opacity: 0;
199
+ }
200
+ 100% {
201
+ -webkit-transform: translateY(-50%) scale(0);
202
+ -ms-transform: translateY(-50%) scale(0);
203
+ transform: translateY(-50%) scale(0);
204
+ opacity: 0;
205
+ }
206
+ }
207
+
208
+
209
+ /*--------------------------------------------------------------
210
+ == Rotate 2
211
+ --------------------------------------------------------------*/
212
+
213
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 .wpr-anim-text-inner {
214
+ -webkit-perspective: 300px;
215
+ perspective: 300px;
216
+ }
217
+
218
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 i,
219
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 em {
220
+ display: inline-block;
221
+ -webkit-backface-visibility: hidden;
222
+ backface-visibility: hidden;
223
+ }
224
+
225
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 b {
226
+ opacity: 0;
227
+ }
228
+
229
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
230
+ -webkit-transform-style: preserve-3d;
231
+ transform-style: preserve-3d;
232
+ -webkit-transform: translateZ(-20px) rotateX(90deg);
233
+ -ms-transform: translateZ(-20px) rotateX(90deg);
234
+ transform: translateZ(-20px) rotateX(90deg);
235
+ opacity: 0;
236
+ }
237
+
238
+ .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
239
+ opacity: 1;
240
+ }
241
+
242
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 i.wpr-anim-text-in {
243
+ -webkit-animation: wpr-anim-text-rotate-2-in 0.4s forwards;
244
+ animation: wpr-anim-text-rotate-2-in 0.4s forwards;
245
+ }
246
+
247
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 i.wpr-anim-text-out {
248
+ -webkit-animation: wpr-anim-text-rotate-2-out 0.4s forwards;
249
+ animation: wpr-anim-text-rotate-2-out 0.4s forwards;
250
+ }
251
+
252
+ .wpr-anim-text.wpr-anim-text-type-rotate-2 em {
253
+ -webkit-transform: translateZ(20px);
254
+ -ms-transform: translateZ(20px);
255
+ transform: translateZ(20px);
256
+ }
257
+
258
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 i {
259
+ -webkit-transform: rotateX(0deg);
260
+ -ms-transform: rotateX(0deg);
261
+ transform: rotateX(0deg);
262
+ opacity: 0;
263
+ }
264
+
265
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 i em {
266
+ -webkit-transform: scale(1);
267
+ -ms-transform: scale(1);
268
+ transform: scale(1);
269
+ }
270
+
271
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-2 .wpr-anim-text-visible i {
272
+ opacity: 1;
273
+ }
274
+
275
+ @-webkit-keyframes wpr-anim-text-rotate-2-in {
276
+ 0% {
277
+ opacity: 0;
278
+ -webkit-transform: translateZ(-20px) rotateX(90deg);
279
+ }
280
+ 60% {
281
+ opacity: 1;
282
+ -webkit-transform: translateZ(-20px) rotateX(-10deg);
283
+ }
284
+ 100% {
285
+ opacity: 1;
286
+ -webkit-transform: translateZ(-20px) rotateX(0deg);
287
+ }
288
+ }
289
+
290
+ @keyframes wpr-anim-text-rotate-2-in {
291
+ 0% {
292
+ opacity: 0;
293
+ -webkit-transform: translateZ(-20px) rotateX(90deg);
294
+ -ms-transform: translateZ(-20px) rotateX(90deg);
295
+ transform: translateZ(-20px) rotateX(90deg);
296
+ }
297
+ 60% {
298
+ opacity: 1;
299
+ -webkit-transform: translateZ(-20px) rotateX(-10deg);
300
+ -ms-transform: translateZ(-20px) rotateX(-10deg);
301
+ transform: translateZ(-20px) rotateX(-10deg);
302
+ }
303
+ 100% {
304
+ opacity: 1;
305
+ -webkit-transform: translateZ(-20px) rotateX(0deg);
306
+ -ms-transform: translateZ(-20px) rotateX(0deg);
307
+ transform: translateZ(-20px) rotateX(0deg);
308
+ }
309
+ }
310
+
311
+ @-webkit-keyframes wpr-anim-text-rotate-2-out {
312
+ 0% {
313
+ opacity: 1;
314
+ -webkit-transform: translateZ(-20px) rotateX(0);
315
+ }
316
+ 60% {
317
+ opacity: 0;
318
+ -webkit-transform: translateZ(-20px) rotateX(-100deg);
319
+ }
320
+ 100% {
321
+ opacity: 0;
322
+ -webkit-transform: translateZ(-20px) rotateX(-90deg);
323
+ }
324
+ }
325
+
326
+ @keyframes wpr-anim-text-rotate-2-out {
327
+ 0% {
328
+ opacity: 1;
329
+ -webkit-transform: translateZ(-20px) rotateX(0);
330
+ -ms-transform: translateZ(-20px) rotateX(0);
331
+ transform: translateZ(-20px) rotateX(0);
332
+ }
333
+ 60% {
334
+ opacity: 0;
335
+ -webkit-transform: translateZ(-20px) rotateX(-100deg);
336
+ -ms-transform: translateZ(-20px) rotateX(-100deg);
337
+ transform: translateZ(-20px) rotateX(-100deg);
338
+ }
339
+ 100% {
340
+ opacity: 0;
341
+ -webkit-transform: translateZ(-20px) rotateX(-90deg);
342
+ -ms-transform: translateZ(-20px) rotateX(-90deg);
343
+ transform: translateZ(-20px) rotateX(-90deg);
344
+ }
345
+ }
346
+
347
+
348
+ /*--------------------------------------------------------------
349
+ == Slide
350
+ --------------------------------------------------------------*/
351
+
352
+ .wpr-anim-text.wpr-anim-text-type-slide span {
353
+ display: inline-block;
354
+ padding: .2em 0;
355
+ }
356
+
357
+ .wpr-anim-text.wpr-anim-text-type-slide .wpr-anim-text-inner {
358
+ overflow: hidden;
359
+ vertical-align: top;
360
+ }
361
+
362
+ .wpr-anim-text.wpr-anim-text-type-slide b {
363
+ opacity: 0;
364
+ top: .2em;
365
+ }
366
+
367
+ .wpr-anim-text.wpr-anim-text-type-slide b.wpr-anim-text-visible {
368
+ top: 0;
369
+ opacity: 1;
370
+ -webkit-animation: wpr-anim-text-slide-in 0.6s;
371
+ animation: wpr-anim-text-slide-in 0.6s;
372
+ }
373
+
374
+ .wpr-anim-text.wpr-anim-text-type-slide b.wpr-anim-text-hidden {
375
+ -webkit-animation: wpr-anim-text-slide-out 0.6s;
376
+ animation: wpr-anim-text-slide-out 0.6s;
377
+ }
378
+
379
+ @-webkit-keyframes wpr-anim-text-slide-in {
380
+ 0% {
381
+ opacity: 0;
382
+ -webkit-transform: translateY(-100%);
383
+ }
384
+ 60% {
385
+ opacity: 1;
386
+ -webkit-transform: translateY(20%);
387
+ }
388
+ 100% {
389
+ opacity: 1;
390
+ -webkit-transform: translateY(0);
391
+ }
392
+ }
393
+
394
+ @keyframes wpr-anim-text-slide-in {
395
+ 0% {
396
+ opacity: 0;
397
+ -webkit-transform: translateY(-100%);
398
+ -ms-transform: translateY(-100%);
399
+ transform: translateY(-100%);
400
+ }
401
+ 60% {
402
+ opacity: 1;
403
+ -webkit-transform: translateY(20%);
404
+ -ms-transform: translateY(20%);
405
+ transform: translateY(20%);
406
+ }
407
+ 100% {
408
+ opacity: 1;
409
+ -webkit-transform: translateY(0);
410
+ -ms-transform: translateY(0);
411
+ transform: translateY(0);
412
+ }
413
+ }
414
+
415
+ @-webkit-keyframes wpr-anim-text-slide-out {
416
+ 0% {
417
+ opacity: 1;
418
+ -webkit-transform: translateY(0);
419
+ }
420
+ 60% {
421
+ opacity: 0;
422
+ -webkit-transform: translateY(120%);
423
+ }
424
+ 100% {
425
+ opacity: 0;
426
+ -webkit-transform: translateY(100%);
427
+ }
428
+ }
429
+
430
+ @keyframes wpr-anim-text-slide-out {
431
+ 0% {
432
+ opacity: 1;
433
+ -webkit-transform: translateY(0);
434
+ -ms-transform: translateY(0);
435
+ transform: translateY(0);
436
+ }
437
+ 60% {
438
+ opacity: 0;
439
+ -webkit-transform: translateY(120%);
440
+ -ms-transform: translateY(120%);
441
+ transform: translateY(120%);
442
+ }
443
+ 100% {
444
+ opacity: 0;
445
+ -webkit-transform: translateY(100%);
446
+ -ms-transform: translateY(100%);
447
+ transform: translateY(100%);
448
+ }
449
+ }
450
+
451
+
452
+ /*--------------------------------------------------------------
453
+ == Clip
454
+ --------------------------------------------------------------*/
455
+
456
+ .wpr-anim-text.wpr-anim-text-type-clip span {
457
+ display: inline-block;
458
+ padding: .2em 0;
459
+ }
460
+
461
+ .wpr-anim-text.wpr-anim-text-type-clip .wpr-anim-text-inner {
462
+ overflow: hidden;
463
+ vertical-align: top;
464
+ }
465
+
466
+ .wpr-anim-text.wpr-anim-text-type-clip b {
467
+ opacity: 0;
468
+ }
469
+
470
+ .wpr-anim-text.wpr-anim-text-type-clip b.wpr-anim-text-visible {
471
+ opacity: 1;
472
+ }
473
+
474
+
475
+ /*--------------------------------------------------------------
476
+ == Zoom
477
+ --------------------------------------------------------------*/
478
+
479
+ .wpr-anim-text.wpr-anim-text-type-zoom .wpr-anim-text-inner {
480
+ -webkit-perspective: 300px;
481
+ perspective: 300px;
482
+ }
483
+
484
+ .wpr-anim-text.wpr-anim-text-type-zoom b {
485
+ opacity: 0;
486
+ }
487
+
488
+ .wpr-anim-text.wpr-anim-text-type-zoom b.wpr-anim-text-visible {
489
+ opacity: 1;
490
+ -webkit-animation: wpr-anim-text-zoom-in 0.8s;
491
+ animation: wpr-anim-text-zoom-in 0.8s;
492
+ }
493
+
494
+ .wpr-anim-text.wpr-anim-text-type-zoom b.wpr-anim-text-hidden {
495
+ -webkit-animation: wpr-anim-text-zoom-out 0.8s;
496
+ animation: wpr-anim-text-zoom-out 0.8s;
497
+ }
498
+
499
+ @-webkit-keyframes wpr-anim-text-zoom-in {
500
+ 0% {
501
+ opacity: 0;
502
+ -webkit-transform: translateZ(100px);
503
+ }
504
+ 100% {
505
+ opacity: 1;
506
+ -webkit-transform: translateZ(0);
507
+ }
508
+ }
509
+
510
+ @keyframes wpr-anim-text-zoom-in {
511
+ 0% {
512
+ opacity: 0;
513
+ -webkit-transform: translateZ(100px);
514
+ -ms-transform: translateZ(100px);
515
+ transform: translateZ(100px);
516
+ }
517
+ 100% {
518
+ opacity: 1;
519
+ -webkit-transform: translateZ(0);
520
+ -ms-transform: translateZ(0);
521
+ transform: translateZ(0);
522
+ }
523
+ }
524
+
525
+ @-webkit-keyframes wpr-anim-text-zoom-out {
526
+ 0% {
527
+ opacity: 1;
528
+ -webkit-transform: translateZ(0);
529
+ }
530
+ 100% {
531
+ opacity: 0;
532
+ -webkit-transform: translateZ(-100px);
533
+ }
534
+ }
535
+
536
+ @keyframes wpr-anim-text-zoom-out {
537
+ 0% {
538
+ opacity: 1;
539
+ -webkit-transform: translateZ(0);
540
+ -ms-transform: translateZ(0);
541
+ transform: translateZ(0);
542
+ }
543
+ 100% {
544
+ opacity: 0;
545
+ -webkit-transform: translateZ(-100px);
546
+ -ms-transform: translateZ(-100px);
547
+ transform: translateZ(-100px);
548
+ }
549
+ }
550
+
551
+
552
+ /*--------------------------------------------------------------
553
+ == Rotate-3
554
+ --------------------------------------------------------------*/
555
+
556
+ .wpr-anim-text.wpr-anim-text-type-rotate-3 .wpr-anim-text-inner {
557
+ -webkit-perspective: 300px;
558
+ perspective: 300px;
559
+ }
560
+
561
+ .wpr-anim-text.wpr-anim-text-type-rotate-3 b {
562
+ opacity: 0;
563
+ }
564
+
565
+ .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
566
+ display: inline-block;
567
+ -webkit-transform: rotateY(180deg);
568
+ -ms-transform: rotateY(180deg);
569
+ transform: rotateY(180deg);
570
+ -webkit-backface-visibility: hidden;
571
+ backface-visibility: hidden;
572
+ }
573
+
574
+ .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
575
+ -webkit-transform: rotateY(0deg);
576
+ -ms-transform: rotateY(0deg);
577
+ transform: rotateY(0deg);
578
+ }
579
+
580
+ .wpr-anim-text.wpr-anim-text-type-rotate-3 i.wpr-anim-text-in {
581
+ -webkit-animation: wpr-anim-text-rotate-3-in 0.6s forwards;
582
+ animation: wpr-anim-text-rotate-3-in 0.6s forwards;
583
+ }
584
+
585
+ .wpr-anim-text.wpr-anim-text-type-rotate-3 i.wpr-anim-text-out {
586
+ -webkit-animation: wpr-anim-text-rotate-3-out 0.6s forwards;
587
+ animation: wpr-anim-text-rotate-3-out 0.6s forwards;
588
+ }
589
+
590
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-3 i {
591
+ -webkit-transform: rotateY(0deg);
592
+ -ms-transform: rotateY(0deg);
593
+ transform: rotateY(0deg);
594
+ opacity: 0;
595
+ }
596
+
597
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-rotate-3 .wpr-anim-text-visible i {
598
+ opacity: 1;
599
+ }
600
+
601
+ @-webkit-keyframes wpr-anim-text-rotate-3-in {
602
+ 0% {
603
+ -webkit-transform: rotateY(180deg);
604
+ }
605
+ 100% {
606
+ -webkit-transform: rotateY(0deg);
607
+ }
608
+ }
609
+
610
+ @keyframes wpr-anim-text-rotate-3-in {
611
+ 0% {
612
+ -webkit-transform: rotateY(180deg);
613
+ -ms-transform: rotateY(180deg);
614
+ transform: rotateY(180deg);
615
+ }
616
+ 100% {
617
+ -webkit-transform: rotateY(0deg);
618
+ -ms-transform: rotateY(0deg);
619
+ transform: rotateY(0deg);
620
+ }
621
+ }
622
+
623
+ @-webkit-keyframes wpr-anim-text-rotate-3-out {
624
+ 0% {
625
+ -webkit-transform: rotateY(0);
626
+ }
627
+ 100% {
628
+ -webkit-transform: rotateY(-180deg);
629
+ }
630
+ }
631
+
632
+ @keyframes wpr-anim-text-rotate-3-out {
633
+ 0% {
634
+ -webkit-transform: rotateY(0);
635
+ -ms-transform: rotateY(0);
636
+ transform: rotateY(0);
637
+ }
638
+ 100% {
639
+ -webkit-transform: rotateY(-180deg);
640
+ -ms-transform: rotateY(-180deg);
641
+ transform: rotateY(-180deg);
642
+ }
643
+ }
644
+
645
+
646
+ /*--------------------------------------------------------------
647
+ == Scale
648
+ --------------------------------------------------------------*/
649
+
650
+ .wpr-anim-text.wpr-anim-text-type-scale b {
651
+ opacity: 0;
652
+ }
653
+
654
+ .wpr-anim-text.wpr-anim-text-type-scale i {
655
+ display: inline-block;
656
+ opacity: 0;
657
+ -webkit-transform: scale(0);
658
+ -ms-transform: scale(0);
659
+ transform: scale(0);
660
+ }
661
+
662
+ .wpr-anim-text-visible .wpr-anim-text.wpr-anim-text-type-scale i {
663
+ opacity: 1;
664
+ }
665
+
666
+ .wpr-anim-text.wpr-anim-text-type-scale i.wpr-anim-text-in {
667
+ -webkit-animation: wpr-anim-text-scale-up 0.6s forwards;
668
+ animation: wpr-anim-text-scale-up 0.6s forwards;
669
+ }
670
+
671
+ .wpr-anim-text.wpr-anim-text-type-scale i.wpr-anim-text-out {
672
+ -webkit-animation: wpr-anim-text-scale-down 0.6s forwards;
673
+ animation: wpr-anim-text-scale-down 0.6s forwards;
674
+ }
675
+
676
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-scale i {
677
+ -webkit-transform: scale(1);
678
+ -ms-transform: scale(1);
679
+ transform: scale(1);
680
+ opacity: 0;
681
+ }
682
+
683
+ .no-csstransitions .wpr-anim-text.wpr-anim-text-type-scale .wpr-anim-text-visible i {
684
+ opacity: 1;
685
+ }
686
+
687
+ @-webkit-keyframes wpr-anim-text-scale-up {
688
+ 0% {
689
+ -webkit-transform: scale(0);
690
+ opacity: 0;
691
+ }
692
+ 60% {
693
+ -webkit-transform: scale(1.2);
694
+ opacity: 1;
695
+ }
696
+ 100% {
697
+ -webkit-transform: scale(1);
698
+ opacity: 1;
699
+ }
700
+ }
701
+
702
+ @keyframes wpr-anim-text-scale-up {
703
+ 0% {
704
+ -webkit-transform: scale(0);
705
+ -ms-transform: scale(0);
706
+ transform: scale(0);
707
+ opacity: 0;
708
+ }
709
+ 60% {
710
+ -webkit-transform: scale(1.2);
711
+ -ms-transform: scale(1.2);
712
+ transform: scale(1.2);
713
+ opacity: 1;
714
+ }
715
+ 100% {
716
+ -webkit-transform: scale(1);
717
+ -ms-transform: scale(1);
718
+ transform: scale(1);
719
+ opacity: 1;
720
+ }
721
+ }
722
+
723
+ @-webkit-keyframes wpr-anim-text-scale-down {
724
+ 0% {
725
+ -webkit-transform: scale(1);
726
+ opacity: 1;
727
+ }
728
+ 60% {
729
+ -webkit-transform: scale(0);
730
+ opacity: 0;
731
+ }
732
+ }
733
+
734
+ @keyframes wpr-anim-text-scale-down {
735
+ 0% {
736
+ -webkit-transform: scale(1);
737
+ -ms-transform: scale(1);
738
+ transform: scale(1);
739
+ opacity: 1;
740
+ }
741
+ 60% {
742
+ -webkit-transform: scale(0);
743
+ -ms-transform: scale(0);
744
+ transform: scale(0);
745
+ opacity: 0;
746
+ }
747
+ }
748
+
749
+
750
+ /*--------------------------------------------------------------
751
+ == Push
752
+ --------------------------------------------------------------*/
753
+ .wpr-anim-text-type-push {
754
+ overflow: hidden;
755
+ }
756
+
757
+ .wpr-anim-text.wpr-anim-text-type-push b {
758
+ opacity: 0;
759
+ }
760
+
761
+ .wpr-anim-text.wpr-anim-text-type-push b.wpr-anim-text-visible {
762
+ opacity: 1;
763
+ -webkit-animation: wpr-anim-text-push-in 0.6s;
764
+ animation: wpr-anim-text-push-in 0.6s;
765
+ }
766
+
767
+ .wpr-anim-text.wpr-anim-text-type-push b.wpr-anim-text-hidden {
768
+ -webkit-animation: wpr-anim-text-push-out 0.6s;
769
+ animation: wpr-anim-text-push-out 0.6s;
770
+ }
771
+
772
+ @-webkit-keyframes wpr-anim-text-push-in {
773
+ 0% {
774
+ opacity: 0;
775
+ -webkit-transform: translateX(-100%);
776
+ }
777
+ 60% {
778
+ opacity: 1;
779
+ -webkit-transform: translateX(10%);
780
+ }
781
+ 100% {
782
+ opacity: 1;
783
+ -webkit-transform: translateX(0);
784
+ }
785
+ }
786
+
787
+ @keyframes wpr-anim-text-push-in {
788
+ 0% {
789
+ opacity: 0;
790
+ -webkit-transform: translateX(-100%);
791
+ -ms-transform: translateX(-100%);
792
+ transform: translateX(-100%);
793
+ }
794
+ 60% {
795
+ opacity: 1;
796
+ -webkit-transform: translateX(10%);
797
+ -ms-transform: translateX(10%);
798
+ transform: translateX(10%);
799
+ }
800
+ 100% {
801
+ opacity: 1;
802
+ -webkit-transform: translateX(0);
803
+ -ms-transform: translateX(0);
804
+ transform: translateX(0);
805
+ }
806
+ }
807
+
808
+ @-webkit-keyframes wpr-anim-text-push-out {
809
+ 0% {
810
+ opacity: 1;
811
+ -webkit-transform: translateX(0);
812
+ }
813
+ 60% {
814
+ opacity: 0;
815
+ -webkit-transform: translateX(110%);
816
+ }
817
+ 100% {
818
+ opacity: 0;
819
+ -webkit-transform: translateX(100%);
820
+ }
821
+ }
822
+
823
+ @keyframes wpr-anim-text-push-out {
824
+ 0% {
825
+ opacity: 1;
826
+ -webkit-transform: translateX(0);
827
+ -ms-transform: translateX(0);
828
+ transform: translateX(0);
829
+ }
830
+ 60% {
831
+ opacity: 0;
832
+ -webkit-transform: translateX(110%);
833
+ -ms-transform: translateX(110%);
834
+ transform: translateX(110%);
835
+ }
836
+ 100% {
837
+ opacity: 0;
838
+ -webkit-transform: translateX(100%);
839
+ -ms-transform: translateX(100%);
840
+ transform: translateX(100%);
841
+ }
842
+ }
843
+
assets/css/lib/animations/wpr-link-animations.css CHANGED
@@ -1,192 +1,192 @@
1
- /*!
2
- * WPR Link 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-pointer-item {
11
- position: relative;
12
- }
13
-
14
- .wpr-pointer-double-line .wpr-pointer-item:before,
15
- .wpr-pointer-double-line .wpr-pointer-item:after,
16
- .wpr-pointer-underline .wpr-pointer-item:after,
17
- .wpr-pointer-overline .wpr-pointer-item:before {
18
- content: '';
19
- display: block;
20
- height: 4px;
21
- width: 100%;
22
- left: 0;
23
- background-color: #55595c;
24
- z-index: 2;
25
- }
26
-
27
-
28
- .wpr-pointer-fx-none .wpr-pointer-item:before,
29
- .wpr-pointer-fx-none .wpr-pointer-item:after {
30
- opacity: 0;
31
- -webkit-transition: none !important;
32
- -o-transition: none !important;
33
- transition: none !important;
34
- }
35
-
36
- .wpr-pointer-fx-none .wpr-pointer-item:hover:before,
37
- .wpr-pointer-fx-none .wpr-pointer-item:hover:after {
38
- opacity: 1;
39
- }
40
-
41
- .wpr-pointer-fx-fade .wpr-pointer-item:before,
42
- .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:after,
43
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
44
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after,
45
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before,
46
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
47
- opacity: 0;
48
- -webkit-transition: all 0.3s;
49
- -o-transition: all 0.3s;
50
- transition: all 0.3s;
51
- }
52
-
53
- .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:before,
54
- .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:after {
55
- opacity: 1;
56
- }
57
-
58
- .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:before,
59
- .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:after {
60
- width: 0;
61
- -webkit-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
62
- -o-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
63
- transition: all .3s cubic-bezier(.175,.885,.32,1.075);
64
- }
65
-
66
- .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:before,
67
- .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:after {
68
- width: 100%;
69
- }
70
-
71
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
72
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after {
73
- position: absolute;
74
- width: 0;
75
- margin: 0 auto;
76
- left: 0;
77
- right: 0;
78
- -webkit-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
79
- -o-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
80
- -webkit-transition: all .3s ease(0, 0, 0.16, 0.95);
81
- -o-transition: all .3s ease(0, 0, 0.16, 0.95);
82
- transition: all .3s ease(0, 0, 0.16, 0.95);
83
- }
84
-
85
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
86
- .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:after {
87
- opacity: 1;
88
- width: 100%;
89
- }
90
-
91
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before {
92
- position: absolute;
93
- top: -10px;
94
- }
95
-
96
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:before {
97
- top: 0;
98
- opacity: 1;
99
- }
100
-
101
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
102
- position: absolute;
103
- bottom: -10px;
104
- }
105
-
106
- .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:after {
107
- bottom: 0;
108
- opacity: 1;
109
- }
110
-
111
- .wpr-pointer-border-fx .wpr-pointer-item:before {
112
- content: '';
113
- display: block;
114
- position: absolute;
115
- top: 0;
116
- right: 0;
117
- bottom: 0;
118
- left: 0;
119
- z-index: 2;
120
- opacity: 0;
121
- border: 2px solid #000;
122
- -webkit-transition: all 0.3s;
123
- -o-transition: all 0.3s;
124
- transition: all 0.3s;
125
- }
126
-
127
- .wpr-pointer-border-fx .wpr-pointer-item:hover:before {
128
- opacity: 1;
129
- }
130
-
131
- .wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
132
- .wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:before {
133
- -webkit-transform: scale(0.9);
134
- -ms-transform: scale(0.9);
135
- transform: scale(0.9);
136
- }
137
-
138
- .wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before,
139
- .wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before {
140
- -webkit-transform: scale(1.1);
141
- -ms-transform: scale(1.1);
142
- transform: scale(1.1);
143
- }
144
-
145
- .wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
146
- .wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
147
- .wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
148
- .wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
149
- .wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:hover:before {
150
- -webkit-transform: scale(1);
151
- -ms-transform: scale(1);
152
- transform: scale(1);
153
- }
154
-
155
- .wpr-pointer-background-fx .wpr-pointer-item:before {
156
- content: '';
157
- display: block;
158
- position: absolute;
159
- top: 0;
160
- right: 0;
161
- bottom: 0;
162
- left: 0;
163
- z-index: -1;
164
- opacity: 0;
165
- background: #000;
166
- -webkit-transition: all 0.3s;
167
- -o-transition: all 0.3s;
168
- transition: all 0.3s;
169
- }
170
-
171
- .wpr-pointer-background-fx .wpr-pointer-item:hover:before {
172
- opacity: 1;
173
- }
174
-
175
- .wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:before {
176
- -webkit-transform: translateY(-12%);
177
- -ms-transform: translateY(-12%);
178
- transform: translateY(-12%);
179
- }
180
-
181
- .wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:before {
182
- -webkit-transform: perspective(600px) rotateX(90deg);
183
- transform: perspective(600px) rotateX(90deg);
184
- -webkit-transform-origin: center bottom 0;
185
- -ms-transform-origin: center bottom 0;
186
- transform-origin: center bottom 0;
187
- }
188
-
189
- .wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:hover:before {
190
- -webkit-transform: perspective(600px) rotateX(0deg);
191
- transform: perspective(600px) rotateX(0deg);
192
  }
1
+ /*!
2
+ * WPR Link 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-pointer-item {
11
+ position: relative;
12
+ }
13
+
14
+ .wpr-pointer-double-line .wpr-pointer-item:before,
15
+ .wpr-pointer-double-line .wpr-pointer-item:after,
16
+ .wpr-pointer-underline .wpr-pointer-item:after,
17
+ .wpr-pointer-overline .wpr-pointer-item:before {
18
+ content: '';
19
+ display: block;
20
+ height: 4px;
21
+ width: 100%;
22
+ left: 0;
23
+ background-color: #55595c;
24
+ z-index: 2;
25
+ }
26
+
27
+
28
+ .wpr-pointer-fx-none .wpr-pointer-item:before,
29
+ .wpr-pointer-fx-none .wpr-pointer-item:after {
30
+ opacity: 0;
31
+ -webkit-transition: none !important;
32
+ -o-transition: none !important;
33
+ transition: none !important;
34
+ }
35
+
36
+ .wpr-pointer-fx-none .wpr-pointer-item:hover:before,
37
+ .wpr-pointer-fx-none .wpr-pointer-item:hover:after {
38
+ opacity: 1;
39
+ }
40
+
41
+ .wpr-pointer-fx-fade .wpr-pointer-item:before,
42
+ .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:after,
43
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
44
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after,
45
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before,
46
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
47
+ opacity: 0;
48
+ -webkit-transition: all 0.3s;
49
+ -o-transition: all 0.3s;
50
+ transition: all 0.3s;
51
+ }
52
+
53
+ .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:before,
54
+ .wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:after {
55
+ opacity: 1;
56
+ }
57
+
58
+ .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:before,
59
+ .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:after {
60
+ width: 0;
61
+ -webkit-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
62
+ -o-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
63
+ transition: all .3s cubic-bezier(.175,.885,.32,1.075);
64
+ }
65
+
66
+ .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:before,
67
+ .wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:after {
68
+ width: 100%;
69
+ }
70
+
71
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
72
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after {
73
+ position: absolute;
74
+ width: 0;
75
+ margin: 0 auto;
76
+ left: 0;
77
+ right: 0;
78
+ -webkit-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
79
+ -o-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
80
+ -webkit-transition: all .3s ease(0, 0, 0.16, 0.95);
81
+ -o-transition: all .3s ease(0, 0, 0.16, 0.95);
82
+ transition: all .3s ease(0, 0, 0.16, 0.95);
83
+ }
84
+
85
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
86
+ .wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:after {
87
+ opacity: 1;
88
+ width: 100%;
89
+ }
90
+
91
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before {
92
+ position: absolute;
93
+ top: -10px;
94
+ }
95
+
96
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:before {
97
+ top: 0;
98
+ opacity: 1;
99
+ }
100
+
101
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
102
+ position: absolute;
103
+ bottom: -10px;
104
+ }
105
+
106
+ .wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:after {
107
+ bottom: 0;
108
+ opacity: 1;
109
+ }
110
+
111
+ .wpr-pointer-border-fx .wpr-pointer-item:before {
112
+ content: '';
113
+ display: block;
114
+ position: absolute;
115
+ top: 0;
116
+ right: 0;
117
+ bottom: 0;
118
+ left: 0;
119
+ z-index: 2;
120
+ opacity: 0;
121
+ border: 2px solid #000;
122
+ -webkit-transition: all 0.3s;
123
+ -o-transition: all 0.3s;
124
+ transition: all 0.3s;
125
+ }
126
+
127
+ .wpr-pointer-border-fx .wpr-pointer-item:hover:before {
128
+ opacity: 1;
129
+ }
130
+
131
+ .wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
132
+ .wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:before {
133
+ -webkit-transform: scale(0.9);
134
+ -ms-transform: scale(0.9);
135
+ transform: scale(0.9);
136
+ }
137
+
138
+ .wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before,
139
+ .wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before {
140
+ -webkit-transform: scale(1.1);
141
+ -ms-transform: scale(1.1);
142
+ transform: scale(1.1);
143
+ }
144
+
145
+ .wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
146
+ .wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
147
+ .wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
148
+ .wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
149
+ .wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:hover:before {
150
+ -webkit-transform: scale(1);
151
+ -ms-transform: scale(1);
152
+ transform: scale(1);
153
+ }
154
+
155
+ .wpr-pointer-background-fx .wpr-pointer-item:before {
156
+ content: '';
157
+ display: block;
158
+ position: absolute;
159
+ top: 0;
160
+ right: 0;
161
+ bottom: 0;
162
+ left: 0;
163
+ z-index: -1;
164
+ opacity: 0;
165
+ background: #000;
166
+ -webkit-transition: all 0.3s;
167
+ -o-transition: all 0.3s;
168
+ transition: all 0.3s;
169
+ }
170
+
171
+ .wpr-pointer-background-fx .wpr-pointer-item:hover:before {
172
+ opacity: 1;
173
+ }
174
+
175
+ .wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:before {
176
+ -webkit-transform: translateY(-12%);
177
+ -ms-transform: translateY(-12%);
178
+ transform: translateY(-12%);
179
+ }
180
+
181
+ .wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:before {
182
+ -webkit-transform: perspective(600px) rotateX(90deg);
183
+ transform: perspective(600px) rotateX(90deg);
184
+ -webkit-transform-origin: center bottom 0;
185
+ -ms-transform-origin: center bottom 0;
186
+ transform-origin: center bottom 0;
187
+ }
188
+
189
+ .wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:hover:before {
190
+ -webkit-transform: perspective(600px) rotateX(0deg);
191
+ transform: perspective(600px) rotateX(0deg);
192
  }
assets/css/lib/bricklayer/bricklayer.css CHANGED
@@ -1,49 +1,49 @@
1
- .bricklayer {
2
- display: -webkit-box;
3
- display: -webkit-flex;
4
- display: -ms-flexbox;
5
- display: flex;
6
- -webkit-box-align: start;
7
- -webkit-align-items: flex-start;
8
- -ms-flex-align: start;
9
- align-items: flex-start;
10
- -webkit-box-pack: center;
11
- -webkit-justify-content: center;
12
- -ms-flex-pack: center;
13
- justify-content: center;
14
- -webkit-flex-wrap: wrap;
15
- -ms-flex-wrap: wrap;
16
- flex-wrap: wrap;
17
- }
18
-
19
- .bricklayer-column-sizer {
20
- width: 100%;
21
- display: none;
22
- }
23
-
24
- @media screen and (min-width: 640px) {
25
- .bricklayer-column-sizer {
26
- width: 50%;
27
- }
28
- }
29
-
30
- @media screen and (min-width: 980px) {
31
- .bricklayer-column-sizer {
32
- width: 33.333%;
33
- }
34
- }
35
-
36
- @media screen and (min-width: 1200px) {
37
- .bricklayer-column-sizer {
38
- width: 25%;
39
- }
40
- }
41
-
42
- .bricklayer-column {
43
- -webkit-box-flex: 1;
44
- -webkit-flex: 1;
45
- -ms-flex: 1;
46
- flex: 1;
47
- padding-left: 5px;
48
- padding-right: 5px;
49
- }
1
+ .bricklayer {
2
+ display: -webkit-box;
3
+ display: -webkit-flex;
4
+ display: -ms-flexbox;
5
+ display: flex;
6
+ -webkit-box-align: start;
7
+ -webkit-align-items: flex-start;
8
+ -ms-flex-align: start;
9
+ align-items: flex-start;
10
+ -webkit-box-pack: center;
11
+ -webkit-justify-content: center;
12
+ -ms-flex-pack: center;
13
+ justify-content: center;
14
+ -webkit-flex-wrap: wrap;
15
+ -ms-flex-wrap: wrap;
16
+ flex-wrap: wrap;
17
+ }
18
+
19
+ .bricklayer-column-sizer {
20
+ width: 100%;
21
+ display: none;
22
+ }
23
+
24
+ @media screen and (min-width: 640px) {
25
+ .bricklayer-column-sizer {
26
+ width: 50%;
27
+ }
28
+ }
29
+
30
+ @media screen and (min-width: 980px) {
31
+ .bricklayer-column-sizer {
32
+ width: 33.333%;
33
+ }
34
+ }
35
+
36
+ @media screen and (min-width: 1200px) {
37
+ .bricklayer-column-sizer {
38
+ width: 25%;
39
+ }
40
+ }
41
+
42
+ .bricklayer-column {
43
+ -webkit-box-flex: 1;
44
+ -webkit-flex: 1;
45
+ -ms-flex: 1;
46
+ flex: 1;
47
+ padding-left: 5px;
48
+ padding-right: 5px;
49
+ }
assets/css/lib/lightgallery/fonts/lg.svg CHANGED
@@ -1,47 +1,47 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>
5
- <json>
6
- <![CDATA[
7
- {
8
- "fontFamily": "lg",
9
- "majorVersion": 1,
10
- "minorVersion": 0,
11
- "fontURL": "https://github.com/sachinchoolur/lightGallery",
12
- "copyright": "sachin",
13
- "license": "MLT",
14
- "licenseURL": "http://opensource.org/licenses/MIT",
15
- "version": "Version 1.0",
16
- "fontId": "lg",
17
- "psName": "lg",
18
- "subFamily": "Regular",
19
- "fullName": "lg",
20
- "description": "Font generated by IcoMoon."
21
- }
22
- ]]>
23
- </json>
24
- </metadata>
25
- <defs>
26
- <font id="lg" horiz-adv-x="1024">
27
- <font-face units-per-em="1024" ascent="960" descent="-64" />
28
- <missing-glyph horiz-adv-x="1024" />
29
- <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
30
- <glyph unicode="&#xe01a;" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
31
- <glyph unicode="&#xe01d;" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
32
- <glyph unicode="&#xe033;" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
33
- <glyph unicode="&#xe070;" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
34
- <glyph unicode="&#xe094;" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
35
- <glyph unicode="&#xe095;" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
36
- <glyph unicode="&#xe0f2;" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
37
- <glyph unicode="&#xe1ff;" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
38
- <glyph unicode="&#xe20c;" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
39
- <glyph unicode="&#xe20d;" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
40
- <glyph unicode="&#xe311;" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
41
- <glyph unicode="&#xe312;" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
42
- <glyph unicode="&#xe80d;" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
43
- <glyph unicode="&#xe901;" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
44
- <glyph unicode="&#xe902;" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
45
- <glyph unicode="&#xe903;" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
46
- <glyph unicode="&#xe904;" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
47
  </font></defs></svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ <json>
6
+ <![CDATA[
7
+ {
8
+ "fontFamily": "lg",
9
+ "majorVersion": 1,
10
+ "minorVersion": 0,
11
+ "fontURL": "https://github.com/sachinchoolur/lightGallery",
12
+ "copyright": "sachin",
13
+ "license": "MLT",
14
+ "licenseURL": "http://opensource.org/licenses/MIT",
15
+ "version": "Version 1.0",
16
+ "fontId": "lg",
17
+ "psName": "lg",
18
+ "subFamily": "Regular",
19
+ "fullName": "lg",
20
+ "description": "Font generated by IcoMoon."
21
+ }
22
+ ]]>
23
+ </json>
24
+ </metadata>
25
+ <defs>
26
+ <font id="lg" horiz-adv-x="1024">
27
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
28
+ <missing-glyph horiz-adv-x="1024" />
29
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
30
+ <glyph unicode="&#xe01a;" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
31
+ <glyph unicode="&#xe01d;" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
32
+ <glyph unicode="&#xe033;" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
33
+ <glyph unicode="&#xe070;" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
34
+ <glyph unicode="&#xe094;" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
35
+ <glyph unicode="&#xe095;" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
36
+ <glyph unicode="&#xe0f2;" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
37
+ <glyph unicode="&#xe1ff;" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
38
+ <glyph unicode="&#xe20c;" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
39
+ <glyph unicode="&#xe20d;" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
40
+ <glyph unicode="&#xe311;" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
41
+ <glyph unicode="&#xe312;" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
42
+ <glyph unicode="&#xe80d;" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
43
+ <glyph unicode="&#xe901;" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
44
+ <glyph unicode="&#xe902;" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
45
+ <glyph unicode="&#xe903;" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
46
+ <glyph unicode="&#xe904;" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
47
  </font></defs></svg>
assets/js/admin/lib/iconpicker/fontawesome-iconpicker.min.css CHANGED
@@ -1,8 +1,8 @@
1
- /*!
2
- * Font Awesome Icon Picker
3
- * https://farbelous.github.io/fontawesome-iconpicker/
4
- *
5
- * @author Javi Aguilar, itsjavi.com
6
- * @license MIT License
7
- * @see https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE
8
  */.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:234px;background:#f7f7f7;z-index:9}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightTop,.iconpicker-popover.popover.rightBottom{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomRightCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 12px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:12px;font-size:13px;line-height:15px;border-bottom:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:12px}.iconpicker-popover.popover .popover-content{padding:0px;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:12px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover .popover-footer:before,.iconpicker-popover .popover-footer:after{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:12px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.iconpicker-popover.popover.topLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightTop>.arrow,.iconpicker-popover.popover.rightBottom>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomRight>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.iconpicker-popover.popover.bottomLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;position:relative}.iconpicker:before,.iconpicker:after{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:12px 0 0 12px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:49px;max-height:246px}.iconpicker .iconpicker-items:before,.iconpicker .iconpicker-items:after{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:14px;height:14px;padding:12px;margin:0 12px 12px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:14px;box-shadow:0 0 0 1px #ddd;color:inherit}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;color:#fff;background:#000}.iconpicker-component{cursor:pointer}
1
+ /*!
2
+ * Font Awesome Icon Picker
3
+ * https://farbelous.github.io/fontawesome-iconpicker/
4
+ *
5
+ * @author Javi Aguilar, itsjavi.com
6
+ * @license MIT License
7
+ * @see https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE
8
  */.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:234px;background:#f7f7f7;z-index:9}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightTop,.iconpicker-popover.popover.rightBottom{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomRightCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 12px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:12px;font-size:13px;line-height:15px;border-bottom:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:12px}.iconpicker-popover.popover .popover-content{padding:0px;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:12px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover .popover-footer:before,.iconpicker-popover .popover-footer:after{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:12px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.iconpicker-popover.popover.topLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightTop>.arrow,.iconpicker-popover.popover.rightBottom>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomRight>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.iconpicker-popover.popover.bottomLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;position:relative}.iconpicker:before,.iconpicker:after{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:12px 0 0 12px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:49px;max-height:246px}.iconpicker .iconpicker-items:before,.iconpicker .iconpicker-items:after{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:14px;height:14px;padding:12px;margin:0 12px 12px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:14px;box-shadow:0 0 0 1px #ddd;color:inherit}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;color:#fff;background:#000}.iconpicker-component{cursor:pointer}
assets/js/admin/plugin-options.js CHANGED
@@ -1,754 +1,754 @@
1
- jQuery(document).ready(function( $ ) {
2
- "use strict";
3
-
4
- // Condition Selects
5
- var globalS = '.global-condition-select',
6
- archiveS = '.archives-condition-select',
7
- singleS = '.singles-condition-select',
8
- inputIDs = '.wpr-condition-input-ids';
9
-
10
- // Condition Popup
11
- var conditionPupup = $( '.wpr-condition-popup-wrap' );
12
-
13
- // Current Tab
14
- var currentTab = $('.nav-tab-active').attr( 'data-title' );
15
- currentTab = currentTab.trim().toLowerCase(),
16
- currentTab = currentTab.replace(' ', '_');
17
-
18
- /*
19
- ** Get Active Filter -------------------------
20
- */
21
- function getActiveFilter() {
22
- var type = currentTab.replace( /\W+/g, '-' ).toLowerCase();
23
- if ( $('.template-filters').length > 0 ) {
24
- type = $('.template-filters .active-filter').last().attr('data-class');
25
- type = type.substring( 0, type.length - 1);
26
- }
27
- return type;
28
- }
29
-
30
- /*
31
- ** Render User Template -------------------------
32
- */
33
- function renderUserTemplate( type, title, slug, id ) {
34
- var html = '';
35
-
36
- html += '<li>';
37
- html += '<h3 class="wpr-title">'+ title +'</h3>';
38
- html += '<div class="wpr-action-buttons">';
39
- html += '<span class="wpr-template-conditions button-primary" data-slug="'+ slug +'">Manage Conditions</span>';
40
- html += '<a href="post.php?post='+ id +'&action=elementor" class="wpr-edit-template button-primary">Edit Template</a>';
41
- html += '<span class="wpr-delete-template button-primary" data-slug="'+ slug +'" data-warning="Are you sure you want to delete this template?"><span class="dashicons dashicons-no-alt"></span></span>';
42
- html += '</div>';
43
- html += '</li>';
44
-
45
- // Render
46
- $( '.wpr-my-templates-list.wpr-'+ getActiveFilter() +'-templates-list' ).prepend( html );
47
-
48
- if ( $('.wpr-empty-templates-message').length ) {
49
- $('.wpr-empty-templates-message').remove();
50
- }
51
-
52
- // Run Functions
53
- changeTemplateConditions();
54
- deleteTemplate();
55
- }
56
-
57
- /*
58
- ** Create User Template -------------------------
59
- */
60
- function createUserTemplate() {
61
- // Get Template Library
62
- var library = 'my_templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
63
- // Get Template Title
64
- var title = $('.wpr-user-template-title').val();
65
-
66
- // Get Template Slug
67
- var slug = 'user-'+ getActiveFilter() +'-'+ title.replace( /\W+/g, '-' ).toLowerCase();
68
-
69
- if ( 'elementor_library' === library ) {
70
- slug = getActiveFilter() +'-'+ title.replace( /\W+/g, '-' ).toLowerCase();
71
- }
72
-
73
- // AJAX Data
74
- var data = {
75
- action: 'wpr_create_template',
76
- nonce: WprPluginOptions.nonce,
77
- user_template_library: library,
78
- user_template_title: title,
79
- user_template_slug: slug,
80
- user_template_type: getActiveFilter(),
81
- };
82
-
83
- // Create Template
84
- $.post(ajaxurl, data, function(response) {
85
- // Close Popup
86
- $('.wpr-user-template-popup-wrap').fadeOut();
87
-
88
- // Open Conditions
89
- setTimeout(function() {
90
- // Get Template ID
91
- var id = response.substring( 0, response.length - 1 );
92
-
93
- // Redirect User to Editor
94
- if ( 'my_templates' === currentTab.replace( /\W+/g, '-' ).toLowerCase() ) {
95
- window.location.href = 'post.php?post='+ id +'&action=elementor';
96
- return;
97
- }
98
-
99
- // Set Template Slug & ID
100
- $( '.wpr-save-conditions' ).attr( 'data-slug', slug ).attr( 'data-id', id );
101
-
102
- // Render Template
103
- renderUserTemplate( getActiveFilter(), $('.wpr-user-template-title').val(), slug, id );
104
-
105
- if ( $('.wpr-no-templates').length ) {
106
- $('.wpr-no-templates').hide();
107
- }
108
-
109
- // Open Popup
110
- openConditionsPopup( slug );
111
- conditionPupup.addClass( 'editor-redirect' );
112
- }, 500);
113
- });
114
- }
115
-
116
- // Open Popup
117
- $('.wpr-user-template').on( 'click', function() {
118
- if ( $(this).find('div').length ) {
119
- alert('Please Install/Activate WooCommerce!');
120
- return;
121
- }
122
-
123
- $('.wpr-user-template-title').val('');
124
- $('.wpr-user-template-popup-wrap').fadeIn();
125
- });
126
-
127
- // Close Popup
128
- $('.wpr-user-template-popup').find('.close-popup').on( 'click', function() {
129
- $('.wpr-user-template-popup-wrap').fadeOut();
130
- });
131
-
132
- // Create - Click
133
- $('.wpr-create-template').on( 'click', function() {
134
- if ( '' === $('.wpr-user-template-title').val() ) {
135
- $('.wpr-user-template-title').css('border-color', 'red');
136
- if ( $('.wpr-fill-out-the-title').length < 1 ) {
137
- $('.wpr-create-template').before('<p class="wpr-fill-out-the-title"><em>Please fill the Title field.</em></p>');
138
- $('.wpr-fill-out-the-title').css('margin-top', '4px');
139
- $('.wpr-fill-out-the-title em').css({'color': '#7f8b96', 'font-size': 'smaller'});
140
- }
141
- } else {
142
- $('.wpr-user-template-title').removeAttr('style');
143
- $('.wpr-create-template + p').remove();
144
-
145
- // Create Template
146
- createUserTemplate();
147
- }
148
- });
149
-
150
- // Create - Enter Key
151
- $('.wpr-user-template-title').keypress(function(e) {
152
- if ( e.which == 13 ) {
153
- e.preventDefault();
154
- createUserTemplate();
155
- }
156
- });
157
-
158
-
159
- /*
160
- ** Reset Template -------------------------
161
- */
162
- function deleteTemplate() {
163
- $( '.wpr-delete-template' ).on( 'click', function() {
164
-
165
- // Buttons
166
- var deleteButton = $(this);
167
-
168
- if ( ! confirm(deleteButton.data('warning')) ) {
169
- return;
170
- }
171
-
172
- // Get Template Library
173
- var library = 'my_templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
174
-
175
- // Get Template Slug
176
- var slug = deleteButton.attr('data-slug');
177
-
178
- var oneTimeNonce = deleteButton.attr('data-nonce');
179
-
180
- // AJAX Data
181
- var data = {
182
- nonce: oneTimeNonce,
183
- action: 'wpr_delete_template',
184
- template_slug: slug,
185
- template_library: library,
186
- };
187
-
188
- // Remove Template via AJAX
189
- $.post(ajaxurl, data, function(response) {
190
- deleteButton.closest('li').remove();
191
- });
192
-
193
- // Save Conditions
194
- $.post(ajaxurl, data, function(response) {
195
- setTimeout(function(){
196
- if ( $('.wpr-my-templates-list li').length === 0 ) {
197
- $('.wpr-my-templates-list').append('<li class="wpr-no-templates">You don\'t have any templates yet!</li>');
198
- // $('.wpr-no-templates').hide();
199
- }
200
- }, 500);
201
- });
202
-
203
- // Delete associated Conditions
204
- if ( 'my_templates' !== getActiveFilter() ) {
205
- var conditions = JSON.parse($( '#wpr_'+ currentTab +'_conditions' ).val());
206
- delete conditions[slug];
207
-
208
- // Set Conditions
209
- $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify(conditions) );
210
-
211
- // AJAX Data
212
- var data = {
213
- action: 'wpr_save_template_conditions'
214
- };
215
- data['wpr_'+ currentTab +'_conditions'] = JSON.stringify(conditions);
216
- }
217
- });
218
- }
219
-
220
- deleteTemplate();
221
-
222
- /*
223
- ** Condition Popup -------------------------
224
- */
225
- // Open Popup
226
- function changeTemplateConditions() {
227
- $( '.wpr-template-conditions' ).on( 'click', function() {
228
- var template = $(this).attr('data-slug');
229
-
230
- // Set Template Slug
231
- $( '.wpr-save-conditions' ).attr( 'data-slug', template );
232
-
233
- // Open Popup
234
- openConditionsPopup( template );
235
- });
236
- }
237
-
238
- changeTemplateConditions();
239
-
240
- // Close Popup
241
- conditionPupup.find('.close-popup').on( 'click', function() {
242
- conditionPupup.fadeOut();
243
- });
244
-
245
-
246
- /*
247
- ** Popup: Clone Conditions -------------------------
248
- */
249
- function popupCloneConditions() {
250
- // Clone
251
- $('.wpr-conditions-wrap').append( '<div class="wpr-conditions">'+ $('.wpr-conditions-sample').html() +'</div>' );
252
-
253
- // Add Tab Class
254
- // why removing and adding again ?
255
- $('.wpr-conditions').removeClass( 'wpr-tab-'+ currentTab ).addClass( 'wpr-tab-'+ currentTab );
256
- var clone = $('.wpr-conditions').last();
257
-
258
- // Reset Extra
259
- clone.find('select').not(':first-child').hide();
260
-
261
- // Entrance Animation
262
- clone.hide().fadeIn();
263
-
264
- // Hide Extra Options
265
- var currentFilter = $('.template-filters .active-filter').attr('data-class');
266
-
267
- if ( 'blog-posts' === currentFilter || 'custom-posts' === currentFilter ) {
268
- clone.find('.singles-condition-select').children(':nth-child(1),:nth-child(2),:nth-child(3)').remove();
269
- clone.find('.wpr-condition-input-ids').val('all').show();
270
- } else if ( 'woocommerce-products' === currentFilter ) {
271
- clone.find('.singles-condition-select').children().filter(function() {
272
- return 'product' !== $(this).val()
273
- }).remove();
274
- clone.find('.wpr-condition-input-ids').val('all').show();
275
- } else if ( '404-pages' === currentFilter ) {
276
- clone.find('.singles-condition-select').children().filter(function() {
277
- return 'page_404' !== $(this).val()
278
- }).remove();
279
- } else if ( 'blog-archives' === currentFilter || 'custom-archives' === currentFilter ) {
280
- clone.find('.archives-condition-select').children().filter(function() {
281
- return 'products' == $(this).val() || 'product_cat' == $(this).val() || 'product_tag' == $(this).val();
282
- }).remove();
283
- } else if ( 'woocommerce-archives' === currentFilter ) {
284
- clone.find('.archives-condition-select').children().filter(function() {
285
- return 'products' !== $(this).val() && 'product_cat' !== $(this).val() && 'product_tag' !== $(this).val();
286
- }).remove();
287
- }
288
- }
289
-
290
- /*
291
- ** Popup: Add Conditions -------------------------
292
- */
293
- function popupAddConditions() {
294
- $( '.wpr-add-conditions' ).on( 'click', function() {
295
- // Clone
296
- popupCloneConditions();
297
-
298
- // Reset
299
- $('.wpr-conditions').last().find('input').hide();//tmp -maybe remove
300
-
301
- // Show on Canvas
302
- if ( 'header' === currentTab || 'footer' === currentTab ) {
303
- $('.wpr-canvas-condition').show();
304
- }
305
-
306
- // Run Functions
307
- popupDeleteConditions();
308
- popupMainConditionSelect();
309
- popupSubConditionSelect();
310
- });
311
- }
312
-
313
- popupAddConditions();
314
-
315
- /*
316
- ** Popup: Set Conditions -------------------------
317
- */
318
- function popupSetConditions( template ) {
319
- var conditions = $( '#wpr_'+ currentTab +'_conditions' ).val();
320
- conditions = '' !== conditions ? JSON.parse(conditions) : {};
321
- // Reset
322
- $('.wpr-conditions').remove();
323
-
324
- // Setup Conditions
325
- if ( conditions[template] != undefined && conditions[template].length > 0 ) {
326
- // Clone
327
- for (var i = 0; i < conditions[template].length; i++) {
328
- popupCloneConditions();
329
- $( '.wpr-conditions' ).find('select').hide();
330
- }
331
-
332
- // Set
333
- if ( $('.wpr-conditions').length ) {
334
- $('.wpr-conditions').each( function( index ) {
335
- var path = conditions[template][index].split( '/' );
336
-
337
- for (var s = 0; s < path.length; s++) {
338
- if ( s === 0 ) {
339
- $(this).find(globalS).val(path[s]).trigger('change');
340
- $(this).find('.'+ path[s] +'s-condition-select').show();
341
- } else if ( s === 1 ) {
342
- path[s-1] = 'product_archive' === path[s-1] ? 'archive' : path[s-1];
343
- $(this).find('.'+ path[s-1] +'s-condition-select').val(path[s]).trigger('change');
344
- } else if ( s === 2 ) {
345
- $(this).find(inputIDs).val(path[s]).trigger('keyup').show();
346
- }
347
- }
348
- });
349
- }
350
- }
351
-
352
- // Set Show on Canvas Switcher value
353
- var conditionsBtn = $('.wpr-template-conditions[data-slug='+ template +']');
354
-
355
- if ( 'true' === conditionsBtn.attr('data-show-on-canvas') ) {
356
- $('.wpr-canvas-condition').find('input[type=checkbox]').attr('checked', 'checked');
357
- } else {
358
- $('.wpr-canvas-condition').find('input[type=checkbox]').removeAttr('checked');
359
- }
360
- }
361
-
362
-
363
- /*
364
- ** Popup: Open -------------------------
365
- */
366
- function openConditionsPopup( template ) {
367
-
368
- // Set Conditions
369
- popupSetConditions(template);
370
- popupMainConditionSelect();
371
- popupSubConditionSelect();
372
- showOnCanvasSwitcher();
373
- popupDeleteConditions();
374
-
375
- // Conditions Wrap
376
- var conditionsWrap = $( '.wpr-conditions' );
377
-
378
- // Reset Canvas Option
379
- $('.wpr-canvas-condition').hide();
380
-
381
- // Show Conditions
382
- if ( 'single' === currentTab || 'product_single' === currentTab ) {
383
- conditionsWrap.find(singleS).show();
384
- } else if ( 'archive' === currentTab || 'product_archive' === currentTab ) {
385
- conditionsWrap.find(archiveS).show();
386
- } else {
387
- conditionsWrap.find(globalS).show();
388
-
389
- // Show Canvas Option
390
- if ( $('.wpr-conditions').length ) {
391
- $('.wpr-canvas-condition').show();
392
- }
393
- }
394
-
395
- // Add Current Filter Class
396
- $('.wpr-conditions-wrap').addClass( $('.template-filters .active-filter').attr('data-class') );
397
-
398
- // Open Popup
399
- conditionPupup.fadeIn();
400
- }
401
-
402
-
403
- /*
404
- ** Popup: Delete Conditions -------------------------------
405
- */
406
- function popupDeleteConditions() {
407
- $( '.wpr-delete-template-conditions' ).on( 'click', function() {
408
- var current = $(this).parent(),
409
- conditions = $( '#wpr_'+ currentTab +'_conditions' ).val();
410
- conditions = '' !== conditions ? JSON.parse(conditions) : {};
411
-
412
- // Update Conditions
413
- $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify( removeConditions( conditions, getConditionsPath(current) ) ) );
414
-
415
- // Remove Conditions
416
- current.fadeOut( 500, function() {
417
- $(this).remove();
418
-
419
- // Show on Canvas
420
- if ( 0 === $('.wpr-conditions').length ) {
421
- $('.wpr-canvas-condition').hide();
422
- }
423
- });
424
-
425
- });
426
- }
427
-
428
-
429
- /*
430
- ** Popup: Condition Selection -------
431
- */
432
- // General Condition Select
433
- function popupMainConditionSelect() {
434
- $(globalS).on( 'change', function() {
435
- var current = $(this).parent();
436
-
437
- // Reset
438
- current.find(archiveS).hide();
439
- current.find(singleS).hide();
440
- current.find(inputIDs).hide();
441
-
442
- // Show
443
- current.find( '.'+ $(this).val() +'s-condition-select' ).show();
444
-
445
- });
446
- }
447
-
448
- // Sub Condition Select
449
- function popupSubConditionSelect() {
450
- $('.archives-condition-select, .singles-condition-select').on( 'change', function() {
451
- var current = $(this).parent(),
452
- selected = $( 'option:selected', this );
453
-
454
- // Show Custom ID input
455
- if ( selected.hasClass('custom-ids') || selected.hasClass('custom-type-ids') ) {
456
- current.find(inputIDs).val('all').trigger('keyup').show();
457
- } else {
458
- current.find(inputIDs).hide();
459
- }
460
- });
461
- }
462
-
463
- // Show on Canvas Switcher
464
- function showOnCanvasSwitcher() {
465
- $('.wpr-canvas-condition input[type=checkbox]').on('change', function() {
466
- $('.wpr-template-conditions[data-slug='+ $('.wpr-save-conditions').attr('data-slug') +']').attr('data-show-on-canvas', $(this).prop('checked'));
467
- });
468
- }
469
-
470
-
471
- /*
472
- ** Remove Conditions --------------------------
473
- */
474
- function removeConditions( conditions, path ) {
475
- var data = [];
476
-
477
- // Get Templates
478
- $('.wpr-template-conditions').each(function() {
479
- data.push($(this).attr('data-slug'))
480
- });
481
-
482
- // Loop
483
- for ( var key in conditions ) {
484
- if ( conditions.hasOwnProperty(key) ) {
485
- // Remove Duplicate
486
- for (var i = 0; i < conditions[key].length; i++) {
487
- if ( path == conditions[key][i] ) {
488
- if ( 'popup' !== getActiveFilter() ) {
489
- conditions[key].splice(i, 1);
490
- }
491
- }
492
- };
493
-
494
- // Clear Database
495
- if ( data.indexOf(key) === -1 ) {
496
- delete conditions[key];
497
- }
498
- }
499
- }
500
-
501
- return conditions;
502
- }
503
-
504
- /*
505
- ** Get Conditions Path -------------------------
506
- */
507
- function getConditionsPath( current ) {
508
- var path = '';
509
-
510
- // Selects
511
- var global = 'none' !== current.find(globalS).css('display') ? current.find(globalS).val() : currentTab,
512
- archive = current.find(archiveS).val(),
513
- single = current.find(singleS).val(),
514
- customIds = current.find(inputIDs);
515
-
516
- if ( 'archive' === global || 'product_archive' === global ) {
517
- if ( 'none' !== customIds.css('display') ) {
518
- path = global +'/'+ archive +'/'+ customIds.val();
519
- } else {
520
- path = global +'/'+ archive;
521
- }
522
- } else if ( 'single' === global || 'product_single' === global ) {
523
- if ( 'none' !== customIds.css('display') ) {
524
- path = global +'/'+ single +'/'+ customIds.val();
525
- } else {
526
- path = global +'/'+ single;
527
- }
528
- } else {
529
- path = 'global';
530
- }
531
-
532
- return path;
533
- }
534
-
535
-
536
- /*
537
- ** Get Conditions -------------------------
538
- */
539
- function getConditions( template, conditions ) {
540
- // Conditions
541
- conditions = ('' === conditions || '[]' === conditions) ? {} : JSON.parse(conditions);
542
- conditions[template] = [];
543
-
544
- $('.wpr-conditions').each( function() {
545
- var path = getConditionsPath( $(this) );
546
-
547
- // Remove Duplicates
548
- conditions = removeConditions( conditions, path );
549
-
550
- // Add New Values
551
- conditions[template].push( path );
552
- });
553
-
554
- return conditions;
555
- }
556
-
557
-
558
- /*
559
- ** Save Conditions -------------------------
560
- */
561
- function saveConditions() {
562
- $( '.wpr-save-conditions' ).on( 'click', function() {
563
- var proActive = (1 === $('.wpr-my-templates-list').data('pro')) ? true : false;
564
-
565
- // Current Template
566
- var template = $(this).attr('data-slug'),
567
- TemplateID = $(this).attr('data-id');
568
-
569
- // Get Conditions
570
- var conditions = getConditions( template, $( '#wpr_'+ currentTab +'_conditions' ).val() );
571
-
572
- // Don't save if not active
573
- if ( !proActive && ('header' === currentTab || 'footer' == currentTab || 'product_archive' == currentTab) ) {
574
- if ( 'header' === currentTab || 'footer' == currentTab ) {
575
- if ( ('global' !== conditions[template][0] && 'undefined' !== typeof conditions[template][0]) || conditions[template].length > 1 ) {
576
- alert('Please select "Entire Site" to continue! Mutiple and custom conditions are fully supported in the Pro version.');
577
- return;
578
- }
579
- } else if ( 'product_archive' == currentTab ) {
580
- console.log(conditions[template][0]);
581
- if ( ('product_archive/products' !== conditions[template][0] && 'undefined' !== typeof conditions[template][0]) || conditions[template].length > 1 ) {
582
- alert('Please select "Entire Site" to continue! Mutiple and custom conditions are fully supported in the Pro version.');
583
- return;
584
- }
585
- }
586
- }
587
-
588
- // Set Conditions
589
- $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify(conditions) );
590
-
591
- // AJAX Data
592
- var data = {
593
- action: 'wpr_save_template_conditions',
594
- template: template
595
- };
596
- data['wpr_'+ currentTab +'_conditions'] = JSON.stringify(conditions);
597
-
598
- if ( $('#wpr-show-on-canvas').length ) {
599
- data['wpr_'+ currentTab +'_show_on_canvas'] = $('#wpr-show-on-canvas').prop('checked');
600
- }
601
-
602
- // Save Conditions
603
- $.post(ajaxurl, data, function(response) {
604
- // Close Popup
605
- conditionPupup.fadeOut();
606
-
607
- // Set Active Class
608
- for ( var key in conditions ) {
609
- if ( conditions[key] && 0 !== conditions[key].length ) {
610
- $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').addClass('wpr-active-conditions-template');
611
- } else {
612
- $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').removeClass('wpr-active-conditions-template');
613
- }
614
- }
615
-
616
- // Redirect User to Editor
617
- if ( conditionPupup.hasClass('editor-redirect') ) {
618
- window.location.href = 'post.php?post='+ TemplateID +'&action=elementor';
619
- }
620
- });
621
- });
622
- }
623
-
624
- saveConditions();
625
-
626
-
627
- /*
628
- ** Highlight Templates with Active Conditions --------
629
- */
630
- if ( $('body').hasClass('royal-addons_page_wpr-theme-builder') || $('body').hasClass('royal-addons_page_wpr-popups') ) {
631
- if ( 'my_templates' !== currentTab ) {
632
- var conditions = $( '#wpr_'+ currentTab +'_conditions' ).val(),
633
- conditions = ('' === conditions || '[]' === conditions) ? {} : JSON.parse(conditions);
634
-
635
- for ( var key in conditions ) {
636
- $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').addClass('wpr-active-conditions-template');
637
- }
638
- }
639
- }
640
-
641
-
642
- /*
643
- ** Elements Toggle -------------------------
644
- */
645
- $('.wpr-elements-toggle').find('input').on( 'change', function() {
646
- if ( $(this).is(':checked') ) {
647
- $('.wpr-element').find('input').prop( 'checked', true );
648
- } else {
649
- $('.wpr-element').find('input').prop( 'checked', false );
650
- }
651
- });
652
-
653
-
654
- /*
655
- ** Filters -------------------------
656
- */
657
- $( '.template-filters ul li span' ).on( 'click', function() {
658
- var filter = $(this).parent();
659
-
660
- // Deny
661
- if ( 'back' === filter.data('role') ) return;
662
-
663
- // Reset
664
- filter.parent().find('li').removeClass('active-filter');
665
- $(this).closest('.templates-grid').find('.column-3-wrap').hide();
666
-
667
- // Active Class
668
- filter.addClass('active-filter');
669
- $(this).closest('.templates-grid').find('.column-3-wrap.'+ filter.data('class')).fadeIn();
670
- });
671
-
672
- // Sub Filters
673
- $( '.template-filters ul li span' ).on( 'click', function() {
674
- var filter = $(this).parent(),
675
- role = filter.data('role');
676
-
677
- if ( 'parent' === role ) {
678
- filter.siblings().hide();
679
- filter.children('span').hide();
680
- filter.find('.sub-filters').show();
681
- } else if ( 'back' === role ) {
682
- filter.closest('ul').parent().siblings().show();
683
- filter.closest('ul').parent().children('span').show();
684
- filter.closest('ul').parent().find('.sub-filters').hide();
685
- }
686
- });
687
-
688
-
689
- /*
690
- ** Settings Tab -------------------------
691
- */
692
-
693
- // Lightbox Settings
694
- jQuery(document).ready(function($){
695
- $('#wpr_lb_bg_color').wpColorPicker();
696
- $('#wpr_lb_toolbar_color').wpColorPicker();
697
- $('#wpr_lb_caption_color').wpColorPicker();
698
- $('#wpr_lb_gallery_color').wpColorPicker();
699
- $('#wpr_lb_pb_color').wpColorPicker();
700
- $('#wpr_lb_ui_color').wpColorPicker();
701
- $('#wpr_lb_ui_hr_color').wpColorPicker();
702
- $('#wpr_lb_text_color').wpColorPicker();
703
-
704
- // Fix Color Picker
705
- if ( $('.wpr-settings').length ) {
706
- $('.wpr-settings').find('.wp-color-result-text').text('Select Color');
707
- $('.wpr-settings').find('.wp-picker-clear').val('Clear');
708
- }
709
- });
710
-
711
-
712
- /*
713
- ** Image Upload Option -------------------------
714
- */
715
- $('body').on( 'click', '.wpr-setting-custom-img-upload button', function(e){
716
- e.preventDefault();
717
-
718
- var button = $(this);
719
-
720
- if ( ! button.find('img').length ) {
721
- var custom_uploader = wp.media({
722
- title: 'Insert image',
723
- library : {
724
- uploadedTo : wp.media.view.settings.post.id, // attach to the current post?
725
- type : 'image'
726
- },
727
- button: {
728
- text: 'Use this image' // button label text
729
- },
730
- multiple: false
731
- }).on('select', function() {
732
- var attachment = custom_uploader.state().get('selection').first().toJSON();
733
-
734
- button.find('i').remove();
735
- button.prepend('<img src="' + attachment.url + '">');
736
- button.find('span').text('Remove Image');
737
-
738
- $('#wpr_wl_plugin_logo').val(attachment.id);
739
- }).open();
740
- } else {
741
- button.find('img').remove();
742
- button.prepend('<i class="dashicons dashicons-cloud-upload"></i>');
743
- button.find('span').text('Upload Image');
744
-
745
- $('#wpr_wl_plugin_logo').val('');
746
- }
747
-
748
- });
749
-
750
-
751
- //TODO: Remove this - only for development
752
- // $('.nav-tab-wrapper').after( '<p>'+ $('.nav-tab-wrapper').next('input').val() +'</p>' );
753
-
754
  }); // end dom ready
1
+ jQuery(document).ready(function( $ ) {
2
+ "use strict";
3
+
4
+ // Condition Selects
5
+ var globalS = '.global-condition-select',
6
+ archiveS = '.archives-condition-select',
7
+ singleS = '.singles-condition-select',
8
+ inputIDs = '.wpr-condition-input-ids';
9
+
10
+ // Condition Popup
11
+ var conditionPupup = $( '.wpr-condition-popup-wrap' );
12
+
13
+ // Current Tab
14
+ var currentTab = $('.nav-tab-active').attr( 'data-title' );
15
+ currentTab = currentTab.trim().toLowerCase(),
16
+ currentTab = currentTab.replace(' ', '_');
17
+
18
+ /*
19
+ ** Get Active Filter -------------------------
20
+ */
21
+ function getActiveFilter() {
22
+ var type = currentTab.replace( /\W+/g, '-' ).toLowerCase();
23
+ if ( $('.template-filters').length > 0 ) {
24
+ type = $('.template-filters .active-filter').last().attr('data-class');
25
+ type = type.substring( 0, type.length - 1);
26
+ }
27
+ return type;
28
+ }
29
+
30
+ /*
31
+ ** Render User Template -------------------------
32
+ */
33
+ function renderUserTemplate( type, title, slug, id ) {
34
+ var html = '';
35
+
36
+ html += '<li>';
37
+ html += '<h3 class="wpr-title">'+ title +'</h3>';
38
+ html += '<div class="wpr-action-buttons">';
39
+ html += '<span class="wpr-template-conditions button-primary" data-slug="'+ slug +'">Manage Conditions</span>';
40
+ html += '<a href="post.php?post='+ id +'&action=elementor" class="wpr-edit-template button-primary">Edit Template</a>';
41
+ html += '<span class="wpr-delete-template button-primary" data-slug="'+ slug +'" data-warning="Are you sure you want to delete this template?"><span class="dashicons dashicons-no-alt"></span></span>';
42
+ html += '</div>';
43
+ html += '</li>';
44
+
45
+ // Render
46
+ $( '.wpr-my-templates-list.wpr-'+ getActiveFilter() +'-templates-list' ).prepend( html );
47
+
48
+ if ( $('.wpr-empty-templates-message').length ) {
49
+ $('.wpr-empty-templates-message').remove();
50
+ }
51
+
52
+ // Run Functions
53
+ changeTemplateConditions();
54
+ deleteTemplate();
55
+ }
56
+
57
+ /*
58
+ ** Create User Template -------------------------
59
+ */
60
+ function createUserTemplate() {
61
+ // Get Template Library
62
+ var library = 'my_templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
63
+ // Get Template Title
64
+ var title = $('.wpr-user-template-title').val();
65
+
66
+ // Get Template Slug
67
+ var slug = 'user-'+ getActiveFilter() +'-'+ title.replace( /\W+/g, '-' ).toLowerCase();
68
+
69
+ if ( 'elementor_library' === library ) {
70
+ slug = getActiveFilter() +'-'+ title.replace( /\W+/g, '-' ).toLowerCase();
71
+ }
72
+
73
+ // AJAX Data
74
+ var data = {
75
+ action: 'wpr_create_template',
76
+ nonce: WprPluginOptions.nonce,
77
+ user_template_library: library,
78
+ user_template_title: title,
79
+ user_template_slug: slug,
80
+ user_template_type: getActiveFilter(),
81
+ };
82
+
83
+ // Create Template
84
+ $.post(ajaxurl, data, function(response) {
85
+ // Close Popup
86
+ $('.wpr-user-template-popup-wrap').fadeOut();
87
+
88
+ // Open Conditions
89
+ setTimeout(function() {
90
+ // Get Template ID
91
+ var id = response.substring( 0, response.length - 1 );
92
+
93
+ // Redirect User to Editor
94
+ if ( 'my_templates' === currentTab.replace( /\W+/g, '-' ).toLowerCase() ) {
95
+ window.location.href = 'post.php?post='+ id +'&action=elementor';
96
+ return;
97
+ }
98
+
99
+ // Set Template Slug & ID
100
+ $( '.wpr-save-conditions' ).attr( 'data-slug', slug ).attr( 'data-id', id );
101
+
102
+ // Render Template
103
+ renderUserTemplate( getActiveFilter(), $('.wpr-user-template-title').val(), slug, id );
104
+
105
+ if ( $('.wpr-no-templates').length ) {
106
+ $('.wpr-no-templates').hide();
107
+ }
108
+
109
+ // Open Popup
110
+ openConditionsPopup( slug );
111
+ conditionPupup.addClass( 'editor-redirect' );
112
+ }, 500);
113
+ });
114
+ }
115
+
116
+ // Open Popup
117
+ $('.wpr-user-template').on( 'click', function() {
118
+ if ( $(this).find('div').length ) {
119
+ alert('Please Install/Activate WooCommerce!');
120
+ return;
121
+ }
122
+
123
+ $('.wpr-user-template-title').val('');
124
+ $('.wpr-user-template-popup-wrap').fadeIn();
125
+ });
126
+
127
+ // Close Popup
128
+ $('.wpr-user-template-popup').find('.close-popup').on( 'click', function() {
129
+ $('.wpr-user-template-popup-wrap').fadeOut();
130
+ });
131
+
132
+ // Create - Click
133
+ $('.wpr-create-template').on( 'click', function() {
134
+ if ( '' === $('.wpr-user-template-title').val() ) {
135
+ $('.wpr-user-template-title').css('border-color', 'red');
136
+ if ( $('.wpr-fill-out-the-title').length < 1 ) {
137
+ $('.wpr-create-template').before('<p class="wpr-fill-out-the-title"><em>Please fill the Title field.</em></p>');
138
+ $('.wpr-fill-out-the-title').css('margin-top', '4px');
139
+ $('.wpr-fill-out-the-title em').css({'color': '#7f8b96', 'font-size': 'smaller'});
140
+ }
141
+ } else {
142
+ $('.wpr-user-template-title').removeAttr('style');
143
+ $('.wpr-create-template + p').remove();
144
+
145
+ // Create Template
146
+ createUserTemplate();
147
+ }
148
+ });
149
+
150
+ // Create - Enter Key
151
+ $('.wpr-user-template-title').keypress(function(e) {
152
+ if ( e.which == 13 ) {
153
+ e.preventDefault();
154
+ createUserTemplate();
155
+ }
156
+ });
157
+
158
+
159
+ /*
160
+ ** Reset Template -------------------------
161
+ */
162
+ function deleteTemplate() {
163
+ $( '.wpr-delete-template' ).on( 'click', function() {
164
+
165
+ // Buttons
166
+ var deleteButton = $(this);
167
+
168
+ if ( ! confirm(deleteButton.data('warning')) ) {
169
+ return;
170
+ }
171
+
172
+ // Get Template Library
173
+ var library = 'my_templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
174
+
175
+ // Get Template Slug
176
+ var slug = deleteButton.attr('data-slug');
177
+
178
+ var oneTimeNonce = deleteButton.attr('data-nonce');
179
+
180
+ // AJAX Data
181
+ var data = {
182
+ nonce: oneTimeNonce,
183
+ action: 'wpr_delete_template',
184
+ template_slug: slug,
185
+ template_library: library,
186
+ };
187
+
188
+ // Remove Template via AJAX
189
+ $.post(ajaxurl, data, function(response) {
190
+ deleteButton.closest('li').remove();
191
+ });
192
+
193
+ // Save Conditions
194
+ $.post(ajaxurl, data, function(response) {
195
+ setTimeout(function(){
196
+ if ( $('.wpr-my-templates-list li').length === 0 ) {
197
+ $('.wpr-my-templates-list').append('<li class="wpr-no-templates">You don\'t have any templates yet!</li>');
198
+ // $('.wpr-no-templates').hide();
199
+ }
200
+ }, 500);
201
+ });
202
+
203
+ // Delete associated Conditions
204
+ if ( 'my_templates' !== getActiveFilter() ) {
205
+ var conditions = JSON.parse($( '#wpr_'+ currentTab +'_conditions' ).val());
206
+ delete conditions[slug];
207
+
208
+ // Set Conditions
209
+ $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify(conditions) );
210
+
211
+ // AJAX Data
212
+ var data = {
213
+ action: 'wpr_save_template_conditions'
214
+ };
215
+ data['wpr_'+ currentTab +'_conditions'] = JSON.stringify(conditions);
216
+ }
217
+ });
218
+ }
219
+
220
+ deleteTemplate();
221
+
222
+ /*
223
+ ** Condition Popup -------------------------
224
+ */
225
+ // Open Popup
226
+ function changeTemplateConditions() {
227
+ $( '.wpr-template-conditions' ).on( 'click', function() {
228
+ var template = $(this).attr('data-slug');
229
+
230
+ // Set Template Slug
231
+ $( '.wpr-save-conditions' ).attr( 'data-slug', template );
232
+
233
+ // Open Popup
234
+ openConditionsPopup( template );
235
+ });
236
+ }
237
+
238
+ changeTemplateConditions();
239
+
240
+ // Close Popup
241
+ conditionPupup.find('.close-popup').on( 'click', function() {
242
+ conditionPupup.fadeOut();
243
+ });
244
+
245
+
246
+ /*
247
+ ** Popup: Clone Conditions -------------------------
248
+ */
249
+ function popupCloneConditions() {
250
+ // Clone
251
+ $('.wpr-conditions-wrap').append( '<div class="wpr-conditions">'+ $('.wpr-conditions-sample').html() +'</div>' );
252
+
253
+ // Add Tab Class
254
+ // why removing and adding again ?
255
+ $('.wpr-conditions').removeClass( 'wpr-tab-'+ currentTab ).addClass( 'wpr-tab-'+ currentTab );
256
+ var clone = $('.wpr-conditions').last();
257
+
258
+ // Reset Extra
259
+ clone.find('select').not(':first-child').hide();
260
+
261
+ // Entrance Animation
262
+ clone.hide().fadeIn();
263
+
264
+ // Hide Extra Options
265
+ var currentFilter = $('.template-filters .active-filter').attr('data-class');
266
+
267
+ if ( 'blog-posts' === currentFilter || 'custom-posts' === currentFilter ) {
268
+ clone.find('.singles-condition-select').children(':nth-child(1),:nth-child(2),:nth-child(3)').remove();
269
+ clone.find('.wpr-condition-input-ids').val('all').show();
270
+ } else if ( 'woocommerce-products' === currentFilter ) {
271
+ clone.find('.singles-condition-select').children().filter(function() {
272
+ return 'product' !== $(this).val()
273
+ }).remove();
274
+ clone.find('.wpr-condition-input-ids').val('all').show();
275
+ } else if ( '404-pages' === currentFilter ) {
276
+ clone.find('.singles-condition-select').children().filter(function() {
277
+ return 'page_404' !== $(this).val()
278
+ }).remove();
279
+ } else if ( 'blog-archives' === currentFilter || 'custom-archives' === currentFilter ) {
280
+ clone.find('.archives-condition-select').children().filter(function() {
281
+ return 'products' == $(this).val() || 'product_cat' == $(this).val() || 'product_tag' == $(this).val();
282
+ }).remove();
283
+ } else if ( 'woocommerce-archives' === currentFilter ) {
284
+ clone.find('.archives-condition-select').children().filter(function() {
285
+ return 'products' !== $(this).val() && 'product_cat' !== $(this).val() && 'product_tag' !== $(this).val();
286
+ }).remove();
287
+ }
288
+ }
289
+
290
+ /*
291
+ ** Popup: Add Conditions -------------------------
292
+ */
293
+ function popupAddConditions() {
294
+ $( '.wpr-add-conditions' ).on( 'click', function() {
295
+ // Clone
296
+ popupCloneConditions();
297
+
298
+ // Reset
299
+ $('.wpr-conditions').last().find('input').hide();//tmp -maybe remove
300
+
301
+ // Show on Canvas
302
+ if ( 'header' === currentTab || 'footer' === currentTab ) {
303
+ $('.wpr-canvas-condition').show();
304
+ }
305
+
306
+ // Run Functions
307
+ popupDeleteConditions();
308
+ popupMainConditionSelect();
309
+ popupSubConditionSelect();
310
+ });
311
+ }
312
+
313
+ popupAddConditions();
314
+
315
+ /*
316
+ ** Popup: Set Conditions -------------------------
317
+ */
318
+ function popupSetConditions( template ) {
319
+ var conditions = $( '#wpr_'+ currentTab +'_conditions' ).val();
320
+ conditions = '' !== conditions ? JSON.parse(conditions) : {};
321
+ // Reset
322
+ $('.wpr-conditions').remove();
323
+
324
+ // Setup Conditions
325
+ if ( conditions[template] != undefined && conditions[template].length > 0 ) {
326
+ // Clone
327
+ for (var i = 0; i < conditions[template].length; i++) {
328
+ popupCloneConditions();
329
+ $( '.wpr-conditions' ).find('select').hide();
330
+ }
331
+
332
+ // Set
333
+ if ( $('.wpr-conditions').length ) {
334
+ $('.wpr-conditions').each( function( index ) {
335
+ var path = conditions[template][index].split( '/' );
336
+
337
+ for (var s = 0; s < path.length; s++) {
338
+ if ( s === 0 ) {
339
+ $(this).find(globalS).val(path[s]).trigger('change');
340
+ $(this).find('.'+ path[s] +'s-condition-select').show();
341
+ } else if ( s === 1 ) {
342
+ path[s-1] = 'product_archive' === path[s-1] ? 'archive' : path[s-1];
343
+ $(this).find('.'+ path[s-1] +'s-condition-select').val(path[s]).trigger('change');
344
+ } else if ( s === 2 ) {
345
+ $(this).find(inputIDs).val(path[s]).trigger('keyup').show();
346
+ }
347
+ }
348
+ });
349
+ }
350
+ }
351
+
352
+ // Set Show on Canvas Switcher value
353
+ var conditionsBtn = $('.wpr-template-conditions[data-slug='+ template +']');
354
+
355
+ if ( 'true' === conditionsBtn.attr('data-show-on-canvas') ) {
356
+ $('.wpr-canvas-condition').find('input[type=checkbox]').attr('checked', 'checked');
357
+ } else {
358
+ $('.wpr-canvas-condition').find('input[type=checkbox]').removeAttr('checked');
359
+ }
360
+ }
361
+
362
+
363
+ /*
364
+ ** Popup: Open -------------------------
365
+ */
366
+ function openConditionsPopup( template ) {
367
+
368
+ // Set Conditions
369
+ popupSetConditions(template);
370
+ popupMainConditionSelect();
371
+ popupSubConditionSelect();
372
+ showOnCanvasSwitcher();
373
+ popupDeleteConditions();
374
+
375
+ // Conditions Wrap
376
+ var conditionsWrap = $( '.wpr-conditions' );
377
+
378
+ // Reset Canvas Option
379
+ $('.wpr-canvas-condition').hide();
380
+
381
+ // Show Conditions
382
+ if ( 'single' === currentTab || 'product_single' === currentTab ) {
383
+ conditionsWrap.find(singleS).show();
384
+ } else if ( 'archive' === currentTab || 'product_archive' === currentTab ) {
385
+ conditionsWrap.find(archiveS).show();
386
+ } else {
387
+ conditionsWrap.find(globalS).show();
388
+
389
+ // Show Canvas Option
390
+ if ( $('.wpr-conditions').length ) {
391
+ $('.wpr-canvas-condition').show();
392
+ }
393
+ }
394
+
395
+ // Add Current Filter Class
396
+ $('.wpr-conditions-wrap').addClass( $('.template-filters .active-filter').attr('data-class') );
397
+
398
+ // Open Popup
399
+ conditionPupup.fadeIn();
400
+ }
401
+
402
+
403
+ /*
404
+ ** Popup: Delete Conditions -------------------------------
405
+ */
406
+ function popupDeleteConditions() {
407
+ $( '.wpr-delete-template-conditions' ).on( 'click', function() {
408
+ var current = $(this).parent(),
409
+ conditions = $( '#wpr_'+ currentTab +'_conditions' ).val();
410
+ conditions = '' !== conditions ? JSON.parse(conditions) : {};
411
+
412
+ // Update Conditions
413
+ $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify( removeConditions( conditions, getConditionsPath(current) ) ) );
414
+
415
+ // Remove Conditions
416
+ current.fadeOut( 500, function() {
417
+ $(this).remove();
418
+
419
+ // Show on Canvas
420
+ if ( 0 === $('.wpr-conditions').length ) {
421
+ $('.wpr-canvas-condition').hide();
422
+ }
423
+ });
424
+
425
+ });
426
+ }
427
+
428
+
429
+ /*
430
+ ** Popup: Condition Selection -------
431
+ */
432
+ // General Condition Select
433
+ function popupMainConditionSelect() {
434
+ $(globalS).on( 'change', function() {
435
+ var current = $(this).parent();
436
+
437
+ // Reset
438
+ current.find(archiveS).hide();
439
+ current.find(singleS).hide();
440
+ current.find(inputIDs).hide();
441
+
442
+ // Show
443
+ current.find( '.'+ $(this).val() +'s-condition-select' ).show();
444
+
445
+ });
446
+ }
447
+
448
+ // Sub Condition Select
449
+ function popupSubConditionSelect() {
450
+ $('.archives-condition-select, .singles-condition-select').on( 'change', function() {
451
+ var current = $(this).parent(),
452
+ selected = $( 'option:selected', this );
453
+
454
+ // Show Custom ID input
455
+ if ( selected.hasClass('custom-ids') || selected.hasClass('custom-type-ids') ) {
456
+ current.find(inputIDs).val('all').trigger('keyup').show();
457
+ } else {
458
+ current.find(inputIDs).hide();
459
+ }
460
+ });
461
+ }
462
+
463
+ // Show on Canvas Switcher
464
+ function showOnCanvasSwitcher() {
465
+ $('.wpr-canvas-condition input[type=checkbox]').on('change', function() {
466
+ $('.wpr-template-conditions[data-slug='+ $('.wpr-save-conditions').attr('data-slug') +']').attr('data-show-on-canvas', $(this).prop('checked'));
467
+ });
468
+ }
469
+
470
+
471
+ /*
472
+ ** Remove Conditions --------------------------
473
+ */
474
+ function removeConditions( conditions, path ) {
475
+ var data = [];
476
+
477
+ // Get Templates
478
+ $('.wpr-template-conditions').each(function() {
479
+ data.push($(this).attr('data-slug'))
480
+ });
481
+
482
+ // Loop
483
+ for ( var key in conditions ) {
484
+ if ( conditions.hasOwnProperty(key) ) {
485
+ // Remove Duplicate
486
+ for (var i = 0; i < conditions[key].length; i++) {
487
+ if ( path == conditions[key][i] ) {
488
+ if ( 'popup' !== getActiveFilter() ) {
489
+ conditions[key].splice(i, 1);
490
+ }
491
+ }
492
+ };
493
+
494
+ // Clear Database
495
+ if ( data.indexOf(key) === -1 ) {
496
+ delete conditions[key];
497
+ }
498
+ }
499
+ }
500
+
501
+ return conditions;
502
+ }
503
+
504
+ /*
505
+ ** Get Conditions Path -------------------------
506
+ */
507
+ function getConditionsPath( current ) {
508
+ var path = '';
509
+
510
+ // Selects
511
+ var global = 'none' !== current.find(globalS).css('display') ? current.find(globalS).val() : currentTab,
512
+ archive = current.find(archiveS).val(),
513
+ single = current.find(singleS).val(),
514
+ customIds = current.find(inputIDs);
515
+
516
+ if ( 'archive' === global || 'product_archive' === global ) {
517
+ if ( 'none' !== customIds.css('display') ) {
518
+ path = global +'/'+ archive +'/'+ customIds.val();
519
+ } else {
520
+ path = global +'/'+ archive;
521
+ }
522
+ } else if ( 'single' === global || 'product_single' === global ) {
523
+ if ( 'none' !== customIds.css('display') ) {
524
+ path = global +'/'+ single +'/'+ customIds.val();
525
+ } else {
526
+ path = global +'/'+ single;
527
+ }
528
+ } else {
529
+ path = 'global';
530
+ }
531
+
532
+ return path;
533
+ }
534
+
535
+
536
+ /*
537
+ ** Get Conditions -------------------------
538
+ */
539
+ function getConditions( template, conditions ) {
540
+ // Conditions
541
+ conditions = ('' === conditions || '[]' === conditions) ? {} : JSON.parse(conditions);
542
+ conditions[template] = [];
543
+
544
+ $('.wpr-conditions').each( function() {
545
+ var path = getConditionsPath( $(this) );
546
+
547
+ // Remove Duplicates
548
+ conditions = removeConditions( conditions, path );
549
+
550
+ // Add New Values
551
+ conditions[template].push( path );
552
+ });
553
+
554
+ return conditions;
555
+ }
556
+
557
+
558
+ /*
559
+ ** Save Conditions -------------------------
560
+ */
561
+ function saveConditions() {
562
+ $( '.wpr-save-conditions' ).on( 'click', function() {
563
+ var proActive = (1 === $('.wpr-my-templates-list').data('pro')) ? true : false;
564
+
565
+ // Current Template
566
+ var template = $(this).attr('data-slug'),
567
+ TemplateID = $(this).attr('data-id');
568
+
569
+ // Get Conditions
570
+ var conditions = getConditions( template, $( '#wpr_'+ currentTab +'_conditions' ).val() );
571
+
572
+ // Don't save if not active
573
+ if ( !proActive && ('header' === currentTab || 'footer' == currentTab || 'product_archive' == currentTab) ) {
574
+ if ( 'header' === currentTab || 'footer' == currentTab ) {
575
+ if ( ('global' !== conditions[template][0] && 'undefined' !== typeof conditions[template][0]) || conditions[template].length > 1 ) {
576
+ alert('Please select "Entire Site" to continue! Mutiple and custom conditions are fully supported in the Pro version.');
577
+ return;
578
+ }
579
+ } else if ( 'product_archive' == currentTab ) {
580
+ console.log(conditions[template][0]);
581
+ if ( ('product_archive/products' !== conditions[template][0] && 'undefined' !== typeof conditions[template][0]) || conditions[template].length > 1 ) {
582
+ alert('Please select "Entire Site" to continue! Mutiple and custom conditions are fully supported in the Pro version.');
583
+ return;
584
+ }
585
+ }
586
+ }
587
+
588
+ // Set Conditions
589
+ $('#wpr_'+ currentTab +'_conditions').val( JSON.stringify(conditions) );
590
+
591
+ // AJAX Data
592
+ var data = {
593
+ action: 'wpr_save_template_conditions',
594
+ template: template
595
+ };
596
+ data['wpr_'+ currentTab +'_conditions'] = JSON.stringify(conditions);
597
+
598
+ if ( $('#wpr-show-on-canvas').length ) {
599
+ data['wpr_'+ currentTab +'_show_on_canvas'] = $('#wpr-show-on-canvas').prop('checked');
600
+ }
601
+
602
+ // Save Conditions
603
+ $.post(ajaxurl, data, function(response) {
604
+ // Close Popup
605
+ conditionPupup.fadeOut();
606
+
607
+ // Set Active Class
608
+ for ( var key in conditions ) {
609
+ if ( conditions[key] && 0 !== conditions[key].length ) {
610
+ $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').addClass('wpr-active-conditions-template');
611
+ } else {
612
+ $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').removeClass('wpr-active-conditions-template');
613
+ }
614
+ }
615
+
616
+ // Redirect User to Editor
617
+ if ( conditionPupup.hasClass('editor-redirect') ) {
618
+ window.location.href = 'post.php?post='+ TemplateID +'&action=elementor';
619
+ }
620
+ });
621
+ });
622
+ }
623
+
624
+ saveConditions();
625
+
626
+
627
+ /*
628
+ ** Highlight Templates with Active Conditions --------
629
+ */
630
+ if ( $('body').hasClass('royal-addons_page_wpr-theme-builder') || $('body').hasClass('royal-addons_page_wpr-popups') ) {
631
+ if ( 'my_templates' !== currentTab ) {
632
+ var conditions = $( '#wpr_'+ currentTab +'_conditions' ).val(),
633
+ conditions = ('' === conditions || '[]' === conditions) ? {} : JSON.parse(conditions);
634
+
635
+ for ( var key in conditions ) {
636
+ $('.wpr-delete-template[data-slug="'+ key +'"]').closest('li').addClass('wpr-active-conditions-template');
637
+ }
638
+ }
639
+ }
640
+
641
+
642
+ /*
643
+ ** Elements Toggle -------------------------
644
+ */
645
+ $('.wpr-elements-toggle').find('input').on( 'change', function() {
646
+ if ( $(this).is(':checked') ) {
647
+ $('.wpr-element').find('input').prop( 'checked', true );
648
+ } else {
649
+ $('.wpr-element').find('input').prop( 'checked', false );
650
+ }
651
+ });
652
+
653
+
654
+ /*
655
+ ** Filters -------------------------
656
+ */
657
+ $( '.template-filters ul li span' ).on( 'click', function() {
658
+ var filter = $(this).parent();
659
+
660
+ // Deny
661
+ if ( 'back' === filter.data('role') ) return;
662
+
663
+ // Reset
664
+ filter.parent().find('li').removeClass('active-filter');
665
+ $(this).closest('.templates-grid').find('.column-3-wrap').hide();
666
+
667
+ // Active Class
668
+ filter.addClass('active-filter');
669
+ $(this).closest('.templates-grid').find('.column-3-wrap.'+ filter.data('class')).fadeIn();
670
+ });
671
+
672
+ // Sub Filters
673
+ $( '.template-filters ul li span' ).on( 'click', function() {
674
+ var filter = $(this).parent(),
675
+ role = filter.data('role');
676
+
677
+ if ( 'parent' === role ) {
678
+ filter.siblings().hide();
679
+ filter.children('span').hide();
680
+ filter.find('.sub-filters').show();
681
+ } else if ( 'back' === role ) {
682
+ filter.closest('ul').parent().siblings().show();
683
+ filter.closest('ul').parent().children('span').show();
684
+ filter.closest('ul').parent().find('.sub-filters').hide();
685
+ }
686
+ });
687
+
688
+
689
+ /*
690
+ ** Settings Tab -------------------------
691
+ */
692
+
693
+ // Lightbox Settings
694
+ jQuery(document).ready(function($){
695
+ $('#wpr_lb_bg_color').wpColorPicker();
696
+ $('#wpr_lb_toolbar_color').wpColorPicker();
697
+ $('#wpr_lb_caption_color').wpColorPicker();
698
+ $('#wpr_lb_gallery_color').wpColorPicker();
699
+ $('#wpr_lb_pb_color').wpColorPicker();
700
+ $('#wpr_lb_ui_color').wpColorPicker();
701
+ $('#wpr_lb_ui_hr_color').wpColorPicker();
702
+ $('#wpr_lb_text_color').wpColorPicker();
703
+
704
+ // Fix Color Picker
705
+ if ( $('.wpr-settings').length ) {
706
+ $('.wpr-settings').find('.wp-color-result-text').text('Select Color');
707
+ $('.wpr-settings').find('.wp-picker-clear').val('Clear');
708
+ }
709
+ });
710
+
711
+
712
+ /*
713
+ ** Image Upload Option -------------------------
714
+ */
715
+ $('body').on( 'click', '.wpr-setting-custom-img-upload button', function(e){
716
+ e.preventDefault();
717
+
718
+ var button = $(this);
719
+
720
+ if ( ! button.find('img').length ) {
721
+ var custom_uploader = wp.media({
722
+ title: 'Insert image',
723
+ library : {
724
+ uploadedTo : wp.media.view.settings.post.id, // attach to the current post?
725
+ type : 'image'
726
+ },
727
+ button: {
728
+ text: 'Use this image' // button label text
729
+ },
730
+ multiple: false
731
+ }).on('select', function() {
732
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
733
+
734
+ button.find('i').remove();
735
+ button.prepend('<img src="' + attachment.url + '">');
736
+ button.find('span').text('Remove Image');
737
+
738
+ $('#wpr_wl_plugin_logo').val(attachment.id);
739
+ }).open();
740
+ } else {
741
+ button.find('img').remove();
742
+ button.prepend('<i class="dashicons dashicons-cloud-upload"></i>');
743
+ button.find('span').text('Upload Image');
744
+
745
+ $('#wpr_wl_plugin_logo').val('');
746
+ }
747
+
748
+ });
749
+
750
+
751
+ //TODO: Remove this - only for development
752
+ // $('.nav-tab-wrapper').after( '<p>'+ $('.nav-tab-wrapper').next('input').val() +'</p>' );
753
+
754
  }); // end dom ready
assets/js/admin/premade-blocks.js CHANGED
@@ -1,93 +1,93 @@
1
- jQuery(document).ready(function( $ ) {
2
- "use strict";
3
-
4
- // Run Macy
5
- var macy = Macy({
6
- container: $('.wpr-tplib-template-gird-inner')[0],
7
- waitForImages: true,
8
- margin: 30,
9
- columns: 5,
10
- breakAt: {
11
- 1370: 4,
12
- 940: 3,
13
- 520: 2,
14
- 400: 1
15
- }
16
- });
17
-
18
- setTimeout(function(){
19
- macy.recalculate(true);
20
- }, 300 );
21
-
22
- setTimeout(function(){
23
- macy.recalculate(true);
24
- }, 600 );
25
-
26
-
27
- // Filters
28
- $('.wpr-tplib-filters').on('click', function(){
29
- if ( '0' == $('.wpr-tplib-filters-list').css('opacity') ) {
30
- $('.wpr-tplib-filters-list').css({
31
- 'opacity' : '1',
32
- 'visibility' : 'visible'
33
- });
34
- } else {
35
- $('.wpr-tplib-filters-list').css({
36
- 'opacity' : '0',
37
- 'visibility' : 'hidden'
38
- });
39
- }
40
- });
41
-
42
- $('body').on('click', function(){
43
- if ( '1' == $('.wpr-tplib-filters-list').css('opacity') ) {
44
- $('.wpr-tplib-filters-list').css({
45
- 'opacity' : '0',
46
- 'visibility' : 'hidden'
47
- });
48
- }
49
- });
50
-
51
- $( '.wpr-tplib-filters-list ul li' ).on( 'click', function() {
52
- var current = $(this).attr( 'data-filter' );
53
-
54
- // Show/Hide
55
- if ( 'all' === current ) {
56
- $( '.wpr-tplib-template' ).parent().show();
57
- } else {
58
- $( '.wpr-tplib-template' ).parent().hide();
59
- $( '.wpr-tplib-template[data-filter="'+ current +'"]' ).parent().fadeIn(500);
60
- }
61
-
62
- $('.wpr-tplib-filters h3 span').attr('data-filter', current).text($(this).text());
63
-
64
- // Fix Grid
65
- macy.recalculate(true);
66
-
67
- setTimeout(function() {
68
- macy.recalculate(true);
69
- }, 500);
70
- });
71
-
72
- $('.wpr-tplib-filters').after('<a href="https://www.youtube.com/watch?v=sTpPq0Kal9I" class="wpr-premade-blocks-tutorial" target="_blank">How to use Premade Blocks <span class="dashicons dashicons-video-alt3"></span></a>');
73
-
74
- // Preview Links and Referrals
75
- $('.wpr-tplib-template-media').on( 'click', function() {
76
- var module = $(this).parent().attr('data-filter'),
77
- template = $(this).parent().attr('data-slug'),
78
- previewUrl = 'https://royal-elementor-addons.com/premade-styles/'+ $(this).parent().attr('data-preview-url'),
79
- proRefferal = '';
80
-
81
- if ( $(this).closest('.wpr-tplib-pro-wrap').length ) {
82
- proRefferal = '-pro';
83
- }
84
-
85
- window.open(previewUrl +'?ref=rea-plugin-backend-premade-blocks'+ proRefferal, '_blank');
86
- });
87
-
88
- $('.wpr-tplib-insert-pro').on( 'click', function() {
89
- var module = $(this).closest('.wpr-tplib-template').attr('data-filter');
90
- window.open('https://royal-elementor-addons.com/?ref=rea-plugin-backend-premade-blocks-'+ module +'-upgrade-pro#purchasepro', '_blank');
91
- });
92
-
93
  }); // end dom ready
1
+ jQuery(document).ready(function( $ ) {
2
+ "use strict";
3
+
4
+ // Run Macy
5
+ var macy = Macy({
6
+ container: $('.wpr-tplib-template-gird-inner')[0],
7
+ waitForImages: true,
8
+ margin: 30,
9
+ columns: 5,
10
+ breakAt: {
11
+ 1370: 4,
12
+ 940: 3,
13
+ 520: 2,
14
+ 400: 1
15
+ }
16
+ });
17
+
18
+ setTimeout(function(){
19
+ macy.recalculate(true);
20
+ }, 300 );
21
+
22
+ setTimeout(function(){
23
+ macy.recalculate(true);
24
+ }, 600 );
25
+
26
+
27
+ // Filters
28
+ $('.wpr-tplib-filters').on('click', function(){
29
+ if ( '0' == $('.wpr-tplib-filters-list').css('opacity') ) {
30
+ $('.wpr-tplib-filters-list').css({
31
+ 'opacity' : '1',
32
+ 'visibility' : 'visible'
33
+ });
34
+ } else {
35
+ $('.wpr-tplib-filters-list').css({
36
+ 'opacity' : '0',
37
+ 'visibility' : 'hidden'
38
+ });
39
+ }
40
+ });
41
+
42
+ $('body').on('click', function(){
43
+ if ( '1' == $('.wpr-tplib-filters-list').css('opacity') ) {
44
+ $('.wpr-tplib-filters-list').css({
45
+ 'opacity' : '0',
46
+ 'visibility' : 'hidden'
47
+ });
48
+ }
49
+ });
50
+
51
+ $( '.wpr-tplib-filters-list ul li' ).on( 'click', function() {
52
+ var current = $(this).attr( 'data-filter' );
53
+
54
+ // Show/Hide
55
+ if ( 'all' === current ) {
56
+ $( '.wpr-tplib-template' ).parent().show();
57
+ } else {
58
+ $( '.wpr-tplib-template' ).parent().hide();
59
+ $( '.wpr-tplib-template[data-filter="'+ current +'"]' ).parent().fadeIn(500);
60
+ }
61
+
62
+ $('.wpr-tplib-filters h3 span').attr('data-filter', current).text($(this).text());
63
+
64
+ // Fix Grid
65
+ macy.recalculate(true);
66
+
67
+ setTimeout(function() {
68
+ macy.recalculate(true);
69
+ }, 500);
70
+ });
71
+
72
+ $('.wpr-tplib-filters').after('<a href="https://www.youtube.com/watch?v=sTpPq0Kal9I" class="wpr-premade-blocks-tutorial" target="_blank">How to use Premade Blocks <span class="dashicons dashicons-video-alt3"></span></a>');
73
+
74
+ // Preview Links and Referrals
75
+ $('.wpr-tplib-template-media').on( 'click', function() {
76
+ var module = $(this).parent().attr('data-filter'),
77
+ template = $(this).parent().attr('data-slug'),
78
+ previewUrl = 'https://royal-elementor-addons.com/premade-styles/'+ $(this).parent().attr('data-preview-url'),
79
+ proRefferal = '';
80
+
81
+ if ( $(this).closest('.wpr-tplib-pro-wrap').length ) {
82
+ proRefferal = '-pro';
83
+ }
84
+
85
+ window.open(previewUrl +'?ref=rea-plugin-backend-premade-blocks'+ proRefferal, '_blank');
86
+ });
87
+
88
+ $('.wpr-tplib-insert-pro').on( 'click', function() {
89
+ var module = $(this).closest('.wpr-tplib-template').attr('data-filter');
90
+ window.open('https://royal-elementor-addons.com/?ref=rea-plugin-backend-premade-blocks-'+ module +'-upgrade-pro#purchasepro', '_blank');
91
+ });
92
+
93
  }); // end dom ready
assets/js/editor.min.js CHANGED
@@ -1,490 +1,490 @@
1
- ( function( $ ) {//TODO: manage comments
2
-
3
- "use strict";
4
-
5
- var panelMutationObserver = new MutationObserver(function(mutations) {
6
- // Elementor Search Input
7
- if ( $('#elementor-panel-elements-search-input').length ) {
8
- var searchTimeout = null;
9
-
10
- $('#elementor-panel-elements-search-input').on( 'keyup', function(e) {
11
- if ( e.which === 13 ) {
12
- return false;
13
- }
14
-
15
- if (searchTimeout != null) {
16
- clearTimeout(searchTimeout);
17
- }
18
-
19
- searchTimeout = setTimeout(function() {
20
- searchTimeout = null;
21
-
22
- var searchVal = $('#elementor-panel-elements-search-input').val();
23
-
24
- if ( searchVal.includes('par') && $('.wpr-elementor-search-notice').length < 1 ) {
25
- $('#elementor-panel-elements-wrapper').prepend('\
26
- <div class="wpr-elementor-search-notice">\
27
- <strong>Parallax Background</strong> is only available for the Section elements. <strong>Edit any section</strong> > <strong>"Styles"</strong> tab > <strong>"Parallax - Royal Addons"</strong>.\
28
- </div>\
29
- ');
30
- }
31
-
32
- elementorCommon.ajax.addRequest( 'wpr_elementor_search_data', {
33
- data: {
34
- search_query: searchVal,
35
- },
36
- success: function() {
37
- // console.log(searchVal);
38
- }
39
- });
40
- }, 1000);
41
- });
42
- }
43
-
44
- // Promote Premium Widgets
45
- if ( $('#elementor-panel-category-wpr-widgets').length ) {
46
- $('.elementor-element--promotion').on('click', function() {
47
- var dialogButton = $('.dialog-button');
48
- dialogButton.hide();
49
-
50
- if ( $(this).find('.wpr-icon').length ) {
51
- var url = '',
52
- title = $(this).find('.title').text();
53
-
54
- if ( title === 'My Account') {
55
- url += 'https://demosites.royal-elementor-addons.com/fashion-v1/my-account-fashion-v1/?ref=rea-plugin-panel-pro-widgets-myacc-seeitinaction';
56
- } else if ( title === 'Woo Category Grid') {
57
- url += 'https://demosites.royal-elementor-addons.com/fashion-v1/?ref=rea-plugin-panel-pro-widgets-catgrid-seeitinaction#catgridprev';
58
- } else if ( title === 'Product Filters') {
59
- url += 'https://demosites.royal-elementor-addons.com/fashion-v1/shop-fashion-v1/?ref=rea-plugin-panel-pro-widgets-prodfilters-seeitinaction';
60
- } else if ( title === 'Product Breadcrumbs') {
61
- url += 'https://demosites.royal-elementor-addons.com/fashion-v1/product/mans-bluish-hoodie/?ref=rea-plugin-panel-pro-widgets-breadcru-seeitinaction';
62
- }
63
-
64
- if ( !dialogButton.next('a').length ) {
65
- dialogButton.after('<a href="'+ url +'" target="_blank" class="dialog-button elementor-button elementor-button-success">See it in action</a>');
66
- dialogButton.next('a').css('display','block');
67
- } else {
68
- dialogButton.next('a').attr('href', url);
69
- dialogButton.next('a').css('display','block');
70
- }
71
- } else {
72
- dialogButton.show();
73
- dialogButton.next('a').hide();
74
- }
75
- });
76
- }
77
-
78
- });
79
-
80
- // Listen to Elementor Panel Changes
81
- panelMutationObserver.observe($('#elementor-panel')[0], {
82
- childList: true,
83
- subtree: true,
84
- });
85
-
86
- // Make our custom css visible in the panel's front-end
87
- elementor.hooks.addFilter( 'editor/style/styleText', function( css, context ) {
88
- if ( ! context ) {
89
- return;
90
- }
91
-
92
- var model = context.model,
93
- customCSS = model.get('settings').get('wpr_custom_css');
94
- var selector = '.elementor-element.elementor-element-' + model.get('id');
95
-
96
- if ( 'document' === model.get('elType') ) {
97
- selector = elementor.config.document.settings.cssWrapperSelector;
98
- }
99
-
100
- if ( customCSS ) {
101
- css += customCSS.replace(/selector/g, selector);
102
- }
103
-
104
- return css;
105
- });
106
-
107
- // Shortcode Widget: Select Template
108
- function selectShortcodeTemplate( model, e, select, textarea ) {
109
- var shortcode = model.attributes.settings.attributes.shortcode,
110
- shortcode = shortcode.replace ( /[^\d.]/g, '' );
111
-
112
- if ( shortcode === select.val() ) {
113
- return;
114
- }
115
-
116
- // Update Settings
117
- model.attributes.settings.attributes.shortcode = '[wpr-template id="'+ select.val() +'"]';
118
-
119
- // Update Textarea
120
- textarea.val('[wpr-template id="'+ select.val() +'"]');
121
-
122
- // Refresh Preview
123
- model.renderRemoteServer();
124
- }
125
-
126
- elementor.hooks.addAction( 'panel/open_editor/widget/shortcode', function( panel, model, view ) {
127
-
128
- var $select = panel.$el.find('.elementor-control-type-wpr-ajaxselect2'),
129
- $textarea = panel.$el.find('.elementor-control-type-textarea').find('textarea');
130
-
131
- // Change
132
- $select.on( 'select2:select', function( e ) {
133
- selectShortcodeTemplate( model, e, $select, $textarea );
134
- });
135
-
136
- // Render
137
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-wpr-ajaxselect2', function(){
138
- $(this).find( 'select' ).on( 'select2:select', function( e ) {
139
- selectShortcodeTemplate( model, e, $select, $textarea );
140
- } );
141
- });
142
- } );
143
-
144
- // WPR Grid Widget: Select Element (Filter Taxonomies)
145
- function filterGridTaxonomies( data, value ) {
146
- var options = [];
147
-
148
- for ( var key in data ) {
149
- if ( key !== value ) {
150
- for ( var i = 0; i < data[key].length; i++ ) {
151
- options.push( '.elementor-control-element_select select option[value="'+ data[key][i] +'"]' );
152
- }
153
- }
154
- }
155
-
156
- // Reset
157
- $( 'head' ).find( '#element_select_filter_style' ).remove();
158
-
159
- if ( 'related' === value || 'current' === value ) {
160
- return;
161
- }
162
-
163
- // Append Styles
164
- $( 'head' ).append('<style id="element_select_filter_style">'+ options.join(',') +' { display: none !important; }</style>');
165
- }
166
-
167
- // WPR Grid Widget: Post Meta Keys (Filter by Query)
168
- function filterGridMetaKeys( data, value ) {
169
- var options = [];
170
-
171
- for ( var key in data ) {
172
- if ( key !== value ) {
173
- for ( var i = 0; i < data[key].length; i++ ) {
174
- options.push( '.select2-results__options li[data-select2-id*="-'+ data[key][i] +'"]' );
175
- }
176
- }
177
- }
178
-
179
- // Reset
180
- $( 'head' ).find( '#post_meta_keys_filter_style' ).remove();
181
-
182
- // Append Styles
183
- $( 'head' ).append('<style id="post_meta_keys_filter_style">'+ options.join(',') +' { display: none !important; }</style>');
184
- }
185
-
186
- // WPR Grid Widget / List style: Element Location
187
- function disableListLocation( value ) {
188
- // Reset
189
- $( 'head' ).find( '#list_element_location_style' ).remove();
190
-
191
- if ( 'list' !== value ) {
192
- return;
193
- }
194
-
195
- // Append Styles
196
- $( 'head' ).append('<style id="list_element_location_style">.elementor-control-element_location option[value="above"] { display: none !important; }</style>');
197
- }
198
-
199
- // Grid
200
- elementor.hooks.addAction( 'panel/open_editor/widget/wpr-grid', function( panel, model, view ) {
201
- var $querySource = panel.$el.find('.elementor-control-query_source').find( 'select' ),
202
- taxonomies = JSON.parse( panel.$el.find('.elementor-control-element_select_filter').find('input').val() ),
203
- metaKeys = JSON.parse( panel.$el.find('.elementor-control-post_meta_keys_filter').find('input').val() );
204
-
205
- // Open
206
- filterGridTaxonomies( taxonomies, $querySource.val() );
207
- filterGridMetaKeys( metaKeys, $querySource.val() );
208
-
209
- // Change
210
- $querySource.on( 'change', function() {
211
- filterGridTaxonomies( taxonomies, $(this).val() );
212
- filterGridMetaKeys( metaKeys, $(this).val() );
213
- });
214
-
215
- // Render Query Source
216
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-query_source', function(){
217
- $(this).find( 'select' ).on( 'change', function() {
218
- filterGridTaxonomies( taxonomies, $(this).val() );
219
- filterGridMetaKeys( metaKeys, $(this).val() );
220
- } );
221
- });
222
-
223
- // Render Layout Select
224
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-layout_select', function(){
225
- disableListLocation( $(this).find( 'select' ).val() );
226
-
227
- $(this).find( 'select' ).on( 'change', function() {
228
- disableListLocation( $(this).val() );
229
- } );
230
- });
231
-
232
- // Render Grid Elements
233
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
234
-
235
- $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
236
- var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
237
-
238
- if ( 'lightbox' === $(this).val() ) {
239
- wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
240
- wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
241
- wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
242
- wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
243
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
244
- setTimeout(function() {
245
- wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
246
- }, 100 );
247
- } else {
248
- wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
249
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
250
- wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
251
- }
252
- } );
253
- });
254
-
255
- var sOffsets = {};
256
-
257
- // Prevent Bubble on Click
258
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-section', function() {
259
- var current = $(this),
260
- attrClass = current.attr( 'class' ),
261
- firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
262
- lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1;
263
-
264
- var oKey = attrClass.substring( firstIndex, lastIndex ),
265
- oProperty = current.offset().top;
266
-
267
- sOffsets[oKey] = oProperty;
268
-
269
- setTimeout(function() {
270
- current.on( 'click', function( event ) {
271
- var current = $(this),
272
- attrClass = current.attr( 'class' ),
273
- firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
274
- lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1,
275
- sectionClass = attrClass.substring( firstIndex, lastIndex );
276
-
277
- setTimeout( function() {
278
- $( '#elementor-panel-content-wrapper' ).scrollTop( sOffsets[sectionClass] - 100 );
279
- }, 10 );
280
- });
281
- }, 100 );
282
- });
283
- } );
284
-
285
- // Image Grid
286
- elementor.hooks.addAction( 'panel/open_editor/widget/wpr-media-grid', function( panel, model, view ) {
287
- // Render Grid Elements
288
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
289
- $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
290
- var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
291
-
292
- if ( 'lightbox' === $(this).val() ) {
293
- wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
294
- wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
295
- wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
296
- wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
297
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
298
- setTimeout(function() {
299
- wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
300
- }, 100 );
301
- } else {
302
- wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
303
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
304
- wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
305
- }
306
- } );
307
- });
308
- } );
309
-
310
- // Woo Grid
311
- elementor.hooks.addAction( 'panel/open_editor/widget/wpr-woo-grid', function( panel, model, view ) {
312
- // Render Grid Elements
313
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
314
- $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
315
- var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
316
-
317
- if ( 'lightbox' === $(this).val() ) {
318
- wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
319
- wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
320
- wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
321
- wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
322
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
323
- setTimeout(function() {
324
- wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
325
- }, 100 );
326
- } else {
327
- wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
328
- wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
329
- wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
330
- }
331
- } );
332
- });
333
-
334
- var sOffsets = {};
335
-
336
- // Prevent Bubble on Click - not working - //tmp
337
- panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-section', function() {
338
- var current = $(this),
339
- attrClass = current.attr( 'class' ),
340
- firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
341
- lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1;
342
-
343
- var oKey = attrClass.substring( firstIndex, lastIndex ),
344
- oPropery = current.offset().top;
345
-
346
- sOffsets[oKey] = oPropery;
347
-
348
- setTimeout(function() {
349
- current.on( 'click', function( event ) {
350
- var current = $(this),
351
- attrClass = current.attr( 'class' ),
352
- firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
353
- lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1,
354
- sectionClass = attrClass.substring( firstIndex, lastIndex );
355
-
356
- setTimeout( function() {
357
- $( '#elementor-panel-content-wrapper' ).scrollTop( sOffsets[sectionClass] - 100 );
358
- }, 10 );
359
- });
360
- }, 100 );
361
- });
362
- } );
363
-
364
- // Refresh Mega Menu
365
- elementor.hooks.addAction( 'panel/open_editor/widget/wpr-mega-menu', function( panel, model, view ) {
366
- model.renderRemoteServer();
367
- });
368
-
369
- // Get Referrer Link
370
- var referrer = document.referrer;
371
-
372
- // Return to Plugin Page
373
- if ( '' !== referrer && referrer.indexOf( 'page=wpr-addons' ) > -1 ) {
374
- $(window).on( 'load', function() {
375
-
376
- $('#elementor-panel-header-menu-button').on( 'click', function() {
377
-
378
- setTimeout(function() {
379
- $('.elementor-panel-menu-item-exit-to-dashboard').on( 'click', function() {
380
- window.location.href = referrer;
381
- });
382
- }, 300);
383
- });
384
- });
385
- }
386
-
387
- // Advanced Slider - TODO: Check if necessary or remove
388
- // elementor.hooks.addAction( 'panel/open_editor/widget/wpr-advanced-slider', function( panel, model, view ) {
389
- // var elControls = panel.$el,
390
- // $select = elControls.find('.elementor-control-slider_content_type').find('select');
391
-
392
- // if ( 'custom' !== $select.val() ) {
393
- // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').addClass('wpr-elementor-hidden-control');
394
- // elControls.find('.elementor-control-slider_content_type').removeClass('wpr-elementor-hidden-control');
395
- // elControls.find('.elementor-control-slider_select_template').removeClass('wpr-elementor-hidden-control');
396
- // } else {
397
- // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').removeClass('wpr-elementor-hidden-control');
398
- // elControls.find('.elementor-control-slider_select_template').addClass('wpr-elementor-hidden-control');
399
- // }
400
-
401
- // $select.on( 'change', function() {
402
-
403
- // if ( 'custom' !== $(this).val() ) {
404
- // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').addClass('wpr-elementor-hidden-control');
405
- // elControls.find('.elementor-control-slider_content_type').removeClass('wpr-elementor-hidden-control');
406
- // elControls.find('.elementor-control-slider_select_template').removeClass('wpr-elementor-hidden-control');
407
- // } else {
408
- // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').removeClass('wpr-elementor-hidden-control');
409
- // elControls.find('.elementor-control-slider_select_template').addClass('wpr-elementor-hidden-control');
410
- // }
411
- // });
412
- // } );
413
-
414
- /*--------------------------------------------------------------
415
- == Widget Preview and Library buttons
416
- --------------------------------------------------------------*/
417
-
418
- for (const [key, value] of Object.entries(registered_modules)) {
419
- elementor.hooks.addAction( 'panel/open_editor/widget/wpr-'+ value[0], function( panel, model, view ) {
420
- openPedefinedStyles( panel.$el, view.$el, value[0], value[1], value[2] );
421
- } );
422
- }
423
-
424
- function openPedefinedStyles( panel, preview, widget, url, filter ) {
425
- panel.on( 'click', '.elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child', function() {
426
- var theme = $(this).data('theme');
427
- $(this).attr('href', url +'?ref=rea-plugin-panel-'+ widget +'-utmtr'+ theme.slice(0,3) +'nkbs'+ theme.slice(3,theme.length) +'-preview'+ filter);
428
- });
429
-
430
- panel.on( 'click', '.elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child', function() {
431
- preview.closest('body').find('#wpr-library-btn').attr('data-filter', widget);
432
- preview.closest('body').find('#wpr-library-btn').trigger('click');
433
- });
434
- }
435
-
436
- /*--------------------------------------------------------------
437
- == Reload Theme Builder
438
- --------------------------------------------------------------*/
439
- elementor.once('document:loaded', function(){
440
- setTimeout(function(){
441
- if ( $('body').hasClass('elementor-editor-wpr-theme-builder') ) {
442
- elementor.reloadPreview();
443
- }
444
- }, 10);
445
- });
446
-
447
- }( jQuery ) );
448
-
449
- ( function( $ ) {
450
-
451
- 'use strict';
452
-
453
- var WprMegaMenuEditor = {
454
-
455
- activeSection: false,
456
-
457
- currentElement: false,
458
-
459
- currentSection: false,
460
-
461
- prevSection: false,
462
-
463
-
464
- init: function() {
465
- elementor.channels.editor.on( 'section:activated', WprMegaMenuEditor.sectionActivated );
466
- },
467
-
468
- sectionActivated: function( sectionName, editor ) {
469
-
470
- let currentElement = WprMegaMenuEditor.currentElement = editor.getOption( 'editedElementView' ) || false;
471
-
472
- if ( ! currentElement ) {
473
- return;
474
- }
475
-
476
- if ( 'wpr-mega-menu' == currentElement.model.get( 'widgetType' ) ) {
477
-
478
- // if ( 'section_general' === sectionName ) {}
479
- // currentElement.model.renderRemoteServer();
480
- }
481
-
482
- }
483
-
484
- };
485
-
486
- $( window ).on( 'elementor:init', WprMegaMenuEditor.init );
487
-
488
- window.WprMegaMenuEditor = WprMegaMenuEditor;
489
-
490
- }( jQuery ) );
1
+ ( function( $ ) {//TODO: manage comments
2
+
3
+ "use strict";
4
+
5
+ var panelMutationObserver = new MutationObserver(function(mutations) {
6
+ // Elementor Search Input
7
+ if ( $('#elementor-panel-elements-search-input').length ) {
8
+ var searchTimeout = null;
9
+
10
+ $('#elementor-panel-elements-search-input').on( 'keyup', function(e) {
11
+ if ( e.which === 13 ) {
12
+ return false;
13
+ }
14
+
15
+ if (searchTimeout != null) {
16
+ clearTimeout(searchTimeout);
17
+ }
18
+
19
+ searchTimeout = setTimeout(function() {
20
+ searchTimeout = null;
21
+
22
+ var searchVal = $('#elementor-panel-elements-search-input').val();
23
+
24
+ if ( searchVal.includes('par') && $('.wpr-elementor-search-notice').length < 1 ) {
25
+ $('#elementor-panel-elements-wrapper').prepend('\
26
+ <div class="wpr-elementor-search-notice">\
27
+ <strong>Parallax Background</strong> is only available for the Section elements. <strong>Edit any section</strong> > <strong>"Styles"</strong> tab > <strong>"Parallax - Royal Addons"</strong>.\
28
+ </div>\
29
+ ');
30
+ }
31
+
32
+ elementorCommon.ajax.addRequest( 'wpr_elementor_search_data', {
33
+ data: {
34
+ search_query: searchVal,
35
+ },
36
+ success: function() {
37
+ // console.log(searchVal);
38
+ }
39
+ });
40
+ }, 1000);
41
+ });
42
+ }
43
+
44
+ // Promote Premium Widgets
45
+ if ( $('#elementor-panel-category-wpr-widgets').length ) {
46
+ $('.elementor-element--promotion').on('click', function() {
47
+ var dialogButton = $('.dialog-button');
48
+ dialogButton.hide();
49
+
50
+ if ( $(this).find('.wpr-icon').length ) {
51
+ var url = '',
52
+ title = $(this).find('.title').text();
53
+
54
+ if ( title === 'My Account') {
55
+ url += 'https://demosites.royal-elementor-addons.com/fashion-v1/my-account-fashion-v1/?ref=rea-plugin-panel-pro-widgets-myacc-seeitinaction';
56
+ } else if ( title === 'Woo Category Grid') {
57
+ url += 'https://demosites.royal-elementor-addons.com/fashion-v1/?ref=rea-plugin-panel-pro-widgets-catgrid-seeitinaction#catgridprev';
58
+ } else if ( title === 'Product Filters') {
59
+ url += 'https://demosites.royal-elementor-addons.com/fashion-v1/shop-fashion-v1/?ref=rea-plugin-panel-pro-widgets-prodfilters-seeitinaction';
60
+ } else if ( title === 'Product Breadcrumbs') {
61
+ url += 'https://demosites.royal-elementor-addons.com/fashion-v1/product/mans-bluish-hoodie/?ref=rea-plugin-panel-pro-widgets-breadcru-seeitinaction';
62
+ }
63
+
64
+ if ( !dialogButton.next('a').length ) {
65
+ dialogButton.after('<a href="'+ url +'" target="_blank" class="dialog-button elementor-button elementor-button-success">See it in action</a>');
66
+ dialogButton.next('a').css('display','block');
67
+ } else {
68
+ dialogButton.next('a').attr('href', url);
69
+ dialogButton.next('a').css('display','block');
70
+ }
71
+ } else {
72
+ dialogButton.show();
73
+ dialogButton.next('a').hide();
74
+ }
75
+ });
76
+ }
77
+
78
+ });
79
+
80
+ // Listen to Elementor Panel Changes
81
+ panelMutationObserver.observe($('#elementor-panel')[0], {
82
+ childList: true,
83
+ subtree: true,
84
+ });
85
+
86
+ // Make our custom css visible in the panel's front-end
87
+ elementor.hooks.addFilter( 'editor/style/styleText', function( css, context ) {
88
+ if ( ! context ) {
89
+ return;
90
+ }
91
+
92
+ var model = context.model,
93
+ customCSS = model.get('settings').get('wpr_custom_css');
94
+ var selector = '.elementor-element.elementor-element-' + model.get('id');
95
+
96
+ if ( 'document' === model.get('elType') ) {
97
+ selector = elementor.config.document.settings.cssWrapperSelector;
98
+ }
99
+
100
+ if ( customCSS ) {
101
+ css += customCSS.replace(/selector/g, selector);
102
+ }
103
+
104
+ return css;
105
+ });
106
+
107
+ // Shortcode Widget: Select Template
108
+ function selectShortcodeTemplate( model, e, select, textarea ) {
109
+ var shortcode = model.attributes.settings.attributes.shortcode,
110
+ shortcode = shortcode.replace ( /[^\d.]/g, '' );
111
+
112
+ if ( shortcode === select.val() ) {
113
+ return;
114
+ }
115
+
116
+ // Update Settings
117
+ model.attributes.settings.attributes.shortcode = '[wpr-template id="'+ select.val() +'"]';
118
+
119
+ // Update Textarea
120
+ textarea.val('[wpr-template id="'+ select.val() +'"]');
121
+
122
+ // Refresh Preview
123
+ model.renderRemoteServer();
124
+ }
125
+
126
+ elementor.hooks.addAction( 'panel/open_editor/widget/shortcode', function( panel, model, view ) {
127
+
128
+ var $select = panel.$el.find('.elementor-control-type-wpr-ajaxselect2'),
129
+ $textarea = panel.$el.find('.elementor-control-type-textarea').find('textarea');
130
+
131
+ // Change
132
+ $select.on( 'select2:select', function( e ) {
133
+ selectShortcodeTemplate( model, e, $select, $textarea );
134
+ });
135
+
136
+ // Render
137
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-wpr-ajaxselect2', function(){
138
+ $(this).find( 'select' ).on( 'select2:select', function( e ) {
139
+ selectShortcodeTemplate( model, e, $select, $textarea );
140
+ } );
141
+ });
142
+ } );
143
+
144
+ // WPR Grid Widget: Select Element (Filter Taxonomies)
145
+ function filterGridTaxonomies( data, value ) {
146
+ var options = [];
147
+
148
+ for ( var key in data ) {
149
+ if ( key !== value ) {
150
+ for ( var i = 0; i < data[key].length; i++ ) {
151
+ options.push( '.elementor-control-element_select select option[value="'+ data[key][i] +'"]' );
152
+ }
153
+ }
154
+ }
155
+
156
+ // Reset
157
+ $( 'head' ).find( '#element_select_filter_style' ).remove();
158
+
159
+ if ( 'related' === value || 'current' === value ) {
160
+ return;
161
+ }
162
+
163
+ // Append Styles
164
+ $( 'head' ).append('<style id="element_select_filter_style">'+ options.join(',') +' { display: none !important; }</style>');
165
+ }
166
+
167
+ // WPR Grid Widget: Post Meta Keys (Filter by Query)
168
+ function filterGridMetaKeys( data, value ) {
169
+ var options = [];
170
+
171
+ for ( var key in data ) {
172
+ if ( key !== value ) {
173
+ for ( var i = 0; i < data[key].length; i++ ) {
174
+ options.push( '.select2-results__options li[data-select2-id*="-'+ data[key][i] +'"]' );
175
+ }
176
+ }
177
+ }
178
+
179
+ // Reset
180
+ $( 'head' ).find( '#post_meta_keys_filter_style' ).remove();
181
+
182
+ // Append Styles
183
+ $( 'head' ).append('<style id="post_meta_keys_filter_style">'+ options.join(',') +' { display: none !important; }</style>');
184
+ }
185
+
186
+ // WPR Grid Widget / List style: Element Location
187
+ function disableListLocation( value ) {
188
+ // Reset
189
+ $( 'head' ).find( '#list_element_location_style' ).remove();
190
+
191
+ if ( 'list' !== value ) {
192
+ return;
193
+ }
194
+
195
+ // Append Styles
196
+ $( 'head' ).append('<style id="list_element_location_style">.elementor-control-element_location option[value="above"] { display: none !important; }</style>');
197
+ }
198
+
199
+ // Grid
200
+ elementor.hooks.addAction( 'panel/open_editor/widget/wpr-grid', function( panel, model, view ) {
201
+ var $querySource = panel.$el.find('.elementor-control-query_source').find( 'select' ),
202
+ taxonomies = JSON.parse( panel.$el.find('.elementor-control-element_select_filter').find('input').val() ),
203
+ metaKeys = JSON.parse( panel.$el.find('.elementor-control-post_meta_keys_filter').find('input').val() );
204
+
205
+ // Open
206
+ filterGridTaxonomies( taxonomies, $querySource.val() );
207
+ filterGridMetaKeys( metaKeys, $querySource.val() );
208
+
209
+ // Change
210
+ $querySource.on( 'change', function() {
211
+ filterGridTaxonomies( taxonomies, $(this).val() );
212
+ filterGridMetaKeys( metaKeys, $(this).val() );
213
+ });
214
+
215
+ // Render Query Source
216
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-query_source', function(){
217
+ $(this).find( 'select' ).on( 'change', function() {
218
+ filterGridTaxonomies( taxonomies, $(this).val() );
219
+ filterGridMetaKeys( metaKeys, $(this).val() );
220
+ } );
221
+ });
222
+
223
+ // Render Layout Select
224
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-layout_select', function(){
225
+ disableListLocation( $(this).find( 'select' ).val() );
226
+
227
+ $(this).find( 'select' ).on( 'change', function() {
228
+ disableListLocation( $(this).val() );
229
+ } );
230
+ });
231
+
232
+ // Render Grid Elements
233
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
234
+
235
+ $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
236
+ var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
237
+
238
+ if ( 'lightbox' === $(this).val() ) {
239
+ wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
240
+ wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
241
+ wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
242
+ wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
243
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
244
+ setTimeout(function() {
245
+ wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
246
+ }, 100 );
247
+ } else {
248
+ wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
249
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
250
+ wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
251
+ }
252
+ } );
253
+ });
254
+
255
+ var sOffsets = {};
256
+
257
+ // Prevent Bubble on Click
258
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-section', function() {
259
+ var current = $(this),
260
+ attrClass = current.attr( 'class' ),
261
+ firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
262
+ lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1;
263
+
264
+ var oKey = attrClass.substring( firstIndex, lastIndex ),
265
+ oProperty = current.offset().top;
266
+
267
+ sOffsets[oKey] = oProperty;
268
+
269
+ setTimeout(function() {
270
+ current.on( 'click', function( event ) {
271
+ var current = $(this),
272
+ attrClass = current.attr( 'class' ),
273
+ firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
274
+ lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1,
275
+ sectionClass = attrClass.substring( firstIndex, lastIndex );
276
+
277
+ setTimeout( function() {
278
+ $( '#elementor-panel-content-wrapper' ).scrollTop( sOffsets[sectionClass] - 100 );
279
+ }, 10 );
280
+ });
281
+ }, 100 );
282
+ });
283
+ } );
284
+
285
+ // Image Grid
286
+ elementor.hooks.addAction( 'panel/open_editor/widget/wpr-media-grid', function( panel, model, view ) {
287
+ // Render Grid Elements
288
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
289
+ $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
290
+ var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
291
+
292
+ if ( 'lightbox' === $(this).val() ) {
293
+ wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
294
+ wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
295
+ wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
296
+ wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
297
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
298
+ setTimeout(function() {
299
+ wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
300
+ }, 100 );
301
+ } else {
302
+ wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
303
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
304
+ wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
305
+ }
306
+ } );
307
+ });
308
+ } );
309
+
310
+ // Woo Grid
311
+ elementor.hooks.addAction( 'panel/open_editor/widget/wpr-woo-grid', function( panel, model, view ) {
312
+ // Render Grid Elements
313
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-grid_elements', function() {
314
+ $(this).find( '.elementor-control-element_select select' ).on( 'change', function() {
315
+ var wrapper = $(this).closest( '.elementor-repeater-row-controls' );
316
+
317
+ if ( 'lightbox' === $(this).val() ) {
318
+ wrapper.find('.elementor-control-element_location').find( 'select' ).val( 'over' ).trigger( 'change' );
319
+ wrapper.find('.elementor-control-element_animation').find( 'select' ).val( 'fade-in' ).trigger( 'change' );
320
+ wrapper.find('.elementor-control-element_align_hr').find( 'input' ).eq(1).prop('checked',true).trigger( 'change' );
321
+ wrapper.find('.elementor-control-element_lightbox_overlay').find( 'input' ).prop('checked',true).trigger( 'change' );
322
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'before' ).trigger( 'change' );
323
+ setTimeout(function() {
324
+ wrapper.find('.elementor-control-element_extra_icon_pos').addClass( 'elementor-hidden-control' );
325
+ }, 100 );
326
+ } else {
327
+ wrapper.find('.elementor-control-element_extra_text_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
328
+ wrapper.find('.elementor-control-element_extra_icon_pos').find( 'select' ).val( 'none' ).trigger( 'change' );
329
+ wrapper.find('.elementor-control-element_extra_icon_pos').removeClass( 'elementor-hidden-control' );
330
+ }
331
+ } );
332
+ });
333
+
334
+ var sOffsets = {};
335
+
336
+ // Prevent Bubble on Click - not working - //tmp
337
+ panel.$el.find('#elementor-controls').on( 'DOMNodeInserted ', '.elementor-control-type-section', function() {
338
+ var current = $(this),
339
+ attrClass = current.attr( 'class' ),
340
+ firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
341
+ lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1;
342
+
343
+ var oKey = attrClass.substring( firstIndex, lastIndex ),
344
+ oPropery = current.offset().top;
345
+
346
+ sOffsets[oKey] = oPropery;
347
+
348
+ setTimeout(function() {
349
+ current.on( 'click', function( event ) {
350
+ var current = $(this),
351
+ attrClass = current.attr( 'class' ),
352
+ firstIndex = attrClass.indexOf( 'elementor-control-section_' ),
353
+ lastIndex = attrClass.indexOf( 'elementor-control-type-section' ) - 1,
354
+ sectionClass = attrClass.substring( firstIndex, lastIndex );
355
+
356
+ setTimeout( function() {
357
+ $( '#elementor-panel-content-wrapper' ).scrollTop( sOffsets[sectionClass] - 100 );
358
+ }, 10 );
359
+ });
360
+ }, 100 );
361
+ });
362
+ } );
363
+
364
+ // Refresh Mega Menu
365
+ elementor.hooks.addAction( 'panel/open_editor/widget/wpr-mega-menu', function( panel, model, view ) {
366
+ model.renderRemoteServer();
367
+ });
368
+
369
+ // Get Referrer Link
370
+ var referrer = document.referrer;
371
+
372
+ // Return to Plugin Page
373
+ if ( '' !== referrer && referrer.indexOf( 'page=wpr-addons' ) > -1 ) {
374
+ $(window).on( 'load', function() {
375
+
376
+ $('#elementor-panel-header-menu-button').on( 'click', function() {
377
+
378
+ setTimeout(function() {
379
+ $('.elementor-panel-menu-item-exit-to-dashboard').on( 'click', function() {
380
+ window.location.href = referrer;
381
+ });
382
+ }, 300);
383
+ });
384
+ });
385
+ }
386
+
387
+ // Advanced Slider - TODO: Check if necessary or remove
388
+ // elementor.hooks.addAction( 'panel/open_editor/widget/wpr-advanced-slider', function( panel, model, view ) {
389
+ // var elControls = panel.$el,
390
+ // $select = elControls.find('.elementor-control-slider_content_type').find('select');
391
+
392
+ // if ( 'custom' !== $select.val() ) {
393
+ // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').addClass('wpr-elementor-hidden-control');
394
+ // elControls.find('.elementor-control-slider_content_type').removeClass('wpr-elementor-hidden-control');
395
+ // elControls.find('.elementor-control-slider_select_template').removeClass('wpr-elementor-hidden-control');
396
+ // } else {
397
+ // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').removeClass('wpr-elementor-hidden-control');
398
+ // elControls.find('.elementor-control-slider_select_template').addClass('wpr-elementor-hidden-control');
399
+ // }
400
+
401
+ // $select.on( 'change', function() {
402
+
403
+ // if ( 'custom' !== $(this).val() ) {
404
+ // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').addClass('wpr-elementor-hidden-control');
405
+ // elControls.find('.elementor-control-slider_content_type').removeClass('wpr-elementor-hidden-control');
406
+ // elControls.find('.elementor-control-slider_select_template').removeClass('wpr-elementor-hidden-control');
407
+ // } else {
408
+ // elControls.find('.elementor-control-slider_items .elementor-repeater-row-controls .elementor-control').removeClass('wpr-elementor-hidden-control');
409
+ // elControls.find('.elementor-control-slider_select_template').addClass('wpr-elementor-hidden-control');
410
+ // }
411
+ // });
412
+ // } );
413
+
414
+ /*--------------------------------------------------------------
415
+ == Widget Preview and Library buttons
416
+ --------------------------------------------------------------*/
417
+
418
+ for (const [key, value] of Object.entries(registered_modules)) {
419
+ elementor.hooks.addAction( 'panel/open_editor/widget/wpr-'+ value[0], function( panel, model, view ) {
420
+ openPedefinedStyles( panel.$el, view.$el, value[0], value[1], value[2] );
421
+ } );
422
+ }
423
+
424
+ function openPedefinedStyles( panel, preview, widget, url, filter ) {
425
+ panel.on( 'click', '.elementor-control-wpr_library_buttons .elementor-control-raw-html div a:first-child', function() {
426
+ var theme = $(this).data('theme');
427
+ $(this).attr('href', url +'?ref=rea-plugin-panel-'+ widget +'-utmtr'+ theme.slice(0,3) +'nkbs'+ theme.slice(3,theme.length) +'-preview'+ filter);
428
+ });
429
+
430
+ panel.on( 'click', '.elementor-control-wpr_library_buttons .elementor-control-raw-html div a:last-child', function() {
431
+ preview.closest('body').find('#wpr-library-btn').attr('data-filter', widget);
432
+ preview.closest('body').find('#wpr-library-btn').trigger('click');
433
+ });
434
+ }
435
+
436
+ /*--------------------------------------------------------------
437
+ == Reload Theme Builder
438
+ --------------------------------------------------------------*/
439
+ elementor.once('document:loaded', function(){
440
+ setTimeout(function(){
441
+ if ( $('body').hasClass('elementor-editor-wpr-theme-builder') ) {
442
+ elementor.reloadPreview();
443
+ }
444
+ }, 10);
445
+ });
446
+
447
+ }( jQuery ) );
448
+
449
+ ( function( $ ) {
450
+
451
+ 'use strict';
452
+
453
+ var WprMegaMenuEditor = {
454
+
455
+ activeSection: false,
456
+
457
+ currentElement: false,
458
+
459
+ currentSection: false,
460
+
461
+ prevSection: false,
462
+
463
+
464
+ init: function() {
465
+ elementor.channels.editor.on( 'section:activated', WprMegaMenuEditor.sectionActivated );
466
+ },
467
+
468
+ sectionActivated: function( sectionName, editor ) {
469
+
470
+ let currentElement = WprMegaMenuEditor.currentElement = editor.getOption( 'editedElementView' ) || false;
471
+
472
+ if ( ! currentElement ) {
473
+ return;
474
+ }
475
+
476
+ if ( 'wpr-mega-menu' == currentElement.model.get( 'widgetType' ) ) {
477
+
478
+ // if ( 'section_general' === sectionName ) {}
479
+ // currentElement.model.renderRemoteServer();
480
+ }
481
+
482
+ }
483
+
484
+ };
485
+
486
+ $( window ).on( 'elementor:init', WprMegaMenuEditor.init );
487
+
488
+ window.WprMegaMenuEditor = WprMegaMenuEditor;
489
+
490
+ }( jQuery ) );
assets/js/frontend.js CHANGED
@@ -1,6364 +1,6364 @@
1
- ( function( $, elementor ) {
2
-
3
- "use strict";
4
-
5
- var WprElements = {
6
-
7
- init: function() {
8
-
9
- var widgets = {
10
- 'wpr-nav-menu.default' : WprElements.widgetNavMenu,
11
- 'wpr-mega-menu.default' : WprElements.widgetMegaMenu,
12
- 'wpr-onepage-nav.default' : WprElements.OnepageNav,
13
- 'wpr-grid.default' : WprElements.widgetGrid,
14
- 'wpr-magazine-grid.default' : WprElements.widgetMagazineGrid,
15
- 'wpr-media-grid.default' : WprElements.widgetGrid,
16
- 'wpr-woo-grid.default' : WprElements.widgetGrid,
17
- 'wpr-woo-category-grid-pro.default' : WprElements.widgetGrid,
18
- 'wpr-featured-media.default' : WprElements.widgetFeaturedMedia,
19
- 'wpr-countdown.default' : WprElements.widgetCountDown,
20
- 'wpr-google-maps.default' : WprElements.widgetGoogleMaps,
21
- 'wpr-before-after.default' : WprElements.widgetBeforeAfter,
22
- 'wpr-mailchimp.default' : WprElements.widgetMailchimp,
23
- 'wpr-advanced-slider.default' : WprElements.widgetAdvancedSlider,
24
- 'wpr-testimonial.default' : WprElements.widgetTestimonialCarousel,
25
- 'wpr-search.default' : WprElements.widgetSearch,
26
- 'wpr-advanced-text.default' : WprElements.widgetAdvancedText,
27
- 'wpr-progress-bar.default' : WprElements.widgetProgressBar,
28
- 'wpr-image-hotspots.default' : WprElements.widgetImageHotspots,
29
- 'wpr-flip-box.default' : WprElements.widgetFlipBox,
30
- 'wpr-content-ticker.default' : WprElements.widgetContentTicker,
31
- 'wpr-tabs.default' : WprElements.widgetTabs,
32
- 'wpr-content-toggle.default' : WprElements.widgetContentToogle,
33
- 'wpr-back-to-top.default': WprElements.widgetBackToTop,
34
- 'wpr-lottie-animations.default': WprElements.widgetLottieAnimations,
35
- 'wpr-posts-timeline.default' : WprElements.widgetPostsTimeline,
36
- 'wpr-sharing-buttons.default' : WprElements.widgetSharingButtons,
37
- 'wpr-flip-carousel.default': WprElements.widgetFlipCarousel,
38
- 'wpr-feature-list.default' : WprElements.widgetFeatureList,
39
- 'wpr-advanced-accordion.default' : WprElements.widgetAdvancedAccordion,
40
- 'wpr-image-accordion.default' : WprElements.widgetImageAccordion,
41
- 'wpr-product-media.default' : WprElements.widgetProductMedia,
42
- 'wpr-product-add-to-cart.default' : WprElements.widgetProductAddToCart,
43
- 'wpr-product-mini-cart.default' : WprElements.widgetProductMiniCart,
44
- 'wpr-product-filters.default' : WprElements.widgetProductFilters,
45
- 'wpr-page-cart.default' : WprElements.widgetPageCart,
46
- 'wpr-my-account-pro.default' : WprElements.widgetPageMyAccount,
47
- 'wpr-reading-progress-bar.default' : WprElements.widgetReadingProgressBar,
48
- 'wpr-data-table.default' : WprElements.widgetDataTable,
49
- 'wpr-charts.default': WprElements.widgetCharts,
50
- 'wpr-taxonomy-list.default': WprElements.widgetTaxonomyList,
51
- 'global': WprElements.widgetSection,
52
-
53
- // Single
54
- 'wpr-post-media.default' : WprElements.widgetPostMedia,
55
- };
56
-
57
- $.each( widgets, function( widget, callback ) {
58
- window.elementorFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback );
59
- });
60
-
61
- // Remove Mega Menu Templates from "Edit with Elementor"
62
- WprElements.changeAdminBarMenu();
63
- },
64
-
65
- widgetPostMedia: function( $scope ) {
66
- // var gallery = $scope.find( '.wpr-gallery-slider' ),
67
- // gallerySettings = gallery.attr( 'data-slick' );
68
-
69
- // gallery.animate({ 'opacity' : '1' }, 1000 );//tmp
70
-
71
- // if ( '[]' !== gallerySettings ) {
72
- // gallery.slick({
73
- // appendDots : $scope.find( '.wpr-gallery-slider-dots' ),
74
- // customPaging : function ( slider, i ) {
75
- // var slideNumber = (i + 1),
76
- // totalSlides = slider.slideCount;
77
-
78
- // return '<span class="wpr-gallery-slider-dot"></span>';
79
- // }
80
- // });
81
- // }
82
-
83
- // Lightbox
84
- var lightboxSettings = $( '.wpr-featured-media-image' ).attr( 'data-lightbox' );
85
-
86
- if ( typeof lightboxSettings !== typeof undefined && lightboxSettings !== false && ! WprElements.editorCheck() ) {
87
- var MediaWrap = $scope.find( '.wpr-featured-media-wrap' );
88
- lightboxSettings = JSON.parse( lightboxSettings );
89
-
90
- // Init Lightbox
91
- MediaWrap.lightGallery( lightboxSettings );
92
-
93
- // Show/Hide Controls
94
- MediaWrap.on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
95
- var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
96
- lightboxDownload = $( '#lg-download' ).attr( 'href' );
97
-
98
- if ( $( '#lg-download' ).length ) {
99
- if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
100
- lightboxControls.addClass( 'wpr-hidden-element' );
101
- } else {
102
- lightboxControls.removeClass( 'wpr-hidden-element' );
103
- }
104
- }
105
-
106
- // Autoplay Button
107
- if ( '' === lightboxSettings.autoplay ) {
108
- $( '.lg-autoplay-button' ).css({
109
- 'width' : '0',
110
- 'height' : '0',
111
- 'overflow' : 'hidden'
112
- });
113
- }
114
- });
115
- }
116
- }, // End widgetFeaturedMedia
117
-
118
- widgetSection: function( $scope ) {
119
-
120
- if ( $scope.attr('data-wpr-particles') || $scope.find('.wpr-particle-wrapper').attr('data-wpr-particles-editor') ) {
121
- particlesEffect();
122
- }
123
-
124
- if ( $scope.hasClass('wpr-jarallax') || $scope.hasClass('wpr-jarallax-yes') ) {
125
- parallaxBackground();
126
- }
127
-
128
- if ( $scope.hasClass('wpr-parallax-yes') ) {
129
- parallaxMultiLayer();
130
- }
131
-
132
- if ( $scope.hasClass('wpr-sticky-section-yes') ) {
133
-
134
- var positionType = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-type') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-type'),
135
- positionLocation = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-location') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-location'),
136
- positionOffset = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-offset') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-offset'),
137
- viewportWidth = $('body').prop('clientWidth') + 17,
138
- availableDevices = !WprElements.editorCheck() ? $scope.attr('data-wpr-sticky-devices') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-sticky-devices'),
139
- activeDevices = !WprElements.editorCheck() ? $scope.attr('data-wpr-active-breakpoints') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-active-breakpoints'),
140
- stickySectionExists = $scope.hasClass('wpr-sticky-section-yes') || $scope.find('.wpr-sticky-section-yes-editor') ? true : false,
141
- positionStyle,
142
- adminBarHeight,
143
- stickyHeaderFooter = $scope.closest('div[data-elementor-type="wp-post"]').length ? $scope.closest('div[data-elementor-type="wp-post"]') : '',
144
- headerFooterZIndex = !WprElements.editorCheck() ? $scope.attr('data-wpr-z-index') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-z-index');
145
-
146
- if ( !$scope.find('.wpr-sticky-section-yes-editor').length) {
147
- positionType = $scope.attr('data-wpr-position-type');
148
- positionLocation = $scope.attr('data-wpr-position-location');
149
- positionOffset = $scope.attr('data-wpr-position-offset');
150
- availableDevices = $scope.attr('data-wpr-sticky-devices');
151
- activeDevices = $scope.attr('data-wpr-active-breakpoints');
152
- headerFooterZIndex = $scope.attr('data-wpr-z-index');
153
- }
154
-
155
- if ( 'top' === positionLocation && 'auto' === $scope.css('top') ) {
156
- var offsetTop = 0;
157
- $scope.css('top', 0);
158
- } else {
159
- var offsetTop = +$scope.css('top').slice(0, -2);
160
- }
161
-
162
- if ( 0 == availableDevices.length ) {
163
- positionType = 'static';
164
- }
165
-
166
- if ( WprElements.editorCheck() && availableDevices ) {
167
- var attributes = $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-sticky-devices');
168
- $scope.attr('data-wpr-sticky-devices', attributes);
169
- availableDevices = $scope.attr('data-wpr-sticky-devices');
170
- }
171
-
172
- changePositionType();
173
- changeAdminBarOffset();
174
-
175
- $(window).resize(function() {
176
- viewportWidth = $('body').prop('clientWidth') + 17,
177
- changePositionType();
178
- });
179
-
180
- if (!stickySectionExists) {
181
- positionStyle = 'static';
182
- }
183
-
184
- function changePositionType() {
185
- if ( !$scope.hasClass('wpr-sticky-section-yes') || !$scope.find('.wpr-sticky-section-yes-editor') ) {
186
- positionStyle = 'static';
187
- return;
188
- }
189
-
190
- var checkDevices = [['mobile_sticky', 768], ['mobile_extra_sticky', 881], ['tablet_sticky', 1025], ['tablet_extra_sticky', 1201], ['laptop_sticky', 1216], ['desktop_sticky', 2400], ['widescreen_sticky', 4000]];
191
- var emptyVariables = [];
192
-
193
- var checkedDevices = checkDevices.filter((item, index) => {
194
- return activeDevices.indexOf(item[0]) != -1;
195
- }).reverse();
196
-
197
- checkedDevices.forEach((device, index) => {
198
- if ( (device[1] > viewportWidth) && availableDevices.indexOf(device[0]) === -1 ) {
199
- positionStyle = activeDevices?.indexOf(device[0]) !== -1 ? 'static' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
200
- // positionStyle = activeDevices && activeDevices.indexOf(device[0]) !== -1 ? 'static' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
201
- emptyVariables[index] = positionStyle;
202
- } else if ( ( device[1] > viewportWidth) && availableDevices.indexOf(device[0]) !== -1 ) {
203
- positionStyle = positionType;
204
- }
205
- });
206
-
207
- applyPosition();
208
- }
209
-
210
- function applyPosition() {
211
- var bottom = +window.innerHeight - (+$scope.css('top').slice(0, -2) + $scope.height());
212
- var top = +window.innerHeight - (+$scope.css('bottom').slice(0, -2) + $scope.height());
213
- if ( 'top' === positionLocation ) {
214
- $scope.css({'position': positionStyle });
215
- if ( '' !== stickyHeaderFooter ) {
216
- // stickyHeaderFooter = stickyHeaderFooter.find('.wpr-sticky-section-yes');
217
- stickyHeaderFooter.css({'position': positionStyle, 'top': positionOffset + 'px', 'bottom': 'auto', 'z-index': headerFooterZIndex, 'width': '100%' });
218
- }
219
- }
220
- else {
221
- $scope.css({'position': positionStyle });
222
- if ( '' !== stickyHeaderFooter ) {
223
- stickyHeaderFooter = stickyHeaderFooter.find('.wpr-sticky-section-yes');
224
- stickyHeaderFooter.css({'position': positionStyle, 'bottom': positionOffset + 'px', 'top': 'auto', 'z-index': headerFooterZIndex, 'width': '100%' });
225
- }
226
- }
227
- }
228
-
229
- function changeAdminBarOffset() {
230
- if ( $('#wpadminbar').length ) {
231
- adminBarHeight = $('#wpadminbar').css('height').slice(0, $('#wpadminbar').css('height').length - 2);
232
- if ( 'top' === positionLocation && ( 'fixed' == $scope.css('position') || 'sticky' == $scope.css('position') ) ) {
233
- $scope.css('top', +adminBarHeight + offsetTop + 'px');
234
- $scope.css('bottom', 'auto');
235
- }
236
- }
237
- }
238
-
239
- }
240
-
241
- function particlesEffect() {
242
- var elementType = $scope.data('element_type'),
243
- sectionID = $scope.data('id'),
244
- particlesJSON = ! WprElements.editorCheck() ? $scope.attr('data-wpr-particles') : $scope.find('.wpr-particle-wrapper').attr('data-wpr-particles-editor');
245
-
246
- if ( 'section' === elementType && undefined !== particlesJSON ) {
247
- // Frontend
248
- if ( ! WprElements.editorCheck() ) {
249
- $scope.prepend('<div class="wpr-particle-wrapper" id="wpr-particle-'+ sectionID +'"></div>');
250
-
251
- particlesJS('wpr-particle-'+ sectionID, $scope.attr('particle-source') == 'wpr_particle_json_custom' ? JSON.parse(particlesJSON) : modifyJSON(particlesJSON));
252
- // Editor
253
- } else {
254
- if ( $scope.hasClass('wpr-particle-yes') ) {
255
- particlesJS( 'wpr-particle-'+ sectionID, $scope.find('.wpr-particle-wrapper').attr('particle-source') == 'wpr_particle_json_custom' ? JSON.parse(particlesJSON) : modifyJSON(particlesJSON));
256
-
257
- $scope.find('.elementor-column').css('z-index', 9);
258
-
259
- $(window).trigger('resize');
260
- } else {
261
- $scope.find('.wpr-particle-wrapper').remove();
262
- }
263
- }
264
- }
265
- }
266
-
267
- function modifyJSON(json) {
268
- var wpJson = JSON.parse(json),
269
- particles_quantity = ! WprElements.editorCheck() ? $scope.attr('wpr-quantity') : $scope.find('.wpr-particle-wrapper').attr('wpr-quantity'),
270
- particles_color = ! WprElements.editorCheck() ? $scope.attr('wpr-color') || '#000000' : $scope.find('.wpr-particle-wrapper').attr('wpr-color') ? $scope.find('.wpr-particle-wrapper').attr('wpr-color') : '#000000',
271
- particles_speed = ! WprElements.editorCheck() ? $scope.attr('wpr-speed') : $scope.find('.wpr-particle-wrapper').attr('wpr-speed'),
272
- particles_shape = ! WprElements.editorCheck() ? $scope.attr('wpr-shape') : $scope.find('.wpr-particle-wrapper').attr('wpr-shape'),
273
- particles_size = ! WprElements.editorCheck() ? $scope.attr('wpr-size') : $scope.find('.wpr-particle-wrapper').attr('wpr-size');
274
-
275
- wpJson.particles.size.value = particles_size;
276
- wpJson.particles.number.value = particles_quantity;
277
- wpJson.particles.color.value = particles_color;
278
- wpJson.particles.shape.type = particles_shape;
279
- wpJson.particles.line_linked.color = particles_color;
280
- wpJson.particles.move.speed = particles_speed;
281
-
282
- return wpJson;
283
- }
284
-
285
- function parallaxBackground() {
286
- if ( $scope.hasClass('wpr-jarallax-yes') ) {
287
- if ( ! WprElements.editorCheck() && $scope.hasClass('wpr-jarallax') ) {
288
- $scope.css('background-image', 'url("' + $scope.attr('bg-image') + '")');
289
- $scope.jarallax({
290
- type: $scope.attr('scroll-effect'),
291
- speed: $scope.attr('speed-data'),
292
- });
293
- } else if ( WprElements.editorCheck() ) {
294
- $scope.css('background-image', 'url("' + $scope.find('.wpr-jarallax').attr('bg-image-editor') + '")');
295
- $scope.jarallax({
296
- type: $scope.find('.wpr-jarallax').attr('scroll-effect-editor'),
297
- speed: $scope.find('.wpr-jarallax').attr('speed-data-editor')
298
- });
299
- }
300
- }
301
- }
302
-
303
- function parallaxMultiLayer() {
304
- if ( $scope.hasClass('wpr-parallax-yes') ) {
305
- var scene = document.getElementsByClassName('wpr-parallax-multi-layer');
306
-
307
- var parallaxInstance = Array.from(scene).map(item => {
308
- return new Parallax(item, {
309
- invertY: item.getAttribute('direction') == 'yes' ? true : false,
310
- invertX: item.getAttribute('direction') == 'yes' ? true : false,
311
- scalarX: item.getAttribute('scalar-speed'),
312
- scalarY: item.getAttribute('scalar-speed'),
313
- hoverOnly: true,
314
- pointerEvents: true
315
- });
316
- });
317
-
318
- parallaxInstance.forEach(parallax => {
319
- parallax.friction(0.2, 0.2);
320
- });
321
- }
322
- if ( ! WprElements.editorCheck() ) {
323
- var newScene = [];
324
-
325
- document.querySelectorAll('.wpr-parallax-multi-layer').forEach((element, index) => {
326
- element.parentElement.style.position = "relative";
327
- element.style.position = "absolute";
328
- newScene.push(element);
329
- element.remove();
330
- });
331
-
332
- document.querySelectorAll('.wpr-parallax-ml-children').forEach((element, index) => {
333
- element.style.position = "absolute";
334
- element.style.top = element.getAttribute('style-top');
335
- element.style.left = element.getAttribute('style-left');
336
- });
337
-
338
- $('.wpr-parallax-yes').each(function(index) {
339
- $(this).append(newScene[index]);
340
- });
341
- }
342
- }
343
- }, // end widgetSection
344
-
345
- widgetNavMenu: function( $scope ) {
346
-
347
- var $navMenu = $scope.find( '.wpr-nav-menu-container' ),
348
- $mobileNavMenu = $scope.find( '.wpr-mobile-nav-menu-container' );
349
-
350
- // Menu
351
- var subMenuFirst = $navMenu.find( '.wpr-nav-menu > li.menu-item-has-children' ),
352
- subMenuDeep = $navMenu.find( '.wpr-sub-menu li.menu-item-has-children' );
353
-
354
- if ( $scope.find('.wpr-mobile-toggle').length ) {
355
- $scope.find('a').on('click', function() {
356
- if (this.pathname == window.location.pathname && !($(this).parent('li').children().length > 1)) {
357
- $scope.find('.wpr-mobile-toggle').trigger('click');
358
- }
359
- });
360
- }
361
-
362
- if ( $navMenu.attr('data-trigger') === 'click' ) {
363
- // First Sub
364
- subMenuFirst.children('a').on( 'click', function(e) {
365
- var currentItem = $(this).parent(),
366
- childrenSub = currentItem.children('.wpr-sub-menu');
367
-
368
- // Reset
369
- subMenuFirst.not(currentItem).removeClass('wpr-sub-open');
370
- if ( $navMenu.hasClass('wpr-nav-menu-horizontal') || ( $navMenu.hasClass('wpr-nav-menu-vertical') && $scope.hasClass('wpr-sub-menu-position-absolute') ) ) {
371
- subMenuAnimation( subMenuFirst.children('.wpr-sub-menu'), false );
372
- }
373
-
374
- if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
375
- e.preventDefault();
376
- currentItem.addClass('wpr-sub-open');
377
- subMenuAnimation( childrenSub, true );
378
- } else {
379
- currentItem.removeClass('wpr-sub-open');
380
- subMenuAnimation( childrenSub, false );
381
- }
382
- });
383
-
384
- // Deep Subs
385
- subMenuDeep.on( 'click', function(e) {
386
- var currentItem = $(this),
387
- childrenSub = currentItem.children('.wpr-sub-menu');
388
-
389
- // Reset
390
- if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
391
- subMenuAnimation( subMenuDeep.find('.wpr-sub-menu'), false );
392
- }
393
-
394
- if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
395
- e.preventDefault();
396
- currentItem.addClass('wpr-sub-open');
397
- subMenuAnimation( childrenSub, true );
398
-
399
- } else {
400
- currentItem.removeClass('wpr-sub-open');
401
- subMenuAnimation( childrenSub, false );
402
- }
403
- });
404
-
405
- // Reset Subs on Document click
406
- $( document ).mouseup(function (e) {
407
- if ( ! subMenuFirst.is(e.target) && subMenuFirst.has(e.target).length === 0 ) {
408
- subMenuFirst.not().removeClass('wpr-sub-open');
409
- subMenuAnimation( subMenuFirst.children('.wpr-sub-menu'), false );
410
- }
411
- if ( ! subMenuDeep.is(e.target) && subMenuDeep.has(e.target).length === 0 ) {
412
- subMenuDeep.removeClass('wpr-sub-open');
413
- subMenuAnimation( subMenuDeep.children('.wpr-sub-menu'), false );
414
- }
415
- });
416
- } else {
417
- // Mouse Over
418
- subMenuFirst.on( 'mouseenter', function() {
419
- if ( $navMenu.hasClass('wpr-nav-menu-vertical') && $scope.hasClass('wpr-sub-menu-position-absolute') ) {
420
- $navMenu.find('li').not(this).children('.wpr-sub-menu').hide();
421
- // BUGFIX: when menu is vertical and absolute positioned, lvl2 depth sub menus wont show properly on hover
422
- }
423
-
424
- subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
425
- });
426
-
427
- // Deep Subs
428
- subMenuDeep.on( 'mouseenter', function() {
429
- subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
430
- });
431
-
432
-
433
- // Mouse Leave
434
- if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
435
- subMenuFirst.on( 'mouseleave', function() {
436
- subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
437
- });
438
-
439
- subMenuDeep.on( 'mouseleave', function() {
440
- subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
441
- });
442
- } else {
443
-
444
- $navMenu.on( 'mouseleave', function() {
445
- subMenuAnimation( $(this).find('.wpr-sub-menu'), false );
446
- });
447
- }
448
- }
449
-
450
-
451
- // Mobile Menu
452
- var mobileMenu = $mobileNavMenu.find( '.wpr-mobile-nav-menu' );
453
-
454
- // Toggle Button
455
- $mobileNavMenu.find( '.wpr-mobile-toggle' ).on( 'click', function() {
456
- $(this).toggleClass('wpr-mobile-toggle-fx');
457
-
458
- if ( ! $(this).hasClass('wpr-mobile-toggle-open') ) {
459
- $(this).addClass('wpr-mobile-toggle-open');
460
-
461
- if ( $(this).find('.wpr-mobile-toggle-text').length ) {
462
- $(this).children().eq(0).hide();
463
- $(this).children().eq(1).show();
464
- }
465
- } else {
466
- $(this).removeClass('wpr-mobile-toggle-open');
467
- $(this).trigger('focusout');
468
-
469
- if ( $(this).find('.wpr-mobile-toggle-text').length ) {
470
- $(this).children().eq(1).hide();
471
- $(this).children().eq(0).show();
472
- }
473
- }
474
-
475
- // Show Menu
476
- $(this).parent().next().stop().slideToggle();
477
-
478
- // Fix Width
479
- fullWidthMobileDropdown();
480
- });
481
-
482
- // Sub Menu Class
483
- mobileMenu.find('.sub-menu').removeClass('wpr-sub-menu').addClass('wpr-mobile-sub-menu');
484
-
485
- // Sub Menu Dropdown
486
- mobileMenu.find('.menu-item-has-children').children('a').on( 'click', function(e) {
487
- var parentItem = $(this).closest('li');
488
-
489
- // Toggle
490
- if ( ! parentItem.hasClass('wpr-mobile-sub-open') ) {
491
- e.preventDefault();
492
- parentItem.addClass('wpr-mobile-sub-open');
493
- parentItem.children('.wpr-mobile-sub-menu').first().stop().slideDown();
494
- } else {
495
- parentItem.removeClass('wpr-mobile-sub-open');
496
- parentItem.children('.wpr-mobile-sub-menu').first().stop().slideUp();
497
- }
498
- });
499
-
500
- // Run Functions
501
- fullWidthMobileDropdown();
502
-
503
- // Run Functions on Resize
504
- $(window).smartresize(function() {
505
- fullWidthMobileDropdown();
506
- });
507
-
508
- // Full Width Dropdown
509
- function fullWidthMobileDropdown() {
510
- if ( ! $scope.hasClass( 'wpr-mobile-menu-full-width' ) || ! $scope.closest('.elementor-column').length ) {
511
- return;
512
- }
513
-
514
- var eColumn = $scope.closest('.elementor-column'),
515
- mWidth = $scope.closest('.elementor-top-section').outerWidth() - 2 * mobileMenu.offset().left,
516
- mPosition = eColumn.offset().left + parseInt(eColumn.css('padding-left'), 10);
517
-
518
- mobileMenu.css({
519
- 'width' : mWidth +'px',
520
- 'left' : - mPosition +'px'
521
- });
522
- }
523
-
524
- // Sub Menu Animation
525
- function subMenuAnimation( selector, show ) {
526
- if ( show === true ) {
527
- if ( $scope.hasClass('wpr-sub-menu-fx-slide') ) {
528
- selector.stop().slideDown();
529
- } else {
530
- selector.stop().fadeIn();
531
- }
532
- } else {
533
- if ( $scope.hasClass('wpr-sub-menu-fx-slide') ) {
534
- selector.stop().slideUp();
535
- } else {
536
- selector.stop().fadeOut();
537
- }
538
- }
539
- }
540
-
541
- }, // End widgetNavMenu
542
-
543
- widgetMegaMenu: function( $scope ) {
544
-
545
- var $navMenu = $scope.find( '.wpr-nav-menu-container' ),
546
- $mobileNavMenu = $scope.find( '.wpr-mobile-nav-menu-container' );
547
-
548
- // Menu
549
- var subMenuFirst = $navMenu.find( '.wpr-nav-menu > li.menu-item-has-children' ),
550
- subMenuDeep = $navMenu.find( '.wpr-sub-menu li.menu-item-has-children' );
551
-
552
- if ( $scope.find('.wpr-mobile-toggle').length ) {
553
- $scope.find('a').on('click', function() {
554
- if (this.pathname == window.location.pathname && !($(this).parent('li').children().length > 1)) {
555
- $scope.find('.wpr-mobile-toggle').trigger('click');
556
- }
557
- });
558
- }
559
-
560
- // Click
561
- if ( $navMenu.attr('data-trigger') === 'click' ) {
562
- // First Sub
563
- subMenuFirst.children('a').on( 'click', function(e) {
564
- var currentItem = $(this).parent(),
565
- childrenSub = currentItem.children('.wpr-sub-menu, .wpr-sub-mega-menu');
566
-
567
- // Reset
568
- subMenuFirst.not(currentItem).removeClass('wpr-sub-open');
569
- if ( $navMenu.hasClass('wpr-nav-menu-horizontal') || ( $navMenu.hasClass('wpr-nav-menu-vertical') ) ) {
570
- subMenuAnimation( subMenuFirst.children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
571
- }
572
-
573
- if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
574
- e.preventDefault();
575
- currentItem.addClass('wpr-sub-open');
576
- subMenuAnimation( childrenSub, true );
577
- } else {
578
- currentItem.removeClass('wpr-sub-open');
579
- subMenuAnimation( childrenSub, false );
580
- }
581
- });
582
-
583
- // Deep Subs
584
- subMenuDeep.on( 'click', function(e) {
585
- var currentItem = $(this),
586
- childrenSub = currentItem.children('.wpr-sub-menu');
587
-
588
- // Reset
589
- if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
590
- subMenuAnimation( subMenuDeep.find('.wpr-sub-menu'), false );
591
- }
592
-
593
- if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
594
- e.preventDefault();
595
- currentItem.addClass('wpr-sub-open');
596
- subMenuAnimation( childrenSub, true );
597
-
598
- } else {
599
- currentItem.removeClass('wpr-sub-open');
600
- subMenuAnimation( childrenSub, false );
601
- }
602
- });
603
-
604
- // Reset Subs on Document click
605
- $( document ).mouseup(function (e) {
606
- if ( ! subMenuFirst.is(e.target) && subMenuFirst.has(e.target).length === 0 ) {
607
- subMenuFirst.not().removeClass('wpr-sub-open');
608
- subMenuAnimation( subMenuFirst.children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
609
- }
610
- if ( ! subMenuDeep.is(e.target) && subMenuDeep.has(e.target).length === 0 ) {
611
- subMenuDeep.removeClass('wpr-sub-open');
612
- subMenuAnimation( subMenuDeep.children('.wpr-sub-menu'), false );
613
- }
614
- });
615
-
616
- // Hover
617
- } else {
618
- // Mouse Over
619
- subMenuFirst.on( 'mouseenter', function() {
620
- subMenuAnimation( $(this).children('.wpr-sub-menu, .wpr-sub-mega-menu'), true );
621
- });
622
-
623
- subMenuDeep.on( 'mouseenter', function() {
624
- subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
625
- });
626
-
627
- // Mouse Leave
628
- subMenuFirst.on( 'mouseleave', function() {
629
- subMenuAnimation( $(this).children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
630
- });
631
-
632
- subMenuDeep.on( 'mouseleave', function() {
633
- subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
634
- });
635
- }
636
-
637
- // Mobile Menu
638
- var mobileMenu = $mobileNavMenu.find( '.wpr-mobile-nav-menu' );
639
-
640
- // Toggle Button
641
- $mobileNavMenu.find( '.wpr-mobile-toggle' ).on( 'click', function() {
642
- // Change Toggle Text
643
- if ( ! $(this).hasClass('wpr-mobile-toggle-open') ) {
644
- $(this).addClass('wpr-mobile-toggle-open');
645
-
646
- if ( $(this).find('.wpr-mobile-toggle-text').length ) {
647
- $(this).children().eq(0).hide();
648
- $(this).children().eq(1).show();
649
- }
650
- } else {
651
- $(this).removeClass('wpr-mobile-toggle-open');
652
- $(this).trigger('focusout');
653
-
654
- if ( $(this).find('.wpr-mobile-toggle-text').length ) {
655
- $(this).children().eq(1).hide();
656
- $(this).children().eq(0).show();
657
- }
658
- }
659
-
660
- // Show Menu
661
- if ( $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
662
- $('body').css('overflow', 'hidden');
663
- $(this).parent().siblings('.wpr-mobile-mega-menu-wrap').toggleClass('wpr-mobile-mega-menu-open');
664
- } else {
665
- $(this).parent().siblings('.wpr-mobile-mega-menu-wrap').stop().slideToggle();
666
- }
667
-
668
- // Hide Off-Canvas Menu
669
- $scope.find('.mobile-mega-menu-close').on('click', function() {
670
- $(this).closest('.wpr-mobile-mega-menu-wrap').removeClass('wpr-mobile-mega-menu-open');
671
- $('body').css('overflow', 'visible');
672
- });
673
- $scope.find('.wpr-mobile-mega-menu-overlay').on('click', function() {
674
- $(this).siblings('.wpr-mobile-mega-menu-wrap').removeClass('wpr-mobile-mega-menu-open');
675
- $('body').css('overflow', 'visible');
676
- });
677
-
678
- // Fix Width
679
- fullWidthMobileDropdown();
680
- });
681
-
682
- // Sub Menu Class
683
- mobileMenu.find('.sub-menu').removeClass('wpr-sub-menu').addClass('wpr-mobile-sub-menu');
684
-
685
- // Add Submenu Icon
686
- let mobileSubIcon = mobileMenu.find('.wpr-mobile-sub-icon'),
687
- mobileSubIconClass = 'fas ';
688
-
689
- if ( $scope.hasClass('wpr-sub-icon-caret-down') ) {
690
- mobileSubIconClass += 'fa-caret-down';
691
- } else if ( $scope.hasClass('wpr-sub-icon-angle-down') ) {
692
- mobileSubIconClass += 'fa-angle-down';
693
- } else if ( $scope.hasClass('wpr-sub-icon-chevron-down') ) {
694
- mobileSubIconClass += 'fa-chevron-down';
695
- } else if ( $scope.hasClass('wpr-sub-icon-plus') ) {
696
- mobileSubIconClass += 'fa-plus';
697
- }
698
-
699
- mobileSubIcon.addClass(mobileSubIconClass);
700
-
701
- // Sub Menu Dropdown
702
- mobileMenu.find('.menu-item-has-children > a .wpr-mobile-sub-icon, .menu-item-has-children > a[href="#"]').on( 'click', function(e) {
703
- e.preventDefault();
704
- e.stopPropagation();
705
-
706
- var parentItem = $(this).closest('li.menu-item');
707
-
708
- // Toggle
709
- if ( ! parentItem.hasClass('wpr-mobile-sub-open') ) {
710
- e.preventDefault();
711
- parentItem.addClass('wpr-mobile-sub-open');
712
-
713
- if ( ! $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
714
- $(window).trigger('resize');
715
- parentItem.children('.wpr-mobile-sub-menu').first().stop().slideDown();
716
- }
717
-
718
- // Mega Menu
719
- if ( parentItem.hasClass('wpr-mega-menu-true') ) {
720
- if ( parentItem.hasClass('wpr-mega-menu-ajax') && ! parentItem.find('.wpr-mobile-sub-mega-menu').find('.elementor').length ) {
721
- let subIcon = parentItem.find('.wpr-mobile-sub-icon');
722
-
723
- $.ajax({
724
- type: 'GET',
725
- url: WprConfig.resturl + '/wprmegamenu/',
726
- data: {
727
- item_id: parentItem.data('id')
728
- },
729
- beforeSend:function() {
730
- subIcon.removeClass(mobileSubIconClass).addClass('fas fa-circle-notch fa-spin');
731
- },
732
- success: function( response ) {
733
- subIcon.removeClass('fas fa-circle-notch fa-spin').addClass(mobileSubIconClass);
734
-
735
- if ( $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
736
- parentItem.find('.wpr-menu-offcanvas-back').after(response);
737
- offCanvasSubMenuAnimation( parentItem );
738
- } else {
739
- parentItem.find('.wpr-mobile-sub-mega-menu').html(response);
740
- parentItem.children('.wpr-mobile-sub-mega-menu').slideDown();
741
- }
742
-
743
- parentItem.find('.wpr-mobile-sub-mega-menu').find('.elementor-element').each(function() {
744
- elementorFrontend.elementsHandler.runReadyTrigger($(this));
745
- });
746
- }
747
- });
748
- } else {
749
- if ( $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
750
- offCanvasSubMenuAnimation( parentItem );
751
- } else {
752
- parentItem.children('.wpr-mobile-sub-mega-menu').slideDown();
753
- }
754
- }
755
- } else {
756
- if ( $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
757
- offCanvasSubMenuAnimation( parentItem );
758
- }
759
- }
760
-
761
- } else {
762
- // SlideUp
763
- parentItem.removeClass('wpr-mobile-sub-open');
764
-
765
- if ( ! $scope.hasClass('wpr-mobile-menu-display-offcanvas') ) {
766
- parentItem.children('.wpr-mobile-sub-menu').slideUp();
767
- parentItem.children('.wpr-mobile-sub-mega-menu').slideUp();
768
- }
769
- }
770
- });
771
-
772
- // Off-Canvas Back Button
773
- $scope.find('.wpr-menu-offcanvas-back').on('click', function() {
774
- $(this).closest('.wpr-mobile-mega-menu').removeClass('wpr-mobile-sub-offcanvas-open');
775
- $(this).closest('.menu-item').removeClass('wpr-mobile-sub-open');
776
- $scope.find('.wpr-mobile-mega-menu-wrap').removeAttr('style');
777
- $scope.find('.wpr-mobile-sub-mega-menu').removeAttr('style');
778
- });
779
-
780
- // Run Functions
781
- MegaMenuCustomWidth();
782
- fullWidthMobileDropdown();
783
-
784
- // Run Functions on Resize
785
- $(window).smartresize(function() {
786
- MegaMenuCustomWidth();
787
- fullWidthMobileDropdown();
788
- });
789
-
790
- // Mega Menu Full or Custom Width
791
- function MegaMenuCustomWidth() {
792
- let megaItem = $scope.find('.wpr-mega-menu-true');
793
-
794
- megaItem.each(function() {
795
- let megaSubMenu = $(this).find('.wpr-sub-mega-menu')
796
-
797
- if ( $(this).hasClass('wpr-mega-menu-width-full') ) {
798
- megaSubMenu.css({
799
- 'max-width' : $(window).width() +'px',
800
- 'left' : - $scope.find('.wpr-nav-menu-container').offset().left +'px'
801
- });
802
- } else if ( $(this).hasClass('wpr-mega-menu-width-stretch') ) {
803
- let elContainer = $(this).closest('.elementor-section');
804
- elContainer = elContainer.hasClass('elementor-inner-section') ? elContainer : elContainer.children('.elementor-container');
805
-
806
- let elWidgetGap = !elContainer.hasClass('elementor-inner-section') ? elContainer.find('.elementor-element-populated').css('padding') : '0';
807
- elWidgetGap = parseInt(elWidgetGap.replace('px', ''), 10);
808
-
809
- let elContainerWidth = elContainer.outerWidth() - (elWidgetGap * 2),
810
- offsetLeft = -($scope.offset().left - elContainer.offset().left) + elWidgetGap;
811
-
812
- megaSubMenu.css({
813
- 'width' : elContainerWidth +'px',
814
- 'left' : offsetLeft +'px'
815
- });
816
- } else if ( $(this).hasClass('wpr-mega-menu-width-custom') ) {
817
- megaSubMenu.css({
818
- 'width' : $(this).data('custom-width') +'px',
819
- });
820
- } else if ( $(this).hasClass('wpr-mega-menu-width-default') && $(this).hasClass('wpr-mega-menu-pos-relative') ) {
821
- megaSubMenu.css({
822
- 'width' : $(this).closest('.elementor-column').outerWidth() +'px',
823
- });
824
- }
825
- });
826
- }
827
-
828
- // Full Width Dropdown
829
- function fullWidthMobileDropdown() {
830
- if ( ! $scope.hasClass( 'wpr-mobile-menu-full-width' ) || ! $scope.closest('.elementor-column').length ) {
831
- return;
832
- }
833
-
834
- var eColumn = $scope.closest('.elementor-column'),
835
- mWidth = $scope.closest('.elementor-top-section').outerWidth() - 2 * mobileMenu.offset().left,
836
- mPosition = eColumn.offset().left + parseInt(eColumn.css('padding-left'), 10);
837
-
838
- mobileMenu.parent('div').css({
839
- 'width' : mWidth +'px',
840
- 'left' : - mPosition +'px'
841
- });
842
- }
843
-
844
- // Sub Menu Animation
845
- function subMenuAnimation( selector, show ) {
846
- if ( show === true ) {
847
- selector.stop().addClass('wpr-animate-sub');
848
- } else {
849
- selector.stop().removeClass('wpr-animate-sub');
850
- }
851
- }
852
-
853
- // Off-Canvas Sub Menu Animation
854
- function offCanvasSubMenuAnimation( selector ) {
855
- let title = selector.children('a').clone().children().remove().end().text();
856
-
857
- selector.closest('.wpr-mobile-mega-menu').addClass('wpr-mobile-sub-offcanvas-open');
858
- selector.find('.wpr-menu-offcanvas-back').find('h3').text(title);
859
-
860
- let parentItem = $scope.find('.wpr-mobile-mega-menu').children('.wpr-mobile-sub-open'),
861
- subSelector = parentItem.children('ul').length ? parentItem.children('ul') : parentItem.children('.wpr-mobile-sub-mega-menu'),
862
- subHeight = subSelector.outerHeight();
863
-
864
- if ( subHeight > $(window).height() ) {
865
- $scope.find('.wpr-mobile-sub-mega-menu').not(selector.find('.wpr-mobile-sub-mega-menu')).hide();
866
- $scope.find('.wpr-mobile-mega-menu-wrap').css('overflow-y', 'scroll');
867
- }
868
- }
869
-
870
- }, // End widgetMegaMenu
871
-
872
- OnepageNav: function( $scope ) {
873
- $scope.find( '.wpr-onepage-nav-item' ).on( 'click', function(event) {
874
- event.preventDefault();
875
-
876
- var section = $( $(this).find( 'a' ).attr( 'href' ) ),
877
- scrollSpeed = parseInt( $(this).parent().attr( 'data-speed' ), 10 );
878
-
879
- $( 'html, body' ).animate({ scrollTop: section.offset().top }, scrollSpeed );
880
- // $( 'body' ).animate({ scrollTop: section.offset().top }, scrollSpeed );
881
-
882
- // Active Class
883
- getSectionOffset( $(window).scrollTop() );
884
- });
885
-
886
- // Trigger Fake Scroll
887
- if ( 'yes' === $scope.find( '.wpr-onepage-nav' ).attr( 'data-highlight' ) ) {
888
- setTimeout(function() {
889
- $(window).scroll();
890
- }, 10 );
891
- }
892
-
893
- // Active Class
894
- $(window).scroll(function() {
895
- getSectionOffset( $(this).scrollTop() );
896
- });
897
-
898
- // Get Offset
899
- function getSectionOffset( scrollTop ) {
900
- if ( 'yes' !== $scope.find( '.wpr-onepage-nav' ).attr( 'data-highlight' ) ) {
901
- return;
902
- }
903
- // Reset Active
904
- $scope.find( '.wpr-onepage-nav-item' ).children( 'a' ).removeClass( 'wpr-onepage-active-item' );
905
-
906
- // Set Active
907
- $( '.elementor-section' ).each(function() {
908
- var secOffTop = $(this).offset().top,
909
- secOffBot = secOffTop + $(this).outerHeight();
910
-
911
- if ( scrollTop >= secOffTop && scrollTop < secOffBot ) {
912
- $scope.find( '.wpr-onepage-nav-item' ).children( 'a[href="#'+ $(this).attr('id') +'"]' ).addClass( 'wpr-onepage-active-item' );
913
- }
914
- });
915
- }
916
-
917
- }, // End OnepageNav
918
-
919
- widgetGrid: function( $scope ) {
920
- var iGrid = $scope.find( '.wpr-grid' );
921
- var loadedItems;
922
-
923
- if ( ! iGrid.length ) {
924
- return;
925
- }
926
-
927
- if ( $scope.find('.woocommerce-result-count').length ) {
928
- var resultCountText = $scope.find('.woocommerce-result-count').text();
929
- resultCountText = resultCountText.replace( /\d\u2013\d+/, '1\u2013' + $scope.find('.wpr-grid-item').length );
930
-
931
- $scope.find('.woocommerce-result-count').text(resultCountText);
932
- }
933
-
934
- // Settings
935
- var settings = iGrid.attr( 'data-settings' );
936
-
937
- if ( $scope.find(".wpr-grid-orderby form").length ) {
938
- var select = $scope.find(".wpr-grid-orderby form");
939
- $scope.find(".orderby").on("change", function () {
940
- select.trigger("submit");
941
- });
942
- }
943
-
944
- // Grid
945
- if ( typeof settings !== typeof undefined && settings !== false ) {
946
- settings = JSON.parse( iGrid.attr( 'data-settings' ) );
947
-
948
- // Init Functions
949
- isotopeLayout( settings );
950
- setTimeout(function() {
951
- isotopeLayout( settings );
952
- }, 100 );
953
-
954
- if ( WprElements.editorCheck() ) {
955
- setTimeout(function() {
956
- isotopeLayout( settings );
957
- }, 500 );
958
- setTimeout(function() {
959
- isotopeLayout( settings );
960
- }, 1000 );
961
- }
962
-
963
- $( window ).on( 'load', function() {
964
- setTimeout(function() {
965
- isotopeLayout( settings );
966
- }, 100 );
967
- });
968
-
969
- $(window).smartresize(function(){
970
- setTimeout(function() {
971
- isotopeLayout( settings );
972
- }, 200 );
973
- });
974
-
975
- isotopeFilters( settings );
976
-
977
- var initialItems = 0;
978
-
979
- // Filtering Transitions
980
- iGrid.on( 'arrangeComplete', function( event, filteredItems ) {
981
- var deepLinkStager = 0,
982
- filterStager = 0,
983
- initStager = 0,
984
- duration = settings.animation_duration,
985
- filterDuration = settings.filters_animation_duration;
986
-
987
- if ( iGrid.hasClass( 'grid-images-loaded' ) ) {
988
- initStager = 0;
989
- } else {
990
- iGrid.css( 'opacity', '1' );
991
-
992
- // Default Animation
993
- if ( 'default' === settings.animation && 'default' === settings.filters_animation ) {
994
- return;
995
- }
996
- }
997
-
998
- for ( var key in filteredItems ) {
999
- if ( initialItems == 0 || key > initialItems - 1 ) {
1000
- initStager += settings.animation_delay;
1001
- $scope.find( filteredItems[key]['element'] ).find( '.wpr-grid-item-inner' ).css({
1002
- 'opacity' : '1',
1003
- 'top' : '0',
1004
- 'transform' : 'scale(1)',
1005
- 'transition' : 'all '+ duration +'s ease-in '+ initStager +'s',
1006
- });
1007
- }
1008
-
1009
- filterStager += settings.filters_animation_delay;
1010
- if ( iGrid.hasClass( 'grid-images-loaded' ) ) {
1011
- $scope.find( filteredItems[key]['element'] ).find( '.wpr-grid-item-inner' ).css({
1012
- 'transition' : 'all '+ filterDuration +'s ease-in '+ filterStager +'s',
1013
- });
1014
- }
1015
-
1016
- // DeepLinking
1017
- var deepLink = window.location.hash;
1018
-
1019
- if ( deepLink.indexOf( '#filter:' ) >= 0 && deepLink.indexOf( '#filter:*' ) < 0 ) {
1020
- deepLink = deepLink.replace( '#filter:', '' );
1021
-
1022
- $scope.find( filteredItems[key]['element'] ).filter(function() {
1023
- if ( $(this).hasClass( deepLink ) ) {
1024
- deepLinkStager += settings.filters_animation_delay;
1025
- return $(this);
1026
- }
1027
- }).find( '.wpr-grid-item-inner' ).css({
1028
- 'transition-delay' : deepLinkStager +'s'
1029
- });
1030
- }
1031
- }
1032
-
1033
- initialItems = filteredItems.length;
1034
- });
1035
-
1036
- // Grid Images Loaded
1037
- iGrid.imagesLoaded().progress( function( instance, image ) {
1038
- if ( '1' !== iGrid.css( 'opacity' ) ) {
1039
- iGrid.css( 'opacity', '1' );
1040
- }
1041
-
1042
- setTimeout(function() {
1043
- iGrid.addClass( 'grid-images-loaded' );
1044
- }, 500 );
1045
- });
1046
-
1047
- // Infinite Scroll / Load More
1048
- if ( ( 'load-more' === settings.pagination_type || 'infinite-scroll' === settings.pagination_type ) && ( $scope.find( '.wpr-grid-pagination' ).length && ! WprElements.editorCheck() ) ) {
1049
-
1050
- var pagination = $scope.find( '.wpr-grid-pagination' ),
1051
- scopeClass = '.elementor-element-'+ $scope.attr( 'data-id' );
1052
-
1053
- var navClass = false,
1054
- threshold = false;
1055
-
1056
- if ( 'infinite-scroll' === settings.pagination_type ) {
1057
- threshold = 300;
1058
- navClass = scopeClass +' .wpr-load-more-btn';
1059
- }
1060
-
1061
- iGrid.infiniteScroll({
1062
- path: scopeClass +' .wpr-grid-pagination a',
1063
- hideNav: navClass,
1064
- append: false,
1065
- history: false,
1066
- scrollThreshold: threshold,
1067
- status: scopeClass +' .page-load-status',
1068
- onInit: function() {
1069
- this.on( 'load', function() {
1070
- iGrid.removeClass( 'grid-images-loaded' );
1071
- });
1072
- }
1073
- });
1074
-
1075
- // Request
1076
- iGrid.on( 'request.infiniteScroll', function( event, path ) {
1077
- pagination.find( '.wpr-load-more-btn' ).hide();
1078
- pagination.find( '.wpr-pagination-loading' ).css( 'display', 'inline-block' );
1079
- });
1080
-
1081
- // Load
1082
- var pagesLoaded = 0;
1083
-
1084
- iGrid.on( 'load.infiniteScroll', function( event, response ) {
1085
- pagesLoaded++;
1086
-
1087
- // get posts from response
1088
- var items = $( response ).find( scopeClass ).find( '.wpr-grid-item' );
1089
-
1090
- if ( $scope.find('.woocommerce-result-count').length ) {
1091
- var resultCount = $scope.find('.woocommerce-result-count').text();
1092
- var updatedResultCount = resultCount.replace( /\d\u2013\d+/, '1\u2013' + ( $scope.find('.wpr-grid-item').length + items.length ) );
1093
- $scope.find('.woocommerce-result-count').text(updatedResultCount);
1094
- }
1095
-
1096
- iGrid.infiniteScroll( 'appendItems', items );
1097
- iGrid.isotopewpr( 'appended', items );
1098
-
1099
- items.imagesLoaded().progress( function( instance, image ) {
1100
- isotopeLayout( settings );
1101
-
1102
- // Fix Layout
1103
- setTimeout(function() {
1104
- isotopeLayout( settings );
1105
- isotopeFilters( settings );
1106
- }, 10 );
1107
-
1108
- setTimeout(function() {
1109
- iGrid.addClass( 'grid-images-loaded' );
1110
- }, 500 );
1111
- });
1112
-
1113
- // Loading
1114
- pagination.find( '.wpr-pagination-loading' ).hide();
1115
-
1116
- if ( settings.pagination_max_pages - 1 !== pagesLoaded ) {
1117
- if ( 'load-more' === settings.pagination_type ) {
1118
- pagination.find( '.wpr-load-more-btn' ).fadeIn();
1119
-
1120
- if ( '*' !== $scope.find('.wpr-active-filter').attr('data-filter') ) {
1121
- let dataFilterClass = $scope.find('.wpr-active-filter').attr('data-filter').substring(1);
1122
- items.each(function() {
1123
- if ( !$(this).hasClass(dataFilterClass) ) {
1124
- loadedItems = false;
1125
- } else {
1126
- loadedItems = true;
1127
- return false;
1128
- }
1129
- });
1130
-
1131
- if ( !loadedItems ) {
1132
- $scope.find( '.wpr-grid' ).infiniteScroll( 'loadNextPage' );
1133
- }
1134
- }
1135
- }
1136
- } else {
1137
- pagination.find( '.wpr-pagination-finish' ).fadeIn( 1000 );
1138
- pagination.delay( 2000 ).fadeOut( 1000 );
1139
- setTimeout(function() {
1140
- pagination.find( '.wpr-pagination-loading' ).hide();
1141
- }, 500 );
1142
- }
1143
-
1144
- // Init Likes
1145
- setTimeout(function() {
1146
- postLikes( settings );
1147
- }, 300 );
1148
-
1149
- // Init Lightbox
1150
- lightboxPopup( settings );
1151
-
1152
- // Fix Lightbox
1153
- iGrid.data( 'lightGallery' ).destroy( true );
1154
- iGrid.lightGallery( settings.lightbox );
1155
-
1156
- // Init Media Hover Link
1157
- mediaHoverLink();
1158
-
1159
- // Init Post Sharing
1160
- postSharing();
1161
- });
1162
-
1163
- pagination.find( '.wpr-load-more-btn' ).on( 'click', function() {
1164
- iGrid.infiniteScroll( 'loadNextPage' );
1165
- return false;
1166
- });
1167
-
1168
- }
1169
-
1170
- // Slider
1171
- } else {
1172
- iGrid.animate({ 'opacity': '1' }, 1000);
1173
-
1174
- var sliderClass = $scope.attr('class'),
1175
- sliderColumnsDesktop = sliderClass.match(/wpr-grid-slider-columns-\d/) ? sliderClass.match(/wpr-grid-slider-columns-\d/).join().slice(-1) : 2,
1176
- sliderColumnsWideScreen = sliderClass.match(/columns--widescreen\d/) ? sliderClass.match(/columns--widescreen\d/).join().slice(-1) : sliderColumnsDesktop,
1177
- sliderColumnsLaptop = sliderClass.match(/columns--laptop\d/) ? sliderClass.match(/columns--laptop\d/).join().slice(-1) : sliderColumnsDesktop,
1178
- sliderColumnsTabletExtra = sliderClass.match(/columns--tablet_extra\d/) ? sliderClass.match(/columns--tablet_extra\d/).join().slice(-1) : sliderColumnsTablet,
1179
- sliderColumnsTablet = sliderClass.match(/columns--tablet\d/) ? sliderClass.match(/columns--tablet\d/).join().slice(-1) : 2,
1180
- sliderColumnsMobileExtra = sliderClass.match(/columns--mobile_extra\d/) ? sliderClass.match(/columns--mobile_extra\d/).join().slice(-1) : sliderColumnsTablet,
1181
- sliderColumnsMobile = sliderClass.match(/columns--mobile\d/) ? sliderClass.match(/columns--mobile\d/).join().slice(-1) : 1,
1182
- sliderSlidesToScroll = sliderClass.match(/wpr-grid-slides-to-scroll-\d/) ? +(sliderClass.match(/wpr-grid-slides-to-scroll-\d/).join().slice(-1)) : 1;
1183
-
1184
- iGrid.slick({
1185
- appendDots : $scope.find( '.wpr-grid-slider-dots' ),
1186
- customPaging : function ( slider, i ) {
1187
- var slideNumber = (i + 1),
1188
- totalSlides = slider.slideCount;
1189
-
1190
- return '<span class="wpr-grid-slider-dot"></span>';
1191
- },
1192
- slidesToShow: sliderColumnsDesktop,
1193
- responsive: [
1194
- {
1195
- breakpoint: 10000,
1196
- settings: {
1197
- slidesToShow: sliderColumnsWideScreen,
1198
- slidesToScroll: sliderSlidesToScroll > sliderColumnsWideScreen ? 1 : sliderSlidesToScroll
1199
- }
1200
- },
1201
- {
1202
- breakpoint: 2399,
1203
- settings: {
1204
- slidesToShow: sliderColumnsDesktop,
1205
- slidesToScroll: sliderSlidesToScroll > sliderColumnsDesktop ? 1 : sliderSlidesToScroll
1206
- }
1207
- },
1208
- {
1209
- breakpoint: 1221,
1210
- settings: {
1211
- slidesToShow: sliderColumnsLaptop,
1212
- slidesToScroll: sliderSlidesToScroll > sliderColumnsLaptop ? 1 : sliderSlidesToScroll
1213
- }
1214
- },
1215
- {
1216
- breakpoint: 1200,
1217
- settings: {
1218
- slidesToShow: sliderColumnsTabletExtra,
1219
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTabletExtra ? 1 : sliderSlidesToScroll
1220
- }
1221
- },
1222
- {
1223
- breakpoint: 1024,
1224
- settings: {
1225
- slidesToShow: sliderColumnsTablet,
1226
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTablet ? 1 : sliderSlidesToScroll
1227
- }
1228
- },
1229
- {
1230
- breakpoint: 880,
1231
- settings: {
1232
- slidesToShow: sliderColumnsMobileExtra,
1233
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobileExtra ? 1 : sliderSlidesToScroll
1234
- }
1235
- },
1236
- {
1237
- breakpoint: 768,
1238
- settings: {
1239
- slidesToShow: sliderColumnsMobile,
1240
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobile ? 1 : sliderSlidesToScroll
1241
- }
1242
- }
1243
- ],
1244
- });
1245
-
1246
- var gridNavPrevArrow = $scope.find('.wpr-grid-slider-prev-arrow');
1247
- var gridNavNextArrow = $scope.find('.wpr-grid-slider-next-arrow');
1248
-
1249
- if ( gridNavPrevArrow.length > 0 && gridNavNextArrow.length > 0 ) {
1250
- var positionSum = gridNavPrevArrow.position().left * -2;
1251
- if ( positionSum > 0 ) {
1252
- $(window).on('load', function() {
1253
- if ( $(window).width() <= ($scope.outerWidth() + gridNavPrevArrow.outerWidth() + gridNavNextArrow.outerWidth() + positionSum) ) {
1254
- gridNavPrevArrow.addClass('wpr-adjust-slider-prev-arrow');
1255
- gridNavNextArrow.addClass('wpr-adjust-slider-next-arrow');
1256
- }
1257
- });
1258
-
1259
- $(window).smartresize(function() {
1260
- if ( $(window).width() <= ($scope.outerWidth() + gridNavPrevArrow.outerWidth() + gridNavNextArrow.outerWidth() + positionSum) ) {
1261
- gridNavPrevArrow.addClass('wpr-adjust-slider-prev-arrow');
1262
- gridNavNextArrow.addClass('wpr-adjust-slider-next-arrow');
1263
- } else {
1264
- gridNavPrevArrow.removeClass('wpr-adjust-slider-prev-arrow');
1265
- gridNavNextArrow.removeClass('wpr-adjust-slider-next-arrow');
1266
- }
1267
- });
1268
- }
1269
- }
1270
-
1271
- // Adjust Horizontal Pagination
1272
- if ( $scope.find( '.slick-dots' ).length && $scope.hasClass( 'wpr-grid-slider-dots-horizontal') ) {
1273
- // Calculate Width
1274
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
1275
-
1276
- // on Load
1277
- if ( $scope.find( '.slick-dots' ).length ) {
1278
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
1279
- }
1280
-
1281
-
1282
- $(window).smartresize(function() {
1283
- setTimeout(function() {
1284
- // Calculate Width
1285
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
1286
-
1287
- // Set Width
1288
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
1289
- }, 300 );
1290
- });
1291
- }
1292
-
1293
- settings = JSON.parse( iGrid.attr( 'data-slick' ) );
1294
- }
1295
-
1296
- // Add To Cart AJAX
1297
- if ( iGrid.find( '.wpr-grid-item-add-to-cart' ).length ) {
1298
- var addCartIcon = iGrid.find( '.wpr-grid-item-add-to-cart' ).find( 'i' ),
1299
- addCartIconClass = addCartIcon.attr( 'class' );
1300
-
1301
- if ( addCartIcon.length ) {
1302
- addCartIconClass = addCartIconClass.substring( addCartIconClass.indexOf('fa-'), addCartIconClass.length );
1303
- }
1304
-
1305
- $( 'body' ).on( 'adding_to_cart', function( ev, button, data ) {
1306
- button.fadeTo( 'slow', 0 );
1307
- });
1308
-
1309
- $( 'body' ).on( 'added_to_cart', function(ev, fragments, hash, button) {
1310
- button.next().fadeTo( 700, 1 );
1311
-
1312
- button.css('display', 'none');
1313
-
1314
- if ( 'sidebar' === button.data('atc-popup') ) {
1315
- if ( $('.wpr-mini-cart-toggle-wrap a').length ) {
1316
- $('.wpr-mini-cart-toggle-wrap a').each(function() {
1317
- if ( 'none' === $(this).closest('.wpr-mini-cart-inner').find('.wpr-mini-cart').css('display') ) {
1318
- $(this).trigger('click');
1319
- }
1320
- });
1321
- }
1322
- } else if ( 'popup' === button.data('atc-popup') ) {
1323
- var popupItem = button.closest('.wpr-grid-item'),
1324
- popupText = popupItem.find('.wpr-grid-item-title').text(),
1325
- popupLink = button.next().attr('href'),
1326
- popupImageSrc = popupItem.find('.wpr-grid-image-wrap').length ? popupItem.find('.wpr-grid-image-wrap').data('src') : '',
1327
- popupAnimation = button.data('atc-animation'),
1328
- fadeOutIn = button.data('atc-fade-out-in'),
1329
- animTime = button.data('atc-animation-time'),
1330
- popupImage,
1331
- animationClass = 'wpr-added-to-cart-default',
1332
- removeAnimationClass;
1333
-
1334
- if ( 'slide-left' === popupAnimation ) {
1335
- animationClass = 'wpr-added-to-cart-slide-in-left';
1336
- removeAnimationClass = 'wpr-added-to-cart-slide-out-left';
1337
- } else if ( 'scale-up' === popupAnimation ) {
1338
- animationClass = 'wpr-added-to-cart-scale-up';
1339
- removeAnimationClass = 'wpr-added-to-cart-scale-down';
1340
- } else if ( 'skew' === popupAnimation ) {
1341
- animationClass = 'wpr-added-to-cart-skew';
1342
- removeAnimationClass = 'wpr-added-to-cart-skew-off';
1343
- } else if ( 'fade' === popupAnimation ) {
1344
- animationClass = 'wpr-added-to-cart-fade';
1345
- removeAnimationClass = 'wpr-added-to-cart-fade-out';
1346
- } else {
1347
- removeAnimationClass = 'wpr-added-to-cart-popup-hide';
1348
- }
1349
-
1350
- if ( '' !== popupImageSrc ) {
1351
- popupImage = '<div class="wpr-added-tc-popup-img"><img src='+popupImageSrc+' alt="" /></div>';
1352
- } else {
1353
- popupImage = '';
1354
- }
1355
-
1356
- $(this).find('.wpr-grid').append('<div class="wpr-added-to-cart-popup ' + animationClass + '">'+ popupImage +'<div class="wpr-added-tc-title"><p>'+ popupText +' was added to cart</p><p><a href='+popupLink+'>View Cart</a></p></div></div>');
1357
-
1358
- setTimeout(() => {
1359
- $(this).find('.wpr-added-to-cart-popup').addClass(removeAnimationClass);
1360
- setTimeout(() => {
1361
- $(this).find('.wpr-added-to-cart-popup').remove();
1362
- }, animTime * 1000);
1363
- }, fadeOutIn * 1000);
1364
- }
1365
-
1366
- if ( addCartIcon.length ) {
1367
- button.find( 'i' ).removeClass( addCartIconClass ).addClass( 'fa-check' );
1368
- setTimeout(function() {
1369
- button.find( 'i' ).removeClass( 'fa-check' ).addClass( addCartIconClass );
1370
- }, 3500 );
1371
- }
1372
- });
1373
- }
1374
-
1375
- // Init Post Sharing
1376
- postSharing();
1377
-
1378
- // Post Sharing
1379
- function postSharing() {
1380
- if ( $scope.find( '.wpr-sharing-trigger' ).length ) {
1381
- var sharingTrigger = $scope.find( '.wpr-sharing-trigger' ),
1382
- sharingInner = $scope.find( '.wpr-post-sharing-inner' ),
1383
- sharingWidth = 5;
1384
-
1385
- // Calculate Width
1386
- sharingInner.first().find( 'a' ).each(function() {
1387
- sharingWidth += $(this).outerWidth() + parseInt( $(this).css('margin-right'), 10 );
1388
- });
1389
-
1390
- // Calculate Margin
1391
- var sharingMargin = parseInt( sharingInner.find( 'a' ).css('margin-right'), 10 );
1392
-
1393
- // Set Positions
1394
- if ( 'left' === sharingTrigger.attr( 'data-direction') ) {
1395
- // Set Width
1396
- sharingInner.css( 'width', sharingWidth +'px' );
1397
-
1398
- // Set Position
1399
- sharingInner.css( 'left', - ( sharingMargin + sharingWidth ) +'px' );
1400
- } else if ( 'right' === sharingTrigger.attr( 'data-direction') ) {
1401
- // Set Width
1402
- sharingInner.css( 'width', sharingWidth +'px' );
1403
-
1404
- // Set Position
1405
- sharingInner.css( 'right', - ( sharingMargin + sharingWidth ) +'px' );
1406
- } else if ( 'top' === sharingTrigger.attr( 'data-direction') ) {
1407
- // Set Margins
1408
- sharingInner.find( 'a' ).css({
1409
- 'margin-right' : '0',
1410
- 'margin-top' : sharingMargin +'px'
1411
- });
1412
-
1413
- // Set Position
1414
- sharingInner.css({
1415
- 'top' : -sharingMargin +'px',
1416
- 'left' : '50%',
1417
- '-webkit-transform' : 'translate(-50%, -100%)',
1418
- 'transform' : 'translate(-50%, -100%)'
1419
- });
1420
- } else if ( 'right' === sharingTrigger.attr( 'data-direction') ) {
1421
- // Set Width
1422
- sharingInner.css( 'width', sharingWidth +'px' );
1423
-
1424
- // Set Position
1425
- sharingInner.css({
1426
- 'left' : sharingMargin +'px',
1427
- // 'bottom' : - ( sharingInner.outerHeight() + sharingTrigger.outerHeight() ) +'px',
1428
- });
1429
- } else if ( 'bottom' === sharingTrigger.attr( 'data-direction') ) {
1430
- // Set Margins
1431
- sharingInner.find( 'a' ).css({
1432
- 'margin-right' : '0',
1433
- 'margin-bottom' : sharingMargin +'px'
1434
- });
1435
-
1436
- // Set Position
1437
- sharingInner.css({
1438
- 'bottom' : -sharingMargin +'px',
1439
- 'left' : '50%',
1440
- '-webkit-transform' : 'translate(-50%, 100%)',
1441
- 'transform' : 'translate(-50%, 100%)'
1442
- });
1443
- }
1444
-
1445
- if ( 'click' === sharingTrigger.attr( 'data-action' ) ) {
1446
- sharingTrigger.on( 'click', function() {
1447
- var sharingInner = $(this).next();
1448
-
1449
- if ( 'hidden' === sharingInner.css( 'visibility' ) ) {
1450
- sharingInner.css( 'visibility', 'visible' );
1451
- sharingInner.find( 'a' ).css({
1452
- 'opacity' : '1',
1453
- 'top' : '0'
1454
- });
1455
-
1456
- setTimeout( function() {
1457
- sharingInner.find( 'a' ).addClass( 'wpr-no-transition-delay' );
1458
- }, sharingInner.find( 'a' ).length * 100 );
1459
- } else {
1460
- sharingInner.find( 'a' ).removeClass( 'wpr-no-transition-delay' );
1461
-
1462
- sharingInner.find( 'a' ).css({
1463
- 'opacity' : '0',
1464
- 'top' : '-5px'
1465
- });
1466
- setTimeout( function() {
1467
- sharingInner.css( 'visibility', 'hidden' );
1468
- }, sharingInner.find( 'a' ).length * 100 );
1469
- }
1470
- });
1471
- } else {
1472
- sharingTrigger.on( 'mouseenter', function() {
1473
- var sharingInner = $(this).next();
1474
-
1475
- sharingInner.css( 'visibility', 'visible' );
1476
- sharingInner.find( 'a' ).css({
1477
- 'opacity' : '1',
1478
- 'top' : '0',
1479
- });
1480
-
1481
- setTimeout( function() {
1482
- sharingInner.find( 'a' ).addClass( 'wpr-no-transition-delay' );
1483
- }, sharingInner.find( 'a' ).length * 100 );
1484
- });
1485
- $scope.find( '.wpr-grid-item-sharing' ).on( 'mouseleave', function() {
1486
- var sharingInner = $(this).find( '.wpr-post-sharing-inner' );
1487
-
1488
- sharingInner.find( 'a' ).removeClass( 'wpr-no-transition-delay' );
1489
-
1490
- sharingInner.find( 'a' ).css({
1491
- 'opacity' : '0',
1492
- 'top' : '-5px'
1493
- });
1494
- setTimeout( function() {
1495
- sharingInner.css( 'visibility', 'hidden' );
1496
- }, sharingInner.find( 'a' ).length * 100 );
1497
- });
1498
- }
1499
- }
1500
- }
1501
-
1502
- // Init Media Hover Link
1503
- mediaHoverLink();
1504
-
1505
- // Media Hover Link
1506
- function mediaHoverLink() {
1507
- if ( 'yes' === iGrid.find( '.wpr-grid-media-wrap' ).attr( 'data-overlay-link' ) && ! WprElements.editorCheck() ) {
1508
- iGrid.find( '.wpr-grid-media-wrap' ).css('cursor', 'pointer');
1509
-
1510
- iGrid.find( '.wpr-grid-media-wrap' ).on( 'click', function( event ) {
1511
- var targetClass = event.target.className;
1512
-
1513
- if ( -1 !== targetClass.indexOf( 'inner-block' ) || -1 !== targetClass.indexOf( 'wpr-cv-inner' ) ||
1514
- -1 !== targetClass.indexOf( 'wpr-grid-media-hover' ) ) {
1515
- event.preventDefault();
1516
-
1517
- var itemUrl = $(this).find( '.wpr-grid-media-hover-bg' ).attr( 'data-url' ),
1518
- itemUrl = itemUrl.replace('#new_tab', '');
1519
-
1520
- if ( '_blank' === iGrid.find( '.wpr-grid-item-title a' ).attr('target') ) {
1521
- window.open(itemUrl, '_blank').focus();
1522
- } else {
1523
- window.location.href = itemUrl;
1524
- }
1525
- }
1526
- });
1527
- }
1528
- }
1529
-
1530
- // Init Lightbox
1531
- if ( !$scope.hasClass('elementor-widget-wpr-woo-category-grid-pro') ) {
1532
- lightboxPopup( settings );
1533
- }
1534
-
1535
- // Lightbox Popup
1536
- function lightboxPopup( settings ) {
1537
- if ( -1 === $scope.find( '.wpr-grid-item-lightbox' ).length ) {
1538
- return;
1539
- }
1540
-
1541
- var lightbox = $scope.find( '.wpr-grid-item-lightbox' ),
1542
- lightboxOverlay = lightbox.find( '.wpr-grid-lightbox-overlay' ).first();
1543
-
1544
- // Set Src Attributes
1545
- lightbox.each(function() {
1546
- var source = $(this).find('.inner-block > span').attr( 'data-src' ),
1547
- gridItem = $(this).closest( 'article' ).not('.slick-cloned');
1548
-
1549
- if ( ! iGrid.hasClass( 'wpr-media-grid' ) ) {
1550
- gridItem.find( '.wpr-grid-image-wrap' ).attr( 'data-src', source );
1551
- }
1552
-
1553
- var dataSource = gridItem.find( '.wpr-grid-image-wrap' ).attr( 'data-src' );
1554
-
1555
- if ( typeof dataSource !== typeof undefined && dataSource !== false ) {
1556
- if ( -1 === dataSource.indexOf( 'wp-content' ) ) {
1557
- gridItem.find( '.wpr-grid-image-wrap' ).attr( 'data-iframe', 'true' );
1558
- }
1559
- }
1560
- });
1561
-
1562
- // Init Lightbox
1563
- iGrid.lightGallery( settings.lightbox );
1564
-
1565
- // Fix LightGallery Thumbnails
1566
- iGrid.on('onAfterOpen.lg',function() {
1567
- if ( $('.lg-outer').find('.lg-thumb-item').length ) {
1568
- $('.lg-outer').find('.lg-thumb-item').each(function() {
1569
- var imgSrc = $(this).find('img').attr('src'),
1570
- newImgSrc = imgSrc,
1571
- extIndex = imgSrc.lastIndexOf('.'),
1572
- imgExt = imgSrc.slice(extIndex),
1573
- cropIndex = imgSrc.lastIndexOf('-'),
1574
- cropSize = /\d{3,}x\d{3,}/.test(imgSrc.substring(extIndex,cropIndex)) ? imgSrc.substring(extIndex,cropIndex) : false;
1575
-
1576
- if ( 42 <= imgSrc.substring(extIndex,cropIndex).length ) {
1577
- cropSize = '';
1578
- }
1579
-
1580
- if ( cropSize !== '' ) {
1581
- if ( false !== cropSize ) {
1582
- newImgSrc = imgSrc.replace(cropSize, '-150x150');
1583
- } else {
1584
- newImgSrc = [imgSrc.slice(0, extIndex), '-150x150', imgSrc.slice(extIndex)].join('');
1585
- }
1586
- }
1587
-
1588
- // Change SRC
1589
- $(this).find('img').attr('src', newImgSrc);
1590
- });
1591
- }
1592
- });
1593
-
1594
- // Show/Hide Controls
1595
- $scope.find( '.wpr-grid' ).on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
1596
- var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
1597
- lightboxDownload = $( '#lg-download' ).attr( 'href' );
1598
-
1599
- if ( $( '#lg-download' ).length ) {
1600
- if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
1601
- lightboxControls.addClass( 'wpr-hidden-element' );
1602
- } else {
1603
- lightboxControls.removeClass( 'wpr-hidden-element' );
1604
- }
1605
- }
1606
-
1607
- // Autoplay Button
1608
- if ( '' === settings.lightbox.autoplay ) {
1609
- $( '.lg-autoplay-button' ).css({
1610
- 'width' : '0',
1611
- 'height' : '0',
1612
- 'overflow' : 'hidden'
1613
- });
1614
- }
1615
- });
1616
-
1617
- // Overlay
1618
- if ( lightboxOverlay.length ) {
1619
- $scope.find( '.wpr-grid-media-hover-bg' ).after( lightboxOverlay.remove() );
1620
-
1621
- $scope.find( '.wpr-grid-lightbox-overlay' ).on( 'click', function() {
1622
- if ( ! WprElements.editorCheck() ) {
1623
- $(this).closest( 'article' ).find( '.wpr-grid-image-wrap' ).trigger( 'click' );
1624
- } else {
1625
- alert( 'Lightbox is Disabled in the Editor!' );
1626
- }
1627
- });
1628
- } else {
1629
- lightbox.find( '.inner-block > span' ).on( 'click', function() {
1630
- if ( ! WprElements.editorCheck() ) {
1631
- var imageWrap = $(this).closest( 'article' ).find( '.wpr-grid-image-wrap' );
1632
- imageWrap.trigger( 'click' );
1633
- } else {
1634
- alert( 'Lightbox is Disabled in the Editor!' );
1635
- }
1636
- });
1637
- }
1638
- }
1639
-
1640
- // Init Likes
1641
- postLikes( settings );
1642
-
1643
- // Likes
1644
- function postLikes( settings ) {
1645
- if ( ! $scope.find( '.wpr-post-like-button' ).length ) {
1646
- return;
1647
- }
1648
-
1649
- $scope.find( '.wpr-post-like-button' ).on( 'click', function() {
1650
- var current = $(this);
1651
-
1652
- if ( '' !== current.attr( 'data-post-id' ) ) {
1653
-
1654
- $.ajax({
1655
- type: 'POST',
1656
- url: current.attr( 'data-ajax' ),
1657
- data: {
1658
- action : 'wpr_likes_init',
1659
- post_id : current.attr( 'data-post-id' ),
1660
- nonce : current.attr( 'data-nonce' )
1661
- },
1662
- beforeSend:function() {
1663
- current.fadeTo( 500, 0.5 );
1664
- },
1665
- success: function( response ) {
1666
- // Get Icon
1667
- var iconClass = current.attr( 'data-icon' );
1668
-
1669
- // Get Count
1670
- var countHTML = response.count;
1671
-
1672
- if ( '' === countHTML.replace(/<\/?[^>]+(>|$)/g, "") ) {
1673
- countHTML = '<span class="wpr-post-like-count">'+ current.attr( 'data-text' ) +'</span>';
1674
-
1675
- if ( ! current.hasClass( 'wpr-likes-zero' ) ) {
1676
- current.addClass( 'wpr-likes-zero' );
1677
- }
1678
- } else {
1679
- current.removeClass( 'wpr-likes-zero' );
1680
- }
1681
-
1682
- // Update Icon
1683
- if ( current.hasClass( 'wpr-already-liked' ) ) {
1684
- current.prop( 'title', 'Like' );
1685
- current.removeClass( 'wpr-already-liked' );
1686
- current.html( '<i class="'+ iconClass +'"></i>' + countHTML );
1687
- } else {
1688
- current.prop( 'title', 'Unlike' );
1689
- current.addClass( 'wpr-already-liked' );
1690
- current.html( '<i class="'+ iconClass.replace( 'far', 'fas' ) +'"></i>' + countHTML );
1691
- }
1692
-
1693
- current.fadeTo( 500, 1 );
1694
- }
1695
- });
1696
-
1697
- }
1698
-
1699
- return false;
1700
- });
1701
- }
1702
-
1703
- // Isotope Layout
1704
- function isotopeLayout( settings ) {
1705
- var grid = $scope.find( '.wpr-grid' ),
1706
- item = grid.find( '.wpr-grid-item' ),
1707
- itemVisible = item.filter( ':visible' ),
1708
- layout = settings.layout,
1709
- mediaAlign = settings.media_align,
1710
- mediaWidth = settings.media_width,
1711
- mediaDistance = settings.media_distance,
1712
- columns = 3,
1713
- columnsMobile = 1,
1714
- columnsMobileExtra,
1715
- columnsTablet = 2,
1716
- columnsTabletExtra,
1717
- columnsDesktop = parseInt(settings.columns_desktop, 10),
1718
- columnsLaptop,
1719
- columnsWideScreen,
1720
- gutterHr = settings.gutter_hr,
1721
- gutterVr = settings.gutter_vr,
1722
- contWidth = grid.width() + gutterHr - 0.3,
1723
- viewportWidth = $( 'body' ).prop( 'clientWidth' ),
1724
- transDuration = 400;
1725
-
1726
- // Get Responsive Columns
1727
- var prefixClass = $scope.attr('class'),
1728
- prefixClass = prefixClass.split(' ');
1729
-
1730
- for ( var i=0; i < prefixClass.length - 1; i++ ) {
1731
-
1732
- if ( -1 !== prefixClass[i].search(/mobile\d/) ) {
1733
- columnsMobile = prefixClass[i].slice(-1);
1734
- }
1735
-
1736
- if ( -1 !== prefixClass[i].search(/mobile_extra\d/) ) {
1737
- columnsMobileExtra = prefixClass[i].slice(-1);
1738
- }
1739
-
1740
- if ( -1 !== prefixClass[i].search(/tablet\d/) ) {
1741
- columnsTablet = prefixClass[i].slice(-1);
1742
- }
1743
-
1744
- if ( -1 !== prefixClass[i].search(/tablet_extra\d/) ) {
1745
- columnsTabletExtra = prefixClass[i].slice(-1);
1746
- }
1747
-
1748
- if ( -1 !== prefixClass[i].search(/widescreen\d/) ) {
1749
- columnsWideScreen = prefixClass[i].slice(-1);
1750
- }
1751
-
1752
- if ( -1 !== prefixClass[i].search(/laptop\d/) ) {
1753
- columnsLaptop = prefixClass[i].slice(-1);
1754
- }
1755
- }
1756
-
1757
- // Mobile
1758
- if ( 440 >= viewportWidth ) {
1759
- columns = columnsMobile;
1760
- // Mobile Extra
1761
- } else if ( 768 >= viewportWidth ) {
1762
- columns = (columnsMobileExtra) ? columnsMobileExtra : columnsTablet;
1763
-
1764
- // Tablet
1765
- } else if ( 881 >= viewportWidth ) {
1766
- columns = columnsTablet;
1767
- // Tablet Extra
1768
- } else if ( 1025 >= viewportWidth ) {
1769
- columns = (columnsTabletExtra) ? columnsTabletExtra : columnsTablet;
1770
-
1771
- // Laptop
1772
- } else if ( 1201 >= viewportWidth ) {
1773
- columns = (columnsLaptop) ? columnsLaptop : columnsDesktop;
1774
-
1775
- // Desktop
1776
- } else if ( 1920 >= viewportWidth ) {
1777
- columns = columnsDesktop;
1778
-
1779
- // Larger Screens
1780
- } else if ( 2300 >= viewportWidth ) {
1781
- columns = columnsDesktop;
1782
- } else if ( 2650 >= viewportWidth ) {
1783
- columns = (columnsWideScreen) ? columnsWideScreen : columnsDesktop;
1784
- } else if ( 3000 >= viewportWidth ) {
1785
- columns = (columnsWideScreen) ? columnsWideScreen : columnsDesktop;
1786
- } else {
1787
- columns = (columnsWideScreen) ? columnsWideScreen : columnsDesktop;
1788
- }
1789
-
1790
- // Limit Columns for Higher Screens
1791
- if ( columns > 8 ) {
1792
- columns = 8;
1793
- }
1794
-
1795
- if ( 'string' == typeof(columns) && -1 !== columns.indexOf('pro') ) {
1796
- columns = 3;
1797
- }
1798
-
1799
- // Calculate Item Width
1800
- item.outerWidth( Math.floor( contWidth / columns - gutterHr ) );
1801
-
1802
- // Set Vertical Gutter
1803
- item.css( 'margin-bottom', gutterVr +'px' );
1804
-
1805
- // Reset Vertical Gutter for 1 Column Layout
1806
- if ( 1 === columns ) {
1807
- item.last().css( 'margin-bottom', '0' );
1808
- }
1809
-
1810
- // add last row & make all post equal height
1811
- var maxTop = -1;
1812
- itemVisible.each(function ( index ) {
1813
-
1814
- // define
1815
- var thisHieght = $(this).outerHeight(),
1816
- thisTop = parseInt( $(this).css( 'top' ) , 10 );
1817
-
1818
- // determine last row
1819
- if ( thisTop > maxTop ) {
1820
- maxTop = thisTop;
1821
- }
1822
-
1823
- });
1824
-
1825
- if ( 'fitRows' === layout ) {
1826
- itemVisible.each(function() {
1827
- if ( parseInt( $(this).css( 'top' ) ) === maxTop ) {
1828
- $(this).addClass( 'rf-last-row' );
1829
- }
1830
- });
1831
- }
1832
-
1833
- // List Layout
1834
- if ( 'list' === layout ) {
1835
- var imageHeight = item.find( '.wpr-grid-image-wrap' ).outerHeight();
1836
- item.find( '.wpr-grid-item-below-content' ).css( 'min-height', imageHeight +'px' );
1837
-
1838
- if ( $( 'body' ).prop( 'clientWidth' ) < 480 ) {
1839
-
1840
- item.find( '.wpr-grid-media-wrap' ).css({
1841
- 'float' : 'none',
1842
- 'width' : '100%'
1843
- });
1844
-
1845
- item.find( '.wpr-grid-item-below-content' ).css({
1846
- 'float' : 'none',
1847
- 'width' : '100%',
1848
- });
1849
-
1850
- item.find( '.wpr-grid-image-wrap' ).css( 'padding', '0' );
1851
-
1852
- item.find( '.wpr-grid-item-below-content' ).css( 'min-height', '0' );
1853
-
1854
- if ( 'zigzag' === mediaAlign ) {
1855
- item.find( '[class*="elementor-repeater-item"]' ).css( 'text-align', 'center' );
1856
- }
1857
-
1858
- } else {
1859
-
1860
- if ( 'zigzag' !== mediaAlign ) {
1861
-
1862
- item.find( '.wpr-grid-media-wrap' ).css({
1863
- 'float' : mediaAlign,
1864
- 'width' : mediaWidth +'%'
1865
- });
1866
-
1867
- var listGutter = 'left' === mediaAlign ? 'margin-right' : 'margin-left';
1868
- item.find( '.wpr-grid-media-wrap' ).css( listGutter, mediaDistance +'px' );
1869
-
1870
- item.find( '.wpr-grid-item-below-content' ).css({
1871
- 'float' : mediaAlign,
1872
- 'width' : 'calc((100% - '+ mediaWidth +'%) - '+ mediaDistance +'px)',
1873
- });
1874
-
1875
- // Zig-zag
1876
- } else {
1877
- // Even
1878
- item.filter(':even').find( '.wpr-grid-media-wrap' ).css({
1879
- 'float' : 'left',
1880
- 'width' : mediaWidth +'%'
1881
- });
1882
- item.filter(':even').find( '.wpr-grid-item-below-content' ).css({
1883
- 'float' : 'left',
1884
- 'width' : 'calc((100% - '+ mediaWidth +'%) - '+ mediaDistance +'px)',
1885
- });
1886
- item.filter(':even').find( '.wpr-grid-media-wrap' ).css( 'margin-right', mediaDistance +'px' );
1887
-
1888
- // Odd
1889
- item.filter(':odd').find( '.wpr-grid-media-wrap' ).css({
1890
- 'float' : 'right',
1891
- 'width' : mediaWidth +'%'
1892
- });
1893
- item.filter(':odd').find( '.wpr-grid-item-below-content' ).css({
1894
- 'float' : 'right',
1895
- 'width' : 'calc((100% - '+ mediaWidth +'%) - '+ mediaDistance +'px)',
1896
- });
1897
- item.filter(':odd').find( '.wpr-grid-media-wrap' ).css( 'margin-left', mediaDistance +'px' );
1898
-
1899
- // Fix Elements Align
1900
- if ( ! grid.hasClass( 'wpr-grid-list-ready' ) ) {
1901
- item.each( function( index ) {
1902
- var element = $(this).find( '[class*="elementor-repeater-item"]' );
1903
-
1904
- if ( index % 2 === 0 ) {
1905
- element.each(function() {
1906
- if ( ! $(this).hasClass( 'wpr-grid-item-align-center' ) ) {
1907
- if ( 'none' === $(this).css( 'float' ) ) {
1908
- $(this).css( 'text-align', 'left' );
1909
- } else {
1910
- $(this).css( 'float', 'left' );
1911
- }
1912
-
1913
- var inner = $(this).find( '.inner-block' );
1914
- }
1915
- });
1916
- } else {
1917
- element.each(function( index ) {
1918
- if ( ! $(this).hasClass( 'wpr-grid-item-align-center' ) ) {
1919
- if ( 'none' === $(this).css( 'float' ) ) {
1920
- $(this).css( 'text-align', 'right' );
1921
- } else {
1922
- $(this).css( 'float', 'right' );
1923
- }
1924
-
1925
- var inner = $(this).find( '.inner-block' );
1926
-
1927
- if ( '0px' !== inner.css( 'margin-left' ) ) {
1928
- inner.css( 'margin-right', inner.css( 'margin-left' ) );
1929
- inner.css( 'margin-left', '0' );
1930
- }
1931
-
1932
- // First Item
1933
- if ( 0 === index ) {
1934
- if ( '0px' !== inner.css( 'margin-right' ) ) {
1935
- inner.css( 'margin-left', inner.css( 'margin-right' ) );
1936
- inner.css( 'margin-right', '0' );
1937
- }
1938
- }
1939
- }
1940
- });
1941
- }
1942
- });
1943
-
1944
- }
1945
-
1946
- setTimeout(function() {
1947
- if ( ! grid.hasClass( 'wpr-grid-list-ready' ) ) {
1948
- grid.addClass( 'wpr-grid-list-ready' );
1949
- }
1950
- }, 500 );
1951
- }
1952
-
1953
- }
1954
- }
1955
-
1956
- // Set Layout
1957
- if ( 'list' === layout ) {
1958
- layout = 'fitRows';
1959
- }
1960
-
1961
- // No Transition
1962
- if ( 'default' !== settings.filters_animation ) {
1963
- transDuration = 0;
1964
- }
1965
-
1966
- // Run Isotope
1967
- var iGrid = grid.isotopewpr({
1968
- layoutMode: layout,
1969
- masonry: {
1970
- comlumnWidth: contWidth / columns,
1971
- gutter: gutterHr
1972
- },
1973
- fitRows: {
1974
- comlumnWidth: contWidth / columns,
1975
- gutter: gutterHr
1976
- },
1977
- transitionDuration: transDuration,
1978
- percentPosition: true
1979
- });
1980
-
1981
- // return iGrid;//tmp
1982
- }
1983
-
1984
- // Isotope Filters
1985
- function isotopeFilters( settings ) {
1986
-
1987
- // Count
1988
- if ( 'yes' === settings.filters_count ) {
1989
- $scope.find( '.wpr-grid-filters a, .wpr-grid-filters span' ).each(function() {
1990
- if ( '*' === $(this).attr( 'data-filter') ) {
1991
- $(this).find( 'sup' ).text( $scope.find( '.wpr-grid-filters' ).next().find('article').length );
1992
- } else {
1993
- $(this).find( 'sup' ).text( $scope.find( $(this).attr( 'data-filter' ) ).length );
1994
- }
1995
- });
1996
- }
1997
-
1998
- // Return if Disabled
1999
- if ( 'yes' === settings.filters_linkable ) {
2000
- return;
2001
- }
2002
-
2003
- // Deeplinking on Load
2004
- if ( 'yes' === settings.deeplinking ) {
2005
- var deepLink = window.location.hash.replace( '#filter:', '.' );
2006
-
2007
- if ( window.location.hash.match( '#filter:all' ) ) {
2008
- deepLink = '*';
2009
- }
2010
-
2011
- var activeFilter = $scope.find( '.wpr-grid-filters span[data-filter="'+ deepLink +'"]:not(.wpr-back-filter)' ),
2012
- activeFilterWrap = activeFilter.parent();
2013
-
2014
- // Sub Filters
2015
- if ( 'parent' === activeFilter.parent().attr( 'data-role' ) ) {
2016
- if ( activeFilterWrap.parent( 'ul' ).find( 'ul[data-parent="'+ deepLink +'"]').length ) {
2017
- activeFilterWrap.parent( 'ul' ).children( 'li' ).css( 'display', 'none' );
2018
- activeFilterWrap.siblings( 'ul[data-parent="'+ deepLink +'"]' ).css( 'display', 'block' );
2019
- }
2020
- } else if ( 'sub' === activeFilter.parent().attr( 'data-role' ) ) {
2021
- activeFilterWrap.closest( '.wpr-grid-filters' ).children( 'li' ).css( 'display', 'none' );
2022
- activeFilterWrap.parent( 'ul' ).css( 'display', 'inline-block' );
2023
- }
2024
-
2025
- // Active Filter Class
2026
- $scope.find( '.wpr-grid-filters span' ).removeClass( 'wpr-active-filter' );
2027
- activeFilter.addClass( 'wpr-active-filter' );
2028
-
2029
- $scope.find( '.wpr-grid' ).isotopewpr({ filter: deepLink });
2030
-
2031
- // Fix Lightbox
2032
- if ( '*' !== deepLink ) {
2033
- settings.lightbox.selector = deepLink +' .wpr-grid-image-wrap';
2034
- } else {
2035
- settings.lightbox.selector = ' .wpr-grid-image-wrap';
2036
- }
2037
-
2038
- lightboxPopup( settings );
2039
- }
2040
-
2041
- // Hide Empty Filters
2042
- if ( 'yes' === settings.filters_hide_empty ) {
2043
- $scope.find( '.wpr-grid-filters span' ).each(function() {
2044
- var searchClass = $(this).attr( 'data-filter' );
2045
-
2046
- if ( '*' !== searchClass ) {
2047
- if ( 0 === iGrid.find(searchClass).length ) {
2048
- $(this).parent( 'li' ).addClass( 'wpr-hidden-element' );
2049
- } else {
2050
- $(this).parent( 'li' ).removeClass( 'wpr-hidden-element' );
2051
- }
2052
- }
2053
- });
2054
- }
2055
-
2056
- // Set a Default Filter
2057
- if ( !$scope.hasClass('elementor-widget-wpr-woo-category-grid-pro') ) {
2058
- if ( '' !== settings.filters_default_filter ) {
2059
- setTimeout(function() {
2060
- $scope.find( '.wpr-grid-filters' ).find('span[data-filter*="-'+ settings.filters_default_filter +'"]')[0].click();
2061
- }, 100)
2062
- }
2063
- }
2064
-
2065
- // Click Event
2066
- $scope.find( '.wpr-grid-filters span' ).on( 'click', function() {
2067
- initialItems = 0;
2068
- var filterClass = $(this).data( 'filter' ),
2069
- filterWrap = $(this).parent( 'li' ),
2070
- filterRole = filterWrap.attr( 'data-role' );
2071
-
2072
- // Active Filter Class
2073
- $scope.find( '.wpr-grid-filters span' ).removeClass( 'wpr-active-filter' );
2074
- $(this).addClass( 'wpr-active-filter' );
2075
-
2076
- // Sub Filters
2077
- if ( 'parent' === filterRole ) {
2078
- if ( filterWrap.parent( 'ul' ).find( 'ul[data-parent="'+ filterClass +'"]').length ) {
2079
- filterWrap.parent( 'ul' ).children( 'li' ).css( 'display', 'none' );
2080
- filterWrap.siblings( 'ul[data-parent="'+ filterClass +'"]' ).css( 'display', 'block' );
2081
- }
2082
- } else if ( 'back' === filterRole ) {
2083
- filterWrap.closest( '.wpr-grid-filters' ).children( 'li' ).css( 'display', 'inline-block' );
2084
- filterWrap.parent().css( 'display', 'none' );
2085
- }
2086
-
2087
- // Deeplinking
2088
- if ( 'yes' === settings.deeplinking ) {
2089
- var filterHash = '#filter:'+ filterClass.replace( '.', '' );
2090
-
2091
- if ( '*' === filterClass ) {
2092
- filterHash = '#filter:all';
2093
- }
2094
-
2095
- window.location.href = window.location.pathname + window.location.search + filterHash;
2096
- }
2097
-
2098
- // Infinite Scroll
2099
- if ( 'infinite-scroll' === settings.pagination_type ) {
2100
- if ( 0 === iGrid.find($(this).attr('data-filter')).length ) {
2101
- $scope.find( '.wpr-grid' ).infiniteScroll( 'loadNextPage' );
2102
- }
2103
- }
2104
-
2105
- // Load More
2106
- if ( 'load-more' === settings.pagination_type ) {
2107
- if ( 0 === iGrid.find($(this).attr('data-filter')).length ) {
2108
- $scope.find( '.wpr-grid' ).infiniteScroll( 'loadNextPage' );
2109
- }
2110
- }
2111
-
2112
- // Filtering Animation
2113
- if ( 'default' !== settings.filters_animation ) {
2114
- $scope.find( '.wpr-grid-item-inner' ).css({
2115
- 'opacity' : '0',
2116
- 'transition' : 'none'
2117
- });
2118
- }
2119
-
2120
- if ( 'fade-slide' === settings.filters_animation ) {
2121
- $scope.find( '.wpr-grid-item-inner' ).css( 'top', '20px' );
2122
- } else if ( 'zoom' === settings.filters_animation ) {
2123
- $scope.find( '.wpr-grid-item-inner' ).css( 'transform', 'scale(0.01)' );
2124
- } else {
2125
- $scope.find( '.wpr-grid-item-inner' ).css({
2126
- 'top' : '0',
2127
- 'transform' : 'scale(1)'
2128
- });
2129
- }
2130
-
2131
- // Filter Grid Items
2132
- $scope.find( '.wpr-grid' ).isotopewpr({ filter: filterClass });
2133
-
2134
- // Fix Lightbox
2135
- if ( '*' !== filterClass ) {
2136
- settings.lightbox.selector = filterClass +' .wpr-grid-image-wrap';
2137
- } else {
2138
- settings.lightbox.selector = ' .wpr-grid-image-wrap';
2139
- }
2140
-
2141
- // Destroy Lightbox
2142
- iGrid.data('lightGallery').destroy( true );
2143
- // Init Lightbox
2144
- iGrid.lightGallery( settings.lightbox );
2145
- });
2146
-
2147
- }
2148
-
2149
- }, // End widgetGrid
2150
-
2151
- widgetMagazineGrid: function( $scope ) {
2152
- // Settings
2153
- var iGrid = $scope.find( '.wpr-magazine-grid-wrap' ),
2154
- settings = iGrid.attr( 'data-slick' ),
2155
- dataSlideEffect = iGrid.attr('data-slide-effect');
2156
-
2157
- // Slider
2158
- if ( typeof settings !== typeof undefined && settings !== false ) {
2159
- iGrid.slick({
2160
- fade: 'fade' === dataSlideEffect ? true : false
2161
- });
2162
- }
2163
-
2164
- var iGridLength = iGrid.find('.wpr-mgzn-grid-item').length;
2165
-
2166
- // $(window).smartresize(function() {
2167
- // if (window.matchMedia("(max-width: 767px)").matches) { // If media query matches
2168
- // iGrid.find('.wpr-magazine-grid.wpr-mgzn-grid-3-h')[0].style.gridTemplateRows = 'repeat('+ iGridLength +', 1fr)';
2169
- // } else {
2170
- // iGrid.find('.wpr-magazine-grid.wpr-mgzn-grid-3-h').removeAttr('style');
2171
- // }
2172
- // });
2173
-
2174
- // Media Hover Link
2175
- if ( 'yes' === iGrid.find( '.wpr-grid-media-wrap' ).attr( 'data-overlay-link' ) && ! WprElements.editorCheck() ) {
2176
- iGrid.find( '.wpr-grid-media-wrap' ).css('cursor', 'pointer');
2177
-
2178
- iGrid.find( '.wpr-grid-media-wrap' ).on( 'click', function( event ) {
2179
- var targetClass = event.target.className;
2180
-
2181
- if ( -1 !== targetClass.indexOf( 'inner-block' ) || -1 !== targetClass.indexOf( 'wpr-cv-inner' ) ||
2182
- -1 !== targetClass.indexOf( 'wpr-grid-media-hover' ) ) {
2183
- event.preventDefault();
2184
- window.location.href = $(this).find( '.wpr-grid-media-hover-bg' ).attr( 'data-url' );
2185
- }
2186
- });
2187
- }
2188
-
2189
- // Sharing
2190
- if ( $scope.find( '.wpr-sharing-trigger' ).length ) {
2191
- var sharingTrigger = $scope.find( '.wpr-sharing-trigger' ),
2192
- sharingInner = $scope.find( '.wpr-post-sharing-inner' ),
2193
- sharingWidth = 5;
2194
-
2195
- // Calculate Width
2196
- sharingInner.first().find( 'a' ).each(function() {
2197
- sharingWidth += $(this).outerWidth() + parseInt( $(this).css('margin-right'), 10 );
2198
- });
2199
-
2200
- // Calculate Margin
2201
- var sharingMargin = parseInt( sharingInner.find( 'a' ).css('margin-right'), 10 );
2202
-
2203
- // Set Positions
2204
- if ( 'left' === sharingTrigger.attr( 'data-direction') ) {
2205
- // Set Width
2206
- sharingInner.css( 'width', sharingWidth +'px' );
2207
-
2208
- // Set Position
2209
- sharingInner.css( 'left', - ( sharingMargin + sharingWidth ) +'px' );
2210
- } else if ( 'right' === sharingTrigger.attr( 'data-direction') ) {
2211
- // Set Width
2212
- sharingInner.css( 'width', sharingWidth +'px' );
2213
-
2214
- // Set Position
2215
- sharingInner.css( 'right', - ( sharingMargin + sharingWidth ) +'px' );
2216
- } else if ( 'top' === sharingTrigger.attr( 'data-direction') ) {
2217
- // Set Margins
2218
- sharingInner.find( 'a' ).css({
2219
- 'margin-right' : '0',
2220
- 'margin-top' : sharingMargin +'px'
2221
- });
2222
-
2223
- // Set Position
2224
- sharingInner.css({
2225
- 'top' : -sharingMargin +'px',
2226
- 'left' : '50%',
2227
- '-webkit-transform' : 'translate(-50%, -100%)',
2228
- 'transform' : 'translate(-50%, -100%)'
2229
- });
2230
- } else if ( 'right' === sharingTrigger.attr( 'data-direction') ) {
2231
- // Set Width
2232
- sharingInner.css( 'width', sharingWidth +'px' );
2233
-
2234
- // Set Position
2235
- sharingInner.css({
2236
- 'left' : sharingMargin +'px',
2237
- // 'bottom' : - ( sharingInner.outerHeight() + sharingTrigger.outerHeight() ) +'px',
2238
- });
2239
- } else if ( 'bottom' === sharingTrigger.attr( 'data-direction') ) {
2240
- // Set Margins
2241
- sharingInner.find( 'a' ).css({
2242
- 'margin-right' : '0',
2243
- 'margin-bottom' : sharingMargin +'px'
2244
- });
2245
-
2246
- // Set Position
2247
- sharingInner.css({
2248
- 'bottom' : -sharingMargin +'px',
2249
- 'left' : '50%',
2250
- '-webkit-transform' : 'translate(-50%, 100%)',
2251
- 'transform' : 'translate(-50%, 100%)'
2252
- });
2253
- }
2254
-
2255
- if ( 'click' === sharingTrigger.attr( 'data-action' ) ) {
2256
- sharingTrigger.on( 'click', function() {
2257
- var sharingInner = $(this).next();
2258
-
2259
- if ( 'hidden' === sharingInner.css( 'visibility' ) ) {
2260
- sharingInner.css( 'visibility', 'visible' );
2261
- sharingInner.find( 'a' ).css({
2262
- 'opacity' : '1',
2263
- 'top' : '0'
2264
- });
2265
-
2266
- setTimeout( function() {
2267
- sharingInner.find( 'a' ).addClass( 'wpr-no-transition-delay' );
2268
- }, sharingInner.find( 'a' ).length * 100 );
2269
- } else {
2270
- sharingInner.find( 'a' ).removeClass( 'wpr-no-transition-delay' );
2271
-
2272
- sharingInner.find( 'a' ).css({
2273
- 'opacity' : '0',
2274
- 'top' : '-5px'
2275
- });
2276
- setTimeout( function() {
2277
- sharingInner.css( 'visibility', 'hidden' );
2278
- }, sharingInner.find( 'a' ).length * 100 );
2279
- }
2280
- });
2281
- } else {
2282
- sharingTrigger.on( 'mouseenter', function() {
2283
- var sharingInner = $(this).next();
2284
-
2285
- sharingInner.css( 'visibility', 'visible' );
2286
- sharingInner.find( 'a' ).css({
2287
- 'opacity' : '1',
2288
- 'top' : '0',
2289
- });
2290
-
2291
- setTimeout( function() {
2292
- sharingInner.find( 'a' ).addClass( 'wpr-no-transition-delay' );
2293
- }, sharingInner.find( 'a' ).length * 100 );
2294
- });
2295
- $scope.find( '.wpr-grid-item-sharing' ).on( 'mouseleave', function() {
2296
- var sharingInner = $(this).find( '.wpr-post-sharing-inner' );
2297
-
2298
- sharingInner.find( 'a' ).removeClass( 'wpr-no-transition-delay' );
2299
-
2300
- sharingInner.find( 'a' ).css({
2301
- 'opacity' : '0',
2302
- 'top' : '-5px'
2303
- });
2304
- setTimeout( function() {
2305
- sharingInner.css( 'visibility', 'hidden' );
2306
- }, sharingInner.find( 'a' ).length * 100 );
2307
- });
2308
- }
2309
- }
2310
-
2311
- // Likes
2312
- if ( $scope.find( '.wpr-post-like-button' ).length ) {
2313
-
2314
- $scope.find( '.wpr-post-like-button' ).on( 'click', function() {
2315
- var current = $(this);
2316
-
2317
- if ( '' !== current.attr( 'data-post-id' ) ) {
2318
-
2319
- $.ajax({
2320
- type: 'POST',
2321
- url: current.attr( 'data-ajax' ),
2322
- data: {
2323
- action : 'wpr_likes_init',
2324
- post_id : current.attr( 'data-post-id' ),
2325
- nonce : current.attr( 'data-nonce' )
2326
- },
2327
- beforeSend:function() {
2328
- current.fadeTo( 500, 0.5 );
2329
- },
2330
- success: function( response ) {
2331
- // Get Icon
2332
- var iconClass = current.attr( 'data-icon' );
2333
-
2334
- // Get Count
2335
- var countHTML = response.count;
2336
-
2337
- if ( '' === countHTML.replace(/<\/?[^>]+(>|$)/g, "") ) {
2338
- countHTML = '<span class="wpr-post-like-count">'+ current.attr( 'data-text' ) +'</span>';
2339
-
2340
- if ( ! current.hasClass( 'wpr-likes-zero' ) ) {
2341
- current.addClass( 'wpr-likes-zero' );
2342
- }
2343
- } else {
2344
- current.removeClass( 'wpr-likes-zero' );
2345
- }
2346
-
2347
- // Update Icon
2348
- if ( current.hasClass( 'wpr-already-liked' ) ) {
2349
- current.prop( 'title', 'Like' );
2350
- current.removeClass( 'wpr-already-liked' );
2351
- current.html( '<i class="'+ iconClass +'"></i>' + countHTML );
2352
- } else {
2353
- current.prop( 'title', 'Unlike' );
2354
- current.addClass( 'wpr-already-liked' );
2355
- current.html( '<i class="'+ iconClass.replace( 'far', 'fas' ) +'"></i>' + countHTML );
2356
- }
2357
-
2358
- current.fadeTo( 500, 1 );
2359
- }
2360
- });
2361
-
2362
- }
2363
-
2364
- return false;
2365
- });
2366
-
2367
- }
2368
-
2369
- }, // End widgetMagazineGrid
2370
-
2371
- widgetFeaturedMedia: function( $scope ) {
2372
- var gallery = $scope.find( '.wpr-gallery-slider' ),
2373
- gallerySettings = gallery.attr( 'data-slick' );
2374
-
2375
- gallery.animate({ 'opacity' : '1' }, 1000 );
2376
-
2377
- if ( '[]' !== gallerySettings ) {
2378
- gallery.slick({
2379
- appendDots : $scope.find( '.wpr-gallery-slider-dots' ),
2380
- customPaging : function ( slider, i ) {
2381
- var slideNumber = (i + 1),
2382
- totalSlides = slider.slideCount;
2383
-
2384
- return '<span class="wpr-gallery-slider-dot"></span>';
2385
- }
2386
- });
2387
- }
2388
-
2389
- // Lightbox
2390
- var lightboxSettings = $( '.wpr-featured-media-image' ).attr( 'data-lightbox' );
2391
-
2392
- if ( typeof lightboxSettings !== typeof undefined && lightboxSettings !== false && ! WprElements.editorCheck() ) {
2393
- var MediaWrap = $scope.find( '.wpr-featured-media-wrap' );
2394
- lightboxSettings = JSON.parse( lightboxSettings );
2395
-
2396
- // Init Lightbox
2397
- MediaWrap.lightGallery( lightboxSettings );
2398
-
2399
- // Show/Hide Controls
2400
- MediaWrap.on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
2401
- var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
2402
- lightboxDownload = $( '#lg-download' ).attr( 'href' );
2403
-
2404
- if ( $( '#lg-download' ).length ) {
2405
- if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
2406
- lightboxControls.addClass( 'wpr-hidden-element' );
2407
- } else {
2408
- lightboxControls.removeClass( 'wpr-hidden-element' );
2409
- }
2410
- }
2411
-
2412
- // Autoplay Button
2413
- if ( '' === lightboxSettings.autoplay ) {
2414
- $( '.lg-autoplay-button' ).css({
2415
- 'width' : '0',
2416
- 'height' : '0',
2417
- 'overflow' : 'hidden'
2418
- });
2419
- }
2420
- });
2421
- }
2422
- }, // End widgetFeaturedMedia
2423
-
2424
- widgetProductMedia: function( $scope ) {
2425
-
2426
- var sliderIcons = $scope.find('.wpr-gallery-slider-arrows-wrap');
2427
-
2428
- sliderIcons.remove();
2429
-
2430
- if ( $scope.find('.woocommerce-product-gallery__trigger').length ) {
2431
- $scope.find('.woocommerce-product-gallery__trigger').remove();
2432
- }
2433
-
2434
- $scope.find('.flex-viewport').append(sliderIcons);
2435
-
2436
- $scope.find('.wpr-gallery-slider-arrow').on('click', function() {
2437
- if ($(this).hasClass('wpr-gallery-slider-prev-arrow')) {
2438
- $scope.find('a.flex-prev').trigger('click');
2439
- } else if ($(this).hasClass('wpr-gallery-slider-next-arrow')) {
2440
- $scope.find('a.flex-next').trigger('click');
2441
- }
2442
- });
2443
-
2444
- // Lightbox
2445
- var lightboxSettings = $( '.wpr-product-media-wrap' ).attr( 'data-lightbox' );
2446
-
2447
- if ( typeof lightboxSettings !== typeof undefined && lightboxSettings !== false && ! WprElements.editorCheck() ) {
2448
-
2449
- $scope.find('.woocommerce-product-gallery__image').each(function() {
2450
- $(this).attr('data-lightbox', lightboxSettings);
2451
- $(this).attr('data-src', $(this).find('a').attr('href'));
2452
- });
2453
-
2454
-
2455
- $scope.find('.woocommerce-product-gallery__image').on('click', function(e) {
2456
- e.stopPropagation();
2457
- });
2458
-
2459
- $scope.find('.wpr-product-media-lightbox').on('click', function() {
2460
- $scope.find('.woocommerce-product-gallery__image').trigger('click');
2461
- });
2462
-
2463
- var MediaWrap = $scope.find( '.woocommerce-product-gallery__wrapper' );
2464
- lightboxSettings = JSON.parse( lightboxSettings );
2465
-
2466
- // Init Lightbox
2467
- MediaWrap.lightGallery( lightboxSettings );
2468
-
2469
- // Show/Hide Controls
2470
- MediaWrap.on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
2471
- var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
2472
- lightboxDownload = $( '#lg-download' ).attr( 'href' );
2473
-
2474
- if ( $( '#lg-download' ).length ) {
2475
- if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
2476
- lightboxControls.addClass( 'wpr-hidden-element' );
2477
- } else {
2478
- lightboxControls.removeClass( 'wpr-hidden-element' );
2479
- }
2480
- }
2481
-
2482
- // Autoplay Button
2483
- if ( '' === lightboxSettings.autoplay ) {
2484
- $( '.lg-autoplay-button' ).css({
2485
- 'width' : '0',
2486
- 'height' : '0',
2487
- 'overflow' : 'hidden'
2488
- });
2489
- }
2490
- });
2491
- }
2492
-
2493
- if ( $scope.hasClass('wpr-product-media-thumbs-slider') && $scope.hasClass('wpr-product-media-thumbs-vertical') ) {
2494
-
2495
- var thumbsToShow = $scope.find('.wpr-product-media-wrap').data('slidestoshow');
2496
- var thumbsToScroll = +$scope.find('.wpr-product-media-wrap').data('slidestoscroll');
2497
-
2498
- $scope.find('.flex-control-nav').css('height', ((100/thumbsToShow) * $scope.find('.flex-control-nav li').length) + '%');
2499
-
2500
- $scope.find('.flex-control-nav').wrap('<div class="wpr-fcn-wrap"></div>');
2501
-
2502
- var thumbIcon1 = $scope.find('.wpr-thumbnail-slider-prev-arrow');
2503
- var thumbIcon2 = $scope.find('.wpr-thumbnail-slider-next-arrow');
2504
-
2505
- thumbIcon1.remove();
2506
- thumbIcon2.remove();
2507
-
2508
- if ( $scope.find('.wpr-product-media-wrap').data('slidestoshow') < $scope.find('.flex-control-nav li').length ) {
2509
- $scope.find('.wpr-fcn-wrap').prepend(thumbIcon1);
2510
- $scope.find('.wpr-fcn-wrap').append(thumbIcon2);
2511
- }
2512
-
2513
- var posy = 0;
2514
- var slideCount = 0;
2515
-
2516
- $scope.find('.wpr-thumbnail-slider-next-arrow').on('click', function() {
2517
- console.log(
2518
- slideCount + thumbsToScroll,
2519
- $scope.find('.flex-control-nav li').length - 1
2520
- );
2521
- // var currTrans = $scope.find('.flex-control-nav').css('transform') != 'none' ? $scope.find('.flex-control-nav').css('transform').split(/[()]/)[1] : 0;
2522
- // posx = currTrans ? currTrans.split(',')[4] : 0;
2523
- if ( (slideCount + thumbsToScroll) < $scope.find('.flex-control-nav li').length - 1 ) {
2524
- posy++;
2525
- slideCount = slideCount + thumbsToScroll;
2526
- $scope.find('.flex-control-nav').css('transform', 'translateY('+ (parseInt(-posy) * (parseInt($scope.find('.flex-control-nav li:last-child').css('height').slice(0, -2)) + parseInt($scope.find('.flex-control-nav li').css('margin-bottom'))) * thumbsToScroll) +'px)');
2527
- if ( posy >= 1 ) {
2528
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', false);
2529
- } else {
2530
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', true);
2531
- }
2532
- } else {
2533
- posy = 0;
2534
- slideCount = 0;
2535
- $scope.find('.flex-control-nav').css('transform', `translateY(0)`);
2536
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', true);
2537
- }
2538
- });
2539
-
2540
- $scope.find('.wpr-thumbnail-slider-prev-arrow').on('click', function() {
2541
- if ( posy >= 1 ) {
2542
- posy--;
2543
- if ( posy == 0 ) {
2544
- $(this).attr('disabled', true);
2545
- }
2546
- slideCount = slideCount - thumbsToScroll;
2547
- $scope.find('.flex-control-nav').css('transform', 'translateY('+ parseInt(-posy) * (parseInt($scope.find('.flex-control-nav li').css('height').slice(0, -2)) + parseInt($scope.find('.flex-control-nav li:last-child').css('margin-top'))) * thumbsToScroll +'px)');
2548
- if ( slideCount < $scope.find('.flex-control-nav li').length - 1 ) {
2549
- $scope.find('.wpr-thumbnail-slider-next-arrow').attr('disabled', false);
2550
- } else {
2551
- $scope.find('.wpr-thumbnail-slider-next-arrow').attr('disabled', true);
2552
- }
2553
- } else {
2554
- // slideCount = $scope.find('.flex-control-nav li').length - 1;
2555
- // $scope.find('.flex-control-nav').css('transform', `translateX(0)`);
2556
- $(this).attr('disabled', true);
2557
- }
2558
- });
2559
- }
2560
-
2561
- if ( $scope.hasClass('wpr-product-media-thumbs-slider') && $scope.find('.wpr-product-media-wrap').hasClass('wpr-product-media-thumbs-horizontal') ) {
2562
-
2563
- var thumbsToShow = $scope.find('.wpr-product-media-wrap').data('slidestoshow');
2564
- var thumbsToScroll = +$scope.find('.wpr-product-media-wrap').data('slidestoscroll');
2565
-
2566
- $scope.find('.flex-control-nav').css('width', ((100/thumbsToShow) * $scope.find('.flex-control-nav li').length) +'%');
2567
-
2568
- $scope.find('.flex-control-nav').wrap('<div class="wpr-fcn-wrap"></div>');
2569
-
2570
- var thumbIcon1 = $scope.find('.wpr-thumbnail-slider-prev-arrow');
2571
- var thumbIcon2 = $scope.find('.wpr-thumbnail-slider-next-arrow');
2572
-
2573
- thumbIcon1.remove();
2574
- thumbIcon2.remove();
2575
-
2576
- if ( $scope.find('.wpr-product-media-wrap').data('slidestoshow') < $scope.find('.flex-control-nav li').length ) {
2577
- $scope.find('.wpr-fcn-wrap').prepend(thumbIcon1);
2578
- $scope.find('.wpr-fcn-wrap').append(thumbIcon2);
2579
- $scope.find('.wpr-thumbnail-slider-arrow').removeClass('wpr-tsa-hidden');
2580
- }
2581
-
2582
- var posx = 0;
2583
- var slideCount = 0;
2584
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', true);
2585
-
2586
- $scope.find('.wpr-thumbnail-slider-next-arrow').on('click', function() {
2587
- // var currTrans = $scope.find('.flex-control-nav').css('transform') != 'none' ? $scope.find('.flex-control-nav').css('transform').split(/[()]/)[1] : 0;
2588
- // posx = currTrans ? currTrans.split(',')[4] : 0;
2589
- if ( (slideCount + thumbsToScroll) < $scope.find('.flex-control-nav li').length - 1 ) {
2590
- posx++;
2591
- slideCount = slideCount + thumbsToScroll;
2592
- $scope.find('.flex-control-nav').css('transform', 'translateX('+ (parseInt(-posx) * (parseInt($scope.find('.flex-control-nav li:last-child').css('width').slice(0, -2)) + parseInt($scope.find('.flex-control-nav li').css('margin-right'))) * thumbsToScroll) +'px)');
2593
- if ( posx >= 1 ) {
2594
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', false);
2595
- } else {
2596
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', true);
2597
- }
2598
- } else {
2599
- posx = 0;
2600
- slideCount = 0;
2601
- $scope.find('.flex-control-nav').css('transform', `translateX(0)`);
2602
- $scope.find('.wpr-thumbnail-slider-prev-arrow').attr('disabled', true);
2603
- }
2604
- });
2605
-
2606
- $scope.find('.wpr-thumbnail-slider-prev-arrow').on('click', function() {
2607
- if ( posx >= 1 ) {
2608
- posx--;
2609
- if ( posx == 0 ) {
2610
- $(this).attr('disabled', true);
2611
- }
2612
- slideCount = slideCount - thumbsToScroll;
2613
- $scope.find('.flex-control-nav').css('transform', 'translateX('+ parseInt(-posx) * (parseInt($scope.find('.flex-control-nav li').css('width').slice(0, -2)) + parseInt($scope.find('.flex-control-nav li').css('margin-right'))) * thumbsToScroll +'px)');
2614
- if ( slideCount < $scope.find('.flex-control-nav li').length - 1 ) {
2615
- $scope.find('.wpr-thumbnail-slider-next-arrow').attr('disabled', false);
2616
- } else {
2617
- $scope.find('.wpr-thumbnail-slider-next-arrow').attr('disabled', true);
2618
- }
2619
- } else {
2620
- // slideCount = $scope.find('.flex-control-nav li').length - 1;
2621
- // $scope.find('.flex-control-nav').css('transform', `translateX(0)`);
2622
- $(this).attr('disabled', true);
2623
- }
2624
- });
2625
-
2626
- }
2627
- }, // End widgetProductMedia
2628
-
2629
- widgetCountDown: function( $scope ) {
2630
- var countDownWrap = $scope.children( '.elementor-widget-container' ).children( '.wpr-countdown-wrap' ),
2631
- countDownInterval = null,
2632
- dataInterval = countDownWrap.data( 'interval' ),
2633
- dataShowAgain = countDownWrap.data( 'show-again' ),
2634
- endTime = new Date( dataInterval * 1000);
2635
-
2636
- // Evergreen End Time
2637
- if ( 'evergreen' === countDownWrap.data( 'type' ) ) {
2638
- var evergreenDate = new Date(),
2639
- widgetID = $scope.attr( 'data-id' ),
2640
- settings = JSON.parse( localStorage.getItem( 'WprCountDownSettings') ) || {};
2641
-
2642
- // End Time
2643
- if ( settings.hasOwnProperty( widgetID ) ) {
2644
- if ( Object.keys(settings).length === 0 || dataInterval !== settings[widgetID].interval ) {
2645
- endTime = evergreenDate.setSeconds( evergreenDate.getSeconds() + dataInterval );
2646
- } else {
2647
- endTime = settings[widgetID].endTime;
2648
- }
2649
- } else {
2650
- endTime = evergreenDate.setSeconds( evergreenDate.getSeconds() + dataInterval );
2651
- }
2652
-
2653
- if ( endTime + dataShowAgain < evergreenDate.setSeconds( evergreenDate.getSeconds() ) ) {
2654
- endTime = evergreenDate.setSeconds( evergreenDate.getSeconds() + dataInterval );
2655
- }
2656
-
2657
- // Settings
2658
- settings[widgetID] = {
2659
- interval: dataInterval,
2660
- endTime: endTime
2661
- };
2662
-
2663
- // Save Settings in Browser
2664
- localStorage.setItem( 'WprCountDownSettings', JSON.stringify( settings ) );
2665
- }
2666
-
2667
- // Init on Load
2668
- initCountDown();
2669
-
2670
- // Start CountDown
2671
- if ( ! WprElements.editorCheck() ) { //tmp
2672
- countDownInterval = setInterval( initCountDown, 1000 );
2673
- }
2674
-
2675
- function initCountDown() {
2676
- var timeLeft = endTime - new Date();
2677
-
2678
- var numbers = {
2679
- days: Math.floor(timeLeft / (1000 * 60 * 60 * 24)),
2680
- hours: Math.floor(timeLeft / (1000 * 60 * 60) % 24),
2681
- minutes: Math.floor(timeLeft / 1000 / 60 % 60),
2682
- seconds: Math.floor(timeLeft / 1000 % 60)
2683
- };
2684
-
2685
- if ( numbers.days < 0 || numbers.hours < 0 || numbers.minutes < 0 ) {
2686
- numbers = {
2687
- days: 0,
2688
- hours: 0,
2689
- minutes: 0,
2690
- seconds: 0
2691
- };
2692
- }
2693
-
2694
- $scope.find( '.wpr-countdown-number' ).each(function() {
2695
- var number = numbers[ $(this).attr( 'data-item' ) ];
2696
-
2697
- if ( 1 === number.toString().length ) {
2698
- number = '0' + number;
2699
- }
2700
-
2701
- $(this).text( number );
2702
-
2703
- // Labels
2704
- var labels = $(this).next();
2705
-
2706
- if ( labels.length ) {
2707
- if ( ! $(this).hasClass( 'wpr-countdown-seconds' ) ) {
2708
- var labelText = labels.data( 'text' );
2709
-
2710
- if ( '01' == number ) {
2711
- labels.text( labelText.singular );
2712
- } else {
2713
- labels.text( labelText.plural );
2714
- }
2715
- }
2716
- }
2717
- });
2718
-
2719
- // Stop Counting
2720
- if ( timeLeft < 0 ) {
2721
- clearInterval( countDownInterval );
2722
-
2723
- // Actions
2724
- expiredActions();
2725
- }
2726
- }
2727
-
2728
- function expiredActions() {
2729
- var dataActions = countDownWrap.data( 'actions' );
2730
-
2731
- if ( ! WprElements.editorCheck() ) {
2732
-
2733
- if ( dataActions.hasOwnProperty( 'hide-timer' ) ) {
2734
- countDownWrap.hide();
2735
- }
2736
-
2737
- if ( dataActions.hasOwnProperty( 'hide-element' ) ) {
2738
- $( dataActions['hide-element'] ).hide();
2739
- }
2740
-
2741
- if ( dataActions.hasOwnProperty( 'message' ) ) {
2742
- if ( ! $scope.children( '.elementor-widget-container' ).children( '.wpr-countdown-message' ).length ) {
2743
- countDownWrap.after( '<div class="wpr-countdown-message">'+ dataActions['message'] +'</div>' );
2744
- }
2745
- }
2746
-
2747
- if ( dataActions.hasOwnProperty( 'redirect' ) ) {
2748
- window.location.href = dataActions['redirect'];
2749
- }
2750
-
2751
- if ( dataActions.hasOwnProperty( 'load-template' ) ) {
2752
- // countDownWrap.parent().find( '.elementor-inner' ).parent().show();
2753
- countDownWrap.next('.elementor').show();
2754
- }
2755
-
2756
- }
2757
-
2758
- }
2759
-
2760
- }, // End widgetCountDown
2761
-
2762
- widgetGoogleMaps: function( $scope ) {
2763
- var googleMap = $scope.find( '.wpr-google-map' ),
2764
- settings = googleMap.data( 'settings' ),
2765
- controls = googleMap.data( 'controls' ),
2766
- locations = googleMap.data( 'locations' ),
2767
- gMarkers = [],
2768
- bounds = new google.maps.LatLngBounds();
2769
-
2770
- // Create Map
2771
- var map = new google.maps.Map( googleMap[0], {
2772
- mapTypeId: settings.type,
2773
- styles: get_map_style( settings ),
2774
- zoom: settings.zoom_depth,
2775
- gestureHandling: settings.zoom_on_scroll,
2776
-
2777
- // UI
2778
- mapTypeControl: controls.type,
2779
- fullscreenControl: controls.fullscreen,
2780
- zoomControl: controls.zoom,
2781
- streetViewControl: controls.streetview,
2782
- } );
2783
-
2784
- // Set Markers
2785
- for ( var i = 0; i < locations.length; i++ ) {
2786
- var data = locations[i],
2787
- iconOptions = '',
2788
- iconSizeW = data.gm_marker_icon_size_width.size,
2789
- iconSizeH = data.gm_marker_icon_size_height.size;
2790
-
2791
- // Empty Values
2792
- if ( '' == data.gm_latitude || '' == data.gm_longtitude ) {
2793
- continue;
2794
- }
2795
-
2796
- // Custom Icon
2797
- if ( 'yes' === data.gm_custom_marker ) {
2798
- iconOptions = {
2799
- url: data.gm_marker_icon.url,
2800
- scaledSize: new google.maps.Size( iconSizeW, iconSizeH ),
2801
- };
2802
- }
2803
-
2804
- // Marker
2805
- var marker = new google.maps.Marker({
2806
- map: map,
2807
- position: new google.maps.LatLng( parseFloat( data.gm_latitude ), parseFloat( data.gm_longtitude ) ),
2808
- animation: google.maps.Animation[data.gm_marker_animation],
2809
- icon: iconOptions
2810
- });
2811
-
2812
- // Info Window
2813
- if ( 'none' !== data.gm_show_info_window ) {
2814
- infoWindow( marker, data );
2815
- }
2816
-
2817
- gMarkers.push(marker);
2818
- bounds.extend(marker.position);
2819
- }
2820
-
2821
- // Center Map
2822
- if ( locations.length > 1 ) {
2823
- map.fitBounds(bounds);
2824
- } else {
2825
- map.setCenter( bounds.getCenter() );
2826
- }
2827
-
2828
- // Marker Clusters
2829
- if ( 'yes' === settings.cluster_markers ) {
2830
- var markerCluster = new MarkerClusterer(map, gMarkers, {
2831
- imagePath: settings.clusters_url
2832
- });
2833
- }
2834
-
2835
- // Info Wondow
2836
- function infoWindow( marker, data ) {
2837
- var content = '<div class="wpr-gm-iwindow"><h3>'+ data.gm_location_title +'</h3><p>'+ data.gm_location_description +'</p></div>',
2838
- iWindow = new google.maps.InfoWindow({
2839
- content: content,
2840
- maxWidth: data.gm_info_window_width.size
2841
- });
2842
-
2843
- if ( 'load' === data.gm_show_info_window ) {
2844
- iWindow.open( map, marker );
2845
- } else {
2846
- marker.addListener( 'click', function() {
2847
- iWindow.open( map, marker );
2848
- });
2849
- }
2850
- }
2851
-
2852
- // Map Styles
2853
- function get_map_style( settings ) {
2854
- var style;
2855
-
2856
- switch ( settings.style ) {
2857
- case 'simple':
2858
- style = JSON.parse('[{"featureType":"road","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#fffffa"}]},{"featureType":"water","stylers":[{"lightness":50}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"lightness":40}]}]');
2859
- break;
2860
- case 'white-black':
2861
- style = JSON.parse('[{"featureType":"road","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]},{"featureType":"administrative","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"weight":1}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"weight":0.8}]},{"featureType":"landscape","stylers":[{"color":"#ffffff"}]},{"featureType":"water","stylers":[{"visibility":"off"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"elementType":"labels","stylers":[{"visibility":"off"}]},{"elementType":"labels.text","stylers":[{"visibility":"on"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#000000"}]},{"elementType":"labels.icon","stylers":[{"visibility":"on"}]}]');
2862
- break;
2863
- case 'light-silver':
2864
- style = JSON.parse('[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2}]}]');
2865
- break;
2866
- case 'light-grayscale':
2867
- style = JSON.parse('[{"featureType":"all","elementType":"geometry.fill","stylers":[{"weight":"2.00"}]},{"featureType":"all","elementType":"geometry.stroke","stylers":[{"color":"#9c9c9c"}]},{"featureType":"all","elementType":"labels.text","stylers":[{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#eeeeee"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#7b7b7b"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#c8d7d4"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#070707"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]}]');
2868
- break;
2869
- case 'subtle-grayscale':
2870
- style = JSON.parse('[{"featureType":"administrative","elementType":"all","stylers":[{"saturation":"-100"}]},{"featureType":"administrative.province","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","elementType":"all","stylers":[{"saturation":-100},{"lightness":"50"},{"visibility":"simplified"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":"-100"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"all","stylers":[{"lightness":"30"}]},{"featureType":"road.local","elementType":"all","stylers":[{"lightness":"40"}]},{"featureType":"transit","elementType":"all","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]},{"featureType":"water","elementType":"labels","stylers":[{"lightness":-25},{"saturation":-100}]}]');
2871
- break;
2872
- case 'mostly-white':
2873
- style = JSON.parse('[{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#6195a0"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#e6f3d6"},{"visibility":"on"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#f4d2c5"},{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"labels.text","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#f4f4f4"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#787878"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#eaf6f8"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#eaf6f8"}]}]');
2874
- break;
2875
- case 'mostly-green':
2876
- style = JSON.parse('[{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"color":"#f7f1df"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#d0e3b4"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.medical","elementType":"geometry","stylers":[{"color":"#fbd3da"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#bde6ab"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffe15f"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#efd151"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"black"}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"color":"#cfb2db"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#a2daf2"}]}]');
2877
- break;
2878
- case 'neutral-blue':
2879
- style = JSON.parse('[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]');
2880
- break;
2881
- case 'blue-water':
2882
- style = JSON.parse('[{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#46bcec"},{"visibility":"on"}]}]');
2883
- break;
2884
- case 'blue-essense':
2885
- style = JSON.parse('[{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#e0efef"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"hue":"#1900ff"},{"color":"#c0e8e8"}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":100},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":700}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#7dcdcd"}]}]');
2886
- break;
2887
- case 'golden-brown':
2888
- style = JSON.parse('[{"featureType":"all","elementType":"all","stylers":[{"color":"#ff7000"},{"lightness":"69"},{"saturation":"100"},{"weight":"1.17"},{"gamma":"2.04"}]},{"featureType":"all","elementType":"geometry","stylers":[{"color":"#cb8536"}]},{"featureType":"all","elementType":"labels","stylers":[{"color":"#ffb471"},{"lightness":"66"},{"saturation":"100"}]},{"featureType":"all","elementType":"labels.text.fill","stylers":[{"gamma":0.01},{"lightness":20}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"saturation":-31},{"lightness":-33},{"weight":2},{"gamma":0.8}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"lightness":"-8"},{"gamma":"0.98"},{"weight":"2.45"},{"saturation":"26"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"lightness":30},{"saturation":30}]},{"featureType":"poi","elementType":"geometry","stylers":[{"saturation":20}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"lightness":20},{"saturation":-20}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":10},{"saturation":-30}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"saturation":25},{"lightness":25}]},{"featureType":"water","elementType":"all","stylers":[{"lightness":-20},{"color":"#ecc080"}]}]');
2889
- break;
2890
- case 'midnight-commander':
2891
- style = JSON.parse('[{"featureType":"all","elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"color":"#000000"},{"lightness":13}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#144b53"},{"lightness":14},{"weight":1.4}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#08304b"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#0c4152"},{"lightness":5}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#0b434f"},{"lightness":25}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#0b3d51"},{"lightness":16}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"transit","elementType":"all","stylers":[{"color":"#146474"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#021019"}]}]');
2892
- break;
2893
- case 'shades-of-grey':
2894
- style = JSON.parse('[{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]}]');
2895
- break;
2896
- case 'yellow-black':
2897
- style = JSON.parse('[{"featureType":"all","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#e5c163"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#c4c4c4"}]},{"featureType":"administrative.neighborhood","elementType":"labels.text.fill","stylers":[{"color":"#e5c163"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21},{"visibility":"on"}]},{"featureType":"poi.business","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#e5c163"},{"lightness":"0"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#e5c163"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#575757"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.text.stroke","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#999999"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]}]');
2898
- break;
2899
- case 'custom':
2900
- style = JSON.parse( settings.custom_style );
2901
- break;
2902
- default:
2903
- style = '';
2904
- }
2905
-
2906
- return style;
2907
- }
2908
-
2909
- }, // End widgetGoogleMaps
2910
-
2911
- widgetBeforeAfter: function( $scope ) {
2912
- var imagesWrap = $scope.find( '.wpr-ba-image-container' ),
2913
- imageOne = imagesWrap.find( '.wpr-ba-image-1' ),
2914
- imageTwo = imagesWrap.find( '.wpr-ba-image-2' ),
2915
- divider = imagesWrap.find( '.wpr-ba-divider' ),
2916
- startPos = imagesWrap.attr( 'data-position' );
2917
-
2918
- // Horizontal
2919
- if ( imagesWrap.hasClass( 'wpr-ba-horizontal' ) ) {
2920
- // On Load
2921
- divider.css( 'left', startPos +'%' );
2922
- imageTwo.css( 'left', startPos +'%' );
2923
- imageTwo.find( 'img' ).css( 'right', startPos +'%' );
2924
-
2925
- // On Move
2926
- divider.on( 'move', function(e) {
2927
- var overlayWidth = e.pageX - imagesWrap.offset().left;
2928
-
2929
- // Reset
2930
- divider.css({
2931
- 'left' : 'auto',
2932
- 'right' : 'auto'
2933
- });
2934
- imageTwo.css({
2935
- 'left' : 'auto',
2936
- 'right' : 'auto'
2937
- });
2938
-
2939
- if ( overlayWidth > 0 && overlayWidth < imagesWrap.outerWidth() ) {
2940
- divider.css( 'left', overlayWidth );
2941
- imageTwo.css( 'left', overlayWidth );
2942
- imageTwo.find( 'img' ).css( 'right', overlayWidth );
2943
- } else {
2944
- if ( overlayWidth <= 0 ) {
2945
- divider.css( 'left', 0 );
2946
- imageTwo.css( 'left', 0 );
2947
- imageTwo.find( 'img' ).css( 'right', 0 );
2948
- } else if ( overlayWidth >= imagesWrap.outerWidth() ) {
2949
- divider.css( 'right', - divider.outerWidth() / 2 );
2950
- imageTwo.css( 'right', 0 );
2951
- imageTwo.find( 'img' ).css( 'right', '100%' );
2952
- }
2953
- }
2954
-
2955
- hideLabelsOnTouch();
2956
- });
2957
-
2958
- // Vertical
2959
- } else {
2960
- // On Load
2961
- divider.css( 'top', startPos +'%' );
2962
- imageTwo.css( 'top', startPos +'%' );
2963
- imageTwo.find( 'img' ).css( 'bottom', startPos +'%' );
2964
-
2965
- // On Move
2966
- divider.on( 'move', function(e) {
2967
- var overlayWidth = e.pageY - imagesWrap.offset().top;
2968
-
2969
- // Reset
2970
- divider.css({
2971
- 'top' : 'auto',
2972
- 'bottom' : 'auto'
2973
- });
2974
- imageTwo.css({
2975
- 'top' : 'auto',
2976
- 'bottom' : 'auto'
2977
- });
2978
-
2979
- if ( overlayWidth > 0 && overlayWidth < imagesWrap.outerHeight() ) {
2980
- divider.css( 'top', overlayWidth );
2981
- imageTwo.css( 'top', overlayWidth );
2982
- imageTwo.find( 'img' ).css( 'bottom', overlayWidth );
2983
- } else {
2984
- if ( overlayWidth <= 0 ) {
2985
- divider.css( 'top', 0 );
2986
- imageTwo.css( 'top', 0 );
2987
- imageTwo.find( 'img' ).css( 'bottom', 0 );
2988
- } else if ( overlayWidth >= imagesWrap.outerHeight() ) {
2989
- divider.css( 'bottom', - divider.outerHeight() / 2 );
2990
- imageTwo.css( 'bottom', 0 );
2991
- imageTwo.find( 'img' ).css( 'bottom', '100%' );
2992
- }
2993
- }
2994
-
2995
- hideLabelsOnTouch();
2996
- });
2997
- }
2998
-
2999
- // Mouse Hover
3000
- if ( 'mouse' === imagesWrap.attr( 'data-trigger' ) ) {
3001
-
3002
- imagesWrap.on( 'mousemove', function( event ) {
3003
-
3004
- // Horizontal
3005
- if ( imagesWrap.hasClass( 'wpr-ba-horizontal' ) ) {
3006
- var overlayWidth = event.pageX - $(this).offset().left;
3007
- divider.css( 'left', overlayWidth );
3008
- imageTwo.css( 'left', overlayWidth );
3009
- imageTwo.find( 'img' ).css( 'right', overlayWidth );
3010
-
3011
- // Vertical
3012
- } else {
3013
- var overlayWidth = event.pageY - $(this).offset().top;
3014
- divider.css( 'top', overlayWidth );
3015
- imageTwo.css( 'top', overlayWidth );
3016
- imageTwo.find( 'img' ).css( 'bottom', overlayWidth );
3017
- }
3018
-
3019
- hideLabelsOnTouch();
3020
- });
3021
-
3022
- }
3023
-
3024
- // Hide Labels
3025
- hideLabelsOnTouch();
3026
-
3027
- function hideLabelsOnTouch() {
3028
- var labelOne = imagesWrap.find( '.wpr-ba-label-1 div' ),
3029
- labelTwo = imagesWrap.find( '.wpr-ba-label-2 div' );
3030
-
3031
- if ( ! labelOne.length && ! labelTwo.length ) {
3032
- return;
3033
- }
3034
-
3035
- // Horizontal
3036
- if ( imagesWrap.hasClass( 'wpr-ba-horizontal' ) ) {
3037
- var labelOneOffset = labelOne.position().left + labelOne.outerWidth(),
3038
- labelTwoOffset = labelTwo.position().left + labelTwo.outerWidth();
3039
-
3040
- if ( labelOneOffset + 15 >= parseInt( divider.css( 'left' ), 10 ) ) {
3041
- labelOne.stop().css( 'opacity', 0 );
3042
- } else {
3043
- labelOne.stop().css( 'opacity', 1 );
3044
- }
3045
-
3046
- if ( (imagesWrap.outerWidth() - (labelTwoOffset + 15)) <= parseInt( divider.css( 'left' ), 10 ) ) {
3047
- labelTwo.stop().css( 'opacity', 0 );
3048
- } else {
3049
- labelTwo.stop().css( 'opacity', 1 );
3050
- }
3051
-
3052
- // Vertical
3053
- } else {
3054
- var labelOneOffset = labelOne.position().top + labelOne.outerHeight(),
3055
- labelTwoOffset = labelTwo.position().top + labelTwo.outerHeight();
3056
-
3057
- if ( labelOneOffset + 15 >= parseInt( divider.css( 'top' ), 10 ) ) {
3058
- labelOne.stop().css( 'opacity', 0 );
3059
- } else {
3060
- labelOne.stop().css( 'opacity', 1 );
3061
- }
3062
-
3063
- if ( (imagesWrap.outerHeight() - (labelTwoOffset + 15)) <= parseInt( divider.css( 'top' ), 10 ) ) {
3064
- labelTwo.stop().css( 'opacity', 0 );
3065
- } else {
3066
- labelTwo.stop().css( 'opacity', 1 );
3067
- }
3068
- }
3069
- }
3070
-
3071
- }, // End widgetBeforeAfter
3072
-
3073
- widgetMailchimp: function( $scope ) {
3074
- var mailchimpForm = $scope.find( 'form' );
3075
-
3076
- mailchimpForm.on( 'submit', function(e) {
3077
- e.preventDefault();
3078
-
3079
- var buttonText = $(this).find('button').text();
3080
-
3081
- // Change Text
3082
- $(this).find('button').text( $(this).find('button').data('loading') );
3083
-
3084
- $.ajax({
3085
- url: WprConfig.ajaxurl,
3086
- type: 'POST',
3087
- data: {
3088
- action: 'mailchimp_subscribe',
3089
- fields: $(this).serialize(),
3090
- apiKey: mailchimpForm.data( 'api-key' ),
3091
- listId: mailchimpForm.data( 'list-id' )
3092
- },
3093
- success: function(data) {
3094
- mailchimpForm.find('button').text( buttonText );
3095
-
3096
- if ( 'subscribed' === data.status ) {
3097
- $scope.find( '.wpr-mailchimp-success-message' ).show();
3098
- } else {
3099
- $scope.find( '.wpr-mailchimp-error-message' ).show();
3100
- }
3101
-
3102
- $scope.find( '.wpr-mailchimp-message' ).fadeIn();
3103
- }
3104
- });
3105
-
3106
- });
3107
-
3108
- }, // End widgetMailchimp
3109
-
3110
- widgetAdvancedSlider: function( $scope ) {
3111
- var $advancedSlider = $scope.find( '.wpr-advanced-slider' ),
3112
- sliderData = $advancedSlider.data('slick');
3113
-
3114
- // Slider Columns
3115
- var sliderClass = $scope.attr('class'),
3116
- sliderColumnsDesktop = sliderClass.match(/wpr-adv-slider-columns-\d/) ? sliderClass.match(/wpr-adv-slider-columns-\d/).join().slice(-1) : 2,
3117
- sliderColumnsWideScreen = sliderClass.match(/columns--widescreen\d/) ? sliderClass.match(/columns--widescreen\d/).join().slice(-1) : sliderColumnsDesktop,
3118
- sliderColumnsLaptop = sliderClass.match(/columns--laptop\d/) ? sliderClass.match(/columns--laptop\d/).join().slice(-1) : sliderColumnsDesktop,
3119
- sliderColumnsTabletExtra = sliderClass.match(/columns--tablet_extra\d/) ? sliderClass.match(/columns--tablet_extra\d/).join().slice(-1) : sliderColumnsTablet,
3120
- sliderColumnsTablet = sliderClass.match(/columns--tablet\d/) ? sliderClass.match(/columns--tablet\d/).join().slice(-1) : 2,
3121
- sliderColumnsMobileExtra = sliderClass.match(/columns--mobile_extra\d/) ? sliderClass.match(/columns--mobile_extra\d/).join().slice(-1) : sliderColumnsTablet,
3122
- sliderColumnsMobile = sliderClass.match(/columns--mobile\d/) ? sliderClass.match(/columns--mobile\d/).join().slice(-1) : 1,
3123
- sliderSlidesToScroll = +(sliderClass.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1)),
3124
- dataSlideEffect = $advancedSlider.attr('data-slide-effect');
3125
-
3126
- $advancedSlider.slick({
3127
- appendArrows : $scope.find('.wpr-slider-controls'),
3128
- appendDots : $scope.find('.wpr-slider-dots'),
3129
- customPaging : function (slider, i) {
3130
- var slideNumber = (i + 1),
3131
- totalSlides = slider.slideCount;
3132
- return '<span class="wpr-slider-dot"></span>';
3133
- },
3134
- slidesToShow: sliderColumnsDesktop,
3135
- responsive: [
3136
- {
3137
- breakpoint: 10000,
3138
- settings: {
3139
- slidesToShow: sliderColumnsWideScreen,
3140
- slidesToScroll: sliderSlidesToScroll > sliderColumnsWideScreen ? 1 : sliderSlidesToScroll,
3141
- fade: (1 == sliderColumnsWideScreen && 'fade' === dataSlideEffect) ? true : false
3142
- }
3143
- },
3144
- {
3145
- breakpoint: 2399,
3146
- settings: {
3147
- slidesToShow: sliderColumnsDesktop,
3148
- slidesToScroll: sliderSlidesToScroll > sliderColumnsDesktop ? 1 : sliderSlidesToScroll,
3149
- fade: (1 == sliderColumnsDesktop && 'fade' === dataSlideEffect) ? true : false
3150
- }
3151
- },
3152
- {
3153
- breakpoint: 1221,
3154
- settings: {
3155
- slidesToShow: sliderColumnsLaptop,
3156
- slidesToScroll: sliderSlidesToScroll > sliderColumnsLaptop ? 1 : sliderSlidesToScroll,
3157
- fade: (1 == sliderColumnsLaptop && 'fade' === dataSlideEffect) ? true : false
3158
- }
3159
- },
3160
- {
3161
- breakpoint: 1200,
3162
- settings: {
3163
- slidesToShow: sliderColumnsTabletExtra,
3164
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTabletExtra ? 1 : sliderSlidesToScroll,
3165
- fade: (1 == sliderColumnsTabletExtra && 'fade' === dataSlideEffect) ? true : false
3166
- }
3167
- },
3168
- {
3169
- breakpoint: 1024,
3170
- settings: {
3171
- slidesToShow: sliderColumnsTablet,
3172
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTablet ? 1 : sliderSlidesToScroll,
3173
- fade: (1 == sliderColumnsTablet && 'fade' === dataSlideEffect) ? true : false
3174
- }
3175
- },
3176
- {
3177
- breakpoint: 880,
3178
- settings: {
3179
- slidesToShow: sliderColumnsMobileExtra,
3180
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobileExtra ? 1 : sliderSlidesToScroll,
3181
- fade: (1 == sliderColumnsMobileExtra && 'fade' === dataSlideEffect) ? true : false
3182
- }
3183
- },
3184
- {
3185
- breakpoint: 768,
3186
- settings: {
3187
- slidesToShow: sliderColumnsMobile,
3188
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobile ? 1 : sliderSlidesToScroll,
3189
- fade: (1 == sliderColumnsMobile && 'fade' === dataSlideEffect) ? true : false
3190
- }
3191
- }
3192
- ],
3193
- });
3194
-
3195
- function sliderVideoSize(){
3196
-
3197
- var sliderWidth = $advancedSlider.find('.wpr-slider-item').outerWidth(),
3198
- sliderHeight = $advancedSlider.find('.wpr-slider-item').outerHeight(),
3199
- sliderRatio = sliderWidth / sliderHeight,
3200
- iframeRatio = (16/9),
3201
- iframeHeight,
3202
- iframeWidth,
3203
- iframeTopDistance = 0,
3204
- iframeLeftDistance = 0;
3205
-
3206
- if ( sliderRatio > iframeRatio ) {
3207
- iframeWidth = sliderWidth;
3208
- iframeHeight = iframeWidth / iframeRatio;
3209
- iframeTopDistance = '-'+ ( iframeHeight - sliderHeight ) / 2 +'px';
3210
- } else {
3211
- iframeHeight = sliderHeight;
3212
- iframeWidth = iframeHeight * iframeRatio;
3213
- iframeLeftDistance = '-'+ ( iframeWidth - sliderWidth ) / 2 +'px';
3214
- }
3215
-
3216
- $advancedSlider.find('iframe').css({
3217
- 'width': iframeWidth +'px',
3218
- 'height': iframeHeight +'px',
3219
- 'max-width': 'none',
3220
- 'position': 'absolute',
3221
- 'left': iframeLeftDistance +'',
3222
- 'top': iframeTopDistance +'',
3223
- 'display': 'block',
3224
- 'text-align': 'inherit',
3225
- 'line-height':'0px',
3226
- 'border-width': '0px',
3227
- 'margin': '0px',
3228
- 'padding': '0px',
3229
- });
3230
- }
3231
-
3232
- $(window).on('load resize', function(){
3233
- sliderVideoSize();
3234
- });
3235
-
3236
- function autoplayVideo() {
3237
- $advancedSlider.find('.slick-active').each(function() {
3238
- var videoSrc = $(this).attr('data-video-src'),
3239
- videoAutoplay = $(this).attr('data-video-autoplay');
3240
-
3241
- if ( $(this).find( '.wpr-slider-video' ).length !== 1 && videoAutoplay === 'yes' ) {
3242
- if ( sliderColumnsDesktop == 1 ) {
3243
- $(this).find('.wpr-cv-inner').prepend('<div class="wpr-slider-video"><iframe src="'+ videoSrc +'" width="100%" height="100%" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
3244
- } else {
3245
- $(this).find('.wpr-cv-container').prepend('<div class="wpr-slider-video"><iframe src="'+ videoSrc +'" width="100%" height="100%" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
3246
- }
3247
- sliderVideoSize();
3248
- }
3249
- });
3250
- }
3251
-
3252
- autoplayVideo();
3253
-
3254
- function slideAnimationOff() {
3255
- if ( sliderColumnsDesktop == 1 ) {
3256
- $advancedSlider.find('.wpr-slider-item').not('.slick-active').find('.wpr-slider-animation').removeClass( 'wpr-animation-enter' );
3257
- }
3258
- }
3259
-
3260
- function slideAnimationOn() {
3261
- $advancedSlider.find('.slick-active').find('.wpr-slider-content').fadeIn(0);
3262
- if ( sliderColumnsDesktop == 1 ) {
3263
- $advancedSlider.find('.slick-active').find('.wpr-slider-animation').addClass( 'wpr-animation-enter' );
3264
- }
3265
- }
3266
-
3267
- slideAnimationOn();
3268
-
3269
- $advancedSlider.find('.wpr-slider-video-btn').on( 'click', function() {
3270
-
3271
- var currentSlide = $(this).closest('.slick-active'),
3272
- videoSrc = currentSlide.attr('data-video-src');
3273
-
3274
- if ( currentSlide.find( '.wpr-slider-video' ).length !== 1 ) {
3275
- currentSlide.find('.wpr-cv-container').prepend('<div class="wpr-slider-video"><iframe src="'+ videoSrc +'" width="100%" height="100%" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
3276
- sliderVideoSize();
3277
- currentSlide.find('.wpr-slider-content').fadeOut(300);
3278
- }
3279
-
3280
- });
3281
-
3282
- $advancedSlider.on( {
3283
- beforeChange: function() {
3284
- $advancedSlider.find('.wpr-slider-item').not('.slick-active').find('.wpr-slider-video').remove();
3285
- $advancedSlider.find('.wpr-animation-enter').find('.wpr-slider-content').fadeOut(300);
3286
- slideAnimationOff();
3287
- },
3288
- afterChange: function( event, slick, currentSlide ) {
3289
- slideAnimationOn();
3290
- autoplayVideo();
3291
- }
3292
- });
3293
-
3294
- // Adjust Horizontal Pagination
3295
- if ( $scope.find( '.slick-dots' ).length && $scope.hasClass( 'wpr-slider-dots-horizontal') ) {
3296
- // Calculate Width
3297
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
3298
-
3299
- // on Load
3300
- if ( $scope.find( '.slick-dots' ).length ) {
3301
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
3302
- }
3303
-
3304
- // on Resize
3305
- $(window).smartresize(function() {
3306
- setTimeout(function() {
3307
- // Calculate Width
3308
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
3309
-
3310
- // Set Width
3311
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
3312
- }, 300 );
3313
- });
3314
- }
3315
-
3316
- }, // End widgetAdvancedSlider
3317
-
3318
- widgetTestimonialCarousel: function( $scope ) {
3319
- var testimonialCarousel = $scope.find( '.wpr-testimonial-carousel' );
3320
- // Slider Columns
3321
- var sliderClass = $scope.attr('class'),
3322
- sliderColumnsDesktop = sliderClass.match(/wpr-testimonial-slider-columns-\d/) ? sliderClass.match(/wpr-testimonial-slider-columns-\d/).join().slice(-1) : 2,
3323
- sliderColumnsWideScreen = sliderClass.match(/columns--widescreen\d/) ? sliderClass.match(/columns--widescreen\d/).join().slice(-1) : sliderColumnsDesktop,
3324
- sliderColumnsLaptop = sliderClass.match(/columns--laptop\d/) ? sliderClass.match(/columns--laptop\d/).join().slice(-1) : sliderColumnsDesktop,
3325
- sliderColumnsTabletExtra = sliderClass.match(/columns--tablet_extra\d/) ? sliderClass.match(/columns--tablet_extra\d/).join().slice(-1) : sliderColumnsTablet,
3326
- sliderColumnsTablet = sliderClass.match(/columns--tablet\d/) ? sliderClass.match(/columns--tablet\d/).join().slice(-1) : 2,
3327
- sliderColumnsMobileExtra = sliderClass.match(/columns--mobile_extra\d/) ? sliderClass.match(/columns--mobile_extra\d/).join().slice(-1) : sliderColumnsTablet,
3328
- sliderColumnsMobile = sliderClass.match(/columns--mobile\d/) ? sliderClass.match(/columns--mobile\d/).join().slice(-1) : 1,
3329
- sliderSlidesToScroll = +(sliderClass.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1)),
3330
- dataSlideEffect = testimonialCarousel.attr('data-slide-effect');
3331
-
3332
- testimonialCarousel.slick({
3333
- appendArrows: $scope.find('.wpr-testimonial-controls'),
3334
- appendDots: $scope.find('.wpr-testimonial-dots'),
3335
- customPaging: function (slider, i) {
3336
- var slideNumber = (i + 1),
3337
- totalSlides = slider.slideCount;
3338
-
3339
- return '<span class="wpr-testimonial-dot"></span>';
3340
- },
3341
- slidesToShow: sliderColumnsDesktop,
3342
- responsive: [
3343
- {
3344
- breakpoint: 10000,
3345
- settings: {
3346
- slidesToShow: sliderColumnsWideScreen,
3347
- slidesToScroll: sliderSlidesToScroll > sliderColumnsWideScreen ? 1 : sliderSlidesToScroll,
3348
- fade: (1 == sliderColumnsWideScreen && 'fade' === dataSlideEffect) ? true : false
3349
- }
3350
- },
3351
- {
3352
- breakpoint: 2399,
3353
- settings: {
3354
- slidesToShow: sliderColumnsDesktop,
3355
- slidesToScroll: sliderSlidesToScroll > sliderColumnsDesktop ? 1 : sliderSlidesToScroll,
3356
- fade: (1 == sliderColumnsDesktop && 'fade' === dataSlideEffect) ? true : false
3357
- }
3358
- },
3359
- {
3360
- breakpoint: 1221,
3361
- settings: {
3362
- slidesToShow: sliderColumnsLaptop,
3363
- slidesToScroll: sliderSlidesToScroll > sliderColumnsLaptop ? 1 : sliderSlidesToScroll,
3364
- fade: (1 == sliderColumnsLaptop && 'fade' === dataSlideEffect) ? true : false
3365
- }
3366
- },
3367
- {
3368
- breakpoint: 1200,
3369
- settings: {
3370
- slidesToShow: sliderColumnsTabletExtra,
3371
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTabletExtra ? 1 : sliderSlidesToScroll,
3372
- fade: (1 == sliderColumnsTabletExtra && 'fade' === dataSlideEffect) ? true : false
3373
- }
3374
- },
3375
- {
3376
- breakpoint: 1024,
3377
- settings: {
3378
- slidesToShow: sliderColumnsTablet,
3379
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTablet ? 1 : sliderSlidesToScroll,
3380
- fade: (1 == sliderColumnsTablet && 'fade' === dataSlideEffect) ? true : false
3381
- }
3382
- },
3383
- {
3384
- breakpoint: 880,
3385
- settings: {
3386
- slidesToShow: sliderColumnsMobileExtra,
3387
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobileExtra ? 1 : sliderSlidesToScroll,
3388
- fade: (1 == sliderColumnsMobileExtra && 'fade' === dataSlideEffect) ? true : false
3389
- }
3390
- },
3391
- {
3392
- breakpoint: 768,
3393
- settings: {
3394
- slidesToShow: sliderColumnsMobile,
3395
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobile ? 1 : sliderSlidesToScroll,
3396
- fade: (1 == sliderColumnsMobile && 'fade' === dataSlideEffect) ? true : false
3397
- }
3398
- }
3399
- ],
3400
- });
3401
-
3402
- // Show Arrows On Hover
3403
- if ( $scope.hasClass( 'wpr-testimonial-nav-fade' ) ) {
3404
- $scope.on( 'mouseover', function() {
3405
- $scope.closest( 'section' ).find( '.wpr-testimonial-arrow' ).css({
3406
- 'opacity' : 1,
3407
- });
3408
- } );
3409
- $scope.closest( 'section' ).on( 'mouseout', function() {
3410
- $scope.find( '.wpr-testimonial-arrow' ).css({
3411
- 'opacity' : 0,
3412
- });
3413
- } );
3414
- }
3415
-
3416
- // on Load
3417
- if ( $scope.find( '.slick-dots' ).length ) {
3418
- // Calculate Width
3419
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
3420
-
3421
- // Set Width
3422
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
3423
- }
3424
-
3425
- $(window).smartresize(function() {
3426
- setTimeout(function() {
3427
- if ( $scope.find( '.slick-dots' ).length ) {
3428
- // Calculate Width
3429
- var dotsWrapWidth = $scope.find( '.slick-dots li' ).outerWidth() * $scope.find( '.slick-dots li' ).length - parseInt( $scope.find( '.slick-dots li span' ).css( 'margin-right' ), 10 );
3430
-
3431
- // Set Width
3432
- $scope.find( '.slick-dots' ).css( 'width', dotsWrapWidth );
3433
- }
3434
- }, 300 );
3435
- });
3436
-
3437
- }, // End widgetTestimonialCarousel
3438
-
3439
- widgetSearch: function( $scope ) {
3440
-
3441
- $scope.find('.wpr-search-form-input').on( {
3442
- focus: function() {
3443
- $scope.addClass( 'wpr-search-form-input-focus' );
3444
- },
3445
- blur: function() {
3446
- $scope.removeClass( 'wpr-search-form-input-focus' );
3447
- }
3448
- } );
3449
-
3450
- var prevData;
3451
- var searchTimeout = null;
3452
-
3453
- function ajaxSearchCall(thisObject, postsOffset, e) {
3454
- if ( e.which === 13 ) {
3455
- return false;
3456
- }
3457
-
3458
- if (searchTimeout != null) {
3459
- clearTimeout(searchTimeout);
3460
- }
3461
- searchTimeout = setTimeout(() => {
3462
- var thisValue = thisObject.val();
3463
- $.ajax({
3464
- type: 'POST',
3465
- url: WprConfig.ajaxurl,
3466
- data: {
3467
- action: 'wpr_data_fetch',
3468
- nonce: WprConfig.nonce,
3469
- wpr_keyword: $scope.find('.wpr-search-form-input').val(),
3470
- wpr_query_type: $scope.find('.wpr-search-form-input').attr('wpr-query-type'),
3471
- wpr_number_of_results: $scope.find('.wpr-search-form-input').attr('number-of-results'),
3472
- wpr_search_results_offset: postsOffset,
3473
- wpr_number_of_words: $scope.find('.wpr-search-form-input').attr('number-of-words'),
3474
- wpr_show_ajax_thumbnail: $scope.find('.wpr-search-form-input').attr('show-ajax-thumbnails'),
3475
- wpr_show_view_result_btn: $scope.find('.wpr-search-form-input').attr('show-view-result-btn'),
3476
- wpr_view_result_text: $scope.find('.wpr-search-form-input').attr('view-result-text'),
3477
- wpr_exclude_without_thumb: $scope.find('.wpr-search-form-input').attr('exclude-without-thumb'),
3478
- wpr_ajax_search_link_target: $scope.find('.wpr-search-form-input').attr('link-target'),
3479
- // wpr_ajax_search_img_size: $scope.find('.wpr-search-form-input').attr('ajax-search-img-size')
3480
- },
3481
- success: function(data) {
3482
- if ( $scope.find('.wpr-data-fetch ul').html() === '' ) {
3483
- $scope.find( '.wpr-pagination-loading' ).hide();
3484
- $scope.find('.wpr-data-fetch ul').html( data );
3485
- $scope.find('.wpr-no-more-results').fadeOut(100);
3486
- setTimeout(function() {
3487
- if (!data.includes('wpr-no-results')) {
3488
- $scope.find('.wpr-ajax-search-pagination').css('display', 'flex');
3489
- if ( $scope.find('.wpr-data-fetch ul').find('li').length < $scope.find('.wpr-search-form-input').attr('number-of-results') ||
3490
- $scope.find('.wpr-data-fetch ul').find('li').length == $scope.find('.wpr-data-fetch ul').find('li').data('number-of-results')) {
3491
- $scope.find('.wpr-ajax-search-pagination').css('display', 'none');
3492
- $scope.find('.wpr-load-more-results').fadeOut(100);
3493
- } else {
3494
- $scope.find('.wpr-ajax-search-pagination').css('display', 'flex');
3495
- $scope.find('.wpr-load-more-results').fadeIn(100);
3496
- }
3497
- } else {
3498
- $scope.find('.wpr-ajax-search-pagination').css('display', 'none');
3499
- }
3500
- }, 100);
3501
- prevData = data;
3502
- } else {
3503
- if ( data != prevData ) {
3504
- prevData = data;
3505
- if (data.includes('wpr-no-results')) {
3506
- $scope.find('.wpr-ajax-search-pagination').css('display', 'none');
3507
- $scope.find('.wpr-data-fetch ul').html('');
3508
- } else {
3509
- $scope.find('.wpr-ajax-search-pagination').css('display', 'flex');
3510
- }
3511
-
3512
- $scope.find('.wpr-data-fetch ul').append( data );
3513
-
3514
- if (data == '') {
3515
- $scope.find('.wpr-load-more-results').fadeOut(100);
3516
- setTimeout(function() {
3517
- $scope.find( '.wpr-pagination-loading' ).hide();
3518
- $scope.find('.wpr-no-more-results').fadeIn(100);
3519
- }, 100);
3520
- } else {
3521
- $scope.find( '.wpr-pagination-loading' ).hide();
3522
- $scope.find('.wpr-load-more-results').show();
3523
- }
3524
-
3525
- if ($scope.find('.wpr-data-fetch ul').find('li').length < $scope.find('.wpr-search-form-input').attr('number-of-results')) {
3526
- $scope.find('.wpr-load-more-results').fadeOut(100);
3527
- setTimeout(function() {
3528
- $scope.find( '.wpr-pagination-loading' ).hide();
3529
- $scope.find('.wpr-no-more-results').fadeIn(100);
3530
- }, 100);
3531
- } else {
3532
- $scope.find('.wpr-load-more-results').show();
3533
- }
3534
-
3535
- if ( $scope.find('.wpr-data-fetch ul').find('li').length == $scope.find('.wpr-data-fetch ul').find('li').data('number-of-results') ) {
3536
- $scope.find('.wpr-load-more-results').fadeOut(100);
3537
- setTimeout(function() {
3538
- $scope.find( '.wpr-pagination-loading' ).hide();
3539
- $scope.find('.wpr-no-more-results').fadeIn(100);
3540
- }, 100);
3541
- } else {
3542
- $scope.find('.wpr-load-more-results').show();
3543
- }
3544
- // $scope.find( '.wpr-pagination-loading' ).hide();
3545
- }
3546
- }
3547
-
3548
- if (data.includes('wpr-no-results')) {
3549
- $scope.find('.wpr-ajax-search-pagination').css('display', 'none');
3550
- $scope.find('.wpr-load-more-results').fadeOut();
3551
- } else {
3552
- $scope.find('.wpr-ajax-search-pagination').css('display', 'flex');
3553
- }
3554
-
3555
- if (thisValue.length > 2) {
3556
- $scope.find('.wpr-data-fetch').slideDown(200);
3557
- $scope.find('.wpr-data-fetch ul').fadeTo(200, 1);
3558
- } else {
3559
- $scope.find('.wpr-data-fetch').slideUp(200);
3560
- $scope.find('.wpr-data-fetch ul').fadeTo(200, 0);
3561
- setTimeout(function() {
3562
- $scope.find('.wpr-data-fetch ul').html('');
3563
- $scope.find('.wpr-no-results').remove();
3564
- }, 600);
3565
- postsOffset = 0;
3566
- }
3567
- },
3568
- error: function(error) {
3569
- console.log(error);
3570
- }
3571
- });
3572
- }, 400);
3573
- }
3574
-
3575
- if ($scope.find('.wpr-search-form-input').attr('ajax-search') === 'yes') {
3576
-
3577
- $scope.find('.wpr-search-form').attr('autocomplete', 'off');
3578
-
3579
- var postsOffset = 0;
3580
- // $scope.find('.wpr-data-fetch ul').on('scroll', function(e) {
3581
- // if ( $(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight ) {
3582
- // postsOffset += +$scope.find('.wpr-search-form-input').attr('number-of-results');
3583
- // ajaxSearchCall($scope.find('.wpr-search-form-input'), postsOffset, e);
3584
- // }
3585
- // });
3586
-
3587
- $scope.find('.wpr-load-more-results').on('click', function(e) {
3588
- postsOffset += +$scope.find('.wpr-search-form-input').attr('number-of-results');
3589
- $scope.find('.wpr-load-more-results').hide();
3590
- $scope.find( '.wpr-pagination-loading' ).css( 'display', 'inline-block' );
3591
- ajaxSearchCall($scope.find('.wpr-search-form-input'), postsOffset, e);
3592
- });
3593
-
3594
- $scope.find('.wpr-search-form-input').on('keyup', function(e) {
3595
- postsOffset = 0;
3596
- $scope.find('.wpr-data-fetch').hide();
3597
- $scope.find('.wpr-data-fetch ul').html('');
3598
- ajaxSearchCall($(this), postsOffset, e);
3599
- });
3600
-
3601
- $scope.find('.wpr-data-fetch').on('click', '.wpr-close-search', function() {
3602
- $scope.find('.wpr-search-form-input').val('');
3603
- $scope.find('.wpr-data-fetch').slideUp(200);
3604
- setTimeout(function() {
3605
- $scope.find('.wpr-data-fetch ul').html('');
3606
- $scope.find('.wpr-no-results').remove();
3607
- }, 400);
3608
- postsOffset = 0;
3609
- });
3610
-
3611
- $('body').on('click', function(e) {
3612
- if ( !e.target.classList.value.includes('wpr-data-fetch') && !e.target.closest('.wpr-data-fetch') ) {
3613
- if ( !e.target.classList.value.includes('wpr-search-form') && !e.target.closest('.wpr-search-form') ) {
3614
- $scope.find('.wpr-search-form-input').val('');
3615
- $scope.find('.wpr-data-fetch').slideUp(200);
3616
- setTimeout(function() {
3617
- $scope.find('.wpr-data-fetch ul').html('');
3618
- $scope.find('.wpr-no-results').remove();
3619
- }, 400);
3620
- postsOffset = 0;
3621
- }
3622
- }
3623
- });
3624
-
3625
-
3626
-
3627
- var mutationObserver = new MutationObserver(function(mutations) {
3628
- $scope.find('.wpr-data-fetch li').on('click', function() {
3629
- var itemUrl = $(this).find('a').attr('href');
3630
- var itemUrlTarget = $(this).find('a').attr('target');
3631
- window.open(itemUrl, itemUrlTarget).focus();
3632
- });
3633
- });
3634
-
3635
- // Listen to Mini Cart Changes
3636
- mutationObserver.observe($scope[0], {
3637
- childList: true,
3638
- subtree: true,
3639
- });
3640
- }
3641
-
3642
- }, // End widgetSearch
3643
-
3644
- widgetAdvancedText: function( $scope ) {
3645
-
3646
- if ( $scope.hasClass('wpr-advanced-text-style-animated') ) {
3647
- var animText = $scope.find( '.wpr-anim-text' ),
3648
- animLetters = $scope.find( '.wpr-anim-text-letters' ),
3649
- animDuration = animText.attr( 'data-anim-duration' ),
3650
- animDurationData = animDuration.split( ',' ),
3651
- animLoop = animText.attr( 'data-anim-loop' ),
3652
- animTextLength = animText.find('b').length,
3653
- animTextCount = 0;
3654
-
3655
- animText.find('b').first().addClass('wpr-anim-text-visible');
3656
-
3657
- // set animation timing
3658
- var animDuration = parseInt( animDurationData[0], 10),
3659
- animDelay = parseInt( animDurationData[1], 10),
3660
- //type effect
3661
- selectionDuration = 500,
3662
- typeAnimationDelay = selectionDuration + 800;
3663
-
3664
- initHeadline();
3665
- }
3666
-
3667
- function loadLongShadow() {
3668
-
3669
- var $clippedText = $scope.find( '.wpr-clipped-text' ),
3670
- clippedOption = $clippedText.data('clipped-options'),
3671
- currentDeviceMode = elementorFrontend.getCurrentDeviceMode();
3672
-
3673
- if ( clippedOption ) {
3674
- var longShadowSize = clippedOption.longShadowSize,
3675
- longShadowSizeTablet = clippedOption.longShadowSizeTablet,
3676
- longShadowSizeMobile = clippedOption.longShadowSizeMobile;
3677
-
3678
- if ('desktop' === currentDeviceMode ) {
3679
- longShadowSize = clippedOption.longShadowSize;
3680
- }
3681
-
3682
- if ('tablet' === currentDeviceMode && longShadowSizeTablet ) {
3683
- longShadowSize = longShadowSizeTablet;
3684
- }
3685
-
3686
- if ('mobile' === currentDeviceMode && longShadowSizeMobile ) {
3687
- longShadowSize = longShadowSizeMobile;
3688
- }
3689
-
3690
- $clippedText.find('.wpr-clipped-text-long-shadow').attr('style','text-shadow:'+longShadow( clippedOption.longShadowColor, longShadowSize, clippedOption.longShadowDirection ));
3691
- }
3692
- }
3693
-
3694
- loadLongShadow();
3695
-
3696
- $(window).on('resize', function() {
3697
- loadLongShadow();
3698
- });
3699
-
3700
- function initHeadline() {
3701
- //insert <i> element for each letter of a changing word
3702
- singleLetters(animLetters.find('b'));
3703
- //initialise headline animation
3704
- animateHeadline(animText);
3705
- }
3706
-
3707
- function singleLetters($words) {
3708
- $words.each(function() {
3709
- var word = $(this),
3710
- letters = word.text().split(''),
3711
- selected = word.hasClass('wpr-anim-text-visible');
3712
- for (var i in letters) {
3713
- var letter = letters[i].replace(/ /g, '&nbsp;');
3714
-
3715
- letters[i] = (selected) ? '<i class="wpr-anim-text-in">' + letter + '</i>': '<i>' + letter + '</i>';
3716
- }
3717
- var newLetters = letters.join('');
3718
- word.html(newLetters).css('opacity', 1);
3719
- });
3720
- }
3721
-
3722
- function animateHeadline($headlines) {
3723
- var duration = animDelay;
3724
- $headlines.each(function(){
3725
- var headline = $(this),
3726
- spanWrapper = headline.find('.wpr-anim-text-inner');
3727
-
3728
- if (headline.hasClass('wpr-anim-text-type-clip')){
3729
- var newWidth = spanWrapper.outerWidth();
3730
- spanWrapper.css('width', newWidth);
3731
- }
3732
-
3733
- //trigger animation
3734
- setTimeout(function(){
3735
- hideWord( headline.find('.wpr-anim-text-visible').eq(0) );
3736
- }, duration);
3737
-
3738
- // Fix Bigger Words Flip
3739
- if ( headline.hasClass( 'wpr-anim-text-type-rotate-1' ) ) {
3740
- spanWrapper.find( 'b' ).each(function() {
3741
- if ( $(this).outerWidth() > spanWrapper.outerWidth() ) {
3742
- spanWrapper.css( 'width', $(this).outerWidth() );
3743
- }
3744
- });
3745
- }
3746
- });
3747
- }
3748
-
3749
- function hideWord($word) {
3750
- var nextWord = takeNext($word);
3751
-
3752
- if ( animLoop !== 'yes' ) {
3753
-
3754
- animTextCount++;
3755
- if ( animTextCount === animTextLength ) {
3756
- return;
3757
- }
3758
-
3759
- }
3760
-
3761
- if ( $word.parents('.wpr-anim-text').hasClass('wpr-anim-text-type-typing') ) {
3762
- var parentSpan = $word.parent('.wpr-anim-text-inner');
3763
- parentSpan.addClass('wpr-anim-text-selected').removeClass('waiting');
3764
- setTimeout(function(){
3765
- parentSpan.removeClass('wpr-anim-text-selected');
3766
- $word.removeClass('wpr-anim-text-visible').addClass('wpr-anim-text-hidden').children('i').removeClass('wpr-anim-text-in').addClass('wpr-anim-text-out');
3767
- }, selectionDuration);
3768
- setTimeout(function(){ showWord(nextWord, animDuration) }, typeAnimationDelay);
3769
-
3770
- } else if ( $word.parents('.wpr-anim-text').hasClass('wpr-anim-text-letters') ) {
3771
-
3772
- var bool = ( $word.children( 'i' ).length >= nextWord.children( 'i' ).length ) ? true : false;
3773
- hideLetter($word.find('i').eq(0), $word, bool, animDuration);
3774
- showLetter(nextWord.find('i').eq(0), nextWord, bool, animDuration);
3775
-
3776
- } else if ( $word.parents('.wpr-anim-text').hasClass('wpr-anim-text-type-clip') ) {
3777
- $word.parents('.wpr-anim-text-inner').animate({ width : '2px' }, animDuration, function(){
3778
- switchWord($word, nextWord);
3779
- showWord(nextWord);
3780
- });
3781
-
3782
- } else {
3783
- switchWord($word, nextWord);
3784
- setTimeout(function(){ hideWord(nextWord) }, animDelay);
3785
- }
3786
-
3787
- }
3788
-
3789
- function showWord($word, $duration) {
3790
- if ( $word.parents( '.wpr-anim-text' ).hasClass( 'wpr-anim-text-type-typing' ) ) {
3791
- showLetter( $word.find( 'i' ).eq(0), $word, false, $duration );
3792
- $word.addClass( 'wpr-anim-text-visible' ).removeClass( 'wpr-anim-text-hidden' );
3793
-
3794
- } else if ( $word.parents( '.wpr-anim-text' ).hasClass( 'wpr-anim-text-type-clip' ) ) {
3795
- $word.parents( '.wpr-anim-text-inner' ).animate({ 'width' : $word.outerWidth() }, animDuration, function() {
3796
- setTimeout( function() {
3797
- hideWord($word);
3798
- }, animDelay );
3799
- });
3800
- }
3801
- }
3802
-
3803
- function hideLetter($letter, $word, $bool, $duration) {
3804
- $letter.removeClass('wpr-anim-text-in').addClass('wpr-anim-text-out');
3805
-
3806
- if ( !$letter.is(':last-child') ) {
3807
- setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration);
3808
- } else if ( $bool ) {
3809
- setTimeout(function(){ hideWord(takeNext($word)) }, animDelay);
3810
- }
3811
-
3812
- if ( $letter.is(':last-child') ) {
3813
- var nextWord = takeNext($word);
3814
- switchWord($word, nextWord);
3815
- }
3816
- }
3817
-
3818
- function showLetter($letter, $word, $bool, $duration) {
3819
- $letter.addClass('wpr-anim-text-in').removeClass('wpr-anim-text-out');
3820
-
3821
- if(!$letter.is(':last-child')) {
3822
- setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration);
3823
- } else {
3824
- if($word.parents('.wpr-anim-text').hasClass('wpr-anim-text-type-typing')) { setTimeout(function(){ $word.parents('.wpr-anim-text-inner').addClass('waiting'); }, 200);}
3825
- if(!$bool) { setTimeout(function(){ hideWord($word) }, animDelay) }
3826
- }
3827
- }
3828
-
3829
- function takeNext($word) {
3830
- return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0);
3831
- }
3832
-
3833
- function takePrev($word) {
3834
- return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last();
3835
- }
3836
-
3837
- function switchWord($oldWord, $newWord) {
3838
- $oldWord.removeClass('wpr-anim-text-visible').addClass('wpr-anim-text-hidden');
3839
- $newWord.removeClass('wpr-anim-text-hidden').addClass('wpr-anim-text-visible');
3840
- }
3841
-
3842
- function longShadow( shadowColor, shadowSize, shadowDirection ) {
3843
-
3844
- var textshadow = '';
3845
-
3846
- for ( var i = 0, len = shadowSize; i < len; i++ ) {
3847
- switch ( shadowDirection ) {
3848
- case 'top':
3849
- textshadow += '0 -'+ i +'px 0 '+ shadowColor +',';
3850
- break;
3851
-
3852
- case 'right':
3853
- textshadow += i +'px 0 0 '+ shadowColor +',';
3854
- break;
3855
-
3856
- case 'bottom':
3857
- textshadow += '0 '+ i +'px 0 '+ shadowColor +',';
3858
- break;
3859
-
3860
- case 'left':
3861
- textshadow += '-'+ i +'px 0 0 '+ shadowColor +',';
3862
- break;
3863
-
3864
- case 'top-left':
3865
- textshadow += '-'+ i +'px -'+ i +'px 0 '+ shadowColor +',';
3866
- break;
3867
-
3868
- case 'top-right':
3869
- textshadow += i +'px -'+ i +'px 0 '+ shadowColor +',';
3870
- break;
3871
-
3872
- case 'bottom-left':
3873
- textshadow += '-'+ i +'px '+ i +'px 0 '+ shadowColor +',';
3874
- break;
3875
-
3876
- case 'bottom-right':
3877
- textshadow += i +'px '+ i +'px 0 '+ shadowColor +',';
3878
- break;
3879
-
3880
- default:
3881
- textshadow += i +'px '+ i +'px 0 '+ shadowColor +',';
3882
- break;
3883
- }
3884
- }
3885
-
3886
- textshadow = textshadow.slice(0, -1);
3887
-
3888
- return textshadow;
3889
- }
3890
-
3891
- }, // End widgetAdvancedText
3892
-
3893
- widgetProgressBar: function( $scope ) {
3894
-
3895
- var $progressBar = $scope.find( '.wpr-progress-bar' ),
3896
- prBarCircle = $scope.find( '.wpr-prbar-circle' ),
3897
- $prBarCircleSvg = prBarCircle.find('.wpr-prbar-circle-svg'),
3898
- $prBarCircleLine = $prBarCircleSvg.find('.wpr-prbar-circle-line'),
3899
- $prBarCirclePrline = $scope.find( '.wpr-prbar-circle-prline' ),
3900
- prBarHrLine = $progressBar.find('.wpr-prbar-hr-line-inner'),
3901
- prBarVrLine = $progressBar.find('.wpr-prbar-vr-line-inner'),
3902
- prBarOptions = $progressBar.data('options'),
3903
- prBarCircleOptions = prBarCircle.data('circle-options'),
3904
- prBarCounter = $progressBar.find('.wpr-prbar-counter-value'),
3905
- prBarCounterValue = prBarOptions.counterValue,
3906
- prBarCounterValuePersent = prBarOptions.counterValuePersent,
3907
- prBarAnimDuration = prBarOptions.animDuration,
3908
- prBarAnimDelay = prBarOptions.animDelay,
3909
- prBarLoopDelay = +prBarOptions.loopDelay,
3910
- currentDeviceMode = elementorFrontend.getCurrentDeviceMode(),
3911
- numeratorData = {
3912
- toValue: prBarCounterValue,
3913
- duration: prBarAnimDuration,
3914
- };
3915
-
3916
- if ( 'yes' === prBarOptions.counterSeparator ) {
3917
- numeratorData.delimiter = ',';
3918
- }
3919
-
3920
-
3921
- function isInViewport( $selector ) {
3922
- if ( $selector.length ) {
3923
- var elementTop = $selector.offset().top,
3924
- elementBottom = elementTop + $selector.outerHeight(),
3925
- viewportTop = $(window).scrollTop(),
3926
- viewportBottom = viewportTop + $(window).height();
3927
-
3928
- if ( elementTop > $(window).height() ) {
3929
- elementTop += 50;
3930
- }
3931
-
3932
- return elementBottom > viewportTop && elementTop < viewportBottom;
3933
- }
3934
- };
3935
-
3936
- function progressBar() {
3937
-
3938
- if ( isInViewport( prBarVrLine ) ) {
3939
- prBarVrLine.css({
3940
- 'height': prBarCounterValuePersent + '%'
3941
- });
3942
- }
3943
-
3944
- if ( isInViewport( prBarHrLine ) ) {
3945
- prBarHrLine.css({
3946
- 'width': prBarCounterValuePersent + '%'
3947
- });
3948
- }
3949
-
3950
- if ( isInViewport( prBarCircle ) ) {
3951
- var circleDashOffset = prBarCircleOptions.circleOffset;
3952
-
3953
- $prBarCirclePrline.css({
3954
- 'stroke-dashoffset': circleDashOffset
3955
- });
3956
- }
3957
-
3958
- // Set Delay
3959
- if ( isInViewport( prBarVrLine ) || isInViewport( prBarHrLine ) || isInViewport( prBarCircle ) ) {
3960
- setTimeout(function() {
3961
- prBarCounter.numerator( numeratorData );
3962
- }, prBarAnimDelay );
3963
- }
3964
-
3965
- }
3966
-
3967
- progressBar();
3968
-
3969
- if (prBarOptions.loop === 'yes') {
3970
- setInterval(function() {
3971
-
3972
- if ( isInViewport( prBarVrLine ) ) {
3973
- prBarVrLine.css({
3974
- 'height': 0 + '%'
3975
- });
3976
- }
3977
-
3978
- if ( isInViewport( prBarHrLine ) ) {
3979
- prBarHrLine.css({
3980
- 'width': 0 + '%'
3981
- });
3982
- }
3983
-
3984
- if ( isInViewport( prBarCircle ) ) {
3985
- var circleDashOffset = prBarCircleOptions.circleOffset;
3986
-
3987
- $prBarCirclePrline.css({
3988
- 'stroke-dashoffset': $prBarCirclePrline.css('stroke-dasharray')
3989
- });
3990
- }
3991
-
3992
- // Set Delay
3993
- if ( isInViewport( prBarVrLine ) || isInViewport( prBarHrLine ) || isInViewport( prBarCircle ) ) {
3994
- setTimeout(function() {
3995
- prBarCounter.numerator( {
3996
- toValue: 0,
3997
- duration: prBarAnimDuration,
3998
- } );
3999
- }, prBarAnimDelay);
4000
- }
4001
-
4002
- setTimeout(function() {
4003
- progressBar();
4004
- }, prBarAnimDuration + prBarAnimDelay);
4005
- }, (prBarAnimDuration + prBarAnimDelay) * prBarLoopDelay);
4006
- }
4007
-
4008
- $(window).on('scroll', function() {
4009
- progressBar();
4010
- });
4011
-
4012
- }, // End widgetProgressBar
4013
-
4014
- widgetImageHotspots: function( $scope ) {
4015
-
4016
- var $imgHotspots = $scope.find( '.wpr-image-hotspots' ),
4017
- hotspotsOptions = $imgHotspots.data('options'),
4018
- $hotspotItem = $imgHotspots.find('.wpr-hotspot-item'),
4019
- tooltipTrigger = hotspotsOptions.tooltipTrigger;
4020
-
4021
- if ( 'click' === tooltipTrigger ) {
4022
- $hotspotItem.on( 'click', function() {
4023
- if ( $(this).hasClass('wpr-tooltip-active') ) {
4024
- $(this).removeClass('wpr-tooltip-active');
4025
- } else {
4026
- $hotspotItem.removeClass('wpr-tooltip-active');
4027
- $(this).addClass('wpr-tooltip-active');
4028
- }
4029
- event.stopPropagation();
4030
- });
4031
-
4032
- $(window).on( 'click', function () {
4033
- $hotspotItem.removeClass('wpr-tooltip-active');
4034
- });
4035
-
4036
- } else if ( 'hover' === tooltipTrigger ) {
4037
- $hotspotItem.hover(function () {
4038
- $(this).toggleClass('wpr-tooltip-active');
4039
- });
4040
-
4041
- } else {
4042
- $hotspotItem.addClass('wpr-tooltip-active');
4043
- }
4044
-
4045
- }, // End widgetImageHotspots
4046
-
4047
- widgetFlipBox: function( $scope ) {
4048
-
4049
- var $flipBox = $scope.find('.wpr-flip-box'),
4050
- flipBoxTrigger = $flipBox.data('trigger');
4051
-
4052
- if ( 'box' === flipBoxTrigger ) {
4053
-
4054
- $flipBox.find('.wpr-flip-box-front').on( 'click', function() {
4055
- $(this).closest('.wpr-flip-box').addClass('wpr-flip-box-active');
4056
- });
4057
-
4058
- $(window).on( 'click', function () {
4059
- if( $(event.target).closest('.wpr-flip-box').length === 0 ) {
4060
- $flipBox.removeClass('wpr-flip-box-active');
4061
- }
4062
- });
4063
-
4064
- } else if ( 'btn' == flipBoxTrigger ) {
4065
-
4066
- $flipBox.find('.wpr-flip-box-btn').on( 'click', function() {
4067
- $(this).closest('.wpr-flip-box').addClass('wpr-flip-box-active');
4068
- });
4069
-
4070
- $(window).on( 'click', function () {
4071
- if( $(event.target).closest('.wpr-flip-box').length === 0 ) {
4072
- $flipBox.removeClass('wpr-flip-box-active');
4073
- }
4074
- });
4075
-
4076
-
4077
- } else if ( 'hover' == flipBoxTrigger ) {
4078
-
4079
- $flipBox.hover(function () {
4080
- $(this).toggleClass('wpr-flip-box-active');
4081
- });
4082
-
4083
- }
4084
-
4085
- }, // End widgetFlipBox
4086
-
4087
- widgetContentTicker: function( $scope ) {
4088
- var $contentTickerSlider = $scope.find( '.wpr-ticker-slider' ),
4089
- $contentTickerMarquee = $scope.find( '.wpr-ticker-marquee' ),
4090
- marqueeData = $contentTickerMarquee.data('options');
4091
- // Slider Columns
4092
- var sliderClass = $scope.attr('class'),
4093
- sliderColumnsDesktop = sliderClass.match(/wpr-ticker-slider-columns-\d/) ? sliderClass.match(/wpr-ticker-slider-columns-\d/).join().slice(-1) : 2,
4094
- sliderColumnsWideScreen = sliderClass.match(/columns--widescreen\d/) ? sliderClass.match(/columns--widescreen\d/).join().slice(-1) : sliderColumnsDesktop,
4095
- sliderColumnsLaptop = sliderClass.match(/columns--laptop\d/) ? sliderClass.match(/columns--laptop\d/).join().slice(-1) : sliderColumnsDesktop,
4096
- sliderColumnsTabletExtra = sliderClass.match(/columns--tablet_extra\d/) ? sliderClass.match(/columns--tablet_extra\d/).join().slice(-1) : sliderColumnsTablet,
4097
- sliderColumnsTablet = sliderClass.match(/columns--tablet\d/) ? sliderClass.match(/columns--tablet\d/).join().slice(-1) : 2,
4098
- sliderColumnsMobileExtra = sliderClass.match(/columns--mobile_extra\d/) ? sliderClass.match(/columns--mobile_extra\d/).join().slice(-1) : sliderColumnsTablet,
4099
- sliderColumnsMobile = sliderClass.match(/columns--mobile\d/) ? sliderClass.match(/columns--mobile\d/).join().slice(-1) : 1,
4100
- dataSlideEffect = $contentTickerSlider.attr('data-slide-effect'),
4101
- sliderSlidesToScroll = 'hr-slide' === dataSlideEffect && sliderClass.match(/wpr-ticker-slides-to-scroll-\d/) ? +(sliderClass.match(/wpr-ticker-slides-to-scroll-\d/).join().slice(-1)) : 1;
4102
-
4103
- $contentTickerSlider.slick({
4104
- appendArrows : $scope.find('.wpr-ticker-slider-controls'),
4105
- slidesToShow: sliderColumnsDesktop,
4106
- responsive: [
4107
- {
4108
- breakpoint: 10000,
4109
- settings: {
4110
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsWideScreen,
4111
- slidesToScroll: sliderSlidesToScroll > sliderColumnsWideScreen ? 1 : sliderSlidesToScroll,
4112
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4113
- }
4114
- },
4115
- {
4116
- breakpoint: 2399,
4117
- settings: {
4118
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsDesktop,
4119
- slidesToScroll: sliderSlidesToScroll > sliderColumnsDesktop ? 1 : sliderSlidesToScroll,
4120
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4121
- }
4122
- },
4123
- {
4124
- breakpoint: 1221,
4125
- settings: {
4126
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsLaptop,
4127
- slidesToScroll: sliderSlidesToScroll > sliderColumnsLaptop ? 1 : sliderSlidesToScroll,
4128
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4129
- }
4130
- },
4131
- {
4132
- breakpoint: 1200,
4133
- settings: {
4134
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsTabletExtra,
4135
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTabletExtra ? 1 : sliderSlidesToScroll,
4136
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4137
- }
4138
- },
4139
- {
4140
- breakpoint: 1024,
4141
- settings: {
4142
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsTablet,
4143
- slidesToScroll: sliderSlidesToScroll > sliderColumnsTablet ? 1 : sliderSlidesToScroll,
4144
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4145
- }
4146
- },
4147
- {
4148
- breakpoint: 880,
4149
- settings: {
4150
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsMobileExtra,
4151
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobileExtra ? 1 : sliderSlidesToScroll,
4152
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4153
- }
4154
- },
4155
- {
4156
- breakpoint: 768,
4157
- settings: {
4158
- slidesToShow: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect ) ? 1 : sliderColumnsMobile,
4159
- slidesToScroll: sliderSlidesToScroll > sliderColumnsMobile ? 1 : sliderSlidesToScroll,
4160
- fade: ('typing' === dataSlideEffect || 'fade' === dataSlideEffect) ? true : false
4161
- }
4162
- }
4163
- ],
4164
- });
4165
-
4166
- $contentTickerMarquee.marquee(marqueeData);
4167
-
4168
- }, // End widgetContentTicker
4169
-
4170
- widgetTabs: function( $scope ) {
4171
-
4172
- var $tabs = $( '.wpr-tabs', $scope ).first(),
4173
- $tabList = $( '.wpr-tabs-wrap', $tabs ).first(),
4174
- $contentWrap = $( '.wpr-tabs-content-wrap', $tabs ).first(),
4175
- $tabList = $( '> .wpr-tab', $tabList ),
4176
- $contentList = $( '> .wpr-tab-content', $contentWrap ),
4177
- tabsData = $tabs.data('options');
4178
-
4179
- // Active Tab
4180
- var activeTabIndex = tabsData.activeTab - 1;
4181
- $tabList.eq( activeTabIndex ).addClass( 'wpr-tab-active' );
4182
- $contentList.eq( activeTabIndex ).addClass( 'wpr-tab-content-active wpr-animation-enter' );
4183
-
4184
- if ( tabsData.autoplay === 'yes' ) {
4185
-
4186
- var startIndex = tabsData.activeTab - 1;
4187
-
4188
- var autoplayInterval = setInterval( function() {
4189
-
4190
- if ( startIndex < $tabList.length - 1 ) {
4191
- startIndex++;
4192
- } else {
4193
- startIndex = 0;
4194
- }
4195
-
4196
- wprTabsSwitcher( startIndex );
4197
-
4198
- }, tabsData.autoplaySpeed );
4199
- }
4200
-
4201
- if ( 'hover' === tabsData.trigger ) {
4202
- wprTabsHover();
4203
- } else {
4204
- wprTabsClick();
4205
- }
4206
-
4207
- // Tab Switcher
4208
- function wprTabsSwitcher( index ) {
4209
-
4210
- var activeTab = $tabList.eq( index ),
4211
- activeContent = $contentList.eq( index ),
4212
- activeContentHeight = 'auto';
4213
-
4214
- $contentWrap.css( { 'height': $contentWrap.outerHeight( true ) } );
4215
-
4216
- $tabList.removeClass( 'wpr-tab-active' );
4217
- activeTab.addClass( 'wpr-tab-active' );
4218
-
4219
- $contentList.removeClass( 'wpr-tab-content-active wpr-animation-enter' );
4220
-
4221
- activeContentHeight = activeContent.outerHeight( true );
4222
- activeContentHeight += parseInt( $contentWrap.css( 'border-top-width' ) ) + parseInt( $contentWrap.css( 'border-bottom-width' ) );
4223
-
4224
-
4225
- activeContent.addClass( 'wpr-tab-content-active wpr-animation-enter' );
4226
-
4227
- $contentWrap.css({ 'height': activeContentHeight });
4228
-
4229
- setTimeout( function() {
4230
- $contentWrap.css( { 'height': 'auto' } );
4231
- }, 500 );
4232
-
4233
- }
4234
-
4235
- // Tab Click Event
4236
- function wprTabsClick() {
4237
-
4238
- $tabList.on( 'click', function() {
4239
-
4240
- var tabIndex = $( this ).data( 'tab' ) - 1;
4241
-
4242
- clearInterval( autoplayInterval );
4243
- wprTabsSwitcher( tabIndex );
4244
-
4245
- });
4246
-
4247
- }
4248
-
4249
- // Tab Hover Event
4250
- function wprTabsHover() {
4251
- $tabList.hover( function () {
4252
-
4253
- var tabIndex = $( this ).data( 'tab' ) - 1;
4254
-
4255
- clearInterval( autoplayInterval );
4256
- wprTabsSwitcher( tabIndex );
4257
-
4258
- });
4259
- }
4260
-
4261
- }, // End widgetTabs
4262
-
4263
- widgetContentToogle: function( $scope ) {
4264
-
4265
- var $contentToggle = $( '.wpr-content-toggle', $scope ).first(),
4266
- $switcherContainer = $( '.wpr-switcher-container', $contentToggle ).first(),
4267
- $switcherWrap = $( '.wpr-switcher-wrap', $contentToggle ).first(),
4268
- $contentWrap = $( '.wpr-switcher-content-wrap', $contentToggle ).first(),
4269
- $switcherBg = $( '> .wpr-switcher-bg', $switcherWrap ),
4270
- $switcherList = $( '> .wpr-switcher', $switcherWrap ),
4271
- $contentList = $( '> .wpr-switcher-content', $contentWrap );
4272
-
4273
- // Active Tab
4274
- var activeSwitcherIndex = parseInt( $switcherContainer.data('active-switcher') ) - 1;
4275
-
4276
- $switcherList.eq( activeSwitcherIndex ).addClass( 'wpr-switcher-active' );
4277
- $contentList.eq( activeSwitcherIndex ).addClass( 'wpr-switcher-content-active wpr-animation-enter' );
4278
-
4279
- function wprSwitcherBg( index ) {
4280
-
4281
- if ( ! $scope.hasClass( 'wpr-switcher-label-style-outer' ) ) {
4282
-
4283
- var switcherWidth = 100 / $switcherList.length,
4284
- switcherBgDistance = index * switcherWidth;
4285
-
4286
- $switcherBg.css({
4287
- 'width' : switcherWidth + '%',
4288
- 'left': switcherBgDistance + '%'
4289
- });
4290
- }
4291
-
4292
- }
4293
-
4294
- wprSwitcherBg( activeSwitcherIndex );
4295
-
4296
- // Tab Switcher
4297
- function wprTabsSwitcher( index ) {
4298
- var activeSwitcher = $switcherList.eq( index ),
4299
- activeContent = $contentList.eq( index ),
4300
- activeContentHeight = 'auto';
4301
-
4302
- // Switcher
4303
- wprSwitcherBg( index );
4304
-
4305
- if ( ! $scope.hasClass( 'wpr-switcher-label-style-outer' ) ) {
4306
- $switcherList.removeClass( 'wpr-switcher-active' );
4307
- activeSwitcher.addClass( 'wpr-switcher-active' );
4308
-
4309
- if ( $scope.hasClass( 'wpr-switcher-style-dual' ) ) {
4310
- $switcherContainer.attr( 'data-active-switcher', index + 1 );
4311
- }
4312
- }
4313
-
4314
- // Tabs
4315
- $contentWrap.css( { 'height': $contentWrap.outerHeight( true ) } );
4316
-
4317
- $contentList.removeClass( 'wpr-switcher-content-active wpr-animation-enter' );
4318
-
4319
- activeContentHeight = activeContent.outerHeight( true );
4320
- activeContentHeight += parseInt( $contentWrap.css( 'border-top-width' ) ) + parseInt( $contentWrap.css( 'border-bottom-width' ) );
4321
-
4322
- activeContent.addClass( 'wpr-switcher-content-active wpr-animation-enter' );
4323
-
4324
- $contentWrap.css({ 'height': activeContentHeight });
4325
-
4326
- setTimeout( function() {
4327
- $contentWrap.css( { 'height': 'auto' } );
4328
- }, 500 );
4329
-
4330
- }
4331
-
4332
- // Tab Click Event
4333
- function wprTabsClick() {
4334
-
4335
- // Outer Labels
4336
- if ( $scope.hasClass( 'wpr-switcher-label-style-outer' ) ) {
4337
- $switcherWrap.on( 'click', function() {
4338
- var activeSwitcher = $switcherWrap.find( '.wpr-switcher-active' );
4339
-
4340
- if ( 1 === parseInt( activeSwitcher.data( 'switcher'), 10 ) ) {
4341
- // Reset
4342
- $switcherWrap.children( '.wpr-switcher' ).eq(0).removeClass( 'wpr-switcher-active' );
4343
-
4344
- // Set Active
4345
- $switcherWrap.children( '.wpr-switcher' ).eq(1).addClass( 'wpr-switcher-active' );
4346
- $switcherWrap.closest( '.wpr-switcher-container' ).attr( 'data-active-switcher', 2 );
4347
- wprTabsSwitcher( 1 );
4348
-
4349
- } else if ( 2 === parseInt( activeSwitcher.data( 'switcher'), 10 ) ) {
4350
- // Reset
4351
- $switcherWrap.children( '.wpr-switcher' ).eq(1).removeClass( 'wpr-switcher-active' );
4352
-
4353
- // Set Active
4354
- $switcherWrap.children( '.wpr-switcher' ).eq(0).addClass( 'wpr-switcher-active' );
4355
- $switcherWrap.closest( '.wpr-switcher-container' ).attr( 'data-active-switcher', 1 );
4356
- wprTabsSwitcher( 0 );
4357
- }
4358
-
4359
- // wprTabsSwitcher( switcherIndex );
4360
-
4361
- });
4362
-
4363
- // Inner Labels / Multi Labels
4364
- } else {
4365
- $switcherList.on( 'click', function() {
4366
-
4367
- var switcherIndex = $( this ).data( 'switcher' ) - 1;
4368
-
4369
- wprTabsSwitcher( switcherIndex );
4370
-
4371
- });
4372
- }
4373
- }
4374
-
4375
- wprTabsClick();
4376
-
4377
- }, // End widgetContentToogle
4378
-
4379
- widgetBackToTop: function($scope) {
4380
- var sttBtn = $scope.find( '.wpr-stt-btn' ),
4381
- settings = sttBtn.attr('data-settings');
4382
-
4383
- // Get Settings
4384
- settings = JSON.parse(settings);
4385
-
4386
- if ( settings.fixed === 'fixed' ) {
4387
-
4388
- if ( 'none' !== settings.animation ) {
4389
- sttBtn.css({
4390
- 'opacity' : '0'
4391
- });
4392
-
4393
- if ( settings.animation ==='slide' ) {
4394
- sttBtn.css({
4395
- 'margin-bottom': '-100px',
4396
- });
4397
- }
4398
- }
4399
-
4400
- // Run on Load
4401
- scrollToTop($(window).scrollTop(), sttBtn, settings);
4402
-
4403
- // Run on Scroll
4404
- $(window).scroll(function() {
4405
- scrollToTop($(this).scrollTop(), sttBtn, settings);
4406
- });
4407
- } // end fixed check
4408
-
4409
- // Click to Scroll Top
4410
- sttBtn.on('click', function() {
4411
- $('html, body').animate({ scrollTop : 0}, settings.scrolAnim );
4412
- return false;
4413
- });
4414
-
4415
- function scrollToTop( scrollTop, button, settings ) {
4416
- // Show
4417
- if ( scrollTop > settings.animationOffset ) {
4418
-
4419
- if ( 'fade' === settings.animation ) {
4420
- sttBtn.stop().css('visibility', 'visible').animate({
4421
- 'opacity' : '1'
4422
- }, settings.animationDuration);
4423
- } else if ( 'slide' === settings.animation ){
4424
- sttBtn.stop().css('visibility', 'visible').animate({
4425
- 'opacity' : '1',
4426
- 'margin-bottom' : 0
4427
- }, settings.animationDuration);
4428
- } else {
4429
- sttBtn.css('visibility', 'visible');
4430
- }
4431
-
4432
- // Hide
4433
- } else {
4434
-
4435
- if ( 'fade' === settings.animation ) {
4436
- sttBtn.stop().animate({'opacity': '0'}, settings.animationDuration);
4437
- } else if (settings.animation === 'slide') {
4438
- sttBtn.stop().animate({
4439
- 'margin-bottom' : '-100px',
4440
- 'opacity' : '0'
4441
- }, settings.animationDuration);
4442
- } else {
4443
- sttBtn.css('visibility', 'hidden');
4444
- }
4445
-
4446
- }
4447
- }
4448
-
4449
- }, // End of Back to Top
4450
-
4451
- widgetLottieAnimations: function($scope) {
4452
- var lottieAnimations = $scope.find('.wpr-lottie-animations'),
4453
- lottieAnimationsWrap = $scope.find('.wpr-lottie-animations-wrapper'),
4454
- lottieJSON = JSON.parse(lottieAnimations.attr('data-settings'));
4455
-
4456
- var animation = lottie.loadAnimation({
4457
- container: lottieAnimations[0], // Required
4458
- path: lottieAnimations.attr('data-json-url'), // Required
4459
- renderer: lottieJSON.lottie_renderer, // Required
4460
- loop: 'yes' === lottieJSON.loop ? true : false, // Optional
4461
- autoplay: 'yes' === lottieJSON.autoplay ? true : false
4462
- });
4463
-
4464
- animation.setSpeed(lottieJSON.speed);
4465
-
4466
- if( lottieJSON.reverse ) {
4467
- animation.setDirection(-1);
4468
- }
4469
-
4470
- animation.addEventListener('DOMLoaded', function () {
4471
-
4472
- if ( 'hover' !== lottieJSON.trigger && 'none' !== lottieJSON.trigger ) {
4473
-
4474
- // if ( 'viewport' === lottieJSON.trigger ) {
4475
- initLottie('load');
4476
- $(window).on('scroll', initLottie);
4477
- }
4478
-
4479
- if ( 'hover' === lottieJSON.trigger ) {
4480
- animation.pause();
4481
- lottieAnimations.hover(function () {
4482
- animation.play();
4483
- }, function () {
4484
- animation.pause();
4485
- });
4486
- }
4487
-
4488
- function initLottie(event) {
4489
- animation.pause();
4490
-
4491
- if (typeof lottieAnimations[0].getBoundingClientRect === "function") {
4492
-
4493
- var height = document.documentElement.clientHeight;
4494
- var scrollTop = (lottieAnimations[0].getBoundingClientRect().top)/height * 100;
4495
- var scrollBottom = (lottieAnimations[0].getBoundingClientRect().bottom)/height * 100;
4496
- var scrollEnd = scrollTop < lottieJSON.scroll_end;
4497
- var scrollStart = scrollBottom > lottieJSON.scroll_start;
4498
-
4499
- if ( 'viewport' === lottieJSON.trigger ) {
4500
- scrollStart && scrollEnd ? animation.play() : animation.pause();
4501
- }
4502
-
4503
- if ( 'scroll' === lottieJSON.trigger ) {
4504
- if( scrollStart && scrollEnd) {
4505
- animation.pause();
4506
-
4507
- // $(window).scroll(function() {
4508
- // calculate the percentage the user has scrolled down the page
4509
- var scrollPercent = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
4510
-
4511
- var scrollPercentRounded = Math.round(scrollPercent);
4512
-
4513
- animation.goToAndStop( (scrollPercentRounded / 100) * 4000); // why 4000
4514
- // });
4515
- }
4516
- };
4517
- }
4518
- }
4519
- });
4520
- }, // End of widgetLottieAnimations
4521
-
4522
- widgetCharts: function($scope) {
4523
- var chartSettings = JSON.parse($scope.find('.wpr-charts-container').attr('data-settings'));
4524
- var labels = chartSettings.chart_labels;
4525
- var customDatasets = chartSettings.chart_datasets ? JSON.parse(chartSettings.chart_datasets) : '';
4526
-
4527
- var newLegendClickHandler = function (e, legendItem, legend) {
4528
- if ( (chartTypesArray.includes(chartSettings.chart_type) || chartSettings.chart_type === 'radar') ) {
4529
- const index = legendItem.datasetIndex;
4530
- const ci = legend.chart;
4531
- if (ci.isDatasetVisible(index)) {
4532
- ci.hide(index);
4533
- legendItem.hidden = true;
4534
- } else {
4535
- ci.show(index);
4536
- legendItem.hidden = false;
4537
- }
4538
- }
4539
- }
4540
-
4541
- const footer = (tooltipItems) => {
4542
- let sum = 0;
4543
-
4544
- tooltipItems.forEach(function(tooltipItem) {
4545
- sum += tooltipItem.parsed.y;
4546
- });
4547
-
4548
- if ( 'bar_horizontal' === chartSettings.chart_type ) {
4549
- sum = 0;
4550
- tooltipItems.forEach(function(tooltipItem) {
4551
- sum += tooltipItem.parsed.x;
4552
- });
4553
- }
4554
-
4555
- if ( "radar" == chartSettings.chart_type || "pie" == chartSettings.chart_type || "doughnut" == chartSettings.chart_type || "polarArea" == chartSettings.chart_type ) {
4556
- return false;
4557
- }
4558
- return 'Sum: ' + sum;
4559
- };
4560
-
4561
- var lineDotsWidth = window.innerWidth >= 768 ? chartSettings.line_dots_radius
4562
- : window.innerWidth <= 767 ? chartSettings.line_dots_radius_mobile : 0;
4563
- var tooltipCaretSize = window.innerWidth >= 768 ? chartSettings.tooltip_caret_size
4564
- : window.innerWidth <= 767 ? chartSettings.chart_tooltip_caret_size_mobile : 0;
4565
-
4566
- var myChart = '';
4567
- var config = '';
4568
- var chartTypesArray = ['bar', 'bar_horizontal', 'line'];
4569
- var globalOptions = {
4570
- responsive: true,
4571
- // layout: { // needs other approach
4572
- // padding: chartPadding,
4573
- // },
4574
- showLine: chartSettings.show_lines,
4575
- animation: chartSettings.chart_animation === 'yes' ? true : false,
4576
- animations: {
4577
- tension: {
4578
- duration: chartSettings.chart_animation_duration,
4579
- easing: chartSettings.animation_transition_type,
4580
- from: 1,
4581
- to: 0,
4582
- loop: chartSettings.chart_animation_loop == 'yes' ? true : false,
4583
- },
4584
- }, // specify exact inserting way
4585
- events: [chartSettings.trigger_tooltip_on, chartSettings.exclude_dataset_on_click === 'yes' ? 'click' : '',],
4586
- interaction: {
4587
- // Overrides the global setting
4588
- mode: chartSettings.chart_interaction_mode !== undefined ? chartSettings.chart_interaction_mode : 'nearest',
4589
- },
4590
- elements: {
4591
- point: {
4592
- radius: chartSettings.line_dots === 'yes' ? lineDotsWidth : 0 // default to disabled in all datasets
4593
- }
4594
- },
4595
- scales: { // remove if corrupts other chart_types data
4596
- x: {
4597
- reverse: chartSettings.reverse_x == 'yes' ? true : false,
4598
- stacked: chartSettings.stacked_bar_chart == 'yes' ? true : false,
4599
- type: 'bar_horizontal' === chartSettings.chart_type ? chartSettings.data_type : 'category',
4600
- min: chartSettings.min_value !== undefined ? chartSettings.min_value : null,
4601
- max: chartSettings.max_value !== undefined ? chartSettings.max_value : null,
4602
- grid: {
4603
- display: chartSettings.display_x_axis,
4604
- drawBorder: chartSettings.display_x_axis,
4605
- drawOnChartArea: chartSettings.display_x_axis,
4606
- drawTicks: chartSettings.display_x_axis,
4607
- color: chartSettings.axis_grid_line_color_x,
4608
- // borderColor: 'green',
4609
- // borderWidth: 5,
4610
- borderDash: [chartSettings.border_dash_length, chartSettings.border_dash_spacing],
4611
- borderDashOffset: chartSettings.border_dash_offset,
4612
- lineWidth: chartSettings.grid_line_width_x,
4613
- },
4614
- title: {
4615
- display: chartSettings.display_x_axis_title,
4616
- text: chartSettings.x_axis_title,
4617
- color: chartSettings.axis_title_color_x,
4618
- font: {
4619
- size: chartSettings.axis_title_font_size_x,
4620
- family: chartSettings.axis_title_font_family_x,
4621
- style: chartSettings.axis_title_font_style_x,
4622
- weight: chartSettings.axis_title_font_weight_x,
4623
- }
4624
- },
4625
- ticks: {
4626
- stepSize: 'bar_horizontal' === chartSettings.chart_type ? chartSettings.x_step_size : '',
4627
- display: chartSettings.display_x_ticks,
4628
- padding: chartSettings.ticks_padding_x,
4629
- autoSkip: false,
4630
- maxRotation: chartSettings.rotation_x,
4631
- minRotation: chartSettings.rotation_x,
4632
- color: chartSettings.ticks_color_x,
4633
- // backdropColor: 'rgb(128,0,128)',
4634
- font: {
4635
- size: chartSettings.ticks_font_size_x,
4636
- family: chartSettings.ticks_font_family_x,
4637
- style: chartSettings.ticks_font_style_x,
4638
- weight: chartSettings.ticks_font_weight_x,
4639
- }
4640
- },
4641
- },
4642
- y: {
4643
- reverse: chartSettings.reverse_y == 'yes' ? true : false,
4644
- stacked: chartSettings.stacked_bar_chart == 'yes' ? true : false,
4645
- type: 'bar' === chartSettings.chart_type || 'line' === chartSettings.chart_type ? chartSettings.data_type : 'category',
4646
- min: chartSettings.min_value !== undefined ? chartSettings.min_value : null,
4647
- max: chartSettings.max_value !== undefined ? chartSettings.max_value : null,
4648
- grid: {
4649
- display: chartSettings.display_y_axis,
4650
- drawBorder: chartSettings.display_y_axis,
4651
- drawOnChartArea: chartSettings.display_y_axis,
4652
- drawTicks: chartSettings.display_y_axis,
4653
- color: chartSettings.axis_grid_line_color_y,
4654
- // borderColor: 'green',
4655
- // borderWidth: 5,
4656
- borderDash: [chartSettings.border_dash_length, chartSettings.border_dash_spacing],
4657
- borderDashOffset: chartSettings.border_dash_offset,
4658
- lineWidth: chartSettings.grid_line_width_y,
4659
- },
4660
- title: {
4661
- display: chartSettings.display_y_axis_title,
4662
- text: chartSettings.y_axis_title,
4663
- color: chartSettings.axis_title_color_y,
4664
- font: {
4665
- size: chartSettings.axis_title_font_size_y,
4666
- family: chartSettings.axis_title_font_family_y,
4667
- style: chartSettings.axis_title_font_style_y,
4668
- weight: chartSettings.axis_title_font_weight_y,
4669
- }
4670
- },
4671
- ticks: {
4672
- stepSize: chartSettings.y_step_size,
4673
- display: chartSettings.display_y_ticks,
4674
- padding: chartSettings.ticks_padding_y,
4675
- autoSkip: false,
4676
- maxRotation: chartSettings.rotation_y,
4677
- minRotation: chartSettings.rotation_y,
4678
- color: chartSettings.ticks_color_y,
4679
- // backdropColor: 'rgb(128,0,128)',
4680
- font: {
4681
- size: chartSettings.ticks_font_size_y,
4682
- family: chartSettings.ticks_font_family_y,
4683
- style: chartSettings.ticks_font_style_y,
4684
- weight: chartSettings.ticks_font_weight_y,
4685
- }
4686
- },
4687
- },
4688
- },
4689
- plugins: {
4690
- datalabels: {
4691
- color: chartSettings.inner_datalabels_color,
4692
- // backgroundColor: chartSettings.inner_datalabels_bg_color,
4693
- font: {
4694
- // family: chartSettings.inner_datalabels_font_family,
4695
- size: chartSettings.inner_datalabels_font_size,
4696
- style: chartSettings.inner_datalabels_font_style,
4697
- weight: chartSettings.inner_datalabels_font_weight,
4698
- },
4699
- },
4700
- legend: {
4701
- onHover: (event, chartElement) => {
4702
- event.native.target.style.cursor = 'pointer';
4703
- },
4704
- onLeave: (event, chartElement) => {
4705
- event.native.target.style.cursor = 'default';
4706
- },
4707
- onClick: newLegendClickHandler,
4708
- reverse: chartSettings.reverse_legend === 'yes' ? true : false,
4709
- display: chartSettings.show_chart_legend == 'yes' ? true : false,
4710
- position: chartSettings.legend_position !== undefined ? chartSettings.legend_position : 'top',
4711
- align: chartSettings.legend_align !== undefined ? chartSettings.legend_align : 'center',
4712
- labels: {
4713
- usePointStyle: chartSettings.legend_shape == 'point' ? true : false,
4714
- padding: chartSettings.legend_padding,
4715
- boxWidth: chartSettings.legend_box_width,
4716
- boxHeight: chartSettings.legend_font_size,
4717
- color: chartSettings.legend_text_color,
4718
- font: {
4719
- family: chartSettings.legend_font_family,
4720
- size: chartSettings.legend_font_size,
4721
- style: chartSettings.legend_font_style,
4722
- weight: chartSettings.legend_font_weight,
4723
- },
4724
- }
4725
- },
4726
- title: {
4727
- display: 'yes' === chartSettings.show_chart_title ? true : false,
4728
- text: chartSettings.chart_title,
4729
- align: chartSettings.chart_title_align !== undefined ? chartSettings.chart_title_align : 'center',
4730
- position: chartSettings.chart_title_position !== undefined ? chartSettings.chart_title_position : 'top',
4731
- color: chartSettings.chart_title_color !== undefined ? chartSettings.chart_title_color : '#000',
4732
- padding: chartSettings.title_padding,
4733
- font: {
4734
- family: chartSettings.title_font_family,
4735
- size: chartSettings.title_font_size,
4736
- style: chartSettings.title_font_style,
4737
- weight: chartSettings.title_font_weight,
4738
- },
4739
- },
4740
- tooltip: {
4741
- callbacks: {
4742
- footer: footer,
4743
- },
4744
- enabled: 'yes' === chartSettings.show_chart_tooltip ? true : false,
4745
- position: chartSettings.tooltip_position !== undefined ? chartSettings.tooltip_position : 'nearest',
4746
- padding: chartSettings.tooltip_padding !== undefined ? chartSettings.tooltip_padding : 10,
4747
- caretSize: tooltipCaretSize,
4748
- backgroundColor: chartSettings.chart_tooltip_bg_color !== undefined ? chartSettings.chart_tooltip_bg_color : 'rbga(0, 0, 0, 0.2)',
4749
- titleColor: chartSettings.chart_tooltip_title_color !== undefined ? chartSettings.chart_tooltip_title_color : '#FFF',
4750
- titleFont: {
4751
- family: chartSettings.chart_tooltip_title_font,
4752
- size: chartSettings.chart_tooltip_title_font_size,
4753
- },
4754
- titleAlign: chartSettings.chart_tooltip_title_align,
4755
- titleMarginBottom: chartSettings.chart_tooltip_title_margin_bottom,
4756
- bodyColor: chartSettings.chart_tooltip_item_color !== undefined ? chartSettings.chart_tooltip_item_color : '#FFF',
4757
- bodyFont: {
4758
- family: chartSettings.chart_tooltip_item_font,
4759
- size: chartSettings.chart_tooltip_item_font_size,
4760
- },
4761
- bodyAlign: chartSettings.chart_tooltip_item_align,
4762
- bodySpacing: chartSettings.chart_tooltip_item_spacing,
4763
- boxPadding: 3
4764
- }
4765
- },
4766
- };
4767
-
4768
- !chartTypesArray.includes(chartSettings.chart_type) && delete globalOptions.scales;
4769
-
4770
- if ( !chartTypesArray.includes(chartSettings.chart_type) && (chartSettings.chart_type !== 'doughnut' && chartSettings.chart_type !== 'pie') ) {
4771
-
4772
- globalOptions.scales = {
4773
- r: {
4774
- angleLines: {
4775
- color: chartSettings.angle_lines_color,
4776
- },
4777
- pointLabels: {
4778
- color: chartSettings.point_labels_color_r,
4779
- font: {
4780
- size: chartSettings.point_labels_font_size_r,
4781
- family: chartSettings.point_labels_font_family_r,
4782
- style: chartSettings.point_labels_font_style_r,
4783
- weight: chartSettings.point_labels_font_weight_r,
4784
- }
4785
- },
4786
- ticks: {
4787
- stepSize: chartSettings.r_step_size,
4788
- display: chartSettings.display_r_ticks,
4789
- backdropColor: chartSettings.axis_labels_bg_color,
4790
- backdropPadding: +chartSettings.axis_labels_padding,
4791
- color: chartSettings.axis_labels_color,
4792
- },
4793
- grid: {
4794
- display: chartSettings.display_r_axis,
4795
- drawBorder: chartSettings.display_r_axis,
4796
- drawOnChartArea: chartSettings.display_r_axis,
4797
- drawTicks: chartSettings.display_r_axis,
4798
- color: chartSettings.axis_grid_line_color_r,
4799
- borderDash: [chartSettings.border_dash_length_r, chartSettings.border_dash_spacing_r],
4800
- borderDashOffset: chartSettings.border_dash_offset_r,
4801
- lineWidth: chartSettings.grid_line_width_r,
4802
- }
4803
- },
4804
- }
4805
- }
4806
-
4807
- if ('custom' === chartSettings.data_source) {
4808
- const data = {
4809
- labels: labels,
4810
- datasets: JSON.parse(chartSettings.chart_datasets),
4811
- }; // todo apply conditions if not suitable for other chart_types
4812
-
4813
- config = {
4814
- plugins: [chartSettings.inner_datalabels ? ChartDataLabels : ''],
4815
- type: chartSettings.chart_type == 'bar_horizontal' ? 'bar' : chartSettings.chart_type,
4816
- data: data,
4817
- options: globalOptions
4818
- };
4819
-
4820
- chartSettings.chart_type == 'bar_horizontal' ? config.options.indexAxis = 'y' : '';
4821
-
4822
- if (chartSettings.tooltips_percent || "pie" == chartSettings.chart_type || "doughnut" == chartSettings.chart_type || "polarArea" == chartSettings.chart_type) {
4823
- config.options.plugins.tooltip.callbacks.label = function (data) {
4824
- var prefixString = data.dataset.label + ": ";
4825
-
4826
- if ("pie" == chartSettings.chart_type || "doughnut" == chartSettings.chart_type || "polarArea" == chartSettings.chart_type) {
4827
- prefixString = data.label + ' ('+data.dataset.label+') ' + ": ";
4828
- }
4829
-
4830
- var dataset = data.dataset;
4831
-
4832
- var total = dataset.data.reduce(function (previousValue, currentValue) {
4833
- return parseFloat(previousValue) + parseFloat(currentValue);
4834
- });
4835
-
4836
- var currentValue = data.formattedValue;
4837
-
4838
- var percentage = ((currentValue / total) * 100).toPrecision(3);
4839
-
4840
- return (
4841
- prefixString + (chartSettings.tooltips_percent ? percentage + "%" : data.formattedValue)
4842
- );
4843
- }
4844
- }
4845
-
4846
- myChart = new Chart(
4847
- $scope.find('.wpr-chart'),
4848
- config
4849
- );
4850
- } else {
4851
- if ( chartSettings.url && (chartTypesArray.includes(chartSettings.chart_type) || chartSettings.chart_type === 'radar') ) {
4852
- $.ajax({
4853
- url: chartSettings.url,
4854
- type: "GET",
4855
- success: function (res) {
4856
- $scope.find(".wpr-rotating-plane").remove();
4857
- renderCSVChart(res, chartSettings);
4858
- },
4859
- error: function (err) {
4860
- console.log(err);
4861
- }
4862
- });
4863
- } else if (!chartSettings.url && (chartTypesArray.includes(chartSettings.chart_type) || chartSettings.chart_type === 'radar')) {
4864
- $scope.find(".wpr-rotating-plane").remove();
4865
- $scope.find('.wpr-charts-container').html('<p class="wpr-charts-error-notice">Provide a csv file or remote URL</p>');
4866
- } else {
4867
- $scope.find(".wpr-rotating-plane").remove();
4868
- $scope.find('.wpr-charts-container').html('<p class="wpr-charts-error-notice">doughnut, pie and polareArea charts only work with custom data source</p>');
4869
- }
4870
- }
4871
-
4872
- $(window).resize(function() {
4873
- lineDotsWidth = window.innerWidth >= 768 ? chartSettings.line_dots_radius
4874
- : window.innerWidth <= 767 ? chartSettings.line_dots_radius_mobile : 0;
4875
- config.options.elements.point.radius = lineDotsWidth;
4876
- config.options.plugins.tooltip.caretSize = tooltipCaretSize;
4877
- });
4878
-
4879
- function renderCSVChart (res, chartSettings) {
4880
- var ctx = $scope.find('.wpr-chart'),
4881
- rowsData = res.split(/\r?\n|\r/),
4882
- labels = (rowsData.shift()).split(chartSettings.separator),
4883
- data = {
4884
- labels: labels,
4885
- datasets: []
4886
- };
4887
-
4888
- config = {
4889
- type: chartSettings.chart_type == 'bar_horizontal' ? 'bar' : chartSettings.chart_type,
4890
- data: data,
4891
- options: globalOptions,
4892
- plugins: [chartSettings.inner_datalabels ? ChartDataLabels : '', {
4893
- beforeInit: function(chart, options) {
4894
- chart.legend.afterFit = function() {
4895
- this.height = this.height + 50;
4896
- };
4897
- }
4898
- }],
4899
- };
4900
-
4901
- chartSettings.chart_type == 'bar_horizontal' ? config.options.indexAxis = 'y' : '';
4902
-
4903
- if (chartSettings.tooltips_percent) {
4904
- config.options.plugins.tooltip.callbacks.label = function (data) {
4905
- var prefixString = data.dataset.label + ": ";
4906
-
4907
- if ("pie" == chartSettings.chart_type || "doughnut" == chartSettings.chart_type || "polarArea" == chartSettings.chart_type) {
4908
- prefixString = data.label + ' ('+data.dataset.label+') ' + ": ";
4909
- }
4910
-
4911
- var dataset = data.dataset;
4912
-
4913
- var total = dataset.data.reduce(function (previousValue, currentValue) {
4914
- return parseFloat(previousValue) + parseFloat(currentValue);
4915
- });
4916
-
4917
- var currentValue = data.formattedValue;
4918
-
4919
- var percentage = ((currentValue / total) * 100).toPrecision(3);
4920
-
4921
- return (
4922
- prefixString + (chartSettings.tooltips_percent ? percentage + "%" : data.formattedValue)
4923
- );
4924
- }
4925
- }
4926
-
4927
- myChart = new Chart(ctx,
4928
- config
4929
- );
4930
-
4931
- rowsData.forEach(function (row, index) {
4932
- if (row.length !== 0) {
4933
- var colData = {};
4934
-
4935
-
4936
- colData.data = row.split(chartSettings.separator);
4937
- //add properties only if repeater element exists
4938
- if (customDatasets[index]) {
4939
- colData.borderColor = customDatasets[index].borderColor;
4940
- colData.borderWidth = customDatasets[index].borderWidth;
4941
- colData.backgroundColor = customDatasets[index].backgroundColor;
4942
- colData.hoverBackgroundColor = customDatasets[index].hoverBackgroundColor;
4943
- colData.label = customDatasets[index].label;
4944
- colData.fill = customDatasets[index].fill
4945
- }
4946
-
4947
- data.datasets.push(colData);
4948
- myChart.update();
4949
-
4950
- }
4951
- });
4952
- }
4953
- }, // End of widgetCharts
4954
-
4955
- widgetTaxonomyList: function($scope) {
4956
- var taxList = $scope.find('.wpr-taxonomy-list');
4957
-
4958
- if ( taxList.data('show-on-click') == 'yes' ) {
4959
-
4960
- // $scope.find('.wpr-tax-dropdown').css('margin-left', -($scope.find('.wpr-tax-dropdown').width()));
4961
-
4962
- taxList.find('.wpr-taxonomy i.wpr-tax-dropdown').on('click', function(e) {
4963
-
4964
- e.preventDefault();
4965
-
4966
- if ( taxList.find('.wpr-sub-taxonomy[data-term-id="child-'+ $(this).closest('li').data('term-id') +'"]').hasClass('wpr-sub-hidden') ) {
4967
- $(this).removeClass('fa-caret-right').addClass('fa-caret-down');
4968
- // $scope.find('.fa-caret-down').css('margin-left', -($scope.find('.fa-caret-down').width()));
4969
- taxList.find('.wpr-sub-taxonomy[data-term-id="child-'+ $(this).closest('li').data('term-id') +'"]').removeClass('wpr-sub-hidden');
4970
- } else {
4971
- $(this).removeClass('fa-caret-down').addClass('fa-caret-right');
4972
- // $scope.find('.fa-caret-right').css('margin-left', -($scope.find('.fa-caret-right').width()));
4973
- taxList.find('.wpr-sub-taxonomy[data-term-id="child-'+ $(this).closest('li').data('term-id') +'"]').addClass('wpr-sub-hidden');
4974
-
4975
- taxList.find('.wpr-inner-sub-taxonomy[data-term-id="grandchild-'+ $(this).closest('li').data('term-id') +'"]').each(function() {
4976
- if ( !$(this).hasClass('wpr-sub-hidden') ) {
4977
- taxList.find('.wpr-sub-taxonomy[data-id="'+ $(this).data('parent-id') +'"] i.wpr-tax-dropdown').removeClass('fa-caret-down').addClass('fa-caret-right');
4978
- // $scope.find('.fa-caret-right').css('margin-left', -($scope.find('.fa-caret-right').width()));
4979
- $(this).addClass('wpr-sub-hidden');
4980
- }
4981
- });
4982
-
4983
- // if (!taxList.find('.wpr-inner-sub-taxonomy[data-term-id="grandchild-'+ $(this).parent('li').data('term-id') +'"]').hasClass('wpr-sub-hidden')) {
4984
- // taxList.find('.wpr-sub-taxonomy[data-term-id="child-'+ $(this).parent('li').data('term-id') +'"] i').removeClass('fa-caret-down').addClass('fa-caret-right');
4985
- // taxList.find('.wpr-inner-sub-taxonomy[data-term-id="grandchild-'+ $(this).parent('li').data('term-id') +'"]').addClass('wpr-sub-hidden');
4986
- // }
4987
- }
4988
- });
4989
-
4990
- taxList.find('.wpr-sub-taxonomy i.wpr-tax-dropdown').on('click', function(e) {
4991
-
4992
- e.preventDefault();
4993
-
4994
- if ( taxList.find('.wpr-inner-sub-taxonomy[data-parent-id="'+ $(this).closest('li').data('id') +'"]').hasClass('wpr-sub-hidden') ) {
4995
- $(this).removeClass('fa-caret-right').addClass('fa-caret-down');
4996
- // $scope.find('.fa-caret-down').css('margin-left', -($scope.find('.fa-caret-down').width()));
4997
- taxList.find('.wpr-inner-sub-taxonomy[data-parent-id="'+ $(this).closest('li').data('id') +'"]').removeClass('wpr-sub-hidden');
4998
- } else {
4999
- $(this).removeClass('fa-caret-down').addClass('fa-caret-right');
5000
- // taxList.find('.wpr-sub-taxonomy i').removeClass('fa-caret-down').addClass('fa-caret-right');
5001
- // $scope.find('.fa-caret-right').css('margin-left', -($scope.find('.fa-caret-right').width()));
5002
- taxList.find('.wpr-inner-sub-taxonomy[data-parent-id="'+ $(this).closest('li').data('id') +'"]').addClass('wpr-sub-hidden');
5003
- }
5004
- });
5005
- }
5006
- }, // End of widgetTaxonomyList
5007
-
5008
- widgetPostsTimeline: function($scope) { // goback
5009
- var iScrollTarget = $scope.find( '.wpr-timeline-centered' ).length > 0 ? $scope.find( '.wpr-timeline-centered' ) : '',
5010
- element = $scope.find('.wpr-timeline-centered').length > 0 ? $scope.find('.wpr-timeline-centered') : '',
5011
- pagination = $scope.find( '.wpr-grid-pagination' ).length > 0 ? $scope.find( '.wpr-grid-pagination' ) : '',
5012
- middleLine = $scope.find('.wpr-middle-line').length > 0 ? $scope.find('.wpr-middle-line') : '',
5013
- timelineFill = $scope.find(".wpr-timeline-fill").length > 0 ? $scope.find(".wpr-timeline-fill") : '',
5014
- lastIcon = $scope.find('.wpr-main-line-icon.wpr-icon:last').length > 0 ? $scope.find('.wpr-main-line-icon.wpr-icon:last') : '',
5015
- firstIcon = $scope.find('.wpr-main-line-icon.wpr-icon').length > 0 ? $scope.find('.wpr-main-line-icon.wpr-icon').first() : '',
5016
- scopeClass = '.elementor-element-'+ $scope.attr( 'data-id' ),
5017
- aosOffset = $scope.find('.wpr-story-info-vertical').attr('data-animation-offset') ? +$scope.find('.wpr-story-info-vertical').attr('data-animation-offset') : '',
5018
- aosDuration = $scope.find('.wpr-story-info-vertical').attr('data-animation-duration') ? +$scope.find('.wpr-story-info-vertical').attr('data-animation-duration') : '';
5019
-
5020
-
5021
- if ( $scope.find('.wpr-timeline-centered').length > 0 ) {
5022
-
5023
- $(window).resize(function() {
5024
- removeLeftAlignedClass();
5025
- });
5026
-
5027
- $(window).smartresize(function() {
5028
- removeLeftAlignedClass();
5029
- });
5030
-
5031
- setTimeout(function() {
5032
- removeLeftAlignedClass();
5033
- $(window).trigger('resize');
5034
- }, 500);
5035
-
5036
- adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element);
5037
-
5038
- setTimeout(function() {
5039
- adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element);
5040
- $(window).trigger('resize');
5041
- }, 500);
5042
-
5043
- $(window).smartresize(function() {
5044
- adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element);
5045
- });
5046
-
5047
- $(window).resize(function() {
5048
- adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element);
5049
- });
5050
-
5051
- if ( 'load-more' !== iScrollTarget.attr('data-pagination') ) {
5052
- $scope.find('.wpr-grid-pagination').css('visibility', 'hidden');
5053
- }
5054
-
5055
- AOS.init({
5056
- offset: parseInt(aosOffset),
5057
- duration: aosDuration,
5058
- once: true,
5059
- });
5060
-
5061
- postsTimelineFill(lastIcon, firstIcon);
5062
-
5063
- $(window).on('scroll', function() {
5064
- postsTimelineFill(lastIcon, firstIcon);
5065
- });
5066
-
5067
- // init Infinite Scroll
5068
- if ( !$scope.find('.elementor-repeater-items').length && !WprElements.editorCheck() && ('load-more' === $scope.find('.wpr-timeline-centered').data('pagination') || 'infinite-scroll' === $scope.find('.wpr-timeline-centered').data('pagination')) ) {
5069
- var threshold = iScrollTarget !== undefined && 'load-more' === iScrollTarget.attr('data-pagination') ? false : 10;
5070
- // var navClass = scopeClass +' .wpr-load-more-btn';
5071
-
5072
- iScrollTarget.infiniteScroll({
5073
- path: scopeClass +' .wpr-grid-pagination a',
5074
- hideNav: false,
5075
- append: scopeClass +'.wpr-timeline-entry',
5076
- history: false,
5077
- scrollThreshold: threshold,
5078
- status: scopeClass + ' .page-load-status',
5079
- });
5080
- // Request
5081
- iScrollTarget.on( 'request.infiniteScroll', function( event, path ) {
5082
- $scope.find( '.wpr-load-more-btn' ).hide();
5083
- $scope.find( '.wpr-pagination-loading' ).css( 'display', 'inline-block' );
5084
- });
5085
-
5086
- var pagesLoaded = 0;
5087
-
5088
- iScrollTarget.on( 'load.infiniteScroll', function( event, response ) {
5089
- pagesLoaded++;
5090
-
5091
- // get posts from response
5092
- var items = $( response ).find(scopeClass).find( '.wpr-timeline-entry' );
5093
- iScrollTarget.infiniteScroll( 'appendItems', items );
5094
-
5095
- if ( !$scope.find('.wpr-one-sided-timeline').length && !$scope.find('.wpr-one-sided-timeline-left').length ) {
5096
- $scope.find('.wpr-timeline-entry').each(function(index, value){
5097
- $(this).removeClass('wpr-right-aligned wpr-left-aligned');
5098
- if ( 0 == index % 2 ) {
5099
- $(this).addClass('wpr-left-aligned');
5100
- $(this).find('.wpr-story-info-vertical').attr('data-aos', $(this).find('.wpr-story-info-vertical').attr('data-aos-left'));
5101
- } else {
5102
- $(this).addClass('wpr-right-aligned');
5103
- $(this).find('.wpr-story-info-vertical').attr('data-aos', $(this).find('.wpr-story-info-vertical').attr('data-aos-right'));
5104
- }
5105
- });
5106
- }
5107
-
5108
- AOS.init({
5109
- offset: parseInt(aosOffset),
5110
- duration: aosDuration,
5111
- once: true,
5112
- });
5113
-
5114
- $(window).scroll();
5115
-
5116
- $scope.find( '.wpr-pagination-loading' ).hide();
5117
- // $scope.find( '.wpr-load-more-btn' ).fadeIn();
5118
- if ( iScrollTarget.data('max-pages') - 1 !== pagesLoaded ) { // $pagination_max_pages
5119
- if ( 'load-more' === iScrollTarget.attr('data-pagination') ) {
5120
- $scope.find( '.wpr-load-more-btn' ).fadeIn();
5121
- }
5122
- } else {
5123
- $scope.find( '.wpr-pagination-finish' ).fadeIn( 1000 );
5124
- pagination.delay( 2000 ).fadeOut( 1000 );
5125
- }
5126
-
5127
- middleLine = $scope.find('.wpr-middle-line');
5128
- timelineFill = $scope.find(".wpr-timeline-fill");
5129
- lastIcon = $scope.find('.wpr-main-line-icon.wpr-icon:last');
5130
- firstIcon = $scope.find('.wpr-main-line-icon.wpr-icon').first();
5131
- element = $scope.find('.wpr-timeline-centered');
5132
-
5133
- adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element);
5134
- $(window).trigger('resize');
5135
- postsTimelineFill(lastIcon, firstIcon);
5136
- });
5137
-
5138
- if ( !WprElements.editorCheck() ) {
5139
- $scope.find( '.wpr-load-more-btn' ).on( 'click', function() {
5140
- iScrollTarget.infiniteScroll( 'loadNextPage' );
5141
- return false;
5142
- });
5143
-
5144
- if ( 'infinite-scroll' == iScrollTarget.attr('data-pagination') ) {
5145
- iScrollTarget.infiniteScroll('loadNextPage');
5146
- }
5147
- }
5148
- }
5149
- }
5150
-
5151
- if ( $scope.find('.swiper-wrapper').length ) {
5152
-
5153
- var swiperLoader = function swiperLoader(swiperElement, swiperConfig) {
5154
- if ('undefined' === typeof Swiper) {
5155
- var asyncSwiper = elementorFrontend.utils.swiper;
5156
- return new asyncSwiper(swiperElement, swiperConfig).then( function (newSwiperInstance) {
5157
- return newSwiperInstance;
5158
- });
5159
- } else {
5160
- return swiperPromise(swiperElement, swiperConfig);
5161
- }
5162
- };
5163
-
5164
- var swiperPromise = function swiperPromise(swiperElement, swiperConfig) {
5165
- return new Promise(function (resolve, reject) {
5166
- var swiperInstance = new Swiper(swiperElement, swiperConfig);
5167
- resolve(swiperInstance);
5168
- });
5169
- };
5170
-
5171
- var horizontal = $scope.find('.wpr-horizontal-bottom').length ? '.wpr-horizontal-bottom' : '.wpr-horizontal';
5172
- var swiperSlider = $scope.find(horizontal +".swiper-container");
5173
-
5174
- var slidestoshow = swiperSlider.data("slidestoshow");
5175
-
5176
- swiperLoader(swiperSlider, {
5177
- spaceBetween: +swiperSlider.data('swiper-space-between'),
5178
- autoplay: swiperSlider.data("autoplay") !== 'yes' ? false : {
5179
- delay: +swiperSlider.attr('data-swiper-delay'),
5180
- // disableOnInteraction: true,
5181
- // pauseOnMouseEnter: true,
5182
- },
5183
- speed: +swiperSlider.attr('data-swiper-speed'),
5184
- slidesPerView: swiperSlider.data("slidestoshow"),
5185
- direction: 'horizontal',
5186
- pagination: {
5187
- el: '.wpr-swiper-pagination',
5188
- type: 'progressbar',
5189
- },
5190
- navigation: {
5191
- nextEl: '.wpr-button-next',
5192
- prevEl: '.wpr-button-prev',
5193
- },
5194
- // Responsive breakpoints
5195
- breakpoints: {
5196
- // when window width is >= 320px
5197
- 320: {
5198
- slidesPerView: 1,
5199
- },
5200
- // when window width is >= 480px
5201
- 480: {
5202
- slidesPerView: 2,
5203
- },
5204
- // when window width is >= 640px
5205
- 769: { // 640
5206
- slidesPerView: slidestoshow,
5207
- }
5208
- },
5209
- });
5210
-
5211
- // swiperSlider.data('pause-on-hover') === 'yes' && swiperSlider.hover(function() {
5212
- // (this).swiper.autoplay.stop();
5213
- // }, function() {
5214
- // (this).swiper.autoplay.start();
5215
- // });
5216
- }
5217
-
5218
- function removeLeftAlignedClass() {
5219
- if ( $scope.find('.wpr-centered').length ) {
5220
- if ( window.innerWidth <= 767 ) {
5221
- $scope.find('.wpr-wrapper .wpr-timeline-centered').removeClass('wpr-both-sided-timeline').addClass('wpr-one-sided-timeline').addClass('wpr-remove-one-sided-later');
5222
- $scope.find('.wpr-wrapper .wpr-left-aligned').removeClass('wpr-left-aligned').addClass('wpr-right-aligned').addClass('wpr-remove-right-aligned-later');
5223
- } else {
5224
- $scope.find('.wpr-wrapper .wpr-timeline-centered.wpr-remove-one-sided-later').removeClass('wpr-one-sided-timeline').addClass('wpr-both-sided-timeline').removeClass('wpr-remove-one-sided-later');
5225
- $scope.find('.wpr-wrapper .wpr-remove-right-aligned-later').removeClass('wpr-right-aligned').addClass('wpr-left-aligned').removeClass('wpr-remove-right-aligned-later');
5226
- }
5227
- }
5228
- }
5229
-
5230
- function postsTimelineFill(lastIcon, firstIcon) {
5231
- if ( !$scope.find('.wpr-timeline-fill').length ) {
5232
- return;
5233
- }
5234
-
5235
- if ( $scope.find('.wpr-timeline-entry:eq(0)').prev('.wpr-year-wrap').length > 0 ) {
5236
- firstIcon = $scope.find('.wpr-year-label').eq(0);
5237
- }
5238
-
5239
- if ( timelineFill.length ) {
5240
- var fillHeight = timelineFill.css('height').slice(0, -2),
5241
- docScrollTop = document.documentElement.scrollTop,
5242
- clientHeight = document.documentElement.clientHeight/2;
5243
-
5244
- if ( !((docScrollTop + clientHeight - (firstIcon.offset().top)) > lastIcon.offset().top - firstIcon.offset().top + parseInt(lastIcon.css('height').slice(0, -2))) ) {
5245
- timelineFill.css('height', (docScrollTop + clientHeight - (firstIcon.offset().top)) + 'px');
5246
- }
5247
-
5248
- $scope.find('.wpr-main-line-icon.wpr-icon').each(function () {
5249
- if ( $(this).offset().top < parseInt( firstIcon.offset().top + parseInt(fillHeight) ) ) {
5250
- $(this).addClass('wpr-change-border-color');
5251
- } else {
5252
- $(this).removeClass('wpr-change-border-color');
5253
- }
5254
- });
5255
- }
5256
- }
5257
-
5258
- function adjustMiddleLineHeight(middleLine, timelineFill, lastIcon, firstIcon, element) {
5259
- element = $scope.find('.wpr-timeline-centered');
5260
- if ( !$scope.find('.wpr-both-sided-timeline').length && !$scope.find('.wpr-one-sided-timeline').length && !$scope.find('.wpr-one-sided-timeline-left').length ) {
5261
- return;
5262
- }
5263
-
5264
- if ( $scope.find('.wpr-timeline-entry:eq(0)').prev('.wpr-year-wrap').length > 0 ) {
5265
- firstIcon = $scope.find('.wpr-year-label').eq(0);
5266
- }
5267
-
5268
- var firstIconOffset = firstIcon.offset().top;
5269
- var lastIconOffset = lastIcon.offset().top;
5270
- var middleLineTop = (firstIconOffset - element.offset().top) + 'px';
5271
- // var middleLineHeight = (lastIconOffset - (lastIcon.css('height').slice(0, -2)/2 + (firstIconOffset - firstIcon.css('height').slice(0, -2)))) + 'px';
5272
- var middleLineHeight = lastIconOffset - firstIconOffset + parseInt(lastIcon.css('height').slice(0, -2));
5273
- var middleLineMaxHeight = firstIconOffset - lastIconOffset + 'px !important';
5274
-
5275
- middleLine.css('top', middleLineTop);
5276
- middleLine.css('height', middleLineHeight);
5277
- // middleLine.css('maxHeight', middleLineMaxHeight);
5278
- timelineFill !== '' ? timelineFill.css('top', middleLineTop) : '';
5279
- }
5280
- }, // end widgetPostsTimeline
5281
-
5282
- widgetSharingButtons: function($scope) {
5283
- $scope.find('.wpr-sharing-print').on('click', function(e) {
5284
- e.preventDefault();
5285
- window.print();
5286
- });
5287
- }, // end widgetSharingButtons
5288
-
5289
- widgetFlipCarousel: function($scope) {
5290
- var flipsterSettings = JSON.parse($scope.find('.wpr-flip-carousel').attr('data-settings'));
5291
-
5292
- $scope.find('.wpr-flip-carousel').css('opacity', 1);
5293
-
5294
- $scope.find('.wpr-flip-carousel').flipster({
5295
- itemContainer: 'ul',
5296
- itemSelector: 'li',
5297
- fadeIn: 400,
5298
- start: flipsterSettings.starts_from_center === 'yes' ? 'center' : 0,
5299
- style: flipsterSettings.carousel_type,
5300
- loop: flipsterSettings.loop === 'yes' ? true : false,
5301
- autoplay: flipsterSettings.autoplay === 'no' ? false : flipsterSettings.autoplay_milliseconds,
5302
- pauseOnHover: flipsterSettings.pause_on_hover === 'yes' ? true : false,
5303
- click: flipsterSettings.play_on_click === 'yes' ? true : false,
5304
- scrollwheel: flipsterSettings.play_on_scroll === 'yes' ? true : false,
5305
- touch: true,
5306
- nav: 'true' === flipsterSettings.pagination_position ? true : flipsterSettings.pagination_position ? flipsterSettings.pagination_position : false,
5307
- spacing: flipsterSettings.spacing,
5308
- buttons: 'custom',
5309
- buttonPrev: flipsterSettings.button_prev,
5310
- buttonNext: flipsterSettings.button_next
5311
- });
5312
-
5313
- var paginationButtons = $scope.find('.wpr-flip-carousel').find('.flipster__nav__item').find('.flipster__nav__link');
5314
-
5315
- paginationButtons.each(function() {
5316
- $(this).text(parseInt($(this).text()) + 1);
5317
- });
5318
- }, // end widgetFlipCarousel
5319
-
5320
- widgetFeatureList: function($scope) {
5321
- $scope.find('.wpr-feature-list-item:not(:last-of-type)').find('.wpr-feature-list-icon-wrap').each(function(index) {
5322
- var offsetTop = $scope.find('.wpr-feature-list-item').eq(index + 1).find('.wpr-feature-list-icon-wrap').offset().top;
5323
-
5324
- $(this).find('.wpr-feature-list-line').height(offsetTop - $(this).offset().top + 'px');
5325
- });
5326
-
5327
- $(window).resize(function() {
5328
- $scope.find('.wpr-feature-list-item:not(:last-of-type)').find('.wpr-feature-list-icon-wrap').each(function(index) {
5329
- var offsetTop = $scope.find('.wpr-feature-list-item').eq(index + 1).find('.wpr-feature-list-icon-wrap').offset().top;
5330
-
5331
- $(this).find('.wpr-feature-list-line').height(offsetTop - $(this).offset().top + 'px');
5332
- });
5333
- })
5334
- }, // end widgetFeatureList
5335
-
5336
- widgetAdvancedAccordion: function($scope) {
5337
- var acc = $scope.find('.wpr-acc-button');
5338
- var accItemWrap = $scope.find('.wpr-accordion-item-wrap');
5339
- var accordionType = $scope.find('.wpr-advanced-accordion').data('accordion-type');
5340
- var activeIndex = +$scope.find('.wpr-advanced-accordion').data('active-index') - 1;
5341
- var accordionTrigger = $scope.find('.wpr-advanced-accordion').data('accordion-trigger');
5342
- var interactionSpeed = +$scope.find('.wpr-advanced-accordion').data('interaction-speed') * 1000;
5343
-
5344
- if ('click' === accordionTrigger) {
5345
-
5346
- if ( accordionType == 'accordion' ) {
5347
- acc.on("click", function() {
5348
- var thisIndex = acc.index(this);
5349
- acc.each(function(index){
5350
- index != thisIndex ? $(this).removeClass('wpr-acc-active') : '';
5351
- });
5352
- $scope.find('.wpr-acc-panel').each(function(index) {
5353
- index != thisIndex ? $(this).removeClass('wpr-acc-panel-active') && $(this).slideUp(interactionSpeed) : '';
5354
- });
5355
- $(this).toggleClass("wpr-acc-active");
5356
- var panel = $(this).next();
5357
- if ( !panel.hasClass('wpr-acc-panel-active') ) {
5358
- panel.slideDown(interactionSpeed);
5359
- panel.addClass('wpr-acc-panel-active');
5360
- } else {
5361
- panel.slideUp(interactionSpeed);
5362
- panel.removeClass('wpr-acc-panel-active');
5363
- }
5364
- });
5365
- } else {
5366
- acc.each(function() {
5367
- $(this).on("click", function() {
5368
- $(this).toggleClass("wpr-acc-active");
5369
- var panel = $(this).next();
5370
- if ( !panel.hasClass('wpr-acc-panel-active') ) {
5371
- panel.slideDown(interactionSpeed);
5372
- panel.addClass('wpr-acc-panel-active');
5373
- } else {
5374
- panel.slideUp(interactionSpeed);
5375
- panel.removeClass('wpr-acc-panel-active');
5376
- }
5377
- });
5378
- });
5379
- }
5380
-
5381
- acc && (activeIndex > -1 && acc.eq(activeIndex).trigger('click'));
5382
- } else if ( accordionTrigger == 'hover' ) {
5383
- accItemWrap.on("mouseenter", function() {
5384
- var thisIndex = accItemWrap.index(this);
5385
-
5386
- $(this).find('.wpr-acc-button').addClass("wpr-acc-active");
5387
-
5388
- var panel = $(this).find('.wpr-acc-panel');
5389
- panel.slideDown(interactionSpeed);
5390
- panel.addClass('wpr-acc-panel-active');
5391
-
5392
- accItemWrap.each(function(index) {
5393
- if (index != thisIndex) {
5394
- $(this).find('.wpr-acc-button').removeClass("wpr-acc-active");
5395
- var panel = $(this).find('.wpr-acc-panel');
5396
- panel.slideUp(interactionSpeed);
5397
- panel.removeClass('wpr-acc-panel-active');
5398
- }
5399
- });
5400
- });
5401
-
5402
- accItemWrap && (activeIndex > -1 && accItemWrap.eq(activeIndex).trigger('mouseenter'));
5403
- }
5404
-
5405
- $scope.find('.wpr-acc-search-input').on( {
5406
- focus: function() {
5407
- $scope.addClass( 'wpr-acc-search-input-focus' );
5408
- },
5409
- blur: function() {
5410
- $scope.removeClass( 'wpr-search-form-input-focus' );
5411
- }
5412
- } );
5413
-
5414
- let allInAcc = $scope.find('.wpr-advanced-accordion > *');
5415
-
5416
- $scope.find('i.fa-times').on('click', function() {
5417
- $scope.find('.wpr-acc-search-input').val('');
5418
- $scope.find('.wpr-acc-search-input').trigger('keyup');
5419
- });
5420
-
5421
- var iconBox = $scope.find('.wpr-acc-icon-box');
5422
-
5423
- iconBox.each(function() {
5424
- $(this).find('.wpr-acc-icon-box-after').css({
5425
- 'border-top': $(this).height()/2 + 'px solid transparent',
5426
- 'border-bottom': $(this).height()/2 + 'px solid transparent'
5427
- });
5428
- });
5429
-
5430
- $(window).resize(function() {
5431
- iconBox.each(function() {
5432
- $(this).find('.wpr-acc-icon-box-after').css({
5433
- 'border-top': $(this).height()/2 + 'px solid transparent',
5434
- 'border-bottom': $(this).height()/2 + 'px solid transparent'
5435
- });
5436
- });
5437
- });
5438
-
5439
- $scope.find('.wpr-acc-search-input').on('keyup', function() {
5440
- setTimeout( () => {
5441
- let thisValue = $(this).val();
5442
- if ( thisValue.length > 0 ) {
5443
- $scope.find('.wpr-acc-search-input-wrap').find('i.fa-times').css('display', 'inline-block');
5444
- allInAcc.each(function() {
5445
- if ( $(this).hasClass('wpr-accordion-item-wrap') ) {
5446
- var itemWrap = $(this);
5447
- if ( itemWrap.text().toUpperCase().indexOf(thisValue.toUpperCase()) == -1 ) {
5448
- itemWrap.hide();
5449
- if ( itemWrap.find('.wpr-acc-button').hasClass('wpr-acc-active') && itemWrap.find('.wpr-acc-panel').hasClass('wpr-acc-panel-active') ) {
5450
- itemWrap.find('.wpr-acc-button').removeClass('wpr-acc-active');
5451
- itemWrap.find('.wpr-acc-panel').removeClass('wpr-acc-panel-active');
5452
- }
5453
- } else {
5454
- itemWrap.show();
5455
- if ( !itemWrap.find('.wpr-acc-button').hasClass('wpr-acc-active') && !itemWrap.find('.wpr-acc-panel').hasClass('wpr-acc-panel-active') ) {
5456
- itemWrap.find('.wpr-acc-button').addClass('wpr-acc-active');
5457
- itemWrap.find('.wpr-acc-panel').addClass('wpr-acc-panel-active');
5458
- itemWrap.find('.wpr-acc-panel').slideDown(interactionSpeed);
5459
- }
5460
- }
5461
- }
5462
- });
5463
- } else {
5464
- $scope.find('.wpr-acc-search-input-wrap').find('i.fa-times').css('display', 'none');
5465
- allInAcc.each(function() {
5466
- if ( $(this).hasClass('wpr-accordion-item-wrap') ) {
5467
- $(this).show();
5468
- if ( $(this).find('.wpr-acc-panel').hasClass('wpr-acc-panel-active') ) {
5469
- $(this).find('.wpr-acc-panel').removeClass('wpr-acc-panel-active');
5470
- }
5471
- if ( $(this).find('.wpr-acc-button').hasClass('wpr-acc-active') ) {
5472
- $(this).find('.wpr-acc-button').removeClass('wpr-acc-active')
5473
- }
5474
- $(this).find('.wpr-acc-panel').slideUp(interactionSpeed);
5475
- }
5476
- });
5477
- // if ('click' === accordionTrigger) {
5478
- // acc && (activeIndex > -1 && acc.eq(activeIndex).trigger('click'));
5479
- // } else if ( 'hover' === accordionTrigger ) {
5480
- // accItemWrap && (activeIndex > -1 && accItemWrap.eq(activeIndex).trigger('mouseenter'));
5481
- // }
5482
- }
5483
- }, 1000);
5484
- });
5485
-
5486
- }, // end widgetAdvancedAccordion
5487
-
5488
- widgetImageAccordion: function($scope) {
5489
- var settings = JSON.parse($scope.find( '.wpr-img-accordion-media-hover' ).attr( 'data-settings' ));
5490
-
5491
- // var MediaWrap = $scope.find( '.wpr-img-accordion-media-hover' );
5492
- var MediaWrap = $scope.find( '.wpr-image-accordion' );
5493
- // var lightboxSettings = settings.lightbox;
5494
- var lightboxSettings = $scope.find('.wpr-image-accordion').attr('lightbox') ? JSON.parse($scope.find('.wpr-image-accordion').attr('lightbox')) : '';
5495
-
5496
- var thisTargetHasClass = false;
5497
-
5498
- if ( $scope.find('.wpr-image-accordion-wrap').hasClass('wpr-acc-no-column') ) {
5499
- if ( !$scope.hasClass('wpr-image-accordion-row') );
5500
- $scope.removeClass('wpr-image-accordion-column').addClass('wpr-image-accordion-row');
5501
- $scope.find('.wpr-image-accordion').css('flex-direction', 'row');
5502
- }
5503
-
5504
- if ( '' !== lightboxSettings ) {
5505
-
5506
- // Init Lightbox
5507
- MediaWrap.lightGallery( lightboxSettings );
5508
-
5509
- // Fix LightGallery Thumbnails
5510
- MediaWrap.on('onAfterOpen.lg',function() {
5511
- if ( $('.lg-outer').find('.lg-thumb-item').length ) {
5512
- $('.lg-outer').find('.lg-thumb-item').each(function() {
5513
- var imgSrc = $(this).find('img').attr('src'),
5514
- newImgSrc = imgSrc,
5515
- extIndex = imgSrc.lastIndexOf('.'),
5516
- imgExt = imgSrc.slice(extIndex),
5517
- cropIndex = imgSrc.lastIndexOf('-'),
5518
- cropSize = /\d{3,}x\d{3,}/.test(imgSrc.substring(extIndex,cropIndex)) ? imgSrc.substring(extIndex,cropIndex) : false;
5519
-
5520
- if ( 42 <= imgSrc.substring(extIndex,cropIndex).length ) {
5521
- cropSize = '';
5522
- }
5523
-
5524
- if ( cropSize !== '' ) {
5525
- if ( false !== cropSize ) {
5526
- newImgSrc = imgSrc.replace(cropSize, '-150x150');
5527
- } else {
5528
- newImgSrc = [imgSrc.slice(0, extIndex), '-150x150', imgSrc.slice(extIndex)].join('');
5529
- }
5530
- }
5531
-
5532
- // Change SRC
5533
- $(this).find('img').attr('src', newImgSrc);
5534
-
5535
- if ( false == cropSize || '-450x450' === cropSize ) {
5536
- $(this).find('img').attr('src', imgSrc);
5537
- }
5538
- });
5539
- }
5540
- });
5541
-
5542
- // Show/Hide Controls
5543
- $scope.find( '.wpr-image-accordion' ).on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
5544
- var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
5545
- lightboxDownload = $( '#lg-download' ).attr( 'href' );
5546
-
5547
- if ( $( '#lg-download' ).length ) {
5548
- if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
5549
- lightboxControls.addClass( 'wpr-hidden-element' );
5550
- } else {
5551
- lightboxControls.removeClass( 'wpr-hidden-element' );
5552
- }
5553
- }
5554
-
5555
- // Autoplay Button
5556
- if ( '' === lightboxSettings.autoplay ) {
5557
- $( '.lg-autoplay-button' ).css({
5558
- 'width' : '0',
5559
- 'height' : '0',
5560
- 'overflow' : 'hidden'
5561
- });
5562
- }
5563
- });
5564
-
5565
- }
5566
-
5567
- MediaWrap.css('cursor', 'pointer');
5568
-
5569
- // Init Media Hover Link
5570
-
5571
- var accordionItem = $scope.find('.wpr-image-accordion-item');
5572
-
5573
- // Media Hover Link
5574
- function mediaHoverLink() {
5575
- if ( ! WprElements.editorCheck() ) {
5576
-
5577
- $scope.find('.wpr-img-accordion-media-hover').on( 'click', function( event ) {
5578
- var thisSettings = event.target.className.includes('wpr-img-accordion-media-hover') ? JSON.parse($(this).attr('data-settings')) : JSON.parse($(this).closest('.wpr-img-accordion-media-hover').attr( 'data-settings' ));
5579
-
5580
- if ( !$(event.target).hasClass('wpr-img-accordion-item-lightbox') && 0 === $(event.target).closest('.wpr-img-accordion-item-lightbox').length ) {
5581
- var itemUrl = thisSettings.activeItem.overlayLink;
5582
- if (itemUrl != '') {
5583
-
5584
- if ( '_blank' === thisSettings.activeItem.overlayLinkTarget ) {
5585
- window.open(itemUrl, '_blank').focus();
5586
- } else {
5587
- window.location.href = itemUrl;
5588
- }
5589
-
5590
- }
5591
- }
5592
- });
5593
- }
5594
- }
5595
-
5596
- if ( 'hover' === settings.activeItem.interaction) {
5597
-
5598
- mediaHoverLink();
5599
-
5600
- accordionItem.on('mouseenter', function() {
5601
- accordionItem.removeClass('wpr-image-accordion-item-grow');
5602
- accordionItem.find('.wpr-animation-wrap').removeClass('wpr-animation-wrap-active');
5603
- $(this).addClass('wpr-image-accordion-item-grow');
5604
- $(this).find('.wpr-animation-wrap').addClass('wpr-animation-wrap-active');
5605
- });
5606
-
5607
- accordionItem.on('mouseleave', function() {
5608
- $(this).removeClass('wpr-image-accordion-item-grow');
5609
- $(this).find('.wpr-animation-wrap').removeClass('wpr-animation-wrap-active');
5610
- });
5611
-
5612
- } else if ( 'click' === settings.activeItem.interaction ) {
5613
- $scope.find('.wpr-img-accordion-media-hover').removeClass('wpr-animation-wrap');
5614
- accordionItem.on('click', '.wpr-img-accordion-media-hover', function(event) {
5615
- thisTargetHasClass = event.target.className.includes('wpr-img-accordion-media-hover') ? event.target.className.includes('wpr-animation-wrap-active') : $(this).closest('.wpr-img-accordion-media-hover').hasClass('wpr-animation-wrap-active');
5616
- if (thisTargetHasClass && !WprElements.editorCheck()) {
5617
- var thisSettings = event.target.className.includes('wpr-img-accordion-media-hover') ? JSON.parse($(this).attr('data-settings')) : JSON.parse($(this).closest('.wpr-img-accordion-media-hover').attr( 'data-settings' ));
5618
-
5619
- if ( !$(event.target).hasClass('wpr-img-accordion-item-lightbox') && 0 === $(event.target).closest('.wpr-img-accordion-item-lightbox').length ) {
5620
- var itemUrl = thisSettings.activeItem.overlayLink;
5621
- if (itemUrl != '') {
5622
- if ( '_blank' === thisSettings.activeItem.overlayLinkTarget ) {
5623
- window.open(itemUrl, '_blank').focus();
5624
- } else {
5625
- window.location.href = itemUrl;
5626
- }
5627
- }
5628
- }
5629
- } else {
5630
- $scope.find('.wpr-img-accordion-media-hover').removeClass('wpr-animation-wrap').removeClass('wpr-animation-wrap-active');
5631
- accordionItem.removeClass('wpr-image-accordion-item-grow');
5632
- $(this).closest('.wpr-image-accordion-item').addClass('wpr-image-accordion-item-grow');
5633
- $(this).closest('.wpr-img-accordion-media-hover').addClass('wpr-animation-wrap-active');
5634
- }
5635
- });
5636
- } else {
5637
- $scope.find('.wpr-img-accordion-media-hover').removeClass('wpr-animation-wrap');
5638
- }
5639
-
5640
- accordionItem.each(function() {
5641
- if ( $(this).index() === settings.activeItem.defaultActive - 1 ) {
5642
- if ( 'click' === settings.activeItem.interaction) {
5643
- setTimeout(() => {
5644
- $(this).find('.wpr-img-accordion-media-hover').trigger('click');
5645
- }, 400);
5646
- } else {
5647
- setTimeout(() => {
5648
- $(this).find('.wpr-img-accordion-media-hover').trigger('mouseenter');
5649
- }, 400);
5650
- }
5651
- }
5652
- });
5653
-
5654
- $scope.find('.wpr-image-accordion-wrap').css('opacity', 1);
5655
- }, // end widgetImageAccordion
5656
-
5657
- widgetProductAddToCart: function($scope) {
5658
- var qtyInput = jQuery('.woocommerce .wpr-quantity-wrapper'),
5659
- qtyInputInStock = qtyInput.find('input.qty').attr('max') ? qtyInput.find('input.qty').attr('max') : 99999999,
5660
- qtyLayout = $scope.find('.wpr-product-add-to-cart').attr('layout-settings'),
5661
- qtyWrapper = $scope.find('.wpr-add-to-cart-icons-wrap'),
5662
- plusIconChild = !$scope.find('.wpr-add-to-cart-icons-wrap').length ? 'last-child' : 'first-child',
5663
- minusIconChild = !$scope.find('.wpr-add-to-cart-icons-wrap').length ? 'first-child' : 'last-child';
5664
-
5665
- $scope.find('input.qty').each(function() {
5666
- if (!$(this).val()) {
5667
- $(this).val(0);
5668
- }
5669
- });
5670
-
5671
- $scope.find('.variations').find('select').on('change', function () {
5672
- var resetButtonDisplay = false;
5673
- $scope.find('.variations').find('select').each(function () {
5674
- if ( 'choose an option' !== $(this).find('option:selected').text().toLowerCase() ) {
5675
- resetButtonDisplay = true;
5676
- }
5677
- });
5678
-
5679
- if ( resetButtonDisplay == false ) {
5680
- $scope.find('.reset_variations').css('display', 'none');
5681
- } else {
5682
- $scope.find('.reset_variations').css('display', 'inline-block');
5683
- }
5684
- });
5685
-
5686
- // convert to text input
5687
- if (qtyLayout !== 'default' ) {
5688
- qtyInput.find('input.qty').attr('type', 'text').removeAttr('step').removeAttr('min').removeAttr('max');
5689
- }
5690
-
5691
- // plus
5692
- qtyInput.on('click', 'i:'+plusIconChild, function() {
5693
-
5694
- if ( parseInt(jQuery(this).prev('.quantity').find('input.qty').val(), 10) < qtyInputInStock && qtyLayout == 'both' ) {
5695
- jQuery(this).prev('.quantity').find('input.qty').val( parseInt(jQuery(this).prev('.quantity').find('input.qty').val(), 10) + 1);
5696
- jQuery('input[name="update_cart"]').removeAttr('disabled');
5697
- } else if ( parseInt(jQuery(this).parent().siblings('.quantity').find('input.qty').val(), 10) < qtyInputInStock && qtyLayout !== 'both' && qtyLayout !== 'default' ) {
5698
- jQuery(this).parent().siblings('.quantity').find('input.qty').val( parseInt(jQuery(this).parent().siblings('.quantity').find('input.qty').val(), 10) + 1);
5699
- jQuery('input[name="update_cart"]').removeAttr('disabled');
5700
- }
5701
- });
5702
-
5703
- // minus
5704
- qtyInput.on('click', 'i:'+minusIconChild, function() {
5705
- if ( parseInt(jQuery(this).next('.quantity').find('input.qty').val(), 10) > 0 && qtyLayout == 'both' ) {
5706
- jQuery(this).next('.quantity').find('input.qty').val( parseInt(jQuery(this).next('.quantity').find('input.qty').val(), 10) - 1);
5707
- jQuery('input[name="update_cart"]').removeAttr('disabled');
5708
- } else if ( parseInt(jQuery(this).parent().siblings('.quantity').find('input.qty').val(), 10) > 0 && qtyLayout !== 'both' && qtyLayout !== 'default' ) {
5709
- jQuery(this).parent().siblings('.quantity').find('input.qty').val( parseInt(jQuery(this).parent().siblings('.quantity').find('input.qty').val(), 10) - 1);
5710
- jQuery('input[name="update_cart"]').removeAttr('disabled');
5711
- }
5712
- });
5713
-
5714
- // in stock range check
5715
- qtyInput.find('input.qty').keyup(function() {
5716
- if ( jQuery(this).val() > qtyInputInStock ) {
5717
- jQuery(this).val( qtyInputInStock );
5718
- }
5719
- });
5720
-
5721
- if ( 'yes' === $scope.find('.wpr-product-add-to-cart').data('ajax-add-to-cart') ) {
5722
- $scope.find('.single_add_to_cart_button').on('click', ajaxAddToCart);
5723
- }
5724
-
5725
- function ajaxAddToCart(e) {
5726
- e.preventDefault();
5727
-
5728
- let $form = $( this ).closest('form');
5729
-
5730
- if ( ! $form[0].checkValidity() ) {
5731
- $form[0].reportValidity();
5732
-
5733
- return false;
5734
- }
5735
-
5736
- let $thisBtn = $( this ),
5737
- product_id = $thisBtn.val() || '',
5738
- cartFormData = $form.serialize();
5739
-
5740
- $.ajax( {
5741
- type: 'POST',
5742
- url: WprConfig.ajaxurl,
5743
- data: 'action=wpr_addons_add_cart_single_product&add-to-cart=' + product_id + '&' + cartFormData,
5744
- beforeSend: function () {
5745
- $thisBtn.removeClass( 'added' ).addClass( 'loading' );
5746
- },
5747
- complete: function () {
5748
- $thisBtn.addClass( 'added' ).removeClass( 'loading' );
5749
- },
5750
- success: function ( response ) {
5751
- if ( response.error && response.product_url ) {
5752
- window.location = response.product_url;
5753
-
5754
- return;
5755
- }
5756
-
5757
- setTimeout( function () {
5758
- $thisBtn.removeClass( 'added' );
5759
- }, 1000 );
5760
-
5761
- $( document.body ).trigger( 'wc_fragment_refresh' );
5762
- $( document.body ).trigger( 'added_to_cart', [ response.fragments, response.cart_hash, $thisBtn ] );
5763
-
5764
- if ( typeof wc_add_to_cart_params === 'undefined' ) {
5765
- return false;
5766
- }
5767
-
5768
- var currentCartCount = parseInt($('.wpr-mini-cart-icon-count').text());
5769
- var updatedCartCount = parseInt($scope.find('.wpr-quantity-wrapper .qty').val());
5770
- $('.wpr-mini-cart-icon-count').text(currentCartCount + updatedCartCount);
5771
- },
5772
- } );
5773
- }
5774
- }, // End of widgetProductAddToCart
5775
-
5776
- widgetProductMiniCart: function($scope) {
5777
- $scope.find('.wpr-mini-cart').css({"display": "none"});
5778
-
5779
- // $( document.body ).trigger( 'wc_fragment_refresh' );
5780
-
5781
- var animationSpeed = $scope.find('.wpr-mini-cart-wrap').data('animation');
5782
-
5783
- $('body').on('click', function(e) {
5784
- if ( !e.target.classList.value.includes('wpr-mini-cart') && !e.target.closest('.wpr-mini-cart') ) {
5785
- if ( $scope.hasClass('wpr-mini-cart-slide') ) {
5786
- $scope.find('.wpr-mini-cart').slideUp(animationSpeed);
5787
- } else {
5788
- $scope.find('.wpr-mini-cart').fadeOut(animationSpeed);
5789
- }
5790
- }
5791
- });
5792
-
5793
- if ( 0 !== $scope.hasClass('wpr-mini-cart-sidebar').length ) {
5794
- if ( $('#wpadminbar').length ) {
5795
- $scope.find('.wpr-mini-cart').css({
5796
- // 'top': $('#wpadminbar').css('height'),
5797
- // 'height': $scope.find('.wpr-shopping-cart-wrap').css('height') - $('#wpadminbar').css('height')
5798
- 'z-index': 999999
5799
- });
5800
- }
5801
-
5802
- closeSideBar();
5803
-
5804
- $scope.find('.wpr-shopping-cart-wrap').on('click', function(e) {
5805
- // if ( !e.target.classList.value.includes('widget_shopping_cart_content') && !e.target.closest('.widget_shopping_cart_content') ) {
5806
- if ( !e.target.classList.value.includes('wpr-shopping-cart-inner-wrap') && !e.target.closest('.wpr-shopping-cart-inner-wrap') ) {
5807
- // $scope.find('.widget_shopping_cart_content').addClass('wpr-mini-cart-slide-out');
5808
- $scope.find('.wpr-shopping-cart-inner-wrap').addClass('wpr-mini-cart-slide-out');
5809
- $scope.find('.wpr-mini-cart-slide-out').css('animation-speed', animationSpeed);
5810
- $scope.find('.wpr-shopping-cart-wrap').fadeOut(animationSpeed);
5811
- $('body').removeClass('wpr-mini-cart-sidebar-body');
5812
- setTimeout(function() {
5813
- // $scope.find('.widget_shopping_cart_content').removeClass('wpr-mini-cart-slide-out');
5814
- $scope.find('.wpr-shopping-cart-inner-wrap').removeClass('wpr-mini-cart-slide-out');
5815
- $scope.find('.wpr-mini-cart').css({"display": "none"});
5816
- }, animationSpeed + 100);
5817
- }
5818
- });
5819
- }
5820
-
5821
- if ( $scope.find('.wpr-mini-cart').length ) {
5822
- $scope.find('.wpr-mini-cart-toggle-btn').on('click', function(e) {
5823
- e.stopPropagation();
5824
- e.preventDefault();
5825
- if ( 'none' === $scope.find('.wpr-mini-cart').css("display") ) {
5826
- if ( $scope.hasClass('wpr-mini-cart-slide') ) {
5827
- $scope.find('.wpr-mini-cart').slideDown(animationSpeed);
5828
- } else {
5829
- $scope.find('.wpr-mini-cart').fadeIn(animationSpeed);
5830
- }
5831
- if ( $scope.hasClass('wpr-mini-cart-sidebar') ) {
5832
- $scope.find('.wpr-shopping-cart-wrap').fadeIn(animationSpeed);
5833
- // $scope.find('.widget_shopping_cart_content').addClass('wpr-mini-cart-slide-in');
5834
- $scope.find('.wpr-shopping-cart-inner-wrap').addClass('wpr-mini-cart-slide-in');
5835
- $scope.find('.wpr-mini-cart-slide-in').css('animation-speed', animationSpeed);
5836
- $('body').addClass('wpr-mini-cart-sidebar-body');
5837
- }
5838
- setTimeout(function() {
5839
- // $scope.find('.widget_shopping_cart_content').removeClass('wpr-mini-cart-slide-in');
5840
- $scope.find('.wpr-shopping-cart-inner-wrap').removeClass('wpr-mini-cart-slide-in');
5841
- if ( $scope.hasClass('wpr-mini-cart-sidebar') ) {
5842
- $scope.find('.wpr-woo-mini-cart').trigger('resize');
5843
- }
5844
- }, animationSpeed + 100);
5845
- } else {
5846
- if ( $scope.hasClass('wpr-mini-cart-slide') ) {
5847
- $scope.find('.wpr-mini-cart').slideUp(animationSpeed);
5848
- } else {
5849
- $scope.find('.wpr-mini-cart').fadeOut(animationSpeed);
5850
- }
5851
- }
5852
- });
5853
- }
5854
-
5855
- var mutationObserver = new MutationObserver(function(mutations) {
5856
- if ( 0 !== $scope.hasClass('wpr-mini-cart-sidebar').length ) {
5857
- closeSideBar();
5858
-
5859
- // if ( $scope.find('.wpr-mini-cart').data('close-cart-heading') ) {
5860
- // $scope.find('.wpr-close-cart h2').text($scope.find('.wpr-mini-cart').data('close-cart-heading').replace(/-/g, ' '));
5861
- // }
5862
- }
5863
-
5864
- $scope.find('.woocommerce-mini-cart-item').on('click', '.wpr-remove-item-from-mini-cart', function() {
5865
- $(this).closest('li').addClass('wpr-before-remove-from-mini-cart');
5866
- });
5867
- });
5868
-
5869
- // Listen to Mini Cart Changes
5870
- mutationObserver.observe($scope[0], {
5871
- childList: true,
5872
- subtree: true,
5873
- });
5874
-
5875
- function closeSideBar() {
5876
- $scope.find('.wpr-close-cart span').on('click', function(e) {
5877
- // $scope.find('.widget_shopping_cart_content').addClass('wpr-mini-cart-slide-out');
5878
- $scope.find('.wpr-shopping-cart-inner-wrap').addClass('wpr-mini-cart-slide-out');
5879
- $scope.find('.wpr-mini-cart-slide-out').css('animation-speed', animationSpeed);
5880
- $scope.find('.wpr-shopping-cart-wrap').fadeOut(animationSpeed);
5881
- $('body').removeClass('wpr-mini-cart-sidebar-body');
5882
- setTimeout(function() {
5883
- // $scope.find('.widget_shopping_cart_content').removeClass('wpr-mini-cart-slide-out');
5884
- $scope.find('.wpr-shopping-cart-inner-wrap').removeClass('wpr-mini-cart-slide-out');
5885
- $scope.find('.wpr-mini-cart').css({"display": "none"});
5886
- }, animationSpeed + 100);
5887
- });
5888
- }
5889
-
5890
- }, // End of widgetProductMiniCart
5891
-
5892
- widgetProductFilters: function($scope) {
5893
- if ( 0 !== $scope.find('.wpr-search-form-input').length ) {
5894
- $scope.find('.wpr-search-form-input').on( {
5895
- focus: function() {
5896
- $scope.addClass( 'wpr-search-form-input-focus' );
5897
- },
5898
- blur: function() {
5899
- $scope.removeClass( 'wpr-search-form-input-focus' );
5900
- }
5901
- } );
5902
- }
5903
- }, // End of widgetProductFilters
5904
-
5905
- widgetPageCart: function($scope) {
5906
- // $scope.find('.shipping-calculator-button').trigger('click');
5907
- }, // End of widgetPageCart
5908
-
5909
- widgetPageMyAccount: function($scope) {
5910
-
5911
- if ( WprElements.editorCheck() ) {
5912
-
5913
- $scope.find(".woocommerce-MyAccount-content").each(function() {
5914
- if ( $(this).index() !== 1 ) {
5915
- $(this).css('display', 'none');
5916
- }
5917
- });
5918
-
5919
- $scope.find('.woocommerce-MyAccount-navigation-link').on('click', function() {
5920
- var tabContent, tabLinks, pageName;
5921
-
5922
- tabContent = $scope.find(".woocommerce-MyAccount-content");
5923
- tabContent.each(function() {
5924
- $(this).css('display', 'none');
5925
- });
5926
-
5927
- tabLinks = $scope.find(".woocommerce-MyAccount-navigation-link");
5928
- tabLinks.each(function() {
5929
- $(this).removeClass('is-active');
5930
- });
5931
-
5932
- pageName = $(this).attr('class').slice($(this).attr('class').indexOf('--') + 2);
5933
- $(this).addClass('is-active');
5934
-
5935
- $scope.find('[wpr-my-account-page="'+ pageName +'"]').css('display', 'block');
5936
-
5937
- });
5938
- }
5939
-
5940
- }, // End of widgetPageMyAccount
5941
-
5942
- widgetReadingProgressBar: function($scope) {
5943
-
5944
- if ( $scope.find('.wpr-reading-progress-bar-container').length != 0 ) {
5945
- var rpbContainer = $scope.find('.wpr-reading-progress-bar-container');
5946
- readingProgressBar($scope, rpbContainer);
5947
- }
5948
-
5949
- function readingProgressBar($scope, rpbContainer) {
5950
-
5951
- var initialPaddingTop = $('body').css('paddingTop');
5952
- var initialPaddingBottom = $('body').css('paddingBottom');
5953
-
5954
- if ( '0px' === rpbContainer.css('top') ) {
5955
- if ( 'colored' == rpbContainer.data('background-type') ) {
5956
- $('body').css('paddingTop', $scope.find('.wpr-reading-progress-bar').css('height'));
5957
- }
5958
- if ( $('#wpadminbar').length ) {
5959
- rpbContainer.css('top', $('#wpadminbar').height());
5960
- }
5961
- $('body').css('paddingBottom', initialPaddingBottom);
5962
- } else if ( '0px' === rpbContainer.css('bottom') && 'colored' == rpbContainer.data('background-type') ) {
5963
- $('body').css('paddingBottom', $scope.find('.wpr-reading-progress-bar').css('height'));
5964
- $('body').css('paddingTop', initialPaddingTop);
5965
- }
5966
-
5967
- readingProgressBarFill($scope);
5968
- window.onscroll = function() {
5969
- readingProgressBarFill($scope);
5970
- };
5971
-
5972
- }
5973
-
5974
- function readingProgressBarFill($scope) {
5975
- if ( $scope.find('.wpr-reading-progress-bar').length ) {
5976
- var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
5977
- var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
5978
- var scrolled = (winScroll / height) * 100;
5979
- $scope.find(".wpr-reading-progress-bar").css('width', scrolled + "%");
5980
- }
5981
- }
5982
-
5983
- },
5984
-
5985
- widgetDataTable: function($scope) {
5986
-
5987
- var beforeFilter = $scope.find("tbody .wpr-table-row"),
5988
- itemsPerPage = +$scope.find('.wpr-table-inner-container').attr('data-rows-per-page'),
5989
- paginationListItems = $scope.find('.wpr-table-custom-pagination-list-item'),
5990
- initialRows = $scope.find('.wpr-table-inner-container tbody tr'),
5991
- table = $scope.find('.wpr-table-inner-container tbody'),
5992
- pageIndex, value, paginationIndex;
5993
-
5994
- // Table Custom Pagination
5995
- if ( 'yes' === $scope.find('.wpr-table-inner-container').attr('data-custom-pagination') ) {
5996
-
5997
- var tableRows = initialRows.filter(function(index) {
5998
- return index < $scope.find('.wpr-table-inner-container').attr('data-rows-per-page');
5999
- });
6000
-
6001
- table.html(tableRows);
6002
-
6003
- adjustPaginationList();
6004
-
6005
- $scope.on('click', '.wpr-table-custom-pagination-list-item', function() {
6006
- paginationListItems.removeClass('wpr-active-pagination-item');
6007
- $(this).addClass('wpr-active-pagination-item');
6008
- adjustPaginationList();
6009
- table.hide();
6010
- pageIndex = +$(this).text();
6011
- itemsPerPage = +$scope.find('.wpr-table-inner-container').attr('data-rows-per-page');
6012
-
6013
- table.html(initialRows.filter(function(index) {
6014
- index++;
6015
- return index > itemsPerPage * (pageIndex - 1) && index <= itemsPerPage * pageIndex;
6016
- }));
6017
-
6018
- table.show();
6019
- beforeFilter = $scope.find("tbody .wpr-table-row");
6020
- beforeFilter.find('.wpr-table-tr-before-remove').each(function() {
6021
- $(this).removeClass('wpr-table-tr-before-remove');
6022
- });
6023
-
6024
- entryInfo();
6025
- });
6026
-
6027
- $scope.find('.wpr-table-prev-next').each(function() {
6028
- pageIndex = +$scope.find('.wpr-active-pagination-item').text();
6029
-
6030
- if ( $(this).hasClass('wpr-table-custom-pagination-prev')) {
6031
-
6032
- $(this).on('click', function() {
6033
-
6034
- if ( 1 < pageIndex ) {
6035
- paginationListItems.removeClass('wpr-active-pagination-item');
6036
- pageIndex--;
6037
-
6038
- paginationListItems.each(function(index) {
6039
- index++;
6040
- if ( index === pageIndex) {
6041
- $(this).addClass('wpr-active-pagination-item');
6042
- pageIndex = +$(this).text();
6043
- }
6044
- });
6045
- adjustPaginationList();
6046
-
6047
- table.html(initialRows.filter(function(index) {
6048
- index++;
6049
- return index > itemsPerPage * (pageIndex - 1) && index <= itemsPerPage * pageIndex;
6050
- }));
6051
-
6052
- beforeFilter = $scope.find("tbody .wpr-table-row");
6053
-
6054
- if ( '' == value ) {
6055
- table.html(beforeFilter);
6056
- }
6057
- }
6058
-
6059
- entryInfo();
6060
- });
6061
-
6062
- } else {
6063
-
6064
- $(this).on('click', function() {
6065
-
6066
- if ( paginationListItems.length > pageIndex ) {
6067
- paginationListItems.removeClass('wpr-active-pagination-item');
6068
- pageIndex++;
6069
-
6070
- paginationListItems.each(function(index) {
6071
- index++;
6072
- if ( index === pageIndex) {
6073
- $(this).addClass('wpr-active-pagination-item');
6074
- pageIndex = +$(this).text();
6075
- }
6076
- });
6077
- adjustPaginationList();
6078
-
6079
- table.html(initialRows.filter(function(index) {
6080
- index++;
6081
- return index > itemsPerPage * (pageIndex - 1) && index <= itemsPerPage * pageIndex;
6082
- }));
6083
-
6084
- beforeFilter = $scope.find("tbody .wpr-table-row");
6085
-
6086
- if ( '' == value ) {
6087
- table.html(beforeFilter);
6088
- }
6089
- }
6090
-
6091
- entryInfo();
6092
- });
6093
- }
6094
-
6095
- beforeFilter.find('.wpr-table-tr-before-remove').each(function() {
6096
- $(this).removeClass('wpr-table-tr-before-remove');
6097
- });
6098
-
6099
- });
6100
-
6101
- }
6102
-
6103
- $scope.find('.wpr-table-inner-container').removeClass('wpr-hide-table-before-arrange');
6104
-
6105
- entryInfo();
6106
-
6107
- // Table Live Search
6108
- beforeFilter = $scope.find("tbody .wpr-table-row");
6109
- $scope.find(".wpr-table-live-search").keyup(function () {
6110
- if ( this.value !== '' ) {
6111
- $scope.find('.wpr-table-pagination-cont').addClass('wpr-hide-pagination-on-search');
6112
- } else {
6113
- $scope.find('.wpr-table-pagination-cont').removeClass('wpr-hide-pagination-on-search');
6114
- }
6115
- value = this.value.toLowerCase().trim();
6116
-
6117
- var afterFilter = [];
6118
-
6119
- initialRows.each(function (index) {
6120
- // if (!index) return; // TODO: restore if better
6121
- $(this).find("td").each(function () {
6122
- var id = $(this).text().toLowerCase().trim();
6123
- var not_found = (id.indexOf(value) == -1);
6124
- // $(this).closest('tr').toggle(!not_found);
6125
- // return not_found;
6126
- if ( !not_found ) {
6127
- afterFilter.push($(this).closest('tr'));
6128
- }
6129
- });
6130
- });
6131
-
6132
- table.html(afterFilter);
6133
-
6134
- if ( '' == value ) {
6135
- table.html(beforeFilter);
6136
- }
6137
-
6138
- entryInfo();
6139
- });
6140
-
6141
- // Table Sorting
6142
- if ( 'yes' === $scope.find('.wpr-table-inner-container').attr('data-table-sorting') ) {
6143
- $(window).click(function(e) {
6144
- if ( !$(e.target).hasClass('wpr-table-th') && 0 === $(e.target).closest('.wpr-table-th').length ) {
6145
- if ( !$(e.target).hasClass('wpr-active-td-bg-color') && 0 === $(e.target).closest('.wpr-active-td-bg-color').length ) {
6146
- $scope.find('td').each(function() {
6147
- if($(this).hasClass('wpr-active-td-bg-color')) {
6148
- $(this).removeClass('wpr-active-td-bg-color');
6149
- }
6150
- });
6151
- }
6152
- }
6153
- });
6154
-
6155
- $scope.find('th').click(function(){
6156
-
6157
- var indexOfTr = $(this).index();
6158
-
6159
- $scope.find('td').each(function() {
6160
- if($(this).index() === indexOfTr) {
6161
- $(this).addClass('wpr-active-td-bg-color');
6162
- } else {
6163
- $(this).removeClass('wpr-active-td-bg-color');
6164
- }
6165
- });
6166
-
6167
- $scope.find('th').each(function() {
6168
- $(this).find('.wpr-sorting-icon').html('<i class="fas fa-sort" aria-hidden="true"></i>');
6169
- });
6170
-
6171
- var table = $(this).parents('table').eq(0);
6172
- var rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index()))
6173
-
6174
- this.asc = !this.asc
6175
- if ($scope.hasClass('wpr-data-table-type-custom') ? !this.asc : this.asc) {
6176
- if ($scope.hasClass('wpr-data-table-type-custom')) {
6177
- $(this).find('.wpr-sorting-icon').html('<i class="fas fa-sort-down" aria-hidden="true"></i>');
6178
- } else {
6179
- $(this).find('.wpr-sorting-icon').html('<i class="fas fa-sort-up" aria-hidden="true"></i>');
6180
- }
6181
- rows = rows.reverse()
6182
- }
6183
-
6184
- if($scope.hasClass('wpr-data-table-type-custom') ? this.asc : !this.asc) {
6185
-
6186
- if ($scope.hasClass('wpr-data-table-type-custom')) {
6187
- $(this).find('.wpr-sorting-icon').html('<i class="fas fa-sort-up" aria-hidden="true"></i>');
6188
- } else {
6189
-
6190
- $(this).find('.wpr-sorting-icon').html('<i class="fas fa-sort-down" aria-hidden="true"></i>');
6191
- }
6192
- }
6193
-
6194
- for (var i = 0; i < rows.length; i++) {
6195
- table.append(rows[i])
6196
- }
6197
-
6198
- beforeFilter.find('.wpr-table-tr-before-remove').each(function() {
6199
- $(this).closest('.wpr-table-row').next('.wpr-table-appended-tr').remove();
6200
- $(this).removeClass('wpr-table-tr-before-remove');
6201
- });
6202
- });
6203
- }
6204
-
6205
- if ( $scope.find('.wpr-table-inner-container').attr('data-row-pagination') === 'yes' ) {
6206
- $scope.find('.wpr-table-head-row').prepend('<th class="wpr-table-th-pag" style="vertical-align: middle;">' + '#' + '</th>')
6207
- initialRows.each(function(index) {
6208
- $(this).prepend('<td class="wpr-table-td-pag" style="vertical-align: middle;"><span style="vertical-align: middle;">'+ (index + 1) +'</span></td>')
6209
- })
6210
- }
6211
-
6212
- if ( $scope.find('.wpr-table-export-button-cont').length ) {
6213
- var exportBtn = $scope.find('.wpr-table-export-button-cont .wpr-button');;
6214
- exportBtn.each(function() {
6215
- if ( $(this).hasClass('wpr-xls')) {
6216
- $(this).on('click', function() {
6217
- let table = $scope.find('table');
6218
- TableToExcel.convert(table[0], { // html code may contain multiple tables so here we are refering to 1st table tag
6219
- name: `export.xlsx`, // fileName you could use any name
6220
- sheet: {
6221
- name: 'Sheet 1' // sheetName
6222
- }
6223
- });
6224
- });
6225
- } else if ( $(this).hasClass('wpr-csv')) {
6226
- $(this).on('click', function() {
6227
- htmlToCSV('why-this-arg?', "placeholder.csv", $scope.find('.wpr-data-table'));
6228
- });
6229
- }
6230
- });
6231
- }
6232
-
6233
- // if('yes' === $scope.find('.wpr-table-inner-container').attr('data-enable-tr-link')) {
6234
- // $scope.find('tbody tr:eq('+ $scope.find('.wpr-table-inner-container').attr('data-tr-index') +')').click(function() {
6235
- // window.location.href = 'https://stackoverflow.com/questions/503093/how-do-i-redirect-to-another-webpage';
6236
- // // window.open('https://stackoverflow.com/questions/503093/how-do-i-redirect-to-another-webpage', '_blank');
6237
- // });
6238
- // }
6239
-
6240
- function entryInfo() {
6241
-
6242
- if ( 'yes' !== $scope.find('.wpr-table-inner-container').attr('data-entry-info') ) {
6243
- return;
6244
- }
6245
-
6246
- var entryPage = +$scope.find('.wpr-active-pagination-item').text(),
6247
- lastEntry = itemsPerPage * entryPage - (itemsPerPage - $scope.find('tbody tr').length),
6248
- firstEntry = lastEntry - $scope.find('tbody tr').length + 1;
6249
-
6250
- $scope.find('.wpr-entry-info').html('Showing ' + firstEntry + ' to ' + lastEntry + ' of ' + initialRows.length + ' Entries.');
6251
- }
6252
-
6253
- function adjustPaginationList() {
6254
-
6255
- paginationIndex = $scope.find('.wpr-active-pagination-item').index();
6256
- paginationListItems.each(function(index) {
6257
- if (index == 0 || index == paginationListItems.length - 1 || index <= paginationIndex && index >= paginationIndex - 2) {
6258
- $(this).css('display', 'flex');
6259
- } else {
6260
- $(this).css('display', 'none');
6261
- }
6262
- });
6263
- }
6264
-
6265
- function comparer(index) {
6266
- return function(a, b) {
6267
- var valA = getCellValue(a, index), valB = getCellValue(b, index)
6268
- return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.toString().localeCompare(valB)
6269
- }
6270
- }
6271
-
6272
- function getCellValue (row, index) {
6273
- return $(row).children('td').eq(index).text()
6274
- }
6275
-
6276
- function htmlToCSV(html, filename, view) {
6277
- var data = [];
6278
- var rows = view.find(".wpr-table-row");
6279
-
6280
- for (var i = 0; i < rows.length; i++) {
6281
- var row = [], cols = rows[i].querySelectorAll(".wpr-table-text");
6282
-
6283
- for (var j = 0; j < cols.length; j++) {
6284
- row.push(cols[j].innerText);
6285
- }
6286
-
6287
- data.push(row.join(","));
6288
- }
6289
-
6290
- downloadCSVFile(data.join("\n"), filename);
6291
- }
6292
-
6293
- function downloadCSVFile(csv, filename) {
6294
- var csv_file, download_link;
6295
-
6296
- csv_file = new Blob([csv], {type: "text/csv"});
6297
-
6298
- download_link = document.createElement("a");
6299
-
6300
- download_link.download = filename;
6301
-
6302
- download_link.href = window.URL.createObjectURL(csv_file);
6303
-
6304
- download_link.style.display = "none";
6305
-
6306
- document.body.appendChild(download_link);
6307
-
6308
- download_link.click();
6309
- } // Data Table CSV export
6310
-
6311
- }, // End widgetDataTable
6312
-
6313
- // Editor Check
6314
- editorCheck: function() {
6315
- return $( 'body' ).hasClass( 'elementor-editor-active' ) ? true : false;
6316
- },
6317
-
6318
- // Edith with Elementor - Admin Bar Menu
6319
- changeAdminBarMenu: function() {
6320
- let editLinks = $('#wp-admin-bar-elementor_edit_page-default');
6321
-
6322
- editLinks.children('li').each(function(){
6323
- let $this = $(this),
6324
- template = $this.children('a').children('span').first().text();
6325
-
6326
- if ( 0 === template.indexOf('wpr-mega-menu-item') ) {
6327
- $this.remove();
6328
- }
6329
- });
6330
- },
6331
-
6332
- } // End WprElements
6333
-
6334
- $( window ).on( 'elementor/frontend/init', WprElements.init );
6335
-
6336
- }( jQuery, window.elementorFrontend ) );
6337
-
6338
-
6339
- // Resize Function - Debounce
6340
- (function($,sr){
6341
-
6342
- var debounce = function (func, threshold, execAsap) {
6343
- var timeout;
6344
-
6345
- return function debounced () {
6346
- var obj = this, args = arguments;
6347
- function delayed () {
6348
- if (!execAsap)
6349
- func.apply(obj, args);
6350
- timeout = null;
6351
- };
6352
-
6353
- if (timeout)
6354
- clearTimeout(timeout);
6355
- else if (execAsap)
6356
- func.apply(obj, args);
6357
-
6358
- timeout = setTimeout(delayed, threshold || 100);
6359
- };
6360
- }
6361
- // smartresize
6362
- jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
6363
-
1
+ ( function( $, elementor ) {
2
+
3
+ "use strict";
4
+
5
+ var WprElements = {
6
+
7
+ init: function() {
8
+
9
+ var widgets = {
10
+ 'wpr-nav-menu.default' : WprElements.widgetNavMenu,
11
+ 'wpr-mega-menu.default' : WprElements.widgetMegaMenu,
12
+ 'wpr-onepage-nav.default' : WprElements.OnepageNav,
13
+ 'wpr-grid.default' : WprElements.widgetGrid,
14
+ 'wpr-magazine-grid.default' : WprElements.widgetMagazineGrid,
15
+ 'wpr-media-grid.default' : WprElements.widgetGrid,
16
+ 'wpr-woo-grid.default' : WprElements.widgetGrid,
17
+ 'wpr-woo-category-grid-pro.default' : WprElements.widgetGrid,
18
+ 'wpr-featured-media.default' : WprElements.widgetFeaturedMedia,
19
+ 'wpr-countdown.default' : WprElements.widgetCountDown,
20
+ 'wpr-google-maps.default' : WprElements.widgetGoogleMaps,
21
+ 'wpr-before-after.default' : WprElements.widgetBeforeAfter,
22
+ 'wpr-mailchimp.default' : WprElements.widgetMailchimp,
23
+ 'wpr-advanced-slider.default' : WprElements.widgetAdvancedSlider,
24
+ 'wpr-testimonial.default' : WprElements.widgetTestimonialCarousel,
25
+ 'wpr-search.default' : WprElements.widgetSearch,
26
+ 'wpr-advanced-text.default' : WprElements.widgetAdvancedText,
27
+ 'wpr-progress-bar.default' : WprElements.widgetProgressBar,
28
+ 'wpr-image-hotspots.default' : WprElements.widgetImageHotspots,
29
+ 'wpr-flip-box.default' : WprElements.widgetFlipBox,
30
+ 'wpr-content-ticker.default' : WprElements.widgetContentTicker,
31
+ 'wpr-tabs.default' : WprElements.widgetTabs,
32
+ 'wpr-content-toggle.default' : WprElements.widgetContentToogle,
33
+ 'wpr-back-to-top.default': WprElements.widgetBackToTop,
34
+ 'wpr-lottie-animations.default': WprElements.widgetLottieAnimations,
35
+ 'wpr-posts-timeline.default' : WprElements.widgetPostsTimeline,
36
+ 'wpr-sharing-buttons.default' : WprElements.widgetSharingButtons,
37
+ 'wpr-flip-carousel.default': WprElements.widgetFlipCarousel,
38
+ 'wpr-feature-list.default' : WprElements.widgetFeatureList,
39
+ 'wpr-advanced-accordion.default' : WprElements.widgetAdvancedAccordion,
40
+ 'wpr-image-accordion.default' : WprElements.widgetImageAccordion,
41
+ 'wpr-product-media.default' : WprElements.widgetProductMedia,
42
+ 'wpr-product-add-to-cart.default' : WprElements.widgetProductAddToCart,
43
+ 'wpr-product-mini-cart.default' : WprElements.widgetProductMiniCart,
44
+ 'wpr-product-filters.default' : WprElements.widgetProductFilters,
45
+ 'wpr-page-cart.default' : WprElements.widgetPageCart,
46
+ 'wpr-my-account-pro.default' : WprElements.widgetPageMyAccount,
47
+ 'wpr-reading-progress-bar.default' : WprElements.widgetReadingProgressBar,
48
+ 'wpr-data-table.default' : WprElements.widgetDataTable,
49
+ 'wpr-charts.default': WprElements.widgetCharts,
50
+ 'wpr-taxonomy-list.default': WprElements.widgetTaxonomyList,
51
+ 'global': WprElements.widgetSection,
52
+
53
+ // Single
54
+ 'wpr-post-media.default' : WprElements.widgetPostMedia,
55
+ };
56
+
57
+ $.each( widgets, function( widget, callback ) {
58
+ window.elementorFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback );
59
+ });
60
+
61
+ // Remove Mega Menu Templates from "Edit with Elementor"
62
+ WprElements.changeAdminBarMenu();
63
+ },
64
+
65
+ widgetPostMedia: function( $scope ) {
66
+ // var gallery = $scope.find( '.wpr-gallery-slider' ),
67
+ // gallerySettings = gallery.attr( 'data-slick' );
68
+
69
+ // gallery.animate({ 'opacity' : '1' }, 1000 );//tmp
70
+
71
+ // if ( '[]' !== gallerySettings ) {
72
+ // gallery.slick({
73
+ // appendDots : $scope.find( '.wpr-gallery-slider-dots' ),
74
+ // customPaging : function ( slider, i ) {
75
+ // var slideNumber = (i + 1),
76
+ // totalSlides = slider.slideCount;
77
+
78
+ // return '<span class="wpr-gallery-slider-dot"></span>';
79
+ // }
80
+ // });
81
+ // }
82
+
83
+ // Lightbox
84
+ var lightboxSettings = $( '.wpr-featured-media-image' ).attr( 'data-lightbox' );
85
+
86
+ if ( typeof lightboxSettings !== typeof undefined && lightboxSettings !== false && ! WprElements.editorCheck() ) {
87
+ var MediaWrap = $scope.find( '.wpr-featured-media-wrap' );
88
+ lightboxSettings = JSON.parse( lightboxSettings );
89
+
90
+ // Init Lightbox
91
+ MediaWrap.lightGallery( lightboxSettings );
92
+
93
+ // Show/Hide Controls
94
+ MediaWrap.on( 'onAferAppendSlide.lg, onAfterSlide.lg', function( event, prevIndex, index ) {
95
+ var lightboxControls = $( '#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download' ),
96
+ lightboxDownload = $( '#lg-download' ).attr( 'href' );
97
+
98
+ if ( $( '#lg-download' ).length ) {
99
+ if ( -1 === lightboxDownload.indexOf( 'wp-content' ) ) {
100
+ lightboxControls.addClass( 'wpr-hidden-element' );
101
+ } else {
102
+ lightboxControls.removeClass( 'wpr-hidden-element' );
103
+ }
104
+ }
105
+
106
+ // Autoplay Button
107
+ if ( '' === lightboxSettings.autoplay ) {
108
+ $( '.lg-autoplay-button' ).css({
109
+ 'width' : '0',
110
+ 'height' : '0',
111
+ 'overflow' : 'hidden'
112
+ });
113
+ }
114
+ });
115
+ }
116
+ }, // End widgetFeaturedMedia
117
+
118
+ widgetSection: function( $scope ) {
119
+
120
+ if ( $scope.attr('data-wpr-particles') || $scope.find('.wpr-particle-wrapper').attr('data-wpr-particles-editor') ) {
121
+ particlesEffect();
122
+ }
123
+
124
+ if ( $scope.hasClass('wpr-jarallax') || $scope.hasClass('wpr-jarallax-yes') ) {
125
+ parallaxBackground();
126
+ }
127
+
128
+ if ( $scope.hasClass('wpr-parallax-yes') ) {
129
+ parallaxMultiLayer();
130
+ }
131
+
132
+ if ( $scope.hasClass('wpr-sticky-section-yes') ) {
133
+
134
+ var positionType = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-type') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-type'),
135
+ positionLocation = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-location') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-location'),
136
+ positionOffset = !WprElements.editorCheck() ? $scope.attr('data-wpr-position-offset') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-position-offset'),
137
+ viewportWidth = $('body').prop('clientWidth') + 17,
138
+ availableDevices = !WprElements.editorCheck() ? $scope.attr('data-wpr-sticky-devices') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-sticky-devices'),
139
+ activeDevices = !WprElements.editorCheck() ? $scope.attr('data-wpr-active-breakpoints') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-active-breakpoints'),
140
+ stickySectionExists = $scope.hasClass('wpr-sticky-section-yes') || $scope.find('.wpr-sticky-section-yes-editor') ? true : false,
141
+ positionStyle,
142
+ adminBarHeight,
143
+ stickyHeaderFooter = $scope.closest('div[data-elementor-type="wp-post"]').length ? $scope.closest('div[data-elementor-type="wp-post"]') : '',
144
+ headerFooterZIndex = !WprElements.editorCheck() ? $scope.attr('data-wpr-z-index') : $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-z-index');
145
+
146
+ if ( !$scope.find('.wpr-sticky-section-yes-editor').length) {
147
+ positionType = $scope.attr('data-wpr-position-type');
148
+ positionLocation = $scope.attr('data-wpr-position-location');
149
+ positionOffset = $scope.attr('data-wpr-position-offset');
150
+ availableDevices = $scope.attr('data-wpr-sticky-devices');
151
+ activeDevices = $scope.attr('data-wpr-active-breakpoints');
152
+ headerFooterZIndex = $scope.attr('data-wpr-z-index');
153
+ }
154
+
155
+ if ( 'top' === positionLocation && 'auto' === $scope.css('top') ) {
156
+ var offsetTop = 0;
157
+ $scope.css('top', 0);
158
+ } else {
159
+ var offsetTop = +$scope.css('top').slice(0, -2);
160
+ }
161
+
162
+ if ( 0 == availableDevices.length ) {
163
+ positionType = 'static';
164
+ }
165
+
166
+ if ( WprElements.editorCheck() && availableDevices ) {
167
+ var attributes = $scope.find('.wpr-sticky-section-yes-editor').attr('data-wpr-sticky-devices');
168
+ $scope.attr('data-wpr-sticky-devices', attributes);
169
+ availableDevices = $scope.attr('data-wpr-sticky-devices');
170
+ }
171
+
172
+ changePositionType();
173
+ changeAdminBarOffset();
174
+
175
+ $(window).resize(function() {
176
+ viewportWidth = $('body').prop('clientWidth') + 17,
177
+ changePositionType();
178
+ });
179
+
180
+ if (!stickySectionExists) {
181
+ positionStyle = 'static';
182
+ }
183
+
184
+ function changePositionType() {
185
+ if ( !$scope.hasClass('wpr-sticky-section-yes') || !$scope.find('.wpr-sticky-section-yes-editor') ) {
186
+ positionStyle = 'static';
187
+ return;
188
+ }
189
+
190
+ var checkDevices = [['mobile_sticky', 768], ['mobile_extra_sticky', 881], ['tablet_sticky', 1025], ['tablet_extra_sticky', 1201], ['laptop_sticky', 1216], ['desktop_sticky', 2400], ['widescreen_sticky', 4000]];
191
+ var emptyVariables = [];
192
+
193
+ var checkedDevices = checkDevices.filter((item, index) => {
194
+ return activeDevices.indexOf(item[0]) != -1;
195
+ }).reverse();
196
+
197
+ checkedDevices.forEach((device, index) => {
198
+ if ( (device[1] > viewportWidth) && availableDevices.indexOf(device[0]) === -1 ) {
199
+ positionStyle = activeDevices?.indexOf(device[0]) !== -1 ? 'static' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
200
+ // positionStyle = activeDevices && activeDevices.indexOf(device[0]) !== -1 ? 'static' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
201
+ emptyVariables[index] = positionStyle;
202
+ } else if ( ( device[1] > viewportWidth) && availableDevices.indexOf(device[0]) !== -1 ) {
203
+ positionStyle = positionType;
204
+ }
205
+ });
206
+
207
+ applyPosition();
208
+ }
209
+
210
+ function applyPosition() {
211
+ var bottom = +window.innerHeight - (+$scope.css('top').slice(0, -2) + $scope.height());
212
+ var top = +window.innerHeight - (+$scope.css('bottom').slice(0, -2) + $scope.height());
213
+ if ( 'top' === positionLocation ) {
214
+ $scope.css({'position': positionStyle });
215
+ if ( '' !== stickyHeaderFooter ) {
216
+ // stickyHeaderFooter = stickyHeaderFooter.find('.wpr-sticky-section-yes');
217
+ stickyHeaderFooter.css({'position': positionStyle, 'top': positionOffset + 'px', 'bottom': 'auto', 'z-index': headerFooterZIndex, 'width': '100%' });
218
+ }
219
+ }
220
+ else {
221
+ $scope.css({'position': positionStyle });
222
+ if ( '' !== stickyHeaderFooter ) {
223
+ stickyHeaderFooter = stickyHeaderFooter.find('.wpr-sticky-section-yes');
224
+ stickyHeaderFooter.css({'position': positionStyle, 'bottom': positionOffset + 'px', 'top': 'auto', 'z-index': headerFooterZIndex, 'width': '100%' });
225
+ }
226
+ }
227
+ }
228
+
229
+ function changeAdminBarOffset() {
230
+ if ( $('#wpadminbar').length ) {
231
+ adminBarHeight = $('#wpadminbar').css('height').slice(0, $('#wpadminbar').css('height').length - 2);
232
+ if ( 'top' === positionLocation && ( 'fixed' == $scope.css('position') || 'sticky' == $scope.css('position') ) ) {
233
+ $scope.css('top', +adminBarHeight + offsetTop + 'px');
234
+ $scope.css('bottom', 'auto');
235
+ }
236
+ }
237
+ }
238
+
239
+ }
240
+
241
+ function particlesEffect() {
242
+ var elementType = $scope.data('element_type'),
243
+ sectionID = $scope.data('id'),
244
+ particlesJSON = ! WprElements.editorCheck() ? $scope.attr('data-wpr-particles') : $scope.find('.wpr-particle-wrapper').attr('data-wpr-particles-editor');
245
+
246
+ if ( 'section' === elementType && undefined !== particlesJSON ) {
247
+ // Frontend
248
+ if ( ! WprElements.editorCheck() ) {
249
+ $scope.prepend('<div class="wpr-particle-wrapper" id="wpr-particle-'+ sectionID +'"></div>');
250
+
251
+ particlesJS('wpr-particle-'+ sectionID, $scope.attr('particle-source') == 'wpr_particle_json_custom' ? JSON.parse(particlesJSON) : modifyJSON(particlesJSON));
252
+ // Editor
253
+ } else {
254
+ if ( $scope.hasClass('wpr-particle-yes') ) {
255
+ particlesJS( 'wpr-particle-'+ sectionID, $scope.find('.wpr-particle-wrapper').attr('particle-source') == 'wpr_particle_json_custom' ? JSON.parse(particlesJSON) : modifyJSON(particlesJSON));
256
+
257
+ $scope.find('.elementor-column').css('z-index', 9);
258
+
259
+ $(window).trigger('resize');
260
+ } else {
261
+ $scope.find('.wpr-particle-wrapper').remove();
262
+ }
263
+ }
264
+ }
265
+ }
266
+
267
+ function modifyJSON(json) {
268
+ var wpJson = JSON.parse(json),
269
+ particles_quantity = ! WprElements.editorCheck() ? $scope.attr('wpr-quantity') : $scope.find('.wpr-particle-wrapper').attr('wpr-quantity'),
270
+ particles_color = ! WprElements.editorCheck() ? $scope.attr('wpr-color') || '#000000' : $scope.find('.wpr-particle-wrapper').attr('wpr-color') ? $scope.find('.wpr-particle-wrapper').attr('wpr-color') : '#000000',
271
+ particles_speed = ! WprElements.editorCheck() ? $scope.attr('wpr-speed') : $scope.find('.wpr-particle-wrapper').attr('wpr-speed'),
272
+ particles_shape = ! WprElements.editorCheck() ? $scope.attr('wpr-shape') : $scope.find('.wpr-particle-wrapper').attr('wpr-shape'),
273
+ particles_size = ! WprElements.editorCheck() ? $scope.attr('wpr-size') : $scope.find('.wpr-particle-wrapper').attr('wpr-size');
274
+
275
+ wpJson.particles.size.value = particles_size;
276
+ wpJson.particles.number.value = particles_quantity;
277
+ wpJson.particles.color.value = particles_color;
278
+ wpJson.particles.shape.type = particles_shape;
279
+ wpJson.particles.line_linked.color = particles_color;
280
+ wpJson.particles.move.speed = particles_speed;
281
+
282
+ return wpJson;
283
+ }
284
+
285
+ function parallaxBackground() {
286
+ if ( $scope.hasClass('wpr-jarallax-yes') ) {
287
+ if ( ! WprElements.editorCheck() && $scope.hasClass('wpr-jarallax') ) {
288
+ $scope.css('background-image', 'url("' + $scope.attr('bg-image') + '")');
289
+ $scope.jarallax({
290
+ type: $scope.attr('scroll-effect'),
291
+ speed: $scope.attr('speed-data'),
292
+ });
293
+ } else if ( WprElements.editorCheck() ) {
294
+ $scope.css('background-image', 'url("' + $scope.find('.wpr-jarallax').attr('bg-image-editor') + '")');
295
+ $scope.jarallax({
296
+ type: $scope.find('.wpr-jarallax').attr('scroll-effect-editor'),
297
+ speed: $scope.find('.wpr-jarallax').attr('speed-data-editor')
298
+ });
299
+ }
300
+ }
301
+ }
302
+
303
+ function parallaxMultiLayer() {
304
+ if ( $scope.hasClass('wpr-parallax-yes') ) {
305
+ var scene = document.getElementsByClassName('wpr-parallax-multi-layer');
306
+
307
+ var parallaxInstance = Array.from(scene).map(item => {
308
+ return new Parallax(item, {
309
+ invertY: item.getAttribute('direction') == 'yes' ? true : false,
310
+ invertX: item.getAttribute('direction') == 'yes' ? true : false,
311
+ scalarX: item.getAttribute('scalar-speed'),
312
+ scalarY: item.getAttribute('scalar-speed'),
313
+ hoverOnly: true,
314
+ pointerEvents: true
315
+ });
316
+ });
317
+
318
+ parallaxInstance.forEach(parallax => {
319
+ parallax.friction(0.2, 0.2);
320
+ });
321
+ }
322
+ if ( ! WprElements.editorCheck() ) {
323
+ var newScene = [];
324
+
325
+ document.querySelectorAll('.wpr-parallax-multi-layer').forEach((element, index) => {
326
+ element.parentElement.style.position = "relative";
327
+ element.style.position = "absolute";
328
+ newScene.push(element);
329
+ element.remove();
330
+ });
331
+
332
+ document.querySelectorAll('.wpr-parallax-ml-children').forEach((element, index) => {
333
+ element.style.position = "absolute";
334
+ element.style.top = element.getAttribute('style-top');
335
+ element.style.left = element.getAttribute('style-left');
336
+ });
337
+
338
+ $('.wpr-parallax-yes').each(function(index) {
339
+ $(this).append(newScene[index]);
340
+ });
341
+ }
342
+ }
343
+ }, // end widgetSection
344
+
345
+ widgetNavMenu: function( $scope ) {
346
+
347
+ var $navMenu = $scope.find( '.wpr-nav-menu-container' ),
348
+ $mobileNavMenu = $scope.find( '.wpr-mobile-nav-menu-container' );
349
+
350
+ // Menu
351
+ var subMenuFirst = $navMenu.find( '.wpr-nav-menu > li.menu-item-has-children' ),
352
+ subMenuDeep = $navMenu.find( '.wpr-sub-menu li.menu-item-has-children' );
353
+
354
+ if ( $scope.find('.wpr-mobile-toggle').length ) {
355
+ $scope.find('a').on('click', function() {
356
+ if (this.pathname == window.location.pathname && !($(this).parent('li').children().length > 1)) {
357
+ $scope.find('.wpr-mobile-toggle').trigger('click');
358
+ }
359
+ });
360
+ }
361
+
362
+ if ( $navMenu.attr('data-trigger') === 'click' ) {
363
+ // First Sub
364
+ subMenuFirst.children('a').on( 'click', function(e) {
365
+ var currentItem = $(this).parent(),
366
+ childrenSub = currentItem.children('.wpr-sub-menu');
367
+
368
+ // Reset
369
+ subMenuFirst.not(currentItem).removeClass('wpr-sub-open');
370
+ if ( $navMenu.hasClass('wpr-nav-menu-horizontal') || ( $navMenu.hasClass('wpr-nav-menu-vertical') && $scope.hasClass('wpr-sub-menu-position-absolute') ) ) {
371
+ subMenuAnimation( subMenuFirst.children('.wpr-sub-menu'), false );
372
+ }
373
+
374
+ if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
375
+ e.preventDefault();
376
+ currentItem.addClass('wpr-sub-open');
377
+ subMenuAnimation( childrenSub, true );
378
+ } else {
379
+ currentItem.removeClass('wpr-sub-open');
380
+ subMenuAnimation( childrenSub, false );
381
+ }
382
+ });
383
+
384
+ // Deep Subs
385
+ subMenuDeep.on( 'click', function(e) {
386
+ var currentItem = $(this),
387
+ childrenSub = currentItem.children('.wpr-sub-menu');
388
+
389
+ // Reset
390
+ if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
391
+ subMenuAnimation( subMenuDeep.find('.wpr-sub-menu'), false );
392
+ }
393
+
394
+ if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
395
+ e.preventDefault();
396
+ currentItem.addClass('wpr-sub-open');
397
+ subMenuAnimation( childrenSub, true );
398
+
399
+ } else {
400
+ currentItem.removeClass('wpr-sub-open');
401
+ subMenuAnimation( childrenSub, false );
402
+ }
403
+ });
404
+
405
+ // Reset Subs on Document click
406
+ $( document ).mouseup(function (e) {
407
+ if ( ! subMenuFirst.is(e.target) && subMenuFirst.has(e.target).length === 0 ) {
408
+ subMenuFirst.not().removeClass('wpr-sub-open');
409
+ subMenuAnimation( subMenuFirst.children('.wpr-sub-menu'), false );
410
+ }
411
+ if ( ! subMenuDeep.is(e.target) && subMenuDeep.has(e.target).length === 0 ) {
412
+ subMenuDeep.removeClass('wpr-sub-open');
413
+ subMenuAnimation( subMenuDeep.children('.wpr-sub-menu'), false );
414
+ }
415
+ });
416
+ } else {
417
+ // Mouse Over
418
+ subMenuFirst.on( 'mouseenter', function() {
419
+ if ( $navMenu.hasClass('wpr-nav-menu-vertical') && $scope.hasClass('wpr-sub-menu-position-absolute') ) {
420
+ $navMenu.find('li').not(this).children('.wpr-sub-menu').hide();
421
+ // BUGFIX: when menu is vertical and absolute positioned, lvl2 depth sub menus wont show properly on hover
422
+ }
423
+
424
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
425
+ });
426
+
427
+ // Deep Subs
428
+ subMenuDeep.on( 'mouseenter', function() {
429
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
430
+ });
431
+
432
+
433
+ // Mouse Leave
434
+ if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
435
+ subMenuFirst.on( 'mouseleave', function() {
436
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
437
+ });
438
+
439
+ subMenuDeep.on( 'mouseleave', function() {
440
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
441
+ });
442
+ } else {
443
+
444
+ $navMenu.on( 'mouseleave', function() {
445
+ subMenuAnimation( $(this).find('.wpr-sub-menu'), false );
446
+ });
447
+ }
448
+ }
449
+
450
+
451
+ // Mobile Menu
452
+ var mobileMenu = $mobileNavMenu.find( '.wpr-mobile-nav-menu' );
453
+
454
+ // Toggle Button
455
+ $mobileNavMenu.find( '.wpr-mobile-toggle' ).on( 'click', function() {
456
+ $(this).toggleClass('wpr-mobile-toggle-fx');
457
+
458
+ if ( ! $(this).hasClass('wpr-mobile-toggle-open') ) {
459
+ $(this).addClass('wpr-mobile-toggle-open');
460
+
461
+ if ( $(this).find('.wpr-mobile-toggle-text').length ) {
462
+ $(this).children().eq(0).hide();
463
+ $(this).children().eq(1).show();
464
+ }
465
+ } else {
466
+ $(this).removeClass('wpr-mobile-toggle-open');
467
+ $(this).trigger('focusout');
468
+
469
+ if ( $(this).find('.wpr-mobile-toggle-text').length ) {
470
+ $(this).children().eq(1).hide();
471
+ $(this).children().eq(0).show();
472
+ }
473
+ }
474
+
475
+ // Show Menu
476
+ $(this).parent().next().stop().slideToggle();
477
+
478
+ // Fix Width
479
+ fullWidthMobileDropdown();
480
+ });
481
+
482
+ // Sub Menu Class
483
+ mobileMenu.find('.sub-menu').removeClass('wpr-sub-menu').addClass('wpr-mobile-sub-menu');
484
+
485
+ // Sub Menu Dropdown
486
+ mobileMenu.find('.menu-item-has-children').children('a').on( 'click', function(e) {
487
+ var parentItem = $(this).closest('li');
488
+
489
+ // Toggle
490
+ if ( ! parentItem.hasClass('wpr-mobile-sub-open') ) {
491
+ e.preventDefault();
492
+ parentItem.addClass('wpr-mobile-sub-open');
493
+ parentItem.children('.wpr-mobile-sub-menu').first().stop().slideDown();
494
+ } else {
495
+ parentItem.removeClass('wpr-mobile-sub-open');
496
+ parentItem.children('.wpr-mobile-sub-menu').first().stop().slideUp();
497
+ }
498
+ });
499
+
500
+ // Run Functions
501
+ fullWidthMobileDropdown();
502
+
503
+ // Run Functions on Resize
504
+ $(window).smartresize(function() {
505
+ fullWidthMobileDropdown();
506
+ });
507
+
508
+ // Full Width Dropdown
509
+ function fullWidthMobileDropdown() {
510
+ if ( ! $scope.hasClass( 'wpr-mobile-menu-full-width' ) || ! $scope.closest('.elementor-column').length ) {
511
+ return;
512
+ }
513
+
514
+ var eColumn = $scope.closest('.elementor-column'),
515
+ mWidth = $scope.closest('.elementor-top-section').outerWidth() - 2 * mobileMenu.offset().left,
516
+ mPosition = eColumn.offset().left + parseInt(eColumn.css('padding-left'), 10);
517
+
518
+ mobileMenu.css({
519
+ 'width' : mWidth +'px',
520
+ 'left' : - mPosition +'px'
521
+ });
522
+ }
523
+
524
+ // Sub Menu Animation
525
+ function subMenuAnimation( selector, show ) {
526
+ if ( show === true ) {
527
+ if ( $scope.hasClass('wpr-sub-menu-fx-slide') ) {
528
+ selector.stop().slideDown();
529
+ } else {
530
+ selector.stop().fadeIn();
531
+ }
532
+ } else {
533
+ if ( $scope.hasClass('wpr-sub-menu-fx-slide') ) {
534
+ selector.stop().slideUp();
535
+ } else {
536
+ selector.stop().fadeOut();
537
+ }
538
+ }
539
+ }
540
+
541
+ }, // End widgetNavMenu
542
+
543
+ widgetMegaMenu: function( $scope ) {
544
+
545
+ var $navMenu = $scope.find( '.wpr-nav-menu-container' ),
546
+ $mobileNavMenu = $scope.find( '.wpr-mobile-nav-menu-container' );
547
+
548
+ // Menu
549
+ var subMenuFirst = $navMenu.find( '.wpr-nav-menu > li.menu-item-has-children' ),
550
+ subMenuDeep = $navMenu.find( '.wpr-sub-menu li.menu-item-has-children' );
551
+
552
+ if ( $scope.find('.wpr-mobile-toggle').length ) {
553
+ $scope.find('a').on('click', function() {
554
+ if (this.pathname == window.location.pathname && !($(this).parent('li').children().length > 1)) {
555
+ $scope.find('.wpr-mobile-toggle').trigger('click');
556
+ }
557
+ });
558
+ }
559
+
560
+ // Click
561
+ if ( $navMenu.attr('data-trigger') === 'click' ) {
562
+ // First Sub
563
+ subMenuFirst.children('a').on( 'click', function(e) {
564
+ var currentItem = $(this).parent(),
565
+ childrenSub = currentItem.children('.wpr-sub-menu, .wpr-sub-mega-menu');
566
+
567
+ // Reset
568
+ subMenuFirst.not(currentItem).removeClass('wpr-sub-open');
569
+ if ( $navMenu.hasClass('wpr-nav-menu-horizontal') || ( $navMenu.hasClass('wpr-nav-menu-vertical') ) ) {
570
+ subMenuAnimation( subMenuFirst.children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
571
+ }
572
+
573
+ if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
574
+ e.preventDefault();
575
+ currentItem.addClass('wpr-sub-open');
576
+ subMenuAnimation( childrenSub, true );
577
+ } else {
578
+ currentItem.removeClass('wpr-sub-open');
579
+ subMenuAnimation( childrenSub, false );
580
+ }
581
+ });
582
+
583
+ // Deep Subs
584
+ subMenuDeep.on( 'click', function(e) {
585
+ var currentItem = $(this),
586
+ childrenSub = currentItem.children('.wpr-sub-menu');
587
+
588
+ // Reset
589
+ if ( $navMenu.hasClass('wpr-nav-menu-horizontal') ) {
590
+ subMenuAnimation( subMenuDeep.find('.wpr-sub-menu'), false );
591
+ }
592
+
593
+ if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
594
+ e.preventDefault();
595
+ currentItem.addClass('wpr-sub-open');
596
+ subMenuAnimation( childrenSub, true );
597
+
598
+ } else {
599
+ currentItem.removeClass('wpr-sub-open');
600
+ subMenuAnimation( childrenSub, false );
601
+ }
602
+ });
603
+
604
+ // Reset Subs on Document click
605
+ $( document ).mouseup(function (e) {
606
+ if ( ! subMenuFirst.is(e.target) && subMenuFirst.has(e.target).length === 0 ) {
607
+ subMenuFirst.not().removeClass('wpr-sub-open');
608
+ subMenuAnimation( subMenuFirst.children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
609
+ }
610
+ if ( ! subMenuDeep.is(e.target) && subMenuDeep.has(e.target).length === 0 ) {
611
+ subMenuDeep.removeClass('wpr-sub-open');
612
+ subMenuAnimation( subMenuDeep.children('.wpr-sub-menu'), false );
613
+ }
614
+ });
615
+
616
+ // Hover
617
+ } else {
618
+ // Mouse Over
619
+ subMenuFirst.on( 'mouseenter', function() {
620
+ subMenuAnimation( $(this).children('.wpr-sub-menu, .wpr-sub-mega-menu'), true );
621
+ });
622
+
623
+ subMenuDeep.on( 'mouseenter', function() {
624
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), true );
625
+ });
626
+
627
+ // Mouse Leave
628
+ subMenuFirst.on( 'mouseleave', function() {
629
+ subMenuAnimation( $(this).children('.wpr-sub-menu, .wpr-sub-mega-menu'), false );
630
+ });
631
+
632
+ subMenuDeep.on( 'mouseleave', function() {
633
+ subMenuAnimation( $(this).children('.wpr-sub-menu'), false );
634
+ });
635
+ }
636
+
637
+ // Mobile Menu
638
+ var mobileMenu = $mobileNavMenu.find( '.wpr-mobile-nav-menu' );
639
+
640
+ // Toggle Button
641
+ $mobileNavMenu.find( '.wpr-mobile-toggle' ).on( 'click', function() {
642
+ // Change Toggle Text
643
+ if ( ! $(this).hasClass('wpr-mobile-toggle-open') ) {
644
+ $(this).addClass('wpr-mobile-toggle-open');
645
+
646
+ if ( $(this).find('.wpr-mobile-toggle-text').length ) {
647
+ $(this).children().eq(0).hide();
648
+ $(this).children().eq(1).show();
649
+ }
650
+ } else {
651
+