summaryrefslogtreecommitdiff
path: root/inc/builder/type/header/account/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'inc/builder/type/header/account/assets/js')
-rw-r--r--inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js1
-rw-r--r--inc/builder/type/header/account/assets/js/unminified/customizer-preview.js140
2 files changed, 141 insertions, 0 deletions
diff --git a/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js b/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js
new file mode 100644
index 0000000..2088bcb
--- /dev/null
+++ b/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js
@@ -0,0 +1 @@
+!function(){var o=astraBuilderPreview.tablet_break_point||768,i=astraBuilderPreview.mobile_break_point||544,e=".ast-header-account-wrap";wp.customize("astra-settings[header-account-icon-color]",function(t){t.bind(function(t){var a=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), "+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg circle, .ast-mobile-popup-content"+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), .ast-mobile-popup-content "+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg circle {";a+="fill: "+(t=t||"inherit")+";",a+="} ",astra_add_dynamic_css("header-account-icon-color",a)})}),astra_responsive_font_size("astra-settings[font-size-section-header-account]",e+" .ast-header-account-text"),astra_css("astra-settings[header-account-type-text-color]","color",e+" .ast-header-account-text, .ast-mobile-popup-content "+e+" .ast-header-account-text"),wp.customize("astra-settings[header-account-icon-size]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.desktop+"px;",a+="width: "+t.desktop+"px;",a+="} ",a+="@media (max-width: "+o+"px) {",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.tablet+"px;",a+="width: "+t.tablet+"px;",a+="} ",a+="} ",a+="@media (max-width: "+i+"px) {",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.mobile+"px;",a+="width: "+t.mobile+"px;",a+="} ",a+="} ",astra_add_dynamic_css("header-account-icon-size",a))})}),wp.customize("astra-settings[header-account-image-width]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.desktop+"px;",a+="} ",a+="@media (max-width: "+o+"px) {",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.tablet+"px;",a+="} ",a+="} ",a+="@media (max-width: "+i+"px) {",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.mobile+"px;",a+="} ",a+="} ",astra_add_dynamic_css("header-account-image-width",a))})}),wp.customize("astra-settings[header-account-margin]",function(t){t.bind(function(t){var a,e;""==t.desktop.bottom&&""==t.desktop.top&&""==t.desktop.left&&""==t.desktop.right&&""==t.tablet.bottom&&""==t.tablet.top&&""==t.tablet.left&&""==t.tablet.right&&""==t.mobile.bottom&&""==t.mobile.top&&""==t.mobile.left&&""==t.mobile.right||(e="",e+=(a=".ast-header-account-wrap")+" {",e+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",e+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",e+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+o+"px) {",e+=a+" {",e+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",e+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",e+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+i+"px) {",e+=a+" {",e+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",e+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",e+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("header-account-margin",e))})}),astra_builder_visibility_css("section-header-account",'.ast-header-account[data-section="section-header-account"]')}(jQuery); \ No newline at end of file
diff --git a/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js b/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..8bafe1f
--- /dev/null
+++ b/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,140 @@
+/**
+ * This file adds some LIVE to the Customizer live preview. To leverage
+ * this, set your custom settings to 'postMessage' and then add your handling
+ * here. Your javascript should grab settings from customizer controls, and
+ * then make any necessary changes to the page using jQuery.
+ *
+ * @package Astra
+ * @since x.x.x
+ */
+
+( function( $ ) {
+
+ var tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
+ mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
+
+ var selector = '.ast-header-account-wrap';
+ var section = 'section-header-account';
+ var visibility_selector = '.ast-header-account[data-section="section-header-account"]';
+
+ wp.customize( 'astra-settings[header-account-icon-color]', function( value ) {
+ value.bind( function( color ) {
+ if( ! color ) {
+ color = 'inherit';
+ }
+ var dynamicStyle = selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), ' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle, .ast-mobile-popup-content' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), .ast-mobile-popup-content ' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle {';
+ dynamicStyle += 'fill: ' + color + ';';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-icon-color', dynamicStyle );
+ } );
+ } );
+
+ // Typography CSS Generation.
+ astra_responsive_font_size(
+ 'astra-settings[font-size-section-header-account]',
+ selector + ' .ast-header-account-text'
+ );
+
+ // Text size.
+ astra_css(
+ 'astra-settings[header-account-type-text-color]',
+ 'color',
+ selector + ' .ast-header-account-text, .ast-mobile-popup-content ' + selector + ' .ast-header-account-text'
+ );
+
+ // Icon Size.
+ wp.customize( 'astra-settings[header-account-icon-size]', function( value ) {
+ value.bind( function( size ) {
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.desktop + 'px' + ';';
+ dynamicStyle += 'width: ' + size.desktop + 'px' + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.tablet + 'px' + ';';
+ dynamicStyle += 'width: ' + size.tablet + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.mobile + 'px' + ';';
+ dynamicStyle += 'width: ' + size.mobile + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-icon-size', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Image Width.
+ wp.customize( 'astra-settings[header-account-image-width]', function( value ) {
+ value.bind( function( size ) {
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.desktop + 'px' + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.tablet + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.mobile + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-image-width', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Margin.
+ wp.customize( 'astra-settings[header-account-margin]', function( value ) {
+ value.bind( function( margin ) {
+ if(
+ margin.desktop.bottom != '' || margin.desktop.top != '' || margin.desktop.left != '' || margin.desktop.right != '' ||
+ margin.tablet.bottom != '' || margin.tablet.top != '' || margin.tablet.left != '' || margin.tablet.right != '' ||
+ margin.mobile.bottom != '' || margin.mobile.top != '' || margin.mobile.left != '' || margin.mobile.right != ''
+ ) {
+ var selector = '.ast-header-account-wrap';
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-margin', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( section, visibility_selector );
+
+} )( jQuery );