From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 139 ++++++++++ .../class-astra-above-footer-component-loader.php | 51 ++++ .../above-footer/class-astra-above-footer.php | 49 ++++ .../above-footer/dynamic-css/dynamic.css.php | 151 +++++++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 142 ++++++++++ .../class-astra-below-footer-component-loader.php | 52 ++++ .../below-footer/class-astra-below-footer.php | 49 ++++ .../below-footer/dynamic-css/dynamic.css.php | 153 +++++++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 15 ++ .../class-astra-footer-button-component-loader.php | 62 +++++ .../button/class-astra-footer-button-component.php | 46 ++++ .../type/footer/button/dynamic-css/dynamic.css.php | 90 +++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 98 +++++++ ...ass-astra-footer-copyright-component-loader.php | 52 ++++ .../class-astra-footer-copyright-component.php | 49 ++++ .../footer/copyright/dynamic-css/dynamic.css.php | 102 ++++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 47 ++++ .../class-astra-footer-html-component-loader.php | 62 +++++ .../html/class-astra-footer-html-component.php | 45 ++++ .../type/footer/html/dynamic-css/dynamic.css.php | 86 ++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 191 ++++++++++++++ .../class-astra-footer-menu-component-loader.php | 52 ++++ .../menu/class-astra-footer-menu-component.php | 114 ++++++++ .../type/footer/menu/dynamic-css/dynamic.css.php | 291 +++++++++++++++++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 124 +++++++++ ...class-astra-primary-footer-component-loader.php | 60 +++++ .../primary-footer/class-astra-primary-footer.php | 50 ++++ .../primary-footer/dynamic-css/dynamic.css.php | 165 ++++++++++++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 15 ++ ...-astra-footer-social-icons-component-loader.php | 62 +++++ .../class-astra-footer-social-icons-component.php | 45 ++++ .../footer/social-icon/dynamic-css/dynamic.css.php | 32 +++ .../assets/js/minified/customizer-preview.min.js | 1 + .../assets/js/unminified/customizer-preview.js | 15 ++ .../class-astra-footer-widget-component-loader.php | 64 +++++ .../widget/class-astra-footer-widget-component.php | 45 ++++ .../type/footer/widget/dynamic-css/dynamic.css.php | 78 ++++++ 45 files changed, 2952 insertions(+) create mode 100644 inc/builder/type/footer/above-footer/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/above-footer/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/above-footer/class-astra-above-footer-component-loader.php create mode 100644 inc/builder/type/footer/above-footer/class-astra-above-footer.php create mode 100644 inc/builder/type/footer/above-footer/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/below-footer/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/below-footer/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/below-footer/class-astra-below-footer-component-loader.php create mode 100644 inc/builder/type/footer/below-footer/class-astra-below-footer.php create mode 100644 inc/builder/type/footer/below-footer/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/button/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/button/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/button/class-astra-footer-button-component-loader.php create mode 100644 inc/builder/type/footer/button/class-astra-footer-button-component.php create mode 100644 inc/builder/type/footer/button/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php create mode 100644 inc/builder/type/footer/copyright/class-astra-footer-copyright-component.php create mode 100644 inc/builder/type/footer/copyright/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/html/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/html/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/html/class-astra-footer-html-component-loader.php create mode 100644 inc/builder/type/footer/html/class-astra-footer-html-component.php create mode 100644 inc/builder/type/footer/html/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php create mode 100644 inc/builder/type/footer/menu/class-astra-footer-menu-component.php create mode 100644 inc/builder/type/footer/menu/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/primary-footer/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/primary-footer/class-astra-primary-footer-component-loader.php create mode 100644 inc/builder/type/footer/primary-footer/class-astra-primary-footer.php create mode 100644 inc/builder/type/footer/primary-footer/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/social-icon/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/social-icon/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component-loader.php create mode 100644 inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component.php create mode 100644 inc/builder/type/footer/social-icon/dynamic-css/dynamic.css.php create mode 100644 inc/builder/type/footer/widget/assets/js/minified/customizer-preview.min.js create mode 100644 inc/builder/type/footer/widget/assets/js/unminified/customizer-preview.js create mode 100644 inc/builder/type/footer/widget/class-astra-footer-widget-component-loader.php create mode 100644 inc/builder/type/footer/widget/class-astra-footer-widget-component.php create mode 100644 inc/builder/type/footer/widget/dynamic-css/dynamic.css.php (limited to 'inc/builder/type/footer') diff --git a/inc/builder/type/footer/above-footer/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/above-footer/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..8cabe1c --- /dev/null +++ b/inc/builder/type/footer/above-footer/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var r=astraBuilderPreview.tablet_break_point||768,o=astraBuilderPreview.mobile_break_point||544,t="section-above-footer-builder",i='.site-above-footer-wrap[data-section="section-above-footer-builder"]';astra_css("astra-settings[hba-footer-height]","min-height",i,"px"),astra_css("astra-settings[hba-footer-vertical-alignment]","align-items",i+" .ast-builder-grid-row, "+i+" .site-footer-section"),wp.customize("astra-settings[hba-footer-separator]",function(t){t.bind(function(t){var a="";""!==t&&(a=i+" {",a+="border-top-width: "+t+"px;",a+="border-top-style: solid",a+="} "),astra_add_dynamic_css("hba-footer-separator",a)})}),wp.customize("astra-settings[hba-inner-spacing]",function(t){t.bind(function(t){var a="";""!=t.desktop&&(a+=i+" .ast-builder-grid-row {",a+="grid-column-gap: "+t.desktop+"px;",a+="} "),""!=t.tablet&&(a+="@media (max-width: "+r+"px) {",a+=i+" .ast-builder-grid-row {",a+="grid-column-gap: "+t.tablet+"px;",a+="grid-row-gap: "+t.tablet+"px;",a+="} ",a+="} "),""!=t.mobile&&(a+="@media (max-width: "+o+"px) {",a+=i+" .ast-builder-grid-row {",a+="grid-column-gap: "+t.mobile+"px;",a+="grid-row-gap: "+t.mobile+"px;",a+="} ",a+="} "),astra_add_dynamic_css("hba-inner-spacing-toggle-button",a)})}),wp.customize("astra-settings[hba-footer-top-border-color]",function(t){t.bind(function(t){var a="";""!==t&&(a=i+" {",a+="border-top-color: "+t+";",a+="border-top-style: solid",a+="} "),astra_add_dynamic_css("hba-footer-top-border-color",a)})}),wp.customize("astra-settings[hba-footer-layout-width]",function(t){t.bind(function(t){var a="";"content"==t&&(a=i+" .ast-builder-grid-row {",a+="max-width: "+AstraBuilderPrimaryFooterData.footer_content_width+"px;",a+="margin-left: auto;",a+="margin-right: auto;",a+="} "),"full"==t&&(a=i+" .ast-builder-grid-row {",a+="max-width: 100%;",a+="padding-right: 35px; padding-left: 35px;",a+="} "),astra_add_dynamic_css("hba-footer-layout-width",a)})}),astra_apply_responsive_background_css("astra-settings[hba-footer-bg-obj-responsive]",i,"desktop"),astra_apply_responsive_background_css("astra-settings[hba-footer-bg-obj-responsive]",i,"tablet"),astra_apply_responsive_background_css("astra-settings[hba-footer-bg-obj-responsive]",i,"mobile"),astra_builder_advanced_css(t,i),astra_builder_visibility_css(t,i,"grid")}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/above-footer/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/above-footer/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..0b32c85 --- /dev/null +++ b/inc/builder/type/footer/above-footer/assets/js/unminified/customizer-preview.js @@ -0,0 +1,139 @@ +/** + * 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 section = 'section-above-footer-builder'; + var selector = '.site-above-footer-wrap[data-section="section-above-footer-builder"]'; + + // Footer Height. + astra_css( + 'astra-settings[hba-footer-height]', + 'min-height', + selector, + 'px' + ); + + // Footer Vertical Alignment. + astra_css( + 'astra-settings[hba-footer-vertical-alignment]', + 'align-items', + selector + ' .ast-builder-grid-row, ' + selector + ' .site-footer-section' + ); + + // Border Bottom width. + wp.customize( 'astra-settings[hba-footer-separator]', function( setting ) { + setting.bind( function( separator ) { + + var dynamicStyle = ''; + + if ( '' !== separator ) { + dynamicStyle = selector + ' {'; + dynamicStyle += 'border-top-width: ' + separator + 'px;'; + dynamicStyle += 'border-top-style: solid'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hba-footer-separator', dynamicStyle ); + + } ); + } ); + + // Inner Space. + wp.customize( 'astra-settings[hba-inner-spacing]', function( value ) { + value.bind( function( spacing ) { + var dynamicStyle = ''; + if ( spacing.desktop != '' ) { + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.desktop + 'px;'; + dynamicStyle += '} '; + } + + if ( spacing.tablet != '' ) { + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + if ( spacing.mobile != '' ) { + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hba-inner-spacing-toggle-button', dynamicStyle ); + } ); + } ); + + // Border Color. + wp.customize( 'astra-settings[hba-footer-top-border-color]', function( setting ) { + setting.bind( function( color ) { + + var dynamicStyle = ''; + + if ( '' !== color ) { + dynamicStyle = selector + ' {'; + dynamicStyle += 'border-top-color: ' + color + ';'; + dynamicStyle += 'border-top-style: solid'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hba-footer-top-border-color', dynamicStyle ); + + } ); + } ); + + // Primary Header - Layout. + wp.customize( 'astra-settings[hba-footer-layout-width]', function( setting ) { + setting.bind( function( layout ) { + + var dynamicStyle = ''; + + if ( 'content' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: ' + AstraBuilderPrimaryFooterData.footer_content_width + 'px;'; + dynamicStyle += 'margin-left: auto;'; + dynamicStyle += 'margin-right: auto;'; + dynamicStyle += '} '; + } + + if ( 'full' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: 100%;'; + dynamicStyle += 'padding-right: 35px; padding-left: 35px;'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hba-footer-layout-width', dynamicStyle ); + + } ); + } ); + + // Responsive BG styles > Above Footer Row. + astra_apply_responsive_background_css( 'astra-settings[hba-footer-bg-obj-responsive]', selector, 'desktop' ); + astra_apply_responsive_background_css( 'astra-settings[hba-footer-bg-obj-responsive]', selector, 'tablet' ); + astra_apply_responsive_background_css( 'astra-settings[hba-footer-bg-obj-responsive]', selector, 'mobile' ); + + // Advanced CSS Generation. + astra_builder_advanced_css( section, selector ); + + // Advanced Visibility CSS Generation. + astra_builder_visibility_css( section, selector, 'grid' ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/above-footer/class-astra-above-footer-component-loader.php b/inc/builder/type/footer/above-footer/class-astra-above-footer-component-loader.php new file mode 100644 index 0000000..01242f1 --- /dev/null +++ b/inc/builder/type/footer/above-footer/class-astra-above-footer-component-loader.php @@ -0,0 +1,51 @@ + array( + 'padding-top' => '20px', + 'padding-bottom' => '20px', + ), + $selector => astra_get_responsive_background_obj( $footer_bg, 'desktop' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_desktop, 'px' ), + ), + $selector . ' .ast-builder-grid-row, ' . $selector . ' .site-footer-section' => array( + 'align-items' => astra_get_option( 'hba-footer-vertical-alignment' ), + ), + $selector . '.ast-footer-row-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + '.ast-builder-grid-row-' . $desk_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $desk_layout ], + ), + + ); + + if ( isset( $footer_width ) && 'content' === $footer_width ) { + + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = astra_get_css_value( $content_width, 'px' ); + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-left'] = 'auto'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-right'] = 'auto'; + } else { + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = '100%'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-left'] = '35px'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-right'] = '35px'; + } + + + $css_output_desktop[ $selector ]['min-height'] = astra_get_css_value( $footer_height, 'px' ); + + if ( isset( $footer_top_border_size ) && 1 <= $footer_top_border_size ) { + + $css_output_desktop[ $selector ]['border-style'] = 'solid'; + + $css_output_desktop[ $selector ]['border-width'] = '0px'; + + $css_output_desktop[ $selector ]['border-top-width'] = astra_get_css_value( $footer_top_border_size, 'px' ); + + $css_output_desktop[ $selector ]['border-top-color'] = $footer_top_border_color; + } + + $css_output_tablet = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'tablet' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + ), + $selector . '.ast-footer-row-tablet-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-tablet-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-' . $tab_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $tab_layout ], + ), + ); + $css_output_mobile = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'mobile' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + ), + $selector . '.ast-footer-row-mobile-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-mobile-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-' . $mob_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $mob_layout ], + ), + ); + + /* 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_margin_padding_css( $_section, $selector ); + $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector, 'grid' ); + return $dynamic_css; +} diff --git a/inc/builder/type/footer/below-footer/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/below-footer/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..a8355dc --- /dev/null +++ b/inc/builder/type/footer/below-footer/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var o=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544,t="section-below-footer-builder",i='.site-below-footer-wrap[data-section="section-below-footer-builder"]';astra_css("astra-settings[hbb-footer-vertical-alignment]","align-items",i+" .ast-builder-grid-row, "+i+" .site-footer-section"),astra_css("astra-settings[hbb-footer-height]","min-height",i,"px"),wp.customize("astra-settings[hbb-inner-spacing]",function(t){t.bind(function(t){var r="";""!=t.desktop&&(r+=i+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.desktop+"px;",r+="} "),""!=t.tablet&&(r+="@media (max-width: "+o+"px) {",r+=i+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.tablet+"px;",r+="grid-row-gap: "+t.tablet+"px;",r+="} ",r+="} "),""!=t.mobile&&(r+="@media (max-width: "+a+"px) {",r+=i+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.mobile+"px;",r+="grid-row-gap: "+t.mobile+"px;",r+="} ",r+="} "),astra_add_dynamic_css("hbb-inner-spacing-toggle-button",r)})}),wp.customize("astra-settings[hbb-footer-separator]",function(t){t.bind(function(t){var r="";""!==t&&(r=i+" {",r+="border-top-width: "+t+"px;",r+="border-top-style: solid",r+="} "),astra_add_dynamic_css("hbb-footer-separator",r)})}),wp.customize("astra-settings[hbb-footer-top-border-color]",function(t){t.bind(function(t){var r="";""!==t&&(r=i+" {",r+="border-top-color: "+t+";",r+="border-top-style: solid",r+="} "),astra_add_dynamic_css("hbb-footer-top-border-color",r)})}),wp.customize("astra-settings[hbb-footer-layout-width]",function(t){t.bind(function(t){var r="";"content"==t&&(r=i+" .ast-builder-grid-row {",r+="max-width: "+AstraBuilderPrimaryFooterData.footer_content_width+"px;",r+="margin-left: auto;",r+="margin-right: auto;",r+="} "),"full"==t&&(r=i+" .ast-builder-grid-row {",r+="max-width: 100%;",r+="padding-right: 35px; padding-left: 35px;",r+="} "),astra_add_dynamic_css("hbb-footer-layout-width",r)})}),astra_apply_responsive_background_css("astra-settings[hbb-footer-bg-obj-responsive]",i,"desktop"),astra_apply_responsive_background_css("astra-settings[hbb-footer-bg-obj-responsive]",i,"tablet"),astra_apply_responsive_background_css("astra-settings[hbb-footer-bg-obj-responsive]",i,"mobile"),astra_builder_advanced_css(t,i),astra_builder_visibility_css(t,i,"grid")}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/below-footer/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/below-footer/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..f5d8377 --- /dev/null +++ b/inc/builder/type/footer/below-footer/assets/js/unminified/customizer-preview.js @@ -0,0 +1,142 @@ +/** + * 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 section = 'section-below-footer-builder'; + var selector = '.site-below-footer-wrap[data-section="section-below-footer-builder"]'; + + // Footer Vertical Alignment. + astra_css( + 'astra-settings[hbb-footer-vertical-alignment]', + 'align-items', + selector + ' .ast-builder-grid-row, ' + selector + ' .site-footer-section' + ); + + + // Header Height. + astra_css( + 'astra-settings[hbb-footer-height]', + 'min-height', + selector, + 'px' + ); + + // Inner Space. + wp.customize( 'astra-settings[hbb-inner-spacing]', function( value ) { + value.bind( function( spacing ) { + var dynamicStyle = ''; + if ( spacing.desktop != '' ) { + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.desktop + 'px;'; + dynamicStyle += '} '; + } + + if ( spacing.tablet != '' ) { + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + if ( spacing.mobile != '' ) { + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hbb-inner-spacing-toggle-button', dynamicStyle ); + } ); + } ); + + // Border Top width. + wp.customize( 'astra-settings[hbb-footer-separator]', function( setting ) { + setting.bind( function( separator ) { + + var dynamicStyle = ''; + + if ( '' !== separator ) { + dynamicStyle = selector + ' {'; + dynamicStyle += 'border-top-width: ' + separator + 'px;'; + dynamicStyle += 'border-top-style: solid'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hbb-footer-separator', dynamicStyle ); + + } ); + } ); + + // Border Color. + + wp.customize( 'astra-settings[hbb-footer-top-border-color]', function( setting ) { + setting.bind( function( color ) { + + var dynamicStyle = ''; + + if ( '' !== color ) { + dynamicStyle = selector + ' {'; + dynamicStyle += 'border-top-color: ' + color + ';'; + dynamicStyle += 'border-top-style: solid'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hbb-footer-top-border-color', dynamicStyle ); + + } ); + } ); + + // Primary Header - Layout. + wp.customize( 'astra-settings[hbb-footer-layout-width]', function( setting ) { + setting.bind( function( layout ) { + + var dynamicStyle = ''; + + if ( 'content' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: ' + AstraBuilderPrimaryFooterData.footer_content_width + 'px;'; + dynamicStyle += 'margin-left: auto;'; + dynamicStyle += 'margin-right: auto;'; + dynamicStyle += '} '; + } + + if ( 'full' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: 100%;'; + dynamicStyle += 'padding-right: 35px; padding-left: 35px;'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hbb-footer-layout-width', dynamicStyle ); + + } ); + } ); + + + // Responsive BG styles > Below Footer Row. + astra_apply_responsive_background_css( 'astra-settings[hbb-footer-bg-obj-responsive]', selector, 'desktop' ); + astra_apply_responsive_background_css( 'astra-settings[hbb-footer-bg-obj-responsive]', selector, 'tablet' ); + astra_apply_responsive_background_css( 'astra-settings[hbb-footer-bg-obj-responsive]', selector, 'mobile' ); + + // Advanced CSS Generation. + astra_builder_advanced_css( section, selector ); + + // Advanced Visibility CSS Generation. + astra_builder_visibility_css( section, selector, 'grid' ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/below-footer/class-astra-below-footer-component-loader.php b/inc/builder/type/footer/below-footer/class-astra-below-footer-component-loader.php new file mode 100644 index 0000000..c600d23 --- /dev/null +++ b/inc/builder/type/footer/below-footer/class-astra-below-footer-component-loader.php @@ -0,0 +1,52 @@ + array( + 'padding-top' => '20px', + 'padding-bottom' => '20px', + ), + $selector => astra_get_responsive_background_obj( $footer_bg, 'desktop' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_desktop, 'px' ), + ), + $selector . ' .ast-builder-grid-row, ' . $selector . ' .site-footer-section' => array( + 'align-items' => astra_get_option( 'hbb-footer-vertical-alignment' ), + ), + $selector . '.ast-footer-row-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + '.ast-builder-grid-row-' . $desk_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $desk_layout ], + ), + + ); + + $css_output_desktop[ $selector ]['min-height'] = astra_get_css_value( $footer_height, 'px' ); + + if ( isset( $footer_top_border_size ) && 1 <= $footer_top_border_size ) { + + $css_output_desktop[ $selector ]['border-style'] = 'solid'; + + $css_output_desktop[ $selector ]['border-width'] = '0px'; + + $css_output_desktop[ $selector ]['border-top-width'] = astra_get_css_value( $footer_top_border_size, 'px' ); + + $css_output_desktop[ $selector ]['border-top-color'] = $footer_top_border_color; + } + + $css_output_tablet = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'tablet' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + ), + $selector . '.ast-footer-row-tablet-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-tablet-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-' . $tab_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $tab_layout ], + ), + ); + $css_output_mobile = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'mobile' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + ), + $selector . '.ast-footer-row-mobile-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-mobile-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-' . $mob_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $mob_layout ], + ), + ); + + if ( isset( $footer_width ) && 'content' === $footer_width ) { + + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = astra_get_css_value( $content_width, 'px' ); + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-left'] = 'auto'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-right'] = 'auto'; + } else { + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = '100%'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-left'] = '35px'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-right'] = '35px'; + } + + + /* 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_margin_padding_css( $_section, $selector ); + + $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector, 'grid' ); + + return $dynamic_css; +} diff --git a/inc/builder/type/footer/button/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/button/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..3a83881 --- /dev/null +++ b/inc/builder/type/footer/button/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +jQuery,astra_builder_button_css("footer",AstraBuilderFooterButtonData.component_limit); \ No newline at end of file diff --git a/inc/builder/type/footer/button/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/button/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..45f32cd --- /dev/null +++ b/inc/builder/type/footer/button/assets/js/unminified/customizer-preview.js @@ -0,0 +1,15 @@ +/** + * 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( 'footer', AstraBuilderFooterButtonData.component_limit ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/button/class-astra-footer-button-component-loader.php b/inc/builder/type/footer/button/class-astra-footer-button-component-loader.php new file mode 100644 index 0000000..eb895bf --- /dev/null +++ b/inc/builder/type/footer/button/class-astra-footer-button-component-loader.php @@ -0,0 +1,62 @@ + defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_button, + '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_Footer_Button_Component_Loader(); diff --git a/inc/builder/type/footer/button/class-astra-footer-button-component.php b/inc/builder/type/footer/button/class-astra-footer-button-component.php new file mode 100644 index 0000000..f0344f9 --- /dev/null +++ b/inc/builder/type/footer/button/class-astra-footer-button-component.php @@ -0,0 +1,46 @@ + array( + 'justify-content' => $desktop_alignment, + ), + ); + + $css_output_tablet = array( + $selector => array( + 'justify-content' => $tablet_alignment, + ), + ); + + $css_output_mobile = array( + $selector => array( + 'justify-content' => $mobile_alignment, + ), + ); + + /* 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; + } + if ( true === $fb_button_flag ) { + $static_css = array( + '[data-section*="section-fb-button-"] .menu-link' => array( + 'display' => 'none', + ), + '[CLASS*="ast-footer-button-"][data-section^="section-fb-button-"]' => array( + 'justify-content' => 'center', + ), + '.site-footer-focus-item[CLASS*="ast-footer-button-"]' => array( + 'display' => 'flex', + ), + ); + return astra_parse_css( $static_css ) . $dynamic_css; + } + + return $dynamic_css; +} diff --git a/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..8d1e5a6 --- /dev/null +++ b/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var i=".ast-footer-copyright",e=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544;astra_css("astra-settings[footer-copyright-color]","color",i),astra_responsive_font_size("astra-settings[font-size-section-footer-copyright]",i),wp.customize("astra-settings[footer-copyright-alignment]",function(t){t.bind(function(t){var o;""==t.desktop&&""==t.tablet&&""==t.mobile||(o="",o+=".ast-footer-copyright {",o+="text-align: "+t.desktop+";",o+="} ",o+="@media (max-width: "+e+"px) {",o+=".ast-footer-copyright {",o+="text-align: "+t.tablet+";",o+="} ",o+="} ",o+="@media (max-width: "+a+"px) {",o+=".ast-footer-copyright {",o+="text-align: "+t.mobile+";",o+="} ",o+="} ",astra_add_dynamic_css("footer-copyright-alignment",o))})}),wp.customize("astra-settings[section-footer-copyright-margin]",function(t){t.bind(function(t){var 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+=i+" {",o+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",o+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",o+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",o+="} ",o+="@media (max-width: "+e+"px) {",o+=i+" {",o+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",o+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",o+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",o+="} ",o+="} ",o+="@media (max-width: "+a+"px) {",o+=i+" {",o+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",o+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",o+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",o+="} ",o+="} ",astra_add_dynamic_css("footer-copyright-margin",o))})}),astra_builder_visibility_css("section-footer-copyright",".ast-footer-copyright.ast-builder-layout-element")}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..4a70418 --- /dev/null +++ b/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js @@ -0,0 +1,98 @@ +/** + * 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( $ ) { + + var selector = '.ast-footer-copyright'; + var visibility_selector = '.ast-footer-copyright.ast-builder-layout-element'; + + var tablet_break_point = astraBuilderPreview.tablet_break_point || 768, + mobile_break_point = astraBuilderPreview.mobile_break_point || 544; + + // HTML color. + astra_css( + 'astra-settings[footer-copyright-color]', + 'color', + selector + ); + + // Typography CSS Generation. + astra_responsive_font_size( + 'astra-settings[font-size-section-footer-copyright]', + selector + ); + + wp.customize( 'astra-settings[footer-copyright-alignment]', function( value ) { + value.bind( function( alignment ) { + if( alignment.desktop != '' || alignment.tablet != '' || alignment.mobile != '' ) { + var dynamicStyle = ''; + dynamicStyle += '.ast-footer-copyright {'; + dynamicStyle += 'text-align: ' + alignment['desktop'] + ';'; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += '.ast-footer-copyright {'; + dynamicStyle += 'text-align: ' + alignment['tablet'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += '.ast-footer-copyright {'; + dynamicStyle += 'text-align: ' + alignment['mobile'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + astra_add_dynamic_css( 'footer-copyright-alignment', dynamicStyle ); + } + } ); + } ); + + // Margin. + wp.customize( 'astra-settings[section-footer-copyright-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 += 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( 'footer-copyright-margin', dynamicStyle ); + } + } ); + } ); + + // Advanced Visibility CSS Generation. + astra_builder_visibility_css( 'section-footer-copyright', visibility_selector ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php new file mode 100644 index 0000000..cf69a0f --- /dev/null +++ b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php @@ -0,0 +1,52 @@ + array( + 'text-align' => $desktop_alignment, + ), + $selector => array( + 'color' => astra_get_option( 'footer-copyright-color' ), + // 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( + '.ast-footer-copyright' => array( + 'text-align' => $tablet_alignment, + ), + $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( + '.ast-footer-copyright' => array( + 'text-align' => $mobile_alignment, + ), + $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 ); + + $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $visibility_selector ); + + return $dynamic_css; +} diff --git a/inc/builder/type/footer/html/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/html/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..08c135c --- /dev/null +++ b/inc/builder/type/footer/html/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var i=AstraBuilderHTMLData.tablet_break_point||768,o=AstraBuilderHTMLData.mobile_break_point||544;astra_builder_html_css("footer",AstraBuilderHTMLData.component_limit);for(var t=1;t<=AstraBuilderHTMLData.component_limit;t++)!function(a){wp.customize("astra-settings[footer-html-"+a+"-alignment]",function(t){t.bind(function(t){var e;""==t.desktop&&""==t.tablet&&""==t.mobile||(e="",e+='.footer-widget-area[data-section="section-fb-html-'+a+'"] .ast-builder-html-element {',e+="text-align: "+t.desktop+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+='.footer-widget-area[data-section="section-fb-html-'+a+'"] .ast-builder-html-element {',e+="text-align: "+t.tablet+";",e+="} ",e+="} ",e+="@media (max-width: "+o+"px) {",e+='.footer-widget-area[data-section="section-fb-html-'+a+'"] .ast-builder-html-element {',e+="text-align: "+t.mobile+";",e+="} ",e+="} ",astra_add_dynamic_css("footer-html-"+a+"-alignment",e))})})}(t)}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/html/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/html/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..f437ab2 --- /dev/null +++ b/inc/builder/type/footer/html/assets/js/unminified/customizer-preview.js @@ -0,0 +1,47 @@ +/** + * 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( $ ) { + + var tablet_break_point = AstraBuilderHTMLData.tablet_break_point || 768, + mobile_break_point = AstraBuilderHTMLData.mobile_break_point || 544; + + astra_builder_html_css( 'footer', AstraBuilderHTMLData.component_limit ); + + for( var index = 1; index <= AstraBuilderHTMLData.component_limit ; index++ ) { + (function( index ) { + wp.customize( 'astra-settings[footer-html-'+ index +'-alignment]', function( value ) { + value.bind( function( alignment ) { + if( alignment.desktop != '' || alignment.tablet != '' || alignment.mobile != '' ) { + var dynamicStyle = ''; + dynamicStyle += '.footer-widget-area[data-section="section-fb-html-'+ index +'"] .ast-builder-html-element {'; + dynamicStyle += 'text-align: ' + alignment['desktop'] + ';'; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += '.footer-widget-area[data-section="section-fb-html-'+ index +'"] .ast-builder-html-element {'; + dynamicStyle += 'text-align: ' + alignment['tablet'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += '.footer-widget-area[data-section="section-fb-html-'+ index +'"] .ast-builder-html-element {'; + dynamicStyle += 'text-align: ' + alignment['mobile'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + astra_add_dynamic_css( 'footer-html-'+ index +'-alignment', dynamicStyle ); + } + } ); + } ); + })( index ); + } + +} )( jQuery ); diff --git a/inc/builder/type/footer/html/class-astra-footer-html-component-loader.php b/inc/builder/type/footer/html/class-astra-footer-html-component-loader.php new file mode 100644 index 0000000..dedd754 --- /dev/null +++ b/inc/builder/type/footer/html/class-astra-footer-html-component-loader.php @@ -0,0 +1,62 @@ + defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_html, + '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_Footer_Html_Component_Loader(); diff --git a/inc/builder/type/footer/html/class-astra-footer-html-component.php b/inc/builder/type/footer/html/class-astra-footer-html-component.php new file mode 100644 index 0000000..296beb0 --- /dev/null +++ b/inc/builder/type/footer/html/class-astra-footer-html-component.php @@ -0,0 +1,45 @@ + array( + 'text-align' => $desktop_alignment, + ), + ); + + $css_output_tablet = array( + $selector . ' .ast-builder-html-element' => array( + 'text-align' => $tablet_alignment, + ), + ); + + $css_output_mobile = array( + $selector . ' .ast-builder-html-element' => array( + 'text-align' => $mobile_alignment, + ), + ); + + /* 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; + } + + if ( true === $static_css_flg ) { + $stati_css_output .= astra_parse_css( + array( + '.footer-widget-area[data-section^="section-fb-html-"] .ast-builder-html-element' => array( + 'text-align' => 'center', + ), + ) + ); + } + return $stati_css_output . $dynamic_css; +} diff --git a/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..b15bb4b --- /dev/null +++ b/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var o="#astra-footer-menu",i=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544;wp.customize("astra-settings[footer-menu-alignment]",function(t){t.bind(function(t){var e;""==t.desktop&&""==t.tablet&&""==t.mobile||(e="",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.desktop+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.desktop+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.tablet+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.tablet+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.mobile+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.mobile+";",e+="} ",e+="} ",astra_add_dynamic_css("footer-menu-alignment",e))})}),astra_responsive_font_size("astra-settings[footer-menu-font-size]",o+" .menu-item > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-color-responsive]","color",o+" .menu-item > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-h-color-responsive]","color",o+" .menu-item:hover > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-a-color-responsive]","color",o+" .menu-item.current-menu-item > a"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"desktop"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"tablet"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"mobile"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-h-bg-color-responsive]","background",o+" .menu-item:hover > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-a-bg-color-responsive]","background",o+" .menu-item.current-menu-item > a"),wp.customize("astra-settings[footer-main-menu-spacing]",function(t){t.bind(function(t){var 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+=o+" .menu-item > a {",e+="padding-left: "+t.desktop.left+t["desktop-unit"]+";",e+="padding-right: "+t.desktop.right+t["desktop-unit"]+";",e+="padding-top: "+t.desktop.top+t["desktop-unit"]+";",e+="padding-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+=o+" .menu-item > a {",e+="padding-left: "+t.tablet.left+t["tablet-unit"]+";",e+="padding-right: "+t.tablet.right+t["tablet-unit"]+";",e+="padding-top: "+t.tablet.top+t["tablet-unit"]+";",e+="padding-bottom: "+t.tablet.bottom+t["tablet-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+=o+" .menu-item > a {",e+="padding-left: "+t.mobile.left+t["mobile-unit"]+";",e+="padding-right: "+t.mobile.right+t["mobile-unit"]+";",e+="padding-top: "+t.mobile.top+t["mobile-unit"]+";",e+="padding-bottom: "+t.mobile.bottom+t["mobile-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("footer-menu-spacing",e))})}),wp.customize("astra-settings[section-footer-menu-margin]",function(t){t.bind(function(t){var 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+=o+" {",e+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",e+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",e+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+=o+" {",e+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",e+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",e+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+=o+" {",e+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",e+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",e+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("section-footer-menu-margin",e))})}),astra_builder_visibility_css("section-footer-menu",'.footer-widget-area[data-section="section-footer-menu"]',"block")}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..050aa76 --- /dev/null +++ b/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js @@ -0,0 +1,191 @@ +/** + * 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 selector = '#astra-footer-menu'; + var visibility_selector = '.footer-widget-area[data-section="section-footer-menu"]'; + + var tablet_break_point = astraBuilderPreview.tablet_break_point || 768, + mobile_break_point = astraBuilderPreview.mobile_break_point || 544; + + wp.customize( 'astra-settings[footer-menu-alignment]', function( value ) { + value.bind( function( alignment ) { + if( alignment.desktop != '' || alignment.tablet != '' || alignment.mobile != '' ) { + var dynamicStyle = ''; + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {'; + dynamicStyle += 'align-items: ' + alignment['desktop'] + ';'; + dynamicStyle += '} '; + + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {'; + dynamicStyle += 'justify-content: ' + alignment['desktop'] + ';'; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {'; + dynamicStyle += 'align-items: ' + alignment['tablet'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {'; + dynamicStyle += 'justify-content: ' + alignment['tablet'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {'; + dynamicStyle += 'align-items: ' + alignment['mobile'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {'; + dynamicStyle += 'justify-content: ' + alignment['mobile'] + ';'; + dynamicStyle += '} '; + dynamicStyle += '} '; + + astra_add_dynamic_css( 'footer-menu-alignment', dynamicStyle ); + } + } ); + } ); + + /** + * Typography CSS. + */ + astra_responsive_font_size( + 'astra-settings[footer-menu-font-size]', + selector + ' .menu-item > a' + ); + + /** + * Menu - Colors + */ + astra_color_responsive_css( + 'astra-footer-menu-preview', + 'astra-settings[footer-menu-color-responsive]', + 'color', + selector + ' .menu-item > a' + ); + + // Menu - Hover Color + astra_color_responsive_css( + 'astra-footer-menu-preview', + 'astra-settings[footer-menu-h-color-responsive]', + 'color', + selector + ' .menu-item:hover > a' + ); + + // Menu - Active Color + astra_color_responsive_css( + 'astra-footer-menu-preview', + 'astra-settings[footer-menu-a-color-responsive]', + 'color', + selector + ' .menu-item.current-menu-item > a' + ); + + // Responsive BG styles > Footer Menu. + astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'desktop' ); + astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'tablet' ); + astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'mobile' ); + + // Menu - Hover Background + astra_color_responsive_css( + 'astra-footer-menu-preview', + 'astra-settings[footer-menu-h-bg-color-responsive]', + 'background', + selector + ' .menu-item:hover > a' + ); + + // Menu - Active Background + astra_color_responsive_css( + 'astra-footer-menu-preview', + 'astra-settings[footer-menu-a-bg-color-responsive]', + 'background', + selector + ' .menu-item.current-menu-item > a' + ); + + /** + * Spacing CSS. + */ + wp.customize( 'astra-settings[footer-main-menu-spacing]', 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 += selector + ' .menu-item > a {'; + 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 += selector + ' .menu-item > a {'; + 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 += selector + ' .menu-item > a {'; + 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( 'footer-menu-spacing', dynamicStyle ); + } + } ); + } ); + + // Margin. + wp.customize( 'astra-settings[section-footer-menu-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 += 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-footer-menu-margin', dynamicStyle ); + } + } ); + } ); + + // Advanced Visibility CSS Generation. + astra_builder_visibility_css( 'section-footer-menu', visibility_selector, 'block' ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php b/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php new file mode 100644 index 0000000..c4d0355 --- /dev/null +++ b/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php @@ -0,0 +1,52 @@ +). + * + * @since 3.0.0 + * @var Array + */ + $menu_classes = apply_filters( 'astra_menu_classes', array( 'ast-nav-menu', 'ast-flex', $desktop_menu_layout_class, $tablet_menu_layout_class, $mobile_menu_layout_class ) ); + + $items_wrap = ''; + + // 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. + if ( has_nav_menu( 'footer_menu' ) ) { + wp_nav_menu( + array( + 'depth' => 1, + 'menu_id' => 'astra-footer-menu', + 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ), + 'container' => 'div', + 'container_class' => 'footer-bar-navigation', + 'items_wrap' => $items_wrap, + 'theme_location' => 'footer_menu', + ) + ); + } + } +} + +/** + * Kicking this off by creating an object. + */ +new Astra_Footer_Menu_Component(); diff --git a/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php b/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php new file mode 100644 index 0000000..1686dc8 --- /dev/null +++ b/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php @@ -0,0 +1,291 @@ + 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' ), + ); + + $arr_footer_ul_desktop = array_merge( $arr_footer_ul_desktop, astra_get_responsive_background_obj( $menu_resp_bg_color, 'desktop' ) ); + + $css_output_desktop = array( + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu' => array( + 'justify-content' => $desktop_alignment, + ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item' => array( + 'align-items' => $desktop_alignment, + ), + $selector . ' .menu-item > a' => array( + 'color' => $menu_resp_color_desktop, + 'font-size' => astra_get_font_css_value( $menu_font_size_desktop, $menu_font_size_desktop_unit ), + 'padding-top' => astra_get_css_value( $menu_desktop_spacing_top, $menu_desktop_spacing_unit ), + 'padding-bottom' => astra_get_css_value( $menu_desktop_spacing_bottom, $menu_desktop_spacing_unit ), + 'padding-left' => astra_get_css_value( $menu_desktop_spacing_left, $menu_desktop_spacing_unit ), + 'padding-right' => astra_get_css_value( $menu_desktop_spacing_right, $menu_desktop_spacing_unit ), + ), + $selector . ' .menu-item:hover > a' => array( + 'color' => $menu_resp_color_hover_desktop, + 'background' => $menu_resp_bg_color_hover_desktop, + ), + $selector . ' .menu-item.current-menu-item > a' => array( + 'color' => $menu_resp_color_active_desktop, + 'background' => $menu_resp_bg_color_active_desktop, + ), + $selector => $arr_footer_ul_desktop, + ); + + $arr_footer_ul_tablet = 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' ), + ); + + $arr_footer_ul_tablet = array_merge( $arr_footer_ul_tablet, astra_get_responsive_background_obj( $menu_resp_bg_color, 'tablet' ) ); + + $css_output_tablet = array( + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-horizontal-menu' => array( + 'justify-content' => $tablet_alignment, + ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-vertical-menu' => array( + 'display' => 'grid', + ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-vertical-menu .menu-item' => array( + 'align-items' => $tablet_alignment, + ), + $selector . ' .menu-item > a' => array( + 'color' => $menu_resp_color_tablet, + 'font-size' => astra_get_font_css_value( $menu_font_size_tablet, $menu_font_size_tablet_unit ), + 'padding-top' => astra_get_css_value( $menu_tablet_spacing_top, $menu_tablet_spacing_unit ), + 'padding-bottom' => astra_get_css_value( $menu_tablet_spacing_bottom, $menu_tablet_spacing_unit ), + 'padding-left' => astra_get_css_value( $menu_tablet_spacing_left, $menu_tablet_spacing_unit ), + 'padding-right' => astra_get_css_value( $menu_tablet_spacing_right, $menu_tablet_spacing_unit ), + ), + $selector . ' .menu-item:hover > a' => array( + 'color' => $menu_resp_color_hover_tablet, + 'background' => $menu_resp_bg_color_hover_tablet, + ), + $selector . ' .menu-item.current-menu-item > a' => array( + 'color' => $menu_resp_color_active_tablet, + 'background' => $menu_resp_bg_color_active_tablet, + ), + $selector => $arr_footer_ul_tablet, + ); + + $arr_footer_ul_mobile = 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' ), + ); + + $arr_footer_ul_mobile = array_merge( $arr_footer_ul_mobile, astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ) ); + + $css_output_mobile = array( + $selector => astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-horizontal-menu' => array( + 'justify-content' => $mobile_alignment, + ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-vertical-menu' => array( + 'display' => 'grid', + ), + '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-vertical-menu .menu-item' => array( + 'align-items' => $mobile_alignment, + ), + $selector . ' .menu-item > a' => array( + 'color' => $menu_resp_color_mobile, + 'font-size' => astra_get_font_css_value( $menu_font_size_mobile, $menu_font_size_mobile_unit ), + 'padding-top' => astra_get_css_value( $menu_mobile_spacing_top, $menu_mobile_spacing_unit ), + 'padding-bottom' => astra_get_css_value( $menu_mobile_spacing_bottom, $menu_mobile_spacing_unit ), + 'padding-left' => astra_get_css_value( $menu_mobile_spacing_left, $menu_mobile_spacing_unit ), + 'padding-right' => astra_get_css_value( $menu_mobile_spacing_right, $menu_mobile_spacing_unit ), + ), + $selector . ' .menu-item:hover > a' => array( + 'color' => $menu_resp_color_hover_mobile, + 'background' => $menu_resp_bg_color_hover_mobile, + ), + $selector . ' .menu-item.current-menu-item > a' => array( + 'color' => $menu_resp_color_active_mobile, + 'background' => $menu_resp_bg_color_active_mobile, + ), + $selector => $arr_footer_ul_mobile, + ); + + /* Parse CSS from array() */ + $css_output = footer_menu_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, $visibility_selector, 'block' ); + + return $dynamic_css; +} + +/** + * Footer menu static CSS + * + * @since 3.5.0 + * @return string + */ +function footer_menu_static_css() { + $footer_menu_css = ' + .footer-nav-wrap .astra-footer-vertical-menu { + display: grid; + } + @media (min-width: 769px) { + .footer-nav-wrap .astra-footer-horizontal-menu li { + margin: 0; + } + .footer-nav-wrap .astra-footer-horizontal-menu a { + padding: 0 0.5em; + } + }'; + + if ( is_rtl() ) { + $footer_menu_css .= ' + @media (min-width: 769px) { + .footer-nav-wrap .astra-footer-horizontal-menu li:first-child a { + padding-right: 0; + } + .footer-nav-wrap .astra-footer-horizontal-menu li:last-child a { + padding-left: 0; + } + }'; + } else { + $footer_menu_css .= ' + @media (min-width: 769px) { + .footer-nav-wrap .astra-footer-horizontal-menu li:first-child a { + padding-left: 0; + } + .footer-nav-wrap .astra-footer-horizontal-menu li:last-child a { + padding-right: 0; + } + }'; + } + return Astra_Enqueue_Scripts::trim_css( $footer_menu_css ); +} diff --git a/inc/builder/type/footer/primary-footer/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/primary-footer/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..34b93c8 --- /dev/null +++ b/inc/builder/type/footer/primary-footer/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +!function(){var s=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544,t="section-primary-footer-builder",e='.site-primary-footer-wrap[data-section="section-primary-footer-builder"]';wp.customize("astra-settings[hb-footer-layout-width]",function(t){t.bind(function(t){var r="";"content"==t&&(r=e+" .ast-builder-grid-row {",r+="max-width: "+AstraBuilderPrimaryFooterData.footer_content_width+"px;",r+="margin-left: auto;",r+="margin-right: auto;",r+="} "),"full"==t&&(r=e+" .ast-builder-grid-row {",r+="max-width: 100%;",r+="padding-right: 35px; padding-left: 35px;",r+="} "),astra_add_dynamic_css("hb-footer-layout-width",r)})}),astra_css("astra-settings[hb-footer-vertical-alignment]","align-items",e+" .ast-builder-grid-row, "+e+" .site-footer-section"),wp.customize("astra-settings[hb-inner-spacing]",function(t){t.bind(function(t){var r="";""!=t.desktop&&(r+=e+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.desktop+"px;",r+="} "),""!=t.tablet&&(r+="@media (max-width: "+s+"px) {",r+=e+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.tablet+"px;",r+="grid-row-gap: "+t.tablet+"px;",r+="} ",r+="} "),""!=t.mobile&&(r+="@media (max-width: "+a+"px) {",r+=e+" .ast-builder-grid-row {",r+="grid-column-gap: "+t.mobile+"px;",r+="grid-row-gap: "+t.mobile+"px;",r+="} ",r+="} "),astra_add_dynamic_css("hb-inner-spacing-toggle-button",r)})}),astra_css("astra-settings[hb-footer-main-sep]","border-top-width",e,"px"),astra_css("astra-settings[hb-footer-main-sep-color]","border-color",e);astra_add_dynamic_css("hb-footer-main-sep-color",'.site-primary-footer-wrap[data-section="section-primary-footer-builder"] {border-top-style: solid} '),astra_apply_responsive_background_css("astra-settings[hb-footer-bg-obj-responsive]",e,"desktop"),astra_apply_responsive_background_css("astra-settings[hb-footer-bg-obj-responsive]",e,"tablet"),astra_apply_responsive_background_css("astra-settings[hb-footer-bg-obj-responsive]",e,"mobile"),astra_apply_responsive_background_css("astra-settings[footer-bg-obj-responsive]",".site-footer","desktop"),astra_apply_responsive_background_css("astra-settings[footer-bg-obj-responsive]",".site-footer","tablet"),astra_apply_responsive_background_css("astra-settings[footer-bg-obj-responsive]",".site-footer","mobile"),astra_builder_advanced_css(t,e),astra_builder_advanced_css("section-footer-builder-layout",".ast-hfb-header .site-footer"),astra_builder_visibility_css(t,e,"grid")}(jQuery); \ No newline at end of file diff --git a/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..c0e089a --- /dev/null +++ b/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js @@ -0,0 +1,124 @@ +/** + * 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 section = 'section-primary-footer-builder'; + var selector = '.site-primary-footer-wrap[data-section="section-primary-footer-builder"]'; + + // Primary Header - Layout. + wp.customize( 'astra-settings[hb-footer-layout-width]', function( setting ) { + setting.bind( function( layout ) { + + var dynamicStyle = ''; + + if ( 'content' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: ' + AstraBuilderPrimaryFooterData.footer_content_width + 'px;'; + dynamicStyle += 'margin-left: auto;'; + dynamicStyle += 'margin-right: auto;'; + dynamicStyle += '} '; + } + + if ( 'full' == layout ) { + dynamicStyle = selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'max-width: 100%;'; + dynamicStyle += 'padding-right: 35px; padding-left: 35px;'; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hb-footer-layout-width', dynamicStyle ); + + } ); + } ); + + // Footer Vertical Alignment. + astra_css( + 'astra-settings[hb-footer-vertical-alignment]', + 'align-items', + selector + ' .ast-builder-grid-row, ' + selector + ' .site-footer-section' + ); + + // Inner Space. + wp.customize( 'astra-settings[hb-inner-spacing]', function( value ) { + value.bind( function( spacing ) { + var dynamicStyle = ''; + if ( spacing.desktop != '' ) { + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.desktop + 'px;'; + dynamicStyle += '} '; + } + + if ( spacing.tablet != '' ) { + dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.tablet + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + if ( spacing.mobile != '' ) { + dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; + dynamicStyle += selector + ' .ast-builder-grid-row {'; + dynamicStyle += 'grid-column-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += 'grid-row-gap: ' + spacing.mobile + 'px;'; + dynamicStyle += '} '; + dynamicStyle += '} '; + } + + astra_add_dynamic_css( 'hb-inner-spacing-toggle-button', dynamicStyle ); + } ); + } ); + + // Border Top width. + astra_css( + 'astra-settings[hb-footer-main-sep]', + 'border-top-width', + selector, + 'px' + ); + + // Border Color. + astra_css( + 'astra-settings[hb-footer-main-sep-color]', + 'border-color', + selector + ); + + var dynamicStyle = selector + ' {'; + dynamicStyle += 'border-top-style: solid'; + dynamicStyle += '} '; + + astra_add_dynamic_css( 'hb-footer-main-sep-color', dynamicStyle ); + + // Responsive BG styles > Primary Footer Row. + astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'desktop' ); + astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'tablet' ); + astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'mobile' ); + + // Responsive BG styles > Global Footer Row. + astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'desktop' ); + astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'tablet' ); + astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'mobile' ); + + // Advanced CSS Generation. + astra_builder_advanced_css( section, selector ); + + // Advanced CSS for Header Builder. + astra_builder_advanced_css( 'section-footer-builder-layout', '.ast-hfb-header .site-footer' ); + + // Advanced Visibility CSS Generation. + astra_builder_visibility_css( section, selector, 'grid' ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/primary-footer/class-astra-primary-footer-component-loader.php b/inc/builder/type/footer/primary-footer/class-astra-primary-footer-component-loader.php new file mode 100644 index 0000000..3e8dbee --- /dev/null +++ b/inc/builder/type/footer/primary-footer/class-astra-primary-footer-component-loader.php @@ -0,0 +1,60 @@ + astra_get_option( 'site-content-width' ), + ) + ); + } +} + +/** +* Kicking this off by creating the object of the class. +*/ +new Astra_Primary_Footer_Component_Loader(); diff --git a/inc/builder/type/footer/primary-footer/class-astra-primary-footer.php b/inc/builder/type/footer/primary-footer/class-astra-primary-footer.php new file mode 100644 index 0000000..6a2b92c --- /dev/null +++ b/inc/builder/type/footer/primary-footer/class-astra-primary-footer.php @@ -0,0 +1,50 @@ + astra_get_responsive_background_obj( $global_footer_bg, 'desktop' ), + ); + + $dynamic_css .= astra_parse_css( $css_output_desktop ); + // Advanced CSS for Header Builder. + $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( 'section-footer-builder-layout', '.ast-hfb-header .site-footer' ); + + if ( ! ( Astra_Builder_Helper::is_footer_row_empty( 'primary' ) || is_customize_preview() ) ) { + return $dynamic_css; + } + + $_section = 'section-primary-footer-builder'; + + $selector = '.site-primary-footer-wrap[data-section="section-primary-footer-builder"]'; + + $footer_bg = astra_get_option( 'hb-footer-bg-obj-responsive' ); + $footer_top_border_size = astra_get_option( 'hb-footer-main-sep' ); + $footer_top_border_color = astra_get_option( 'hb-footer-main-sep-color' ); + $footer_width = astra_get_option( 'hb-footer-layout-width' ); + $content_width = astra_get_option( 'site-content-width' ); + $inner_spacing = astra_get_option( 'hb-inner-spacing' ); + + $layout = astra_get_option( 'hb-footer-layout' ); + + $desk_layout = ( isset( $layout['desktop'] ) ) ? $layout['desktop'] : 'full'; + $tab_layout = ( isset( $layout['tablet'] ) ) ? $layout['tablet'] : 'full'; + $mob_layout = ( isset( $layout['mobile'] ) ) ? $layout['mobile'] : 'full'; + + $inner_spacing_desktop = ( isset( $inner_spacing['desktop'] ) ) ? $inner_spacing['desktop'] : ''; + $inner_spacing_tablet = ( isset( $inner_spacing['tablet'] ) ) ? $inner_spacing['tablet'] : ''; + $inner_spacing_mobile = ( isset( $inner_spacing['mobile'] ) ) ? $inner_spacing['mobile'] : ''; + + $css_output_desktop = array( + '.site-primary-footer-wrap' => array( + 'padding-top' => '45px', + 'padding-bottom' => '45px', + ), + $selector => astra_get_responsive_background_obj( $footer_bg, 'desktop' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_desktop, 'px' ), + ), + $selector . ' .ast-builder-grid-row, ' . $selector . ' .site-footer-section' => array( + 'align-items' => astra_get_option( 'hb-footer-vertical-alignment' ), + ), + $selector . '.ast-footer-row-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + '.ast-builder-grid-row-' . $desk_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $desk_layout ], + ), + + ); + + if ( isset( $footer_top_border_size ) && 1 <= $footer_top_border_size ) { + + $css_output_desktop[ $selector ]['border-style'] = 'solid'; + + $css_output_desktop[ $selector ]['border-width'] = '0px'; + + $css_output_desktop[ $selector ]['border-top-width'] = astra_get_css_value( $footer_top_border_size, 'px' ); + + $css_output_desktop[ $selector ]['border-top-color'] = $footer_top_border_color; + } + + if ( isset( $footer_width ) && 'content' === $footer_width ) { + + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = astra_get_css_value( $content_width, 'px' ); + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-left'] = 'auto'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['margin-right'] = 'auto'; + } else { + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['max-width'] = '100%'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-left'] = '35px'; + $css_output_desktop[ $selector . ' .ast-builder-grid-row' ]['padding-right'] = '35px'; + } + + $css_output_tablet = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'tablet' ), + '.site-footer' => astra_get_responsive_background_obj( $global_footer_bg, 'tablet' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_tablet, 'px' ), + ), + $selector . '.ast-footer-row-tablet-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-tablet-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-' . $tab_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $tab_layout ], + ), + ); + $css_output_mobile = array( + + $selector => astra_get_responsive_background_obj( $footer_bg, 'mobile' ), + '.site-footer' => astra_get_responsive_background_obj( $global_footer_bg, 'mobile' ), + $selector . ' .ast-builder-grid-row' => array( + 'grid-column-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + 'grid-row-gap' => astra_get_css_value( $inner_spacing_mobile, 'px' ), + ), + $selector . '.ast-footer-row-mobile-inline .site-footer-section' => array( + 'display' => 'flex', + 'margin-bottom' => '0', + ), + $selector . '.ast-footer-row-mobile-stack .site-footer-section' => array( + 'display' => 'block', + 'margin-bottom' => '10px', + ), + '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-' . $mob_layout . ' .ast-builder-grid-row' => array( + 'grid-template-columns' => Astra_Builder_Helper::$grid_size_mapping[ $mob_layout ], + ), + ); + + /* 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_margin_padding_css( $_section, $selector ); + + $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector, 'grid' ); + + return $dynamic_css; +} diff --git a/inc/builder/type/footer/social-icon/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/social-icon/assets/js/minified/customizer-preview.min.js new file mode 100644 index 0000000..8ca4a0a --- /dev/null +++ b/inc/builder/type/footer/social-icon/assets/js/minified/customizer-preview.min.js @@ -0,0 +1 @@ +jQuery,astra_builder_social_css("footer",astraBuilderFooterSocial.component_limit); \ No newline at end of file diff --git a/inc/builder/type/footer/social-icon/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/social-icon/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..5658cac --- /dev/null +++ b/inc/builder/type/footer/social-icon/assets/js/unminified/customizer-preview.js @@ -0,0 +1,15 @@ +/** + * 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( 'footer', astraBuilderFooterSocial.component_limit ); + +} )( jQuery ); diff --git a/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component-loader.php b/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component-loader.php new file mode 100644 index 0000000..408692c --- /dev/null +++ b/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component-loader.php @@ -0,0 +1,62 @@ + 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_footer_social_icons, + ) + ); + } +} + +/** +* Kicking this off by creating the object of the class. +*/ +new Astra_Footer_Social_Icons_Component_Loader(); diff --git a/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component.php b/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component.php new file mode 100644 index 0000000..4890d26 --- /dev/null +++ b/inc/builder/type/footer/social-icon/class-astra-footer-social-icons-component.php @@ -0,0 +1,45 @@ + defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_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_Footer_Widget_Component_Loader(); diff --git a/inc/builder/type/footer/widget/class-astra-footer-widget-component.php b/inc/builder/type/footer/widget/class-astra-footer-widget-component.php new file mode 100644 index 0000000..e1bf09d --- /dev/null +++ b/inc/builder/type/footer/widget/class-astra-footer-widget-component.php @@ -0,0 +1,45 @@ + array( + 'text-align' => $desktop_alignment, + ), + ); + $css_output_tablet = array( + $footer_widget_selector => array( + 'text-align' => $tablet_alignment, + ), + ); + $css_output_mobile = array( + $footer_widget_selector => array( + 'text-align' => $mobile_alignment, + ), + ); + + /* 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_Widget_Component_Dynamic_CSS::astra_widget_dynamic_css( 'footer' ); + } + + return $dynamic_css; +} -- cgit v1.2.3-60-g2f50