summaryrefslogtreecommitdiff
path: root/inc/builder/type/header/primary-header/assets
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/header/primary-header/assets
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/header/primary-header/assets')
-rw-r--r--inc/builder/type/header/primary-header/assets/js/minified/customizer-preview.min.js1
-rw-r--r--inc/builder/type/header/primary-header/assets/js/unminified/customizer-preview.js152
2 files changed, 153 insertions, 0 deletions
diff --git a/inc/builder/type/header/primary-header/assets/js/minified/customizer-preview.min.js b/inc/builder/type/header/primary-header/assets/js/minified/customizer-preview.min.js
new file mode 100644
index 0000000..993c385
--- /dev/null
+++ b/inc/builder/type/header/primary-header/assets/js/minified/customizer-preview.min.js
@@ -0,0 +1 @@
+!function(){var t=AstraBuilderPrimaryHeaderData.tablet_break_point||768,r=AstraBuilderPrimaryHeaderData.mobile_break_point||544;wp.customize("astra-settings[hb-header-height]",function(a){a.bind(function(a){var e;""==a.desktop&&""==a.tablet&&""==a.mobile||(e="",e+=".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {",e+="min-height: "+a.desktop+"px;",e+="} ",e+=".ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item {",e+="line-height: "+a.desktop+"px;",e+="} ",e+="@media (max-width: "+t+"px) {",e+=".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {",e+="min-height: "+a.tablet+"px;",e+="} ",e+="} ",e+="@media (max-width: "+r+"px) {",e+=".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {",e+="min-height: "+a.mobile+"px;",e+="} ",e+="} ",astra_add_dynamic_css("hb-header-height",e))})}),wp.customize("astra-settings[hb-header-main-layout-width]",function(a){a.bind(function(a){var e="";"content"!==a?(e+="#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {",e+="max-width: unset;",e+="padding-left: 35px;",e+="padding-right: 35px;"):(e="#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {",e+="max-width: 100%",e+="padding-left: 20px;",e+="padding-right: 20px;"),e+="} ",e+="@media (max-width: "+AstraBuilderPrimaryHeaderData.header_break_point+"px) {",e+="#masthead .ast-mobile-header-wrap .ast-above-header-bar, #masthead .ast-mobile-header-wrap .ast-primary-header-bar, #masthead .ast-mobile-header-wrap .ast-below-header-bar {",e+="padding-left: 20px;",e+="padding-right: 20px;",e+="} ",e+="} ",astra_add_dynamic_css("hb-header-main-layout-width",e)})}),wp.customize("astra-settings[hb-header-main-sep]",function(a){a.bind(function(a){var e="";e+=".ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar {",e+="border-bottom-width: "+a+"px;",e+="border-bottom-style: solid;",e+="border-color:"+wp.customize("astra-settings[hb-header-main-sep-color]").get()+";",e+="}",astra_add_dynamic_css("hb-header-main-sep",e)})}),astra_css("astra-settings[hb-header-main-sep-color]","border-color",".ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar"),astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".main-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".ast-primary-header.main-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".ast-primary-header.main-header-bar","mobile"),astra_builder_advanced_css("section-primary-header-builder",".ast-desktop .ast-primary-header-bar, .ast-header-break-point .ast-primary-header-bar"),astra_builder_visibility_css("section-primary-header-builder",".ast-primary-header-bar","grid"),wp.customize("astra-settings[section-header-builder-layout-margin]",function(a){a.bind(function(a){var e;""==a.desktop.bottom&&""==a.desktop.top&&""==a.desktop.left&&""==a.desktop.right&&""==a.tablet.bottom&&""==a.tablet.top&&""==a.tablet.left&&""==a.tablet.right&&""==a.mobile.bottom&&""==a.mobile.top&&""==a.mobile.left&&""==a.mobile.right||(e="",e+=".ast-hfb-header .site-header {",e+="margin-left: "+a.desktop.left+a["desktop-unit"]+";",e+="margin-right: "+a.desktop.right+a["desktop-unit"]+";",e+="margin-top: "+a.desktop.top+a["desktop-unit"]+";",e+="margin-bottom: "+a.desktop.bottom+a["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+t+"px) {",e+=".ast-hfb-header .site-header {",e+="margin-left: "+a.tablet.left+a["tablet-unit"]+";",e+="margin-right: "+a.tablet.right+a["tablet-unit"]+";",e+="margin-top: "+a.tablet.top+a["desktop-unit"]+";",e+="margin-bottom: "+a.tablet.bottom+a["desktop-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+r+"px) {",e+=".ast-hfb-header .site-header {",e+="margin-left: "+a.mobile.left+a["mobile-unit"]+";",e+="margin-right: "+a.mobile.right+a["mobile-unit"]+";",e+="margin-top: "+a.mobile.top+a["desktop-unit"]+";",e+="margin-bottom: "+a.mobile.bottom+a["desktop-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("section-header-builder-layout-margin-toggle-button",e))})})}(jQuery); \ No newline at end of file
diff --git a/inc/builder/type/header/primary-header/assets/js/unminified/customizer-preview.js b/inc/builder/type/header/primary-header/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..1118135
--- /dev/null
+++ b/inc/builder/type/header/primary-header/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,152 @@
+/**
+ * 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 3.0.0
+ */
+
+( function( $ ) {
+
+ var tablet_break_point = AstraBuilderPrimaryHeaderData.tablet_break_point || 768,
+ mobile_break_point = AstraBuilderPrimaryHeaderData.mobile_break_point || 544;
+
+ wp.customize( 'astra-settings[hb-header-height]', function( value ) {
+ value.bind( function( size ) {
+
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += '.ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {';
+ dynamicStyle += 'min-height: ' + size.desktop + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '.ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item {';
+ dynamicStyle += 'line-height: ' + size.desktop + 'px;';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += '.ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {';
+ dynamicStyle += 'min-height: ' + size.tablet + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += '.ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {';
+ dynamicStyle += 'min-height: ' + size.mobile + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'hb-header-height', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Primary Header - Layout > Content Width.
+ wp.customize( 'astra-settings[hb-header-main-layout-width]', function( setting ) {
+ setting.bind( function( layout ) {
+
+ var dynamicStyle = '';
+
+ if ( 'content' !== layout ) {
+ dynamicStyle += '#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {';
+ dynamicStyle += 'max-width: unset;';
+ dynamicStyle += 'padding-left: 35px;';
+ dynamicStyle += 'padding-right: 35px;';
+ dynamicStyle += '} ';
+
+ } else {
+ dynamicStyle = '#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {';
+ dynamicStyle += 'max-width: 100%';
+ dynamicStyle += 'padding-left: 20px;';
+ dynamicStyle += 'padding-right: 20px;';
+ dynamicStyle += '} ';
+ }
+
+ dynamicStyle += '@media (max-width: ' + AstraBuilderPrimaryHeaderData.header_break_point + 'px) {';
+ dynamicStyle += '#masthead .ast-mobile-header-wrap .ast-above-header-bar, #masthead .ast-mobile-header-wrap .ast-primary-header-bar, #masthead .ast-mobile-header-wrap .ast-below-header-bar {';
+ dynamicStyle += 'padding-left: 20px;';
+ dynamicStyle += 'padding-right: 20px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'hb-header-main-layout-width', dynamicStyle );
+ } );
+ } );
+
+ // Border Bottom width.
+ wp.customize( 'astra-settings[hb-header-main-sep]', function( value ) {
+ value.bind( function( border ) {
+
+ var color = wp.customize( 'astra-settings[hb-header-main-sep-color]' ).get(),
+ dynamicStyle = '';
+
+ dynamicStyle += '.ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar {';
+ dynamicStyle += 'border-bottom-width: ' + border + 'px;';
+ dynamicStyle += 'border-bottom-style: solid;';
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'hb-header-main-sep', dynamicStyle );
+
+ } );
+ } );
+
+ // Border Color.
+ astra_css(
+ 'astra-settings[hb-header-main-sep-color]',
+ 'border-color',
+ '.ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar'
+ );
+
+ // Responsive BG styles > Primary Header Row.
+ astra_apply_responsive_background_css( 'astra-settings[hb-header-bg-obj-responsive]', '.main-header-bar', 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[hb-header-bg-obj-responsive]', '.ast-primary-header.main-header-bar', 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[hb-header-bg-obj-responsive]', '.ast-primary-header.main-header-bar', 'mobile' );
+
+ // Advanced CSS Generation.
+ astra_builder_advanced_css( 'section-primary-header-builder', '.ast-desktop .ast-primary-header-bar, .ast-header-break-point .ast-primary-header-bar' );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( 'section-primary-header-builder', '.ast-primary-header-bar', 'grid' );
+
+ // Advanced CSS for Header Builder - Margin.
+ wp.customize( 'astra-settings[section-header-builder-layout-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 dynamicStyle = '';
+ dynamicStyle += '.ast-hfb-header .site-header {';
+ 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 += '.ast-hfb-header .site-header {';
+ 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 += '.ast-hfb-header .site-header {';
+ 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( 'section-header-builder-layout-margin-toggle-button', dynamicStyle );
+ }
+ } );
+ } );
+
+
+} )( jQuery );