-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
913 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
if( !function_exists('gbt_th_theme_warning') ) { | ||
function gbt_th_theme_warning() { | ||
|
||
?> | ||
|
||
<div class="error"> | ||
<p>The Hanger Extender plugin couldn't find the Block Editor (Gutenberg) on this site. It requires WordPress 5+ or Gutenberg installed as a plugin.</p> | ||
</div> | ||
|
||
<?php | ||
} | ||
} | ||
|
||
if( !function_exists('is_wp_version') ) { | ||
function is_wp_version( $operator, $version ) { | ||
|
||
global $wp_version; | ||
|
||
return version_compare( $wp_version, $version, $operator ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.widget_theme_ecommerce_info { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; } | ||
.widget_theme_ecommerce_info .ecommerce-info-widget-txt-wrapper .ecommerce-info-widget-title { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; } | ||
.widget_theme_ecommerce_info .ecommerce-info-widget-txt-wrapper .ecommerce-info-widget-title .ecommerce-info-widget-icon { | ||
font-size: 24px; | ||
margin-right: 16px; | ||
line-height: 1; } | ||
.widget_theme_ecommerce_info .ecommerce-info-widget-txt-wrapper .ecommerce-info-widget-title .widget-title { | ||
margin-bottom: 4px; } | ||
.widget_theme_ecommerce_info .ecommerce-info-widget-txt-wrapper .ecommerce-info-widget-subtitle { | ||
padding-left: 2.5rem; } |
93 changes: 93 additions & 0 deletions
93
includes/widgets/assets/css/widget-product-categories-with-icon.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li { | ||
border-bottom: 1px solid; | ||
margin: 0; | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
-ms-flex-wrap: wrap; | ||
flex-wrap: wrap; | ||
cursor: pointer; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li:last-child { | ||
border-bottom: 0; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li .dropdown_icon:before { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-pack: end; | ||
-ms-flex-pack: end; | ||
justify-content: flex-end; | ||
-webkit-transition: -webkit-transform .7s; | ||
transition: -webkit-transform .7s; | ||
-o-transition: transform .7s; | ||
transition: transform .7s; | ||
transition: transform .7s, -webkit-transform .7s; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li.active-item .dropdown_icon:before { | ||
-webkit-transform: rotateX(180deg) rotateY(0deg) rotateZ(0deg); | ||
transform: rotateX(180deg) rotateY(0deg) rotateZ(0deg); } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children { | ||
margin: 0px 0.5rem 1rem 2.5rem; | ||
width: 100%; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children.add_scroll { | ||
max-height: 200px; | ||
overflow-y: scroll; | ||
margin-bottom: 1.5rem; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children.add_scroll::-webkit-scrollbar-track { | ||
border-radius: 3px; | ||
background: rgba(0, 0, 0, 0.1); } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children.add_scroll::-webkit-scrollbar { | ||
width: 2px; | ||
background: rgba(0, 0, 0, 0.1); } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children.add_scroll::-webkit-scrollbar-thumb { | ||
border-radius: 3px; | ||
background: rgba(0, 0, 0, 0.1); } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children li [class^="thehanger-icons-"], | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > ul.children li [class*=" thehanger-icons-"] { | ||
display: none; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > a { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
min-height: 4.5em; | ||
padding-top: 1.2em; | ||
padding-bottom: 1.2em; | ||
max-width: 70%; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > a i { | ||
font-size: 1.5rem; | ||
padding-right: 0.9375rem; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li > a img { | ||
width: 1.5rem; | ||
margin-right: 0.9375rem; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > li .count { | ||
margin-left: 0.1875rem; } | ||
|
||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent { | ||
position: relative; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent.no-icon > .children { | ||
margin-left: 1.25rem; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent.current-cat-parent.active ul.children { | ||
display: block; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent .dropdown_icon { | ||
-webkit-transition: all .3s ease-in-out; | ||
-o-transition: all .3s ease-in-out; | ||
transition: all .3s ease-in-out; | ||
padding: 0.25rem; | ||
font-size: 0.5rem; | ||
-webkit-box-flex: 1; | ||
-ms-flex-positive: 1; | ||
flex-grow: 1; | ||
-webkit-box-pack: end; | ||
-ms-flex-pack: end; | ||
justify-content: flex-end; | ||
text-align: right; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent .cat-item { | ||
margin-bottom: 0.3125rem; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent > .children { | ||
display: none; } | ||
.widget.woocommerce.widget_product_categories_with_icon .product-categories-with-icon > .cat-parent > .children li ul.children { | ||
margin: 0.5rem 0.5rem 0px 1.25rem; } |
41 changes: 41 additions & 0 deletions
41
includes/widgets/assets/js/widget-product-categories-with-icon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
jQuery(function($) { | ||
|
||
"use strict"; | ||
|
||
$('.product-categories-with-icon').on('click', '.cat-parent .dropdown_icon', function() { | ||
$(this).parent().toggleClass('active-item'); | ||
$(this).siblings("ul.children").slideToggle('300', function() { | ||
}); | ||
}); | ||
|
||
// If there is more than 8 categories than add scroll class | ||
// If the user is inside the category, keep the widget category open | ||
|
||
$('.product-categories-with-icon .cat-item').each(function() { | ||
|
||
var max_subcategory_nr = 8 | ||
var subcategory_nr = $(this).find("ul.children").find('li').length; | ||
|
||
if ( subcategory_nr > max_subcategory_nr ) { | ||
$(this).find("ul.children").addClass('add_scroll'); | ||
} | ||
|
||
if ( $(this).hasClass('current-cat') ) { | ||
$(this).addClass('active-item'); | ||
$(this).find("ul.children").show(); | ||
} | ||
|
||
if ( $(this).hasClass('current-cat-parent') ) { | ||
$(this).addClass('active-item'); | ||
$(this).find("ul.children").show(); | ||
} | ||
|
||
if ( $(this).hasClass('cat-parent') ) { | ||
if ( ! $(this).find('i').length ) { | ||
$(this).addClass('no-icon'); | ||
} | ||
} | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.widget_theme_ecommerce_info | ||
{ | ||
display: flex; | ||
|
||
.ecommerce-info-widget-txt-wrapper | ||
{ | ||
.ecommerce-info-widget-title | ||
{ | ||
display: flex; | ||
align-items: center; | ||
|
||
.ecommerce-info-widget-icon | ||
{ | ||
font-size: 24px; | ||
margin-right: 16px; | ||
line-height: 1; | ||
} | ||
|
||
.widget-title | ||
{ | ||
margin-bottom: 4px; | ||
} | ||
} | ||
|
||
.ecommerce-info-widget-subtitle | ||
{ | ||
padding-left: 2.5rem; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.