diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index 93bd9e6c6..6d97b0991 100755 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -330,7 +330,6 @@ textarea.eael-form-control { animation-iteration-count: infinite; animation-timing-function: linear; } -} @-webkit-keyframes rotate { from {-webkit-transform: rotate(0deg);} diff --git a/admin/assets/css/eael-notice.css b/admin/assets/css/eael-notice.css index d850fddfc..4c6b2b0d8 100755 --- a/admin/assets/css/eael-notice.css +++ b/admin/assets/css/eael-notice.css @@ -1,65 +1,98 @@ - /* review notice */ -.eael-review-notice { - padding: 10px; - background-color: #fff; - border-radius: 3px; - margin: 15px; - border-left: 4px solid transparent; - display: flex; - align-items: center; -} -.eael-review-notice:after{ - content: ''; - display: table; - clear: both; -} -.eael-review-thumbnail{ - width: 90px; - float: left; - padding: 5px; - text-align: center; - border-right: 4px solid transparent; -} -.eael-review-thumbnail img { - width: 72px; - opacity: .85; - transition: all .3s; -} -.eael-review-thumbnail img:hover { - opacity: 1; -} -.eael-review-text{ - overflow: hidden; -} -.eael-review-text h3{ - font-size: 24px; - margin: 0 0 5px; - font-weight: 400; - line-height: 1.3; -} -.eael-review-text p{ - font-size: 13px; - margin: 0 0 5px; -} -.eael-review-ul { - margin: 8px 0 0 0; - padding: 0; -} -.eael-review-ul li{ - display: inline-block; - margin-right: 15px; -} -.eael-review-ul li a{ - display: inline-block; - color: #10738B; - text-decoration: none; - padding-left: 26px; - position: relative; -} -.eael-review-ul li a span{ - position: absolute; - left: 0; - top: -2px; +.wpdeveloper-review-notice { + padding: 10px; + background-color: #fff; + border-radius: 3px; + margin: 15px; + border-left: 4px solid transparent; + display: flex; + align-items: center; +} + +.wpdeveloper-review-notice:after { + content: ''; + display: table; + clear: both; +} + +.wpdeveloper-notice-thumbnail { + width: 90px; + float: left; + padding: 5px; + text-align: center; + border-right: 4px solid transparent; +} + +.wpdeveloper-notice-thumbnail img { + width: 72px; + opacity: .85; + transition: all .3s; +} + +.wpdeveloper-notice-thumbnail img:hover { + opacity: 1; +} + +.eael-review-text { + overflow: hidden; +} + +.eael-review-text h3 { + font-size: 24px; + margin: 0 0 5px; + font-weight: 400; + line-height: 1.3; +} + +.eael-review-text p { + font-size: 13px; + margin: 0 0 5px; +} + +.wpdeveloper-notice-link { + margin: 8px 0 0 0; + padding: 0; +} + +.wpdeveloper-notice-link li { + display: inline-block; + margin-right: 15px; +} + +.wpdeveloper-notice-link li a { + display: inline-block; + color: #10738B; + text-decoration: none; + padding-left: 26px; + position: relative; +} + +.wpdeveloper-notice-link li a span { + position: absolute; + left: 0; + top: -2px; +} + +.wpdeveloper-upsale-notice .wpdeveloper-notice-message { + display: flex; + align-items: center; + padding: 10px 0; +} +.wpdeveloper-upsale-notice .wpdeveloper-notice-message + .notice-dismiss { + top: 18px; +} +.wpdeveloper-upsale-notice #plugin-install-core { + margin-left: 10px; +} +.notice.notice-has-thumbnail { + padding-left: 0px; +} + +.wpdeveloper-upsale-notice { + display: flex; +} +.wpdeveloper-upsale-notice .wpdeveloper-notice-thumbnail { + padding: 0; + width: 80px; } \ No newline at end of file diff --git a/admin/assets/images/icon-extensions.svg b/admin/assets/images/icon-extensions.svg new file mode 100755 index 000000000..f9636e3c8 --- /dev/null +++ b/admin/assets/images/icon-extensions.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/admin/assets/images/wpsp-logo.svg b/admin/assets/images/wpsp-logo.svg new file mode 100755 index 000000000..b13d41d62 --- /dev/null +++ b/admin/assets/images/wpsp-logo.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/partials/elements.php b/admin/partials/elements.php index ce5ad1401..dc3a6d458 100755 --- a/admin/partials/elements.php +++ b/admin/partials/elements.php @@ -346,6 +346,27 @@

+
+ + +

+ +

+
+
+ + +

+ +

+
+
+ + +

+ +

+
diff --git a/admin/partials/extensions.php b/admin/partials/extensions.php new file mode 100755 index 000000000..e199cb71d --- /dev/null +++ b/admin/partials/extensions.php @@ -0,0 +1,32 @@ +
+
+
+ +

Available Extensions

+
+ +
+ eael_get_settings['section-particles'], true ); ?> > + +

+
+ +
+

Premium Extensions

+
+ +
+ + +

+
+ +
+ + +
+ +
+
+
+
\ No newline at end of file diff --git a/admin/settings.php b/admin/settings.php index 2bd1d5221..dadf44230 100755 --- a/admin/settings.php +++ b/admin/settings.php @@ -14,7 +14,7 @@ class Eael_Admin_Settings { * @var array * @since 2.3.0 */ - public $eael_default_keys = [ 'contact-form-7', 'count-down', 'creative-btn', 'fancy-text', 'img-comparison', 'instagram-gallery', 'interactive-promo', 'lightbox', 'post-block', 'post-grid', 'post-timeline', 'product-grid', 'team-members', 'testimonial-slider', 'testimonials', 'testimonials', 'weforms', 'static-product', 'call-to-action', 'flip-box', 'info-box', 'dual-header', 'price-table', 'flip-carousel', 'interactive-cards', 'ninja-form', 'gravity-form', 'caldera-form', 'wpforms', 'wisdom_registered_setting', 'twitter-feed', 'facebook-feed', 'twitter-feed-carousel', 'facebook-feed-carousel', 'data-table', 'filter-gallery', 'dynamic-filter-gallery', 'image-accordion', 'content-ticker', 'tooltip', 'adv-accordion', 'adv-tabs', 'progress-bar' ]; + public $eael_default_keys = [ 'contact-form-7', 'count-down', 'creative-btn', 'fancy-text', 'interactive-promo', 'post-grid', 'post-block', 'post-timeline', 'product-grid', 'team-members', 'testimonials', 'weforms', 'call-to-action', 'flip-box', 'info-box', 'dual-header', 'price-table','ninja-form', 'gravity-form', 'caldera-form', 'wpforms', 'twitter-feed', 'facebook-feed', 'data-table', 'filter-gallery', 'image-accordion', 'content-ticker', 'tooltip', 'adv-accordion', 'adv-tabs', 'progress-bar', 'section-particles']; /** * Will Contain All Components Default Values @@ -169,12 +169,14 @@ public function eael_admin_settings_page() { diff --git a/assets/css/essential-addons-elementor.css b/assets/css/essential-addons-elementor.css old mode 100755 new mode 100644 index de6a27f27..83270e970 --- a/assets/css/essential-addons-elementor.css +++ b/assets/css/essential-addons-elementor.css @@ -1337,310 +1337,383 @@ span.eael-testimonial-quote { text-align: right; } -/*-------------------------*/ +/*--------------------------*/ /* 09. Product Styles -/* ------------------------*/ -.eael-product-carousel .woocommerce li.product { - background-color: #fff; +/*--------------------------*/ +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product { + position: relative; + float: left; + overflow: hidden; + text-align: center; + padding: 0; -webkit-border-radius: 0; border-radius: 0; + background-color: #fff; -webkit-box-shadow: none; box-shadow: none; } - -.hide_rating .woocommerce .star-rating-container, -.hide_rating .woocommerce .star-rating { - display: none !important; -} - -.eael-product-carousel .woocommerce ul.products li.product h3 { - padding: 0.5em; -} - -.eael-product-carousel .woocommerce .products .star-rating { - display: block; - float: none; - margin: 10px auto; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product a, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product a, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product a, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product a { + text-decoration: none; } - -body:not(.x-ethos):not(.x-integrity):not(.x-renew):not(.x-icon) .eael-product-carousel .woocommerce li.product .button { +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product a:hover, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product a:hover, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product a:hover, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product a:hover { + outline: none; -webkit-box-shadow: none; box-shadow: none; - display: block; - left: auto; - margin: 15px; - padding: 0.45em 0.5em 0.575em; - position: relative; - right: auto; - text-shadow: none; - top: auto; } - -/*--- Product Simple and Reveal Style ---*/ -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-featured { - background-color: transparent; - border: medium none; - -webkit-box-shadow: none; - box-shadow: none; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product img, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product img, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product img, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product img { + width: 100%; + height: auto; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .woocommerce-loop-product__title, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .woocommerce-loop-product__title, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .woocommerce-loop-product__title, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .woocommerce-loop-product__title { + font-size: 16px; + font-weight: 700; + line-height: 1; + color: #333; + margin: 25px 0 12px; padding: 0; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-wrap, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap { - background-color: transparent; - bottom: auto; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .onsale, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .onsale, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .onsale, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .onsale { + display: block; + line-height: 170px; + font-size: 13px; + text-align: center; + letter-spacing: 0; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); + text-transform: uppercase; + color: #fff; + background-color: #ff2a13; + -webkit-border-radius: 0; + border-radius: 0; + border: none; -webkit-box-shadow: none; box-shadow: none; - padding: 15px 0 0; - position: relative; - text-align: center; - top: auto; + position: absolute; + height: 100px; + width: 200px; + z-index: 1; + left: -100px; + top: -50px; + right: auto; + margin: 0; + padding: 0; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + transform: rotate(-45deg); } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header h3, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header h3 { +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .price, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .price, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .price, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .price { font-size: 14px; - line-height: 1.2; - margin: 0 0 5px; - padding-bottom: 0.5em; + margin-bottom: 0; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header h3 a, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header h3 a { - color: #272727; - font-weight: normal; - letter-spacing: 0.01rem; - text-transform: uppercase; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .price del, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .price del, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .price del, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .price del { + opacity: 0.5; + display: inline-block; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .price > .amount, -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header .price > .amount, -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header .price > ins > .amount, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header .price > .amount, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header .price > ins > .amount { - color: #272727; - font-size: 18px; - font-weight: normal; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .price ins, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .price ins, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .price ins, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .price ins { + font-weight: 400; + background-color: transparent; + color: #ff2a13; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-wrap::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap::before { - display: none; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .star-rating, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .star-rating, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .star-rating, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .star-rating { + display: block; + float: none; + font-size: 14px; + margin: 10px auto; } - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-header .button { - background-color: transparent; - border: 1px solid rgba(0, 0, 0, 0.5); +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .button.add_to_cart_button, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .button.add_to_cart_button, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button { + display: inline-block; + height: 40px; + font-size: 14px; + font-weight: 400; + line-height: 40px; + text-align: center; + text-transform: uppercase; + color: #fff; + background-color: #333; + padding: 0 30px; + margin: 15px 0; -webkit-border-radius: 0; border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; - color: #272727; +} +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product .button.add_to_cart_button:focus, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button:focus, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product .button.add_to_cart_button:focus, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button:focus { + outline: none; +} +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product a.added_to_cart, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product a.added_to_cart, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product a.added_to_cart, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product a.added_to_cart { display: block; + margin: 0 0 15px 0; + padding: 0; font-size: 14px; - left: auto; - margin: 20px auto; - opacity: 1; - position: relative; - right: auto; - text-shadow: none; - top: auto; - width: 80%; + line-height: 1; + text-transform: capitalize; + color: #333; + background-color: transparent; } - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-header .button:hover { - background-color: #e74c3c; - border: 1px solid #e74c3c; - color: #fff; +.eael-product-grid.eael-product-simple .woocommerce ul.products li.product, +.eael-post-grid.eael-product-simple .woocommerce ul.products li.product { + border: 1px solid #eee; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container { - background-color: transparent; - left: auto; - opacity: 1; - position: relative; - right: auto; - top: 5px; - display: block; - margin: 0 auto; - width: 110px; +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product { + border: 1px solid transparent; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container .star-rating::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container .star-rating::before { - color: #f2b01e; +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button, +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product a.added_to_cart, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product .button.add_to_cart_button, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product a.added_to_cart { + visibility: hidden; + -webkit-transition: none; + -o-transition: none; + transition: none; } - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container .star-rating span::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container .star-rating span::before { - color: #f2b01e; +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product:hover, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product:hover { + border: 1px solid #eee; } - -.eael-product-carousel:not(.eael-product-no-style) .onsale { +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product:hover .button.add_to_cart_button, +.eael-product-grid.eael-product-reveal .woocommerce ul.products li.product:hover a.added_to_cart, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product:hover .button.add_to_cart_button, +.eael-post-grid.eael-product-reveal .woocommerce ul.products li.product:hover a.added_to_cart { + visibility: visible; +} +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product { + position: relative; + float: left; + overflow: hidden; + text-align: center; + padding: 0 0 15px 0; -webkit-border-radius: 0; border-radius: 0; + background-color: #fff; -webkit-box-shadow: none; box-shadow: none; - display: block; - font-size: 14px; - height: 100px; - letter-spacing: 0; - line-height: 160px; - position: absolute; - text-align: center; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); - text-transform: uppercase; - -webkit-transform: rotate(-45deg); - -ms-transform: rotate(-45deg); - transform: rotate(-45deg); - width: 200px; - z-index: 1; } - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .onsale { - left: -95px; - top: -45px; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product a, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product a { + text-decoration: none; } - -.eael-product-carousel .woocommerce ul.products { - margin: 0 0 30px; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product a:hover, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product a:hover { + outline: none; + -webkit-box-shadow: none; + box-shadow: none; } - -/*--- Product Simple and Reveal Style ---*/ -.eael-product-carousel .woocommerce li.product { - background-color: #fff; - float: left; - overflow: hidden; - padding: 0; - position: relative; - text-align: center; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product img, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product img { + width: 100%; + height: auto; + margin: 0; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } - -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap { - bottom: -63px; - margin-top: -63px; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay { position: relative; - top: auto; - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - -o-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .entry-wrap { - bottom: 0; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .entry-wrap::before { - background-color: #fff; - display: block; + overflow: hidden; + line-height: 0; } - -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container { - background-color: rgba(255, 255, 255, 0.9); - left: auto; - opacity: 0; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .button-wrap, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .button-wrap { position: absolute; - right: 10px; - top: 10px; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .star-rating-container { - opacity: 1; -} - -/*--- Product Reveal Styles ---*/ -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap { - bottom: auto; - font-size: 14px; + top: 50%; left: 0; - padding: 0; - position: absolute; right: 0; - top: calc(100% - 4em); - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - -o-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; + text-align: center; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap { - background-color: rgba(0, 0, 0, 0.5); - bottom: auto; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link, +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button, +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart { + display: inline-block; font-size: 14px; - left: 0; - padding: 0; - position: absolute; - right: 0; + line-height: 38px; text-align: center; - top: calc(100% - 4em); - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - -o-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; + color: #fff; + background-color: #333; + width: 38px; + height: 38px; + border-style: none; + -webkit-border-radius: 50%; + border-radius: 50%; + vertical-align: middle; + padding: 0; + margin: 0 5px; + -webkit-transform: translateY(20px); + -ms-transform: translateY(20px); + transform: translateY(20px); + opacity: 0; + -webkit-transition: opacity 300ms, -webkit-transform 200ms; + transition: opacity 300ms, -webkit-transform 200ms; + -o-transition: transform 200ms, opacity 300ms; + transition: transform 200ms, opacity 300ms; + transition: transform 200ms, opacity 300ms, -webkit-transform 200ms; +} +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link:focus, +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:focus, +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:focus, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link:focus, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:focus, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:focus { + outline: none; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.5); - content: ""; - display: block; - height: 50em; - left: 0; - position: absolute; - right: 0; - top: 0; - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - -o-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - z-index: 0; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button { + font-size: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.75); +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:before, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:before { + display: none; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header { - position: relative; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:after, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button:after { + content: '\f217'; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + line-height: 38px; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + vertical-align: middle; + margin: 0; + padding: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header h3 { +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button.loading:before, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button.loading:before { + display: none; +} +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button.loading:after, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .add_to_cart_button.loading:after { + content: '\f110'; + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; font-size: 14px; - line-height: 1; + line-height: 38px; + color: #fff; + height: auto; + width: auto; + position: relative; + top: 0; + left: 0; margin: 0; - overflow: hidden; - padding: 1.5em; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - text-transform: uppercase; - white-space: nowrap; + padding: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header h3 a { +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart { + font-size: 0; +} +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:after, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:after { + content: '\f06e'; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + line-height: 38px; color: #fff; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + vertical-align: middle; + margin: 0; + padding: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .price > del, -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header .price > del { - display: none; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .woocommerce-loop-product__title, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .woocommerce-loop-product__title { + font-size: 16px; + font-weight: 700; + line-height: 1; + color: #333; + margin: 25px 0 12px; + padding: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header .price > .amount, -.woocommerce li.product .entry-header .price > ins > .amount { +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .onsale, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .onsale { + display: block; + line-height: 170px; + font-size: 13px; + text-align: center; + letter-spacing: 0; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); + text-transform: uppercase; color: #fff; - font-size: 24px; + background-color: #ff2a13; + -webkit-border-radius: 0; + border-radius: 0; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + position: absolute; + height: 100px; + width: 200px; + z-index: 1; + left: -100px; + top: -50px; + right: auto; + margin: 0; + padding: 0; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + transform: rotate(-45deg); } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .added_to_cart { - display: none; +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .price, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .price { + font-size: 14px; + margin-bottom: 0; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap { - top: calc(100% - 10.385em); +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .price del, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .price del { + opacity: 0.5; + display: inline-block; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.75); +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .price ins, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .price ins { + font-weight: 400; + background-color: transparent; + color: #ff2a13; } - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .star-rating-container { +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .star-rating, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product .star-rating { + display: block; + float: none; + font-size: 14px; + margin: 10px auto; +} +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product:hover .overlay a, +.eael-product-grid.eael-product-overlay .woocommerce ul.products li.product:hover .overlay .add_to_cart_button, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product:hover .overlay a, +.eael-post-grid.eael-product-overlay .woocommerce ul.products li.product:hover .overlay .add_to_cart_button { opacity: 1; + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); } /*--------------------------------*/ @@ -7371,3 +7444,6 @@ a.eael-gallery-load-more, a.eael-gallery-load-more:hover { transform: none; } } +.elementor-section .elementor-container { + z-index: 99; +} diff --git a/assets/js/eael-scripts.js b/assets/js/eael-scripts.js index 2d43fb4c4..9263bb840 100755 --- a/assets/js/eael-scripts.js +++ b/assets/js/eael-scripts.js @@ -644,8 +644,205 @@ } var ProgressBar = function ($scope, $) { - jQuery('.eael-progressbar', $scope).eaelProgressBar() - } + + var $progressBar = $scope.find('.eael-progress-bar-container').eq(0), + $layout = mybe_note_undefined($progressBar, "layout"), + $id = mybe_note_undefined($progressBar, "id"), + $number = mybe_note_undefined($progressBar, "number"), + $class = '.elementor-element-' + $scope.data('id'), + $line_stroke_color = mybe_note_undefined($progressBar, "line-stroke-color"), + $line_stroke_width = mybe_note_undefined($progressBar, "line-stroke-width"), + $line_stroke_trail_color = mybe_note_undefined($progressBar, "line-stroke-trail-color"), + $line_stroke_trail_width = mybe_note_undefined($progressBar, "line-stroke-trail-width"), + $line_direction = mybe_note_undefined($progressBar, "line-direction"), + + $fan_stroke_color = mybe_note_undefined($progressBar, "fan-stroke-color"), + $fan_stroke_width = mybe_note_undefined($progressBar, "fan-stroke-width"), + $fan_stroke_trail_color = mybe_note_undefined($progressBar, "fan-stroke-trail-color"), + $fan_stroke_trail_width = mybe_note_undefined($progressBar, "fan-stroke-trail-width"), + $fan_direction = mybe_note_undefined($progressBar, "fan-direction"), + + $circle_stroke_color = mybe_note_undefined($progressBar, "circle-stroke-color"), + $circle_stroke_width = mybe_note_undefined($progressBar, "circle-stroke-width"), + $circle_stroke_trail_color = mybe_note_undefined($progressBar, "circle-stroke-trail-color"), + $circle_stroke_trail_width = mybe_note_undefined($progressBar, "circle-stroke-trail-width"), + $circle_direction = mybe_note_undefined($progressBar, "circle-direction"), + + $bubble_circle_color = mybe_note_undefined($progressBar, "bubble-circle-color"), + $bubble_bg_color = mybe_note_undefined($progressBar, "bubble-bg-color"), + $bubble_circle_width = mybe_note_undefined($progressBar, "bubble-circle-width"), + $bubble_direction = mybe_note_undefined($progressBar, "bubble-direction"), + + $rainbow_stroke_width = mybe_note_undefined($progressBar, "rainbow-stroke-width"), + $rainbow_stroke_trail_width = mybe_note_undefined($progressBar, "rainbow-stroke-trail-width"), + $rainbow_color_one = mybe_note_undefined($progressBar, "rainbow-color-one"), + $rainbow_color_two = mybe_note_undefined($progressBar, "rainbow-color-two"), + $rainbow_color_three = mybe_note_undefined($progressBar, "rainbow-color-three"), + $rainbow_color_four = mybe_note_undefined($progressBar, "rainbow-color-four"), + $rainbow_color_five = mybe_note_undefined($progressBar, "rainbow-color-five"), + $rainbow_direction = mybe_note_undefined($progressBar, "rainbow-direction"); + + + if('rainbow' == $layout){ + var bar = new ldBar($class + ' .inside-progressbar', { + "type": 'stroke', + "path": 'M0 10L100 10', + "stroke": 'data:ldbar/res,gradient(0,1,'+ $rainbow_color_one +','+ $rainbow_color_two +','+ $rainbow_color_three +','+ $rainbow_color_four +','+ $rainbow_color_five +')', + "aspect-ratio": 'none', + "stroke-width": $rainbow_stroke_width, + "stroke-trail-width": $rainbow_stroke_trail_width, + "stroke-dir": $rainbow_direction + }).set($number); + } + else if('line' == $layout){ + var bar = new ldBar($class + ' .inside-progressbar', { + "type": 'stroke', + "path": 'M0 10L100 10', + "stroke": $line_stroke_color, + "stroke-width": $line_stroke_width, + "stroke-trail": $line_stroke_trail_color, + "stroke-trail-width": $line_stroke_trail_width, + "aspect-ratio": 'none', + "stroke-dir": $line_direction + }).set($number); + } + else if('fan' == $layout){ + var bar = new ldBar($class + ' .inside-progressbar', { + "type": 'stroke', + "path": 'M10 90A40 40 0 0 1 90 90', + "fill-dir": $fan_direction, + "fill": $fan_stroke_color, + "fill-background": $fan_stroke_trail_color, + "fill-background-extrude": $fan_stroke_width, + "stroke-dir": 'normal', + "stroke": $fan_stroke_color, + "stroke-width": $fan_stroke_width, + "stroke-trail": $fan_stroke_trail_color, + "stroke-trail-width": $fan_stroke_trail_width + }).set($number); + } + else if('circle' == $layout){ + var bar = new ldBar($class + ' .inside-progressbar', { + "type": 'stroke', + "path": 'M50 10A40 40 0 0 1 50 90A40 40 0 0 1 50 10', + "fill-dir": $circle_direction, + "fill": $circle_stroke_color, + "fill-background": $circle_stroke_trail_color, + "fill-background-extrude": $circle_stroke_width, + "stroke-dir": 'normal', + "stroke": $circle_stroke_color, + "stroke-width": $circle_stroke_width, + "stroke-trail": $circle_stroke_trail_color, + "stroke-trail-width": $circle_stroke_trail_width + }).set($number); + } + else if('bubble' == $layout){ + var bar = new ldBar($class + ' .inside-progressbar', { + "type": 'fill', + "path": 'M50 10A40 40 0 0 1 50 90A40 40 0 0 1 50 10', + "fill-dir": $bubble_direction, + "fill": 'data:ldbar/res,bubble('+ $bubble_bg_color +','+ $bubble_circle_color +')', + "pattern-size": $bubble_circle_width, + "fill-background": '#ddd', + "fill-background-extrude": 2, + "stroke-dir": 'normal', + "stroke": '#25b', + "stroke-width": '3', + "stroke-trail": '#ddd', + "stroke-trail-width": 0.5 + }).set($number); + } + }; + + /*=================================*/ + /* 36. Section Particles + /*=================================*/ + var EaelParticlesHandler = function($scope,$){ + var target = $scope, + sectionId = target.data('id'), + editMode = elementorFrontend.isEditMode(), + settings; + + + if ( editMode ) { + settings = generateEditorSettings( sectionId ); + } + + if (!editMode || ! settings ) { + return false; + } + + if(settings.switch == 'yes') { + target.addClass('eael-particles-section'); + if(settings.themeSource === 'presets' || settings.themeSource === 'custom' && '' !== settings.selected_theme) { + generateParticles(); + } + } else { + target.removeClass('eael-particles-section'); + } + + + function generateEditorSettings(targetId){ + var editorElements = null, + sectionData = {}, + settings = {}; + + if ( ! window.elementor.hasOwnProperty( 'elements' ) ) { + return false; + } + + editorElements = window.elementor.elements; + + if ( ! editorElements.models ) { + return false; + } + + $.each(editorElements.models,function(index,elem){ + if( targetId == elem.id){ + sectionData = elem.attributes.settings.attributes; + + } else if( elem.id == target.closest( '.elementor-top-section' ).data( 'id' ) ) { + $.each(elem.attributes.elements.models,function(index,col){ + $.each(col.attributes.elements.models,function(index,subSec){ + sectionData = subSec.attributes.settings.attributes; + }); + }); + } + }); + + settings.switch = sectionData[ 'eael_particle_switch' ]; + settings.zIndex = sectionData[ 'eael_particles_zindex' ]; + settings.themeSource = sectionData['eael_particle_theme_from']; + + + if(settings.themeSource == 'presets') { + settings.selected_theme = (ParticleThemesData[sectionData[ 'eael_particle_preset_themes' ]]); + } + + if( (settings.themeSource == 'custom') && ('' !== sectionData[ 'eael_particles_custom_style' ]) ){ + settings.selected_theme = sectionData[ 'eael_particles_custom_style' ]; + } + + if ( 0 !== settings.length ) { + return settings; + } + + return false; + } + + function generateParticles(){ + target.attr('id','eael-section-particles-'+ sectionId); + if(typeof particlesJS !== 'undefined' && $.isFunction(particlesJS)) { + particlesJS("eael-section-particles-" + sectionId, JSON.parse(settings.selected_theme)); + target.children('canvas.particles-js-canvas-el').css({ + zIndex: settings.zIndex, + position: 'absolute', + top:0 + }); + } + } + + }; $(window).on('elementor/frontend/init', function () { if(elementorFrontend.isEditMode()) { @@ -665,6 +862,7 @@ elementorFrontend.hooks.addAction('frontend/element_ready/eael-image-accordion.default', ImageAccordion); elementorFrontend.hooks.addAction('frontend/element_ready/eael-countdown.default', CountDown); elementorFrontend.hooks.addAction('frontend/element_ready/eael-progress-bar.default', ProgressBar); + elementorFrontend.hooks.addAction( 'frontend/element_ready/section', EaelParticlesHandler ); }); }(jQuery)); \ No newline at end of file diff --git a/assets/js/particles.js b/assets/js/particles.js new file mode 100755 index 000000000..c73969351 --- /dev/null +++ b/assets/js/particles.js @@ -0,0 +1,5 @@ +/* +/* Author : Vincent Garreau - vincentgarreau.com +/* MIT license: http://opensource.org/licenses/MIT +*/ +function hexToRgb(e){var a=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function clamp(e,a,t){return Math.min(Math.max(e,a),t)}function isInArray(e,a){return a.indexOf(e)>-1}var pJS=function(e,a){var t=document.querySelector("#"+e+" > .particles-js-canvas-el");this.pJS={canvas:{el:t,w:t.offsetWidth,h:t.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var i=this.pJS;a&&Object.deepExtend(i,a),i.tmp.obj={size_value:i.particles.size.value,size_anim_speed:i.particles.size.anim.speed,move_speed:i.particles.move.speed,line_linked_distance:i.particles.line_linked.distance,line_linked_width:i.particles.line_linked.width,mode_grab_distance:i.interactivity.modes.grab.distance,mode_bubble_distance:i.interactivity.modes.bubble.distance,mode_bubble_size:i.interactivity.modes.bubble.size,mode_repulse_distance:i.interactivity.modes.repulse.distance},i.fn.retinaInit=function(){i.retina_detect&&window.devicePixelRatio>1?(i.canvas.pxratio=window.devicePixelRatio,i.tmp.retina=!0):(i.canvas.pxratio=1,i.tmp.retina=!1),i.canvas.w=i.canvas.el.offsetWidth*i.canvas.pxratio,i.canvas.h=i.canvas.el.offsetHeight*i.canvas.pxratio,i.particles.size.value=i.tmp.obj.size_value*i.canvas.pxratio,i.particles.size.anim.speed=i.tmp.obj.size_anim_speed*i.canvas.pxratio,i.particles.move.speed=i.tmp.obj.move_speed*i.canvas.pxratio,i.particles.line_linked.distance=i.tmp.obj.line_linked_distance*i.canvas.pxratio,i.interactivity.modes.grab.distance=i.tmp.obj.mode_grab_distance*i.canvas.pxratio,i.interactivity.modes.bubble.distance=i.tmp.obj.mode_bubble_distance*i.canvas.pxratio,i.particles.line_linked.width=i.tmp.obj.line_linked_width*i.canvas.pxratio,i.interactivity.modes.bubble.size=i.tmp.obj.mode_bubble_size*i.canvas.pxratio,i.interactivity.modes.repulse.distance=i.tmp.obj.mode_repulse_distance*i.canvas.pxratio},i.fn.canvasInit=function(){i.canvas.ctx=i.canvas.el.getContext("2d")},i.fn.canvasSize=function(){i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i&&i.interactivity.events.resize&&window.addEventListener("resize",function(){i.canvas.w=i.canvas.el.offsetWidth,i.canvas.h=i.canvas.el.offsetHeight,i.tmp.retina&&(i.canvas.w*=i.canvas.pxratio,i.canvas.h*=i.canvas.pxratio),i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i.particles.move.enable||(i.fn.particlesEmpty(),i.fn.particlesCreate(),i.fn.particlesDraw(),i.fn.vendors.densityAutoParticles()),i.fn.vendors.densityAutoParticles()})},i.fn.canvasPaint=function(){i.canvas.ctx.fillRect(0,0,i.canvas.w,i.canvas.h)},i.fn.canvasClear=function(){i.canvas.ctx.clearRect(0,0,i.canvas.w,i.canvas.h)},i.fn.particle=function(e,a,t){if(this.radius=(i.particles.size.random?Math.random():1)*i.particles.size.value,i.particles.size.anim.enable&&(this.size_status=!1,this.vs=i.particles.size.anim.speed/100,i.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=t?t.x:Math.random()*i.canvas.w,this.y=t?t.y:Math.random()*i.canvas.h,this.x>i.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>i.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),i.particles.move.bounce&&i.fn.vendors.checkOverlap(this,t),this.color={},"object"==typeof e.value)if(e.value instanceof Array){var s=e.value[Math.floor(Math.random()*i.particles.color.value.length)];this.color.rgb=hexToRgb(s)}else void 0!=e.value.r&&void 0!=e.value.g&&void 0!=e.value.b&&(this.color.rgb={r:e.value.r,g:e.value.g,b:e.value.b}),void 0!=e.value.h&&void 0!=e.value.s&&void 0!=e.value.l&&(this.color.hsl={h:e.value.h,s:e.value.s,l:e.value.l});else"random"==e.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof e.value&&(this.color=e,this.color.rgb=hexToRgb(this.color.value));this.opacity=(i.particles.opacity.random?Math.random():1)*i.particles.opacity.value,i.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=i.particles.opacity.anim.speed/100,i.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var n={};switch(i.particles.move.direction){case"top":n={x:0,y:-1};break;case"top-right":n={x:.5,y:-.5};break;case"right":n={x:1,y:-0};break;case"bottom-right":n={x:.5,y:.5};break;case"bottom":n={x:0,y:1};break;case"bottom-left":n={x:-.5,y:1};break;case"left":n={x:-1,y:0};break;case"top-left":n={x:-.5,y:-.5};break;default:n={x:0,y:0}}i.particles.move.straight?(this.vx=n.x,this.vy=n.y,i.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=n.x+Math.random()-.5,this.vy=n.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var r=i.particles.shape.type;if("object"==typeof r){if(r instanceof Array){var c=r[Math.floor(Math.random()*r.length)];this.shape=c}}else this.shape=r;if("image"==this.shape){var o=i.particles.shape;this.img={src:o.image.src,ratio:o.image.width/o.image.height},this.img.ratio||(this.img.ratio=1),"svg"==i.tmp.img_type&&void 0!=i.tmp.source_svg&&(i.fn.vendors.createSvgImg(this),i.tmp.pushing&&(this.img.loaded=!1))}},i.fn.particle.prototype.draw=function(){function e(){i.canvas.ctx.drawImage(r,a.x-t,a.y-t,2*t,2*t/a.img.ratio)}var a=this;if(void 0!=a.radius_bubble)var t=a.radius_bubble;else var t=a.radius;if(void 0!=a.opacity_bubble)var s=a.opacity_bubble;else var s=a.opacity;if(a.color.rgb)var n="rgba("+a.color.rgb.r+","+a.color.rgb.g+","+a.color.rgb.b+","+s+")";else var n="hsla("+a.color.hsl.h+","+a.color.hsl.s+"%,"+a.color.hsl.l+"%,"+s+")";switch(i.canvas.ctx.fillStyle=n,i.canvas.ctx.beginPath(),a.shape){case"circle":i.canvas.ctx.arc(a.x,a.y,t,0,2*Math.PI,!1);break;case"edge":i.canvas.ctx.rect(a.x-t,a.y-t,2*t,2*t);break;case"triangle":i.fn.vendors.drawShape(i.canvas.ctx,a.x-t,a.y+t/1.66,2*t,3,2);break;case"polygon":i.fn.vendors.drawShape(i.canvas.ctx,a.x-t/(i.particles.shape.polygon.nb_sides/3.5),a.y-t/.76,2.66*t/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,1);break;case"star":i.fn.vendors.drawShape(i.canvas.ctx,a.x-2*t/(i.particles.shape.polygon.nb_sides/4),a.y-t/1.52,2*t*2.66/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==i.tmp.img_type)var r=a.img.obj;else var r=i.tmp.img_obj;r&&e()}i.canvas.ctx.closePath(),i.particles.shape.stroke.width>0&&(i.canvas.ctx.strokeStyle=i.particles.shape.stroke.color,i.canvas.ctx.lineWidth=i.particles.shape.stroke.width,i.canvas.ctx.stroke()),i.canvas.ctx.fill()},i.fn.particlesCreate=function(){for(var e=0;e=i.particles.opacity.value&&(a.opacity_status=!1),a.opacity+=a.vo):(a.opacity<=i.particles.opacity.anim.opacity_min&&(a.opacity_status=!0),a.opacity-=a.vo),a.opacity<0&&(a.opacity=0)),i.particles.size.anim.enable&&(1==a.size_status?(a.radius>=i.particles.size.value&&(a.size_status=!1),a.radius+=a.vs):(a.radius<=i.particles.size.anim.size_min&&(a.size_status=!0),a.radius-=a.vs),a.radius<0&&(a.radius=0)),"bounce"==i.particles.move.out_mode)var s={x_left:a.radius,x_right:i.canvas.w,y_top:a.radius,y_bottom:i.canvas.h};else var s={x_left:-a.radius,x_right:i.canvas.w+a.radius,y_top:-a.radius,y_bottom:i.canvas.h+a.radius};switch(a.x-a.radius>i.canvas.w?(a.x=s.x_left,a.y=Math.random()*i.canvas.h):a.x+a.radius<0&&(a.x=s.x_right,a.y=Math.random()*i.canvas.h),a.y-a.radius>i.canvas.h?(a.y=s.y_top,a.x=Math.random()*i.canvas.w):a.y+a.radius<0&&(a.y=s.y_bottom,a.x=Math.random()*i.canvas.w),i.particles.move.out_mode){case"bounce":a.x+a.radius>i.canvas.w?a.vx=-a.vx:a.x-a.radius<0&&(a.vx=-a.vx),a.y+a.radius>i.canvas.h?a.vy=-a.vy:a.y-a.radius<0&&(a.vy=-a.vy)}if(isInArray("grab",i.interactivity.events.onhover.mode)&&i.fn.modes.grabParticle(a),(isInArray("bubble",i.interactivity.events.onhover.mode)||isInArray("bubble",i.interactivity.events.onclick.mode))&&i.fn.modes.bubbleParticle(a),(isInArray("repulse",i.interactivity.events.onhover.mode)||isInArray("repulse",i.interactivity.events.onclick.mode))&&i.fn.modes.repulseParticle(a),i.particles.line_linked.enable||i.particles.move.attract.enable)for(var n=e+1;n0){var c=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+r+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(a.x,a.y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}},i.fn.interact.attractParticles=function(e,a){var t=e.x-a.x,s=e.y-a.y,n=Math.sqrt(t*t+s*s);if(n<=i.particles.line_linked.distance){var r=t/(1e3*i.particles.move.attract.rotateX),c=s/(1e3*i.particles.move.attract.rotateY);e.vx-=r,e.vy-=c,a.vx+=r,a.vy+=c}},i.fn.interact.bounceParticles=function(e,a){var t=e.x-a.x,i=e.y-a.y,s=Math.sqrt(t*t+i*i),n=e.radius+a.radius;n>=s&&(e.vx=-e.vx,e.vy=-e.vy,a.vx=-a.vx,a.vy=-a.vy)},i.fn.modes.pushParticles=function(e,a){i.tmp.pushing=!0;for(var t=0;e>t;t++)i.particles.array.push(new i.fn.particle(i.particles.color,i.particles.opacity.value,{x:a?a.pos_x:Math.random()*i.canvas.w,y:a?a.pos_y:Math.random()*i.canvas.h})),t==e-1&&(i.particles.move.enable||i.fn.particlesDraw(),i.tmp.pushing=!1)},i.fn.modes.removeParticles=function(e){i.particles.array.splice(0,e),i.particles.move.enable||i.fn.particlesDraw()},i.fn.modes.bubbleParticle=function(e){function a(){e.opacity_bubble=e.opacity,e.radius_bubble=e.radius}function t(a,t,s,n,c){if(a!=t)if(i.tmp.bubble_duration_end){if(void 0!=s){var o=n-p*(n-a)/i.interactivity.modes.bubble.duration,l=a-o;d=a+l,"size"==c&&(e.radius_bubble=d),"opacity"==c&&(e.opacity_bubble=d)}}else if(r<=i.interactivity.modes.bubble.distance){if(void 0!=s)var v=s;else var v=n;if(v!=a){var d=n-p*(n-a)/i.interactivity.modes.bubble.duration;"size"==c&&(e.radius_bubble=d),"opacity"==c&&(e.opacity_bubble=d)}}else"size"==c&&(e.radius_bubble=void 0),"opacity"==c&&(e.opacity_bubble=void 0)}if(i.interactivity.events.onhover.enable&&isInArray("bubble",i.interactivity.events.onhover.mode)){var s=e.x-i.interactivity.mouse.pos_x,n=e.y-i.interactivity.mouse.pos_y,r=Math.sqrt(s*s+n*n),c=1-r/i.interactivity.modes.bubble.distance;if(r<=i.interactivity.modes.bubble.distance){if(c>=0&&"mousemove"==i.interactivity.status){if(i.interactivity.modes.bubble.size!=i.particles.size.value)if(i.interactivity.modes.bubble.size>i.particles.size.value){var o=e.radius+i.interactivity.modes.bubble.size*c;o>=0&&(e.radius_bubble=o)}else{var l=e.radius-i.interactivity.modes.bubble.size,o=e.radius-l*c;o>0?e.radius_bubble=o:e.radius_bubble=0}if(i.interactivity.modes.bubble.opacity!=i.particles.opacity.value)if(i.interactivity.modes.bubble.opacity>i.particles.opacity.value){var v=i.interactivity.modes.bubble.opacity*c;v>e.opacity&&v<=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=v)}else{var v=e.opacity-(i.particles.opacity.value-i.interactivity.modes.bubble.opacity)*c;v=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=v)}}}else a();"mouseleave"==i.interactivity.status&&a()}else if(i.interactivity.events.onclick.enable&&isInArray("bubble",i.interactivity.events.onclick.mode)){if(i.tmp.bubble_clicking){var s=e.x-i.interactivity.mouse.click_pos_x,n=e.y-i.interactivity.mouse.click_pos_y,r=Math.sqrt(s*s+n*n),p=((new Date).getTime()-i.interactivity.mouse.click_time)/1e3;p>i.interactivity.modes.bubble.duration&&(i.tmp.bubble_duration_end=!0),p>2*i.interactivity.modes.bubble.duration&&(i.tmp.bubble_clicking=!1,i.tmp.bubble_duration_end=!1)}i.tmp.bubble_clicking&&(t(i.interactivity.modes.bubble.size,i.particles.size.value,e.radius_bubble,e.radius,"size"),t(i.interactivity.modes.bubble.opacity,i.particles.opacity.value,e.opacity_bubble,e.opacity,"opacity"))}},i.fn.modes.repulseParticle=function(e){function a(){var a=Math.atan2(d,p);if(e.vx=u*Math.cos(a),e.vy=u*Math.sin(a),"bounce"==i.particles.move.out_mode){var t={x:e.x+e.vx,y:e.y+e.vy};t.x+e.radius>i.canvas.w?e.vx=-e.vx:t.x-e.radius<0&&(e.vx=-e.vx),t.y+e.radius>i.canvas.h?e.vy=-e.vy:t.y-e.radius<0&&(e.vy=-e.vy)}}if(i.interactivity.events.onhover.enable&&isInArray("repulse",i.interactivity.events.onhover.mode)&&"mousemove"==i.interactivity.status){var t=e.x-i.interactivity.mouse.pos_x,s=e.y-i.interactivity.mouse.pos_y,n=Math.sqrt(t*t+s*s),r={x:t/n,y:s/n},c=i.interactivity.modes.repulse.distance,o=100,l=clamp(1/c*(-1*Math.pow(n/c,2)+1)*c*o,0,50),v={x:e.x+r.x*l,y:e.y+r.y*l};"bounce"==i.particles.move.out_mode?(v.x-e.radius>0&&v.x+e.radius0&&v.y+e.radius=m&&a()}else 0==i.tmp.repulse_clicking&&(e.vx=e.vx_i,e.vy=e.vy_i)},i.fn.modes.grabParticle=function(e){if(i.interactivity.events.onhover.enable&&"mousemove"==i.interactivity.status){var a=e.x-i.interactivity.mouse.pos_x,t=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(a*a+t*t);if(s<=i.interactivity.modes.grab.distance){var n=i.interactivity.modes.grab.line_linked.opacity-s/(1/i.interactivity.modes.grab.line_linked.opacity)/i.interactivity.modes.grab.distance;if(n>0){var r=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+r.r+","+r.g+","+r.b+","+n+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x,i.interactivity.mouse.pos_y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}}},i.fn.vendors.eventsListeners=function(){"window"==i.interactivity.detect_on?i.interactivity.el=window:i.interactivity.el=i.canvas.el,(i.interactivity.events.onhover.enable||i.interactivity.events.onclick.enable)&&(i.interactivity.el.addEventListener("mousemove",function(e){if(i.interactivity.el==window)var a=e.clientX,t=e.clientY;else var a=e.offsetX||e.clientX,t=e.offsetY||e.clientY;i.interactivity.mouse.pos_x=a,i.interactivity.mouse.pos_y=t,i.tmp.retina&&(i.interactivity.mouse.pos_x*=i.canvas.pxratio,i.interactivity.mouse.pos_y*=i.canvas.pxratio),i.interactivity.status="mousemove"}),i.interactivity.el.addEventListener("mouseleave",function(e){i.interactivity.mouse.pos_x=null,i.interactivity.mouse.pos_y=null,i.interactivity.status="mouseleave"})),i.interactivity.events.onclick.enable&&i.interactivity.el.addEventListener("click",function(){if(i.interactivity.mouse.click_pos_x=i.interactivity.mouse.pos_x,i.interactivity.mouse.click_pos_y=i.interactivity.mouse.pos_y,i.interactivity.mouse.click_time=(new Date).getTime(),i.interactivity.events.onclick.enable)switch(i.interactivity.events.onclick.mode){case"push":i.particles.move.enable?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):1==i.interactivity.modes.push.particles_nb?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):i.interactivity.modes.push.particles_nb>1&&i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb);break;case"remove":i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);break;case"bubble":i.tmp.bubble_clicking=!0;break;case"repulse":i.tmp.repulse_clicking=!0,i.tmp.repulse_count=0,i.tmp.repulse_finish=!1,setTimeout(function(){i.tmp.repulse_clicking=!1},1e3*i.interactivity.modes.repulse.duration)}})},i.fn.vendors.densityAutoParticles=function(){if(i.particles.number.density.enable){var e=i.canvas.el.width*i.canvas.el.height/1e3;i.tmp.retina&&(e/=2*i.canvas.pxratio);var a=e*i.particles.number.value/i.particles.number.density.value_area,t=i.particles.array.length-a;0>t?i.fn.modes.pushParticles(Math.abs(t)):i.fn.modes.removeParticles(t)}},i.fn.vendors.checkOverlap=function(e,a){for(var t=0;tv;v++)e.lineTo(i,0),e.translate(i,0),e.rotate(l);e.fill(),e.restore()},i.fn.vendors.exportImg=function(){window.open(i.canvas.el.toDataURL("image/png"),"_blank")},i.fn.vendors.loadImg=function(e){if(i.tmp.img_error=void 0,""!=i.particles.shape.image.src)if("svg"==e){var a=new XMLHttpRequest;a.open("GET",i.particles.shape.image.src),a.onreadystatechange=function(e){4==a.readyState&&(200==a.status?(i.tmp.source_svg=e.currentTarget.response,i.fn.vendors.checkBeforeDraw()):(console.log("Error pJS - Image not found"),i.tmp.img_error=!0))},a.send()}else{var t=new Image;t.addEventListener("load",function(){i.tmp.img_obj=t,i.fn.vendors.checkBeforeDraw()}),t.src=i.particles.shape.image.src}else console.log("Error pJS - No image.src"),i.tmp.img_error=!0},i.fn.vendors.draw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type?i.tmp.count_svg>=i.particles.number.value?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):void 0!=i.tmp.img_obj?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame))},i.fn.vendors.checkBeforeDraw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type&&void 0==i.tmp.source_svg?i.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(i.tmp.checkAnimFrame),i.tmp.img_error||(i.fn.vendors.init(),i.fn.vendors.draw())):(i.fn.vendors.init(),i.fn.vendors.draw())},i.fn.vendors.init=function(){i.fn.retinaInit(),i.fn.canvasInit(),i.fn.canvasSize(),i.fn.canvasPaint(),i.fn.particlesCreate(),i.fn.vendors.densityAutoParticles(),i.particles.line_linked.color_rgb_line=hexToRgb(i.particles.line_linked.color)},i.fn.vendors.start=function(){isInArray("image",i.particles.shape.type)?(i.tmp.img_type=i.particles.shape.image.src.substr(i.particles.shape.image.src.length-3),i.fn.vendors.loadImg(i.tmp.img_type)):i.fn.vendors.checkBeforeDraw()},i.fn.vendors.eventsListeners(),i.fn.vendors.start()};Object.deepExtend=function(e,a){for(var t in a)a[t]&&a[t].constructor&&a[t].constructor===Object?(e[t]=e[t]||{},arguments.callee(e[t],a[t])):e[t]=a[t];return e},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),window.cancelRequestAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout}(),window.pJSDom=[],window.particlesJS=function(e,a){"string"!=typeof e&&(a=e,e="particles-js"),e||(e="particles-js");var t=document.getElementById(e),i="particles-js-canvas-el",s=t.getElementsByClassName(i);if(s.length)for(;s.length>0;)t.removeChild(s[0]);var n=document.createElement("canvas");n.className=i,n.style.width="100%",n.style.height="100%";var r=document.getElementById(e).appendChild(n);null!=r&&pJSDom.push(new pJS(e,a))},window.particlesJS.load=function(e,a,t){var i=new XMLHttpRequest;i.open("GET",a),i.onreadystatechange=function(a){if(4==i.readyState)if(200==i.status){var s=JSON.parse(a.currentTarget.response);window.particlesJS(e,s),t&&t()}else console.log("Error pJS - XMLHttpRequest status: "+i.status),console.log("Error pJS - File config not found")},i.send()}; \ No newline at end of file diff --git a/assets/sass/_advance-accordion.scss b/assets/sass/_advance-accordion.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_advance-tabs.scss b/assets/sass/_advance-tabs.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_caldera-form.scss b/assets/sass/_caldera-form.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_call-to-action.scss b/assets/sass/_call-to-action.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_contact-form7.scss b/assets/sass/_contact-form7.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_contact-forms.scss b/assets/sass/_contact-forms.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_content-ticker.scss b/assets/sass/_content-ticker.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_countdown.scss b/assets/sass/_countdown.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_creative-button.scss b/assets/sass/_creative-button.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_data-table.scss b/assets/sass/_data-table.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_dual-color-heading.scss b/assets/sass/_dual-color-heading.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_fancy-text.scss b/assets/sass/_fancy-text.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_filterable-gallery.scss b/assets/sass/_filterable-gallery.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_flipbox.scss b/assets/sass/_flipbox.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_general-slider.scss b/assets/sass/_general-slider.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_general.scss b/assets/sass/_general.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_gravity-form.scss b/assets/sass/_gravity-form.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_img-accordion.scss b/assets/sass/_img-accordion.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_infobox.scss b/assets/sass/_infobox.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_magnific-popup.scss b/assets/sass/_magnific-popup.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_ninja-form.scss b/assets/sass/_ninja-form.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_particles.scss b/assets/sass/_particles.scss new file mode 100644 index 000000000..b032486a7 --- /dev/null +++ b/assets/sass/_particles.scss @@ -0,0 +1,3 @@ +.elementor-section .elementor-container { + z-index: 99; +} \ No newline at end of file diff --git a/assets/sass/_post-grid-column.scss b/assets/sass/_post-grid-column.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_post-grid.scss b/assets/sass/_post-grid.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_post-timeline.scss b/assets/sass/_post-timeline.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_pricing-table.scss b/assets/sass/_pricing-table.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_progress-bar.scss b/assets/sass/_progress-bar.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_social-feeds.scss b/assets/sass/_social-feeds.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_swiper.scss b/assets/sass/_swiper.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_team-members.scss b/assets/sass/_team-members.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_testimonial-slider.scss b/assets/sass/_testimonial-slider.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_tooltip.scss b/assets/sass/_tooltip.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_weform.scss b/assets/sass/_weform.scss old mode 100644 new mode 100755 diff --git a/assets/sass/_woo-products.scss b/assets/sass/_woo-products.scss old mode 100644 new mode 100755 index 2aea4214f..938c13307 --- a/assets/sass/_woo-products.scss +++ b/assets/sass/_woo-products.scss @@ -1,289 +1,370 @@ -/*-------------------------*/ +/*--------------------------*/ /* 09. Product Styles -/* ------------------------*/ -.eael-product-carousel .woocommerce li.product { - background-color: #fff; - border-radius: 0; - box-shadow: none; -} - -.hide_rating .woocommerce .star-rating-container, -.hide_rating .woocommerce .star-rating { - display: none !important; -} - -.eael-product-carousel .woocommerce ul.products li.product h3 { - padding: 0.5em; -} - -.eael-product-carousel .woocommerce .products .star-rating { - display: block; - float: none; - margin: 10px auto; -} - -body:not(.x-ethos):not(.x-integrity):not(.x-renew):not(.x-icon) .eael-product-carousel .woocommerce li.product .button { - box-shadow: none; - display: block; - left: auto; - margin: 15px; - padding: 0.45em 0.5em 0.575em; - position: relative; - right: auto; - text-shadow: none; - top: auto; -} - - -/*--- Product Simple and Reveal Style ---*/ -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-featured { - background-color: transparent; - border: medium none; - box-shadow: none; - padding: 0; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-wrap, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap { - background-color: transparent; - bottom: auto; - box-shadow: none; - padding: 15px 0 0; - position: relative; - text-align: center; - top: auto; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header h3, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header h3 { - font-size: 14px; - line-height: 1.2; - margin: 0 0 5px; - padding-bottom: 0.5em; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header h3 a, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header h3 a { - color: #272727; - font-weight: normal; - letter-spacing: 0.01rem; - text-transform: uppercase; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .price>.amount, -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header .price>.amount, -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-header .price>ins>.amount, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header .price>.amount, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-header .price>ins>.amount { - color: #272727; - font-size: 18px; - font-weight: normal; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .entry-wrap::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap::before { - display: none; -} - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-header .button { - background-color: transparent; - border: 1px solid rgba(0, 0, 0, 0.5); - border-radius: 0; - box-shadow: none; - color: #272727; - display: block; - font-size: 14px; - left: auto; - margin: 20px auto; - opacity: 1; - position: relative; - right: auto; - text-shadow: none; - top: auto; - width: 80%; -} - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .entry-header .button:hover { - background-color: #e74c3c; - border: 1px solid #e74c3c; - color: #fff; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container { - background-color: transparent; - left: auto; - opacity: 1; - position: relative; - right: auto; - top: 5px; - display: block; - margin: 0 auto; - width: 110px; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container .star-rating::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container .star-rating::before { - color: #f2b01e; -} - -.eael-product-carousel.eael-product-simple .woocommerce li.product .star-rating-container .star-rating span::before, -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container .star-rating span::before { - color: #f2b01e; -} - -.eael-product-carousel:not(.eael-product-no-style) .onsale { - border-radius: 0; - box-shadow: none; - display: block; - font-size: 14px; - height: 100px; - letter-spacing: 0; - line-height: 160px; - position: absolute; - text-align: center; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); - text-transform: uppercase; - transform: rotate(-45deg); - width: 200px; - z-index: 1; -} - -.eael-product-carousel:not(.eael-product-no-style) .woocommerce li.product .onsale { - left: -95px; - top: -45px; -} - -.eael-product-carousel .woocommerce ul.products { - margin: 0 0 30px; -} - - -/*--- Product Simple and Reveal Style ---*/ -.eael-product-carousel .woocommerce li.product { - background-color: #fff; - float: left; - overflow: hidden; - padding: 0; - position: relative; - text-align: center; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product .entry-wrap { - bottom: -63px; - margin-top: -63px; - position: relative; - top: auto; - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .entry-wrap { - bottom: 0; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .entry-wrap::before { - background-color: #fff; - display: block; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product .star-rating-container { - background-color: rgba(255, 255, 255, 0.9); - left: auto; - opacity: 0; - position: absolute; - right: 10px; - top: 10px; -} - -.eael-product-carousel.eael-product-reveal .woocommerce li.product:hover .star-rating-container { - opacity: 1; -} - -/*--- Product Reveal Styles ---*/ -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap { - bottom: auto; - font-size: 14px; - left: 0; - padding: 0; - position: absolute; - right: 0; - top: calc(100% - 4em); - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap { - background-color: rgba(0, 0, 0, 0.5); - bottom: auto; - font-size: 14px; - left: 0; - padding: 0; - position: absolute; - right: 0; - text-align: center; - top: calc(100% - 4em); - -webkit-transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.5); - content: ""; - display: block; - height: 50em; - left: 0; - position: absolute; - right: 0; - top: 0; - transition: all 0.615s cubic-bezier(0.19, 1, 0.22, 1) 0s; - z-index: 0; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.75); -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header { - position: relative; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header h3 { - font-size: 14px; - line-height: 1; - margin: 0; - overflow: hidden; - padding: 1.5em; - text-overflow: ellipsis; - text-transform: uppercase; - white-space: nowrap; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header h3 a { - color: #fff; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .price>del, -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header .price>del { - display: none; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .entry-header .price>.amount, -.woocommerce li.product .entry-header .price>ins>.amount { - color: #fff; - font-size: 24px; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product .added_to_cart { - display: none; -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap { - top: calc(100% - 10.385em); -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .entry-wrap::before { - background-color: rgba(0, 0, 0, 0.75); -} - -.eael-product-carousel.eael-product-overlay .woocommerce li.product:hover .star-rating-container { - opacity: 1; -} +/*--------------------------*/ +.eael-product-grid, +.eael-post-grid { + // simple & reveal style + &.eael-product-simple, + &.eael-product-reveal { + .woocommerce { + ul.products { + li.product { + position: relative; + float: left; + overflow: hidden; + text-align: center; + padding: 0; + border-radius: 0; + background-color: #fff; + box-shadow: none; + + a { + text-decoration: none; + + &:hover { + outline: none; + box-shadow: none; + } + } + + img { + width: 100%; + height: auto; + backface-visibility: hidden; + } + + // product title + .woocommerce-loop-product__title { + font-size: 16px; + font-weight: 700; + line-height: 1; + color: #333; + margin: 25px 0 12px; + padding: 0; + } + + // onsale + .onsale { + display: block; + line-height: 170px; + font-size: 13px; + text-align: center; + letter-spacing: 0; + text-shadow: 0 1px 1px rgba(0,0,0,.6); + text-transform: uppercase; + color: #fff; + background-color: #ff2a13; + border-radius: 0; + border: none; + box-shadow: none; + position: absolute; + height: 100px; + width: 200px; + z-index: 1; + left: -100px; + top: -50px; + right: auto; + margin: 0; + padding: 0; + transform: rotate(-45deg); + } + + .price { + font-size: 14px; + margin-bottom: 0; + + del { + opacity: 0.5; + display: inline-block; + } + + ins { + font-weight: 400; + background-color: transparent; + color: #ff2a13; + } + } + + + // star rating + .star-rating { + display: block; + float: none; + font-size: 14px; + margin: 10px auto; + } + + // add to cart button + .button.add_to_cart_button { + display: inline-block; + height: 40px; + font-size: 14px; + font-weight: 400; + line-height: 40px; + text-align: center; + text-transform: uppercase; + color: #fff; + background-color: #333; + padding: 0 30px; + margin: 15px 0; + border-radius: 0; + + &:focus { + outline: none; + } + } + + a.added_to_cart { + display: block; + margin: 0 0 15px 0; + padding: 0; + font-size: 14px; + line-height: 1; + text-transform: capitalize; + color: #333; + background-color: transparent; + } + } + } + } + } + + // simple style + &.eael-product-simple { + .woocommerce { + ul.products { + li.product { + border: 1px solid #eee; + } + } + } + } + + // reveal style + &.eael-product-reveal { + .woocommerce { + ul.products { + li.product { + border: 1px solid transparent; + + .button.add_to_cart_button, + a.added_to_cart { + visibility: hidden; + transition: none; + } + + &:hover { + border: 1px solid #eee; + + .button.add_to_cart_button, + a.added_to_cart { + visibility: visible; + } + } + } + } + } + } + + // overlay style + &.eael-product-overlay { + .woocommerce { + ul.products { + li.product { + position: relative; + float: left; + overflow: hidden; + text-align: center; + padding: 0 0 15px 0; + border-radius: 0; + background-color: #fff; + box-shadow: none; + + a { + text-decoration: none; + + &:hover { + outline: none; + box-shadow: none; + } + } + + img { + width: 100%; + height: auto; + margin: 0; + backface-visibility: hidden; + } + + .overlay { + position: relative; + overflow: hidden; + line-height: 0; + + .button-wrap { + position: absolute; + top: 50%; + left: 0; + right: 0; + text-align: center; + transform: translateY(-50%); + } + + .product-link, + .add_to_cart_button, + .added_to_cart { + display: inline-block; + font-size: 14px; + line-height: 38px; + text-align: center; + color: #fff; + background-color: #333; + width: 38px; + height: 38px; + border-style: none; + border-radius: 50%; + vertical-align: middle; + padding: 0; + margin: 0 5px; + transform: translateY(20px); + opacity: 0; + transition: transform 200ms, opacity 300ms; + + &:focus { + outline: none; + } + } + + .add_to_cart_button { + font-size: 0; + &:before { + display: none; + } + + &:after { + content: '\f217'; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + line-height: 38px; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + vertical-align: middle; + margin: 0; + padding: 0; + } + + &.loading { + &:before { + display: none; + } + &:after { + content: '\f110'; + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + line-height: 38px; + color: #fff; + height: auto; + width: auto; + position: relative; + top: 0; + left: 0; + margin: 0; + padding: 0; + } + } + } + + .added_to_cart { + font-size: 0; + + &:after { + content: '\f06e'; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + line-height: 38px; + color: #fff; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + vertical-align: middle; + margin: 0; + padding: 0; + } + } + } + + // product title + .woocommerce-loop-product__title { + font-size: 16px; + font-weight: 700; + line-height: 1; + color: #333; + margin: 25px 0 12px; + padding: 0; + } + + // onsale + .onsale { + display: block; + line-height: 170px; + font-size: 13px; + text-align: center; + letter-spacing: 0; + text-shadow: 0 1px 1px rgba(0,0,0,.6); + text-transform: uppercase; + color: #fff; + background-color: #ff2a13; + border-radius: 0; + border: none; + box-shadow: none; + position: absolute; + height: 100px; + width: 200px; + z-index: 1; + left: -100px; + top: -50px; + right: auto; + margin: 0; + padding: 0; + transform: rotate(-45deg); + } + + .price { + font-size: 14px; + margin-bottom: 0; + + del { + opacity: 0.5; + display: inline-block; + } + + ins { + font-weight: 400; + background-color: transparent; + color: #ff2a13; + } + } + + + // star rating + .star-rating { + display: block; + float: none; + font-size: 14px; + margin: 10px auto; + } + + &:hover { + .overlay { + a, + .add_to_cart_button { + opacity: 1; + transform: translateY(0); + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/assets/sass/_wp-form.scss b/assets/sass/_wp-form.scss old mode 100644 new mode 100755 diff --git a/assets/sass/essential-addons-elementor.scss b/assets/sass/essential-addons-elementor.scss old mode 100644 new mode 100755 index ae9854dc6..053220ddf --- a/assets/sass/essential-addons-elementor.scss +++ b/assets/sass/essential-addons-elementor.scss @@ -76,4 +76,5 @@ @import "advance-accordion"; @import "tooltip"; @import "progress-bar"; -@import "img-accordion"; \ No newline at end of file +@import "img-accordion"; +@import "particles"; diff --git a/config.rb b/config.rb old mode 100644 new mode 100755 diff --git a/elements/product-grid/product-grid.php b/elements/product-grid/product-grid.php index fc7e50dcf..e3440c367 100755 --- a/elements/product-grid/product-grid.php +++ b/elements/product-grid/product-grid.php @@ -1,52 +1,51 @@ start_controls_section( - 'eael_section_product_grid_settings', - [ - 'label' => esc_html__( 'Product Settings', 'essential-addons-elementor' ) - ] - ); + $this->start_controls_section( + 'eael_section_product_grid_settings', + [ + 'label' => esc_html__('Product Settings', 'essential-addons-elementor'), + ] + ); $this->add_control( 'eael_product_grid_product_filter', [ - 'label' => esc_html__( 'Filter By', 'essential-addons-elementor' ), + 'label' => esc_html__('Filter By', 'essential-addons-elementor'), 'type' => Controls_Manager::SELECT, 'default' => 'recent-products', 'options' => [ - 'recent-products' => esc_html__( 'Recent Products', 'essential-addons-elementor' ), - 'featured-products' => esc_html__( 'Featured Products', 'essential-addons-elementor' ), - 'best-selling-products' => esc_html__( 'Best Selling Products', 'essential-addons-elementor' ), - 'sale-products' => esc_html__( 'Sale Products', 'essential-addons-elementor' ), - 'top-products' => esc_html__( 'Top Rated Products', 'essential-addons-elementor' ), + 'recent-products' => esc_html__('Recent Products', 'essential-addons-elementor'), + 'featured-products' => esc_html__('Featured Products', 'essential-addons-elementor'), + 'best-selling-products' => esc_html__('Best Selling Products', 'essential-addons-elementor'), + 'sale-products' => esc_html__('Sale Products', 'essential-addons-elementor'), + 'top-products' => esc_html__('Top Rated Products', 'essential-addons-elementor'), ], ] ); @@ -54,37 +53,36 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_column', [ - 'label' => esc_html__( 'Columns', 'essential-addons-elementor' ), + 'label' => esc_html__('Columns', 'essential-addons-elementor'), 'type' => Controls_Manager::SELECT, 'default' => '4', 'options' => [ - '1' => esc_html__( '1', 'essential-addons-elementor' ), - '2' => esc_html__( '2', 'essential-addons-elementor' ), - '3' => esc_html__( '3', 'essential-addons-elementor' ), - '4' => esc_html__( '4', 'essential-addons-elementor' ), - '5' => esc_html__( '5', 'essential-addons-elementor' ), - '6' => esc_html__( '6', 'essential-addons-elementor' ), + '1' => esc_html__('1', 'essential-addons-elementor'), + '2' => esc_html__('2', 'essential-addons-elementor'), + '3' => esc_html__('3', 'essential-addons-elementor'), + '4' => esc_html__('4', 'essential-addons-elementor'), + '5' => esc_html__('5', 'essential-addons-elementor'), + '6' => esc_html__('6', 'essential-addons-elementor'), ], ] ); $this->add_control( - 'eael_product_grid_products_count', - [ - 'label' => __( 'Products Count', 'essential-addons-elementor' ), - 'type' => Controls_Manager::NUMBER, - 'default' => 4, - 'min' => 1, - 'max' => 1000, - 'step' => 1, - ] + 'eael_product_grid_products_count', + [ + 'label' => __('Products Count', 'essential-addons-elementor'), + 'type' => Controls_Manager::NUMBER, + 'default' => 4, + 'min' => 1, + 'max' => 1000, + 'step' => 1, + ] ); - $this->add_control( 'eael_product_grid_categories', [ - 'label' => esc_html__( 'Product Categories', 'essential-addons-elementor' ), + 'label' => esc_html__('Product Categories', 'essential-addons-elementor'), 'type' => Controls_Manager::SELECT2, 'label_block' => true, 'multiple' => true, @@ -92,25 +90,25 @@ protected function _register_controls() { ] ); - // $this->add_control( - // 'eael_product_grid_style_preset', - // [ - // 'label' => esc_html__( 'Style Preset', 'essential-addons-elementor' ), - // 'type' => Controls_Manager::SELECT, - // 'default' => 'eael-product-simple', - // 'options' => [ - // 'eael-product-simple' => esc_html__( 'Simple Style', 'essential-addons-elementor' ), - // 'eael-product-reveal' => esc_html__( 'Reveal Style', 'essential-addons-elementor' ), - // 'eael-product-overlay' => esc_html__( 'Overlay Style', 'essential-addons-elementor' ), - // 'eacs-product-default' => esc_html__( 'None (Use Theme Style)', 'essential-addons-elementor' ), - // ], - // ] - // ); + $this->add_control( + 'eael_product_grid_style_preset', + [ + 'label' => esc_html__( 'Style Preset', 'essential-addons-elementor' ), + 'type' => Controls_Manager::SELECT, + 'default' => 'eael-product-simple', + 'options' => [ + 'eael-product-default' => esc_html__( 'Default', 'essential-addons-elementor' ), + 'eael-product-simple' => esc_html__( 'Simple Style', 'essential-addons-elementor' ), + 'eael-product-reveal' => esc_html__( 'Reveal Style', 'essential-addons-elementor' ), + 'eael-product-overlay' => esc_html__( 'Overlay Style', 'essential-addons-elementor' ), + ], + ] + ); $this->add_control( 'eael_product_grid_rating', [ - 'label' => esc_html__( 'Show Product Rating?', 'essential-addons-elementor' ), + 'label' => esc_html__('Show Product Rating?', 'essential-addons-elementor'), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => 'yes', @@ -118,44 +116,19 @@ protected function _register_controls() { ); $this->end_controls_section(); - - $this->start_controls_section( - 'eael_section_pro', - [ - 'label' => __( 'Go Premium for More Features', 'essential-addons-elementor' ) - ] - ); - - $this->add_control( - 'eael_control_get_pro', - [ - 'label' => __( 'Unlock more possibilities', 'essential-addons-elementor' ), - 'type' => Controls_Manager::CHOOSE, - 'options' => [ - '1' => [ - 'title' => __( '', 'essential-addons-elementor' ), - 'icon' => 'fa fa-unlock-alt', - ], - ], - 'default' => '1', - 'description' => ' Get the Pro version for more stunning elements and customization options.' - ] - ); - $this->end_controls_section(); - $this->start_controls_section( 'eael_product_grid_styles', [ - 'label' => esc_html__( 'Products Styles', 'essential-addons-elementor' ), - 'tab' => Controls_Manager::TAB_STYLE + 'label' => esc_html__('Products Styles', 'essential-addons-elementor'), + 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'eael_product_grid_background_color', [ - 'label' => esc_html__( 'Content Background Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Content Background Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ @@ -168,37 +141,55 @@ protected function _register_controls() { Group_Control_Border::get_type(), [ 'name' => 'eael_peoduct_grid_border', + 'fields_options' => [ + 'border' => [ + 'default' => 'solid', + ], + 'width' => [ + 'default' => [ + 'top' => '1', + 'right' => '1', + 'bottom' => '1', + 'left' => '1', + 'isLinked' => false, + ], + ], + 'color' => [ + 'default' => '#eee', + ], + ], 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product', + 'condition' => [ + 'eael_product_grid_style_preset' => ['eael-product-default', 'eael-product-simple', 'eael-product-overlay'] + ] ] ); - + $this->add_control( 'eael_peoduct_grid_border_radius', [ - 'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ), + 'label' => esc_html__('Border Radius', 'essential-addons-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); - - - $this->end_controls_section(); + $this->end_controls_section(); $this->start_controls_section( 'eael_section_product_grid_typography', [ - 'label' => esc_html__( 'Color & Typography', 'essential-addons-elementor' ), - 'tab' => Controls_Manager::TAB_STYLE + 'label' => esc_html__('Color & Typography', 'essential-addons-elementor'), + 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'eael_product_grid_product_title_heading', [ - 'label' => __( 'Product Title', 'essential-addons-elementor' ), + 'label' => __('Product Title', 'essential-addons-elementor'), 'type' => Controls_Manager::HEADING, ] ); @@ -206,7 +197,7 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_product_title_color', [ - 'label' => esc_html__( 'Product Title Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Product Title Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#272727', 'selectors' => [ @@ -214,11 +205,11 @@ protected function _register_controls() { ], ] ); - + $this->add_group_control( Group_Control_Typography::get_type(), [ - 'name' => 'eael_product_grid_product_title_typography', + 'name' => 'eael_product_grid_product_title_typography', 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product .woocommerce-loop-product__title', ] ); @@ -226,16 +217,15 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_product_price_heading', [ - 'label' => __( 'Product Price', 'essential-addons-elementor' ), + 'label' => __('Product Price', 'essential-addons-elementor'), 'type' => Controls_Manager::HEADING, ] ); - $this->add_control( 'eael_product_grid_product_price_color', [ - 'label' => esc_html__( 'Product Price Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Product Price Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#272727', 'selectors' => [ @@ -243,11 +233,11 @@ protected function _register_controls() { ], ] ); - + $this->add_group_control( Group_Control_Typography::get_type(), [ - 'name' => 'eael_product_grid_product_price_typography', + 'name' => 'eael_product_grid_product_price_typography', 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product .price', ] ); @@ -255,7 +245,7 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_product_rating_heading', [ - 'label' => __( 'Star Rating', 'essential-addons-elementor' ), + 'label' => __('Star Rating', 'essential-addons-elementor'), 'type' => Controls_Manager::HEADING, ] ); @@ -263,7 +253,7 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_product_rating_color', [ - 'label' => esc_html__( 'Rating Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Rating Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#f2b01e', 'selectors' => [ @@ -272,11 +262,11 @@ protected function _register_controls() { ], ] ); - + $this->add_group_control( Group_Control_Typography::get_type(), [ - 'name' => 'eael_product_grid_product_rating_typography', + 'name' => 'eael_product_grid_product_rating_typography', 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product .star-rating', ] ); @@ -284,7 +274,7 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_sale_badge_heading', [ - 'label' => __( 'Sale Badge', 'essential-addons-elementor' ), + 'label' => __('Sale Badge', 'essential-addons-elementor'), 'type' => Controls_Manager::HEADING, ] ); @@ -292,11 +282,11 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_sale_badge_color', [ - 'label' => esc_html__( 'Sale Badge Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Sale Badge Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ - '{{WRAPPER}} .eael-product-grid:not(.eael-product-no-style) .onsale' => 'color: {{VALUE}};', + '{{WRAPPER}} .woocommerce ul.products li.product .onsale' => 'color: {{VALUE}};', ], ] ); @@ -304,193 +294,225 @@ protected function _register_controls() { $this->add_control( 'eael_product_grid_sale_badge_background', [ - 'label' => esc_html__( 'Sale Badge Background', 'essential-addons-elementor' ), + 'label' => esc_html__('Sale Badge Background', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#ff2a13', 'selectors' => [ - '{{WRAPPER}} .eael-product-grid:not(.eael-product-no-style) .onsale' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .woocommerce ul.products li.product .onsale' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid .woocommerce ul.products li.product .price ins' => 'color: {{VALUE}};', ], ] ); - + $this->add_group_control( Group_Control_Typography::get_type(), [ - 'name' => 'eael_product_grid_sale_badge_typography', - 'selector' => '{{WRAPPER}} .eael-product-grid:not(.eael-product-no-style) .onsale', + 'name' => 'eael_product_grid_sale_badge_typography', + 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product .onsale', ] ); - $this->end_controls_section(); - $this->start_controls_section( 'eael_section_product_grid_add_to_cart_styles', [ - 'label' => esc_html__( 'Add to Cart Button Styles', 'essential-addons-elementor' ), - 'tab' => Controls_Manager::TAB_STYLE + 'label' => esc_html__('Add to Cart Button Styles', 'essential-addons-elementor'), + 'tab' => Controls_Manager::TAB_STYLE, ] ); + $this->start_controls_tabs('eael_product_grid_add_to_cart_style_tabs'); - $this->start_controls_tabs( 'eael_product_grid_add_to_cart_style_tabs' ); - - $this->start_controls_tab( 'normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-elementor' ) ] ); + $this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-elementor')]); $this->add_control( 'eael_product_grid_add_to_cart_color', [ - 'label' => esc_html__( 'Button Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Button Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, - 'default' => '#333', + 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button' => 'color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link' => 'color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart' => 'color: {{VALUE}};', ], ] ); - + $this->add_control( 'eael_product_grid_add_to_cart_background', [ - 'label' => esc_html__( 'Button Background Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Button Background Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, - 'default' => '#fff', + 'default' => '#333', 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart' => 'background-color: {{VALUE}};', ], ] ); - + $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'eael_product_grid_add_to_cart_border', - 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button', + 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button, {{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link, {{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ - 'name' => 'eael_product_grid_add_to_cart_typography', + 'name' => 'eael_product_grid_add_to_cart_typography', 'selector' => '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button', + 'condition' => [ + 'eael_product_grid_style_preset' => ['eael-product-default', 'eael-product-simple'] + ], ] ); $this->end_controls_tab(); - $this->start_controls_tab( 'eael_product_grid_add_to_cart_hover_styles', [ 'label' => esc_html__( 'Hover', 'essential-addons-elementor' ) ] ); + $this->start_controls_tab('eael_product_grid_add_to_cart_hover_styles', ['label' => esc_html__('Hover', 'essential-addons-elementor')]); $this->add_control( 'eael_product_grid_add_to_cart_hover_color', [ - 'label' => esc_html__( 'Button Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Button Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, - 'default' => '#333', + 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button:hover' => 'color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link:hover' => 'color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:hover' => 'color: {{VALUE}};', ], ] ); - + $this->add_control( 'eael_product_grid_add_to_cart_hover_background', [ - 'label' => esc_html__( 'Button Background Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Button Background Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, - 'default' => '#f9f9f9', + 'default' => '#333', 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button:hover' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link:hover' => 'background-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:hover' => 'background-color: {{VALUE}};', ], ] ); - + $this->add_control( 'eael_product_grid_add_to_cart_hover_border_color', [ - 'label' => esc_html__( 'Border Color', 'essential-addons-elementor' ), + 'label' => esc_html__('Border Color', 'essential-addons-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-product-grid .woocommerce li.product .button.add_to_cart_button:hover' => 'border-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .product-link:hover' => 'border-color: {{VALUE}};', + '{{WRAPPER}} .eael-product-grid.eael-product-overlay .woocommerce ul.products li.product .overlay .added_to_cart:hover' => 'border-color: {{VALUE}};', ], ] ); - $this->end_controls_tab(); - - $this->end_controls_tabs(); + $this->end_controls_tabs(); $this->end_controls_section(); - - - } + } - protected function render( ) { - - + protected function render() { $settings = $this->get_settings(); - - $product_count = $this->get_settings( 'eael_product_grid_products_count' ); - $columns = $this->get_settings( 'eael_product_grid_column' ); - $show_rating = ( ($settings['eael_product_grid_rating'] == 'yes') ? "show_rating" : "hide_rating" ); - $product_grid_classes = $show_rating; - - $get_product_categories = $settings['eael_product_grid_categories']; // get custom field value - if($get_product_categories >= 1 ) { - $category_ids = implode(', ', $get_product_categories); + $show_rating = $settings['eael_product_grid_rating']; + + if ($settings['eael_product_grid_style_preset'] == 'eael-product-simple') { + $grid_layout = 'eael-product-simple'; + } else if ($settings['eael_product_grid_style_preset'] == 'eael-product-reveal') { + $grid_layout = 'eael-product-reveal'; + } else if ($settings['eael_product_grid_style_preset'] == 'eael-product-overlay') { + $grid_layout = 'eael-product-overlay'; } else { - $category_ids = ''; + $grid_layout = 'eael-product-default'; } - ?> - - - - + if ($settings['eael_product_grid_product_filter'] == 'featured-products') { + $args['tax_query'] = [ + 'taxonomy' => 'product_visibility', + 'field' => 'name', + 'terms' => 'featured', + ]; + } else if ($settings['eael_product_grid_product_filter'] == 'best-selling-products') { + $args['meta_key'] = 'total_sales'; + $args['orderby'] = 'meta_value_num'; + $args['order'] = 'DESC'; + } else if ($settings['eael_product_grid_product_filter'] == 'sale-products') { + $args['meta_query'] = [ + 'relation' => 'OR', + [ + 'key' => '_sale_price', + 'value' => 0, + 'compare' => '>', + 'type' => 'numeric', + ], [ + 'key' => '_min_variation_sale_price', + 'value' => 0, + 'compare' => '>', + 'type' => 'numeric', + ], + ]; + } else if ($settings['eael_product_grid_product_filter'] == 'top-products') { + $args['meta_key'] = '_wc_average_rating'; + $args['orderby'] = 'meta_value_num'; + $args['order'] = 'DESC'; + } - - +
+
    '; + $query = new \WP_Query($args); + if ($query->have_posts()) { + while ($query->have_posts()): $query->the_post(); + include ESSENTIAL_ADDONS_EL_PATH . 'includes/templates/product-loop.php'; + endwhile; + } else { + echo __('No products found'); + } + wp_reset_postdata(); + unset($woocommerce_loop); + echo '
+
+
'; } protected function content_template() { - - ?> - - - widgets_manager->register_widget_type( new Widget_Eael_Product_Grid() ); \ No newline at end of file +Plugin::instance()->widgets_manager->register_widget_type(new Widget_Eael_Product_Grid()); \ No newline at end of file diff --git a/essential_adons_elementor.php b/essential_adons_elementor.php index a9b862788..8fbf4cc9a 100755 --- a/essential_adons_elementor.php +++ b/essential_adons_elementor.php @@ -4,7 +4,7 @@ * Description: The ultimate elements library for Elementor page builder plugin for WordPress. * Plugin URI: https://essential-addons.com/elementor/ * Author: WPDeveloper - * Version: 2.8.7 + * Version: 2.9.0 * Author URI: https://wpdeveloper.net/ * * Text Domain: essential-addons-elementor @@ -16,8 +16,8 @@ define( 'ESSENTIAL_ADDONS_EL_URL', plugins_url( '/', __FILE__ ) ); define( 'ESSENTIAL_ADDONS_EL_PATH', plugin_dir_path( __FILE__ ) ); define( 'ESSENTIAL_ADDONS_EL_ROOT', __FILE__ ); -define( 'ESSENTIAL_ADDONS_VERSION', '2.8.4' ); -define( 'ESSENTIAL_ADDONS_STABLE_VERSION', '2.8.3' ); +define( 'ESSENTIAL_ADDONS_VERSION', '2.9.0' ); +define( 'ESSENTIAL_ADDONS_STABLE_VERSION', '2.9.0' ); define( 'ESSENTIAL_ADDONS_BASENAME', plugin_basename( __FILE__ ) ); @@ -28,6 +28,7 @@ require_once ESSENTIAL_ADDONS_EL_PATH.'includes/maintennance.php'; require_once ESSENTIAL_ADDONS_EL_PATH.'includes/eael-rollback.php'; require_once ESSENTIAL_ADDONS_EL_PATH.'admin/settings.php'; +require_once ESSENTIAL_ADDONS_EL_PATH .'includes/extensions.php'; /** * This function will return true for all activated modules @@ -36,8 +37,8 @@ */ function eael_activated_modules() { - $eael_default_keys = [ 'contact-form-7', 'count-down', 'creative-btn', 'fancy-text', 'post-grid', 'post-timeline', 'product-grid', 'team-members', 'testimonials', 'weforms', 'call-to-action', 'flip-box', 'info-box', 'dual-header', 'price-table', 'ninja-form', 'gravity-form', 'caldera-form', 'wpforms', 'twitter-feed', 'facebook-feed', 'data-table', 'filter-gallery', 'image-accordion', 'content-ticker', 'tooltip', 'adv-accordion', 'adv-tabs', 'progress-bar' ]; - + $eael_default_keys = [ 'contact-form-7', 'count-down', 'creative-btn', 'fancy-text', 'img-comparison', 'instagram-gallery', 'interactive-promo', 'lightbox', 'post-block', 'post-grid', 'post-timeline', 'product-grid', 'team-members', 'testimonial-slider', 'testimonials', 'testimonials', 'weforms', 'static-product', 'call-to-action', 'flip-box', 'info-box', 'dual-header', 'price-table', 'flip-carousel', 'interactive-cards', 'ninja-form', 'gravity-form', 'caldera-form', 'wisdom_registered_setting', 'twitter-feed', 'facebook-feed', 'data-table', 'filter-gallery', 'image-accordion','content-ticker', 'tooltip', 'adv-accordion', 'adv-tabs', 'progress-bar', 'section-particles' ]; + $eael_default_settings = array_fill_keys( $eael_default_keys, true ); $eael_get_settings = get_option( 'eael_save_settings', $eael_default_settings ); $eael_new_settings = array_diff_key( $eael_default_settings, $eael_get_settings ); @@ -51,6 +52,20 @@ function eael_activated_modules() { } +/** + * Load acivate or deactivate Modules + * + * @since v1.0.0 + */ +function add_eael_extensions() { + $is_component_active = eael_activated_modules(); + + if( $is_component_active['section-particles'] ) { + require_once ESSENTIAL_ADDONS_EL_PATH .'extensions/eael-particle-section/eael-particle-section.php'; + } +} +add_eael_extensions(); + /** * Acivate or Deactivate Modules * @@ -227,7 +242,16 @@ function essential_addons_el_enqueue(){ } if( $is_component_active['progress-bar'] ) { - wp_enqueue_script('essential_addons_elementor-eael-bar',ESSENTIAL_ADDONS_EL_URL.'assets/js/progress-bar.js', array('jquery'),'1.0', true); + wp_enqueue_script('essential_addons_elementor-progress-bar',ESSENTIAL_ADDONS_EL_URL.'assets/js/loading-bar.min.js', array('jquery'),'1.0', true); + } + if( $is_component_active['section-particles'] ) { + wp_enqueue_script( + 'particles-js', ESSENTIAL_ADDONS_EL_URL.'assets/js/particles.js', + ['jquery'], '1.0', true + ); + + $preset_themes = require ESSENTIAL_ADDONS_EL_PATH.'extensions/eael-particle-section/particle-themes.php'; + wp_localize_script( 'particles-js', 'ParticleThemesData', $preset_themes ); } } @@ -346,175 +370,4 @@ function eael_is_failed_to_load() { } } add_action( 'plugins_loaded', 'eael_init' ); - -/** - * Admin Notice - * - * @since v1.0.0 - */ -function eael_admin_notice() { - if ( current_user_can( 'install_plugins' ) ) { - global $current_user ; - $user_id = $current_user->ID; - /* Check that the user hasn't already clicked to ignore the message */ - if ( ! get_user_meta($user_id, 'eael_ignore_notice287') ) { - echo '

'; - echo '

'; - printf(__('Make XMas Much Merrier. Use the coupon code Christmas2018 to redeem a 40% discount on Essential Addons for Elementor Unlimited. Apply Coupon - I\'m good with free version'), admin_url( 'admin.php?page=eael-settings&eael_nag_ignore=0' )); - echo "

"; - } - } -} -add_action('admin_notices', 'eael_admin_notice'); - - -/** - * Nag Ignore - */ -function eael_nag_ignore() { - global $current_user; - $user_id = $current_user->ID; - /* If user clicks to ignore the notice, add that to their user meta */ - if ( isset($_GET['eael_nag_ignore']) && '0' == $_GET['eael_nag_ignore'] ) { - add_user_meta($user_id, 'eael_ignore_notice287', 'true', true); - } -} -add_action('admin_init', 'eael_nag_ignore'); - -/** - * @review_dismiss() - * @review_pending() - * @eael_review_notice_message() - * Make all the above functions working. - */ -function eael_review_notice(){ - - review_dismiss(); - review_pending(); - - $activation_time = get_site_option( 'eael_active_time' ); - $review_dismissal = get_site_option( 'eael_review_dismiss' ); - $maybe_later = get_site_option( 'eael_maybe_later' ); - - if ( 'yes' == $review_dismissal ) { - return; - } - - if ( ! $activation_time ) { - add_site_option( 'eael_active_time', time() ); - } - - $daysinseconds = 259200; // 3 Days in seconds. - if( 'yes' == $maybe_later ) { - $daysinseconds = 604800 ; // 7 Days in seconds. - } - - if ( time() - $activation_time > $daysinseconds ) { - add_action( 'admin_notices' , 'eael_review_notice_message' ); - } - -} -add_action( 'admin_init', 'eael_review_notice' ); - -/** - * For the notice preview. - */ -function eael_review_notice_message(){ - $scheme = (parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY )) ? '&' : '?'; - $url = $_SERVER['REQUEST_URI'] . $scheme . 'eael_review_dismiss=yes'; - $dismiss_url = wp_nonce_url( $url, 'eael-review-nonce' ); - - $_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'eael_review_later=yes'; - $later_url = wp_nonce_url( $_later_link, 'eael-review-nonce' ); - ?> - -
-
- -
-
-

- -
-
- - start_controls_section( + 'eael_particles_section', + [ + 'label' => 'EA Particles', + 'tab' => Controls_Manager::TAB_LAYOUT + ] + ); + + $element->add_control( + 'eael_particle_switch', + [ + 'label' => __( 'Enable Particles', 'essential-addons-elementor' ), + 'type' => Controls_Manager::SWITCHER, + ] + ); + + $element->add_control( + 'eael_particle_area_zindex', + [ + 'label' => __( 'Z-index', 'essential-addons-elementor' ), + 'type' => Controls_Manager::NUMBER, + 'default' => 0, + 'condition' => [ + 'eael_particle_switch' => 'yes' + ] + ] + ); + + $element->add_control( + 'eael_particle_theme_from', + [ + 'label' => __( 'Theme Source', 'essential-addons-elementor' ), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'presets' => [ + 'title' => __( 'Defaults', 'essential-addons-elementor' ), + 'icon' => 'fa fa-list', + ], + 'custom' => [ + 'title' => __( 'Custom', 'essential-addons-elementor' ), + 'icon' => 'fa fa-edit', + ], + ], + 'condition' => [ + 'eael_particle_switch' => 'yes' + ], + 'default' => 'presets' + ] + ); + + $element->add_control( + 'eael_particle_preset_themes', + [ + 'label' => esc_html__( 'Preset Themes', 'essential-addons-elementor' ), + 'type' => Controls_Manager::SELECT, + 'label_block' => true, + 'options' => [ + 11 => __( 'Default', 'essential-addons-elementor' ), + 'nasa' => __( 'Nasa', 'essential-addons-elementor' ), + 'bubble' => __( 'Bubble', 'essential-addons-elementor' ), + 'snow' => __( 'Snow', 'essential-addons-elementor' ), + 'nyan_cat' => __( 'Nyan Cat', 'essential-addons-elementor' ) + ], + 'default' => 11, + 'condition' => [ + 'eael_particle_theme_from' => 'presets', + 'eael_particle_switch' => 'yes' + ] + ] + ); + + $element->add_control( + 'eael_particles_custom_style', + [ + 'label' => __( 'Custom Style', 'essential-addons-elementor' ), + 'type' => Controls_Manager::TEXTAREA, + 'description' => __( 'You can generate custom particles JSON code from Here!. Simply just past the JSON code above. For more queries Click Here!', 'essential-addons-elementor' ), + 'condition' => [ + 'eael_particle_theme_from' => 'custom', + 'eael_particle_switch' => 'yes' + ] + ] + ); + + $element->add_control( + 'eael_particle_section_notice', + [ + 'raw' => __( 'You need to configure a Background Type to see this in full effect. You can do this by switching to the Style Tab.', 'essential-addons-elementor' ), + 'type' => Controls_Manager::RAW_HTML, + 'condition' => [ + 'eael_particle_theme_from' => 'custom', + 'eael_particle_switch' => 'yes' + ] + ] + ); + + $element->end_controls_section(); + + } + + public function before_render( $element ) { + + if( $element->get_settings('eael_particle_switch') == 'yes' ){ + + $element->add_render_attribute( + '_wrapper','id', + 'eael-section-particles-' . $element->get_id() + ); + + } + + } + + public function after_render( $element ) { + + $data = $element->get_data(); + $settings = $element->get_settings_for_display(); + $type = $data['elType']; + $zindex = ! empty( $settings['eael_particle_area_zindex'] ) ? $settings['eael_particle_area_zindex'] : 0; + + if( ('section' == $type) && ($element->get_settings('eael_particle_switch') == 'yes') ){ + + $preset_themes = include('particle-themes.php'); + if( isset($settings['eael_particle_theme_from']) && $settings['eael_particle_theme_from'] == 'presets') { + $theme = $preset_themes[ $settings['eael_particle_preset_themes'] ]; + } + + if( isset($settings['eael_particle_theme_from']) && $settings['eael_particle_theme_from'] == 'custom') { + $theme = $settings['eael_particles_custom_style']; + } + + ?> + + + + '{ + "particles": { + "number": { + "value": 160, + "density": { + "enable": true, + "value_area": 800 + } + }, + "color": { + "value": "#ffffff" + }, + "shape": { + "type": "circle", + "stroke": { + "width": 0, + "color": "#000000" + }, + "polygon": { + "nb_sides": 5 + }, + "image": { + "src": "img/github.svg", + "width": 100, + "height": 100 + } + }, + "opacity": { + "value": 0.5, + "random": false, + "anim": { + "enable": false, + "speed": 1, + "opacity_min": 0.1, + "sync": false + } + }, + "size": { + "value": 3, + "random": true, + "anim": { + "enable": false, + "speed": 40, + "size_min": 0.1, + "sync": false + } + }, + "line_linked": { + "enable": true, + "distance": 150, + "color": "#ffffff", + "opacity": 0.4, + "width": 1 + }, + "move": { + "enable": true, + "speed": 6, + "direction": "none", + "random": false, + "straight": false, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": false, + "rotateX": 600, + "rotateY": 1200 + } + } + }, + "interactivity": { + "detect_on": "canvas", + "events": { + "onhover": { + "enable": true, + "mode": "repulse" + }, + "onclick": { + "enable": true, + "mode": "push" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 400, + "line_linked": { + "opacity": 1 + } + }, + "bubble": { + "distance": 400, + "size": 40, + "duration": 2, + "opacity": 8, + "speed": 3 + }, + "repulse": { + "distance": 200, + "duration": 0.4 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true + }', + 'nasa' => '{ + "particles": { + "number": { + "value": 250, + "density": { + "enable": true, + "value_area": 800 + } + }, + "color": { + "value": "#ffffff" + }, + "shape": { + "type": "circle", + "stroke": { + "width": 0, + "color": "#000000" + }, + "polygon": { + "nb_sides": 5 + }, + "image": { + "src": "img/github.svg", + "width": 100, + "height": 100 + } + }, + "opacity": { + "value": 1, + "random": true, + "anim": { + "enable": true, + "speed": 1, + "opacity_min": 0, + "sync": false + } + }, + "size": { + "value": 3, + "random": true, + "anim": { + "enable": false, + "speed": 4, + "size_min": 0.3, + "sync": false + } + }, + "line_linked": { + "enable": false, + "distance": 150, + "color": "#ffffff", + "opacity": 0.4, + "width": 1 + }, + "move": { + "enable": true, + "speed": 1, + "direction": "none", + "random": true, + "straight": false, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": false, + "rotateX": 600, + "rotateY": 600 + } + } + }, + "interactivity": { + "detect_on": "canvas", + "events": { + "onhover": { + "enable": true, + "mode": "bubble" + }, + "onclick": { + "enable": true, + "mode": "repulse" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 400, + "line_linked": { + "opacity": 1 + } + }, + "bubble": { + "distance": 250, + "size": 0, + "duration": 2, + "opacity": 0, + "speed": 3 + }, + "repulse": { + "distance": 400, + "duration": 0.4 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true + }', + 'bubble' => '{ + "particles": { + "number": { + "value": 15, + "density": { + "enable": true, + "value_area": 800 + } + }, + "color": { + "value": "#1b1e34" + }, + "shape": { + "type": "polygon", + "stroke": { + "width": 0, + "color": "#000" + }, + "polygon": { + "nb_sides": 6 + }, + "image": { + "src": "img/github.svg", + "width": 100, + "height": 100 + } + }, + "opacity": { + "value": 0.3, + "random": true, + "anim": { + "enable": false, + "speed": 1, + "opacity_min": 0.1, + "sync": false + } + }, + "size": { + "value": 50, + "random": false, + "anim": { + "enable": true, + "speed": 10, + "size_min": 40, + "sync": false + } + }, + "line_linked": { + "enable": false, + "distance": 200, + "color": "#ffffff", + "opacity": 1, + "width": 2 + }, + "move": { + "enable": true, + "speed": 8, + "direction": "none", + "random": false, + "straight": false, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": false, + "rotateX": 600, + "rotateY": 1200 + } + } + }, + "interactivity": { + "detect_on": "canvas", + "events": { + "onhover": { + "enable": false, + "mode": "grab" + }, + "onclick": { + "enable": false, + "mode": "push" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 400, + "line_linked": { + "opacity": 1 + } + }, + "bubble": { + "distance": 400, + "size": 40, + "duration": 2, + "opacity": 8, + "speed": 3 + }, + "repulse": { + "distance": 200, + "duration": 0.4 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true + }', + 'snow' => '{ + "particles": { + "number": { + "value": 450, + "density": { + "enable": true, + "value_area": 800 + } + }, + "color": { + "value": "#fff" + }, + "shape": { + "type": "circle", + "stroke": { + "width": 0, + "color": "#000000" + }, + "polygon": { + "nb_sides": 5 + }, + "image": { + "src": "img/github.svg", + "width": 100, + "height": 100 + } + }, + "opacity": { + "value": 0.5, + "random": true, + "anim": { + "enable": false, + "speed": 1, + "opacity_min": 0.1, + "sync": false + } + }, + "size": { + "value": 5, + "random": true, + "anim": { + "enable": false, + "speed": 40, + "size_min": 0.1, + "sync": false + } + }, + "line_linked": { + "enable": false, + "distance": 500, + "color": "#ffffff", + "opacity": 0.4, + "width": 2 + }, + "move": { + "enable": true, + "speed": 6, + "direction": "bottom", + "random": false, + "straight": false, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": false, + "rotateX": 600, + "rotateY": 1200 + } + } + }, + "interactivity": { + "detect_on": "canvas", + "events": { + "onhover": { + "enable": true, + "mode": "bubble" + }, + "onclick": { + "enable": true, + "mode": "repulse" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 400, + "line_linked": { + "opacity": 0.5 + } + }, + "bubble": { + "distance": 400, + "size": 4, + "duration": 0.3, + "opacity": 1, + "speed": 3 + }, + "repulse": { + "distance": 200, + "duration": 0.4 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true + }', + 'nyan_cat' => '{ + "particles": { + "number": { + "value": 150, + "density": { + "enable": false, + "value_area": 800 + } + }, + "color": { + "value": "#ffffff" + }, + "shape": { + "type": "star", + "stroke": { + "width": 0, + "color": "#000000" + }, + "polygon": { + "nb_sides": 5 + }, + "image": { + "src": "http://wiki.lexisnexis.com/academic/images/f/fb/Itunes_podcast_icon_300.jpg", + "width": 100, + "height": 100 + } + }, + "opacity": { + "value": 0.5, + "random": false, + "anim": { + "enable": false, + "speed": 1, + "opacity_min": 0.1, + "sync": false + } + }, + "size": { + "value": 4, + "random": true, + "anim": { + "enable": false, + "speed": 40, + "size_min": 0.1, + "sync": false + } + }, + "line_linked": { + "enable": false, + "distance": 150, + "color": "#ffffff", + "opacity": 0.4, + "width": 1 + }, + "move": { + "enable": true, + "speed": 14, + "direction": "left", + "random": false, + "straight": true, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": false, + "rotateX": 600, + "rotateY": 1200 + } + } + }, + "interactivity": { + "detect_on": "canvas", + "events": { + "onhover": { + "enable": false, + "mode": "grab" + }, + "onclick": { + "enable": true, + "mode": "repulse" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 200, + "line_linked": { + "opacity": 1 + } + }, + "bubble": { + "distance": 400, + "size": 40, + "duration": 2, + "opacity": 8, + "speed": 3 + }, + "repulse": { + "distance": 200, + "duration": 0.4 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true + }' +]; diff --git a/gulpfile.js b/gulpfile.js old mode 100644 new mode 100755 diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index d80429746..003acd572 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -85,7 +85,7 @@ public function init() { // add_action( 'admin_init', array( $this, 'do_tracking' ) ); // Display the admin notice on activation - add_action( 'admin_notices', array( $this, 'optin_notice' ) ); + // add_action( 'wpdeveloper_optin_notice', array( $this, 'optin_notice' ) ); add_action( 'admin_notices', array( $this, 'marketing_notice' ) ); // Deactivation @@ -622,9 +622,10 @@ public function optin_notice() { $notice_text = __( 'Want to help make Essential Addons for Elementor even more awesome? You can get a 25% discount coupon for Pro upgrade if you allow. What we collect.', 'plugin-usage-tracker' ); } // And we allow you to filter the text anyway + // ob_start(); $notice_text = apply_filters( 'wisdom_notice_text_' . esc_attr( $this->plugin_name ), $notice_text ); ?> - -
+ +

+ get_error_message() ); + } + } + + /** + * Install WPSP + * + * @return void + */ + public function core_install() { + check_ajax_referer( 'wpdeveloper_upsale_core_install' ); + + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( __( 'You don\'t have permission to install the plugins' ) ); + } + + $plugin_slug = ( isset( $_POST['slug'] ) ) ? $_POST['slug'] : ''; + $plugin_file = ( isset( $_POST['file'] ) ) ? $_POST['file'] : ''; + + if( empty( $plugin_file ) || empty( $plugin_slug ) ) { + wp_send_json_error( __( 'You don\'t have set any slug and file name to install the plugins' ) ); + } + + $plugin_status = $this->install_plugin( $plugin_slug, $plugin_file ); + $this->fail_on_error( $plugin_status ); + + wp_send_json_success(); + } + + /** + * Install and activate a plugin + * + * @param string $slug + * @param string $file + * + * @return WP_Error|null + */ + public function install_plugin( $slug, $file ) { + include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + + $plugin_basename = $slug . '/' . $file; + + // if exists and not activated + if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_basename ) ) { + return activate_plugin( $plugin_basename ); + } + + // seems like the plugin doesn't exists. Download and activate it + $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); + + $api = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); + $result = $upgrader->install( $api->download_link ); + + if ( is_wp_error( $result ) ) { + return $result; + } + + return activate_plugin( $plugin_basename ); + } + } + /** + * Initiate The Core Installer + */ + new WPDeveloper_Core_Installer(); +endif; + diff --git a/includes/class-wpdev-notices.php b/includes/class-wpdev-notices.php new file mode 100755 index 000000000..b495837c3 --- /dev/null +++ b/includes/class-wpdev-notices.php @@ -0,0 +1,782 @@ + true, + // 'next_notice_time' => '', + // 'notice_seen' => [ + // 'opt_in' => false, + // 'first_install' => false, + // 'update' => false, + // 'review' => false, + // 'upsale' => false + // ], + // 'notice_will_show' => [ + // 'opt_in' => true, + // 'first_install' => false, + // 'update' => true, + // 'review' => true, + // 'upsale' => true, + // ] + ); + /** + * Notice ID for users. + * @var string + */ + private $notice_id; + /** + * Upsale Notice Arguments + * @var array + */ + public $upsale_args; + /** + * Revoke this function when the object is created. + * + * @param string $plugin_name + * @param string $version + */ + public function __construct( $plugin_name = '', $version = '' ) { + $this->plugin_name = $plugin_name; + $this->version = $version; + $this->timestamp = current_time( 'timestamp' ); + $this->notice_id = 'wpdeveloper_notice_' . str_replace( '.', '_', $this->version ); + + require dirname( __FILE__ ) . '/class-wpdev-core-install.php'; + + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + if( ! function_exists( 'wp_get_current_user' ) ) { + require_once ABSPATH . 'wp-includes/pluggable.php'; + } + } + + public function init(){ + add_action( 'activate_' . $this->plugin_name, array( $this, 'first_install_track' ) ); + add_action( 'upgrader_process_complete', array( $this, 'upgrade_completed' ), 10, 2); + add_action( 'deactivate_' . $this->plugin_name, array( $this, 'first_install_end' ) ); + add_action( 'wp_ajax_wpdeveloper_upsale_notice_dissmiss', array( $this, 'upsale_notice_dissmiss' ) ); + add_action( 'wpdeveloper_before_notice', array( $this, 'before' ) ); + add_action( 'wpdeveloper_after_notice', array( $this, 'after' ) ); + add_action( 'wpdeveloper_before_upsale_notice', array( $this, 'before_upsale' ) ); + add_action( 'wpdeveloper_after_upsale_notice', array( $this, 'after' ) ); + add_action( 'wpdeveloper_notices', array( $this, 'content' ) ); + if( current_user_can( 'install_plugins' ) ) { + $this->clicked(); + $current_notice = $this->next_notice(); + $deserve_notice = $this->deserve_notice( $current_notice ); + $options_data = $this->get_options_data(); + + $notice_time = isset( $options_data[ $this->plugin_name ]['notice_will_show'][ $current_notice ] ) + ? $options_data[ $this->plugin_name ]['notice_will_show'][ $current_notice ] : $this->timestamp; + $current_notice_end = $this->makeTime( $notice_time, $this->cne_time ); + + if( $deserve_notice ) { + /** + * TODO: automatic maybe later setup with time. + */ + + if( $this->timestamp >= $current_notice_end ) { + $this->maybe_later( $current_notice ); + $notice_time = false; + } + + if( isset( $options_data[ $this->plugin_name ]['current_notice_start'] ) ) { + $current_notice_start = $options_data[ $this->plugin_name ]['current_notice_start']; + } else { + $current_notice_start = $this->timestamp; + } + + if( $notice_time != false ) { + if( $notice_time <= $this->timestamp ) { + if( $current_notice === 'upsale' ) { + $upsale_args = $this->get_upsale_args(); + $plugins = get_plugins(); + $pkey = $upsale_args['slug'] . '/' . $upsale_args['file']; + + if( isset( $plugins[ $pkey ] ) ) { + return; + } + add_action( 'admin_notices', array( $this, 'upsale_notice' ) ); + } else { + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); + } + } + } + } + + } + + } + + public function makeTime( $current, $time ) { + return strtotime( date('Y-m-d H:i:s', $current) . " +$time" ); + } + + private function maybe_later( $notice ){ + $options_data = $this->get_options_data(); + $options_data[ $this->plugin_name ]['notice_will_show'][ $notice ] = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + $this->update_options_data( $options_data[ $this->plugin_name ] ); + } + /** + * When links are clicked, this function will invoked. + * @return void + */ + public function clicked(){ + if( ! isset( $_GET['notice_action'] ) || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'wpdeveloper-nonce' ) ) { + return; + } + if( isset( $_GET['notice_action'] ) && $_GET['notice_action'] === $this->plugin_name ) { + $options_data = $this->get_options_data(); + $clicked_from = $this->next_notice(); + extract($_GET); + + $later_time = ''; + + switch( $clicked_from ) { + + case 'opt_in' : + $later_time = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + break; + + case 'first_install' : + $later_time = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + break; + + case 'update' : + $later_time = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + break; + + case 'review' : + $later_time = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + break; + + case 'upsale' : + $later_time = $this->makeTime( $this->timestamp, $this->maybe_later_time ); + break; + + } + + if( isset( $later ) && $later == true ) { + $options_data[ $this->plugin_name ]['notice_will_show'][ $clicked_from ] = $later_time; + } + if( isset( $dismiss ) && $dismiss == true ) { + $user_notices = $this->get_user_notices(); + if( ! $user_notices ) { + $user_notices = []; + } + $user_notices[ $this->notice_id ][ $this->plugin_name ][] = $clicked_from; + + update_user_meta( get_current_user_id(), self::ADMIN_UPDATE_NOTICE_KEY, $user_notices); + } + $this->update_options_data( $options_data[ $this->plugin_name ] ); + wp_safe_redirect( $this->redirect_url ); + } + } + /** + * Before Notice + * @return void + */ + public function before(){ + $current_notice = $this->next_notice(); + $classes = 'notice notice-info put-dismiss-notice'; + if( isset( $this->data['classes'] ) ) { + if( isset( $this->data['classes'][ $current_notice ] ) ) { + $classes = $this->data['classes'][ $current_notice ]; + } + } + + if( $this->has_thumbnail( $current_notice ) ) { + $classes .= 'notice-has-thumbnail'; + } + + echo '
'; + } + /** + * After Notice + * @return void + */ + public function after(){ + echo '
'; + } + /** + * Content generation & Hooks Funciton. + * @return void + */ + public function content(){ + $options_data = $this->get_options_data(); + $notice = $this->next_notice(); + + switch( $notice ) { + case 'opt_in' : + do_action('wpdeveloper_optin_notice'); + $this->get_thumbnail( 'opt_in' ); + $this->get_message( 'opt_in' ); + break; + case 'first_install' : + if( $options_data[ $this->plugin_name ]['first_install'] !== 'deactivated' ) { + do_action('wpdeveloper_first_install_notice'); + $this->get_thumbnail( 'first_install' ); + $this->get_message( 'first_install' ); + } + break; + case 'update' : + do_action('wpdeveloper_update_notice'); + $this->get_thumbnail( 'update' ); + $this->get_message( 'update' ); + break; + case 'review' : + do_action('wpdeveloper_review_notice'); + $this->get_thumbnail( 'review' ); + $this->get_message( 'review' ); + break; + } + } + /** + * Before Upsale Notice + * @return void + */ + public function before_upsale(){ + $classes = ''; + if( $this->has_thumbnail('upsale') ) { + $classes = 'notice-has-thumbnail'; + } + echo '
'; + } + public function upsale_notice(){ + do_action( 'wpdeveloper_before_upsale_notice' ); + do_action('wpdeveloper_upsale_notice'); + $this->get_thumbnail( 'upsale' ); + $this->get_message( 'upsale' ); + do_action( 'wpdeveloper_after_upsale_notice' ); + $this->upsale_button_script(); + } + + private function get_upsale_args(){ + return $this->upsale_args; + } + + private function upsale_button(){ + $upsale_args = $this->get_upsale_args(); + $plugin_slug = ( isset( $upsale_args['slug'] )) ? $upsale_args['slug'] : '' ; + if( empty( $plugin_slug ) ) { + return; + } + + echo ''; + } + /** + * This methods is responsible for get notice image. + * + * @param string $msg_for + * @return void + */ + protected function get_thumbnail( $msg_for ){ + $output = ''; + if( isset( $this->data['thumbnail'] ) && isset( $this->data['thumbnail'][ $msg_for ] ) ) { + $output = '
'; + $output .= ''; + $output .= '
'; + } + echo $output; + } + /** + * Has Thumbnail Check + * + * @param string $msg_for + * @return boolean + */ + protected function has_thumbnail( $msg_for = '' ){ + if( empty( $msg_for ) ) { + return false; + } + if( isset( $this->data['thumbnail'] ) && isset( $this->data['thumbnail'][ $msg_for ] ) ) { + return true; + } + return false; + } + + /** + * This method is responsible for get messages. + * + * @param string $msg_for + * @return void + */ + protected function get_message( $msg_for ){ + if( isset( $this->data['message'] ) && isset( $this->data['message'][ $msg_for ] ) ) { + echo '
'; + echo $this->data['message'][ $msg_for ]; + if( $msg_for === 'upsale' ) { + $this->upsale_button(); + } + $this->dismissible_notice( $msg_for ); + echo '
'; + } + } + /** + * Detect which notice will show @ next. + * @return void + */ + protected function next_notice(){ + $options_data = $this->get_options_data(); + if( ! $options_data ) { + $args = $this->get_args(); + $return_notice = $args['notice_will_show']; + } else { + $return_notice = $options_data[ $this->plugin_name ]['notice_will_show']; + } + + $deserve_notice_timestamp = INF; + $deserve_notice = ''; + foreach( $return_notice as $notice => $timestamp ) { + if( $timestamp <= $deserve_notice_timestamp ) { + $deserve_notice_timestamp = $timestamp; + $deserve_notice = $notice; + } + } + return $deserve_notice; + } + + private function deserve_notice( $notice ) { + $notices = $this->get_user_notices(); + if( empty( $notices ) ) { + return true; + } else { + if( isset( $notices[ $this->notice_id ] ) && isset( $notices[ $this->notice_id ][ $this->plugin_name ] ) ) { + if( in_array( $notice, $notices[ $this->notice_id ][ $this->plugin_name ] ) ) { + return false; + } + } else { + return true; + } + } + } + + /** + * This is the main methods for generate the notice. + * @return void + */ + public function admin_notices(){ + do_action( 'wpdeveloper_before_notice' ); + do_action( 'wpdeveloper_notices' ); + do_action( 'wpdeveloper_after_notice' ); + } + /** + * This method is responsible for all dismissible links generation. + * @param string $links_for + * @return void + */ + public function dismissible_notice( $links_for = '' ){ + if( empty( $links_for ) ) { + return; + } + $links = isset( $this->data['links'][ $links_for ] ) ? $this->data['links'][ $links_for ] : false; + if( $links ) : + $output = ''; + echo $output; + endif; + } + /** + * First Installation Track + * + * @return void + */ + public function first_install_track( $args = array() ){ + if( empty( $args ) ) { + $args = array( + 'time' => $this->timestamp, + ); + } + $options_data = $this->get_options_data(); + $args = wp_parse_args( $args, $this->get_args() ); + + if( ! isset( $options_data[ $this->plugin_name ] ) ) { + $this->update_options_data( $args ); + } + } + /** + * First Installation Deactive Track + * + * @return void + */ + public function first_install_end(){ + // $args = array( + // 'first_install' => 'deactivated' + // ); + // $options_data = $this->get_options_data(); + // if( isset( $options_data[ $this->plugin_name ] ) ) { + // $args = wp_parse_args( $args, $options_data[ $this->plugin_name ] ); + // $this->update_options_data( $args ); + // } + delete_option( 'wpdeveloper_plugins_data' ); + } + /** + * Get all options from database! + * @return void + */ + protected function get_options_data( $key = ''){ + $options_data = get_option( 'wpdeveloper_plugins_data' ); + if( empty( $key ) ) { + return $options_data; + } + + if( isset( $options_data[ $this->plugin_name ][ $key ] ) ) { + return $options_data[ $this->plugin_name ][ $key ]; + } + return false; + } + /** + * This will update the options table for plugins. + * + * @param mixed $new_data + * @param array $args + * @return void + */ + protected function update_options_data( $args = array() ){ + $options_data = $this->get_options_data(); + $options_data[ $this->plugin_name ] = $args; + update_option( 'wpdeveloper_plugins_data', $options_data ); + } + /** + * Set properties data, for some selected properties. + * + * @param string $name + * @param mixed $value + */ + public function __set( $name, $value ){ + if( in_array( $name, $this->properties ) ) { + $this->data[ $name ] = $value; + } + } + /** + * Invoked when some selected methods are called + * + * @param string $name + * @param array $values + * @return void + */ + public function __call( $name, $values ){ + if( in_array( $name, $this->methods ) ) { + $this->data[ $name ][ $values[0] ] = $values[1]; + } + } + + private function get_args( $key = '' ){ + if( empty( $key ) ) { + return $this->options_args; + } + + if( isset( $this->options_args[ $key ] ) ) { + return $this->options_args[ $key ]; + } + + return false; + } + + public function upgrade_completed( $upgrader_object, $options ) { + // If an update has taken place and the updated type is plugins and the plugins element exists + if( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) { + // Iterate through the plugins being updated and check if ours is there + foreach( $options['plugins'] as $plugin ) { + if( $plugin == $this->plugin_name ) { + $this->first_install_track( array( + 'update_time' => $this->timestamp + ) ); + } + } + } + } + /** + * This function is responsible for get_user_notices + * @return void + */ + private function get_user_notices() { + return get_user_meta( get_current_user_id(), self::ADMIN_UPDATE_NOTICE_KEY, true ); + } + + public function upsale_notice_dissmiss(){ + $dismiss = isset( $_POST['dismiss'] ) ? $_POST['dismiss'] : false; + + if( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'wpdeveloper_upsale_notice_dissmiss' ) ) { + return; + } + + if( ! isset( $_POST['action'] ) || ( $_POST['action'] !== 'wpdeveloper_upsale_notice_dissmiss' ) ) { + return; + } + + if( $dismiss ) { + $user_notices = $this->get_user_notices(); + if( ! $user_notices ) { + $user_notices = []; + } + $user_notices[ $this->notice_id ][ $this->plugin_name ][] = 'upsale'; + + update_user_meta( get_current_user_id(), self::ADMIN_UPDATE_NOTICE_KEY, $user_notices); + echo 'success'; + } else { + echo 'failed'; + } + die(); + } + + public function upsale_button_script(){ + $upsale_args = $this->get_upsale_args(); + + $plugin_slug = ( isset( $upsale_args['slug'] ) ) ? $upsale_args['slug'] : ''; + $plugin_file = ( isset( $upsale_args['file'] ) ) ? $upsale_args['file'] : ''; + $page_slug = ( isset( $upsale_args['page_slug'] ) ) ? $upsale_args['page_slug'] : ''; + + ?> + + + links = [ + 'review' => array( + 'later' => array( + 'link' => 'https://wpdeveloper.net/review-essential-addons-elementor', + 'target' => '_blank', + 'label' => __( 'Ok, you deserve it!', 'essential-addons-elementor' ), + 'icon_class' => 'dashicons dashicons-external', + ), + 'allready' => array( + 'link' => $url, + 'label' => __( 'I already did', 'essential-addons-elementor' ), + 'icon_class' => 'dashicons dashicons-smiley', + 'data_args' => [ + 'dismiss' => true, + ] + ), + 'maybe_later' => array( + 'link' => $url, + 'label' => __( 'Maybe Later', 'essential-addons-elementor' ), + 'icon_class' => 'dashicons dashicons-calendar-alt', + 'data_args' => [ + 'later' => true, + ] + ), + 'support' => array( + 'link' => 'https://wpdeveloper.net/support', + 'label' => __( 'I need help', 'essential-addons-elementor' ), + 'icon_class' => 'dashicons dashicons-sos', + ), + 'never_show_again' => array( + 'link' => $url, + 'label' => __( 'Never show again', 'essential-addons-elementor' ), + 'icon_class' => 'dashicons dashicons-dismiss', + 'data_args' => [ + 'dismiss' => true, + ] + ), + ) +]; + +/** + * This is upsale notice settings + * classes for wrapper, + * Message message for showing. + */ +$notice->classes( 'upsale', 'notice is-dismissible' ); +$notice->message( 'upsale', '

'. __( 'Get the missing Drag & Drop Post Calendar feature for WordPress for Free!', 'essential-addons-elementor' ) .'

' ); +$notice->thumbnail( 'upsale', plugins_url( 'admin/assets/images/wpsp-logo.svg', ESSENTIAL_ADDONS_BASENAME ) ); + +/** + * This is review message and thumbnail. + */ +$notice->message( 'review', '

'. __( 'We hope you\'re enjoying Essential Addons for Elementor! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'essential-addons-elementor' ) .'

' ); +$notice->thumbnail( 'review', plugins_url( 'admin/assets/images/ea-logo.svg', ESSENTIAL_ADDONS_BASENAME ) ); + +/** + * Current Notice End Time. + * Notice will dismiss in 1 days if user does nothing. + */ +$notice->cne_time = '3 Day'; +$notice->redirect_url = admin_url( 'admin.php?page=eael-settings' ); +/** + * Current Notice Maybe Later Time. + * Notice will show again in 7 days + */ +$notice->maybe_later_time = '7 Day'; + +$notice->upsale_args = array( + 'slug' => 'wp-scheduled-posts', + 'page_slug' => 'wpsp-schedule-calendar', + 'file' => 'wp-scheduled-posts.php' +); + +$notice->options_args = array( + 'notice_seen' => [ + 'review' => false, + 'upsale' => false, + ], + 'notice_will_show' => [ + 'review' => $notice->makeTime( $notice->timestamp, '4 Day' ), // after 4 days + 'upsale' => $notice->makeTime( $notice->timestamp, '2 Hour' ), // will be after 2 hours + ] +); + +$notice->init(); \ No newline at end of file diff --git a/includes/eael-rollback.php b/includes/eael-rollback.php index ab8fc5a4e..da52e3076 100755 --- a/includes/eael-rollback.php +++ b/includes/eael-rollback.php @@ -20,13 +20,6 @@ final class EAEL_Rollback { */ private static $instance; - /** - * Plugin repo url. - * - * @var string - */ - public $plugins_repo = 'http://plugins.svn.wordpress.org'; - /** * Plugin file. * @@ -46,7 +39,46 @@ final class EAEL_Rollback { * * @var array */ - public $versions; + public $versions = [ + '2.8.6', + '2.8.5', + '2.8.4', + '2.8.3', + '2.8.2', + '2.8.1', + '2.8.0', + '2.7.1', + '2.7.1', + '2.7.9', + '2.7.8', + '2.7.7', + '2.7.6', + '2.7.5', + '2.7.4', + '2.7.3', + '2.7.2', + '2.7.1', + '2.7.0', + '2.6.0', + '2.5.0', + '2.4.3', + '2.4.2', + '2.4.1', + '2.4.0', + '2.3.1', + '2.3.0', + '2.2.5', + '2.2.4', + '2.2.3', + '2.2.2', + '2.2.1', + '2.2.0', + '2.1', + '2.0', + '1.1.0', + '1.0.1', + '1.0.0' + ]; /** * Current version. @@ -73,13 +105,14 @@ public static function instance() { // Only setup plugin rollback on specific page. self::$instance->setup_plugin_vars(); - self::$instance->get_plugin_data(); + // self::$instance->get_plugin_data(); } return self::$instance; } public function __construct() { add_filter( 'insert_eael_versions_html', [$this, 'versions_select'] ); + $this->get_plugin_data(); } /** @@ -88,8 +121,6 @@ public function __construct() { * @access private */ private function setup_plugin_vars() { - $svn_tags = $this->get_svn_tags(); - $this->set_svn_versions_data($svn_tags); $this->versions_select('plugin'); } @@ -111,55 +142,6 @@ public function get_plugin_data() { } } - /** - * Get Subversion Tags - * - * cURL wp.org repo to get the proper tags - * - * @param $type - * @param $slug - * @return null|string - */ - public function get_svn_tags() { - $url = $this->plugins_repo . '/' . $this->plugin_slug . '/tags/'; - - $response = wp_remote_get($url); - - // If we have an error - if( wp_remote_retrieve_response_code( $response ) !== 200) return null; - - // Return response body - return wp_remote_retrieve_body( $response ); - } - - /** - * Set SVN Version Data - * - * @param $html - * - * @return array|bool - */ - public function set_svn_versions_data( $html ) { - if( ! $html ) return false; - - $DOM = new DOMDocument; - $DOM->loadHTML( $html ); - - $versions = []; - $items = $DOM->getElementsByTagName('a'); - - foreach( $items as $item ) { - $href = str_replace( '/', '', $item->getAttribute('href') ); // Remove trailing slash - - if( strpos( $href, 'http' ) === false && '..' !== $href ) { - $versions[] = $href; - } - } - - $this->versions = array_reverse( $versions ); - return $versions; - } - /** * Versions Select * @@ -178,7 +160,7 @@ public function versions_select( $vh ) { // Loop through versions and output in a radio list foreach( $this->versions as $v ) { - + // Is this the current version? if( $v == $this->current_version ) { $vh .= '