diff options
author | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
commit | 9d4123cee1867ee7199b06bdc92d40611f547ecc (patch) | |
tree | 6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/footer/below-footer | |
download | blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2 blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip |
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/footer/below-footer')
5 files changed, 397 insertions, 0 deletions
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 @@ +<?php +/** + * Below Footer Styling Loader for Astra theme. + * + * @package Astra Builder + * @author Brainstorm Force + * @copyright Copyright (c) 2020, Brainstorm Force + * @link https://www.brainstormforce.com + * @since Astra 3.0.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +/** + * Below Footer Initialization + * + * @since 3.0.0 + */ +class Astra_Below_Footer_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-footer-below-footer-customizer-preview-js', ASTRA_BUILDER_FOOTER_BELOW_FOOTER_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_Footer_Component_Loader(); diff --git a/inc/builder/type/footer/below-footer/class-astra-below-footer.php b/inc/builder/type/footer/below-footer/class-astra-below-footer.php new file mode 100644 index 0000000..e9ff993 --- /dev/null +++ b/inc/builder/type/footer/below-footer/class-astra-below-footer.php @@ -0,0 +1,49 @@ +<?php +/** + * Below Footer component. + * + * @package Astra Builder + * @author Brainstorm Force + * @copyright Copyright (c) 2020, Brainstorm Force + * @link https://www.brainstormforce.com + * @since Astra 3.0.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +define( 'ASTRA_BUILDER_FOOTER_BELOW_FOOTER_DIR', ASTRA_THEME_DIR . 'inc/builder/type/footer/below-footer' ); +define( 'ASTRA_BUILDER_FOOTER_BELOW_FOOTER_URI', ASTRA_THEME_URI . 'inc/builder/type/footer/below-footer' ); + +if ( ! class_exists( 'Astra_Below_Footer' ) ) { + + /** + * Below Footer Initial Setup + * + * @since 3.0.0 + */ + class Astra_Below_Footer { + + /** + * Constructor function that initializes required actions and hooks + */ + public function __construct() { + + // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once ASTRA_BUILDER_FOOTER_BELOW_FOOTER_DIR . '/class-astra-below-footer-component-loader.php'; + + // Include front end files. + if ( ! is_admin() ) { + require_once ASTRA_BUILDER_FOOTER_BELOW_FOOTER_DIR . '/dynamic-css/dynamic.css.php'; + } + // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + } + } + + /** + * Kicking this off by creating an object. + */ + new Astra_Below_Footer(); + +} diff --git a/inc/builder/type/footer/below-footer/dynamic-css/dynamic.css.php b/inc/builder/type/footer/below-footer/dynamic-css/dynamic.css.php new file mode 100644 index 0000000..7427eb8 --- /dev/null +++ b/inc/builder/type/footer/below-footer/dynamic-css/dynamic.css.php @@ -0,0 +1,153 @@ +<?php +/** + * Below Footer control - Dynamic CSS + * + * @package Astra Builder + * @since 3.0.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +/** + * Below Footer CSS + */ +add_filter( 'astra_dynamic_theme_css', 'astra_fb_below_footer_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 below Footer. + * + * @since 3.0.0 + */ +function astra_fb_below_footer_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { + + if ( ! ( Astra_Builder_Helper::is_footer_row_empty( 'below' ) || is_customize_preview() ) ) { + return $dynamic_css; + } + + $_section = 'section-below-footer-builder'; + + $selector = '.site-below-footer-wrap[data-section="section-below-footer-builder"]'; + + $footer_bg = astra_get_option( 'hbb-footer-bg-obj-responsive' ); + $footer_height = astra_get_option( 'hbb-footer-height' ); + $footer_top_border_size = astra_get_option( 'hbb-footer-separator' ); + $footer_top_border_color = astra_get_option( 'hbb-footer-top-border-color' ); + $footer_width = astra_get_option( 'hbb-footer-layout-width' ); + $content_width = astra_get_option( 'site-content-width' ); + $inner_spacing = astra_get_option( 'hbb-inner-spacing' ); + + $layout = astra_get_option( 'hbb-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-below-footer-wrap' => 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; +} |