File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/header.tar
Back
mobile-trigger/dynamic-css/dynamic.css.php 0000644 00000024330 15104467203 0014616 0 ustar 00 <?php /** * Mobile Trigger - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Mobile Trigger. */ add_filter( 'astra_dynamic_theme_css', 'astra_mobile_trigger_row_setting', 11 ); /** * Mobile Trigger - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_mobile_trigger_row_setting( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'mobile-trigger', 'header', 'mobile' ) && ! Astra_Builder_Helper::is_component_loaded( 'mobile-trigger', 'header', 'desktop' ) ) { return $dynamic_css; } $_section = 'section-header-mobile-trigger'; $selector = '[data-section="section-header-mobile-trigger"]'; $theme_color = astra_get_option( 'theme-color' ); $icon_size = astra_get_option( 'mobile-header-toggle-icon-size' ); $trigger_bg = astra_get_option( 'mobile-header-toggle-btn-bg-color', $theme_color ); $trigger_border_width = astra_get_option( 'mobile-header-toggle-btn-border-size' ); $trigger_border_color = astra_get_option( 'mobile-header-toggle-border-color', $trigger_bg ); $trigger_border_radius_fields = astra_get_option( 'mobile-header-toggle-border-radius-fields' ); $font_size = astra_get_option( 'mobile-header-label-font-size' ); $style = astra_get_option( 'mobile-header-toggle-btn-style' ); $default = '#ffffff'; if ( 'fill' !== $style ) { $default = $theme_color; } $icon_color = astra_get_option( 'mobile-header-toggle-btn-color', $default ); // Border. $trigger_border_width_top = isset( $trigger_border_width ) && isset( $trigger_border_width['top'] ) ? $trigger_border_width['top'] : 0; $trigger_border_width_bottom = isset( $trigger_border_width ) && isset( $trigger_border_width['bottom'] ) ? $trigger_border_width['bottom'] : 0; $trigger_border_width_right = isset( $trigger_border_width ) && isset( $trigger_border_width['right'] ) ? $trigger_border_width['right'] : 0; $trigger_border_width_left = isset( $trigger_border_width ) && isset( $trigger_border_width['left'] ) ? $trigger_border_width['left'] : 0; $margin = astra_get_option( $_section . '-margin' ); $margin_selector = $selector . ' .ast-button-wrap .menu-toggle'; /** * Off-Canvas CSS. */ $css_output = array( $selector . ' .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg' => array( 'width' => astra_get_css_value( $icon_size, 'px' ), 'height' => astra_get_css_value( $icon_size, 'px' ), 'fill' => $icon_color, ), $selector . ' .ast-button-wrap .mobile-menu-wrap .mobile-menu' => array( // Color. 'color' => $icon_color, // Typography. 'font-size' => astra_get_css_value( $font_size, 'px' ), ), $margin_selector => 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' ), ), ); // Execute all cases in customizer preview. $is_customizer = false; if ( is_customize_preview() ) { $is_customizer = true; } switch ( $style ) { case 'minimal': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment $css_output_minimal = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' => array( // Color & Border. 'color' => esc_attr( $icon_color ), 'border' => 'none', 'background' => 'transparent', ), ); $dynamic_css .= astra_parse_css( $css_output_minimal ); if ( false === $is_customizer ) { break; } // no break case 'fill': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment $css_output_fill = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' => array( // Color & Border. 'color' => esc_attr( $icon_color ), 'border' => 'none', 'background' => esc_attr( $trigger_bg ), 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'desktop' ), ), ); $css_output_fill_tablet = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' => array( 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'tablet' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'tablet' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'tablet' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'tablet' ), ), ); $css_output_fill_mobile = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' => array( 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'mobile' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'mobile' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'mobile' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'mobile' ), ), ); $dynamic_css .= astra_parse_css( $css_output_fill ); $dynamic_css .= astra_parse_css( $css_output_fill_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_fill_mobile, '', astra_get_mobile_breakpoint() ); if ( false === $is_customizer ) { break; } // no break case 'outline': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment $css_output_outline = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' => array( 'background' => 'transparent', 'color' => esc_attr( $icon_color ), 'border-top-width' => astra_get_css_value( $trigger_border_width_top, 'px' ), 'border-bottom-width' => astra_get_css_value( $trigger_border_width_bottom, 'px' ), 'border-right-width' => astra_get_css_value( $trigger_border_width_right, 'px' ), 'border-left-width' => astra_get_css_value( $trigger_border_width_left, 'px' ), 'border-style' => 'solid', 'border-color' => $trigger_border_color, 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'desktop' ), ), ); $css_output_outline_tablet = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' => array( 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'tablet' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'tablet' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'tablet' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'tablet' ), ), ); $css_output_outline_mobile = array( $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' => array( 'border-top-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'top', 'mobile' ), 'border-top-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'right', 'mobile' ), 'border-bottom-right-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'bottom', 'mobile' ), 'border-bottom-left-radius' => astra_responsive_spacing( $trigger_border_radius_fields, 'left', 'mobile' ), ), ); $dynamic_css .= astra_parse_css( $css_output_outline ); $dynamic_css .= astra_parse_css( $css_output_outline_tablet, '', astra_get_tablet_breakpoint() ); $dynamic_css .= astra_parse_css( $css_output_outline_mobile, '', astra_get_mobile_breakpoint() ); if ( false === $is_customizer ) { break; } // no break default: $dynamic_css .= ''; break; } // Tablet CSS. $css_output_tablet = array( $margin_selector => 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( $margin_selector => 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' ), ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; return $dynamic_css; } mobile-trigger/class-astra-mobile-trigger-loader.php 0000644 00000002201 15104467203 0016551 0 ustar 00 <?php /** * Mobile Trigger Loader. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Class Mobile Trigger Loader. * * Loads config files. * * @since 3.0.0 */ class Astra_Mobile_Trigger_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-mobile-trigger-customizer-preview-js', ASTRA_MOBILE_TRIGGER_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Mobile_Trigger_Loader(); mobile-trigger/class-astra-mobile-trigger.php 0000644 00000002216 15104467203 0015313 0 ustar 00 <?php /** * Mobile Trigger. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_MOBILE_TRIGGER_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/mobile-trigger' ); define( 'ASTRA_MOBILE_TRIGGER_URI', ASTRA_THEME_URI . 'inc/builder/type/header/mobile-trigger' ); /** * Mobile Trigger Initial Setup * * @since 3.0.0 */ class Astra_Mobile_Trigger { /** * Constructor function that initializes required actions and hooks. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_MOBILE_TRIGGER_DIR . '/class-astra-mobile-trigger-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_MOBILE_TRIGGER_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Mobile_Trigger(); mobile-trigger/assets/js/unminified/customizer-preview.js 0000644 00000016111 15104467203 0017744 0 ustar 00 /** * 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 = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; // Trigger Icon Color. astra_css( 'astra-settings[mobile-header-toggle-btn-color]', 'fill', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg' ); // Trigger Label Color. astra_css( 'astra-settings[mobile-header-toggle-btn-color]', 'color', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-wrap .mobile-menu' ); // Trigger Icon Width. astra_css( 'astra-settings[mobile-header-toggle-icon-size]', 'width', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg', 'px' ); // Trigger Icon Height. astra_css( 'astra-settings[mobile-header-toggle-icon-size]', 'height', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg', 'px' ); // Trigger Button Background Color. astra_css( 'astra-settings[mobile-header-toggle-btn-bg-color]', 'background', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill' ); // Border Size for Trigger Button. wp.customize( 'astra-settings[mobile-header-toggle-btn-border-size]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle {'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( 'astra-settings[mobile-header-toggle-btn-border-size]', dynamicStyle ); } ); } ); // Border Radius Fields. wp.customize( 'astra-settings[mobile-header-toggle-border-radius-fields]', function( setting ) { setting.bind( function( border ) { let globalSelector = '[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle'; let dynamicStyle = globalSelector + '{ border-top-left-radius :' + border['desktop']['top'] + border['desktop-unit'] + '; border-bottom-right-radius :' + border['desktop']['bottom'] + border['desktop-unit'] + '; border-bottom-left-radius :' + border['desktop']['left'] + border['desktop-unit'] + '; border-top-right-radius :' + border['desktop']['right'] + border['desktop-unit'] + '; } '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) { ' + globalSelector + '{ border-top-left-radius :' + border['tablet']['top'] + border['tablet-unit'] + '; border-bottom-right-radius :' + border['tablet']['bottom'] + border['tablet-unit'] + '; border-bottom-left-radius :' + border['tablet']['left'] + border['tablet-unit'] + '; border-top-right-radius :' + border['tablet']['right'] + border['tablet-unit'] + '; } } '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) { ' + globalSelector + '{ border-top-left-radius :' + border['mobile']['top'] + border['mobile-unit'] + '; border-bottom-right-radius :' + border['mobile']['bottom'] + border['mobile-unit'] + '; border-bottom-left-radius :' + border['mobile']['left'] + border['mobile-unit'] + '; border-top-right-radius :' + border['mobile']['right'] + border['mobile-unit'] + '; } } '; astra_add_dynamic_css( 'astra-settings[mobile-header-toggle-border-radius-fields]', dynamicStyle ); } ); } ); // Border Color. astra_css( 'astra-settings[mobile-header-toggle-border-color]', 'border-color', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline, [data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill' ); // Margin. wp.customize( 'astra-settings[section-header-mobile-trigger' + '-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 = '[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle'; 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-mobile-trigger-margin', dynamicStyle ); } } ); } ); // Trigger Typography. astra_css( 'astra-settings[mobile-header-label-font-size]', 'font-size', '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-wrap .mobile-menu', 'px' ); } )( jQuery ); mobile-trigger/assets/js/minified/customizer-preview.min.js 0000644 00000010440 15104467203 0020162 0 ustar 00 (()=>{var i=astraBuilderPreview.tablet_break_point||768,r=astraBuilderPreview.mobile_break_point||544;astra_css("astra-settings[mobile-header-toggle-btn-color]","fill",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg'),astra_css("astra-settings[mobile-header-toggle-btn-color]","color",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-wrap .mobile-menu'),astra_css("astra-settings[mobile-header-toggle-icon-size]","width",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg',"px"),astra_css("astra-settings[mobile-header-toggle-icon-size]","height",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg',"px"),astra_css("astra-settings[mobile-header-toggle-btn-bg-color]","background",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill'),wp.customize("astra-settings[mobile-header-toggle-btn-border-size]",function(t){t.bind(function(t){var e='[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle {',e=(e=(e+="border-top-width:"+t.top+"px;")+("border-right-width:"+t.right+"px;")+("border-left-width:"+t.left+"px;"))+("border-bottom-width:"+t.bottom+"px;")+"} ";astra_add_dynamic_css("astra-settings[mobile-header-toggle-btn-border-size]",e)})}),wp.customize("astra-settings[mobile-header-toggle-border-radius-fields]",function(t){t.bind(function(t){var e='[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle',o=e+"{ border-top-left-radius :"+t.desktop.top+t["desktop-unit"]+"; border-bottom-right-radius :"+t.desktop.bottom+t["desktop-unit"]+"; border-bottom-left-radius :"+t.desktop.left+t["desktop-unit"]+"; border-top-right-radius :"+t.desktop.right+t["desktop-unit"]+"; } ",o=(o+="@media (max-width: "+i+"px) { "+e+"{ border-top-left-radius :"+t.tablet.top+t["tablet-unit"]+"; border-bottom-right-radius :"+t.tablet.bottom+t["tablet-unit"]+"; border-bottom-left-radius :"+t.tablet.left+t["tablet-unit"]+"; border-top-right-radius :"+t.tablet.right+t["tablet-unit"]+"; } } ")+("@media (max-width: "+r+"px) { "+e+"{ border-top-left-radius :"+t.mobile.top+t["mobile-unit"]+"; border-bottom-right-radius :"+t.mobile.bottom+t["mobile-unit"]+"; border-bottom-left-radius :"+t.mobile.left+t["mobile-unit"]+"; border-top-right-radius :"+t.mobile.right+t["mobile-unit"]+"; } } ");astra_add_dynamic_css("astra-settings[mobile-header-toggle-border-radius-fields]",o)})}),astra_css("astra-settings[mobile-header-toggle-border-color]","border-color",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline, [data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill'),wp.customize("astra-settings[section-header-mobile-trigger-margin]",function(t){t.bind(function(t){var e,o;""==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||(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o="")+(e='[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.main-header-menu-toggle')+" {margin-left: "+t.desktop.left+t["desktop-unit"]+";")+"margin-right: "+t.desktop.right+t["desktop-unit"]+";")+"margin-top: "+t.desktop.top+t["desktop-unit"]+";")+"margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";")+"} @media (max-width: "+i+"px) {")+e+" {margin-left: "+t.tablet.left+t["tablet-unit"]+";")+"margin-right: "+t.tablet.right+t["tablet-unit"]+";")+"margin-top: "+t.tablet.top+t["desktop-unit"]+";")+"margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";} ")+"} @media (max-width: "+r+"px) {")+e+" {margin-left: "+t.mobile.left+t["mobile-unit"]+";")+"margin-right: "+t.mobile.right+t["mobile-unit"]+";")+"margin-top: "+t.mobile.top+t["desktop-unit"]+";")+"margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";} } ",astra_add_dynamic_css("header-mobile-trigger-margin",o))})}),astra_css("astra-settings[mobile-header-label-font-size]","font-size",'[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-wrap .mobile-menu',"px")})(jQuery); off-canvas/dynamic-css/dynamic.css.php 0000644 00000054470 15104467203 0013741 0 ustar 00 <?php /** * Off Canvas - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Off Canvas Row. */ add_filter( 'astra_dynamic_theme_css', 'astra_off_canvas_row_setting', 11 ); /** * Off Canvas Row - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_off_canvas_row_setting( $dynamic_css, $dynamic_css_filtered = '' ) { $selector = '.ast-mobile-popup-drawer.active'; if ( ! Astra_Builder_Helper::is_component_loaded( 'mobile-trigger', 'header' ) && ! is_customize_preview() ) { return $dynamic_css; } $off_canvas_background = astra_get_option( 'off-canvas-background' ); $off_canvas_close_color = astra_get_option( 'off-canvas-close-color' ); $offcanvas_content_alignment = astra_get_option( 'header-offcanvas-content-alignment', 'flex-start' ); $padding = astra_get_option( 'off-canvas-padding' ); $menu_content_alignment = 'center'; $inner_spacing = astra_get_option( 'off-canvas-inner-spacing' ); $mobile_header_type = astra_get_option( 'mobile-header-type' ); $move_body = astra_get_option( 'off-canvas-move-body' ); $is_site_rtl = is_rtl(); $inner_spacing = isset( $inner_spacing ) ? (int) $inner_spacing : ''; if ( 'flex-start' === $offcanvas_content_alignment ) { $menu_content_alignment = $is_site_rtl ? 'right' : 'left'; } elseif ( 'flex-end' === $offcanvas_content_alignment ) { $menu_content_alignment = $is_site_rtl ? 'left' : 'right'; } if ( 'off-canvas' === $mobile_header_type || 'full-width' === $mobile_header_type || is_customize_preview() ) { $dynamic_css .= astra_off_canvas_static_css(); } if ( 'dropdown' === $mobile_header_type || is_customize_preview() ) { $dynamic_css .= astra_dropdown_type_static_css(); } /** * Off-Canvas CSS. */ $css_output = array( $selector . ' .ast-mobile-popup-inner' => astra_get_background_obj( $off_canvas_background ), '.ast-mobile-header-wrap .ast-mobile-header-content, .ast-desktop-header-content' => astra_get_background_obj( $off_canvas_background ), '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content' => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'desktop' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'desktop' ), ), '.ast-mobile-popup-content > *, .ast-mobile-header-content > *, .ast-desktop-popup-content > *, .ast-desktop-header-content > *' => array( 'padding-top' => astra_get_css_value( $inner_spacing, 'px' ), 'padding-bottom' => astra_get_css_value( $inner_spacing, 'px' ), ), '.content-align-' . esc_attr( $offcanvas_content_alignment ) . ' .ast-builder-layout-element' => array( 'justify-content' => esc_attr( $offcanvas_content_alignment ), ), '.content-align-' . esc_attr( $offcanvas_content_alignment ) . ' .main-header-menu' => array( 'text-align' => esc_attr( $menu_content_alignment ), ), ); // Styling to apply when the move body option is disabled. if ( $mobile_header_type === 'dropdown' && ! $move_body ) { $css_output['.ast-desktop-header-content, .ast-mobile-header-content'] = array( 'position' => 'absolute', 'width' => '100%', ); } if ( is_rtl() ) { /** * Off-Canvas CSS if RTL mode is enabled. */ $css_output['.rtl #ast-mobile-popup-wrapper #ast-mobile-popup'] = array( 'pointer-events' => 'none', ); $css_output['.rtl #ast-mobile-popup-wrapper #ast-mobile-popup.active'] = array( 'pointer-events' => 'unset', ); } $css_output[ $selector . ' .menu-toggle-close' ]['color'] = $off_canvas_close_color; /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output ); // Tablet CSS. $css_output_tablet = array( '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content' => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'tablet' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'tablet' ), ), ); $css_output_mobile = array( '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content' => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'mobile' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'mobile' ), ), ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; return $dynamic_css; } /** * Add static CSS for Off-canvas flyout. * * @since 3.4.0 * @return string. */ function astra_off_canvas_static_css() { $off_canvas_css = ' .ast-off-canvas-active body.ast-main-header-nav-open { overflow: hidden; } .ast-mobile-popup-drawer .ast-mobile-popup-overlay { background-color: rgba(0, 0, 0, 0.4); position: fixed; top: 0; right: 0; bottom: 0; left: 0; visibility: hidden; opacity: 0; transition: opacity 0.2s ease-in-out; } .ast-mobile-popup-drawer .ast-mobile-popup-header { -js-display: flex; display: flex; justify-content: flex-end; min-height: calc( 1.2em + 24px); } .ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close { background: transparent; border: 0; font-size: 24px; line-height: 1; padding: .6em; color: inherit; -js-display: flex; display: flex; box-shadow: none; } .ast-mobile-popup-drawer.ast-mobile-popup-full-width .ast-mobile-popup-inner { max-width: none; transition: transform 0s ease-in, opacity 0.2s ease-in; } .ast-mobile-popup-drawer.active { left: 0; opacity: 1; right: 0; z-index: 100000; transition: opacity 0.25s ease-out; } .ast-mobile-popup-drawer.active .ast-mobile-popup-overlay { opacity: 1; cursor: pointer; visibility: visible; } body.admin-bar .ast-mobile-popup-drawer, body.admin-bar .ast-mobile-popup-drawer .ast-mobile-popup-inner { top: 32px; } body.admin-bar.ast-primary-sticky-header-active .ast-mobile-popup-drawer, body.admin-bar.ast-primary-sticky-header-active .ast-mobile-popup-drawer .ast-mobile-popup-inner { top: 0px; } @media (max-width: 782px) { body.admin-bar .ast-mobile-popup-drawer,body.admin-bar .ast-mobile-popup-drawer .ast-mobile-popup-inner { top: 46px; } } .ast-mobile-popup-content > *, .ast-desktop-popup-content > *{ padding: 10px 0; height: auto; } .ast-mobile-popup-content > *:first-child, .ast-desktop-popup-content > *:first-child{ padding-top: 10px; } .ast-mobile-popup-content > .ast-builder-menu, .ast-desktop-popup-content > .ast-builder-menu{ padding-top: 0; } .ast-mobile-popup-content > *:last-child, .ast-desktop-popup-content > *:last-child { padding-bottom: 0; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-icon, .ast-mobile-popup-drawer .main-header-bar-navigation .menu-item-has-children .sub-menu, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-icon { display: none; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.ast-inline-search label, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.ast-inline-search label { width: 100%; } .ast-mobile-popup-content .ast-builder-menu-mobile .main-header-menu, .ast-mobile-popup-content .ast-builder-menu-mobile .main-header-menu .sub-menu { background-color: transparent; } .ast-mobile-popup-content .ast-icon svg { height: .85em; width: .95em; margin-top: 15px; } .ast-mobile-popup-content .ast-icon.icon-search svg { margin-top: 0; } .ast-desktop .ast-desktop-popup-content .astra-menu-animation-slide-up > .menu-item > .sub-menu, .ast-desktop .ast-desktop-popup-content .astra-menu-animation-slide-up > .menu-item .menu-item > .sub-menu, .ast-desktop .ast-desktop-popup-content .astra-menu-animation-slide-down > .menu-item > .sub-menu, .ast-desktop .ast-desktop-popup-content .astra-menu-animation-slide-down > .menu-item .menu-item > .sub-menu, .ast-desktop .ast-desktop-popup-content .astra-menu-animation-fade > .menu-item > .sub-menu, .ast-mobile-popup-drawer.show, .ast-desktop .ast-desktop-popup-content .astra-menu-animation-fade > .menu-item .menu-item > .sub-menu{ opacity: 1; visibility: visible; }'; if ( is_rtl() ) { $off_canvas_css .= ' .ast-mobile-popup-drawer { position: fixed; top: 0; bottom: 0; right: -99999rem; left: 99999rem; transition: opacity 0.25s ease-in, right 0s 0.25s, left 0s 0.25s; opacity: 0; } .ast-mobile-popup-drawer .ast-mobile-popup-inner { width: 100%; transform: translateX(-115%); max-width: 90%; left: 0; top: 0; background: #fafafa; color: #3a3a3a; bottom: 0; opacity: 0; position: fixed; box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.1); -js-display: flex; display: flex; flex-direction: column; transition: transform 0.2s ease-in, opacity 0.2s ease-in; overflow-y:auto; overflow-x:hidden; } .ast-mobile-popup-drawer.ast-mobile-popup-left .ast-mobile-popup-inner { transform: translateX(-115%); left: auto; right: 0; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-popup-drawer .main-header-bar-navigation ul .menu-item .sub-menu .menu-link { padding-right: 30px; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-popup-drawer .main-header-bar-navigation .sub-menu .menu-item .menu-item .menu-link { padding-right: 40px; } .ast-mobile-popup-drawer .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { left: calc( 20px - 0.907em); } .ast-mobile-popup-drawer.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { right: calc( 20px - 0.907em); width: fit-content; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.slide-search, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.slide-search { width: 100%; position: relative; display: block; left: auto; transform: none; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-form, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-form { left: 0; visibility: visible; opacity: 1; position: relative; top: auto; transform: none; padding: 0; display: block; overflow: hidden; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-field, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-field { width: 100%; padding-left: 5.5em; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-submit, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-submit { display: block; position: absolute; height: 100%; top: 0; left: 0; padding: 0 1em; border-radius: 0; }'; } else { $off_canvas_css .= ' .ast-mobile-popup-drawer { position: fixed; top: 0; bottom: 0; left: -99999rem; right: 99999rem; transition: opacity 0.25s ease-in, left 0s 0.25s, right 0s 0.25s; opacity: 0; } .ast-mobile-popup-drawer .ast-mobile-popup-inner { width: 100%; transform: translateX(100%); max-width: 90%; right: 0; top: 0; background: #fafafa; color: #3a3a3a; bottom: 0; opacity: 0; position: fixed; box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.1); -js-display: flex; display: flex; flex-direction: column; transition: transform 0.2s ease-in, opacity 0.2s ease-in; overflow-y:auto; overflow-x:hidden; } .ast-mobile-popup-drawer.ast-mobile-popup-left .ast-mobile-popup-inner { transform: translateX(-100%); right: auto; left: 0; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-popup-drawer .main-header-bar-navigation ul .menu-item .sub-menu .menu-link { padding-left: 30px; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-popup-drawer .main-header-bar-navigation .sub-menu .menu-item .menu-item .menu-link { padding-left: 40px; } .ast-mobile-popup-drawer .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { right: calc( 20px - 0.907em); } .ast-mobile-popup-drawer.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { left: calc( 20px - 0.907em); width: fit-content; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.slide-search, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.slide-search { width: 100%; position: relative; display: block; right: auto; transform: none; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-form, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-form { right: 0; visibility: visible; opacity: 1; position: relative; top: auto; transform: none; padding: 0; display: block; overflow: hidden; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-field, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-field { width: 100%; padding-right: 5.5em; } .ast-mobile-popup-drawer .ast-mobile-popup-content .ast-search-menu-icon .search-submit, .ast-mobile-popup-drawer .ast-desktop-popup-content .ast-search-menu-icon .search-submit { display: block; position: absolute; height: 100%; top: 0; right: 0; padding: 0 1em; border-radius: 0; }'; } // Adding this CSS to bottom because it needs to be load after above style loads. As it required to hide/show flyout offcanvas. $off_canvas_css .= ' .ast-mobile-popup-drawer.active .ast-mobile-popup-inner { opacity: 1; visibility: visible; transform: translateX(0%); }'; return Astra_Enqueue_Scripts::trim_css( $off_canvas_css ); } /** * Add static CSS for Dropdown Type. * * @since 3.4.0 * @return string. */ function astra_dropdown_type_static_css() { $dropdown_type_css = ' .ast-mobile-header-content > *, .ast-desktop-header-content > * { padding: 10px 0; height: auto; } .ast-mobile-header-content > *:first-child, .ast-desktop-header-content > *:first-child { padding-top: 10px; } .ast-mobile-header-content > .ast-builder-menu, .ast-desktop-header-content > .ast-builder-menu { padding-top: 0; } .ast-mobile-header-content > *:last-child, .ast-desktop-header-content > *:last-child { padding-bottom: 0; } .ast-mobile-header-content .ast-search-menu-icon.ast-inline-search label, .ast-desktop-header-content .ast-search-menu-icon.ast-inline-search label { width: 100%; } .ast-desktop-header-content .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before { transform: rotateX(180deg); } #ast-desktop-header .ast-desktop-header-content, .ast-mobile-header-content .ast-search-icon, .ast-desktop-header-content .ast-search-icon, .ast-mobile-header-wrap .ast-mobile-header-content, .ast-main-header-nav-open.ast-popup-nav-open .ast-mobile-header-wrap .ast-mobile-header-content, .ast-main-header-nav-open.ast-popup-nav-open .ast-desktop-header-content { display: none; } .ast-main-header-nav-open.ast-header-break-point #ast-desktop-header .ast-desktop-header-content, .ast-main-header-nav-open.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content { display: block; } .ast-desktop .ast-desktop-header-content .astra-menu-animation-slide-up > .menu-item > .sub-menu, .ast-desktop .ast-desktop-header-content .astra-menu-animation-slide-up > .menu-item .menu-item > .sub-menu, .ast-desktop .ast-desktop-header-content .astra-menu-animation-slide-down > .menu-item > .sub-menu, .ast-desktop .ast-desktop-header-content .astra-menu-animation-slide-down > .menu-item .menu-item > .sub-menu, .ast-desktop .ast-desktop-header-content .astra-menu-animation-fade > .menu-item > .sub-menu, .ast-desktop .ast-desktop-header-content .astra-menu-animation-fade > .menu-item .menu-item > .sub-menu { opacity: 1; visibility: visible; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content .main-header-bar-navigation { width: unset; margin: unset; }'; if ( is_rtl() ) { $dropdown_type_css .= ' .ast-mobile-header-content.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle, .ast-desktop-header-content.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { right: calc( 20px - 0.907em); left: auto; } .ast-mobile-header-content .ast-search-menu-icon, .ast-mobile-header-content .ast-search-menu-icon.slide-search, .ast-desktop-header-content .ast-search-menu-icon, .ast-desktop-header-content .ast-search-menu-icon.slide-search { width: 100%; position: relative; display: block; left: auto; transform: none; } .ast-mobile-header-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-header-content .ast-search-menu-icon .search-form, .ast-desktop-header-content .ast-search-menu-icon.slide-search .search-form, .ast-desktop-header-content .ast-search-menu-icon .search-form { left: 0; visibility: visible; opacity: 1; position: relative; top: auto; transform: none; padding: 0; display: block; overflow: hidden; } .ast-mobile-header-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-header-content .ast-search-menu-icon .search-field, .ast-desktop-header-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-desktop-header-content .ast-search-menu-icon .search-field { width: 100%; padding-left: 5.5em; } .ast-mobile-header-content .ast-search-menu-icon .search-submit, .ast-desktop-header-content .ast-search-menu-icon .search-submit { display: block; position: absolute; height: 100%; top: 0; left: 0; padding: 0 1em; border-radius: 0; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content .main-header-bar-navigation ul .sub-menu .menu-link { padding-right: 30px; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content .main-header-bar-navigation .sub-menu .menu-item .menu-item .menu-link { padding-right: 40px; }'; } else { $dropdown_type_css .= ' .ast-mobile-header-content.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle, .ast-desktop-header-content.content-align-flex-end .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle { left: calc( 20px - 0.907em); right: auto; } .ast-mobile-header-content .ast-search-menu-icon, .ast-mobile-header-content .ast-search-menu-icon.slide-search, .ast-desktop-header-content .ast-search-menu-icon, .ast-desktop-header-content .ast-search-menu-icon.slide-search { width: 100%; position: relative; display: block; right: auto; transform: none; } .ast-mobile-header-content .ast-search-menu-icon.slide-search .search-form, .ast-mobile-header-content .ast-search-menu-icon .search-form, .ast-desktop-header-content .ast-search-menu-icon.slide-search .search-form, .ast-desktop-header-content .ast-search-menu-icon .search-form { right: 0; visibility: visible; opacity: 1; position: relative; top: auto; transform: none; padding: 0; display: block; overflow: hidden; } .ast-mobile-header-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-mobile-header-content .ast-search-menu-icon .search-field, .ast-desktop-header-content .ast-search-menu-icon.ast-inline-search .search-field, .ast-desktop-header-content .ast-search-menu-icon .search-field { width: 100%; padding-right: 5.5em; } .ast-mobile-header-content .ast-search-menu-icon .search-submit, .ast-desktop-header-content .ast-search-menu-icon .search-submit { display: block; position: absolute; height: 100%; top: 0; right: 0; padding: 0 1em; border-radius: 0; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content .main-header-bar-navigation ul .sub-menu .menu-link { padding-left: 30px; } .ast-hfb-header.ast-default-menu-enable.ast-header-break-point .ast-mobile-header-wrap .ast-mobile-header-content .main-header-bar-navigation .sub-menu .menu-item .menu-item .menu-link { padding-left: 40px; }'; } return Astra_Enqueue_Scripts::trim_css( $dropdown_type_css ); } off-canvas/class-astra-off-canvas-loader.php 0000644 00000002156 15104467203 0015010 0 ustar 00 <?php /** * Off Canvas Loader. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Class Astra_Off_Canvas_Loader * * Loads config files. * * @since 3.0.0 */ class Astra_Off_Canvas_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-off-canvas-customizer-preview-js', ASTRA_OFF_CANVAS_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Off_Canvas_Loader(); off-canvas/class-astra-off-canvas.php 0000644 00000002143 15104467203 0013540 0 ustar 00 <?php /** * Off Canvas. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_OFF_CANVAS_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/off-canvas' ); define( 'ASTRA_OFF_CANVAS_URI', ASTRA_THEME_URI . 'inc/builder/type/header/off-canvas' ); /** * Off Canvas Initial Setup * * @since 3.0.0 */ class Astra_Off_Canvas { /** * Constructor function that initializes required actions and hooks. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_OFF_CANVAS_DIR . '/class-astra-off-canvas-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_OFF_CANVAS_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Off_Canvas(); off-canvas/assets/js/unminified/customizer-preview.js 0000644 00000021450 15104467203 0017061 0 ustar 00 /** * 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 = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; // Close Icon Color. astra_css( 'astra-settings[off-canvas-close-color]', 'color', '.ast-mobile-popup-drawer.active .menu-toggle-close' ); // Off-Canvas Background Color. wp.customize( 'astra-settings[off-canvas-background]', function( value ) { value.bind( function( bg_obj ) { var dynamicStyle = ' .ast-mobile-popup-drawer.active .ast-mobile-popup-inner, .ast-mobile-header-wrap .ast-mobile-header-content, .ast-desktop-header-content { {{css}} }'; astra_background_obj_css( wp.customize, bg_obj, 'off-canvas-background', dynamicStyle ); } ); } ); wp.customize( 'astra-settings[off-canvas-inner-spacing]', function ( value ) { value.bind( function ( spacing ) { var dynamicStyle = ''; if( spacing != '' ) { dynamicStyle += '.ast-mobile-popup-content > *, .ast-mobile-header-content > *, .ast-desktop-popup-content > *, .ast-desktop-header-content > * {'; dynamicStyle += 'padding-top: ' + spacing + 'px;'; dynamicStyle += 'padding-bottom: ' + spacing + 'px;'; dynamicStyle += '} '; } astra_add_dynamic_css( 'off-canvas-inner-spacing', dynamicStyle ); } ); } ); wp.customize( 'astra-settings[mobile-header-type]', function ( value ) { value.bind( function ( newVal ) { var mobile_header = document.querySelectorAll( "#ast-mobile-header" ); var desktop_header = document.querySelectorAll( "#ast-desktop-header" ); var header_type = newVal; var off_canvas_slide = ( typeof ( wp.customize._value['astra-settings[off-canvas-slide]'] ) != 'undefined' ) ? wp.customize._value['astra-settings[off-canvas-slide]']._value : 'right'; var side_class = ''; if ( 'off-canvas' === header_type ) { if ( 'left' === off_canvas_slide ) { side_class = 'ast-mobile-popup-left'; } else { side_class = 'ast-mobile-popup-right'; } } else if ( 'full-width' === header_type ) { side_class = 'ast-mobile-popup-full-width'; } jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-left' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-right' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-full-width' ); jQuery('.ast-mobile-popup-drawer').addClass( side_class ); if( 'full-width' === header_type ) { header_type = 'off-canvas'; } for ( var k = 0; k < mobile_header.length; k++ ) { mobile_header[k].setAttribute( 'data-type', header_type ); } for ( var k = 0; k < desktop_header.length; k++ ) { desktop_header[k].setAttribute( 'data-type', header_type ); } var event = new CustomEvent( "astMobileHeaderTypeChange", { "detail": { 'type' : header_type } } ); document.dispatchEvent(event); } ); } ); wp.customize( 'astra-settings[off-canvas-slide]', function ( value ) { value.bind( function ( newval ) { var side_class = ''; if ( 'left' === newval ) { side_class = 'ast-mobile-popup-left'; } else { side_class = 'ast-mobile-popup-right'; } jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-left' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-right' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'ast-mobile-popup-full-width' ); jQuery('.ast-mobile-popup-drawer').addClass( side_class ); } ); } ); // Padding. wp.customize( 'astra-settings[off-canvas-padding]', function( value ) { value.bind( function( padding ) { if( padding.desktop.bottom != '' || padding.desktop.top != '' || padding.desktop.left != '' || padding.desktop.right != '' || padding.tablet.bottom != '' || padding.tablet.top != '' || padding.tablet.left != '' || padding.tablet.right != '' || padding.mobile.bottom != '' || padding.mobile.top != '' || padding.mobile.left != '' || padding.mobile.right != '' ) { var dynamicStyle = ''; dynamicStyle += '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {'; dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {'; dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {'; dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'off-canvas-padding', dynamicStyle ); } else { astra_add_dynamic_css( 'off-canvas-padding', '' ); } } ); } ); wp.customize( 'astra-settings[header-builder-menu-toggle-target]', function ( value ) { value.bind( function ( newval ) { var menuTargetClass = 'ast-builder-menu-toggle-' + newval + ' '; jQuery( '.site-header' ).removeClass( 'ast-builder-menu-toggle-icon' ); jQuery( '.site-header' ).removeClass( 'ast-builder-menu-toggle-link' ); jQuery( '.site-header' ).addClass( menuTargetClass ); } ); } ); wp.customize( 'astra-settings[header-offcanvas-content-alignment]', function ( value ) { value.bind( function ( newval ) { var alignment_class = 'content-align-' + newval + ' '; var menu_content_alignment = 'center'; jQuery('.ast-mobile-header-content').removeClass( 'content-align-flex-start' ); jQuery('.ast-mobile-header-content').removeClass( 'content-align-flex-end' ); jQuery('.ast-mobile-header-content').removeClass( 'content-align-center' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'content-align-flex-end' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'content-align-flex-start' ); jQuery('.ast-mobile-popup-drawer').removeClass( 'content-align-center' ); jQuery('.ast-desktop-header-content').removeClass( 'content-align-flex-start' ); jQuery('.ast-desktop-header-content').removeClass( 'content-align-flex-end' ); jQuery('.ast-desktop-header-content').removeClass( 'content-align-center' ); jQuery('.ast-desktop-header-content').addClass( alignment_class ); jQuery('.ast-mobile-header-content').addClass( alignment_class ); jQuery('.ast-mobile-popup-drawer').addClass( alignment_class ); if ( 'flex-start' === newval ) { menu_content_alignment = 'left'; } else if ( 'flex-end' === newval ) { menu_content_alignment = 'right'; } var dynamicStyle = '.content-align-' + newval + ' .ast-builder-layout-element {'; dynamicStyle += 'justify-content: ' + newval + ';'; dynamicStyle += '} '; dynamicStyle += '.content-align-' + newval + ' .main-header-menu {'; dynamicStyle += 'text-align: ' + menu_content_alignment + ';'; dynamicStyle += '} '; astra_add_dynamic_css( 'header-offcanvas-content-alignment', dynamicStyle ); } ); } ); } )( jQuery ); off-canvas/assets/js/minified/customizer-preview.min.js 0000644 00000012422 15104467203 0017277 0 ustar 00 (()=>{var a=astraBuilderPreview.tablet_break_point||768,o=astraBuilderPreview.mobile_break_point||544;astra_css("astra-settings[off-canvas-close-color]","color",".ast-mobile-popup-drawer.active .menu-toggle-close"),wp.customize("astra-settings[off-canvas-background]",function(e){e.bind(function(e){astra_background_obj_css(wp.customize,e,"off-canvas-background"," .ast-mobile-popup-drawer.active .ast-mobile-popup-inner, .ast-mobile-header-wrap .ast-mobile-header-content, .ast-desktop-header-content { {{css}} }")})}),wp.customize("astra-settings[off-canvas-inner-spacing]",function(e){e.bind(function(e){var t="";""!=e&&(t=(t=t+".ast-mobile-popup-content > *, .ast-mobile-header-content > *, .ast-desktop-popup-content > *, .ast-desktop-header-content > * {padding-top: "+e+"px;")+"padding-bottom: "+e+"px;} "),astra_add_dynamic_css("off-canvas-inner-spacing",t)})}),wp.customize("astra-settings[mobile-header-type]",function(e){e.bind(function(e){var t=document.querySelectorAll("#ast-mobile-header"),a=document.querySelectorAll("#ast-desktop-header"),o=e,e=void 0!==wp.customize._value["astra-settings[off-canvas-slide]"]?wp.customize._value["astra-settings[off-canvas-slide]"]._value:"right",s="";"off-canvas"===o?s="left"===e?"ast-mobile-popup-left":"ast-mobile-popup-right":"full-width"===o&&(s="ast-mobile-popup-full-width"),jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-left"),jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-right"),jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-full-width"),jQuery(".ast-mobile-popup-drawer").addClass(s),"full-width"===o&&(o="off-canvas");for(var n=0;n<t.length;n++)t[n].setAttribute("data-type",o);for(n=0;n<a.length;n++)a[n].setAttribute("data-type",o);e=new CustomEvent("astMobileHeaderTypeChange",{detail:{type:o}});document.dispatchEvent(e)})}),wp.customize("astra-settings[off-canvas-slide]",function(e){e.bind(function(e){var t="",t="left"===e?"ast-mobile-popup-left":"ast-mobile-popup-right";jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-left"),jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-right"),jQuery(".ast-mobile-popup-drawer").removeClass("ast-mobile-popup-full-width"),jQuery(".ast-mobile-popup-drawer").addClass(t)})}),wp.customize("astra-settings[off-canvas-padding]",function(e){e.bind(function(e){var t;""!=e.desktop.bottom||""!=e.desktop.top||""!=e.desktop.left||""!=e.desktop.right||""!=e.tablet.bottom||""!=e.tablet.top||""!=e.tablet.left||""!=e.tablet.right||""!=e.mobile.bottom||""!=e.mobile.top||""!=e.mobile.left||""!=e.mobile.right?(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t="")+".ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {padding-left: "+e.desktop.left+e["desktop-unit"]+";")+"padding-right: "+e.desktop.right+e["desktop-unit"]+";")+"padding-top: "+e.desktop.top+e["desktop-unit"]+";")+"padding-bottom: "+e.desktop.bottom+e["desktop-unit"]+";")+"} @media (max-width: "+a+"px) {")+".ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {padding-left: "+e.tablet.left+e["tablet-unit"]+";")+"padding-right: "+e.tablet.right+e["tablet-unit"]+";")+"padding-top: "+e.tablet.top+e["tablet-unit"]+";")+"padding-bottom: "+e.tablet.bottom+e["tablet-unit"]+";} ")+"} @media (max-width: "+o+"px) {")+".ast-mobile-popup-drawer.active .ast-desktop-popup-content, .ast-mobile-popup-drawer.active .ast-mobile-popup-content {padding-left: "+e.mobile.left+e["mobile-unit"]+";")+"padding-right: "+e.mobile.right+e["mobile-unit"]+";")+"padding-top: "+e.mobile.top+e["mobile-unit"]+";")+"padding-bottom: "+e.mobile.bottom+e["mobile-unit"]+";} } ",astra_add_dynamic_css("off-canvas-padding",t)):astra_add_dynamic_css("off-canvas-padding","")})}),wp.customize("astra-settings[header-builder-menu-toggle-target]",function(e){e.bind(function(e){e="ast-builder-menu-toggle-"+e+" ";jQuery(".site-header").removeClass("ast-builder-menu-toggle-icon"),jQuery(".site-header").removeClass("ast-builder-menu-toggle-link"),jQuery(".site-header").addClass(e)})}),wp.customize("astra-settings[header-offcanvas-content-alignment]",function(e){e.bind(function(e){var t="content-align-"+e+" ",a="center",t=(jQuery(".ast-mobile-header-content").removeClass("content-align-flex-start"),jQuery(".ast-mobile-header-content").removeClass("content-align-flex-end"),jQuery(".ast-mobile-header-content").removeClass("content-align-center"),jQuery(".ast-mobile-popup-drawer").removeClass("content-align-flex-end"),jQuery(".ast-mobile-popup-drawer").removeClass("content-align-flex-start"),jQuery(".ast-mobile-popup-drawer").removeClass("content-align-center"),jQuery(".ast-desktop-header-content").removeClass("content-align-flex-start"),jQuery(".ast-desktop-header-content").removeClass("content-align-flex-end"),jQuery(".ast-desktop-header-content").removeClass("content-align-center"),jQuery(".ast-desktop-header-content").addClass(t),jQuery(".ast-mobile-header-content").addClass(t),jQuery(".ast-mobile-popup-drawer").addClass(t),"flex-start"===e?a="left":"flex-end"===e&&(a="right"),".content-align-"+e+" .ast-builder-layout-element {"),t=(t=(t+="justify-content: "+e+";")+"} "+(".content-align-"+e+" .main-header-menu {"))+("text-align: "+a+";")+"} ";astra_add_dynamic_css("header-offcanvas-content-alignment",t)})})})(jQuery); below-header/dynamic-css/dynamic.css.php 0000644 00000013776 15104467203 0014260 0 ustar 00 <?php /** * Below Header - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Below Header Row. */ add_filter( 'astra_dynamic_theme_css', 'astra_below_header_row_setting', 11 ); /** * Below Header Row - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_below_header_row_setting( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! is_customize_preview() && ( ! Astra_Builder_Helper::is_row_empty( 'below', 'header', 'desktop' ) && ! Astra_Builder_Helper::is_row_empty( 'below', 'header', 'mobile' ) ) ) { return $dynamic_css; } $parse_css = ''; // Common CSS options. $hbb_header_height = astra_get_option( 'hbb-header-height' ); $hbb_header_divider = astra_get_option( 'hbb-header-separator' ); $hbb_border_color = astra_get_option( 'hbb-header-bottom-border-color' ); // Header Height. $hbb_header_height_desktop = isset( $hbb_header_height['desktop'] ) && ! empty( $hbb_header_height['desktop'] ) ? $hbb_header_height['desktop'] : ''; $hbb_header_height_tablet = isset( $hbb_header_height['tablet'] ) && ! empty( $hbb_header_height['tablet'] ) ? $hbb_header_height['tablet'] : ''; $hbb_header_height_mobile = isset( $hbb_header_height['mobile'] ) && ! empty( $hbb_header_height['mobile'] ) ? $hbb_header_height['mobile'] : ''; // Background CSS options. $hbb_header_bg_obj = astra_get_option( 'hbb-header-bg-obj-responsive' ); $desktop_background = isset( $hbb_header_bg_obj['desktop']['background-color'] ) ? $hbb_header_bg_obj['desktop']['background-color'] : ''; $tablet_background = isset( $hbb_header_bg_obj['tablet']['background-color'] ) ? $hbb_header_bg_obj['tablet']['background-color'] : ''; $mobile_background = isset( $hbb_header_bg_obj['mobile']['background-color'] ) ? $hbb_header_bg_obj['mobile']['background-color'] : ''; /** * Below Header General options */ $common_css_output = array( '.ast-below-header .main-header-bar-navigation' => array( 'height' => '100%', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item .menu-link' => array( 'border' => 'none', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item-has-children > .ast-menu-toggle::before' => array( 'font-size' => '.6rem', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-wrap .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( 'transform' => 'rotateX(180deg)', ), '#masthead .ast-mobile-header-wrap .ast-below-header-bar' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), '.ast-mobile-header-wrap .ast-below-header-bar , .ast-below-header-bar .site-below-header-wrap' => array( 'min-height' => astra_get_css_value( $hbb_header_height_desktop, 'px' ), ), '.ast-desktop .ast-below-header-bar .main-header-menu > .menu-item' => array( 'line-height' => astra_get_css_value( $hbb_header_height_desktop, 'px' ), ), '.ast-desktop .ast-below-header-bar .ast-header-woo-cart, .ast-desktop .ast-below-header-bar .ast-header-edd-cart' => array( 'line-height' => astra_get_css_value( $hbb_header_height_desktop, 'px' ), ), ); // Apply border only when it has positive value. if ( '' !== $hbb_header_divider && 'inherit' !== $hbb_header_divider ) { $common_css_output['.ast-below-header-bar'] = array( 'border-bottom-width' => astra_get_css_value( $hbb_header_divider, 'px' ), 'border-bottom-color' => esc_attr( $hbb_border_color ), 'border-bottom-style' => 'solid', ); } else { $common_css_output['.ast-below-header-bar'] = array( 'border-bottom-style' => 'none', ); } $parse_css .= astra_parse_css( $common_css_output ); // Below Header Background Responsive - Desktop. $desktop_bg = array( '.ast-below-header-bar' => astra_get_responsive_background_obj( $hbb_header_bg_obj, 'desktop' ), '.ast-header-break-point .ast-below-header-bar' => array( 'background-color' => esc_attr( $desktop_background ), ), ); $parse_css .= astra_parse_css( $desktop_bg ); // Below Header Background Responsive - Tablet. $tablet_bg = array( '.ast-below-header-bar' => astra_get_responsive_background_obj( $hbb_header_bg_obj, 'tablet' ), '.ast-header-break-point .ast-below-header-bar' => array( 'background-color' => esc_attr( $tablet_background ), ), '.ast-mobile-header-wrap .ast-below-header-bar , .ast-below-header-bar .site-below-header-wrap' => array( 'min-height' => astra_get_css_value( $hbb_header_height_tablet, 'px' ), ), ); $parse_css .= astra_parse_css( $tablet_bg, '', astra_get_tablet_breakpoint() ); // Below Header Background Responsive - Mobile. $mobile_bg = array( '.ast-below-header-bar' => astra_get_responsive_background_obj( $hbb_header_bg_obj, 'mobile' ), '.ast-header-break-point .ast-below-header-bar' => array( 'background-color' => esc_attr( $mobile_background ), ), '.ast-mobile-header-wrap .ast-below-header-bar , .ast-below-header-bar .site-below-header-wrap' => array( 'min-height' => astra_get_css_value( $hbb_header_height_mobile, 'px' ), ), ); $parse_css .= astra_parse_css( $mobile_bg, '', astra_get_mobile_breakpoint() ); // Trim white space for faster page loading. $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $parse_css ); $_section = 'section-below-header-builder'; $parent_selector = '.ast-below-header-bar.ast-below-header, .ast-header-break-point .ast-below-header-bar.ast-below-header'; $dynamic_css .= Astra_Extended_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( $_section, $parent_selector ); $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, '.ast-below-header-bar', 'block', 'grid' ); return $dynamic_css; } below-header/class-astra-below-header-loader.php 0000644 00000002173 15104467203 0015635 0 ustar 00 <?php /** * Below Header Loader. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Class Astra_Below_Header_Loader * * Loads config files. * * @since 3.0.0 */ class Astra_Below_Header_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-below-customizer-preview-js', ASTRA_BELOW_HEADER_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Below_Header_Loader(); below-header/class-astra-below-header.php 0000644 00000002171 15104467203 0014367 0 ustar 00 <?php /** * Below Header. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_BELOW_HEADER_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/below-header' ); define( 'ASTRA_BELOW_HEADER_URI', ASTRA_THEME_URI . 'inc/builder/type/header/below-header' ); /** * Below Header Initial Setup * * @since 3.0.0 */ class Astra_Below_Header { /** * Constructor function that initializes required actions and hooks. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_BELOW_HEADER_DIR . '/class-astra-below-header-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_BELOW_HEADER_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Below_Header(); below-header/assets/js/unminified/customizer-preview.js 0000644 00000007633 15104467203 0017403 0 ustar 00 /** * 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 = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; wp.customize( 'astra-settings[hbb-header-height]', function( value ) { value.bind( function( size ) { if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) { var dynamicStyle = ''; dynamicStyle += '.ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {'; dynamicStyle += 'min-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '.ast-desktop .ast-below-header-bar .main-header-menu > .menu-item {'; dynamicStyle += 'line-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {'; dynamicStyle += 'min-height: ' + size.tablet + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {'; dynamicStyle += 'min-height: ' + size.mobile + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'hbb-header-height', dynamicStyle ); } } ); } ); // Border Bottom width. wp.customize( 'astra-settings[hbb-header-separator]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[hbb-header-bottom-border-color]' ).get(), dynamicStyle = ''; dynamicStyle += '.ast-header-break-point .ast-below-header-bar, .ast-below-header-bar {'; dynamicStyle += 'border-bottom-width: ' + border + 'px;'; dynamicStyle += 'border-bottom-style: solid;'; dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += '}'; astra_add_dynamic_css( 'hbb-header-separator', dynamicStyle ); } ); } ); // Border Color. astra_css( 'astra-settings[hbb-header-bottom-border-color]', 'border-color', '.ast-header-break-point .ast-below-header-bar, .ast-below-header-bar' ); // Responsive BG styles > Below Header Row. astra_apply_responsive_background_css( 'astra-settings[hbb-header-bg-obj-responsive]', '.ast-below-header.ast-below-header-bar', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[hbb-header-bg-obj-responsive]', '.ast-below-header.ast-below-header-bar', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[hbb-header-bg-obj-responsive]', '.ast-below-header.ast-below-header-bar', 'mobile' ); if (document.querySelector(".ast-below-header-bar .site-logo-img")) { astra_apply_responsive_background_css( "astra-settings[hbb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar", "desktop" ); astra_apply_responsive_background_css( "astra-settings[hbb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar", "tablet" ); astra_apply_responsive_background_css( "astra-settings[hbb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar", "mobile" ); } // Advanced CSS Generation. astra_builder_advanced_css( 'section-below-header-builder', '.ast-below-header.ast-below-header-bar' ); // Advanced Visibility CSS Generation. astra_builder_visibility_css( 'section-below-header-builder', '.ast-below-header-bar', 'grid' ); } )( jQuery ); below-header/assets/js/minified/customizer-preview.min.js 0000644 00000005056 15104467203 0017617 0 ustar 00 (()=>{var r=astraBuilderPreview.tablet_break_point||768,s=astraBuilderPreview.mobile_break_point||544;wp.customize("astra-settings[hbb-header-height]",function(e){e.bind(function(e){var a;""==e.desktop&&""==e.tablet&&""==e.mobile||(a=(a=(a=(a=(a=(a=(a="")+".ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {min-height: "+e.desktop+"px;} .ast-desktop .ast-below-header-bar .main-header-menu > .menu-item {")+"line-height: "+e.desktop+"px;} ")+"@media (max-width: "+r+"px) {.ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {")+"min-height: "+e.tablet+"px;} ")+"} @media (max-width: "+s+"px) {")+".ast-below-header-bar .site-below-header-wrap, .ast-mobile-header-wrap .ast-below-header-bar {min-height: "+e.mobile+"px;} } ",astra_add_dynamic_css("hbb-header-height",a))})}),wp.customize("astra-settings[hbb-header-separator]",function(e){e.bind(function(e){var a="",a=(a=(a+=".ast-header-break-point .ast-below-header-bar, .ast-below-header-bar {")+("border-bottom-width: "+e+"px;")+"border-bottom-style: solid;")+("border-color:"+wp.customize("astra-settings[hbb-header-bottom-border-color]").get()+";")+"}";astra_add_dynamic_css("hbb-header-separator",a)})}),astra_css("astra-settings[hbb-header-bottom-border-color]","border-color",".ast-header-break-point .ast-below-header-bar, .ast-below-header-bar"),astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-below-header.ast-below-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-below-header.ast-below-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-below-header.ast-below-header-bar","mobile"),document.querySelector(".ast-below-header-bar .site-logo-img")&&(astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hbb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-below-header.ast-below-header-bar","mobile")),astra_builder_advanced_css("section-below-header-builder",".ast-below-header.ast-below-header-bar"),astra_builder_visibility_css("section-below-header-builder",".ast-below-header-bar","grid")})(jQuery); widget/dynamic-css/dynamic.css.php 0000644 00000001266 15104467203 0013174 0 ustar 00 <?php /** * WIdget control - Dynamic CSS * * @package Astra Builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_widget_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_hb_widget_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $dynamic_css .= Astra_Widget_Component_Dynamic_CSS::astra_widget_dynamic_css( 'header' ); return $dynamic_css; } widget/class-astra-header-widget-component-loader.php 0000644 00000003304 15104467203 0016732 0 ustar 00 <?php /** * WIDGET Styling Loader for Astra theme. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Widget_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-header-widget-customizer-preview-js', ASTRA_BUILDER_HEADER_WIDGET_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for WIDGET JS. wp_localize_script( 'astra-header-widget-customizer-preview-js', 'AstraBuilderWidgetData', array( 'header_widget_count' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_widgets, 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), 'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(), 'has_block_editor' => astra_has_widgets_block_editor(), ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Widget_Component_Loader(); widget/class-astra-header-widget-component.php 0000644 00000002266 15104467203 0015474 0 ustar 00 <?php /** * WIDGET component. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_BUILDER_HEADER_WIDGET_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/widget' ); define( 'ASTRA_BUILDER_HEADER_WIDGET_URI', ASTRA_THEME_URI . 'inc/builder/type/header/widget' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Widget_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_BUILDER_HEADER_WIDGET_DIR . '/class-astra-header-widget-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_BUILDER_HEADER_WIDGET_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Widget_Component(); widget/assets/js/unminified/customizer-preview.js 0000644 00000000637 15104467203 0016325 0 ustar 00 /** * 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 Builder * @since 3.0.0 */ ( function( $ ) { astra_builder_widget_css( 'header' ); } )( jQuery ); widget/assets/js/minified/customizer-preview.min.js 0000644 00000000052 15104467203 0016533 0 ustar 00 jQuery,astra_builder_widget_css("header"); site-identity/class-astra-header-site-identity-component.php 0000644 00000002320 15104467203 0020303 0 ustar 00 <?php /** * Site_Identity for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_SITE_IDENTITY_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/site-identity' ); define( 'ASTRA_HEADER_SITE_IDENTITY_URI', ASTRA_THEME_URI . 'inc/builder/type/header/site-identity' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Site_Identity_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_SITE_IDENTITY_DIR . '/class-astra-header-site-identity-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_SITE_IDENTITY_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Site_Identity_Component(); site-identity/dynamic-css/dynamic.css.php 0000644 00000005021 15104467203 0014475 0 ustar 00 <?php /** * Site Identity - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Site Identity */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_site_identity_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Site Identity. * * @since 3.0.0 */ function astra_hb_site_identity_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'logo', 'header' ) ) { return $dynamic_css; } $_section = 'title_tagline'; $selector = '.ast-builder-layout-element .ast-site-identity'; $visibility_selector = '.ast-builder-layout-element[data-section="title_tagline"]'; $margin = astra_get_option( $_section . '-margin' ); // Desktop CSS. $css_output_desktop = array( $selector => 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( $selector => 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( $selector => 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' ), ), ); $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $visibility_selector ); return $dynamic_css; } site-identity/class-astra-header-site-identity-component-loader.php 0000644 00000002217 15104467203 0021554 0 ustar 00 <?php /** * Site_Identity Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Site_Identity_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-site-identity-customizer-preview-js', ASTRA_HEADER_SITE_IDENTITY_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Site_Identity_Component_Loader(); site-identity/assets/js/unminified/customizer-preview.js 0000644 00000007230 15104467203 0017631 0 ustar 00 /** * 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 HF Builder. * @since 3.0.0 */ ( function( $ ) { wp.customize( 'astra-settings[different-mobile-logo]', function ( value ) { value.bind( function ( newval ) { if ( '1' == newval ) { jQuery('.site-header').addClass( 'ast-has-mobile-header-logo' ); } else { jQuery('.site-header').removeClass( 'ast-has-mobile-header-logo' ); } } ); } ); // Margin. wp.customize( 'astra-settings[title_tagline-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 = '', selector = '.ast-builder-layout-element .ast-site-identity', tablet_break_point = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; 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( 'title_tagline-margin', dynamicStyle ); } } ); } ); var section = 'title_tagline'; var visibility_selector = '.ast-builder-layout-element[data-section="title_tagline"]'; // Advanced Visibility CSS Generation. astra_builder_visibility_css( section, visibility_selector ); } )( jQuery ); site-identity/assets/js/minified/customizer-preview.min.js 0000644 00000003163 15104467203 0020051 0 ustar 00 (()=>{wp.customize("astra-settings[different-mobile-logo]",function(t){t.bind(function(t){"1"==t?jQuery(".site-header").addClass("ast-has-mobile-header-logo"):jQuery(".site-header").removeClass("ast-has-mobile-header-logo")})}),wp.customize("astra-settings[title_tagline-margin]",function(t){t.bind(function(t){var e,i,o;""==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||(o="",e=".ast-builder-layout-element .ast-site-identity",i=astraBuilderPreview.tablet_break_point||768,o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=e+" {margin-left: "+t.desktop.left+t["desktop-unit"]+";")+"margin-right: "+t.desktop.right+t["desktop-unit"]+";")+"margin-top: "+t.desktop.top+t["desktop-unit"]+";")+"margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";")+"} @media (max-width: "+i+"px) {")+e+" {margin-left: "+t.tablet.left+t["tablet-unit"]+";")+"margin-right: "+t.tablet.right+t["tablet-unit"]+";")+"margin-top: "+t.tablet.top+t["desktop-unit"]+";")+"margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";} ")+"} @media (max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) {")+e+" {margin-left: "+t.mobile.left+t["mobile-unit"]+";")+"margin-right: "+t.mobile.right+t["mobile-unit"]+";")+"margin-top: "+t.mobile.top+t["desktop-unit"]+";")+"margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";} } ",astra_add_dynamic_css("title_tagline-margin",o))})}),astra_builder_visibility_css("title_tagline",'.ast-builder-layout-element[data-section="title_tagline"]')})(jQuery); search/dynamic-css/dynamic.css.php 0000644 00000015570 15104467203 0013161 0 ustar 00 <?php /** * Search - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Search */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_search_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Search. * * @since 3.0.0 */ function astra_hb_search_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'search', 'header' ) ) { return $dynamic_css; } $_section = 'section-header-search'; $selector = '.ast-header-search'; $icon_size = astra_get_option( 'header-search-icon-space' ); $search_width = astra_get_option( 'header-search-width' ); $search_type = astra_get_option( 'header-search-box-type' ); $live_search = astra_get_option( 'live-search' ); $search_width_applicable = ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ( 'slide-search' === $search_type || 'search-box' === $search_type ) ) ? true : false; $icon_size_desktop = isset( $icon_size ) && isset( $icon_size['desktop'] ) && ! empty( $icon_size['desktop'] ) ? $icon_size['desktop'] : 20; $icon_size_tablet = isset( $icon_size ) && isset( $icon_size['tablet'] ) && ! empty( $icon_size['tablet'] ) ? $icon_size['tablet'] : 20; $icon_size_mobile = isset( $icon_size ) && isset( $icon_size['mobile'] ) && ! empty( $icon_size['mobile'] ) ? $icon_size['mobile'] : 20; $icon_color_desktop = astra_get_prop( astra_get_option( 'header-search-icon-color' ), 'desktop' ); $icon_color_tablet = astra_get_prop( astra_get_option( 'header-search-icon-color' ), 'tablet' ); $icon_color_mobile = astra_get_prop( astra_get_option( 'header-search-icon-color' ), 'mobile' ); $margin = astra_get_option( $_section . '-margin' ); $margin_selector = '.ast-hfb-header .site-header-section > .ast-header-search, .ast-hfb-header .ast-header-search'; /** * Search CSS. */ $css_output_desktop = array( $selector . ' .ast-search-menu-icon .search-form .search-field:-ms-input-placeholder,' . $selector . ' .ast-search-menu-icon .search-form .search-field:-ms-input-placeholder' => array( 'opacity' => '0.5', ), $selector . ' .ast-search-menu-icon.slide-search .search-form, .ast-header-search .ast-search-menu-icon.ast-inline-search .search-form' => array( '-js-display' => 'flex', 'display' => 'flex', 'align-items' => 'center', ), '.ast-builder-layout-element.ast-header-search' => array( 'height' => 'auto', ), $selector . ' .astra-search-icon' => array( 'color' => esc_attr( $icon_color_desktop ), 'font-size' => astra_get_css_value( $icon_size_desktop, 'px' ), ), $selector . ' .search-field::placeholder,' . $selector . ' .ast-icon' => array( 'color' => esc_attr( $icon_color_desktop ), ), $margin_selector => 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' ), ), ); if ( $search_width_applicable ) { $css_output_desktop[ $selector . ' form.search-form .search-field, ' . $selector . ' .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field' ] = array( 'width' => astra_get_css_value( astra_get_prop( $search_width, 'desktop' ), 'px' ), ); } if ( $live_search && Astra_Builder_Helper::is_component_loaded( 'search', 'header' ) && ! is_customize_preview() && apply_filters( 'astra_increased_search_icon_zindex', true ) ) { $css_output_desktop['.ast-search-menu-icon'] = array( 'z-index' => '5', // To fix search results container overlapping issue with menu (AST-3605). ); } $css_output_tablet = array( $selector . ' .astra-search-icon' => array( 'color' => esc_attr( $icon_color_tablet ), 'font-size' => astra_get_css_value( $icon_size_tablet, 'px' ), ), $selector . ' .search-field::placeholder,' . $selector . ' .ast-icon' => array( 'color' => esc_attr( $icon_color_tablet ), ), $margin_selector => 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' ), ), ); if ( $search_width_applicable ) { $css_output_tablet[ $selector . ' form.search-form .search-field, ' . $selector . ' .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form' ] = array( 'width' => astra_get_css_value( astra_get_prop( $search_width, 'tablet' ), 'px' ), ); } if ( $live_search && Astra_Builder_Helper::is_component_loaded( 'search', 'header', 'mobile' ) ) { $css_output_tablet['.ast-mobile-header-content .ast-header-search .ast-search-menu-icon .search-form'] = array( 'overflow' => 'visible', // To fix search results container should overflow inside offcanvas (AST-3604). ); } $css_output_mobile = array( $selector . ' .astra-search-icon' => array( 'color' => esc_attr( $icon_color_mobile ), 'font-size' => astra_get_css_value( $icon_size_mobile, 'px' ), ), $selector . ' .search-field::placeholder,' . $selector . ' .ast-icon' => array( 'color' => esc_attr( $icon_color_mobile ), ), $margin_selector => 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' ), ), ); if ( $search_width_applicable ) { $css_output_mobile[ $selector . ' form.search-form .search-field, ' . $selector . ' .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form' ] = array( 'width' => astra_get_css_value( astra_get_prop( $search_width, 'mobile' ), 'px' ), ); } /* Parse CSS from array() */ $css_output = astra_search_static_css(); $css_output .= astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector ); return $dynamic_css; } search/class-astra-header-search-component-loader.php 0000644 00000003303 15104467203 0016675 0 ustar 00 <?php /** * Search Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Search_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_filter( 'astra_get_search', array( $this, 'get_search_markup' ), 10, 3 ); add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-header-builder-search-customizer-preview-js', ASTRA_HEADER_SEARCH_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } /** * Adding Wrapper for Search Form. * * @since 3.0.0 * * @param string $search_markup Search Form Content. * @param string $option Search Form Options. * @param string $device Device Desktop/Tablet/Mobile. * @return Search HTML structure created. */ public static function get_search_markup( $search_markup, $option = '', $device = '' ) { if ( is_customize_preview() ) { Astra_Builder_UI_Controller::render_customizer_edit_button(); } return $search_markup; } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Search_Component_Loader(); search/assets/js/unminified/customizer-preview.js 0000644 00000013616 15104467203 0016310 0 ustar 00 /** * 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 = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; var selector = '.ast-header-search'; var section = 'section-header-search'; // Icon Color. astra_color_responsive_css( 'header-search-icon-color', 'astra-settings[header-search-icon-color]', 'color', selector + ' .astra-search-icon, ' + selector + ' .search-field::placeholder,' + selector + ' .ast-icon' ); // Icon Size. astra_css( 'astra-settings[header-search-icon-space]', 'font-size', selector + ' .astra-search-icon', 'px' ); // Icon Size. wp.customize( 'astra-settings[header-search-icon-space]', function( value ) { value.bind( function( size ) { if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) { var dynamicStyle = ''; dynamicStyle += selector + ' .astra-search-icon {'; dynamicStyle += 'font-size: ' + size.desktop + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += selector + ' .astra-search-icon {'; dynamicStyle += 'font-size: ' + size.tablet + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += selector + ' .astra-search-icon {'; dynamicStyle += 'font-size: ' + size.mobile + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'header-search-icon-space', dynamicStyle ); } } ); } ); wp.customize( 'astra-settings[header-search-width]', function( setting ) { setting.bind( function( width ) { if ( width['desktop'] != '' || width['tablet'] != '' || width['mobile'] != '' ) { var dynamicStyle = '.ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field {'; dynamicStyle += 'width:' + width['desktop'] + 'px;'; dynamicStyle += '} '; dynamicStyle += '@media( max-width: ' + astColors.tablet_break_point + 'px ) {'; dynamicStyle += '.ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form {'; dynamicStyle += 'width:' + width['tablet'] + 'px;'; dynamicStyle += '} }'; dynamicStyle += '@media( max-width: ' + astColors.mobile_break_point + 'px ) {'; dynamicStyle += '.ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form {'; dynamicStyle += 'width:' + width['mobile'] + 'px;'; dynamicStyle += '} }'; astra_add_dynamic_css( 'astra-settings[header-search-width]', dynamicStyle ); } }); }); // Margin. wp.customize( 'astra-settings[section-header-search-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-hfb-header .site-header-section > .ast-header-search, .ast-hfb-header .ast-header-search'; 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-search-margin', dynamicStyle ); } } ); } ); // Advanced Visibility CSS Generation. astra_builder_visibility_css( section, selector ); } )( jQuery ); search/assets/js/minified/customizer-preview.min.js 0000644 00000006160 15104467203 0016523 0 ustar 00 (()=>{var s=astraBuilderPreview.tablet_break_point||768,i=astraBuilderPreview.mobile_break_point||544,a=".ast-header-search";astra_color_responsive_css("header-search-icon-color","astra-settings[header-search-icon-color]","color",a+" .astra-search-icon, "+a+" .search-field::placeholder,"+a+" .ast-icon"),astra_css("astra-settings[header-search-icon-space]","font-size",a+" .astra-search-icon","px"),wp.customize("astra-settings[header-search-icon-space]",function(e){e.bind(function(e){var t;""==e.desktop&&""==e.tablet&&""==e.mobile||(t="",t=(t=(t=(t=(t=(t+=a+" .astra-search-icon {")+"font-size: "+e.desktop+"px;} ")+"@media (max-width: "+s+"px) {"+a+" .astra-search-icon {")+"font-size: "+e.tablet+"px;} ")+"} @media (max-width: "+i+"px) {")+a+" .astra-search-icon {font-size: "+e.mobile+"px;} } ",astra_add_dynamic_css("header-search-icon-space",t))})}),wp.customize("astra-settings[header-search-width]",function(e){e.bind(function(e){var t;""==e.desktop&&""==e.tablet&&""==e.mobile||(t=(t=(t=(t=(t=(t=".ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field {")+"width:"+e.desktop+"px;} ")+"@media( max-width: "+astColors.tablet_break_point+"px ) {.ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form {")+"width:"+e.tablet+"px;} }")+"@media( max-width: "+astColors.mobile_break_point+"px ) {.ast-header-search form.search-form .search-field, .ast-header-search .ast-dropdown-active.ast-search-menu-icon.slide-search input.search-field, .ast-mobile-header-content .ast-search-menu-icon .search-form {")+"width:"+e.mobile+"px;} }",astra_add_dynamic_css("astra-settings[header-search-width]",t))})}),wp.customize("astra-settings[section-header-search-margin]",function(e){e.bind(function(e){var t,a;""==e.desktop.bottom&&""==e.desktop.top&&""==e.desktop.left&&""==e.desktop.right&&""==e.tablet.bottom&&""==e.tablet.top&&""==e.tablet.left&&""==e.tablet.right&&""==e.mobile.bottom&&""==e.mobile.top&&""==e.mobile.left&&""==e.mobile.right||(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a="")+(t=".ast-hfb-header .site-header-section > .ast-header-search, .ast-hfb-header .ast-header-search")+" {margin-left: "+e.desktop.left+e["desktop-unit"]+";")+"margin-right: "+e.desktop.right+e["desktop-unit"]+";")+"margin-top: "+e.desktop.top+e["desktop-unit"]+";")+"margin-bottom: "+e.desktop.bottom+e["desktop-unit"]+";")+"} @media (max-width: "+s+"px) {")+t+" {margin-left: "+e.tablet.left+e["tablet-unit"]+";")+"margin-right: "+e.tablet.right+e["tablet-unit"]+";")+"margin-top: "+e.tablet.top+e["desktop-unit"]+";")+"margin-bottom: "+e.tablet.bottom+e["desktop-unit"]+";} ")+"} @media (max-width: "+i+"px) {")+t+" {margin-left: "+e.mobile.left+e["mobile-unit"]+";")+"margin-right: "+e.mobile.right+e["mobile-unit"]+";")+"margin-top: "+e.mobile.top+e["desktop-unit"]+";")+"margin-bottom: "+e.mobile.bottom+e["desktop-unit"]+";} } ",astra_add_dynamic_css("header-search-margin",a))})}),astra_builder_visibility_css("section-header-search",a)})(jQuery); search/class-astra-header-search-component.php 0000644 00000004402 15104467203 0015432 0 ustar 00 <?php /** * Search for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_SEARCH_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/search' ); define( 'ASTRA_HEADER_SEARCH_URI', ASTRA_THEME_URI . 'inc/builder/type/header/search' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Search_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_SEARCH_DIR . '/class-astra-header-search-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_SEARCH_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound add_filter( 'rest_post_query', array( $this, 'astra_update_rest_post_query' ), 10, 2 ); } /** * Update REST Post Query for live search. * * @since 4.4.0 * @param array $args Query args. * @param array $request Request args. * @return array */ public function astra_update_rest_post_query( $args, $request ) { if ( isset( $request['post_type'] ) && ( strpos( $request['post_type'], 'ast_queried' ) !== false ) ) { $search_post_types = explode( ':', sanitize_text_field( $request['post_type'] ) ); $args = array( 'posts_per_page' => ! empty( $args['posts_per_page'] ) ? $args['posts_per_page'] : 10, 'post_type' => $search_post_types, 'paged' => 1, 's' => ! empty( $args['s'] ) ? $args['s'] : '', ); if ( in_array( 'product', $search_post_types ) ) { // Added product visibility checks, excluding hidden or shop-only visibility types. $args['tax_query'][] = array( 'taxonomy' => 'product_visibility', 'field' => 'slug', 'terms' => array( 'exclude-from-search' ), 'operator' => 'NOT IN', ); } } return $args; } } /** * Kicking this off by creating an object. */ new Astra_Header_Search_Component(); html/class-astra-header-html-component.php 0000644 00000002202 15104467203 0014624 0 ustar 00 <?php /** * HTML component. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_HTML_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/html' ); define( 'ASTRA_HEADER_HTML_URI', ASTRA_THEME_URI . 'inc/builder/type/header/html' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Html_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_HTML_DIR . '/class-astra-header-html-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_HTML_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Html_Component(); html/dynamic-css/dynamic.css.php 0000644 00000001254 15104467203 0012652 0 ustar 00 <?php /** * HTML control - Dynamic CSS * * @package Astra Builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_html_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_hb_html_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $dynamic_css .= Astra_Html_Component_Dynamic_CSS::astra_html_dynamic_css( 'header' ); return $dynamic_css; } html/assets/js/unminified/customizer-preview.js 0000644 00000000706 15104467203 0016003 0 ustar 00 /** * 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 Builder * @since 3.0.0 */ ( function( $ ) { astra_builder_html_css( 'header', AstraBuilderHTMLData.component_limit ); } )( jQuery ); html/assets/js/minified/customizer-preview.min.js 0000644 00000000115 15104467203 0016214 0 ustar 00 jQuery,astra_builder_html_css("header",AstraBuilderHTMLData.component_limit); html/class-astra-header-html-component-loader.php 0000644 00000002646 15104467203 0016104 0 ustar 00 <?php /** * HTML Styling Loader for Astra theme. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Html_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-html-customizer-preview-js', ASTRA_HEADER_HTML_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'ahfb-base-customizer-preview' ), ASTRA_THEME_VERSION, true ); // Localize variables for HTML JS. wp_localize_script( 'astra-heading-html-customizer-preview-js', 'AstraBuilderHTMLData', array( 'component_limit' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_html, ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Html_Component_Loader(); woo-cart/dynamic-css/dynamic.css.php 0000644 00000131232 15104467203 0013441 0 ustar 00 <?php /** * WooCommerce Cart - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Search */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_woo_cart_dynamic_css' ); if ( ! function_exists( 'astra_cart_position' ) ) { /** * Position markup * * @since 3.9.0 * @param string $postion Position. * @param string $device Device type. * @return array */ function astra_cart_position( $postion, $device ) { switch ( $postion ) { case 'bottom': return array( '.ast-cart-' . $device . '-position-bottom' => array( 'flex-direction' => 'column', 'padding-top' => '7px', 'padding-bottom' => '5px', ), '.ast-cart-' . $device . '-position-bottom .ast-woo-header-cart-info-wrap' => array( 'order' => 2, 'line-height' => 1, 'margin-top' => '0.5em', ), ); case 'right': return array( '.ast-cart-' . $device . '-position-right .ast-woo-header-cart-info-wrap' => array( 'order' => 2, 'margin-left' => '0.7em', ), ); case 'left': return array( '.ast-cart-' . $device . '-position-left .ast-woo-header-cart-info-wrap' => array( 'margin-right' => '0.5em', ), ); default: break; } } } /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Search. * * @since 3.0.0 */ function astra_hb_woo_cart_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) ) { return $dynamic_css; } $selector = '.ast-site-header-cart'; $trans_header_selector = 'body.ast-theme-transparent-header .ast-site-header-cart'; $theme_color = astra_get_option( 'theme-color' ); $icon_color = esc_attr( astra_get_option( 'header-woo-cart-icon-color', $theme_color ) ); $icon_hover_color = esc_attr( astra_get_option( 'header-woo-cart-icon-hover-color' ) ); // icon cart hover color. $header_cart_icon_radius_fields = astra_get_option( 'woo-header-cart-icon-radius-fields' ); $cart_h_color = astra_get_foreground_color( $icon_color ); $header_cart_icon_style = astra_get_option( 'woo-header-cart-icon-style' ); $theme_h_color = astra_get_foreground_color( $theme_color ); $cart_products_count_color = astra_get_option( 'woo-header-cart-product-count-color', $theme_h_color ); $cart_products_count_color_hover = astra_get_option( 'woo-header-cart-product-count-h-color' ); $transparent_header_icon_color = esc_attr( astra_get_option( 'transparent-header-woo-cart-icon-color', $icon_color ) ); $transparent_header_cart_h_color = astra_get_foreground_color( $transparent_header_icon_color ); $header_woo_cart_list = astra_get_option( 'woo-header-cart-icon', 'default' ); if ( 'none' === $header_cart_icon_style ) { $icon_color = $theme_color; $transparent_header_icon_color = $theme_color; } /** * - WooCommerce cart styles. */ $cart_text_color = astra_get_option( 'header-woo-cart-text-color' ); $cart_link_color = astra_get_option( 'header-woo-cart-link-color' ); $cart_bg_color = astra_get_option( 'header-woo-cart-background-color' ); $cart_h_bg_color = astra_get_option( 'header-woo-cart-background-hover-color' ); $cart_separator_color = astra_get_option( 'header-woo-cart-separator-color' ); $cart_h_link_color = astra_get_option( 'header-woo-cart-link-hover-color' ); $cart_button_text_color = astra_get_option( 'header-woo-cart-btn-text-color' ); $cart_icon_size = astra_get_option( 'header-woo-cart-icon-size' ); $cart_button_bg_color = astra_get_option( 'header-woo-cart-btn-background-color' ); $cart_button_text_h_color = astra_get_option( 'header-woo-cart-btn-text-hover-color' ); $cart_button_bg_h_color = astra_get_option( 'header-woo-cart-btn-bg-hover-color' ); $checkout_button_text_color = astra_get_option( 'header-woo-checkout-btn-text-color' ); $checkout_button_bg_color = astra_get_option( 'header-woo-checkout-btn-background-color' ); $checkout_button_text_h_color = astra_get_option( 'header-woo-checkout-btn-text-hover-color' ); $checkout_button_bg_h_color = astra_get_option( 'header-woo-checkout-btn-bg-hover-color' ); $cart_total_label_position = astra_get_option( 'woo-header-cart-icon-total-label-position' ); $cart_badge_display = astra_get_option( 'woo-header-cart-badge-display' ); $check_transparent_is_enabled_on = astra_get_option( 'transparent-header-on-devices' ); $header_cart_icon = ''; $cart_text_color_desktop = ! empty( $cart_text_color['desktop'] ) ? $cart_text_color['desktop'] : ''; $cart_text_color_mobile = ! empty( $cart_text_color['mobile'] ) ? $cart_text_color['mobile'] : ''; $cart_text_color_tablet = ! empty( $cart_text_color['tablet'] ) ? $cart_text_color['tablet'] : ''; $cart_bg_color_desktop = ! empty( $cart_bg_color['desktop'] ) ? $cart_bg_color['desktop'] : ''; $cart_bg_color_mobile = ! empty( $cart_bg_color['mobile'] ) ? $cart_bg_color['mobile'] : ''; $cart_bg_color_tablet = ! empty( $cart_bg_color['tablet'] ) ? $cart_bg_color['tablet'] : ''; $cart_h_bg_color_desktop = ! empty( $cart_h_bg_color['desktop'] ) ? $cart_h_bg_color['desktop'] : ''; $cart_h_bg_color_mobile = ! empty( $cart_h_bg_color['mobile'] ) ? $cart_h_bg_color['mobile'] : ''; $cart_h_bg_color_tablet = ! empty( $cart_h_bg_color['tablet'] ) ? $cart_h_bg_color['tablet'] : ''; $cart_link_color_desktop = ! empty( $cart_link_color['desktop'] ) ? $cart_link_color['desktop'] : ''; $cart_link_color_mobile = ! empty( $cart_link_color['mobile'] ) ? $cart_link_color['mobile'] : ''; $cart_link_color_tablet = ! empty( $cart_link_color['tablet'] ) ? $cart_link_color['tablet'] : ''; $cart_separator_color_desktop = ! empty( $cart_separator_color['desktop'] ) ? $cart_separator_color['desktop'] : ''; $cart_separator_color_mobile = ! empty( $cart_separator_color['mobile'] ) ? $cart_separator_color['mobile'] : ''; $cart_separator_color_tablet = ! empty( $cart_separator_color['tablet'] ) ? $cart_separator_color['tablet'] : ''; $cart_h_link_color_desktop = ! empty( $cart_h_link_color['desktop'] ) ? $cart_h_link_color['desktop'] : ''; $cart_h_link_color_mobile = ! empty( $cart_h_link_color['mobile'] ) ? $cart_h_link_color['mobile'] : ''; $cart_h_link_color_tablet = ! empty( $cart_h_link_color['tablet'] ) ? $cart_h_link_color['tablet'] : ''; $checkout_button_text_color_desktop = ! empty( $checkout_button_text_color['desktop'] ) ? $checkout_button_text_color['desktop'] : ''; $checkout_button_text_color_mobile = ! empty( $checkout_button_text_color['mobile'] ) ? $checkout_button_text_color['mobile'] : ''; $checkout_button_text_color_tablet = ! empty( $checkout_button_text_color['tablet'] ) ? $checkout_button_text_color['tablet'] : ''; $checkout_button_bg_color_desktop = ! empty( $checkout_button_bg_color['desktop'] ) ? $checkout_button_bg_color['desktop'] : ''; $checkout_button_bg_color_mobile = ! empty( $checkout_button_bg_color['mobile'] ) ? $checkout_button_bg_color['mobile'] : ''; $checkout_button_bg_color_tablet = ! empty( $checkout_button_bg_color['tablet'] ) ? $checkout_button_bg_color['tablet'] : ''; $checkout_button_text_h_color_desktop = ! empty( $checkout_button_text_h_color['desktop'] ) ? $checkout_button_text_h_color['desktop'] : ''; $checkout_button_text_h_color_mobile = ! empty( $checkout_button_text_h_color['mobile'] ) ? $checkout_button_text_h_color['mobile'] : ''; $checkout_button_text_h_color_tablet = ! empty( $checkout_button_text_h_color['tablet'] ) ? $checkout_button_text_h_color['tablet'] : ''; $checkout_button_bg_h_color_desktop = ! empty( $checkout_button_bg_h_color['desktop'] ) ? $checkout_button_bg_h_color['desktop'] : ''; $checkout_button_bg_h_color_mobile = ! empty( $checkout_button_bg_h_color['mobile'] ) ? $checkout_button_bg_h_color['mobile'] : ''; $checkout_button_bg_h_color_tablet = ! empty( $checkout_button_bg_h_color['tablet'] ) ? $checkout_button_bg_h_color['tablet'] : ''; $cart_button_text_color_desktop = ! empty( $cart_button_text_color['desktop'] ) ? $cart_button_text_color['desktop'] : ''; $cart_button_text_color_mobile = ! empty( $cart_button_text_color['mobile'] ) ? $cart_button_text_color['mobile'] : ''; $cart_button_text_color_tablet = ! empty( $cart_button_text_color['tablet'] ) ? $cart_button_text_color['tablet'] : ''; $cart_button_bg_color_desktop = ! empty( $cart_button_bg_color['desktop'] ) ? $cart_button_bg_color['desktop'] : ''; $cart_button_bg_color_mobile = ! empty( $cart_button_bg_color['mobile'] ) ? $cart_button_bg_color['mobile'] : ''; $cart_button_bg_color_tablet = ! empty( $cart_button_bg_color['tablet'] ) ? $cart_button_bg_color['tablet'] : ''; $cart_button_text_h_color_desktop = ! empty( $cart_button_text_h_color['desktop'] ) ? $cart_button_text_h_color['desktop'] : ''; $cart_button_text_h_color_mobile = ! empty( $cart_button_text_h_color['mobile'] ) ? $cart_button_text_h_color['mobile'] : ''; $cart_button_text_h_color_tablet = ! empty( $cart_button_text_h_color['tablet'] ) ? $cart_button_text_h_color['tablet'] : ''; $cart_button_bg_h_color_desktop = ! empty( $cart_button_bg_h_color['desktop'] ) ? $cart_button_bg_h_color['desktop'] : ''; $cart_button_bg_h_color_mobile = ! empty( $cart_button_bg_h_color['mobile'] ) ? $cart_button_bg_h_color['mobile'] : ''; $cart_button_bg_h_color_tablet = ! empty( $cart_button_bg_h_color['tablet'] ) ? $cart_button_bg_h_color['tablet'] : ''; $cart_label_position_desktop = ! empty( $cart_total_label_position['desktop'] ) ? $cart_total_label_position['desktop'] : ''; $cart_label_position_mobile = ! empty( $cart_total_label_position['mobile'] ) ? $cart_total_label_position['mobile'] : ''; $cart_label_position_tablet = ! empty( $cart_total_label_position['tablet'] ) ? $cart_total_label_position['tablet'] : ''; $cart_icon_size_desktop = isset( $cart_icon_size ) && isset( $cart_icon_size['desktop'] ) && ! empty( $cart_icon_size['desktop'] ) ? $cart_icon_size['desktop'] : ''; $cart_icon_size_tablet = isset( $cart_icon_size ) && isset( $cart_icon_size['tablet'] ) && ! empty( $cart_icon_size['tablet'] ) ? $cart_icon_size['tablet'] : ''; $cart_icon_size_mobile = isset( $cart_icon_size ) && isset( $cart_icon_size['mobile'] ) && ! empty( $cart_icon_size['mobile'] ) ? $cart_icon_size['mobile'] : ''; /** * Woo Cart CSS. */ $css_output_desktop = array( $selector . ' .ast-cart-menu-wrap, ' . $selector . ' .ast-addon-cart-wrap' => array( 'color' => $icon_color, ), $selector . ' .ast-cart-menu-wrap .count, ' . $selector . ' .ast-cart-menu-wrap .count:after, ' . $selector . ' .ast-addon-cart-wrap .count, ' . $selector . ' .ast-addon-cart-wrap .ast-icon-shopping-cart:after' => array( 'color' => $icon_color, 'border-color' => $icon_color, ), $selector . ' .ast-addon-cart-wrap .ast-icon-shopping-cart:after' => array( 'color' => esc_attr( $theme_h_color ), 'background-color' => esc_attr( $icon_color ), ), $selector . ' .ast-woo-header-cart-info-wrap' => array( 'color' => esc_attr( $icon_color ), ), $selector . ' .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $theme_h_color ), 'background-color' => esc_attr( $icon_color ), ), '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg' => array( 'height' => astra_get_css_value( $cart_icon_size_desktop, 'px' ), 'width' => astra_get_css_value( $cart_icon_size_desktop, 'px' ), ), '.ast-cart-menu-wrap, i.astra-icon.ast-icon-shopping-' . $header_woo_cart_list => array( 'font-size' => astra_get_css_value( $cart_icon_size_desktop, 'px' ), ), $selector . ' a.cart-container *' => array( 'transition' => 'none', ), /** * General Woo Cart tray color for widget */ '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button), .astra-cart-drawer .widget_shopping_cart_content a:not(.button)' => array( 'color' => esc_attr( $cart_link_color_desktop ), ), '.ast-site-header-cart-data span, .ast-site-header-cart-data strong, .ast-site-header-cart-data .woocommerce-mini-cart__empty-message, .ast-site-header-cart-data .total .woocommerce-Price-amount, .ast-site-header-cart-data .total .woocommerce-Price-amount .woocommerce-Price-currencySymbol, .ast-header-woo-cart .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove' => array( 'color' => esc_attr( $cart_text_color_desktop ), ), '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button):hover, .astra-cart-drawer .widget_shopping_cart_content a:not(.button):hover' => array( 'color' => esc_attr( $cart_h_link_color_desktop ), ), '.ast-site-header-cart .woocommerce.widget_shopping_cart, div.astra-cart-drawer ' => array( 'background-color' => esc_attr( $cart_bg_color_desktop ), 'border-color' => esc_attr( $cart_bg_color_desktop ), ), '.ast-site-header-cart .widget_shopping_cart:hover, .astra-cart-drawer:hover' => array( 'background-color' => esc_attr( $cart_h_bg_color_desktop ), 'border-color' => esc_attr( $cart_h_bg_color_desktop ), ), '.ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-, .woocommerce-js .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header' => array( 'border-top-color' => esc_attr( $cart_separator_color_desktop ), 'border-bottom-color' => esc_attr( $cart_separator_color_desktop ), ), '.ast-site-header-cart .widget_shopping_cart .mini_cart_item,.astra-cart-drawer .astra-cart-drawer-content .widget_shopping_cart_content ul li' => array( 'border-bottom-color' => $cart_separator_color_desktop ? astra_hex_to_rgba( $cart_separator_color_desktop ) : '', ), '.ast-site-header-cart .widget_shopping_cart:before, .ast-site-header-cart .widget_shopping_cart:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:before' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_desktop ), ), '.ast-site-header-cart:hover .widget_shopping_cart:hover:before, .ast-site-header-cart:hover .widget_shopping_cart:hover:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:hover:before' => array( 'border-bottom-color' => esc_attr( $cart_h_bg_color_desktop ), ), '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove' => array( 'border-color' => esc_attr( $cart_text_color_desktop ), ), '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove:hover, .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item:hover > a.remove' => array( 'color' => esc_attr( $cart_h_link_color_desktop ), 'border-color' => esc_attr( $cart_h_link_color_desktop ), 'background-color' => esc_attr( $cart_h_bg_color_desktop ), ), '.ast-icon-shopping-bag svg' => array( 'height' => '1em', 'width' => '1em', ), '.ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap' => array( 'line-height' => '1', ), '.ast-hfb-header .ast-addon-cart-wrap' => array( ' padding' => '0.4em', ), /** * Cart button color for widget */ '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a.button.wc-forward:not(.checkout), .woocommerce-js .astra-cart-drawer .widget_shopping_cart_content a.button.wc-forward:not(.checkout), .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a.button.wc-forward:not(.checkout), .woocommerce-js .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping)' => array( 'color' => esc_attr( $cart_button_text_color_desktop ), 'background-color' => esc_attr( $cart_button_bg_color_desktop ), ), '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a.button.wc-forward:not(.checkout):hover, .woocommerce-js .astra-cart-drawer .widget_shopping_cart_content a.button.wc-forward:not(.checkout):hover, .woocommerce-js .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping):hover' => array( 'color' => esc_attr( $cart_button_text_h_color_desktop ), 'background-color' => esc_attr( $cart_button_bg_h_color_desktop ), ), /** * Checkout button color for widget */ '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a.button.checkout.wc-forward, .astra-cart-drawer .widget_shopping_cart_content a.button.checkout.wc-forward' => array( 'color' => esc_attr( $checkout_button_text_color_desktop ), 'border-color' => esc_attr( $checkout_button_bg_color_desktop ), 'background-color' => esc_attr( $checkout_button_bg_color_desktop ), ), '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a.button.checkout.wc-forward:hover, .astra-cart-drawer .widget_shopping_cart_content a.button.checkout.wc-forward:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_desktop ), 'background-color' => esc_attr( $checkout_button_bg_h_color_desktop ), ), '.ast-site-header-cart .ast-addon-cart-wrap i.astra-icon:after, .ast-theme-transparent-header .ast-site-header-cart .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $cart_products_count_color ), ), ); // Offcanvas cart. $flyout_cart_width = astra_get_option( 'woo-slide-in-cart-width' ); $flyout_cart_width_desktop = isset( $flyout_cart_width['desktop'] ) ? $flyout_cart_width['desktop'] : ''; $flyout_cart_width_tablet = isset( $flyout_cart_width['tablet'] ) ? $flyout_cart_width['tablet'] : ''; $flyout_cart_width_mobile = isset( $flyout_cart_width['mobile'] ) ? $flyout_cart_width['mobile'] : ''; $flyout_cart_width_desktop_unit = isset( $flyout_cart_width['desktop-unit'] ) ? $flyout_cart_width['desktop-unit'] : ''; $flyout_cart_width_tablet_unit = isset( $flyout_cart_width['tablet-unit'] ) ? $flyout_cart_width['tablet-unit'] : ''; $flyout_cart_width_mobile_unit = isset( $flyout_cart_width['mobile-unit'] ) ? $flyout_cart_width['mobile-unit'] : ''; if ( 'flyout' === astra_get_option( 'woo-header-cart-click-action' ) || is_customize_preview() ) { $desktop_flyout_cart_direction = astra_get_option( 'woo-desktop-cart-flyout-direction' ); $css_output_desktop['.ast-desktop-cart-flyout.ast-site-header-cart:focus .widget_shopping_cart, .ast-desktop-cart-flyout.ast-site-header-cart:hover .widget_shopping_cart'] = array( 'opacity' => '0', 'visibility' => 'hidden', ); $css_output_desktop['.ast-desktop .astra-cart-drawer'] = array( 'width' => astra_get_css_value( $flyout_cart_width_desktop, $flyout_cart_width_desktop_unit ), ); if ( 'left' === $desktop_flyout_cart_direction ) { $css_output_desktop['.ast-desktop .astra-cart-drawer'] = array( 'width' => astra_get_css_value( $flyout_cart_width_desktop, $flyout_cart_width_desktop_unit ), 'left' => '-' . astra_get_css_value( $flyout_cart_width_desktop, $flyout_cart_width_desktop_unit ), ); $css_output_desktop['.ast-desktop .astra-cart-drawer.active'] = array( 'left' => astra_get_css_value( $flyout_cart_width_desktop, $flyout_cart_width_desktop_unit ), ); } } /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $responsive_selector = '.astra-cart-drawer'; $css_output_mobile = array( $responsive_selector . ' .astra-cart-drawer-title, ' . $responsive_selector . ' .widget_shopping_cart_content span, ' . $responsive_selector . ' .widget_shopping_cart_content strong,' . $responsive_selector . ' .woocommerce-mini-cart__empty-message, .astra-cart-drawer .woocommerce-mini-cart *' => array( 'color' => esc_attr( $cart_text_color_mobile ), ), $responsive_selector . ' .widget_shopping_cart .mini_cart_item a.remove' => array( 'border-color' => esc_attr( $cart_text_color_mobile ), ), $responsive_selector . '#astra-mobile-cart-drawer' => array( 'background-color' => esc_attr( $cart_bg_color_mobile ), 'border-color' => esc_attr( $cart_bg_color_mobile ), ), $responsive_selector . '#astra-mobile-cart-drawer:hover' => array( 'background-color' => esc_attr( $cart_h_bg_color_mobile ), 'border-color' => esc_attr( $cart_h_bg_color_mobile ), ), '#astra-mobile-cart-drawer:hover .widget_shopping_cart:before, #astra-mobile-cart-drawer:hover .widget_shopping_cart:after, .open-preview-woocommerce-cart #astra-mobile-cart-drawer .widget_shopping_cart:before' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_mobile ), ), $responsive_selector . ' .widget_shopping_cart .mini_cart_item a.remove:hover,' . $responsive_selector . ' .widget_shopping_cart .mini_cart_item:hover > a.remove' => array( 'color' => esc_attr( $cart_h_link_color_mobile ), 'border-color' => esc_attr( $cart_h_link_color_mobile ), 'background-color' => esc_attr( $cart_bg_color_mobile ), ), $responsive_selector . ' .widget_shopping_cart_content a:not(.button)' => array( 'color' => esc_attr( $cart_link_color_mobile ), ), '#astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header' => array( 'border-top-color' => esc_attr( $cart_separator_color_mobile ), 'border-bottom-color' => esc_attr( $cart_separator_color_mobile ), ), '#astra-mobile-cart-drawer .widget_shopping_cart .mini_cart_item' => array( 'border-bottom-color' => $cart_separator_color_mobile ? astra_hex_to_rgba( $cart_separator_color_mobile ) : '', ), $responsive_selector . ' .widget_shopping_cart_content a:not(.button):hover' => array( 'color' => esc_attr( $cart_h_link_color_mobile ), ), $responsive_selector . '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg' => array( 'height' => astra_get_css_value( $cart_icon_size_mobile, 'px' ), 'width' => astra_get_css_value( $cart_icon_size_mobile, 'px' ), ), '.ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, i.astra-icon.ast-icon-shopping-' . $header_woo_cart_list => array( 'font-size' => astra_get_css_value( $cart_icon_size_mobile, 'px' ), ), /** * Mobile flyout cart width. */ $responsive_selector . '.active' => array( 'width' => astra_get_css_value( $flyout_cart_width_mobile, $flyout_cart_width_mobile_unit ), ), /** * Checkout button color for widget */ $responsive_selector . ' .widget_shopping_cart_content a.button.checkout.wc-forward' => array( 'color' => esc_attr( $checkout_button_text_color_mobile ), 'border-color' => esc_attr( $checkout_button_bg_color_mobile ), 'background-color' => esc_attr( $checkout_button_bg_color_mobile ), ), $responsive_selector . ' .widget_shopping_cart_content a.button.checkout.wc-forward:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_mobile ), 'background-color' => esc_attr( $checkout_button_bg_h_color_mobile ), ), /** * Cart button color for widget */ '.woocommerce-js ' . $responsive_selector . ' .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping)' => array( 'color' => esc_attr( $cart_button_text_color_mobile ), 'background-color' => esc_attr( $cart_button_bg_color_mobile ), ), '.woocommerce-js ' . $responsive_selector . ' .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping):hover' => array( 'color' => esc_attr( $cart_button_text_h_color_mobile ), 'background-color' => esc_attr( $cart_button_bg_h_color_mobile ), ), ); $css_output_tablet = array( $responsive_selector . ' .astra-cart-drawer-title, ' . $responsive_selector . ' .widget_shopping_cart_content span, ' . $responsive_selector . ' .widget_shopping_cart_content strong,' . $responsive_selector . ' .woocommerce-mini-cart__empty-message, .astra-cart-drawer .woocommerce-mini-cart *' => array( 'color' => esc_attr( $cart_text_color_tablet ), ), $responsive_selector . ' .widget_shopping_cart .mini_cart_item a.remove' => array( 'border-color' => esc_attr( $cart_text_color_tablet ), ), $responsive_selector . '#astra-mobile-cart-drawer' => array( 'background-color' => esc_attr( $cart_bg_color_tablet ), 'border-color' => esc_attr( $cart_bg_color_tablet ), ), $responsive_selector . '#astra-mobile-cart-drawer:hover' => array( 'background-color' => esc_attr( $cart_h_bg_color_tablet ), 'border-color' => esc_attr( $cart_h_bg_color_tablet ), ), '#astra-mobile-cart-drawer:hover .widget_shopping_cart:before, #astra-mobile-cart-drawer:hover .widget_shopping_cart:after, .open-preview-woocommerce-cart #astra-mobile-cart-drawer .widget_shopping_cart:before' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_tablet ), ), $responsive_selector . ' .widget_shopping_cart .mini_cart_item a.remove:hover,' . $responsive_selector . ' .widget_shopping_cart .mini_cart_item:hover > a.remove' => array( 'color' => esc_attr( $cart_h_link_color_tablet ), 'border-color' => esc_attr( $cart_h_link_color_tablet ), 'background-color' => esc_attr( $cart_bg_color_tablet ), ), $responsive_selector . ' .widget_shopping_cart_content a:not(.button)' => array( 'color' => esc_attr( $cart_link_color_tablet ), ), '#astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header' => array( 'border-top-color' => esc_attr( $cart_separator_color_tablet ), 'border-bottom-color' => esc_attr( $cart_separator_color_tablet ), ), '#astra-mobile-cart-drawer .widget_shopping_cart .mini_cart_item' => array( 'border-bottom-color' => $cart_separator_color_tablet ? astra_hex_to_rgba( $cart_separator_color_tablet ) : '', ), $responsive_selector . ' .widget_shopping_cart_content a:not(.button):hover' => array( 'color' => esc_attr( $cart_h_link_color_tablet ), ), $responsive_selector . '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg' => array( 'height' => astra_get_css_value( $cart_icon_size_tablet, 'px' ), 'width' => astra_get_css_value( $cart_icon_size_tablet, 'px' ), ), '.ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, i.astra-icon.ast-icon-shopping-' . $header_woo_cart_list => array( 'font-size' => astra_get_css_value( $cart_icon_size_tablet, 'px' ), ), /** * Tablet flyout cart width. */ $responsive_selector . '.active' => array( 'width' => astra_get_css_value( $flyout_cart_width_tablet, $flyout_cart_width_tablet_unit ), ), /** * Checkout button color for widget */ $responsive_selector . ' .widget_shopping_cart_content a.button.checkout.wc-forward' => array( 'color' => esc_attr( $checkout_button_text_color_tablet ), 'border-color' => esc_attr( $checkout_button_bg_color_tablet ), 'background-color' => esc_attr( $checkout_button_bg_color_tablet ), ), $responsive_selector . ' .widget_shopping_cart_content a.button.checkout.wc-forward:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_tablet ), 'background-color' => esc_attr( $checkout_button_bg_h_color_tablet ), ), /** * Cart button color for widget */ '.woocommerce-js ' . $responsive_selector . ' .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping)' => array( 'color' => esc_attr( $cart_button_text_color_tablet ), 'background-color' => esc_attr( $cart_button_bg_color_tablet ), ), '.woocommerce-js ' . $responsive_selector . ' .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button:not(.checkout):not(.ast-continue-shopping):hover' => array( 'color' => esc_attr( $cart_button_text_h_color_tablet ), 'background-color' => esc_attr( $cart_button_bg_h_color_tablet ), ), ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); if ( 'none' !== $header_cart_icon_style ) { if ( function_exists( 'astra_has_pro_woocommerce_addon' ) && ! astra_has_pro_woocommerce_addon() && 'outline' === $header_cart_icon_style && 'default' !== $header_woo_cart_list ) { $border_width = astra_get_option( 'woo-header-cart-border-width' ); $header_cart_icon_outline = array( '.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-menu-cart-outline .ast-addon-cart-wrap' => array( 'border-style' => 'solid', 'border-color' => esc_attr( $icon_color ), 'border-width' => astra_get_css_value( $border_width, 'px' ), ), ); $css_output .= astra_parse_css( $header_cart_icon_outline ); } $header_cart_icon = array( $selector . ' .ast-cart-menu-wrap, ' . $selector . ' .ast-addon-cart-wrap' => array( 'color' => $icon_color, ), // Outline icon colors. '.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-menu-cart-outline .ast-addon-cart-wrap' => array( 'color' => esc_attr( $icon_color ), ), // Fix: Count color for the legacy users. ( shopping-default ) [Ref: #AST-3683]. '.ast-menu-cart-outline .ast-cart-menu-wrap .count' => array( 'color' => esc_attr( $cart_products_count_color ), ), // Fix: Count hover color for the legacy users. ( shopping-default ) [Ref: #AST-3683]. '.ast-site-header-cart .ast-site-header-cart-li:hover .ast-cart-menu-wrap .count .ast-count-text' => array( 'color' => esc_attr( $cart_products_count_color_hover ), ), // Outline Info colors. $selector . ' .ast-menu-cart-outline .ast-woo-header-cart-info-wrap' => array( 'color' => esc_attr( $icon_color ), ), // Border radius. '.ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-woo-header-cart-info-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-woo-header-cart-info-wrap' => array( 'border-top-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'left', 'desktop' ), ), ); $header_cart_icon_tablet = array( // Border radius. '.ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-woo-header-cart-info-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-woo-header-cart-info-wrap' => array( 'border-top-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'top', 'tablet' ), 'border-top-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'right', 'tablet' ), 'border-bottom-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'bottom', 'tablet' ), 'border-bottom-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'left', 'tablet' ), ), ); $header_cart_icon_mobile = array( // Border radius. '.ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-woo-header-cart-info-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-woo-header-cart-info-wrap' => array( 'border-top-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'top', 'mobile' ), 'border-top-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'right', 'mobile' ), 'border-bottom-right-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'bottom', 'mobile' ), 'border-bottom-left-radius' => astra_responsive_spacing( $header_cart_icon_radius_fields, 'left', 'mobile' ), ), ); // We adding this conditional CSS only to maintain backwards. Remove this condition after 2-3 updates of add-on. if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.4.2', '<' ) ) { // Outline cart style border. $header_cart_icon['.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-menu-cart-outline .ast-addon-cart-wrap'] = array( 'border' => '2px solid ' . $icon_color, 'color' => esc_attr( $icon_color ), ); // Transparent Header outline cart style border. $header_cart_icon['.ast-theme-transparent-header .ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-theme-transparent-header .ast-menu-cart-outline .ast-addon-cart-wrap'] = array( 'border' => '2px solid ' . $transparent_header_icon_color, 'color' => esc_attr( $transparent_header_icon_color ), ); } $css_output .= astra_parse_css( $header_cart_icon ); $css_output .= astra_parse_css( $header_cart_icon_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $header_cart_icon_mobile, '', astra_get_mobile_breakpoint() ); } $remove_when_transparent_header = array( // Fill icon Color. '.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-cart-menu-wrap, .ast-menu-cart-fill .ast-addon-cart-wrap .ast-woo-header-cart-info-wrap, .ast-menu-cart-fill .ast-addon-cart-wrap' => array( 'background-color' => esc_attr( $icon_color ), 'color' => esc_attr( $cart_h_color ), ), // Fill icon hover Color. '.ast-menu-cart-fill .ast-site-header-cart-li:hover .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-site-header-cart-li:hover .ast-cart-menu-wrap, .ast-menu-cart-fill .ast-site-header-cart-li:hover .ast-addon-cart-wrap, .ast-menu-cart-fill .ast-site-header-cart-li:hover .ast-addon-cart-wrap .ast-woo-header-cart-info-wrap, .ast-menu-cart-fill .ast-site-header-cart-li:hover .ast-addon-cart-wrap i.astra-icon:after' => array( 'background-color' => $icon_hover_color, 'color' => esc_attr( $cart_h_color ), ), // Outline icon hover Color. $selector . ' .ast-site-header-cart-li:hover .ast-cart-menu-wrap .count, .ast-menu-cart-outline .ast-site-header-cart-li:hover .ast-addon-cart-wrap' => array( 'border-color' => $icon_hover_color, ), $selector . '.ast-menu-cart-outline .ast-site-header-cart-li:hover .ast-cart-menu-wrap .count, .ast-menu-cart-outline .ast-site-header-cart-li:hover .ast-addon-cart-wrap' => array( 'color' => $icon_hover_color, ), $selector . ' .ast-site-header-cart-li:hover .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $theme_h_color ), 'background-color' => $icon_hover_color, ), // Label/Fill icon hover Color. '.ast-site-header-cart-li:hover .ast-woo-header-cart-info-wrap,' . $selector . ' .ast-site-header-cart-li:hover .ast-addon-cart-wrap, .ast-menu-cart-outline .ast-site-header-cart-li:hover .ast-addon-cart-wrap .astra-icon' => array( 'color' => $icon_hover_color, ), $selector . ' .ast-site-header-cart-li:hover .ast-cart-menu-wrap .count:after, ' . $selector . ' .ast-site-header-cart-li:hover .ast-addon-cart-wrap .count' => array( 'color' => $icon_hover_color, 'border-color' => $icon_hover_color, ), '.ast-site-header-cart.ast-menu-cart-fill .ast-site-header-cart-li:hover .astra-icon' => array( 'color' => $cart_h_color, ), ); if ( 'default' !== $header_woo_cart_list ) { $svg_cart_icon_not_transparent = array( '.ast-site-header-cart .cart-container:hover .count, .ast-site-header-cart .cart-container:hover .count' => array( 'color' => esc_attr( $cart_h_color ), ), ); if ( ! Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { $css_output .= astra_parse_css( $svg_cart_icon_not_transparent ); } } $remove_when_tp_header = array( '.ast-site-header-cart .ast-site-header-cart-li:hover .ast-addon-cart-wrap i.astra-icon:after, .ast-theme-transparent-header .ast-site-header-cart .ast-site-header-cart-li:hover .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $cart_products_count_color_hover ), ), ); if ( $check_transparent_is_enabled_on && 'desktop' !== $check_transparent_is_enabled_on && 'both' !== $check_transparent_is_enabled_on ) { $css_output .= astra_parse_css( $remove_when_tp_header, astra_get_tablet_breakpoint( '', 1 ) ); } if ( $check_transparent_is_enabled_on && 'mobile' !== $check_transparent_is_enabled_on && 'both' !== $check_transparent_is_enabled_on ) { $css_output .= astra_parse_css( $remove_when_tp_header, '', astra_get_tablet_breakpoint() ); } $add_when_transparent_header = array( $trans_header_selector . ' .ast-cart-menu-wrap .count, ' . $trans_header_selector . ' .ast-cart-menu-wrap .count:after, ' . $trans_header_selector . ' .ast-addon-cart-wrap .count, ' . $trans_header_selector . ' .ast-addon-cart-wrap .ast-icon-shopping-cart:after' => array( 'border-color' => $transparent_header_icon_color, ), $trans_header_selector . ' .ast-addon-cart-wrap .ast-icon-shopping-cart:after' => array( 'color' => esc_attr( $theme_h_color ), 'background-color' => esc_attr( $transparent_header_icon_color ), ), $trans_header_selector . ' .ast-woo-header-cart-info-wrap' => array( 'color' => esc_attr( $transparent_header_icon_color ), ), $trans_header_selector . ' .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $transparent_header_cart_h_color ), 'background-color' => esc_attr( $transparent_header_icon_color ), ), // Outline icon colors. '.ast-theme-transparent-header .ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-theme-transparent-header .ast-menu-cart-outline .ast-addon-cart-wrap' => array( 'color' => esc_attr( $transparent_header_icon_color ), 'border-color' => esc_attr( $transparent_header_icon_color ), ), // Fill icon Color. '.ast-theme-transparent-header .ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-theme-transparent-header .ast-menu-cart-fill .ast-cart-menu-wrap, .ast-theme-transparent-header .ast-menu-cart-fill .ast-addon-cart-wrap .ast-woo-header-cart-info-wrap, .ast-theme-transparent-header .ast-menu-cart-fill .ast-addon-cart-wrap' => array( 'background-color' => esc_attr( $transparent_header_icon_color ), 'color' => esc_attr( $transparent_header_cart_h_color ), ), // Outline icon hover colors. '.ast-theme-transparent-header .ast-site-header-cart .ast-cart-menu-wrap:hover .count, .ast-theme-transparent-header .ast-site-header-cart .ast-addon-cart-wrap:hover .count' => array( 'color' => esc_attr( $transparent_header_cart_h_color ), 'background-color' => esc_attr( $transparent_header_icon_color ), ), // Outline Info colors. $trans_header_selector . ' .ast-menu-cart-outline .ast-woo-header-cart-info-wrap' => array( 'color' => esc_attr( $transparent_header_icon_color ), ), ); if ( ! Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { $css_output .= astra_parse_css( $remove_when_transparent_header ); } if ( Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { /** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $tablet_breakpoint = astra_get_tablet_breakpoint( '', 1 ); if ( $check_transparent_is_enabled_on && 'desktop' !== $check_transparent_is_enabled_on && 'both' !== $check_transparent_is_enabled_on ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $remove_when_transparent_header, $tablet_breakpoint, '' ); } if ( $check_transparent_is_enabled_on && 'mobile' !== $check_transparent_is_enabled_on && 'both' !== $check_transparent_is_enabled_on ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $remove_when_transparent_header, '', astra_get_tablet_breakpoint() ); } if ( $check_transparent_is_enabled_on && 'desktop' === $check_transparent_is_enabled_on ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $add_when_transparent_header, $tablet_breakpoint, '' ); } elseif ( $check_transparent_is_enabled_on && 'mobile' === $check_transparent_is_enabled_on ) { /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $add_when_transparent_header, '', astra_get_tablet_breakpoint() ); } else { $css_output .= astra_parse_css( $add_when_transparent_header ); } } /** * Woo Cart Display Badge. */ if ( false === $cart_badge_display ) { $css_badge_output = array( '.astra-icon.astra-icon::after' => array( 'display' => 'none', ), '.ast-count-text' => array( 'display' => 'none', ), ); $css_output .= astra_parse_css( $css_badge_output ); } /** * Added for the Cart total label badge position */ $cart_dynamic_label = astra_get_option( 'woo-header-cart-label-display' ); if ( ! empty( $cart_dynamic_label ) ) { $css_total_position_common_selector = array( '.cart-container, .ast-addon-cart-wrap' => array( 'display' => 'flex', 'align-items' => 'center', ), '.astra-icon' => array( 'line-height' => 0.1, ), ); $css_output .= astra_parse_css( $css_total_position_common_selector ); } if ( 'default' !== $header_woo_cart_list ) { $svg_cart_icon_not_transparent = array( '.ast-site-header-cart .ast-site-header-cart-li:hover .ast-addon-cart-wrap i.astra-icon:after' => array( 'color' => esc_attr( $cart_products_count_color_hover ), ), ); if ( ! Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) { $css_output .= astra_parse_css( $svg_cart_icon_not_transparent ); } } $cart_l_p_mobile = ''; $cart_l_p_tablet = ''; if ( $cart_label_position_desktop ) { $cart_l_p_desktop = astra_cart_position( $cart_label_position_desktop, 'desktop' ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $cart_l_p_desktop, astra_get_tablet_breakpoint( '', '1' ) ); } if ( $cart_label_position_mobile ) { $cart_l_p_mobile = astra_cart_position( $cart_label_position_mobile, 'mobile' ); } if ( $cart_label_position_tablet ) { $cart_l_p_tablet = astra_cart_position( $cart_label_position_tablet, 'tablet' ); } /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $cart_l_p_tablet, astra_get_mobile_breakpoint( '', '1' ), astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $css_output .= astra_parse_css( $cart_l_p_mobile, '', astra_get_mobile_breakpoint( '', '1' ) ); $angle_transition = array( '.ast-site-header-cart .widget_shopping_cart:before, .ast-site-header-cart .widget_shopping_cart:after' => array( 'transition' => 'all 0.3s ease', 'margin-left' => 0.5 . 'em', ), ); $css_output .= astra_parse_css( $angle_transition ); $css_output .= Astra_Extended_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( 'section-header-woo-cart', '.woocommerce .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap, .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap' ); $css_output .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( 'section-header-woo-cart', '.ast-header-woo-cart' ); $dynamic_css .= $css_output; return $dynamic_css; } woo-cart/class-astra-header-woo-cart-loader.php 0000644 00000002646 15104467203 0015462 0 ustar 00 <?php /** * WooCommerce Cart Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Woo_Cart_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-header-builder-woo-cart-customizer-preview-js', ASTRA_HEADER_WOO_CART_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for Astra Breakpoints JS. wp_localize_script( 'astra-header-builder-woo-cart-customizer-preview-js', 'astraBuilderCartPreview', array( '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_Header_Woo_Cart_Loader(); woo-cart/class-astra-header-woo-cart-component.php 0000644 00000002365 15104467203 0016214 0 ustar 00 <?php /** * WooCommerce Cart for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_WOO_CART_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/woo-cart' ); define( 'ASTRA_HEADER_WOO_CART_URI', ASTRA_THEME_URI . 'inc/builder/type/header/woo-cart' ); if ( ! class_exists( 'Astra_Header_Woo_Cart_Component' ) ) { /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Woo_Cart_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_WOO_CART_DIR . '/class-astra-header-woo-cart-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_WOO_CART_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Woo_Cart_Component(); } woo-cart/assets/js/unminified/customizer-preview.js 0000644 00000054611 15104467203 0016576 0 ustar 00 /** * 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 selector = '.ast-site-header-cart'; var responsive_selector = '.astra-cart-drawer'; const appendSelector = '.woocommerce-js '; var tablet_break_point = astraBuilderCartPreview.tablet_break_point || 768, mobile_break_point = astraBuilderCartPreview.mobile_break_point || 544; // Icon Color. astra_css( 'astra-settings[header-woo-cart-icon-color]', 'color', selector + ' .ast-cart-menu-wrap .count, ' + selector + ' .ast-cart-menu-wrap .count:after,' + selector + ' .ast-woo-header-cart-info-wrap,' + selector + ' .ast-site-header-cart .ast-addon-cart-wrap' ); // Icon Color. astra_css( 'astra-settings[header-woo-cart-icon-color]', 'border-color', selector + ' .ast-cart-menu-wrap .count, ' + selector + ' .ast-cart-menu-wrap .count:after' ); // Icon BG Color. astra_css( 'astra-settings[header-woo-cart-icon-color]', 'border-color', '.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-cart-menu-wrap' ); // WooCommerce Cart Colors. astra_color_responsive_css( 'woo-cart-text-color', 'astra-settings[header-woo-cart-text-color]', 'color', '.astra-cart-drawer-title, .ast-site-header-cart-data span, .ast-site-header-cart-data strong, .ast-site-header-cart-data .woocommerce-mini-cart__empty-message, .ast-site-header-cart-data .total .woocommerce-Price-amount, .ast-site-header-cart-data .total .woocommerce-Price-amount .woocommerce-Price-currencySymbol, .ast-header-woo-cart .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove,' + responsive_selector + ' .widget_shopping_cart_content span, ' + responsive_selector + ' .widget_shopping_cart_content strong,' + responsive_selector + ' .woocommerce-mini-cart__empty-message, .astra-cart-drawer .woocommerce-mini-cart *, ' + responsive_selector + ' .astra-cart-drawer-title' ); astra_color_responsive_css( 'woo-cart-border-color', 'astra-settings[header-woo-cart-text-color]', 'border-color', '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove, ' + responsive_selector + ' .widget_shopping_cart .mini_cart_item a.remove' ); astra_color_responsive_css( 'woo-cart-link-color', 'astra-settings[header-woo-cart-link-color]', 'color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button),' + responsive_selector + ' .widget_shopping_cart_content a:not(.button)' ); astra_color_responsive_css( 'woo-cart-background-color', 'astra-settings[header-woo-cart-background-color]', 'background-color', '.ast-site-header-cart .widget_shopping_cart, .astra-cart-drawer' ); astra_color_responsive_css( 'woo-cart-border-color', 'astra-settings[header-woo-cart-background-color]', 'border-color', '.ast-site-header-cart .widget_shopping_cart, .astra-cart-drawer' ); astra_color_responsive_css( 'woo-cart-border-bottom-color', 'astra-settings[header-woo-cart-background-color]', 'border-bottom-color', '.ast-site-header-cart .widget_shopping_cart:before, .ast-site-header-cart .widget_shopping_cart:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:before, #astra-mobile-cart-drawer, .astra-cart-drawer' ); // Added Background Color Hover astra_color_responsive_css( 'woo-cart-background-hover-color', 'astra-settings[header-woo-cart-background-hover-color]', 'background-color', '.ast-site-header-cart .widget_shopping_cart:hover, #astra-mobile-cart-drawer:hover' ); astra_color_responsive_css( 'woo-cart-border-color', 'astra-settings[header-woo-cart-background-hover-color]', 'border-color', '.ast-site-header-cart .widget_shopping_cart:hover, #astra-mobile-cart-drawer:hover' ); astra_color_responsive_css( 'woo-cart-border-bottom-color', 'astra-settings[header-woo-cart-background-hover-color]', 'border-bottom-color', '.ast-site-header-cart .widget_shopping_cart:hover,site-header-cart .widget_shopping_cart:hover:after, #astra-mobile-cart-drawer:hover,.ast-site-header-cart:hover .widget_shopping_cart:hover:before, .ast-site-header-cart:hover .widget_shopping_cart:hover:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:hover:before' ); astra_color_responsive_css( 'woo-cart-separator-colors', 'astra-settings[header-woo-cart-separator-color]', 'border-top-color', '.ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total, #astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header' ); astra_color_responsive_css( 'woo-cart-border-bottom-colors', 'astra-settings[header-woo-cart-separator-color]', 'border-bottom-color', '.ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total, #astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header, .ast-site-header-cart .widget_shopping_cart .mini_cart_item, #astra-mobile-cart-drawer .widget_shopping_cart .mini_cart_item' ); astra_color_responsive_css( 'woo-cart-link-hover-colors', 'astra-settings[header-woo-cart-link-hover-color]', 'color', '.ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button):hover, .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove:hover, .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item:hover > a.remove,' + responsive_selector + ' .widget_shopping_cart_content a:not(.button):hover,' + responsive_selector + ' .widget_shopping_cart .mini_cart_item a.remove:hover,' + responsive_selector + ' .widget_shopping_cart .mini_cart_item:hover > a.remove' ); astra_color_responsive_css( 'woo-cart-border-colors', 'astra-settings[header-woo-cart-link-hover-color]', 'border-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove:hover,' + selector + ' .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item:hover > a.remove,' + responsive_selector + ' .widget_shopping_cart .mini_cart_item a.remove:hover,' + responsive_selector + ' .widget_shopping_cart .mini_cart_item:hover > a.remove' ); astra_color_responsive_css( 'woo-cart-btn-text-color', 'astra-settings[header-woo-cart-btn-text-color]', 'color', appendSelector + selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout),' + appendSelector + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout)' ); astra_color_responsive_css( 'woo-cart-btn-bg-color', 'astra-settings[header-woo-cart-btn-background-color]', 'background-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout),' + appendSelector + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout)' ); astra_color_responsive_css( 'woo-cart-btn-hover-text-color', 'astra-settings[header-woo-cart-btn-text-hover-color]', 'color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover,' + appendSelector + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover' ); astra_color_responsive_css( 'woo-cart-btn-hover-bg-color', 'astra-settings[header-woo-cart-btn-bg-hover-color]', 'background-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover,' + appendSelector + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover' ); astra_color_responsive_css( 'woo-cart-checkout-btn-text-color', 'astra-settings[header-woo-checkout-btn-text-color]', 'color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,' + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward' ); astra_color_responsive_css( 'woo-cart-checkout-btn-border-color', 'astra-settings[header-woo-checkout-btn-background-color]', 'border-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,' + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward' ); astra_color_responsive_css( 'woo-cart-checkout-btn-background-color', 'astra-settings[header-woo-checkout-btn-background-color]', 'background-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,' + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward' ); astra_color_responsive_css( 'woo-cart-checkout-btn-hover-text-color', 'astra-settings[header-woo-checkout-btn-text-hover-color]', 'color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover,' + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover' ); astra_color_responsive_css( 'woo-cart-checkout-btn-bg-hover-background-color', 'astra-settings[header-woo-checkout-btn-bg-hover-color]', 'background-color', selector + ' .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover,' + responsive_selector + ' .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover' ); /** * Cart icon style */ wp.customize('astra-settings[woo-header-cart-icon-style]', function (setting) { setting.bind(function (icon_style) { var buttons = $(document).find('.ast-site-header-cart'); buttons.removeClass('ast-menu-cart-fill ast-menu-cart-outline ast-menu-cart-none'); buttons.addClass('ast-menu-cart-' + icon_style); var dynamicStyle = '.ast-site-header-cart a, .ast-site-header-cart a *{ transition: all 0s; } '; astra_add_dynamic_css('woo-header-cart-icon-style', dynamicStyle); wp.customize.preview.send('refresh'); }); }); /** * Desktop cart offcanvas width. */ wp.customize( 'astra-settings[woo-slide-in-cart-width]', function( setting ) { setting.bind( function( wooSlideInConfig ) { const { desktop, mobile, tablet } = wooSlideInConfig; const desktopUnit = wooSlideInConfig['desktop-unit']; const tabletUnit = wooSlideInConfig['tablet-unit']; const mobileUnit = wooSlideInConfig['mobile-unit']; const offcanvasPosition = wp.customize( 'astra-settings[woo-desktop-cart-flyout-direction]' ).get(); if( 'left' == offcanvasPosition ) { var dynamicStyle = '.ast-desktop .astra-cart-drawer { width: ' + desktop + desktopUnit + '; left: -' + desktop + desktopUnit + '; } '; dynamicStyle += '.ast-desktop .astra-cart-drawer.active { left: ' + desktop + desktopUnit + '; } '; } else { var dynamicStyle = '.ast-desktop .astra-cart-drawer { width: ' + desktop + desktopUnit + '; left: 100%; } '; } //Tablets. dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px ) and ( min-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '#astra-mobile-cart-drawer {'; dynamicStyle += 'width: ' + tablet + tabletUnit + ';'; dynamicStyle += '}'; dynamicStyle += '}'; // Mobile. dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '#astra-mobile-cart-drawer {'; dynamicStyle += 'width: ' + mobile + mobileUnit + ';'; dynamicStyle += '}'; dynamicStyle += '}'; if( desktop > 500 ) { $( '#astra-mobile-cart-drawer .astra-cart-drawer-content' ).addClass('ast-large-view'); } else { $( '#astra-mobile-cart-drawer .astra-cart-drawer-content' ).removeClass('ast-large-view'); } astra_add_dynamic_css( 'woo-slide-in-cart-width', dynamicStyle ); } ); } ); /** * Cart icon type */ wp.customize( 'astra-settings[woo-header-cart-icon]', function( setting ) { setting.bind( function( icon_type ) { $( document.body ).trigger( 'wc_fragment_refresh' ); } ); } ); /** * Cart Click Action */ wp.customize( 'astra-settings[woo-header-cart-click-action]', function( setting ) { setting.bind( function( clickAction ) { //Trigger refresh to reload markup. $( document.body ).trigger( 'wc_fragment_refresh' ); wp.customize.preview.send('refresh'); } ); } ); /** * Cart icon hover style */ wp.customize('astra-settings[header-woo-cart-icon-hover-color]', function (setting) { setting.bind(function (color) { wp.customize.preview.send('refresh'); }); }); /** * Cart icon style */ wp.customize('astra-settings[header-woo-cart-icon-color]', function (setting) { setting.bind(function (color) { var dynamicStyle = '.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-cart-menu-wrap { background-color: ' + color + '; } '; astra_add_dynamic_css('header-woo-cart-icon-color', dynamicStyle); wp.customize.preview.send('refresh'); }); }); /** * Cart Border Width. */ astra_css( 'astra-settings[woo-header-cart-border-width]', 'border-width', '.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-theme-transparent-header .ast-menu-cart-outline .ast-addon-cart-wrap', 'px' ); /** * Cart Border Radius Fields */ wp.customize('astra-settings[woo-header-cart-icon-radius-fields]', function (setting) { setting.bind(function (border) { let globalSelector = '.ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap '; let dynamicStyle = globalSelector + '{ border-top-left-radius :' + border['desktop']['top'] + border['desktop-unit'] + '; border-bottom-right-radius :' + border['desktop']['bottom'] + border['desktop-unit'] + '; border-bottom-left-radius :' + border['desktop']['left'] + border['desktop-unit'] + '; border-top-right-radius :' + border['desktop']['right'] + border['desktop-unit'] + '; } '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) { ' + globalSelector + '{ border-top-left-radius :' + border['tablet']['top'] + border['tablet-unit'] + '; border-bottom-right-radius :' + border['tablet']['bottom'] + border['tablet-unit'] + '; border-bottom-left-radius :' + border['tablet']['left'] + border['tablet-unit'] + '; border-top-right-radius :' + border['tablet']['right'] + border['tablet-unit'] + '; } } '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) { ' + globalSelector + '{ border-top-left-radius :' + border['mobile']['top'] + border['mobile-unit'] + '; border-bottom-right-radius :' + border['mobile']['bottom'] + border['mobile-unit'] + '; border-bottom-left-radius :' + border['mobile']['left'] + border['mobile-unit'] + '; border-top-right-radius :' + border['mobile']['right'] + border['mobile-unit'] + '; } } '; astra_add_dynamic_css('woo-header-cart-icon-radius-fields', dynamicStyle); }); }); /** * Transparent Header WOO-Cart color options - Customizer preview CSS. */ wp.customize('astra-settings[transparent-header-woo-cart-icon-color]', function (setting) { setting.bind(function (cart_icon_color) { wp.customize.preview.send('refresh'); }); }); /** * Cart total label position. */ wp.customize('astra-settings[woo-header-cart-icon-total-label-position]', function (setting) { setting.bind(function (position) { var defaultCart = $(document).find('.cart-container'); defaultPositionSelector = 'ast-cart-desktop-position-left ast-cart-desktop-position-right ast-cart-desktop-position-bottom ast-cart-mobile-position-left ast-cart-mobile-position-right ast-cart-mobile-position-bottom ast-cart-tablet-position-left ast-cart-tablet-position-right ast-cart-tablet-position-bottom'; if($(selector).find('.ast-addon-cart-wrap').length){ let iconCart = $(document).find('.ast-addon-cart-wrap'); iconCart.removeClass(defaultPositionSelector); defaultCart.removeClass(defaultPositionSelector); iconCart.addClass('ast-cart-desktop-position-' + position.desktop); iconCart.addClass('ast-cart-mobile-position-' + position.mobile); iconCart.addClass('ast-cart-tablet-position-' + position.tablet); } else { defaultCart.removeClass(defaultPositionSelector); defaultCart.addClass('ast-cart-desktop-position-' + position.desktop); defaultCart.addClass('ast-cart-mobile-position-' + position.mobile); defaultCart.addClass('ast-cart-tablet-position-' + position.tablet); } var dynamicStyle = '.cart-container, .ast-addon-cart-wrap {display : flex; align-items : center; padding-top: 7px; padding-bottom: 5px;} '; dynamicStyle += '.astra-icon {line-height : 0.1;} '; var tablet_break_point = astraBuilderCartPreview.tablet_break_point || 768, mobile_break_point = astraBuilderCartPreview.mobile_break_point || 544; if( position.desktop ){ dynamicStyle += '@media (min-width: ' + tablet_break_point + 'px) {'; dynamicStyle += cartPosition(position.desktop,'desktop'); dynamicStyle += '} '; } if( position.tablet ){ dynamicMobileStyle = cartPosition(position.tablet,'tablet'); dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px ) and ( min-width: ' + mobile_break_point + 'px) {'; dynamicStyle += dynamicMobileStyle; dynamicStyle += '} '; } if( position.mobile ){ dynamictabletStyle = cartPosition(position.mobile,'mobile'); dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += dynamictabletStyle; dynamicStyle += '} '; } function cartPosition(position,device) { switch(position){ case "bottom": var dynamicStylePosition = '.ast-cart-'+ device +'-position-bottom { flex-direction : column;} '; dynamicStylePosition += '.ast-cart-'+ device +'-position-bottom .ast-woo-header-cart-info-wrap { order : 2; line-height : 1; margin-top : 0.5em; } '; return dynamicStylePosition; case "right": dynamicStylePosition = '.ast-cart-'+ device +'-position-right .ast-woo-header-cart-info-wrap { order : 2; margin-left : 0.7em;} '; return dynamicStylePosition; case "left": dynamicStylePosition = '.ast-cart-'+ device +'-position-left .ast-woo-header-cart-info-wrap { margin-right : 0.5em;} '; return dynamicStylePosition; default: break; } } astra_add_dynamic_css( 'woo-header-cart-icon-total-label-position', dynamicStyle ); }); }); // Advanced CSS Generation for cart padding and margin. astra_builder_advanced_css( 'section-header-woo-cart', '.woocommerce .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap, .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap' ); // Advanced Visibility CSS Generation. astra_builder_visibility_css('section-header-woo-cart', '.ast-header-woo-cart'); // Icon Size. wp.customize('astra-settings[header-woo-cart-icon-size]', function (value) { value.bind(function (size) { if (size.desktop != '' || size.tablet != '' || size.mobile != '') { var dynamicStyle = ''; dynamicStyle += '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {'; dynamicStyle += 'height: ' + size.desktop + 'px' + ';'; dynamicStyle += 'width: ' + size.desktop + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {'; dynamicStyle += 'height: ' + size.tablet + 'px' + ';'; dynamicStyle += 'width: ' + size.tablet + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {'; dynamicStyle += 'height: ' + size.mobile + 'px' + ';'; dynamicStyle += 'width: ' + size.mobile + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '.ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {'; dynamicStyle += 'font-size: ' + size.desktop + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {'; dynamicStyle += 'font-size: ' + size.tablet + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {'; dynamicStyle += 'font-size:' + size.mobile + 'px' + ';'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css('header-woo-cart-icon-size', dynamicStyle); } }); }); /** * Cart Badge */ wp.customize('astra-settings[woo-header-cart-badge-display]', function (setting) { setting.bind(function (badge) { if (!badge) { var dynamicStyle = '.astra-icon.astra-icon::after { display:none; } '; dynamicStyle += '.ast-count-text { display:none; } '; } else { var dynamicStyle = '.astra-icon.astra-icon::after { display:block; } '; dynamicStyle += '.ast-count-text { display:block; } '; } astra_add_dynamic_css('woo-header-cart-badge-display', dynamicStyle); }); }); /** * Hide Cart Total Label */ wp.customize( 'astra-settings[woo-header-cart-total-label]', function( setting ) { setting.bind( function( toggle ) { $( document.body ).trigger( 'wc_fragment_refresh' ); }); }); })(jQuery); woo-cart/assets/js/minified/customizer-preview.min.js 0000644 00000040311 15104467203 0017005 0 ustar 00 (i=>{var s=".ast-site-header-cart",t=".astra-cart-drawer",a=".woocommerce-js ",n=astraBuilderCartPreview.tablet_break_point||768,d=astraBuilderCartPreview.mobile_break_point||544;astra_css("astra-settings[header-woo-cart-icon-color]","color",s+" .ast-cart-menu-wrap .count, "+s+" .ast-cart-menu-wrap .count:after,"+s+" .ast-woo-header-cart-info-wrap,"+s+" .ast-site-header-cart .ast-addon-cart-wrap"),astra_css("astra-settings[header-woo-cart-icon-color]","border-color",s+" .ast-cart-menu-wrap .count, "+s+" .ast-cart-menu-wrap .count:after"),astra_css("astra-settings[header-woo-cart-icon-color]","border-color",".ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-cart-menu-wrap"),astra_color_responsive_css("woo-cart-text-color","astra-settings[header-woo-cart-text-color]","color",".astra-cart-drawer-title, .ast-site-header-cart-data span, .ast-site-header-cart-data strong, .ast-site-header-cart-data .woocommerce-mini-cart__empty-message, .ast-site-header-cart-data .total .woocommerce-Price-amount, .ast-site-header-cart-data .total .woocommerce-Price-amount .woocommerce-Price-currencySymbol, .ast-header-woo-cart .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove,"+t+" .widget_shopping_cart_content span, "+t+" .widget_shopping_cart_content strong,"+t+" .woocommerce-mini-cart__empty-message, .astra-cart-drawer .woocommerce-mini-cart *, "+t+" .astra-cart-drawer-title"),astra_color_responsive_css("woo-cart-border-color","astra-settings[header-woo-cart-text-color]","border-color",".ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove, "+t+" .widget_shopping_cart .mini_cart_item a.remove"),astra_color_responsive_css("woo-cart-link-color","astra-settings[header-woo-cart-link-color]","color",s+" .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button),"+t+" .widget_shopping_cart_content a:not(.button)"),astra_color_responsive_css("woo-cart-background-color","astra-settings[header-woo-cart-background-color]","background-color",".ast-site-header-cart .widget_shopping_cart, .astra-cart-drawer"),astra_color_responsive_css("woo-cart-border-color","astra-settings[header-woo-cart-background-color]","border-color",".ast-site-header-cart .widget_shopping_cart, .astra-cart-drawer"),astra_color_responsive_css("woo-cart-border-bottom-color","astra-settings[header-woo-cart-background-color]","border-bottom-color",".ast-site-header-cart .widget_shopping_cart:before, .ast-site-header-cart .widget_shopping_cart:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:before, #astra-mobile-cart-drawer, .astra-cart-drawer"),astra_color_responsive_css("woo-cart-background-hover-color","astra-settings[header-woo-cart-background-hover-color]","background-color",".ast-site-header-cart .widget_shopping_cart:hover, #astra-mobile-cart-drawer:hover"),astra_color_responsive_css("woo-cart-border-color","astra-settings[header-woo-cart-background-hover-color]","border-color",".ast-site-header-cart .widget_shopping_cart:hover, #astra-mobile-cart-drawer:hover"),astra_color_responsive_css("woo-cart-border-bottom-color","astra-settings[header-woo-cart-background-hover-color]","border-bottom-color",".ast-site-header-cart .widget_shopping_cart:hover,site-header-cart .widget_shopping_cart:hover:after, #astra-mobile-cart-drawer:hover,.ast-site-header-cart:hover .widget_shopping_cart:hover:before, .ast-site-header-cart:hover .widget_shopping_cart:hover:after, .open-preview-woocommerce-cart .ast-site-header-cart .widget_shopping_cart:hover:before"),astra_color_responsive_css("woo-cart-separator-colors","astra-settings[header-woo-cart-separator-color]","border-top-color",".ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total, #astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header"),astra_color_responsive_css("woo-cart-border-bottom-colors","astra-settings[header-woo-cart-separator-color]","border-bottom-color",".ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart__total, #astra-mobile-cart-drawer .widget_shopping_cart .woocommerce-mini-cart__total, .astra-cart-drawer .astra-cart-drawer-header, .ast-site-header-cart .widget_shopping_cart .mini_cart_item, #astra-mobile-cart-drawer .widget_shopping_cart .mini_cart_item"),astra_color_responsive_css("woo-cart-link-hover-colors","astra-settings[header-woo-cart-link-hover-color]","color",".ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart_content a:not(.button):hover, .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove:hover, .ast-site-header-cart .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item:hover > a.remove,"+t+" .widget_shopping_cart_content a:not(.button):hover,"+t+" .widget_shopping_cart .mini_cart_item a.remove:hover,"+t+" .widget_shopping_cart .mini_cart_item:hover > a.remove"),astra_color_responsive_css("woo-cart-border-colors","astra-settings[header-woo-cart-link-hover-color]","border-color",s+" .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item a.remove:hover,"+s+" .ast-site-header-cart-data .widget_shopping_cart .mini_cart_item:hover > a.remove,"+t+" .widget_shopping_cart .mini_cart_item a.remove:hover,"+t+" .widget_shopping_cart .mini_cart_item:hover > a.remove"),astra_color_responsive_css("woo-cart-btn-text-color","astra-settings[header-woo-cart-btn-text-color]","color",a+s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout),"+a+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout)"),astra_color_responsive_css("woo-cart-btn-bg-color","astra-settings[header-woo-cart-btn-background-color]","background-color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout),"+a+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout)"),astra_color_responsive_css("woo-cart-btn-hover-text-color","astra-settings[header-woo-cart-btn-text-hover-color]","color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover,"+a+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover"),astra_color_responsive_css("woo-cart-btn-hover-bg-color","astra-settings[header-woo-cart-btn-bg-hover-color]","background-color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover,"+a+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.wc-forward:not(.checkout):hover"),astra_color_responsive_css("woo-cart-checkout-btn-text-color","astra-settings[header-woo-checkout-btn-text-color]","color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,"+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward"),astra_color_responsive_css("woo-cart-checkout-btn-border-color","astra-settings[header-woo-checkout-btn-background-color]","border-color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,"+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward"),astra_color_responsive_css("woo-cart-checkout-btn-background-color","astra-settings[header-woo-checkout-btn-background-color]","background-color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward,"+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward"),astra_color_responsive_css("woo-cart-checkout-btn-hover-text-color","astra-settings[header-woo-checkout-btn-text-hover-color]","color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover,"+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover"),astra_color_responsive_css("woo-cart-checkout-btn-bg-hover-background-color","astra-settings[header-woo-checkout-btn-bg-hover-color]","background-color",s+" .ast-site-header-cart-data .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover,"+t+" .widget_shopping_cart_content .woocommerce-mini-cart__buttons a.button.checkout.wc-forward:hover"),wp.customize("astra-settings[woo-header-cart-icon-style]",function(t){t.bind(function(t){var a=i(document).find(".ast-site-header-cart");a.removeClass("ast-menu-cart-fill ast-menu-cart-outline ast-menu-cart-none"),a.addClass("ast-menu-cart-"+t);astra_add_dynamic_css("woo-header-cart-icon-style",".ast-site-header-cart a, .ast-site-header-cart a *{ transition: all 0s; } "),wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[woo-slide-in-cart-width]",function(t){t.bind(function(t){var a,{desktop:o,mobile:r,tablet:e}=t,s=t["desktop-unit"],c=t["tablet-unit"],t=t["mobile-unit"];"left"==wp.customize("astra-settings[woo-desktop-cart-flyout-direction]").get()?(a=".ast-desktop .astra-cart-drawer { width: "+o+s+"; left: -"+o+s+"; } ",a+=".ast-desktop .astra-cart-drawer.active { left: "+o+s+"; } "):a=".ast-desktop .astra-cart-drawer { width: "+o+s+"; left: 100%; } ",a=(a=(a=(a=a+"@media (max-width: "+n+"px ) and ( min-width: "+d+"px) {#astra-mobile-cart-drawer {")+"width: "+e+c+";}")+"}@media (max-width: "+d+"px) {")+"#astra-mobile-cart-drawer {width: "+r+t+";}}",500<o?i("#astra-mobile-cart-drawer .astra-cart-drawer-content").addClass("ast-large-view"):i("#astra-mobile-cart-drawer .astra-cart-drawer-content").removeClass("ast-large-view"),astra_add_dynamic_css("woo-slide-in-cart-width",a)})}),wp.customize("astra-settings[woo-header-cart-icon]",function(t){t.bind(function(t){i(document.body).trigger("wc_fragment_refresh")})}),wp.customize("astra-settings[woo-header-cart-click-action]",function(t){t.bind(function(t){i(document.body).trigger("wc_fragment_refresh"),wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[header-woo-cart-icon-hover-color]",function(t){t.bind(function(t){wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[header-woo-cart-icon-color]",function(t){t.bind(function(t){astra_add_dynamic_css("header-woo-cart-icon-color",".ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-menu-cart-fill .ast-cart-menu-wrap { background-color: "+t+"; } "),wp.customize.preview.send("refresh")})}),astra_css("astra-settings[woo-header-cart-border-width]","border-width",".ast-menu-cart-outline .ast-addon-cart-wrap, .ast-theme-transparent-header .ast-menu-cart-outline .ast-addon-cart-wrap","px"),wp.customize("astra-settings[woo-header-cart-icon-radius-fields]",function(t){t.bind(function(t){var a=".ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap .count, .ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-addon-cart-wrap ",o=a+"{ border-top-left-radius :"+t.desktop.top+t["desktop-unit"]+"; border-bottom-right-radius :"+t.desktop.bottom+t["desktop-unit"]+"; border-bottom-left-radius :"+t.desktop.left+t["desktop-unit"]+"; border-top-right-radius :"+t.desktop.right+t["desktop-unit"]+"; } ",o=(o+="@media (max-width: "+n+"px) { "+a+"{ border-top-left-radius :"+t.tablet.top+t["tablet-unit"]+"; border-bottom-right-radius :"+t.tablet.bottom+t["tablet-unit"]+"; border-bottom-left-radius :"+t.tablet.left+t["tablet-unit"]+"; border-top-right-radius :"+t.tablet.right+t["tablet-unit"]+"; } } ")+("@media (max-width: "+d+"px) { "+a+"{ border-top-left-radius :"+t.mobile.top+t["mobile-unit"]+"; border-bottom-right-radius :"+t.mobile.bottom+t["mobile-unit"]+"; border-bottom-left-radius :"+t.mobile.left+t["mobile-unit"]+"; border-top-right-radius :"+t.mobile.right+t["mobile-unit"]+"; } } ");astra_add_dynamic_css("woo-header-cart-icon-radius-fields",o)})}),wp.customize("astra-settings[transparent-header-woo-cart-icon-color]",function(t){t.bind(function(t){wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[woo-header-cart-icon-total-label-position]",function(t){t.bind(function(t){var a=i(document).find(".cart-container"),o=(defaultPositionSelector="ast-cart-desktop-position-left ast-cart-desktop-position-right ast-cart-desktop-position-bottom ast-cart-mobile-position-left ast-cart-mobile-position-right ast-cart-mobile-position-bottom ast-cart-tablet-position-left ast-cart-tablet-position-right ast-cart-tablet-position-bottom",(i(s).find(".ast-addon-cart-wrap").length?((o=i(document).find(".ast-addon-cart-wrap")).removeClass(defaultPositionSelector),a.removeClass(defaultPositionSelector),o.addClass("ast-cart-desktop-position-"+t.desktop),o.addClass("ast-cart-mobile-position-"+t.mobile),o):(a.removeClass(defaultPositionSelector),a.addClass("ast-cart-desktop-position-"+t.desktop),a.addClass("ast-cart-mobile-position-"+t.mobile),a)).addClass("ast-cart-tablet-position-"+t.tablet),".cart-container, .ast-addon-cart-wrap {display : flex; align-items : center; padding-top: 7px; padding-bottom: 5px;} "),a=(o+=".astra-icon {line-height : 0.1;} ",astraBuilderCartPreview.tablet_break_point||768),r=astraBuilderCartPreview.mobile_break_point||544;function e(t,a){switch(t){case"bottom":var o=".ast-cart-"+a+"-position-bottom { flex-direction : column;} ";return o+=".ast-cart-"+a+"-position-bottom .ast-woo-header-cart-info-wrap { order : 2; line-height : 1; margin-top : 0.5em; } ";case"right":return o=".ast-cart-"+a+"-position-right .ast-woo-header-cart-info-wrap { order : 2; margin-left : 0.7em;} ";case"left":return o=".ast-cart-"+a+"-position-left .ast-woo-header-cart-info-wrap { margin-right : 0.5em;} "}}t.desktop&&(o=(o+="@media (min-width: "+a+"px) {")+e(t.desktop,"desktop")+"} "),t.tablet&&(o=(o+="@media (max-width: "+a+"px ) and ( min-width: "+r+"px) {")+(dynamicMobileStyle=e(t.tablet,"tablet"))+"} "),t.mobile&&(o=(o+="@media (max-width: "+r+"px) {")+(dynamictabletStyle=e(t.mobile,"mobile"))+"} "),astra_add_dynamic_css("woo-header-cart-icon-total-label-position",o)})}),astra_builder_advanced_css("section-header-woo-cart",".woocommerce .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap, .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap"),astra_builder_visibility_css("section-header-woo-cart",".ast-header-woo-cart"),wp.customize("astra-settings[header-woo-cart-icon-size]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a="")+".ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {height: "+t.desktop+"px;")+"width: "+t.desktop+"px;")+"} @media (max-width: "+n+"px) {")+".ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {height: "+t.tablet+"px;")+"width: "+t.tablet+"px;} ")+"} @media (max-width: "+d+"px) {")+".ast-icon-shopping-bag .ast-icon svg, .ast-icon-shopping-cart .ast-icon svg, .ast-icon-shopping-basket .ast-icon svg {height: "+t.mobile+"px;")+"width: "+t.mobile+"px;} } .ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {")+"font-size: "+t.desktop+"px;} ")+"@media (max-width: "+n+"px) {.ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {")+"font-size: "+t.tablet+"px;} ")+"} @media (max-width: "+d+"px) {")+".ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-site-header-cart i.astra-icon {font-size:"+t.mobile+"px;} } ",astra_add_dynamic_css("header-woo-cart-icon-size",a))})}),wp.customize("astra-settings[woo-header-cart-badge-display]",function(t){t.bind(function(t){var a;t?(a=".astra-icon.astra-icon::after { display:block; } ",a+=".ast-count-text { display:block; } "):(a=".astra-icon.astra-icon::after { display:none; } ",a+=".ast-count-text { display:none; } "),astra_add_dynamic_css("woo-header-cart-badge-display",a)})}),wp.customize("astra-settings[woo-header-cart-total-label]",function(t){t.bind(function(t){i(document.body).trigger("wc_fragment_refresh")})})})(jQuery); above-header/dynamic-css/dynamic.css.php 0000644 00000014044 15104467203 0014231 0 ustar 00 <?php /** * Above Header - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Above Header Row. */ add_filter( 'astra_dynamic_theme_css', 'astra_above_header_row_setting', 11 ); /** * Above Header Row - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_above_header_row_setting( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! is_customize_preview() && ( ! Astra_Builder_Helper::is_row_empty( 'above', 'header', 'desktop' ) && ! Astra_Builder_Helper::is_row_empty( 'above', 'header', 'mobile' ) ) ) { return $dynamic_css; } $parse_css = ''; // Common CSS options. $hba_header_height = astra_get_option( 'hba-header-height' ); $hba_header_divider = astra_get_option( 'hba-header-separator' ); $hba_border_color = astra_get_option( 'hba-header-bottom-border-color' ); // Background CSS options. $hba_header_bg_obj = astra_get_option( 'hba-header-bg-obj-responsive' ); $desktop_background = isset( $hba_header_bg_obj['desktop']['background-color'] ) ? $hba_header_bg_obj['desktop']['background-color'] : ''; $tablet_background = isset( $hba_header_bg_obj['tablet']['background-color'] ) ? $hba_header_bg_obj['tablet']['background-color'] : ''; $mobile_background = isset( $hba_header_bg_obj['mobile']['background-color'] ) ? $hba_header_bg_obj['mobile']['background-color'] : ''; // Header Height. $hba_header_height_desktop = isset( $hba_header_height['desktop'] ) && ! empty( $hba_header_height['desktop'] ) ? $hba_header_height['desktop'] : ''; $hba_header_height_tablet = isset( $hba_header_height['tablet'] ) && ! empty( $hba_header_height['tablet'] ) ? $hba_header_height['tablet'] : ''; $hba_header_height_mobile = isset( $hba_header_height['mobile'] ) && ! empty( $hba_header_height['mobile'] ) ? $hba_header_height['mobile'] : ''; /** * Above Header General options */ $common_css_output = array( '.ast-above-header .main-header-bar-navigation' => array( 'height' => '100%', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-above-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item .menu-link' => array( 'border' => 'none', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-above-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item-has-children > .ast-menu-toggle::before' => array( 'font-size' => '.6rem', ), '.ast-header-break-point .ast-mobile-header-wrap .ast-above-header-wrap .main-header-bar-navigation .ast-submenu-expanded > .ast-menu-toggle::before' => array( 'transform' => 'rotateX(180deg)', ), '.ast-mobile-header-wrap .ast-above-header-bar , .ast-above-header-bar .site-above-header-wrap' => array( 'min-height' => astra_get_css_value( $hba_header_height_desktop, 'px' ), ), '.ast-desktop .ast-above-header-bar .main-header-menu > .menu-item' => array( 'line-height' => astra_get_css_value( $hba_header_height_desktop, 'px' ), ), '.ast-desktop .ast-above-header-bar .ast-header-woo-cart, .ast-desktop .ast-above-header-bar .ast-header-edd-cart' => array( 'line-height' => astra_get_css_value( $hba_header_height_desktop, 'px' ), ), ); // Apply border only when it has positive value. if ( '' !== $hba_header_divider && 'inherit' !== $hba_header_divider ) { $common_css_output['.ast-above-header-bar'] = array( 'border-bottom-width' => astra_get_css_value( $hba_header_divider, 'px' ), 'border-bottom-color' => esc_attr( $hba_border_color ), 'border-bottom-style' => 'solid', ); } else { $common_css_output['.ast-above-header-bar'] = array( 'border-bottom-style' => 'none', ); } $parse_css .= astra_parse_css( $common_css_output ); // Above Header Background Responsive - Desktop. $desktop_bg = array( '.ast-above-header.ast-above-header-bar' => astra_get_responsive_background_obj( $hba_header_bg_obj, 'desktop' ), '.ast-header-break-point .ast-above-header-bar' => array( 'background-color' => esc_attr( $desktop_background ), ), ); $parse_css .= astra_parse_css( $desktop_bg ); // Above Header Background Responsive - Tablet. $tablet_bg = array( '.ast-above-header.ast-above-header-bar' => astra_get_responsive_background_obj( $hba_header_bg_obj, 'tablet' ), '.ast-header-break-point .ast-above-header-bar' => array( 'background-color' => esc_attr( $tablet_background ), ), '.ast-mobile-header-wrap .ast-above-header-bar , .ast-above-header-bar .site-above-header-wrap' => array( 'min-height' => astra_get_css_value( $hba_header_height_tablet, 'px' ), ), '#masthead .ast-mobile-header-wrap .ast-above-header-bar' => array( 'padding-left' => '20px', 'padding-right' => '20px', ), ); $parse_css .= astra_parse_css( $tablet_bg, '', astra_get_tablet_breakpoint() ); // Above Header Background Responsive - Mobile. $mobile_bg = array( '.ast-above-header.ast-above-header-bar' => astra_get_responsive_background_obj( $hba_header_bg_obj, 'mobile' ), '.ast-header-break-point .ast-above-header-bar' => array( 'background-color' => esc_attr( $mobile_background ), ), '.ast-mobile-header-wrap .ast-above-header-bar , .ast-above-header-bar .site-above-header-wrap' => array( 'min-height' => astra_get_css_value( $hba_header_height_mobile, 'px' ), ), ); $parse_css .= astra_parse_css( $mobile_bg, '', astra_get_mobile_breakpoint() ); // Trim white space for faster page loading. $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $parse_css ); $_section = 'section-above-header-builder'; $parent_selector = '.ast-above-header.ast-above-header-bar, .ast-header-break-point #masthead.site-header .ast-above-header-bar'; $dynamic_css .= Astra_Extended_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( $_section, $parent_selector ); $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, '.ast-above-header-bar', 'block', $mobile_tablet_default_display = 'grid' ); return $dynamic_css; } above-header/class-astra-above-header-loader.php 0000644 00000002173 15104467203 0015605 0 ustar 00 <?php /** * Above Header Loader. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Class Astra_Above_Header_Loader * * Loads config files. * * @since 3.0.0 */ class Astra_Above_Header_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-above-customizer-preview-js', ASTRA_ABOVE_HEADER_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Above_Header_Loader(); above-header/class-astra-above-header.php 0000644 00000002170 15104467203 0014336 0 ustar 00 <?php /** * Above Header. * * @package astra-builder * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_ABOVE_HEADER_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/above-header' ); define( 'ASTRA_ABOVE_HEADER_URI', ASTRA_THEME_URI . 'inc/builder/type/header/above-header' ); /** * Above Header Initial Setup * * @since 3.0.0 */ class Astra_Above_Header { /** * Constructor function that initializes required actions and hooks. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_ABOVE_HEADER_DIR . '/class-astra-above-header-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_ABOVE_HEADER_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Above_Header(); above-header/assets/js/unminified/customizer-preview.js 0000644 00000007677 15104467203 0017377 0 ustar 00 /** * 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 = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; wp.customize( 'astra-settings[hba-header-height]', function( value ) { value.bind( function( size ) { if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) { var dynamicStyle = ''; dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{'; dynamicStyle += 'min-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '.ast-desktop .ast-above-header-bar .main-header-menu > .menu-item {'; dynamicStyle += 'line-height: ' + size.desktop + 'px;'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{'; dynamicStyle += 'min-height: ' + size.tablet + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{'; dynamicStyle += 'min-height: ' + size.mobile + 'px;'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'hba-header-height', dynamicStyle ); } } ); } ); // Border Bottom width. wp.customize( 'astra-settings[hba-header-separator]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[hba-header-bottom-border-color]' ).get(), dynamicStyle = ''; dynamicStyle += '.ast-above-header.ast-above-header-bar, .ast-above-header-bar {'; dynamicStyle += 'border-bottom-width: ' + border + 'px;'; dynamicStyle += 'border-bottom-style: solid;'; dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += '}'; astra_add_dynamic_css( 'hba-header-separator', dynamicStyle ); } ); } ); // Border Color. astra_css( 'astra-settings[hba-header-bottom-border-color]', 'border-color', '.ast-above-header.ast-above-header-bar, .ast-above-header-bar' ); // Responsive BG styles > Below Header Row. astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'mobile' ); if (document.querySelector(".ast-above-header-wrap .site-logo-img")) { astra_apply_responsive_background_css( "astra-settings[hba-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar", "desktop" ); astra_apply_responsive_background_css( "astra-settings[hba-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar", "tablet" ); astra_apply_responsive_background_css( "astra-settings[hba-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar", "mobile" ); } // Advanced CSS Generation. astra_builder_advanced_css( 'section-above-header-builder', '.ast-above-header.ast-above-header-bar, .ast-header-break-point #masthead.site-header .ast-above-header-bar' ); // Advanced Visibility CSS Generation. astra_builder_visibility_css( 'section-above-header-builder', '.ast-above-header-bar', 'grid' ); } )( jQuery ); above-header/assets/js/minified/customizer-preview.min.js 0000644 00000005141 15104467203 0017576 0 ustar 00 (()=>{var r=astraBuilderPreview.tablet_break_point||768,s=astraBuilderPreview.mobile_break_point||544;wp.customize("astra-settings[hba-header-height]",function(e){e.bind(function(e){var a;""==e.desktop&&""==e.tablet&&""==e.mobile||(a=(a=(a=(a=(a=(a=(a="")+".ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{min-height: "+e.desktop+"px;} .ast-desktop .ast-above-header-bar .main-header-menu > .menu-item {")+"line-height: "+e.desktop+"px;} ")+"@media (max-width: "+r+"px) {.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{")+"min-height: "+e.tablet+"px;} ")+"} @media (max-width: "+s+"px) {")+".ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{min-height: "+e.mobile+"px;} } ",astra_add_dynamic_css("hba-header-height",a))})}),wp.customize("astra-settings[hba-header-separator]",function(e){e.bind(function(e){var a="",a=(a=(a+=".ast-above-header.ast-above-header-bar, .ast-above-header-bar {")+("border-bottom-width: "+e+"px;")+"border-bottom-style: solid;")+("border-color:"+wp.customize("astra-settings[hba-header-bottom-border-color]").get()+";")+"}";astra_add_dynamic_css("hba-header-separator",a)})}),astra_css("astra-settings[hba-header-bottom-border-color]","border-color",".ast-above-header.ast-above-header-bar, .ast-above-header-bar"),astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-above-header.ast-above-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-above-header.ast-above-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-above-header.ast-above-header-bar","mobile"),document.querySelector(".ast-above-header-wrap .site-logo-img")&&(astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hba-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-above-header.ast-above-header-bar","mobile")),astra_builder_advanced_css("section-above-header-builder",".ast-above-header.ast-above-header-bar, .ast-header-break-point #masthead.site-header .ast-above-header-bar"),astra_builder_visibility_css("section-above-header-builder",".ast-above-header-bar","grid")})(jQuery); social-icon/class-astra-header-social-icon-component-loader.php 0000644 00000003123 15104467203 0020563 0 ustar 00 <?php /** * Social Icon Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0s */ class Astra_Header_Social_Icon_Component_Loader { /** * Constructor * * @since 3.0.0s */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0s */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-social-icon-customizer-preview-js', ASTRA_HEADER_SOCIAL_ICON_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for Astra Breakpoints JS. wp_localize_script( 'astra-heading-social-icon-customizer-preview-js', 'astraBuilderHeaderSocial', array( 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), 'component_limit' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_social_icons, ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Social_Icon_Component_Loader(); social-icon/dynamic-css/dynamic.css.php 0000644 00000001270 15104467203 0014104 0 ustar 00 <?php /** * Heading Colors - Dynamic CSS * * @package Astra * @since 2.1.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_social_icon_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 2.1.4 */ function astra_hb_social_icon_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $dynamic_css .= Astra_Social_Component_Dynamic_CSS::astra_social_dynamic_css( 'header' ); return $dynamic_css; } social-icon/assets/js/unminified/customizer-preview.js 0000644 00000000701 15104467203 0017232 0 ustar 00 /** * 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( $ ) { astra_builder_social_css( 'header', astraBuilderHeaderSocial.component_limit ); } )( jQuery ); social-icon/assets/js/minified/customizer-preview.min.js 0000644 00000000123 15104467203 0017447 0 ustar 00 jQuery,astra_builder_social_css("header",astraBuilderHeaderSocial.component_limit); social-icon/class-astra-header-social-icon-component.php 0000644 00000002300 15104467203 0017313 0 ustar 00 <?php /** * Heading Colors for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_SOCIAL_ICON_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/social-icon' ); define( 'ASTRA_HEADER_SOCIAL_ICON_URI', ASTRA_THEME_URI . 'inc/builder/type/header/social-icon' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Social_Icon_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_SOCIAL_ICON_DIR . '/class-astra-header-social-icon-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_SOCIAL_ICON_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Social_Icon_Component(); button/dynamic-css/dynamic.css.php 0000644 00000001246 15104467203 0013222 0 ustar 00 <?php /** * Butons - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_button_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_hb_button_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { $dynamic_css .= Astra_Button_Component_Dynamic_CSS::astra_button_dynamic_css( 'header' ); return $dynamic_css; } button/class-astra-header-button-component-loader.php 0000644 00000004160 15104467203 0017013 0 ustar 00 <?php /** * Button Styling Loader for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Button_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 ); } /** * Add Font Family Callback * * @return void */ public function add_fonts() { /** * Header - Button */ $num_of_header_button = Astra_Builder_Helper::$num_of_header_button; for ( $index = 1; $index <= $num_of_header_button; $index++ ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'button-' . $index, 'header' ) ) { continue; } $_prefix = 'button' . $index; $btn_font_family = astra_get_option( 'header-' . $_prefix . '-font-family' ); $btn_font_weight = astra_get_option( 'header-' . $_prefix . '-font-weight' ); Astra_Fonts::add_font( $btn_font_family, $btn_font_weight ); } } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-button-customizer-preview-js', ASTRA_HEADER_BUTTON_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for Button JS. wp_localize_script( 'astra-heading-button-customizer-preview-js', 'AstraBuilderButtonData', array( 'component_limit' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_button, ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Button_Component_Loader(); button/assets/js/unminified/customizer-preview.js 0000644 00000000677 15104467203 0016361 0 ustar 00 /** * 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( $ ) { astra_builder_button_css( 'header', AstraBuilderButtonData.component_limit ); } )( jQuery ); button/assets/js/minified/customizer-preview.min.js 0000644 00000000121 15104467203 0016560 0 ustar 00 jQuery,astra_builder_button_css("header",AstraBuilderButtonData.component_limit); button/class-astra-header-button-component.php 0000644 00000002235 15104467203 0015550 0 ustar 00 <?php /** * Heading Colors for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 2.1.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_BUTTON_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/button' ); define( 'ASTRA_HEADER_BUTTON_URI', ASTRA_THEME_URI . 'inc/builder/type/header/button' ); /** * Heading Initial Setup * * @since 2.1.4 */ class Astra_Header_Button_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_BUTTON_DIR . '/class-astra-header-button-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_BUTTON_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Button_Component(); primary-header/dynamic-css/dynamic.css.php 0000644 00000023712 15104467203 0014622 0 ustar 00 <?php /** * Primary Header - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_primary_header_breakpoint_style', 11 ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_primary_header_breakpoint_style( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! is_customize_preview() && ( ! Astra_Builder_Helper::is_row_empty( 'primary', 'header', 'desktop' ) && ! Astra_Builder_Helper::is_row_empty( 'primary', 'header', 'mobile' ) ) ) { return $dynamic_css; } // Parsed CSS. $parse_css = ''; $hb_header_height = astra_get_option( 'hb-header-height' ); // Header Height. $hb_header_height_desktop = isset( $hb_header_height['desktop'] ) && ! empty( $hb_header_height['desktop'] ) ? $hb_header_height['desktop'] : ''; $hb_header_height_tablet = isset( $hb_header_height['tablet'] ) && ! empty( $hb_header_height['tablet'] ) ? $hb_header_height['tablet'] : ''; $hb_header_height_mobile = isset( $hb_header_height['mobile'] ) && ! empty( $hb_header_height['mobile'] ) ? $hb_header_height['mobile'] : ''; $common_css_output = array( '.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_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' ) && defined( 'WC_VERSION' ) ) || ( Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) && defined( 'EDD_VERSION' ) ) ) { $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 background colours. $header_bg_obj = astra_get_option( 'hb-header-bg-obj-responsive' ); $hba_header_bg_obj = astra_get_option( 'hba-header-bg-obj-responsive' ); $hbb_header_bg_obj = astra_get_option( 'hbb-header-bg-obj-responsive' ); // Handle style guide logo background cases inside the customizer. if ( is_customize_preview() ) { $header_items = astra_get_option( 'header-desktop-items', array() ); $header_main_color = array( '.ast-sg-element-wrap.ast-sg-logo-section' => astra_get_responsive_background_obj( $header_bg_obj, 'desktop' ), ); $sections = array( 'above' => $hba_header_bg_obj, 'primary' => $header_bg_obj, 'below' => $hbb_header_bg_obj, ); foreach ( $sections as $section => $bg_obj ) { if ( isset( $header_items[ $section ] ) && astra_is_logo_in_section( $header_items[ $section ] ) ) { $header_main_color = array( '.ast-sg-element-wrap.ast-sg-logo-section' => astra_get_responsive_background_obj( $bg_obj, 'desktop' ), ); break; } } // Parse the CSS $parse_css .= astra_parse_css( $header_main_color ); } /** * 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_Extended_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; } primary-header/class-astra-primary-header-loader.php 0000644 00000003757 15104467203 0016574 0 ustar 00 <?php /** * Button Styling Loader for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Primary_Header_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); // Markup. add_filter( 'body_class', array( $this, 'astra_body_header_classes' ) ); } /** * Adds custom classes to the array of body classes. * * @since 1.0.0 * @param array $classes Classes for the body element. * @return array */ public function astra_body_header_classes( $classes ) { /** * Add class for header width */ $header_content_layout = astra_get_option( 'hb-header-main-layout-width' ); if ( 'full' === $header_content_layout ) { $classes[] = 'ast-full-width-primary-header'; } return $classes; } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-primary-customizer-preview-js', ASTRA_PRIMARY_HEADER_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for Button JS. wp_localize_script( 'astra-heading-primary-customizer-preview-js', 'AstraBuilderPrimaryHeaderData', array( 'header_break_point' => 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(); primary-header/class-astra-primary-header.php 0000644 00000002345 15104467203 0015320 0 ustar 00 <?php /** * Heading Colors for Astra theme. * * @package Astra * @link https://www.brainstormforce.com * @since Astra 3.0.0. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_PRIMARY_HEADER_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/primary-header' ); define( 'ASTRA_PRIMARY_HEADER_URI', ASTRA_THEME_URI . 'inc/builder/type/header/primary-header' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Primary_Header { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_PRIMARY_HEADER_DIR . '/class-astra-primary-header-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_PRIMARY_HEADER_DIR . '/dynamic-css/dynamic.css.php'; remove_filter( 'astra_dynamic_theme_css', 'astra_header_breakpoint_style' ); } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Primary_Header(); primary-header/assets/js/unminified/customizer-preview.js 0000644 00000020044 15104467203 0017745 0 ustar 00 /** * 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' ); const iframe = document.querySelector('#customize-preview iframe'); // Style guide logo background colour preview. var desktopHeader = document.getElementById("ast-desktop-header"); if (desktopHeader) { var mainHeaderWrap = desktopHeader.querySelector( '.ast-main-header-wrap.main-header-bar-wrap' ); if (mainHeaderWrap && mainHeaderWrap.querySelector(".site-logo-img")) { astra_apply_responsive_background_css( "astra-settings[hb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .main-header-bar", "desktop" ); astra_apply_responsive_background_css( "astra-settings[hb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .ast-primary-header.main-header-bar", "tablet" ); astra_apply_responsive_background_css( "astra-settings[hb-header-bg-obj-responsive]", ".ast-sg-element-wrap.ast-sg-logo-section, .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 ); primary-header/assets/js/minified/customizer-preview.min.js 0000644 00000011315 15104467203 0020165 0 ustar 00 (()=>{var t=AstraBuilderPrimaryHeaderData.tablet_break_point||768,r=AstraBuilderPrimaryHeaderData.mobile_break_point||544,e=(wp.customize("astra-settings[hb-header-height]",function(e){e.bind(function(e){var a;""==e.desktop&&""==e.tablet&&""==e.mobile||(a=(a=(a=(a=(a=(a=(a="")+".ast-mobile-header-wrap .ast-primary-header-bar , .ast-primary-header-bar .site-primary-header-wrap {min-height: "+e.desktop+"px;} .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item {")+"line-height: "+e.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: "+e.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: "+e.mobile+"px;} } ",astra_add_dynamic_css("hb-header-height",a))})}),wp.customize("astra-settings[hb-header-main-layout-width]",function(e){e.bind(function(e){var a="";"content"!==e?a+="#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {max-width: unset;padding-left: 35px;padding-right: 35px;} ":a="#masthead .ast-container, .site-header-focus-item + .ast-breadcrumbs-wrapper {max-width: 100%padding-left: 20px;padding-right: 20px;} ",a=a+("@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",a)})}),wp.customize("astra-settings[hb-header-main-sep]",function(e){e.bind(function(e){var a="",a=(a=(a+=".ast-header-break-point .ast-primary-header-bar, .ast-primary-header-bar {")+("border-bottom-width: "+e+"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",a)})}),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"),document.querySelector("#customize-preview iframe"),document.getElementById("ast-desktop-header"));e&&(e=e.querySelector(".ast-main-header-wrap.main-header-bar-wrap"))&&e.querySelector(".site-logo-img")&&(astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .main-header-bar","desktop"),astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .ast-primary-header.main-header-bar","tablet"),astra_apply_responsive_background_css("astra-settings[hb-header-bg-obj-responsive]",".ast-sg-element-wrap.ast-sg-logo-section, .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(e){e.bind(function(e){var a;""==e.desktop.bottom&&""==e.desktop.top&&""==e.desktop.left&&""==e.desktop.right&&""==e.tablet.bottom&&""==e.tablet.top&&""==e.tablet.left&&""==e.tablet.right&&""==e.mobile.bottom&&""==e.mobile.top&&""==e.mobile.left&&""==e.mobile.right||(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a="")+".ast-hfb-header .site-header {margin-left: "+e.desktop.left+e["desktop-unit"]+";")+"margin-right: "+e.desktop.right+e["desktop-unit"]+";")+"margin-top: "+e.desktop.top+e["desktop-unit"]+";")+"margin-bottom: "+e.desktop.bottom+e["desktop-unit"]+";")+"} @media (max-width: "+t+"px) {")+".ast-hfb-header .site-header {margin-left: "+e.tablet.left+e["tablet-unit"]+";")+"margin-right: "+e.tablet.right+e["tablet-unit"]+";")+"margin-top: "+e.tablet.top+e["desktop-unit"]+";")+"margin-bottom: "+e.tablet.bottom+e["desktop-unit"]+";} ")+"} @media (max-width: "+r+"px) {")+".ast-hfb-header .site-header {margin-left: "+e.mobile.left+e["mobile-unit"]+";")+"margin-right: "+e.mobile.right+e["mobile-unit"]+";")+"margin-top: "+e.mobile.top+e["desktop-unit"]+";")+"margin-bottom: "+e.mobile.bottom+e["desktop-unit"]+";} } ",astra_add_dynamic_css("section-header-builder-layout-margin-toggle-button",a))})})})(jQuery); edd-cart/dynamic-css/dynamic.css.php 0000644 00000046435 15104467203 0013403 0 ustar 00 <?php /** * EDD Cart - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Search */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_edd_cart_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Search. * * @since 3.0.0 */ function astra_hb_edd_cart_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ) { return $dynamic_css; } $selector = '.ast-edd-site-header-cart'; $trans_header_cart_selector = '.ast-theme-transparent-header .ast-edd-site-header-cart'; $theme_color = astra_get_option( 'theme-color' ); $link_color = astra_get_option( 'link-color', $theme_color ); $header_cart_icon_style = astra_get_option( 'edd-header-cart-icon-style' ); $header_cart_icon_color = astra_get_option( 'edd-header-cart-icon-color', $theme_color ); $header_cart_icon_radius = astra_get_option( 'edd-header-cart-icon-radius' ); $cart_h_color = astra_get_foreground_color( $header_cart_icon_color ); $trans_header_cart_icon_color = astra_get_option( 'transparent-header-edd-cart-icon-color', $theme_color ); $trans_header_cart_h_color = astra_get_foreground_color( $trans_header_cart_icon_color ); $btn_color = astra_get_option( 'button-color' ); $btn_bg_color = astra_get_option( 'button-bg-color', $theme_color ); if ( empty( $btn_color ) ) { $btn_color = astra_get_foreground_color( $theme_color ); } if ( 'none' === $header_cart_icon_style ) { $header_cart_icon_color = $theme_color; $trans_header_cart_icon_color = $theme_color; } /** * - EDD cart styles. */ $cart_text_color = astra_get_option( 'header-edd-cart-text-color' ); $cart_link_color = astra_get_option( 'header-edd-cart-link-color', $link_color ); $cart_bg_color = astra_get_option( 'header-edd-cart-background-color' ); $cart_separator_color = astra_get_option( 'header-edd-cart-separator-color' ); $checkout_button_text_color = astra_get_option( 'header-edd-checkout-btn-text-color', $btn_color ); $checkout_button_bg_color = astra_get_option( 'header-edd-checkout-btn-background-color', $btn_bg_color ); $checkout_button_text_h_color = astra_get_option( 'header-edd-checkout-btn-text-hover-color', $btn_color ); $checkout_button_bg_h_color = astra_get_option( 'header-edd-checkout-btn-bg-hover-color', $btn_bg_color ); $header_cart_icon = ''; $cart_text_color_desktop = ! empty( $cart_text_color['desktop'] ) ? $cart_text_color['desktop'] : ''; $cart_text_color_mobile = ! empty( $cart_text_color['mobile'] ) ? $cart_text_color['mobile'] : ''; $cart_text_color_tablet = ! empty( $cart_text_color['tablet'] ) ? $cart_text_color['tablet'] : ''; $cart_bg_color_desktop = ! empty( $cart_bg_color['desktop'] ) ? $cart_bg_color['desktop'] : ''; $cart_bg_color_mobile = ! empty( $cart_bg_color['mobile'] ) ? $cart_bg_color['mobile'] : ''; $cart_bg_color_tablet = ! empty( $cart_bg_color['tablet'] ) ? $cart_bg_color['tablet'] : ''; $cart_link_color_desktop = ! empty( $cart_link_color['desktop'] ) ? $cart_link_color['desktop'] : ''; $cart_link_color_mobile = ! empty( $cart_link_color['mobile'] ) ? $cart_link_color['mobile'] : ''; $cart_link_color_tablet = ! empty( $cart_link_color['tablet'] ) ? $cart_link_color['tablet'] : ''; $cart_separator_color_desktop = ! empty( $cart_separator_color['desktop'] ) ? $cart_separator_color['desktop'] : ''; $cart_separator_color_mobile = ! empty( $cart_separator_color['mobile'] ) ? $cart_separator_color['mobile'] : ''; $cart_separator_color_tablet = ! empty( $cart_separator_color['tablet'] ) ? $cart_separator_color['tablet'] : ''; $checkout_button_text_color_desktop = ! empty( $checkout_button_text_color['desktop'] ) ? $checkout_button_text_color['desktop'] : ''; $checkout_button_text_color_mobile = ! empty( $checkout_button_text_color['mobile'] ) ? $checkout_button_text_color['mobile'] : ''; $checkout_button_text_color_tablet = ! empty( $checkout_button_text_color['tablet'] ) ? $checkout_button_text_color['tablet'] : ''; $checkout_button_bg_color_desktop = ! empty( $checkout_button_bg_color['desktop'] ) ? $checkout_button_bg_color['desktop'] : ''; $checkout_button_bg_color_mobile = ! empty( $checkout_button_bg_color['mobile'] ) ? $checkout_button_bg_color['mobile'] : ''; $checkout_button_bg_color_tablet = ! empty( $checkout_button_bg_color['tablet'] ) ? $checkout_button_bg_color['tablet'] : ''; $checkout_button_text_h_color_desktop = ! empty( $checkout_button_text_h_color['desktop'] ) ? $checkout_button_text_h_color['desktop'] : ''; $checkout_button_text_h_color_mobile = ! empty( $checkout_button_text_h_color['mobile'] ) ? $checkout_button_text_h_color['mobile'] : ''; $checkout_button_text_h_color_tablet = ! empty( $checkout_button_text_h_color['tablet'] ) ? $checkout_button_text_h_color['tablet'] : ''; $checkout_button_bg_h_color_desktop = ! empty( $checkout_button_bg_h_color['desktop'] ) ? $checkout_button_bg_h_color['desktop'] : ''; $checkout_button_bg_h_color_mobile = ! empty( $checkout_button_bg_h_color['mobile'] ) ? $checkout_button_bg_h_color['mobile'] : ''; $checkout_button_bg_h_color_tablet = ! empty( $checkout_button_bg_h_color['tablet'] ) ? $checkout_button_bg_h_color['tablet'] : ''; /** * EDD Cart CSS. */ $css_output_desktop = array( $selector . ' .ast-edd-cart-menu-wrap .count, ' . $selector . ' .ast-edd-cart-menu-wrap .count:after' => array( 'color' => $theme_color, 'border-color' => $theme_color, ), $selector . ' .ast-edd-cart-menu-wrap:hover .count' => array( 'color' => esc_attr( $cart_h_color ), 'background-color' => esc_attr( $theme_color ), ), $selector . ' .ast-icon-shopping-cart' => array( 'color' => $theme_color, ), $selector . ' .ast-edd-header-cart-info-wrap' => array( 'color' => esc_attr( $header_cart_icon_color ), ), $selector . ' .ast-addon-cart-wrap span.astra-icon:after' => array( 'color' => esc_attr( $cart_h_color ), 'background-color' => esc_attr( $header_cart_icon_color ), ), /** * Transparent Header - EDD Cart icon color. */ $trans_header_cart_selector . ' .ast-edd-header-cart-info-wrap' => array( 'color' => esc_attr( $trans_header_cart_icon_color ), ), $trans_header_cart_selector . ' .ast-addon-cart-wrap span.astra-icon:after' => array( 'color' => esc_attr( $trans_header_cart_h_color ), 'background-color' => esc_attr( $trans_header_cart_icon_color ), ), /** * General EDD Cart tray color for widget */ $selector . ' .widget_edd_cart_widget a, ' . $selector . ' .widget_edd_cart_widget a.edd-remove-from-cart, ' . $selector . ' .widget_edd_cart_widget .cart-total' => array( 'color' => esc_attr( $cart_link_color_desktop ), ), $selector . ' .widget_edd_cart_widget a.edd-remove-from-cart:after' => array( 'color' => esc_attr( $cart_link_color_desktop ), 'border-color' => esc_attr( $cart_link_color_desktop ), ), $selector . ' .widget_edd_cart_widget span, ' . $selector . ' .widget_edd_cart_widget strong, ' . $selector . ' .widget_edd_cart_widget *' => array( 'color' => esc_attr( $cart_text_color_desktop ), ), '.ast-builder-layout-element ' . $selector . ' .widget_edd_cart_widget' => array( 'background-color' => esc_attr( $cart_bg_color_desktop ), 'border-color' => esc_attr( $cart_bg_color_desktop ), ), '.ast-builder-layout-element ' . $selector . ' .widget_edd_cart_widget:before, .ast-builder-layout-element ' . $selector . ' .widget_edd_cart_widget:after' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_desktop ), ), $selector . ' .widget_edd_cart_widget .edd-cart-item, ' . $selector . ' .widget_edd_cart_widget .edd-cart-number-of-items, ' . $selector . ' .widget_edd_cart_widget .edd-cart-meta' => array( 'border-bottom-color' => esc_attr( $cart_separator_color_desktop ), ), /** * Checkout button color for widget */ '.ast-edd-site-header-cart .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array( 'color' => esc_attr( $checkout_button_text_color_desktop ), 'border-color' => esc_attr( $checkout_button_bg_color_desktop ), 'background-color' => esc_attr( $checkout_button_bg_color_desktop ), ), '.ast-edd-site-header-cart .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_desktop ), 'background-color' => esc_attr( $checkout_button_bg_h_color_desktop ), ), ); $css_output = astra_parse_css( $css_output_desktop ); $responsive_selector = '.astra-cart-drawer.edd-active'; $css_output_mobile = array( $responsive_selector . ' .widget_edd_cart_widget a, ' . $responsive_selector . ' .widget_edd_cart_widget a.edd-remove-from-cart, ' . $responsive_selector . ' .widget_edd_cart_widget .cart-total' => array( 'color' => esc_attr( $cart_link_color_mobile ), ), $selector . ' .widget_edd_cart_widget a.edd-remove-from-cart:after' => array( 'color' => esc_attr( $cart_link_color_mobile ), 'border-color' => esc_attr( $cart_link_color_mobile ), ), $responsive_selector . ' .astra-cart-drawer-title, ' . $responsive_selector . ' .widget_edd_cart_widget span, ' . $responsive_selector . ' .widget_edd_cart_widget strong, ' . $responsive_selector . ' .widget_edd_cart_widget *' => array( 'color' => esc_attr( $cart_text_color_mobile ), ), $responsive_selector => array( 'background-color' => esc_attr( $cart_bg_color_mobile ), 'border-color' => esc_attr( $cart_bg_color_mobile ), ), $responsive_selector . ' .widget_edd_cart_widget:before, .ast-builder-layout-element ' . $responsive_selector . ' .widget_edd_cart_widget:after' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_mobile ), ), $responsive_selector . ' .widget_edd_cart_widget .edd-cart-item, ' . $responsive_selector . ' .widget_edd_cart_widget .edd-cart-number-of-items, ' . $responsive_selector . ' .widget_edd_cart_widget .edd-cart-meta, ' . $responsive_selector . ' .astra-cart-drawer-header' => array( 'border-bottom-color' => esc_attr( $cart_separator_color_mobile ), ), /** * Checkout button color for widget */ $responsive_selector . ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array( 'color' => esc_attr( $checkout_button_text_color_mobile ), 'border-color' => esc_attr( $checkout_button_bg_color_mobile ), 'background-color' => esc_attr( $checkout_button_bg_color_mobile ), ), $responsive_selector . ' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_mobile ), 'background-color' => esc_attr( $checkout_button_bg_h_color_mobile ), ), ); $css_output_tablet = array( $responsive_selector . ' .widget_edd_cart_widget a, ' . $responsive_selector . ' .widget_edd_cart_widget a.edd-remove-from-cart, ' . $responsive_selector . ' .widget_edd_cart_widget .cart-total' => array( 'color' => esc_attr( $cart_link_color_tablet ), ), $selector . ' .widget_edd_cart_widget a.edd-remove-from-cart:after' => array( 'color' => esc_attr( $cart_link_color_tablet ), 'border-color' => esc_attr( $cart_link_color_tablet ), ), $responsive_selector . ' .astra-cart-drawer-title, ' . $responsive_selector . ' .widget_edd_cart_widget span, ' . $responsive_selector . ' .widget_edd_cart_widget strong, ' . $responsive_selector . ' .widget_edd_cart_widget *' => array( 'color' => esc_attr( $cart_text_color_tablet ), ), $responsive_selector => array( 'background-color' => esc_attr( $cart_bg_color_tablet ), 'border-color' => esc_attr( $cart_bg_color_tablet ), ), $responsive_selector . ' .widget_edd_cart_widget:before, .ast-builder-layout-element ' . $responsive_selector . ' .widget_edd_cart_widget:after' => array( 'border-bottom-color' => esc_attr( $cart_bg_color_tablet ), ), $responsive_selector . ' .widget_edd_cart_widget .edd-cart-item, ' . $responsive_selector . ' .widget_edd_cart_widget .edd-cart-number-of-items, ' . $responsive_selector . ' .widget_edd_cart_widget .edd-cart-meta, ' . $responsive_selector . ' .astra-cart-drawer-header' => array( 'border-bottom-color' => esc_attr( $cart_separator_color_tablet ), ), /** * Checkout button color for widget */ $responsive_selector . ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' => array( 'color' => esc_attr( $checkout_button_text_color_tablet ), 'border-color' => esc_attr( $checkout_button_bg_color_tablet ), 'background-color' => esc_attr( $checkout_button_bg_color_tablet ), ), $responsive_selector . ' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' => array( 'color' => esc_attr( $checkout_button_text_h_color_tablet ), 'background-color' => esc_attr( $checkout_button_bg_h_color_tablet ), ), ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); /** * Header Cart color */ if ( 'none' !== $header_cart_icon_style ) { /** * Header Cart Icon colors */ $header_cart_icon = array( $selector . ' .ast-edd-cart-menu-wrap .count' => array( 'color' => esc_attr( astra_get_option( 'edd-header-cart-icon-color' ) ), 'border-color' => esc_attr( astra_get_option( 'edd-header-cart-icon-color' ) ), ), $selector . ' .ast-edd-cart-menu-wrap .count:after' => array( 'color' => esc_attr( astra_get_option( 'edd-header-cart-icon-color' ) ), 'border-color' => esc_attr( astra_get_option( 'edd-header-cart-icon-color' ) ), ), $selector . ' .ast-icon-shopping-cart' => array( 'color' => esc_attr( astra_get_option( 'edd-header-cart-icon-color' ) ), ), // Default icon colors. '.ast-edd-cart-menu-wrap .count, .ast-edd-cart-menu-wrap .count:after' => array( 'border-color' => esc_attr( $header_cart_icon_color ), 'color' => esc_attr( $header_cart_icon_color ), ), // Outline icon hover colors. $selector . ' .ast-edd-cart-menu-wrap:hover .count' => array( 'color' => esc_attr( $cart_h_color ), 'background-color' => esc_attr( $header_cart_icon_color ), ), // Outline icon colors. '.ast-edd-menu-cart-outline .ast-addon-cart-wrap' => array( 'background' => '#ffffff', 'color' => esc_attr( $header_cart_icon_color ), ), // Outline Info colors. $selector . ' .ast-menu-cart-outline .ast-edd-header-cart-info-wrap' => array( 'color' => esc_attr( $header_cart_icon_color ), ), // Fill icon Color. '.ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-edd-cart-menu-wrap .count,.ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-edd-menu-cart-fill .ast-addon-cart-wrap .ast-edd-header-cart-info-wrap, .ast-edd-menu-cart-fill .ast-addon-cart-wrap .ast-icon-shopping-cart' => array( 'background-color' => esc_attr( $header_cart_icon_color ), 'color' => esc_attr( $cart_h_color ), ), // Transparent Header - Count colors. $trans_header_cart_selector . ' .ast-edd-cart-menu-wrap .count' => array( 'color' => esc_attr( astra_get_option( 'transparent-header-edd-cart-icon-color' ) ), 'border-color' => esc_attr( astra_get_option( 'transparent-header-edd-cart-icon-color' ) ), ), $trans_header_cart_selector . ' .ast-edd-cart-menu-wrap .count:after' => array( 'color' => esc_attr( astra_get_option( 'transparent-header-edd-cart-icon-color' ) ), 'border-color' => esc_attr( astra_get_option( 'transparent-header-edd-cart-icon-color' ) ), ), $trans_header_cart_selector . ' .ast-icon-shopping-cart' => array( 'color' => esc_attr( astra_get_option( 'transparent-header-edd-cart-icon-color' ) ), ), // Transparent Header - Default icon colors. '.ast-theme-transparent-header .ast-edd-cart-menu-wrap .count, .ast-theme-transparent-header .ast-edd-cart-menu-wrap .count:after' => array( 'border-color' => esc_attr( $trans_header_cart_icon_color ), 'color' => esc_attr( $trans_header_cart_icon_color ), ), // Transparent Header - Outline icon hover colors. $trans_header_cart_selector . ' .ast-edd-cart-menu-wrap:hover .count' => array( 'color' => esc_attr( $trans_header_cart_h_color ), 'background-color' => esc_attr( $trans_header_cart_icon_color ), ), // Transparent Header - Outline icon colors. '.ast-theme-transparent-header .ast-edd-menu-cart-outline .ast-addon-cart-wrap' => array( 'background' => '#ffffff', 'color' => esc_attr( $trans_header_cart_icon_color ), ), // Transparent Header - Outline Info colors. $trans_header_cart_selector . ' .ast-menu-cart-outline .ast-edd-header-cart-info-wrap' => array( 'color' => esc_attr( $trans_header_cart_icon_color ), ), // Transparent Header - Fill icon Color. '.ast-theme-transparent-header .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-edd-cart-menu-wrap .count, .ast-theme-transparent-header .ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-theme-transparent-header .ast-edd-menu-cart-fill .ast-edd-site-header-cart-wrap .ast-icon-shopping-cart, .ast-theme-transparent-header .ast-edd-site-header-cart .ast-addon-cart-wrap span.astra-icon:after' => array( 'background-color' => esc_attr( $trans_header_cart_icon_color ), 'color' => esc_attr( $trans_header_cart_h_color ), ), // Border radius. '.ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .count, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .count, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-addon-cart-wrap .ast-edd-header-cart-info-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-addon-cart-wrap .ast-edd-header-cart-info-wrap' => array( 'border-radius' => astra_get_css_value( $header_cart_icon_radius, 'px' ), ), ); // We adding this conditional CSS only to maintain backwards. Remove this condition after 2-3 updates of add-on. if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.4.2', '<' ) ) { // Outline cart style border. $header_cart_icon['.ast-edd-menu-cart-outline .ast-addon-cart-wrap'] = array( 'background' => '#ffffff', 'border' => '1px solid ' . $header_cart_icon_color, 'color' => esc_attr( $header_cart_icon_color ), ); // Transparent Header outline cart style border. $header_cart_icon['.ast-theme-transparent-header .ast-edd-menu-cart-outline .ast-addon-cart-wrap'] = array( 'background' => '#ffffff', 'border' => '1px solid ' . $trans_header_cart_icon_color, 'color' => esc_attr( $trans_header_cart_icon_color ), ); } $header_cart_icon = astra_parse_css( $header_cart_icon ); } /* Parse CSS from array() */ $css_output .= $header_cart_icon; $css_output .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( 'section-header-edd-cart', '.ast-header-edd-cart' ); $dynamic_css .= $css_output; return $dynamic_css; } edd-cart/class-astra-header-edd-cart-component.php 0000644 00000002355 15104467203 0016073 0 ustar 00 <?php /** * EDD Cart for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_EDD_CART_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/edd-cart' ); define( 'ASTRA_HEADER_EDD_CART_URI', ASTRA_THEME_URI . 'inc/builder/type/header/edd-cart' ); if ( ! class_exists( 'Astra_Header_Edd_Cart_Component' ) ) { /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Edd_Cart_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_EDD_CART_DIR . '/class-astra-header-edd-cart-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_EDD_CART_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Edd_Cart_Component(); } edd-cart/class-astra-header-edd-cart-loader.php 0000644 00000002163 15104467203 0015334 0 ustar 00 <?php /** * EDD Cart Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Edd_Cart_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-header-builder-edd-cart-customizer-preview-js', ASTRA_HEADER_EDD_CART_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Edd_Cart_Loader(); edd-cart/assets/js/unminified/customizer-preview.js 0000644 00000016326 15104467203 0016527 0 ustar 00 /** * 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 selector = '.ast-edd-site-header-cart'; var responsive_selector = '.astra-cart-drawer.edd-active'; // Icon Color. astra_css( 'astra-settings[edd-header-cart-icon-color]', 'color', selector + ' .ast-edd-cart-menu-wrap .count, ' + selector + ' .ast-edd-cart-menu-wrap .count:after,' + selector + ' .ast-edd-header-cart-info-wrap' ); // Icon Color. astra_css( 'astra-settings[edd-header-cart-icon-color]', 'border-color', selector + ' .ast-edd-cart-menu-wrap .count, ' + selector + ' .ast-edd-cart-menu-wrap .count:after' ); // EDD Cart Colors. astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-text-color]', 'color', selector + ' .widget_edd_cart_widget span, ' + selector + ' .widget_edd_cart_widget strong, ' + selector + ' .widget_edd_cart_widget *, ' + responsive_selector + ' .widget_edd_cart_widget span, .astra-cart-drawer .widget_edd_cart_widget *, ' + responsive_selector + ' .astra-cart-drawer-title' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-link-color]', 'color', selector + ' .widget_edd_cart_widget a, ' + selector + ' .widget_edd_cart_widget a.edd-remove-from-cart, ' + selector + ' .widget_edd_cart_widget .cart-total, ' + selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after, '+ responsive_selector + ' .widget_edd_cart_widget a, ' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart, ' + responsive_selector + ' .widget_edd_cart_widget .cart-total, ' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-link-color]', 'border-color', selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after,' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after,' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-background-color]', 'background-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget ,' + responsive_selector + ', ' + responsive_selector + '#astra-mobile-cart-drawer' ); astra_color_responsive_css( 'edd-cart-border-color', 'astra-settings[header-edd-cart-background-color]', 'border-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget, ' + responsive_selector + ' .widget_edd_cart_widget' ); astra_color_responsive_css( 'edd-cart-border-bottom-color', 'astra-settings[header-edd-cart-background-color]', 'border-bottom-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget:before, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget:after, ' + responsive_selector + ' .widget_edd_cart_widget:before, ' + responsive_selector + ' .widget_edd_cart_widget:after' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-separator-color]', 'border-bottom-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-item, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-number-of-items, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-meta,'+ responsive_selector + ' .widget_edd_cart_widget .edd-cart-item, ' + responsive_selector + ' .widget_edd_cart_widget .edd-cart-number-of-items, ' + responsive_selector + ' .widget_edd_cart_widget .edd-cart-meta, ' + responsive_selector + ' .astra-cart-drawer-header' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-text-color]', 'color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a, '+ responsive_selector + ' .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-background-color]', 'background-color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-border-color', 'astra-settings[header-edd-checkout-btn-background-color]', 'border-color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-text-hover-color]', 'color', selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover,' + responsive_selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-bg-hover-color]', 'background-color', selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover, ' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' ); /** * Cart icon style */ wp.customize( 'astra-settings[edd-header-cart-icon-style]', function( setting ) { setting.bind( function( icon_style ) { var buttons = $(document).find('.ast-edd-site-header-cart'); buttons.removeClass('ast-edd-menu-cart-fill ast-edd-menu-cart-outline'); buttons.addClass( 'ast-edd-menu-cart-' + icon_style ); var dynamicStyle = '.ast-edd-site-header-cart a, .ast-edd-site-header-cart a *{ transition: all 0s; } '; astra_add_dynamic_css( 'edd-header-cart-icon-style', dynamicStyle ); wp.customize.preview.send( 'refresh' ); } ); } ); /** * EDD Cart Button Color */ wp.customize( 'astra-settings[edd-header-cart-icon-color]', function( setting ) { setting.bind( function( cart_icon_color ) { wp.customize.preview.send( 'refresh' ); }); }); /** * Button Border Radius */ wp.customize( 'astra-settings[edd-header-cart-icon-radius]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .count, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .count{ border-radius: ' + ( parseInt( border ) ) + 'px } '; astra_add_dynamic_css( 'edd-header-cart-icon-radius', dynamicStyle ); } ); } ); /** * Transparent Header EDD-Cart color options - Customizer preview CSS. */ wp.customize( 'astra-settings[transparent-header-edd-cart-icon-color]', function( setting ) { setting.bind( function( cart_icon_color ) { wp.customize.preview.send( 'refresh' ); }); }); // Advanced Visibility CSS Generation. astra_builder_visibility_css( 'section-header-edd-cart', '.ast-header-edd-cart' ); } )( jQuery ); edd-cart/assets/js/minified/customizer-preview.min.js 0000644 00000012452 15104467203 0016742 0 ustar 00 (t=>{var e=".ast-edd-site-header-cart",d=".astra-cart-drawer.edd-active";astra_css("astra-settings[edd-header-cart-icon-color]","color",e+" .ast-edd-cart-menu-wrap .count, "+e+" .ast-edd-cart-menu-wrap .count:after,"+e+" .ast-edd-header-cart-info-wrap"),astra_css("astra-settings[edd-header-cart-icon-color]","border-color",e+" .ast-edd-cart-menu-wrap .count, "+e+" .ast-edd-cart-menu-wrap .count:after"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-cart-text-color]","color",e+" .widget_edd_cart_widget span, "+e+" .widget_edd_cart_widget strong, "+e+" .widget_edd_cart_widget *, "+d+" .widget_edd_cart_widget span, .astra-cart-drawer .widget_edd_cart_widget *, "+d+" .astra-cart-drawer-title"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-cart-link-color]","color",e+" .widget_edd_cart_widget a, "+e+" .widget_edd_cart_widget a.edd-remove-from-cart, "+e+" .widget_edd_cart_widget .cart-total, "+e+" .widget_edd_cart_widget a.edd-remove-from-cart:after, "+d+" .widget_edd_cart_widget a, "+d+" .widget_edd_cart_widget a.edd-remove-from-cart, "+d+" .widget_edd_cart_widget .cart-total, "+d+" .widget_edd_cart_widget a.edd-remove-from-cart:after"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-cart-link-color]","border-color",e+" .widget_edd_cart_widget a.edd-remove-from-cart:after,"+d+" .widget_edd_cart_widget a.edd-remove-from-cart:after,"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-cart-background-color]","background-color",".ast-builder-layout-element "+e+" .widget_edd_cart_widget ,"+d+", "+d+"#astra-mobile-cart-drawer"),astra_color_responsive_css("edd-cart-border-color","astra-settings[header-edd-cart-background-color]","border-color",".ast-builder-layout-element "+e+" .widget_edd_cart_widget, "+d+" .widget_edd_cart_widget"),astra_color_responsive_css("edd-cart-border-bottom-color","astra-settings[header-edd-cart-background-color]","border-bottom-color",".ast-builder-layout-element "+e+" .widget_edd_cart_widget:before, .ast-builder-layout-element "+e+" .widget_edd_cart_widget:after, "+d+" .widget_edd_cart_widget:before, "+d+" .widget_edd_cart_widget:after"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-cart-separator-color]","border-bottom-color",".ast-builder-layout-element "+e+" .widget_edd_cart_widget .edd-cart-item, .ast-builder-layout-element "+e+" .widget_edd_cart_widget .edd-cart-number-of-items, .ast-builder-layout-element "+e+" .widget_edd_cart_widget .edd-cart-meta,"+d+" .widget_edd_cart_widget .edd-cart-item, "+d+" .widget_edd_cart_widget .edd-cart-number-of-items, "+d+" .widget_edd_cart_widget .edd-cart-meta, "+d+" .astra-cart-drawer-header"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-checkout-btn-text-color]","color",e+" .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a, "+d+" .widget_edd_cart_widget .edd_checkout a"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-checkout-btn-background-color]","background-color",e+" .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,"+d+" .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a"),astra_color_responsive_css("edd-cart-border-color","astra-settings[header-edd-checkout-btn-background-color]","border-color",e+" .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,"+d+" .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-checkout-btn-text-hover-color]","color",e+" .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover,"+d+" .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover"),astra_color_responsive_css("edd-cart-colors","astra-settings[header-edd-checkout-btn-bg-hover-color]","background-color",e+" .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover, "+d+" .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover"),wp.customize("astra-settings[edd-header-cart-icon-style]",function(e){e.bind(function(e){var d=t(document).find(".ast-edd-site-header-cart");d.removeClass("ast-edd-menu-cart-fill ast-edd-menu-cart-outline"),d.addClass("ast-edd-menu-cart-"+e);astra_add_dynamic_css("edd-header-cart-icon-style",".ast-edd-site-header-cart a, .ast-edd-site-header-cart a *{ transition: all 0s; } "),wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[edd-header-cart-icon-color]",function(e){e.bind(function(e){wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[edd-header-cart-icon-radius]",function(e){e.bind(function(e){e=".ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .count, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .count{ border-radius: "+parseInt(e)+"px } ";astra_add_dynamic_css("edd-header-cart-icon-radius",e)})}),wp.customize("astra-settings[transparent-header-edd-cart-icon-color]",function(e){e.bind(function(e){wp.customize.preview.send("refresh")})}),astra_builder_visibility_css("section-header-edd-cart",".ast-header-edd-cart")})(jQuery); mobile-menu/dynamic-css/dynamic.css.php 0000644 00000041133 15104467203 0014117 0 ustar 00 <?php /** * Header Menu Colors - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Header Menu Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_mobile_menu_dynamic_css', 11 ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Header Menu Colors. * * @since 3.0.0 */ function astra_hb_mobile_menu_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'mobile-menu', 'header' ) ) { return $dynamic_css; } $_section = 'section-header-mobile-menu'; $selector = '.ast-builder-menu-mobile .main-navigation'; // Sub Menu. $sub_menu_divider_toggle = astra_get_option( 'header-mobile-menu-submenu-item-border' ); $sub_menu_divider_size = astra_get_option( 'header-mobile-menu-submenu-item-b-size' ); $sub_menu_divider_color = astra_get_option( 'header-mobile-menu-submenu-item-b-color' ); // Menu. $menu_resp_color = astra_get_option( 'header-mobile-menu-color-responsive' ); $menu_resp_bg_color = astra_get_option( 'header-mobile-menu-bg-obj-responsive' ); $menu_resp_color_hover = astra_get_option( 'header-mobile-menu-h-color-responsive' ); $menu_resp_bg_color_hover = astra_get_option( 'header-mobile-menu-h-bg-color-responsive' ); $menu_resp_color_active = astra_get_option( 'header-mobile-menu-a-color-responsive' ); $menu_resp_bg_color_active = astra_get_option( 'header-mobile-menu-a-bg-color-responsive' ); $submenu_resp_bg_color = astra_get_option( 'header-mobile-menu-submenu-bg-color-responsive' ); $menu_resp_color_desktop = isset( $menu_resp_color['desktop'] ) ? $menu_resp_color['desktop'] : ''; $menu_resp_color_tablet = isset( $menu_resp_color['tablet'] ) ? $menu_resp_color['tablet'] : ''; $menu_resp_color_mobile = isset( $menu_resp_color['mobile'] ) ? $menu_resp_color['mobile'] : ''; $menu_resp_color_hover_desktop = isset( $menu_resp_color_hover['desktop'] ) ? $menu_resp_color_hover['desktop'] : ''; $menu_resp_color_hover_tablet = isset( $menu_resp_color_hover['tablet'] ) ? $menu_resp_color_hover['tablet'] : ''; $menu_resp_color_hover_mobile = isset( $menu_resp_color_hover['mobile'] ) ? $menu_resp_color_hover['mobile'] : ''; $menu_resp_bg_color_hover_desktop = isset( $menu_resp_bg_color_hover['desktop'] ) ? $menu_resp_bg_color_hover['desktop'] : ''; $menu_resp_bg_color_hover_tablet = isset( $menu_resp_bg_color_hover['tablet'] ) ? $menu_resp_bg_color_hover['tablet'] : ''; $menu_resp_bg_color_hover_mobile = isset( $menu_resp_bg_color_hover['mobile'] ) ? $menu_resp_bg_color_hover['mobile'] : ''; $menu_resp_color_active_desktop = isset( $menu_resp_color_active['desktop'] ) ? $menu_resp_color_active['desktop'] : ''; $menu_resp_color_active_tablet = isset( $menu_resp_color_active['tablet'] ) ? $menu_resp_color_active['tablet'] : ''; $menu_resp_color_active_mobile = isset( $menu_resp_color_active['mobile'] ) ? $menu_resp_color_active['mobile'] : ''; $menu_resp_bg_color_active_desktop = isset( $menu_resp_bg_color_active['desktop'] ) ? $menu_resp_bg_color_active['desktop'] : ''; $menu_resp_bg_color_active_tablet = isset( $menu_resp_bg_color_active['tablet'] ) ? $menu_resp_bg_color_active['tablet'] : ''; $menu_resp_bg_color_active_mobile = isset( $menu_resp_bg_color_active['mobile'] ) ? $menu_resp_bg_color_active['mobile'] : ''; // Typography. $menu_font_size = astra_get_option( 'header-mobile-menu-font-size' ); $menu_font_size_desktop = isset( $menu_font_size['desktop'] ) ? $menu_font_size['desktop'] : ''; $menu_font_size_tablet = isset( $menu_font_size['tablet'] ) ? $menu_font_size['tablet'] : ''; $menu_font_size_mobile = isset( $menu_font_size['mobile'] ) ? $menu_font_size['mobile'] : ''; $menu_font_size_desktop_unit = isset( $menu_font_size['desktop-unit'] ) ? $menu_font_size['desktop-unit'] : ''; $menu_font_size_tablet_unit = isset( $menu_font_size['tablet-unit'] ) ? $menu_font_size['tablet-unit'] : ''; $menu_font_size_mobile_unit = isset( $menu_font_size['mobile-unit'] ) ? $menu_font_size['mobile-unit'] : ''; // Spacing. $menu_spacing = astra_get_option( 'header-mobile-menu-menu-spacing' ); $sub_menu_divider_color = true === $sub_menu_divider_toggle ? $sub_menu_divider_color : ''; // Margin. $margin = astra_get_option( $_section . '-margin' ); $margin_selector = '.ast-builder-menu-mobile .main-header-menu, .ast-header-break-point .ast-builder-menu-mobile .main-header-menu'; $menu_spacing_desktop_top = astra_responsive_spacing( $menu_spacing, 'top', 'desktop' ); $menu_spacing_desktop_top = isset( $menu_spacing_desktop_top ) && ! empty( $menu_spacing_desktop_top ) ? $menu_spacing_desktop_top : 0; $menu_spacing_tablet_top = astra_responsive_spacing( $menu_spacing, 'top', 'tablet' ); $menu_spacing_tablet_top = isset( $menu_spacing_tablet_top ) && ! empty( $menu_spacing_tablet_top ) ? $menu_spacing_tablet_top : 0; $menu_spacing_mobile_top = astra_responsive_spacing( $menu_spacing, 'top', 'mobile' ); if ( isset( $menu_spacing_mobile_top ) && '' === $menu_spacing_mobile_top && isset( $menu_spacing_tablet_top ) && '' !== $menu_spacing_tablet_top && 0 !== $menu_spacing_tablet_top ) { $menu_spacing_mobile_top = $menu_spacing_tablet_top; } $menu_spacing_mobile_top = isset( $menu_spacing_mobile_top ) && ! empty( $menu_spacing_mobile_top ) ? $menu_spacing_mobile_top : 0; $css_output_desktop = array( $selector . ' .menu-item > .menu-link' => astra_get_font_array_css( astra_get_option( 'header-mobile-menu-font-family' ), astra_get_option( 'header-mobile-menu-font-weight' ), array(), 'font-extras-header-mobile-menu' ), $selector => array( 'font-size' => astra_get_font_css_value( $menu_font_size_desktop, $menu_font_size_desktop_unit ), ), $selector . ' .main-header-menu .menu-item > .menu-link' => array( 'color' => $menu_resp_color_desktop, 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'desktop' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), ), $selector . ' .main-header-menu .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_desktop, ), $selector . ' .main-header-menu .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_desktop, 'background' => $menu_resp_bg_color_hover_desktop, ), '.ast-builder-menu-mobile .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_desktop, 'background' => $menu_resp_bg_color_hover_desktop, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_desktop, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_desktop, 'background' => $menu_resp_bg_color_active_desktop, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_desktop, ), $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => $menu_spacing_desktop_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), '-', '0.907', 'em' ), ), $selector . ' .menu-item-has-children > .menu-link:after' => array( 'content' => 'unset', ), // Margin CSS. $margin_selector => array( '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' ), ), ); $css_output_desktop[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .menu-link, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'desktop' ); $css_output_desktop[ $selector . ' .main-header-menu .sub-menu .menu-link' ] = array( 'background-color' => isset( $submenu_resp_bg_color['desktop'] ) ? $submenu_resp_bg_color['desktop'] : '', ); $css_output_tablet = array( $selector => array( 'font-size' => astra_get_font_css_value( $menu_font_size_tablet, $menu_font_size_tablet_unit ), ), $selector . ' .main-header-menu .menu-item > .menu-link' => array( 'color' => $menu_resp_color_tablet, 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'tablet' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ), ), $selector . ' .main-header-menu .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_tablet, ), $selector . ' .main-header-menu .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_tablet, 'background' => $menu_resp_bg_color_hover_tablet, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_tablet, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_tablet, 'background' => $menu_resp_bg_color_active_tablet, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_tablet, ), $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => $menu_spacing_tablet_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ), '-', '0.907', 'em' ), ), $selector . ' .menu-item-has-children > .menu-link:after' => array( 'content' => 'unset', ), // Margin CSS. $margin_selector => array( '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' ), ), ); $css_output_tablet[ $selector . ' .main-header-menu , ' . $selector . ' .main-header-menu .menu-link, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'tablet' ); $css_output_tablet[ $selector . ' .main-header-menu .sub-menu .menu-link' ] = array( 'background-color' => isset( $submenu_resp_bg_color['tablet'] ) ? $submenu_resp_bg_color['tablet'] : ( isset( $submenu_resp_bg_color['desktop'] ) ? $submenu_resp_bg_color['desktop'] : '' ), ); $css_output_mobile = array( $selector => array( 'font-size' => astra_get_font_css_value( $menu_font_size_mobile, $menu_font_size_mobile_unit ), ), $selector . ' .main-header-menu .menu-item > .menu-link' => array( 'color' => $menu_resp_color_mobile, 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'mobile' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ), ), $selector . ' .main-header-menu .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_mobile, ), $selector . ' .main-header-menu .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_mobile, 'background' => $menu_resp_bg_color_hover_mobile, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_mobile, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_mobile, 'background' => $menu_resp_bg_color_active_mobile, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_mobile, ), $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => $menu_spacing_mobile_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ), '-', '0.907', 'em' ), ), // Margin CSS. $margin_selector => array( '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' ), ), ); $css_output_mobile[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .menu-link, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ); $css_output_mobile[ $selector . ' .main-header-menu .sub-menu .menu-link' ] = array( 'background-color' => isset( $submenu_resp_bg_color['mobile'] ) ? $submenu_resp_bg_color['mobile'] : ( isset( $submenu_resp_bg_color['desktop'] ) ? $submenu_resp_bg_color['desktop'] : '' ), ); if ( true === $sub_menu_divider_toggle ) { $css_output_desktop_submenu = array( '.ast-hfb-header ' . $selector . ' .main-header-menu, .ast-hfb-header ' . $selector . ' .main-header-menu, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .main-header-menu, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .main-header-menu' => array( 'border-top-width' => $sub_menu_divider_size . 'px', 'border-color' => $sub_menu_divider_color, ), '.ast-hfb-header ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .menu-link, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .menu-item .menu-link, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .menu-item .menu-link' => array( 'border-bottom-width' => $sub_menu_divider_size . 'px', 'border-color' => $sub_menu_divider_color, 'border-style' => 'solid', ), ); } else { $css_output_desktop_submenu = array( '.ast-hfb-header .ast-builder-menu-mobile .main-header-menu, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link' => array( 'border-style' => 'none', ), ); } $css_output_desktop_submenu[ $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' ] = array( 'top' => $menu_spacing_desktop_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), '-', '0.907', 'em' ), ); $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_desktop_submenu ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector, 'block' ); return $dynamic_css; } mobile-menu/class-astra-mobile-menu-component.php 0000644 00000011754 15104467203 0016124 0 ustar 00 <?php /** * Header Navigation Menu component. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_BUILDER_MOBILE_MENU_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/mobile-menu' ); define( 'ASTRA_BUILDER_MOBILE_MENU_URI', ASTRA_THEME_URI . 'inc/builder/type/header/mobile-menu' ); /** * Header Navigation Menu Initial Setup * * @since 3.0.0 */ class Astra_Mobile_Menu_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_BUILDER_MOBILE_MENU_DIR . '/class-astra-mobile-menu-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_BUILDER_MOBILE_MENU_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Secondary navigation markup * * @param string $device Checking where mobile-menu is dropped. * * @since 3.0.0. */ public static function menu_markup( $device = 'mobile' ) { $astra_builder = astra_builder(); $theme_location = 'mobile_menu'; $submenu_class = apply_filters( 'astra_secondary_submenu_border_class', ' submenu-with-border' ); $stack_on_mobile_class = 'stack-on-mobile'; // Menu Animation. $menu_animation = astra_get_option( 'header-mobile-menu-submenu-container-animation' ); if ( ! empty( $menu_animation ) ) { $submenu_class .= ' astra-menu-animation-' . esc_attr( $menu_animation ) . ' '; } // Resolving duplicate ID for 'ast-hf-mobile-menu' in W3C Validator. $menu_id = 'ast-hf-mobile-menu'; if ( 'desktop' === $device ) { $menu_id = 'ast-desktop-toggle-menu'; } /** * Filter the classes(array) for Menu (<ul>). * * @since 3.0.0 * @var Array */ $menu_classes = apply_filters( 'astra_primary_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-flex', $submenu_class, $stack_on_mobile_class ) ); $menu_name = wp_get_nav_menu_name( $theme_location ); $items_wrap = '<nav '; $items_wrap .= astra_attr( 'site-navigation', array( 'id' => 'ast-' . esc_attr( $device ) . '-site-navigation', 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility site-header-focus-item', 'aria-label' => esc_attr__( 'Site Navigation: ', 'astra' ) . $menu_name, ) ); $items_wrap .= '>'; $items_wrap .= '<div class="main-navigation">'; $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>'; $items_wrap .= '</div>'; $items_wrap .= '</nav>'; // Fallback Menu if primary menu not set. $fallback_menu_args = array( 'theme_location' => $theme_location, 'menu_id' => $menu_id, 'menu_class' => 'main-navigation', 'container' => 'div', 'before' => '<ul class="' . esc_attr( implode( ' ', $menu_classes ) ) . '">', 'after' => '</ul>', 'walker' => new Astra_Walker_Page(), 'echo' => false, ); // To add default alignment for navigation which can be added through any third party plugin. // Do not add any CSS from theme except header alignment. echo '<div ' . astra_attr( 'ast-main-header-bar-alignment' ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( is_customize_preview() ) { Astra_Builder_UI_Controller::render_customizer_edit_button(); } if ( has_nav_menu( $theme_location ) ) { $mobile_menu_markup = wp_nav_menu( array( 'menu_id' => $menu_id, 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ), 'container' => 'div', 'container_class' => 'main-header-bar-navigation', 'items_wrap' => $items_wrap, 'theme_location' => $theme_location, 'echo' => false, ) ); // Adding rel="nofollow" for duplicate menu render. $mobile_menu_markup = $astra_builder->nofollow_markup( $theme_location, $mobile_menu_markup ); echo do_shortcode( $mobile_menu_markup ); } else { echo '<div class="main-header-bar-navigation">'; echo '<nav '; echo wp_kses_post( astra_attr( 'site-navigation', array( 'id' => 'ast-' . esc_attr( $device ) . '-site-navigation', 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility', 'aria-label' => esc_attr__( 'Site Navigation', 'astra' ), ) ) ); echo '>'; $mobile_menu_markup = wp_page_menu( $fallback_menu_args ); // Adding rel="nofollow" for duplicate menu render. $mobile_menu_markup = $astra_builder->nofollow_markup( $theme_location, $mobile_menu_markup ); echo do_shortcode( $mobile_menu_markup ); echo '</nav>'; echo '</div>'; } echo '</div>'; } } /** * Kicking this off by creating an object. */ new Astra_Mobile_Menu_Component(); mobile-menu/class-astra-mobile-menu-component-loader.php 0000644 00000002243 15104467203 0017361 0 ustar 00 <?php /** * Mobile Navigation Menu Styling Loader for Astra theme. * * @package Astra Builder * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Mobile Navigation Menu Initialization * * @since 3.0.0 */ class Astra_Mobile_Menu_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-mobile-menu-customizer-preview', ASTRA_BUILDER_MOBILE_MENU_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Mobile_Menu_Component_Loader(); mobile-menu/assets/js/unminified/customizer-preview.js 0000644 00000041223 15104467203 0017247 0 ustar 00 /** * 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 = AstraBuilderMenuData.tablet_break_point || 768, mobile_break_point = AstraBuilderMenuData.mobile_break_point || 544; var selector = '.ast-builder-menu-mobile .main-navigation'; var section = 'section-header-mobile-menu'; // Advanced Visibility CSS Generation. astra_builder_visibility_css( section, selector, 'block' ); /** * Typography CSS. */ // Menu Typography. astra_generate_outside_font_family_css( 'astra-settings[header-mobile-menu-font-family]', selector + ' .menu-item > .menu-link' ); astra_generate_font_weight_css( 'astra-settings[header-mobile-menu-font-family]', 'astra-settings[header-mobile-menu-font-weight]', 'font-weight', selector + ' .menu-item > .menu-link' ); astra_responsive_font_size( 'astra-settings[header-mobile-menu-font-size]', selector + ' .menu-item > .menu-link' ); astra_font_extras_css( 'font-extras-header-mobile-menu', '.ast-builder-menu-mobile .main-navigation .menu-item > .menu-link' ); /** * Color CSS. */ /** * Menu - Colors */ // Menu - Normal Color astra_color_responsive_css( 'astra-menu-color-preview', 'astra-settings[header-mobile-menu-color-responsive]', 'color', selector + ' .main-header-menu .menu-item > .menu-link' ); // Menu - Hover Color astra_color_responsive_css( 'astra-menu-h-color-preview', 'astra-settings[header-mobile-menu-h-color-responsive]', 'color', selector + ' .main-header-menu .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' ); // Menu Toggle - Color astra_color_responsive_css( 'astra-builder-toggle', 'astra-settings[header-mobile-menu-color-responsive]', 'color', selector + ' .main-header-menu .menu-item > .ast-menu-toggle' ); // Menu Toggle - Hover Color astra_color_responsive_css( 'astra-menu-h-toogle-color-preview', 'astra-settings[header-mobile-menu-h-color-responsive]', 'color', selector + ' .menu-item:hover > .ast-menu-toggle' ); // Menu - Active Color astra_color_responsive_css( 'astra-menu-active-color-preview', 'astra-settings[header-mobile-menu-a-color-responsive]', 'color', selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle' ); // Menu - Normal Background astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu .menu-link, ' + selector + ' .main-header-menu .sub-menu', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu .menu-link, ' + selector + ' .main-header-menu .sub-menu', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu .menu-link, ' + selector + ' .main-header-menu .sub-menu', 'mobile' ); // Menu - Hover Background astra_color_responsive_css( 'astra-menu-bg-preview', 'astra-settings[header-mobile-menu-h-bg-color-responsive]', 'background', selector + ' .main-header-menu .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' ); // Menu - Active Background astra_color_responsive_css( 'astra-builder', 'astra-settings[header-mobile-menu-a-bg-color-responsive]', 'background', selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle' ); /** * Border CSS. */ (function () { // Sub Menu - Divider Size. wp.customize( 'astra-settings[header-mobile-menu-submenu-item-b-size]', function( value ) { value.bind( function( borderSize ) { var selector = '.ast-hfb-header .ast-builder-menu-mobile .main-navigation'; var dynamicStyle = ''; dynamicStyle += selector + ' .main-header-menu {'; dynamicStyle += 'border-top-width: ' + borderSize + 'px;'; dynamicStyle += '} '; dynamicStyle += selector + ' .menu-item .sub-menu .menu-link, ' + selector + ' .menu-item .menu-link {'; dynamicStyle += 'border-bottom-width: ' + borderSize + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( 'header-mobile-menu-submenu-item-b-size', dynamicStyle ); } ); } ); // Menu 1 > Sub Menu Border Size. wp.customize( 'astra-settings[header-mobile-menu-submenu-border]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.ast-builder-menu-mobile .sub-menu {'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-style: solid;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-mobile-menu-submenu-border', dynamicStyle ); } ); } ); // Menu Spacing - Menu 1. wp.customize( 'astra-settings[header-mobile-menu-menu-spacing]', function( value ) { value.bind( function( padding ) { var dynamicStyle = ''; dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';'; dynamicStyle += '} '; // Toggle top. dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {'; dynamicStyle += 'top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';'; dynamicStyle += 'right: calc( ' + padding['desktop']['right'] + padding['desktop-unit'] + ' - 0.907em );' dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';'; dynamicStyle += '} '; // Toggle top. dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {'; dynamicStyle += 'top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'right: calc( ' + padding['tablet']['right'] + padding['tablet-unit'] + ' - 0.907em );' dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';'; dynamicStyle += '} '; // Toggle top. dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {'; dynamicStyle += 'top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'right: calc( ' + padding['mobile']['right'] + padding['mobile-unit'] + ' - 0.907em );' dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'header-mobile-menu-menu-spacing-toggle-button', dynamicStyle ); } ); } ); // Margin - Menu 1. wp.customize( 'astra-settings[section-header-mobile-menu-margin]', function( value ) { value.bind( function( margin ) { var selector = '.ast-builder-menu-mobile .main-header-menu, .ast-header-break-point .ast-builder-menu-mobile .main-header-menu'; 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( 'section-header-mobile-menu-margin', dynamicStyle ); } ); } ); /** * Header Menu 1 > Submenu border Color */ wp.customize('astra-settings[header-mobile-menu-submenu-item-b-color]', function (value) { value.bind(function (color) { var insideBorder = wp.customize('astra-settings[header-mobile-menu-submenu-item-border]').get(), borderSize = wp.customize('astra-settings[header-mobile-menu-submenu-item-b-size]').get(); if ('' != color) { if ( true == insideBorder ) { var dynamicStyle = ''; dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link'; dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( true === insideBorder ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation .main-header-menu'; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + ( ( true === insideBorder ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += '}'; astra_add_dynamic_css('header-mobile-menu-submenu-item-b-color', dynamicStyle); } else { wp.customize.preview.send( 'refresh' ); } } else { wp.customize.preview.send('refresh'); } }); }); /** * Header Menu 1 > Submenu border Color */ wp.customize( 'astra-settings[header-mobile-menu-submenu-item-border]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[header-mobile-menu-submenu-item-b-color]' ).get(), borderSize = wp.customize('astra-settings[header-mobile-menu-submenu-item-b-size]').get(); if( true === border ) { var dynamicStyle = '.ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .menu-link'; dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( true === border ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; dynamicStyle += '.ast-builder-menu-mobile .main-navigation .main-header-menu'; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + ( ( true === border ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-style: solid;'; dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-mobile-menu-submenu-item-border', dynamicStyle ); } else { wp.customize.preview.send( 'refresh' ); } } ); } ); })(); // Sub Menu - Border Color. astra_css( 'astra-settings[header-mobile-menu-submenu-b-color]', 'border-color', selector + ' li.menu-item .sub-menu, ' + selector + ' .main-header-menu' ); // Transparent header > Submenu link hover color. astra_color_responsive_css( 'astra-builder-transparent-submenu', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link' ); } )( jQuery ); mobile-menu/assets/js/minified/customizer-preview.min.js 0000644 00000020737 15104467203 0017475 0 ustar 00 (()=>{var n=AstraBuilderMenuData.tablet_break_point||768,a=AstraBuilderMenuData.mobile_break_point||544,e=".ast-builder-menu-mobile .main-navigation";astra_builder_visibility_css("section-header-mobile-menu",e,"block"),astra_generate_outside_font_family_css("astra-settings[header-mobile-menu-font-family]",e+" .menu-item > .menu-link"),astra_generate_font_weight_css("astra-settings[header-mobile-menu-font-family]","astra-settings[header-mobile-menu-font-weight]","font-weight",e+" .menu-item > .menu-link"),astra_responsive_font_size("astra-settings[header-mobile-menu-font-size]",e+" .menu-item > .menu-link"),astra_font_extras_css("font-extras-header-mobile-menu",".ast-builder-menu-mobile .main-navigation .menu-item > .menu-link"),astra_color_responsive_css("astra-menu-color-preview","astra-settings[header-mobile-menu-color-responsive]","color",e+" .main-header-menu .menu-item > .menu-link"),astra_color_responsive_css("astra-menu-h-color-preview","astra-settings[header-mobile-menu-h-color-responsive]","color",e+" .main-header-menu .menu-item:hover > .menu-link, "+e+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder-toggle","astra-settings[header-mobile-menu-color-responsive]","color",e+" .main-header-menu .menu-item > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-h-toogle-color-preview","astra-settings[header-mobile-menu-h-color-responsive]","color",e+" .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-active-color-preview","astra-settings[header-mobile-menu-a-color-responsive]","color",e+" .menu-item.current-menu-item > .menu-link, "+e+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu .menu-link, "+e+" .main-header-menu .sub-menu","desktop"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu .menu-link, "+e+" .main-header-menu .sub-menu","tablet"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu .menu-link, "+e+" .main-header-menu .sub-menu","mobile"),astra_color_responsive_css("astra-menu-bg-preview","astra-settings[header-mobile-menu-h-bg-color-responsive]","background",e+" .main-header-menu .menu-item:hover > .menu-link, "+e+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder","astra-settings[header-mobile-menu-a-bg-color-responsive]","background",e+" .menu-item.current-menu-item > .menu-link, "+e+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle"),wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]",function(e){e.bind(function(e){var t=".ast-hfb-header .ast-builder-menu-mobile .main-navigation",i=(i=(i=(i="")+(t+" .main-header-menu {")+("border-top-width: "+e+"px;"))+"} "+(t+" .menu-item .sub-menu .menu-link, "+t+" .menu-item .menu-link {"))+("border-bottom-width: "+e+"px;")+"} ";astra_add_dynamic_css("header-mobile-menu-submenu-item-b-size",i)})}),wp.customize("astra-settings[header-mobile-menu-submenu-border]",function(e){e.bind(function(e){var t=".ast-builder-menu-mobile .sub-menu {",t=(t=(t=(t+="border-top-width:"+e.top+"px;")+("border-right-width:"+e.right+"px;"))+("border-left-width:"+e.left+"px;")+"border-style: solid;")+("border-bottom-width:"+e.bottom+"px;")+"}";astra_add_dynamic_css("header-mobile-menu-submenu-border",t)})}),wp.customize("astra-settings[header-mobile-menu-menu-spacing]",function(e){e.bind(function(e){var t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t="")+".ast-hfb-header .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.desktop.left+e["desktop-unit"]+";"))+("padding-right: "+e.desktop.right+e["desktop-unit"]+";"))+("padding-top: "+e.desktop.top+e["desktop-unit"]+";"))+("padding-bottom: "+e.desktop.bottom+e["desktop-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.desktop.top+e["desktop-unit"]+";"))+("right: calc( "+e.desktop.right+e["desktop-unit"]+" - 0.907em );"))+"} "+("@media (max-width: "+n+"px) {"))+".ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.tablet.left+e["tablet-unit"]+";"))+("padding-right: "+e.tablet.right+e["tablet-unit"]+";"))+("padding-top: "+e.tablet.top+e["tablet-unit"]+";"))+("padding-bottom: "+e.tablet.bottom+e["tablet-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.tablet.top+e["tablet-unit"]+";"))+("right: calc( "+e.tablet.right+e["tablet-unit"]+" - 0.907em );")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+".ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.mobile.left+e["mobile-unit"]+";"))+("padding-right: "+e.mobile.right+e["mobile-unit"]+";"))+("padding-top: "+e.mobile.top+e["mobile-unit"]+";"))+("padding-bottom: "+e.mobile.bottom+e["mobile-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.mobile.top+e["mobile-unit"]+";"))+("right: calc( "+e.mobile.right+e["mobile-unit"]+" - 0.907em );"))+"} "+"} ";astra_add_dynamic_css("header-mobile-menu-menu-spacing-toggle-button",t)})}),wp.customize("astra-settings[section-header-mobile-menu-margin]",function(e){e.bind(function(e){var t=".ast-builder-menu-mobile .main-header-menu, .ast-header-break-point .ast-builder-menu-mobile .main-header-menu",i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i="")+(t+" {")+("margin-left: "+e.desktop.left+e["desktop-unit"]+";"))+("margin-right: "+e.desktop.right+e["desktop-unit"]+";"))+("margin-top: "+e.desktop.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.desktop.bottom+e["desktop-unit"]+";"))+"} "+("@media (max-width: "+n+"px) {"))+(t+" {")+("margin-left: "+e.tablet.left+e["tablet-unit"]+";"))+("margin-right: "+e.tablet.right+e["tablet-unit"]+";"))+("margin-top: "+e.tablet.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.tablet.bottom+e["desktop-unit"]+";")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+(t+" {")+("margin-left: "+e.mobile.left+e["mobile-unit"]+";"))+("margin-right: "+e.mobile.right+e["mobile-unit"]+";"))+("margin-top: "+e.mobile.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.mobile.bottom+e["desktop-unit"]+";"))+"} "+"} ";astra_add_dynamic_css("section-header-mobile-menu-margin",i)})}),wp.customize("astra-settings[header-mobile-menu-submenu-item-b-color]",function(e){e.bind(function(e){var t,i=wp.customize("astra-settings[header-mobile-menu-submenu-item-border]").get(),n=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]").get();""!=e&&1==i?(t="",t=(t=(t=(t=(t+=".ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link")+"{border-bottom-width:"+(!0===i?n+"px;":"0px;"))+"border-color:"+e+";border-style: solid;}.ast-hfb-header .ast-builder-menu-mobile .main-navigation .main-header-menu")+"{border-top-width:"+(!0===i?n+"px;":"0px;"))+"border-color:"+e+";}",astra_add_dynamic_css("header-mobile-menu-submenu-item-b-color",t)):wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[header-mobile-menu-submenu-item-border]",function(e){e.bind(function(e){var t,i=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-color]").get(),n=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]").get();!0===e?(t=".ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .menu-link",t=(t=(t=(t+="{")+"border-bottom-width:"+(!0===e?n+"px;":"0px;")+"border-color:"+i+";border-style: solid;}.ast-builder-menu-mobile .main-navigation .main-header-menu{")+"border-top-width:"+(!0===e?n+"px;":"0px;")+"border-style: solid;")+"border-color:"+i+";}",astra_add_dynamic_css("header-mobile-menu-submenu-item-border",t)):wp.customize.preview.send("refresh")})}),astra_css("astra-settings[header-mobile-menu-submenu-b-color]","border-color",e+" li.menu-item .sub-menu, "+e+" .main-header-menu"),astra_color_responsive_css("astra-builder-transparent-submenu","astra-settings[transparent-submenu-h-color-responsive]","color",".ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link")})(jQuery); menu/class-astra-header-menu-component-loader.php 0000644 00000005002 15104467203 0016071 0 ustar 00 <?php /** * Menu Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Menu_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); // Load Google fonts. add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 ); } /** * Enqueue google fonts. * * @since 3.0.0 */ public function add_fonts() { $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; for ( $index = 1; $index <= $component_limit; $index++ ) { $_prefix = 'menu' . $index; $menu_font_family = astra_get_option( 'header-' . $_prefix . '-font-family' ); $menu_font_weight = astra_get_option( 'header-' . $_prefix . '-font-weight' ); Astra_Fonts::add_font( $menu_font_family, $menu_font_weight ); } $mobile_menu_font_family = astra_get_option( 'header-mobile-menu-font-family' ); $mobile_menu_font_weight = astra_get_option( 'header-mobile-menu-font-weight' ); Astra_Fonts::add_font( $mobile_menu_font_family, $mobile_menu_font_weight ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-heading-menu-customizer-preview-js', ASTRA_HEADER_MENU_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for Menu JS. wp_localize_script( 'astra-heading-menu-customizer-preview-js', 'AstraBuilderMenuData', array( 'component_limit' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu, 'nav_menu_enabled' => defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'nav-menu' ) ? true : false, '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_Header_Menu_Component_Loader(); menu/dynamic-css/dynamic.css.php 0000644 00000056326 15104467203 0012664 0 ustar 00 <?php /** * Heading Colors - Dynamic CSS * * @package astra-builder * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Heading Colors */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_menu_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Heading Colors. * * @since 3.0.0 */ function astra_hb_menu_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_menu; $index++ ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index, 'header' ) ) { continue; } $_prefix = 'menu' . $index; $_section = 'section-hb-menu-' . $index; $selector = '.ast-builder-menu-' . $index; // Theme color. $theme_color = astra_get_option( 'theme-color' ); // Sub Menu. $sub_menu_border = astra_get_option( 'header-' . $_prefix . '-submenu-border' ); $sub_menu_divider_toggle = astra_get_option( 'header-' . $_prefix . '-submenu-item-border' ); $sub_menu_divider_size = astra_get_option( 'header-' . $_prefix . '-submenu-item-b-size' ); $sub_menu_divider_color = astra_get_option( 'header-' . $_prefix . '-submenu-item-b-color' ); $sub_menu_border_radius_fields = astra_get_option( 'header-' . $_prefix . '-submenu-border-radius-fields' ); $sub_menu_top_offset = astra_get_option( 'header-' . $_prefix . '-submenu-top-offset' ); $sub_menu_width = astra_get_option( 'header-' . $_prefix . '-submenu-width' ); // Menu. $menu_resp_color = astra_get_option( 'header-' . $_prefix . '-color-responsive' ); $menu_resp_bg_color = astra_get_option( 'header-' . $_prefix . '-bg-obj-responsive' ); $menu_resp_color_hover = astra_get_option( 'header-' . $_prefix . '-h-color-responsive' ); $menu_resp_bg_color_hover = astra_get_option( 'header-' . $_prefix . '-h-bg-color-responsive' ); $menu_resp_color_active = astra_get_option( 'header-' . $_prefix . '-a-color-responsive' ); $menu_resp_bg_color_active = astra_get_option( 'header-' . $_prefix . '-a-bg-color-responsive' ); $menu_resp_color_desktop = isset( $menu_resp_color['desktop'] ) ? $menu_resp_color['desktop'] : ''; $menu_resp_color_tablet = isset( $menu_resp_color['tablet'] ) ? $menu_resp_color['tablet'] : ''; $menu_resp_color_mobile = isset( $menu_resp_color['mobile'] ) ? $menu_resp_color['mobile'] : ''; $menu_resp_color_hover_desktop = isset( $menu_resp_color_hover['desktop'] ) ? $menu_resp_color_hover['desktop'] : ''; $menu_resp_color_hover_tablet = isset( $menu_resp_color_hover['tablet'] ) ? $menu_resp_color_hover['tablet'] : ''; $menu_resp_color_hover_mobile = isset( $menu_resp_color_hover['mobile'] ) ? $menu_resp_color_hover['mobile'] : ''; $menu_resp_bg_color_hover_desktop = isset( $menu_resp_bg_color_hover['desktop'] ) ? $menu_resp_bg_color_hover['desktop'] : ''; $menu_resp_bg_color_hover_tablet = isset( $menu_resp_bg_color_hover['tablet'] ) ? $menu_resp_bg_color_hover['tablet'] : ''; $menu_resp_bg_color_hover_mobile = isset( $menu_resp_bg_color_hover['mobile'] ) ? $menu_resp_bg_color_hover['mobile'] : ''; $menu_resp_color_active_desktop = isset( $menu_resp_color_active['desktop'] ) ? $menu_resp_color_active['desktop'] : ''; $menu_resp_color_active_tablet = isset( $menu_resp_color_active['tablet'] ) ? $menu_resp_color_active['tablet'] : ''; $menu_resp_color_active_mobile = isset( $menu_resp_color_active['mobile'] ) ? $menu_resp_color_active['mobile'] : ''; $menu_resp_bg_color_active_desktop = isset( $menu_resp_bg_color_active['desktop'] ) ? $menu_resp_bg_color_active['desktop'] : ''; $menu_resp_bg_color_active_tablet = isset( $menu_resp_bg_color_active['tablet'] ) ? $menu_resp_bg_color_active['tablet'] : ''; $menu_resp_bg_color_active_mobile = isset( $menu_resp_bg_color_active['mobile'] ) ? $menu_resp_bg_color_active['mobile'] : ''; // Typography. $menu_font_family = astra_get_option( 'header-' . $_prefix . '-font-family' ); $menu_font_size = astra_get_option( 'header-' . $_prefix . '-font-size' ); $menu_font_weight = astra_get_option( 'header-' . $_prefix . '-font-weight' ); $menu_text_transform = astra_get_font_extras( astra_get_option( 'header-' . $_prefix . '-font-extras' ), 'text-transform' ); $menu_line_height = astra_get_font_extras( astra_get_option( 'header-' . $_prefix . '-font-extras' ), 'line-height', 'line-height-unit' ); $menu_letter_spacing = astra_get_font_extras( astra_get_option( 'header-' . $_prefix . '-font-extras' ), 'letter-spacing', 'letter-spacing-unit' ); $menu_text_decoration = astra_get_font_extras( astra_get_option( 'header-' . $_prefix . '-font-extras' ), 'text-decoration' ); $menu_font_size_desktop = isset( $menu_font_size['desktop'] ) ? $menu_font_size['desktop'] : ''; $menu_font_size_tablet = isset( $menu_font_size['tablet'] ) ? $menu_font_size['tablet'] : ''; $menu_font_size_mobile = isset( $menu_font_size['mobile'] ) ? $menu_font_size['mobile'] : ''; $menu_font_size_desktop_unit = isset( $menu_font_size['desktop-unit'] ) ? $menu_font_size['desktop-unit'] : ''; $menu_font_size_tablet_unit = isset( $menu_font_size['tablet-unit'] ) ? $menu_font_size['tablet-unit'] : ''; $menu_font_size_mobile_unit = isset( $menu_font_size['mobile-unit'] ) ? $menu_font_size['mobile-unit'] : ''; // Spacing. $menu_spacing = astra_get_option( 'header-' . $_prefix . '-menu-spacing' ); $sub_menu_border_top = isset( $sub_menu_border ) && ! empty( $sub_menu_border['top'] ) ? $sub_menu_border['top'] : 0; $sub_menu_border_bottom = isset( $sub_menu_border ) && ! empty( $sub_menu_border['bottom'] ) ? $sub_menu_border['bottom'] : 0; $sub_menu_border_right = isset( $sub_menu_border ) && ! empty( $sub_menu_border['right'] ) ? $sub_menu_border['right'] : 0; $sub_menu_border_left = isset( $sub_menu_border ) && ! empty( $sub_menu_border['left'] ) ? $sub_menu_border['left'] : 0; // Top offset position. $sub_menu_top_offset = ! empty( $sub_menu_top_offset ) ? $sub_menu_top_offset : 0; // Submenu container width. $sub_menu_width = ! empty( $sub_menu_width ) ? $sub_menu_width : ''; // Margin. $margin = astra_get_option( $_section . '-margin' ); $margin_selector = '.ast-builder-menu-' . $index . ' .main-header-menu, .ast-header-break-point .ast-builder-menu-' . $index . ' .main-header-menu'; $css_output_desktop = array( // Menu. $selector => array( 'font-family' => astra_get_font_family( $menu_font_family ), 'font-weight' => esc_attr( $menu_font_weight ), 'text-transform' => esc_attr( $menu_text_transform ), ), $selector . ' .menu-item > .menu-link' => array( 'line-height' => esc_attr( $menu_line_height ), 'font-size' => astra_get_font_css_value( $menu_font_size_desktop, $menu_font_size_desktop_unit ), 'color' => $menu_resp_color_desktop, 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'desktop' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), 'text-decoration' => esc_attr( $menu_text_decoration ), 'letter-spacing' => esc_attr( $menu_letter_spacing ), ), $selector . ' .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_desktop, ), $selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_desktop, 'background' => $menu_resp_bg_color_hover_desktop, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_desktop, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .current-menu-ancestor > .menu-link' => array( 'color' => $menu_resp_color_active_desktop, 'background' => $menu_resp_bg_color_active_desktop, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_desktop, ), // Sub Menu. $selector . ' .sub-menu, ' . $selector . ' .inline-on-mobile .sub-menu' => array( 'border-top-width' => astra_get_css_value( $sub_menu_border_top, 'px' ), 'border-bottom-width' => astra_get_css_value( $sub_menu_border_bottom, 'px' ), 'border-right-width' => astra_get_css_value( $sub_menu_border_right, 'px' ), 'border-left-width' => astra_get_css_value( $sub_menu_border_left, 'px' ), 'border-color' => esc_attr( astra_get_option( 'header-' . $_prefix . '-submenu-b-color', $theme_color ) ), 'border-style' => 'solid', 'width' => astra_get_css_value( $sub_menu_width, 'px' ), 'border-top-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'top', 'desktop' ), 'border-top-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'right', 'desktop' ), 'border-bottom-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'bottom', 'desktop' ), 'border-bottom-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'left', 'desktop' ), ), // Fix submenu top offset when above border is assigned. $selector . ' .sub-menu .sub-menu' => array( 'top' => astra_get_css_value( strval( -1 * intval( $sub_menu_border_top ) ), 'px' ), ), $selector . ' .main-header-menu > .menu-item > .sub-menu, ' . $selector . ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper' => array( 'margin-top' => astra_get_css_value( $sub_menu_top_offset, 'px' ), ), '.ast-desktop ' . $selector . ' .main-header-menu > .menu-item > .sub-menu:before, .ast-desktop ' . $selector . ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper:before' => array( 'height' => astra_calculate_spacing( $sub_menu_top_offset . 'px', '+', intval( $sub_menu_border_top ) . 'px + 5', 'px' ), ), $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => astra_responsive_spacing( $menu_spacing, 'top', 'desktop' ), 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), '-', '0.907', 'em' ), ), // Margin CSS. $margin_selector => array( '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' ), ), ); $css_output_desktop[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'desktop' ); $mobile_selector = '.ast-header-break-point .ast-builder-menu-' . $index; $menu_spacing_mobile_top = astra_responsive_spacing( $menu_spacing, 'top', 'mobile' ); $menu_spacing_mobile_top = isset( $menu_spacing_mobile_top ) && ! empty( $menu_spacing_mobile_top ) ? $menu_spacing_mobile_top : 0; $menu_spacing_tablet_top = astra_responsive_spacing( $menu_spacing, 'top', 'tablet' ); $menu_spacing_tablet_top = isset( $menu_spacing_tablet_top ) && ! empty( $menu_spacing_tablet_top ) ? $menu_spacing_tablet_top : 0; if ( ! is_rtl() ) { $selector_right_value = array( 'right' => '-15px', ); } else { $selector_right_value = array( 'left' => '-15px', ); } $css_output_tablet = array( $mobile_selector . ' .menu-item > .menu-link' => array( 'font-size' => astra_get_font_css_value( $menu_font_size_tablet, $menu_font_size_tablet_unit ), ), $mobile_selector . ' .main-header-menu .menu-item > .menu-link' => array( 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'tablet' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ), ), // Sub Menu. $selector . ' .sub-menu, ' . $selector . ' .inline-on-mobile .sub-menu' => array( 'border-top-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'top', 'tablet' ), 'border-top-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'right', 'tablet' ), 'border-bottom-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'bottom', 'tablet' ), 'border-bottom-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'left', 'tablet' ), ), $selector . ' .main-header-menu .menu-item > .menu-link' => array( 'color' => $menu_resp_color_tablet, ), $selector . ' .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_tablet, ), $selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_tablet, 'background' => $menu_resp_bg_color_hover_tablet, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_tablet, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .current-menu-ancestor > .menu-link, ' . $selector . ' .current-menu-ancestor > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_tablet, 'background' => $menu_resp_bg_color_active_tablet, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_tablet, ), $mobile_selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => $menu_spacing_tablet_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ), '-', '0.907', 'em' ), ), $selector . ' .inline-on-mobile .menu-item.menu-item-has-children > .ast-menu-toggle' => $selector_right_value, $selector . ' .menu-item-has-children > .menu-link:after' => array( 'content' => 'unset', ), // Margin CSS. $margin_selector => array( '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' ), ), $selector . ' .main-header-menu > .menu-item > .sub-menu, ' . $selector . ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper' => array( 'margin-top' => '0', ), ); $css_output_tablet[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'tablet' ); $css_output_mobile = array( $mobile_selector . ' .menu-item > .menu-link' => array( 'font-size' => astra_get_font_css_value( $menu_font_size_mobile, $menu_font_size_mobile_unit ), ), $mobile_selector . ' .main-header-menu .menu-item > .menu-link' => array( 'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'mobile' ), 'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ), ), // Sub Menu. $selector . ' .sub-menu, ' . $selector . ' .inline-on-mobile .sub-menu' => array( 'border-top-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'top', 'mobile' ), 'border-top-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'right', 'mobile' ), 'border-bottom-right-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'bottom', 'mobile' ), 'border-bottom-left-radius' => astra_responsive_spacing( $sub_menu_border_radius_fields, 'left', 'mobile' ), ), $selector . ' .main-header-menu .menu-item > .menu-link' => array( 'color' => $menu_resp_color_mobile, ), $selector . ' .menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_mobile, ), $selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_mobile, 'background' => $menu_resp_bg_color_hover_mobile, ), $selector . ' .menu-item:hover > .ast-menu-toggle' => array( 'color' => $menu_resp_color_hover_mobile, ), $selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .current-menu-ancestor > .menu-link, ' . $selector . ' .current-menu-ancestor > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_mobile, 'background' => $menu_resp_bg_color_active_mobile, ), $selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array( 'color' => $menu_resp_color_active_mobile, ), $mobile_selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array( 'top' => $menu_spacing_mobile_top, 'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ), '-', '0.907', 'em' ), ), // Margin CSS. $margin_selector => array( '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' ), ), $selector . ' .main-header-menu > .menu-item > .sub-menu, ' . $selector . ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper' => array( 'margin-top' => '0', ), ); $css_output_mobile[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ); // Submenu border radius inner items fix. $sub_menu_border = strval( $sub_menu_border_top ); $devices = array( 'desktop', 'tablet', 'mobile' ); foreach ( $devices as $device ) { $border_top_left_radius = astra_responsive_spacing( $sub_menu_border_radius_fields, 'top', $device ); $border_top_right_radius = astra_responsive_spacing( $sub_menu_border_radius_fields, 'right', $device ); $border_bottom_right_radius = astra_responsive_spacing( $sub_menu_border_radius_fields, 'bottom', $device ); $border_bottom_left_radius = astra_responsive_spacing( $sub_menu_border_radius_fields, 'left', $device ); // Determine the variable. $css_output_var = &${ 'css_output_' . $device }; if ( ! is_array( $css_output_var ) ) { continue; } $css_output_var[ $selector . ' .sub-menu .menu-item:first-of-type > .menu-link, ' . $selector . ' .inline-on-mobile .sub-menu .menu-item:first-of-type > .menu-link' ] = array( 'border-top-left-radius' => $border_top_left_radius ? 'calc(' . $border_top_left_radius . ' - ' . astra_get_css_value( $sub_menu_border, 'px' ) . ')' : '', 'border-top-right-radius' => $border_top_right_radius ? 'calc(' . $border_top_right_radius . ' - ' . astra_get_css_value( $sub_menu_border, 'px' ) . ')' : '', ); $css_output_var[ $selector . ' .sub-menu .menu-item:last-of-type > .menu-link, ' . $selector . ' .inline-on-mobile .sub-menu .menu-item:last-of-type > .menu-link' ] = array( 'border-bottom-right-radius' => $border_bottom_right_radius ? 'calc(' . $border_bottom_right_radius . ' - ' . astra_get_css_value( $sub_menu_border, 'px' ) . ')' : '', 'border-bottom-left-radius' => $border_bottom_left_radius ? 'calc(' . $border_bottom_left_radius . ' - ' . astra_get_css_value( $sub_menu_border, 'px' ) . ')' : '', ); } if ( true === $sub_menu_divider_toggle ) { // Sub Menu Divider. $css_output_desktop[ '.ast-desktop ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link' ] = array( 'border-bottom-width' => $sub_menu_divider_size . 'px', 'border-color' => $sub_menu_divider_color, 'border-style' => 'solid', ); $css_output_desktop[ '.ast-desktop ' . $selector . ' .menu-item .sub-menu:last-child > .menu-item > .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link' ] = array( 'border-bottom-width' => $sub_menu_divider_size . 'px', ); $css_output_desktop[ '.ast-desktop ' . $selector . ' .menu-item:last-child > .menu-item > .menu-link' ] = array( 'border-bottom-width' => 0, ); } else { $css_output_desktop[ '.ast-desktop .ast-builder-menu-' . $index . ' .menu-item .sub-menu .menu-link' ] = array( 'border-style' => 'none', ); } /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector ); } $dynamic_css .= astra_menu_hover_style_css(); return $dynamic_css; } /** * Load Menu hover style static CSS if any one of the menu hover style is selected. * * @return string * @since 3.5.0 */ function astra_menu_hover_style_css() { $hover_style_flg = false; $menu_hover_css = ''; for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_menu; $index++ ) { if ( '' !== astra_get_option( 'header-menu' . $index . '-menu-hover-animation' ) ) { $hover_style_flg = true; } } if ( true === $hover_style_flg ) { $menu_hover_css = ' .ast-desktop .ast-menu-hover-style-underline > .menu-item > .menu-link:before, .ast-desktop .ast-menu-hover-style-overline > .menu-item > .menu-link:before { content: ""; position: absolute; width: 100%; right: 50%; height: 1px; background-color: transparent; transform: scale(0, 0) translate(-50%, 0); transition: transform .3s ease-in-out, color .0s ease-in-out; } .ast-desktop .ast-menu-hover-style-underline > .menu-item:hover > .menu-link:before, .ast-desktop .ast-menu-hover-style-overline > .menu-item:hover > .menu-link:before { width: calc(100% - 1.2em); background-color: currentColor; transform: scale(1, 1) translate(50%, 0); } .ast-desktop .ast-menu-hover-style-underline > .menu-item > .menu-link:before { bottom: 0; } .ast-desktop .ast-menu-hover-style-overline > .menu-item > .menu-link:before { top: 0; } .ast-desktop .ast-menu-hover-style-zoom > .menu-item > .menu-link:hover { transition: all .3s ease; transform: scale(1.2); }'; } return Astra_Enqueue_Scripts::trim_css( $menu_hover_css ); } menu/class-astra-header-menu-component.php 0000644 00000014434 15104467203 0014636 0 ustar 00 <?php /** * Menu for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_MENU_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/menu' ); define( 'ASTRA_HEADER_MENU_URI', ASTRA_THEME_URI . 'inc/builder/type/header/menu' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Menu_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_MENU_DIR . '/class-astra-header-menu-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_MENU_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Secondary navigation markup * * @param int $index index. * @param string $device device. */ public static function menu_markup( $index, $device = 'desktop' ) { $astra_builder = astra_builder(); switch ( $index ) { case 1: $theme_location = 'primary'; $nav_label = esc_attr__( 'Primary Site Navigation', 'astra' ); break; case 2: $theme_location = 'secondary_menu'; $nav_label = esc_attr__( 'Secondary Site Navigation', 'astra' ); break; default: $theme_location = 'menu_' . $index; /* translators: %d: menu index number */ $nav_label = sprintf( esc_attr__( 'Menu %d Site Navigation', 'astra' ), $index ); break; } $_prefix = 'menu' . $index; $submenu_class = apply_filters( 'astra_secondary_submenu_border_class', ' submenu-with-border' ); $stack_on_mobile_class = 'inline-on-mobile'; if ( astra_get_option( 'header-' . $_prefix . '-menu-stack-on-mobile' ) ) { $stack_on_mobile_class = 'stack-on-mobile'; } // Menu Animation. $menu_animation = astra_get_option( 'header-menu' . $index . '-submenu-container-animation' ); if ( ! empty( $menu_animation ) ) { $submenu_class .= ' astra-menu-animation-' . esc_attr( $menu_animation ) . ' '; } // Menu hover animation. $menu_hover_animation = astra_get_option( 'header-' . $_prefix . '-menu-hover-animation' ); if ( '' !== $menu_hover_animation ) { $submenu_class .= ' ast-menu-hover-style-' . esc_attr( $menu_hover_animation ) . ' '; } /** * Filter the classes(array) for Menu (<ul>). * * @since 3.0.0 * @var Array */ $menu_classes = apply_filters( 'astra_' . $theme_location . '_menu_classes', array( 'main-header-menu', 'ast-menu-shadow', 'ast-nav-menu', 'ast-flex', $submenu_class, $stack_on_mobile_class ) ); $items_wrap = '<nav '; $items_wrap .= astra_attr( 'site-navigation', array( 'id' => apply_filters( 'astra_header_site_navigation_id', esc_attr( $theme_location ) . '-site-navigation-' . esc_attr( $device ) ), 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility site-header-focus-item', 'aria-label' => $nav_label, 'itemtype' => 'https://schema.org/SiteNavigationElement', 'itemscope' => 'itemscope', ) ); $items_wrap .= '>'; $items_wrap .= '<div class="main-navigation ast-inline-flex">'; $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>'; $items_wrap .= '</div>'; $items_wrap .= '</nav>'; // Fallback Menu if primary menu not set. $fallback_menu_args = array( 'theme_location' => $theme_location, 'menu_id' => apply_filters( 'astra_header_menu_ul_id', 'ast-hf-menu-' . $index ), 'menu_class' => 'main-navigation ast-inline-flex', 'container' => 'div', 'before' => '<ul class="' . esc_attr( implode( ' ', $menu_classes ) ) . '">', 'after' => '</ul>', 'walker' => new Astra_Walker_Page(), 'echo' => false, ); // To add default alignment for navigation which can be added through any third party plugin. // Do not add any CSS from theme except header alignment. echo '<div ' . astra_attr( 'ast-main-header-bar-alignment' ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( is_customize_preview() ) { Astra_Builder_UI_Controller::render_customizer_edit_button(); } if ( has_nav_menu( $theme_location ) ) { /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $nav_menu_markup = wp_nav_menu( array( 'menu_id' => apply_filters( 'astra_header_menu_ul_id', 'ast-hf-menu-' . $index ), 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ), 'container' => 'div', 'container_class' => 'main-header-bar-navigation', 'items_wrap' => $items_wrap, 'theme_location' => $theme_location, 'echo' => false, ) ); // Adding rel="nofollow" for duplicate menu render. $nav_menu_markup = $astra_builder->nofollow_markup( $theme_location, $nav_menu_markup ); echo do_shortcode( $nav_menu_markup ); /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } else { echo '<div class="main-header-bar-navigation ast-flex-1">'; echo '<nav '; echo wp_kses_post( astra_attr( 'site-navigation', array( 'id' => esc_attr( $theme_location ) . '-site-navigation', 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility', 'aria-label' => $nav_label, 'itemtype' => 'https://schema.org/SiteNavigationElement', 'itemscope' => 'itemscope', ) ) ); echo '>'; /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $nav_menu_markup = wp_page_menu( $fallback_menu_args ); // Adding rel="nofollow" for duplicate menu render. $nav_menu_markup = $astra_builder->nofollow_markup( $theme_location, $nav_menu_markup ); echo do_shortcode( $nav_menu_markup ); /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort echo '</nav>'; echo '</div>'; } echo '</div>'; } } /** * Kicking this off by creating an object. */ new Astra_Header_Menu_Component(); menu/assets/js/unminified/customizer-preview.js 0000644 00000051674 15104467203 0016015 0 ustar 00 /** * 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 = AstraBuilderMenuData.tablet_break_point || 768, mobile_break_point = AstraBuilderMenuData.mobile_break_point || 544, isNavMenuEnabled = AstraBuilderMenuData.nav_menu_enabled || false; for ( var index = 1; index <= AstraBuilderMenuData.component_limit; index++ ) { var prefix = 'menu' + index; var selector = '.ast-builder-menu-' + index; var section = 'section-hb-menu-' + index; // Advanced Visibility CSS Generation. astra_builder_visibility_css( section, selector ); /** * Typography CSS. */ // Menu Typography. astra_generate_outside_font_family_css( 'astra-settings[header-' + prefix + '-font-family]', selector + ' .menu-item > .menu-link' ); astra_generate_font_weight_css( 'astra-settings[header-' + prefix + '-font-family]', 'astra-settings[header-' + prefix + '-font-weight]', 'font-weight', selector + ' .menu-item > .menu-link' ); astra_css( 'astra-settings[header-' + prefix + '-text-transform]', 'text-transform', selector + ' .menu-item > .menu-link' ); astra_responsive_font_size( 'astra-settings[header-' + prefix + '-font-size]', selector + ' .menu-item > .menu-link' ); astra_css( 'astra-settings[header-' + prefix + '-line-height]', 'line-height', selector + ' .menu-item > .menu-link' ); astra_css( 'astra-settings[header-' + prefix + '-letter-spacing]', 'letter-spacing', selector + ' .menu-item > .menu-link', 'px' ); /** * Color CSS. */ /** * Menu - Colors */ // Menu - Normal Color astra_color_responsive_css( 'astra-menu-color-preview', 'astra-settings[header-' + prefix + '-color-responsive]', 'color', selector + ' .main-header-menu .menu-item > .menu-link' ); // Menu - Hover Color astra_color_responsive_css( 'astra-menu-h-color-preview', 'astra-settings[header-' + prefix + '-h-color-responsive]', 'color', selector + ' .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' ); // Menu Toggle - Color astra_color_responsive_css( 'astra-builder-toggle', 'astra-settings[header-' + prefix + '-color-responsive]', 'color', selector + ' .menu-item > .ast-menu-toggle' ); // Menu Toggle - Hover Color astra_color_responsive_css( 'astra-menu-h-toogle-color-preview', 'astra-settings[header-' + prefix + '-h-color-responsive]', 'color', selector + ' .menu-item:hover > .ast-menu-toggle' ); // Menu - Active Color astra_color_responsive_css( 'astra-menu-active-color-preview', 'astra-settings[header-' + prefix + '-a-color-responsive]', 'color', selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' + selector + ' .current-menu-ancestor > .menu-link, ' + selector + ' .current-menu-ancestor > .ast-menu-toggle' ); // Menu - Normal Background astra_apply_responsive_background_css( 'astra-settings[header-' + prefix + '-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[header-' + prefix + '-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[header-' + prefix + '-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'mobile' ); // Menu - Hover Background astra_color_responsive_css( 'astra-menu-bg-preview', 'astra-settings[header-' + prefix + '-h-bg-color-responsive]', 'background', selector + ' .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' ); // Menu - Active Background astra_color_responsive_css( 'astra-builder', 'astra-settings[header-' + prefix + '-a-bg-color-responsive]', 'background', selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' + selector + ' .current-menu-ancestor > .menu-link, ' + selector + ' .current-menu-ancestor > .ast-menu-toggle' ); /** * Border CSS. */ (function (index) { // Menu 1 > Sub Menu Border Size. wp.customize( 'astra-settings[header-menu'+ index +'-submenu-border]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.ast-builder-menu-'+ index +' .sub-menu, .ast-builder-menu-'+ index +' .inline-on-mobile .sub-menu, .ast-builder-menu-'+ index +' .main-header-menu.submenu-with-border .astra-megamenu, .ast-builder-menu-'+ index +' .main-header-menu.submenu-with-border .astra-full-megamenu-wrapper {'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-style: solid;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += '}'; // Fix submenu top offset when above border is assigned. dynamicStyle += '.ast-builder-menu-'+ index + ' .sub-menu .sub-menu {'; dynamicStyle += 'top:' + Number( -1 * border.top ) + 'px;'; dynamicStyle += '}'; const submenuTopOffset = wp.customize( 'astra-settings[header-menu'+ index +'-submenu-top-offset]' ).get(); dynamicStyle += '.ast-desktop .ast-builder-menu-' + index + ' .main-header-menu > .menu-item > .sub-menu:before, .ast-desktop .ast-builder-menu-' + index + ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper:before {'; dynamicStyle += 'height: calc( ' + ( border.top || 0 ) + 'px + ' + ( submenuTopOffset || 0 ) + 'px + 5px );'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-border', dynamicStyle ); } ); } ); // Menu Spacing - Menu 1. wp.customize( 'astra-settings[header-menu'+ index +'-menu-spacing]', function( value ) { value.bind( function( padding ) { var dynamicStyle = ''; dynamicStyle += '.ast-builder-menu-'+ index +' .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point .ast-builder-menu-'+ index +' .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';'; dynamicStyle += '} '; // Toggle top. dynamicStyle += '.ast-hfb-header .ast-builder-menu-'+ index +' .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {'; dynamicStyle += 'top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'right: calc( ' + padding['tablet']['right'] + padding['tablet-unit'] + ' - 0.907em );' dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += '.ast-header-break-point .ast-builder-menu-'+ index +' .main-header-menu .menu-item > .menu-link {'; dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';'; dynamicStyle += '} '; // Toggle top. dynamicStyle += '.ast-hfb-header .ast-builder-menu-'+ index +' .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {'; dynamicStyle += 'top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'right: calc( ' + padding['mobile']['right'] + padding['mobile-unit'] + ' - 0.907em );' dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( 'header-menu'+ index +'-menu-spacing-toggle-button', dynamicStyle ); } ); } ); // Margin - Menu 1. wp.customize( 'astra-settings[section-hb-menu-'+ index +'-margin]', function( value ) { value.bind( function( margin ) { var selector = '.ast-builder-menu-'+ index +' .main-header-menu, .ast-header-break-point .ast-builder-menu-'+ index +' .main-header-menu'; 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( 'section-hb-menu-'+ index +'-margin', dynamicStyle ); } ); } ); /** * Header Menu 1 > Submenu border Color */ wp.customize('astra-settings[header-menu'+ index +'-submenu-item-b-color]', function (value) { value.bind(function (color) { var insideBorder = wp.customize('astra-settings[header-menu'+ index +'-submenu-item-border]').get(), borderSize = wp.customize('astra-settings[header-menu'+ index +'-submenu-item-b-size]').get(); if ('' != color) { if ( true == insideBorder ) { var dynamicStyle = ''; dynamicStyle += '.ast-desktop .ast-builder-menu-'+ index +' .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link'; dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( borderSize ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; dynamicStyle += '.ast-desktop .ast-builder-menu-'+ index +' .main-header-menu .menu-item .sub-menu .menu-item:last-child .menu-link{ border-style: none; }'; astra_add_dynamic_css('header-menu'+ index +'-submenu-item-b-color', dynamicStyle); } } else { wp.customize.preview.send('refresh'); } }); }); // Sub Menu - Divider Size. wp.customize( 'astra-settings[header-menu'+ index +'-submenu-item-b-size]', function( value ) { value.bind( function( borderSize ) { var selector = '.ast-desktop .ast-builder-menu-'+ index + ' .main-header-menu'; var dynamicStyle = ''; dynamicStyle += selector + ' .menu-item .sub-menu:last-child > .menu-item > .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link {'; dynamicStyle += 'border-bottom-width: ' + borderSize + 'px;'; dynamicStyle += '} '; dynamicStyle += selector + ' .menu-item .sub-menu .menu-item:last-child .menu-link {'; dynamicStyle += 'border-bottom-width: 0px'; dynamicStyle += '} '; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-item-b-size', dynamicStyle ); } ); } ); /** * Header Menu 1 > Submenu border Color */ wp.customize( 'astra-settings[header-menu'+ index +'-submenu-item-border]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[header-menu'+ index +'-submenu-item-b-color]' ).get(), borderSize = wp.customize('astra-settings[header-menu'+ index +'-submenu-item-b-size]').get(); var dynamicStyle = '.ast-desktop .ast-builder-menu-'+ index +' .main-header-menu.submenu-with-border .sub-menu .menu-link'; if( true === border ) { dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( borderSize ) ? borderSize + 'px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; } else { dynamicStyle += '{'; dynamicStyle += 'border-style: none;'; dynamicStyle += '}'; } dynamicStyle += '.ast-desktop .ast-builder-menu-'+ index +' .menu-item .sub-menu .menu-item:last-child .menu-link{ border-style: none; }'; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-item-border', dynamicStyle ); } ); } ); // Animation preview support. // Adding customizer-refresh because if megamenu is enabled on menu then caluculated left & width JS value of megamenu wrapper wiped out due to partial refresh. wp.customize( 'astra-settings[header-menu'+ index +'-menu-hover-animation]', function( setting ) { setting.bind( function( animation ) { var menuWrapper = jQuery( '#ast-desktop-header #ast-hf-menu-'+ index ); menuWrapper.removeClass('ast-menu-hover-style-underline'); menuWrapper.removeClass('ast-menu-hover-style-zoom'); menuWrapper.removeClass('ast-menu-hover-style-overline'); if ( isNavMenuEnabled ) { document.dispatchEvent( new CustomEvent( "astMenuHoverStyleChanged", { "detail": {} }) ); } menuWrapper.addClass( 'ast-menu-hover-style-' + animation ); } ); } ); wp.customize( 'astra-settings[header-menu'+ index +'-submenu-container-animation]', function( setting ) { setting.bind( function( animation ) { var menuWrapper = jQuery( '#ast-desktop-header #ast-hf-menu-'+ index ); menuWrapper.removeClass('astra-menu-animation-fade'); menuWrapper.removeClass('astra-menu-animation-slide-down'); menuWrapper.removeClass('astra-menu-animation-slide-up'); if ( '' != animation ) { menuWrapper.addClass( 'astra-menu-animation-' + animation ); } } ); } ); // Stack on Mobile CSS wp.customize( 'astra-settings[header-menu'+ index +'-menu-stack-on-mobile]', function( setting ) { setting.bind( function( stack ) { var menu_div = jQuery( '#ast-mobile-header #ast-hf-menu-'+ index + '.main-header-menu' ); menu_div.removeClass('inline-on-mobile'); menu_div.removeClass('stack-on-mobile'); if ( false === stack ) { menu_div.addClass('inline-on-mobile'); } else { menu_div.addClass('stack-on-mobile'); } } ); } ); wp.customize( 'astra-settings[header-menu'+ index +'-submenu-border-radius-fields]', function( value ) { value.bind( function( border ) { const tabletBreakPoint = astraBuilderPreview.tablet_break_point || 768; const mobileBreakPoint = astraBuilderPreview.mobile_break_point || 544; const submenuBorderWidth = wp.customize.get()?.[ 'astra-settings[header-menu' + index + '-submenu-border]' ]; const deviceSpecific = ( device ) => { return '.ast-builder-menu-' + index + ' li.menu-item .sub-menu, .ast-builder-menu-' + index + ' ul.inline-on-mobile li.menu-item .sub-menu {\ border-top-left-radius: ' + border[ device ]['top'] + border[ device + '-unit' ] + ';\ border-bottom-right-radius: ' + border[ device ]['bottom'] + border[ device + '-unit' ] + ';\ border-bottom-left-radius: ' + border[ device ]['left'] + border[ device + '-unit' ] + ';\ border-top-right-radius:' + border[ device ]['right'] + border[ device + '-unit' ] + ';\ }\ .ast-builder-menu-' + index + ' li.menu-item .sub-menu .menu-item:first-of-type > .menu-link, .ast-builder-menu-' + index + ' ul.inline-on-mobile li.menu-item .sub-menu .menu-item:first-of-type > .menu-link {\ border-top-left-radius: calc(' + border[ device ]['top'] + border[ device + '-unit' ] + ' - ' + submenuBorderWidth?.top + 'px);\ border-top-right-radius: calc(' + border[ device ]['right'] + border[ device + '-unit' ] + ' - ' + submenuBorderWidth?.top + 'px);\ }\ .ast-builder-menu-' + index + ' li.menu-item .sub-menu .menu-item:last-of-type > .menu-link, .ast-builder-menu-' + index + ' ul.inline-on-mobile li.menu-item .sub-menu .menu-item:last-of-type > .menu-link {\ border-bottom-left-radius: calc(' + border[ device ]['left'] + border[ device + '-unit' ] + ' - ' + submenuBorderWidth?.top + 'px);\ border-bottom-right-radius: calc(' + border[ device ]['bottom'] + border[ device + '-unit' ] + ' - ' + submenuBorderWidth?.top + 'px);\ }'; }; dynamicStyle = deviceSpecific( 'desktop' ) + '@media ( max-width: ' + tabletBreakPoint + 'px ) { ' + deviceSpecific( 'tablet' ) + ' }\n' + '@media ( max-width: ' + mobileBreakPoint + 'px ) { ' + deviceSpecific( 'mobile' ) + ' }\n'; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-border-radius-fields', dynamicStyle ); } ); } ); // Sub Menu - Top Offset. wp.customize( 'astra-settings[header-menu'+ index +'-submenu-top-offset]', function( value ) { value.bind( function( offset ) { var dynamicStyle = '.ast-desktop .ast-builder-menu-' + index + ' .main-header-menu > li.menu-item > .sub-menu, .ast-desktop .ast-builder-menu-' + index + ' ul.inline-on-mobile > li.menu-item > .sub-menu, .ast-desktop .ast-builder-menu-' + index + ' li.menu-item .astra-full-megamenu-wrapper {'; dynamicStyle += 'margin-top: ' + offset + 'px'; dynamicStyle += '}'; const submenuBorder = wp.customize( 'astra-settings[header-menu'+ index +'-submenu-border]' ).get(); dynamicStyle += '.ast-desktop .ast-builder-menu-' + index + ' .main-header-menu > .menu-item > .sub-menu:before, .ast-desktop .ast-builder-menu-' + index + ' .main-header-menu > .menu-item > .astra-full-megamenu-wrapper:before {'; dynamicStyle += 'height: calc( ' + ( submenuBorder.top || 0 ) + 'px + ' + ( offset || 0 ) + 'px + 5px );'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-top-offset', dynamicStyle ); } ); } ); // Sub Menu - Width. wp.customize( 'astra-settings[header-menu'+ index +'-submenu-width]', function( value ) { value.bind( function( width ) { var dynamicStyle = '.ast-builder-menu-' + index + ' li.menu-item .sub-menu, .ast-builder-menu-' + index + ' ul.inline-on-mobile li.menu-item .sub-menu {'; dynamicStyle += 'width: ' + width + 'px'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-menu'+ index +'-submenu-width', dynamicStyle ); } ); } ); // Sub menu astra_font_extras_css( 'header-menu' + index + '-font-extras', '.ast-builder-menu-' + index + ' .menu-item > .menu-link' ); })(index); // Sub Menu - Border Color. astra_css( 'astra-settings[header-' + prefix + '-submenu-b-color]', 'border-color', selector + ' li.menu-item .sub-menu, ' + selector + ' .inline-on-mobile li.menu-item .sub-menu ' ); } // Transparent header > Submenu link hover color. astra_color_responsive_css( 'astra-builder-transparent-submenu', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link' ); } )( jQuery ); menu/assets/js/minified/customizer-preview.min.js 0000644 00000031733 15104467203 0016226 0 ustar 00 (()=>{for(var i=AstraBuilderMenuData.tablet_break_point||768,a=AstraBuilderMenuData.mobile_break_point||544,n=AstraBuilderMenuData.nav_menu_enabled||!1,e=1;e<=AstraBuilderMenuData.component_limit;e++){var t="menu"+e,s=".ast-builder-menu-"+e;astra_builder_visibility_css("section-hb-menu-"+e,s),astra_generate_outside_font_family_css("astra-settings[header-"+t+"-font-family]",s+" .menu-item > .menu-link"),astra_generate_font_weight_css("astra-settings[header-"+t+"-font-family]","astra-settings[header-"+t+"-font-weight]","font-weight",s+" .menu-item > .menu-link"),astra_css("astra-settings[header-"+t+"-text-transform]","text-transform",s+" .menu-item > .menu-link"),astra_responsive_font_size("astra-settings[header-"+t+"-font-size]",s+" .menu-item > .menu-link"),astra_css("astra-settings[header-"+t+"-line-height]","line-height",s+" .menu-item > .menu-link"),astra_css("astra-settings[header-"+t+"-letter-spacing]","letter-spacing",s+" .menu-item > .menu-link","px"),astra_color_responsive_css("astra-menu-color-preview","astra-settings[header-"+t+"-color-responsive]","color",s+" .main-header-menu .menu-item > .menu-link"),astra_color_responsive_css("astra-menu-h-color-preview","astra-settings[header-"+t+"-h-color-responsive]","color",s+" .menu-item:hover > .menu-link, "+s+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder-toggle","astra-settings[header-"+t+"-color-responsive]","color",s+" .menu-item > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-h-toogle-color-preview","astra-settings[header-"+t+"-h-color-responsive]","color",s+" .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-active-color-preview","astra-settings[header-"+t+"-a-color-responsive]","color",s+" .menu-item.current-menu-item > .menu-link, "+s+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, "+s+" .current-menu-ancestor > .menu-link, "+s+" .current-menu-ancestor > .ast-menu-toggle"),astra_apply_responsive_background_css("astra-settings[header-"+t+"-bg-obj-responsive]",s+" .main-header-menu, "+s+" .main-header-menu .sub-menu","desktop"),astra_apply_responsive_background_css("astra-settings[header-"+t+"-bg-obj-responsive]",s+" .main-header-menu, "+s+" .main-header-menu .sub-menu","tablet"),astra_apply_responsive_background_css("astra-settings[header-"+t+"-bg-obj-responsive]",s+" .main-header-menu, "+s+" .main-header-menu .sub-menu","mobile"),astra_color_responsive_css("astra-menu-bg-preview","astra-settings[header-"+t+"-h-bg-color-responsive]","background",s+" .menu-item:hover > .menu-link, "+s+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder","astra-settings[header-"+t+"-a-bg-color-responsive]","background",s+" .menu-item.current-menu-item > .menu-link, "+s+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, "+s+" .current-menu-ancestor > .menu-link, "+s+" .current-menu-ancestor > .ast-menu-toggle"),(s=>{wp.customize("astra-settings[header-menu"+s+"-submenu-border]",function(e){e.bind(function(e){var t=".ast-builder-menu-"+s+" .sub-menu, .ast-builder-menu-"+s+" .inline-on-mobile .sub-menu, .ast-builder-menu-"+s+" .main-header-menu.submenu-with-border .astra-megamenu, .ast-builder-menu-"+s+" .main-header-menu.submenu-with-border .astra-full-megamenu-wrapper {",n=(t=(t=(t=(t=(t+="border-top-width:"+e.top+"px;")+("border-right-width:"+e.right+"px;")+("border-left-width:"+e.left+"px;"))+"border-style: solid;"+("border-bottom-width:"+e.bottom+"px;"))+"}"+(".ast-builder-menu-"+s+" .sub-menu .sub-menu {"))+("top:"+Number(-1*e.top)+"px;")+"}",wp.customize("astra-settings[header-menu"+s+"-submenu-top-offset]").get()),t=(t+=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu > .menu-item > .sub-menu:before, .ast-desktop .ast-builder-menu-"+s+" .main-header-menu > .menu-item > .astra-full-megamenu-wrapper:before {")+("height: calc( "+(e.top||0)+"px + "+(n||0)+"px + 5px );")+"}";astra_add_dynamic_css("header-menu"+s+"-submenu-border",t)})}),wp.customize("astra-settings[header-menu"+s+"-menu-spacing]",function(e){e.bind(function(e){var t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t="")+(".ast-builder-menu-"+s+" .main-header-menu .menu-item > .menu-link {")+("padding-left: "+e.desktop.left+e["desktop-unit"]+";"))+("padding-right: "+e.desktop.right+e["desktop-unit"]+";"))+("padding-top: "+e.desktop.top+e["desktop-unit"]+";"))+("padding-bottom: "+e.desktop.bottom+e["desktop-unit"]+";"))+"} "+("@media (max-width: "+i+"px) {"))+(".ast-header-break-point .ast-builder-menu-"+s+" .main-header-menu .menu-item > .menu-link {")+("padding-left: "+e.tablet.left+e["tablet-unit"]+";"))+("padding-right: "+e.tablet.right+e["tablet-unit"]+";"))+("padding-top: "+e.tablet.top+e["tablet-unit"]+";"))+("padding-bottom: "+e.tablet.bottom+e["tablet-unit"]+";")+"} ")+(".ast-hfb-header .ast-builder-menu-"+s+" .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {")+("top: "+e.tablet.top+e["tablet-unit"]+";"))+("right: calc( "+e.tablet.right+e["tablet-unit"]+" - 0.907em );")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+(".ast-header-break-point .ast-builder-menu-"+s+" .main-header-menu .menu-item > .menu-link {")+("padding-left: "+e.mobile.left+e["mobile-unit"]+";"))+("padding-right: "+e.mobile.right+e["mobile-unit"]+";"))+("padding-top: "+e.mobile.top+e["mobile-unit"]+";"))+("padding-bottom: "+e.mobile.bottom+e["mobile-unit"]+";")+"} ")+(".ast-hfb-header .ast-builder-menu-"+s+" .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {")+("top: "+e.mobile.top+e["mobile-unit"]+";"))+("right: calc( "+e.mobile.right+e["mobile-unit"]+" - 0.907em );"))+"} "+"} ";astra_add_dynamic_css("header-menu"+s+"-menu-spacing-toggle-button",t)})}),wp.customize("astra-settings[section-hb-menu-"+s+"-margin]",function(e){e.bind(function(e){var t=".ast-builder-menu-"+s+" .main-header-menu, .ast-header-break-point .ast-builder-menu-"+s+" .main-header-menu",n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n="")+(t+" {")+("margin-left: "+e.desktop.left+e["desktop-unit"]+";"))+("margin-right: "+e.desktop.right+e["desktop-unit"]+";"))+("margin-top: "+e.desktop.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.desktop.bottom+e["desktop-unit"]+";"))+"} "+("@media (max-width: "+i+"px) {"))+(t+" {")+("margin-left: "+e.tablet.left+e["tablet-unit"]+";"))+("margin-right: "+e.tablet.right+e["tablet-unit"]+";"))+("margin-top: "+e.tablet.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.tablet.bottom+e["desktop-unit"]+";")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+(t+" {")+("margin-left: "+e.mobile.left+e["mobile-unit"]+";"))+("margin-right: "+e.mobile.right+e["mobile-unit"]+";"))+("margin-top: "+e.mobile.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.mobile.bottom+e["desktop-unit"]+";"))+"} "+"} ";astra_add_dynamic_css("section-hb-menu-"+s+"-margin",n)})}),wp.customize("astra-settings[header-menu"+s+"-submenu-item-b-color]",function(e){e.bind(function(e){var t=wp.customize("astra-settings[header-menu"+s+"-submenu-item-border]").get(),n=wp.customize("astra-settings[header-menu"+s+"-submenu-item-b-size]").get();""!=e?1==t&&(t="",t=(t=(t=(t+=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link")+"{border-bottom-width:"+(n?n+"px;":"0px;"))+"border-color:"+e+";border-style: solid;")+"}.ast-desktop .ast-builder-menu-"+s+" .main-header-menu .menu-item .sub-menu .menu-item:last-child .menu-link{ border-style: none; }",astra_add_dynamic_css("header-menu"+s+"-submenu-item-b-color",t)):wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[header-menu"+s+"-submenu-item-b-size]",function(e){e.bind(function(e){var t=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu",n=(n=(n=(n="")+(t+" .menu-item .sub-menu:last-child > .menu-item > .menu-link, .ast-header-break-point .main-navigation ul .menu-item .menu-link {")+("border-bottom-width: "+e+"px;"))+"} "+(t+" .menu-item .sub-menu .menu-item:last-child .menu-link {"))+"border-bottom-width: 0px"+"} ";astra_add_dynamic_css("header-menu"+s+"-submenu-item-b-size",n)})}),wp.customize("astra-settings[header-menu"+s+"-submenu-item-border]",function(e){e.bind(function(e){var t=wp.customize("astra-settings[header-menu"+s+"-submenu-item-b-color]").get(),n=wp.customize("astra-settings[header-menu"+s+"-submenu-item-b-size]").get(),i=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu.submenu-with-border .sub-menu .menu-link";!0===e?i=(i+="{")+"border-bottom-width:"+(n?n+"px;":"0px;")+"border-color:"+t+";border-style: solid;}":i+="{border-style: none;}",i+=".ast-desktop .ast-builder-menu-"+s+" .menu-item .sub-menu .menu-item:last-child .menu-link{ border-style: none; }",astra_add_dynamic_css("header-menu"+s+"-submenu-item-border",i)})}),wp.customize("astra-settings[header-menu"+s+"-menu-hover-animation]",function(e){e.bind(function(e){var t=jQuery("#ast-desktop-header #ast-hf-menu-"+s);t.removeClass("ast-menu-hover-style-underline"),t.removeClass("ast-menu-hover-style-zoom"),t.removeClass("ast-menu-hover-style-overline"),n&&document.dispatchEvent(new CustomEvent("astMenuHoverStyleChanged",{detail:{}})),t.addClass("ast-menu-hover-style-"+e)})}),wp.customize("astra-settings[header-menu"+s+"-submenu-container-animation]",function(e){e.bind(function(e){var t=jQuery("#ast-desktop-header #ast-hf-menu-"+s);t.removeClass("astra-menu-animation-fade"),t.removeClass("astra-menu-animation-slide-down"),t.removeClass("astra-menu-animation-slide-up"),""!=e&&t.addClass("astra-menu-animation-"+e)})}),wp.customize("astra-settings[header-menu"+s+"-menu-stack-on-mobile]",function(e){e.bind(function(e){var t=jQuery("#ast-mobile-header #ast-hf-menu-"+s+".main-header-menu");t.removeClass("inline-on-mobile"),t.removeClass("stack-on-mobile"),!1===e?t.addClass("inline-on-mobile"):t.addClass("stack-on-mobile")})}),wp.customize("astra-settings[header-menu"+s+"-submenu-border-radius-fields]",function(e){e.bind(function(t){var e=astraBuilderPreview.tablet_break_point||768,n=astraBuilderPreview.mobile_break_point||544;let i=wp.customize.get()?.["astra-settings[header-menu"+s+"-submenu-border]"];var a=e=>".ast-builder-menu-"+s+" li.menu-item .sub-menu, .ast-builder-menu-"+s+" ul.inline-on-mobile li.menu-item .sub-menu {\t\t\t\t\t\t\t\t\tborder-top-left-radius: "+t[e].top+t[e+"-unit"]+";\t\t\t\t\t\t\t\t\tborder-bottom-right-radius: "+t[e].bottom+t[e+"-unit"]+";\t\t\t\t\t\t\t\t\tborder-bottom-left-radius: "+t[e].left+t[e+"-unit"]+";\t\t\t\t\t\t\t\t\tborder-top-right-radius:"+t[e].right+t[e+"-unit"]+";\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t.ast-builder-menu-"+s+" li.menu-item .sub-menu .menu-item:first-of-type > .menu-link, .ast-builder-menu-"+s+" ul.inline-on-mobile li.menu-item .sub-menu .menu-item:first-of-type > .menu-link {\t\t\t\t\t\t\t\t\tborder-top-left-radius: calc("+t[e].top+t[e+"-unit"]+" - "+i?.top+"px);\t\t\t\t\t\t\t\t\tborder-top-right-radius: calc("+t[e].right+t[e+"-unit"]+" - "+i?.top+"px);\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t.ast-builder-menu-"+s+" li.menu-item .sub-menu .menu-item:last-of-type > .menu-link, .ast-builder-menu-"+s+" ul.inline-on-mobile li.menu-item .sub-menu .menu-item:last-of-type > .menu-link {\t\t\t\t\t\t\t\t\tborder-bottom-left-radius: calc("+t[e].left+t[e+"-unit"]+" - "+i?.top+"px);\t\t\t\t\t\t\t\t\tborder-bottom-right-radius: calc("+t[e].bottom+t[e+"-unit"]+" - "+i?.top+"px);\t\t\t\t\t\t\t\t}";dynamicStyle=a("desktop")+"@media ( max-width: "+e+"px ) { "+a("tablet")+" }\n@media ( max-width: "+n+"px ) { "+a("mobile")+" }\n",astra_add_dynamic_css("header-menu"+s+"-submenu-border-radius-fields",dynamicStyle)})}),wp.customize("astra-settings[header-menu"+s+"-submenu-top-offset]",function(e){e.bind(function(e){n=(n=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu > li.menu-item > .sub-menu, .ast-desktop .ast-builder-menu-"+s+" ul.inline-on-mobile > li.menu-item > .sub-menu, .ast-desktop .ast-builder-menu-"+s+" li.menu-item .astra-full-megamenu-wrapper {")+"margin-top: "+e+"px}";var t=wp.customize("astra-settings[header-menu"+s+"-submenu-border]").get(),n=(n+=".ast-desktop .ast-builder-menu-"+s+" .main-header-menu > .menu-item > .sub-menu:before, .ast-desktop .ast-builder-menu-"+s+" .main-header-menu > .menu-item > .astra-full-megamenu-wrapper:before {")+("height: calc( "+(t.top||0)+"px + "+(e||0)+"px + 5px );")+"}";astra_add_dynamic_css("header-menu"+s+"-submenu-top-offset",n)})}),wp.customize("astra-settings[header-menu"+s+"-submenu-width]",function(e){e.bind(function(e){var t=(t=".ast-builder-menu-"+s+" li.menu-item .sub-menu, .ast-builder-menu-"+s+" ul.inline-on-mobile li.menu-item .sub-menu {")+("width: "+e+"px")+"}";astra_add_dynamic_css("header-menu"+s+"-submenu-width",t)})}),astra_font_extras_css("header-menu"+s+"-font-extras",".ast-builder-menu-"+s+" .menu-item > .menu-link")})(e),astra_css("astra-settings[header-"+t+"-submenu-b-color]","border-color",s+" li.menu-item .sub-menu, "+s+" .inline-on-mobile li.menu-item .sub-menu ")}astra_color_responsive_css("astra-builder-transparent-submenu","astra-settings[transparent-submenu-h-color-responsive]","color",".ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link")})(jQuery); account/dynamic-css/dynamic.css.php 0000644 00000013632 15104467203 0013345 0 ustar 00 <?php /** * Account - Dynamic CSS * * @package Astra * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Account */ add_filter( 'astra_dynamic_theme_css', 'astra_hb_account_dynamic_css' ); /** * Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @param string $dynamic_css_filtered Astra Dynamic CSS Filters. * @return String Generated dynamic CSS for Account. * * @since 3.0.0 */ function astra_hb_account_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { if ( ! Astra_Builder_Helper::is_component_loaded( 'account', 'header' ) ) { return $dynamic_css; } $_section = 'section-header-account'; $selector = '.ast-header-account-wrap'; $icon_size = astra_get_option( 'header-account-icon-size' ); $icon_size_desktop = isset( $icon_size ) && isset( $icon_size['desktop'] ) && ! empty( $icon_size['desktop'] ) ? $icon_size['desktop'] : 20; $icon_size_tablet = isset( $icon_size ) && isset( $icon_size['tablet'] ) && ! empty( $icon_size['tablet'] ) ? $icon_size['tablet'] : 20; $icon_size_mobile = isset( $icon_size ) && isset( $icon_size['mobile'] ) && ! empty( $icon_size['mobile'] ) ? $icon_size['mobile'] : 20; $image_width = astra_get_option( 'header-account-image-width' ); $image_width_desktop = isset( $image_width ) && isset( $image_width['desktop'] ) && ! empty( $image_width['desktop'] ) ? $image_width['desktop'] : 20; $image_width_tablet = isset( $image_width ) && isset( $image_width['tablet'] ) && ! empty( $image_width['tablet'] ) ? $image_width['tablet'] : 20; $image_width_mobile = isset( $image_width ) && isset( $image_width['mobile'] ) && ! empty( $image_width['mobile'] ) ? $image_width['mobile'] : 20; $margin = astra_get_option( 'header-account-margin' ); $margin_selector = '.ast-header-account-wrap'; /** * Account CSS. */ $css_output_desktop = array( '.ast-header-account-type-icon' => array( '-js-display' => 'inline-flex', 'display' => 'inline-flex', 'align-self' => 'center', 'vertical-align' => 'middle', ), '.ast-header-account-type-avatar .avatar' => array( 'display' => 'inline', 'border-radius' => '100%', 'max-width' => '100%', ), '.as.site-header-focus-item.ast-header-account:hover > .customize-partial-edit-shortcut' => array( 'opacity' => '0', ), '.site-header-focus-item.ast-header-account:hover > * > .customize-partial-edit-shortcut' => array( 'opacity' => '1', ), $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' => array( 'fill' => esc_attr( astra_get_option( 'header-account-icon-color' ) ), ), '.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' => array( 'fill' => esc_attr( astra_get_option( 'header-account-icon-color' ) ), ), $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array( 'height' => astra_get_css_value( $icon_size_desktop, 'px' ), 'width' => astra_get_css_value( $icon_size_desktop, 'px' ), ), $selector . ' .ast-header-account-type-avatar .avatar' => array( 'width' => astra_get_css_value( $image_width_desktop, 'px' ), ), $selector . ' .ast-header-account-text' => array( 'color' => esc_attr( astra_get_option( 'header-account-type-text-color' ) ), ), $margin_selector => 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' ), ), ); $css_output_tablet = array( $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array( 'height' => astra_get_css_value( $icon_size_tablet, 'px' ), 'width' => astra_get_css_value( $icon_size_tablet, 'px' ), ), $selector . ' .ast-header-account-type-avatar .avatar' => array( 'width' => astra_get_css_value( $image_width_tablet, 'px' ), ), $margin_selector => 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' ), ), ); $css_output_mobile = array( $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array( 'height' => astra_get_css_value( $icon_size_mobile, 'px' ), 'width' => astra_get_css_value( $icon_size_mobile, 'px' ), ), $selector . ' .ast-header-account-type-avatar .avatar' => array( 'width' => astra_get_css_value( $image_width_mobile, 'px' ), ), $margin_selector => 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' ), ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= $css_output; $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_typography_css( $_section, $selector . ' .ast-header-account-text' ); $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector ); return $dynamic_css; } account/class-astra-header-account-component-loader.php 0000644 00000002201 15104467203 0017247 0 ustar 00 <?php /** * Account Styling Loader for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Header_Account_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = SCRIPT_DEBUG ? 'unminified' : 'minified'; $file_prefix = SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'astra-header-builder-account-customizer-preview-js', ASTRA_HEADER_ACCOUNT_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Account_Component_Loader(); account/assets/js/unminified/customizer-preview.js 0000644 00000015105 15104467203 0016472 0 ustar 00 /** * 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 ); account/assets/js/minified/customizer-preview.min.js 0000644 00000006530 15104467203 0016713 0 ustar 00 (()=>{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=(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 {")+("fill: "+(t=t||"inherit")+";")+"} ";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=(a=(a=(a=(a=(a="")+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {height: "+t.desktop+"px;")+"width: "+t.desktop+"px;} ")+"@media (max-width: "+o+"px) {"+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {")+"height: "+t.tablet+"px;width: "+t.tablet+"px;} } ")+"@media (max-width: "+i+"px) {"+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {")+"height: "+t.mobile+"px;width: "+t.mobile+"px;} } ",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=(a=(a=(a=(a=(a+=e+" .ast-header-account-type-avatar .avatar {")+"width: "+t.desktop+"px;} ")+"@media (max-width: "+o+"px) {"+e+" .ast-header-account-type-avatar .avatar {")+"width: "+t.tablet+"px;} ")+"} @media (max-width: "+i+"px) {")+e+" .ast-header-account-type-avatar .avatar {width: "+t.mobile+"px;} } ",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=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e="")+(a=".ast-header-account-wrap")+" {margin-left: "+t.desktop.left+t["desktop-unit"]+";")+"margin-right: "+t.desktop.right+t["desktop-unit"]+";")+"margin-top: "+t.desktop.top+t["desktop-unit"]+";")+"margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";")+"} @media (max-width: "+o+"px) {")+a+" {margin-left: "+t.tablet.left+t["tablet-unit"]+";")+"margin-right: "+t.tablet.right+t["tablet-unit"]+";")+"margin-top: "+t.tablet.top+t["desktop-unit"]+";")+"margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";} ")+"} @media (max-width: "+i+"px) {")+a+" {margin-left: "+t.mobile.left+t["mobile-unit"]+";")+"margin-right: "+t.mobile.right+t["mobile-unit"]+";")+"margin-top: "+t.mobile.top+t["desktop-unit"]+";")+"margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";} } ",astra_add_dynamic_css("header-account-margin",e))})}),astra_builder_visibility_css("section-header-account",'.ast-header-account[data-section="section-header-account"]')})(jQuery); account/class-astra-header-account-component.php 0000644 00000013634 15104467203 0016017 0 ustar 00 <?php /** * Account for Astra theme. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_HEADER_ACCOUNT_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/account' ); define( 'ASTRA_HEADER_ACCOUNT_URI', ASTRA_THEME_URI . 'inc/builder/type/header/account' ); if ( ! class_exists( 'Astra_Header_Account_Component' ) ) { /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Account_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_HEADER_ACCOUNT_DIR . '/class-astra-header-account-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_HEADER_ACCOUNT_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Account navigation markup */ public static function account_menu_markup() { $astra_builder = astra_builder(); $theme_location = 'loggedin_account_menu'; $account_type = astra_get_option( 'header-account-type' ); $enable_woo_menu = ( 'woocommerce' === $account_type && astra_get_option( 'header-account-woo-menu' ) ); /** * Filter the classes(array) for Menu (<ul>). * * @since 3.0.0 * @var Array */ $menu_classes = apply_filters( 'astra_menu_classes', array( 'main-header-menu', 'ast-menu-shadow', 'ast-nav-menu', 'ast-account-nav-menu' ) ); $items_wrap = '<nav '; $items_wrap .= astra_attr( 'site-navigation', array( 'id' => 'account-site-navigation', 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility site-header-focus-item', 'aria-label' => esc_attr__( 'Site Navigation', 'astra' ), ) ); $items_wrap .= '>'; $items_wrap .= '<div class="account-main-navigation">'; $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>'; $items_wrap .= '</div>'; $items_wrap .= '</nav>'; // Fallback Menu if primary menu not set. $fallback_menu_args = array( 'theme_location' => $theme_location, 'menu_id' => 'ast-hf-account-menu', 'menu_class' => 'account-main-navigation', 'container' => 'div', 'before' => '<ul class="' . esc_attr( implode( ' ', $menu_classes ) ) . '">', 'after' => '</ul>', 'walker' => new Astra_Walker_Page(), 'echo' => false, ); // To add default alignment for navigation which can be added through any third party plugin. // Do not add any CSS from theme except header alignment. echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">'; if ( has_nav_menu( $theme_location ) && ! $enable_woo_menu ) { $account_menu_markup = wp_nav_menu( array( 'menu_id' => 'ast-hf-account-menu', 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ), 'container' => 'div', 'container_class' => 'account-main-header-bar-navigation', 'items_wrap' => $items_wrap, 'theme_location' => $theme_location, 'echo' => false, ) ); // Adding rel="nofollow" for duplicate menu render. $account_menu_markup = $astra_builder->nofollow_markup( $theme_location, $account_menu_markup ); echo do_shortcode( $account_menu_markup ); } elseif ( $enable_woo_menu ) { echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">'; echo '<div class="account-main-header-bar-navigation">'; echo '<nav '; echo wp_kses_post( astra_attr( 'account-woo-navigation', array( 'id' => 'account-woo-navigation', ) ) ); echo ' class="ast-flex-grow-1 navigation-accessibility site-header-focus-item" aria-label="' . esc_attr__( 'Account Woo Navigation', 'astra' ) . '">'; ob_start(); if ( class_exists( 'woocommerce' ) ) { ?> <ul id="ast-hf-account-menu" class="main-header-menu ast-nav-menu ast-account-nav-menu ast-header-account-woocommerce-menu"> <?php foreach ( wc_get_account_menu_items() as $endpoint => $item ) { ?> <li class="menu-item <?php echo esc_attr( wc_get_account_menu_item_classes( $endpoint ) ); ?>"> <a href="<?php echo esc_url( wc_get_account_endpoint_url( $endpoint ) ); ?>" class="menu-link"><?php echo esc_html( $item ); ?></a> </li> <?php } ?> </ul> <?php } $account_menu_markup = ob_get_clean(); // Adding rel="nofollow" for duplicate menu render. $account_menu_markup = $astra_builder->nofollow_markup( $theme_location, $account_menu_markup ); echo wp_kses_post( $account_menu_markup ); echo '</nav>'; echo '</div>'; echo '</div>'; } else { echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">'; echo '<div class="account-main-header-bar-navigation">'; echo '<nav '; echo wp_kses_post( astra_attr( 'site-navigation', array( 'id' => 'account-site-navigation', 'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility', 'aria-label' => esc_attr__( 'Site Navigation', 'astra' ), ) ) ); echo '>'; $account_menu_markup = wp_page_menu( $fallback_menu_args ); // Adding rel="nofollow" for duplicate menu render. $account_menu_markup = $astra_builder->nofollow_markup( $theme_location, $account_menu_markup ); echo wp_kses_post( $account_menu_markup ); echo '</nav>'; echo '</div>'; echo '</div>'; } echo '</div>'; } } /** * Kicking this off by creating an object. */ new Astra_Header_Account_Component(); } class-astra-customizer-off-canvas-configs.php 0000644 00000002101 15107444133 0015337 0 ustar 00 <?php /** * Astra Theme Customizer Configuration Off Canvas. * * @package astra-builder * @link https://wpastra.com/ * @since 3.0.0 */ // No direct access, please. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( class_exists( 'Astra_Customizer_Config_Base' ) ) { /** * Register Off Canvas Customizer Configurations. * * @since 3.0.0 */ class Astra_Customizer_Off_Canvas_Configs extends Astra_Customizer_Config_Base { /** * Register Builder Above Customizer Configurations. * * @param Array $configurations Astra Customizer Configurations. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @since 3.0.0 * @return Array Astra Customizer Configurations with updated configurations. */ public function register_configuration( $configurations, $wp_customize ) { $_configs = astra_header_off_canvas_configuration(); return array_merge( $configurations, $_configs ); } } /** * Kicking this off by creating object o
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings