8889841cclass-astra-primary-header.php000064400000002367150515336460012421 0ustar00 astra_header_break_point(), 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Primary_Header_Loader(); assets/js/minified/customizer-preview.min.js000064400000010011150515336460015252 0ustar00!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=(e=(e=(e=(e=(e="")+".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {min-height: "+a.desktop+"px;} .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item {")+"line-height: "+a.desktop+"px;} ")+"@media (max-width: "+t+"px) {.ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {")+"min-height: "+a.tablet+"px;} ")+"} @media (max-width: "+r+"px) {")+".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {min-height: "+a.mobile+"px;} } ",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 {max-width: unset;padding-left: 35px;padding-right: 35px;} ":e="#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {max-width: 100%padding-left: 20px;padding-right: 20px;} ",e=e+("@media (max-width: "+AstraBuilderPrimaryHeaderData.header_break_point)+"px) {#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 {padding-left: 20px;padding-right: 20px;} } ",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=(e=(e+=".ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar {")+("border-bottom-width: "+a+"px;")+"border-bottom-style: solid;")+("border-color:"+wp.customize("astra-settings[hb-header-main-sep-color]").get()+";")+"}";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=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e="")+".ast-hfb-header .site-header {margin-left: "+a.desktop.left+a["desktop-unit"]+";")+"margin-right: "+a.desktop.right+a["desktop-unit"]+";")+"margin-top: "+a.desktop.top+a["desktop-unit"]+";")+"margin-bottom: "+a.desktop.bottom+a["desktop-unit"]+";")+"} @media (max-width: "+t+"px) {")+".ast-hfb-header .site-header {margin-left: "+a.tablet.left+a["tablet-unit"]+";")+"margin-right: "+a.tablet.right+a["tablet-unit"]+";")+"margin-top: "+a.tablet.top+a["desktop-unit"]+";")+"margin-bottom: "+a.tablet.bottom+a["desktop-unit"]+";} ")+"} @media (max-width: "+r+"px) {")+".ast-hfb-header .site-header {margin-left: "+a.mobile.left+a["mobile-unit"]+";")+"margin-right: "+a.mobile.right+a["mobile-unit"]+";")+"margin-top: "+a.mobile.top+a["desktop-unit"]+";")+"margin-bottom: "+a.mobile.bottom+a["desktop-unit"]+";} } ",astra_add_dynamic_css("section-header-builder-layout-margin-toggle-button",e))})})}(jQuery);assets/js/unminified/customizer-preview.js000064400000016214150515336460015046 0ustar00/** * 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 ); dynamic-css/dynamic.css.php000064400000021603150515336460011714 0ustar00 array( 'min-height' => astra_get_css_value( $hb_header_height_desktop, 'px' ), ), '.ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item' => array( 'line-height' => astra_get_css_value( $hb_header_height_desktop, 'px' ), ), ); $parse_css .= astra_parse_css( $common_css_output ); if ( Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) || Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ) { $common_css_cart_output = array( '.ast-desktop .ast-primary-header-bar .ast-header-woo-cart, .ast-desktop .ast-primary-header-bar .ast-header-edd-cart' => array( 'line-height' => astra_get_css_value( $hb_header_height_desktop, 'px' ), 'min-height' => astra_get_css_value( $hb_header_height_desktop, 'px' ), ), '.woocommerce .ast-site-header-cart, .ast-site-header-cart' => array( 'display' => 'flex', 'flex-wrap' => 'wrap', 'align-items' => 'center', ), ); $parse_css .= astra_parse_css( $common_css_cart_output ); } $astra_header_width = astra_get_option( 'hb-header-main-layout-width' ); $header_breadcrumb_position = astra_get_option( 'breadcrumb-position' ); /* Width for Header */ if ( 'content' !== $astra_header_width ) { $general_global_responsive = array( '#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper' => array( 'max-width' => '100%', 'padding-left' => '35px', 'padding-right' => '35px', ), ); /* Parse CSS from array()*/ $parse_css .= astra_parse_css( $general_global_responsive ); } elseif ( 'astra_header_primary_container_after' == $header_breadcrumb_position ) { $site_content_width = astra_get_option( 'site-content-width', 1200 ); $general_global_responsive = array( '.site-header-focus-item + .ast-breadcrumbs-wrapper' => array( 'max-width' => astra_get_css_value( $site_content_width + 40, 'px' ), 'margin-left' => 'auto', 'margin-right' => 'auto', 'padding-left' => '20px', 'padding-right' => '20px', ), ); /* Parse CSS from array()*/ $parse_css .= astra_parse_css( $general_global_responsive ); } $padding_below_breakpoint = array( '.ast-header-break-point #masthead .ast-mobile-header-wrap .ast-primary-header-bar, .ast-header-break-point #masthead .ast-mobile-header-wrap .ast-below-header-bar, .ast-header-break-point #masthead .ast-mobile-header-wrap .ast-above-header-bar' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), ); $parse_css .= astra_parse_css( $padding_below_breakpoint ); // Header Separator. $header_separator = astra_get_option( 'hb-header-main-sep' ); // Apply border only when it has positive value. if ( '' !== $header_separator && 'inherit' !== $header_separator ) { $header_separator_color = astra_get_option( 'hb-header-main-sep-color' ); $border_responsive_style = array( '.ast-header-break-point .ast-primary-header-bar' => array( 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), 'border-bottom-color' => esc_attr( $header_separator_color ), 'border-bottom-style' => 'solid', ), ); $border_desktop_style = array( '.ast-primary-header-bar' => array( 'border-bottom-width' => astra_get_css_value( $header_separator, 'px' ), 'border-bottom-color' => esc_attr( $header_separator_color ), 'border-bottom-style' => 'solid', ), ); } else { $border_responsive_style = array( '.ast-header-break-point .ast-primary-header-bar' => array( 'border-bottom-style' => 'none', ), ); $border_desktop_style = array( '.ast-primary-header-bar' => array( 'border-bottom-style' => 'none', ), ); } $parse_css .= astra_parse_css( $border_responsive_style ); $parse_css .= astra_parse_css( $border_desktop_style, astra_get_tablet_breakpoint( '', 1 ) ); $header_bg_obj = astra_get_option( 'hb-header-bg-obj-responsive' ); /** * Responsive Colors options * Header Responsive Background with Image */ $desktop_colors = array( '.ast-primary-header-bar' => astra_get_responsive_background_obj( $header_bg_obj, 'desktop' ), ); $tablet_colors = array( '.ast-primary-header-bar.ast-primary-header' => astra_get_responsive_background_obj( $header_bg_obj, 'tablet' ), '.ast-mobile-header-wrap .ast-primary-header-bar, .ast-primary-header-bar .site-primary-header-wrap' => array( 'min-height' => astra_get_css_value( $hb_header_height_tablet, 'px' ), ), ); $mobile_colors = array( '.ast-primary-header-bar.ast-primary-header' => astra_get_responsive_background_obj( $header_bg_obj, 'mobile' ), '.ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap' => array( 'min-height' => astra_get_css_value( $hb_header_height_mobile, 'px' ), ), ); /* Parse CSS from array() */ /** * Tweak - Check for AMP Support. */ $parse_css .= apply_filters( 'astra_addon_colors_dynamic_css_desktop', astra_parse_css( $desktop_colors ) ); $parse_css .= apply_filters( 'astra_addon_colors_dynamic_css_tablet', astra_parse_css( $tablet_colors, '', astra_get_tablet_breakpoint() ) ); $parse_css .= apply_filters( 'astra_addon_colors_dynamic_css_mobile', astra_parse_css( $mobile_colors, '', astra_get_mobile_breakpoint() ) ); /** * Tweak - $remove_bottom_sire_brancing - Search in Astra Pro. */ // Trim white space for faster page loading. $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $parse_css ); $_section = 'section-primary-header-builder'; $parent_selector = '.ast-desktop .ast-primary-header-bar.main-header-bar, .ast-header-break-point #masthead .ast-primary-header-bar.main-header-bar'; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( $_section, $parent_selector ); $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, '.ast-primary-header-bar', 'block', 'grid' ); // Advanced CSS for Header Builder. $margin = astra_get_option( 'section-header-builder-layout-margin' ); // Desktop CSS. $css_output_desktop = array( '.ast-hfb-header .site-header' => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ), ), ); // Tablet CSS. $css_output_tablet = array( '.ast-hfb-header .site-header' => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ), ), ); // Mobile CSS. $css_output_mobile = array( '.ast-hfb-header .site-header' => array( // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ), ), ); $dynamic_css .= astra_parse_css( $css_output_desktop ); $dynamic_css .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $dynamic_css; }