first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,179 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$highLight_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'highLight' );
$enable_legacy_blocks = UAGB_Admin_Helper::get_admin_settings_option( 'uag_enable_legacy_blocks' );
$heading_alignment_default = ( 'yes' === get_option( 'uagb-old-user-less-than-2' ) ) ? 'center' : '';
$subheading_toggle_default = 'yes' === get_option( 'uagb-old-user-less-than-2' );
return array_merge(
$highLight_border_attribute,
array(
'classMigrate' => false,
'blockBackground' => '',
'blockBackgroundType' => 'classic',
'blockGradientBackground' => 'linear-gradient(90deg, rgb(6, 147, 227) 0%, rgb(155, 81, 224) 100%)',
'headingAlign' => $heading_alignment_default,
'headingAlignTablet' => '',
'headingDescPosition' => 'below-heading',
'seperatorPosition' => 'below-heading',
'headingAlignMobile' => '',
'headingColor' => '',
'headingColorType' => 'classic',
'headingGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)',
'subHeadingColor' => '',
'separatorHeightType' => 'px',
'separatorSpaceType' => 'px',
'separatorColor' => '#0170b9',
'seperatorStyle' => 'none',
'separatorHeight' => 2,
'separatorWidth' => 12,
'separatorWidthTablet' => '',
'separatorWidthMobile' => '',
'separatorWidthType' => '%',
'headFontFamily' => '',
'headLoadGoogleFonts' => false,
'headFontWeight' => '',
'headFontStyle' => '',
'headFontSize' => '',
'headFontSizeType' => 'px',
'headFontSizeTypeTablet' => 'px',
'headFontSizeTypeMobile' => 'px',
'headFontSizeTablet' => '',
'headFontSizeMobile' => '',
'headSpaceType' => 'px',
'headLineHeight' => '',
'headLineHeightType' => 'em',
'headLineHeightTablet' => '',
'headLineHeightMobile' => '',
'headLetterSpacing' => '',
'headLetterSpacingTablet' => '',
'headLetterSpacingMobile' => '',
'headLetterSpacingType' => 'px',
'headShadowColor' => '',
'headShadowHOffset' => 0,
'headShadowVOffset' => 0,
'headShadowBlur' => 10,
'subHeadFontFamily' => '',
'subHeadLoadGoogleFonts' => false,
'subHeadFontWeight' => '',
'subHeadFontStyle' => '',
'subHeadFontSize' => '',
'subHeadFontSizeType' => 'px',
'subHeadFontSizeTypeTablet' => 'px',
'subHeadFontSizeTypeMobile' => 'px',
'subHeadFontSizeTablet' => '',
'subHeadFontSizeMobile' => '',
'subHeadLineHeight' => '',
'subHeadLineHeightType' => 'em',
'subHeadLineHeightTablet' => '',
'subHeadLineHeightMobile' => '',
'subHeadLetterSpacing' => '',
'subHeadLetterSpacingTablet' => '',
'subHeadLetterSpacingMobile' => '',
'subHeadLetterSpacingType' => 'px',
'headSpace' => 15,
'headSpaceTablet' => '',
'headSpaceMobile' => '',
'separatorSpace' => 15,
'separatorSpaceTablet' => '',
'separatorSpaceMobile' => '',
'separatorHoverColor' => '',
'headTransform' => '',
'headDecoration' => '',
'subHeadTransform' => '',
'subHeadDecoration' => '',
// padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
'blockPaddingLink' => '',
// margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
'blockMarginLink' => '',
// link.
'linkColor' => '',
'linkHColor' => '',
// Highlight.
'highLightColor' => '#fff',
'highLightBackground' => '#007cba',
'highLightLoadGoogleFonts' => false,
'highLightFontFamily' => 'Default',
'highLightFontWeight' => 'Default',
'highLightFontStyle' => 'normal',
'highLightTransform' => '',
'highLightDecoration' => '',
'highLightFontSizeType' => 'px',
'highLightFontSizeTypeTablet' => 'px',
'highLightFontSizeTypeMobile' => 'px',
'highLightLineHeightType' => 'em',
'highLightFontSize' => '',
'highLightFontSizeTablet' => '',
'highLightFontSizeMobile' => '',
'highLightLineHeight' => '',
'highLightLineHeightTablet' => '',
'highLightLineHeightMobile' => '',
'highLightLetterSpacing' => '',
'highLightLetterSpacingTablet' => '',
'highLightLetterSpacingMobile' => '',
'highLightLetterSpacingType' => 'px',
'highLightTopPadding' => '',
'highLightRightPadding' => '',
'highLightLeftPadding' => '',
'highLightBottomPadding' => '',
'highLightTopPaddingTablet' => '',
'highLightRightPaddingTablet' => '',
'highLightLeftPaddingTablet' => '',
'highLightBottomPaddingTablet' => '',
'highLightTopPaddingMobile' => '',
'highLightRightPaddingMobile' => '',
'highLightLeftPaddingMobile' => '',
'highLightBottomPaddingMobile' => '',
'highLightPaddingUnit' => 'px',
'highLightPaddingUnitTablet' => 'px',
'highLightPaddingUnitMobile' => 'px',
'highLightPaddingLink' => '',
'subHeadSpace' => 15,
'subHeadSpaceMobile' => '',
'subHeadSpaceTablet' => '',
'subHeadSpaceType' => 'px',
'headingDescToggle' => $subheading_toggle_default,
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
)
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/advanced-heading';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'content', 'core' ),
'link' => 'advanced-heading',
'doc' => 'advanced-heading',
'title' => __( 'Heading', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add heading, sub heading and a separator using one block.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'advanced-heading' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'advanced-heading',
),
);

View File

@@ -0,0 +1,292 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Add fonts.
UAGB_Block_JS::blocks_advanced_heading_gfont( $attr );
$m_selectors = array();
$t_selectors = array();
$highLight_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'highLight' );
$highLight_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'highLight', 'tablet' );
$highLight_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'highLight', 'mobile' );
$selectors = array(
'.wp-block-uagb-advanced-heading .uagb-heading-text' => array(
'color' => $attr['headingColor'],
),
'.wp-block-uagb-advanced-heading ' => array(
'background' => 'classic' === $attr['blockBackgroundType'] ? $attr['blockBackground'] : $attr['blockGradientBackground'],
'text-align' => $attr['headingAlign'],
'margin-top' => UAGB_Helper::get_css_value(
$attr['blockTopMargin'],
$attr['blockMarginUnit']
),
'margin-right' => UAGB_Helper::get_css_value(
$attr['blockRightMargin'],
$attr['blockMarginUnit']
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomMargin'],
$attr['blockMarginUnit']
),
'margin-left' => UAGB_Helper::get_css_value(
$attr['blockLeftMargin'],
$attr['blockMarginUnit']
),
'padding-top' => UAGB_Helper::get_css_value(
$attr['blockTopPadding'],
$attr['blockPaddingUnit']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['blockRightPadding'],
$attr['blockPaddingUnit']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomPadding'],
$attr['blockPaddingUnit']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['blockLeftPadding'],
$attr['blockPaddingUnit']
),
),
'.wp-block-uagb-advanced-heading a' => array(
'color' => $attr['linkColor'],
),
'.wp-block-uagb-advanced-heading a:hover' => array(
'color' => $attr['linkHColor'],
),
'.wp-block-uagb-advanced-heading .uagb-desc-text' => array(
'color' => $attr['subHeadingColor'],
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['subHeadSpace'],
'px'
),
),
'.wp-block-uagb-advanced-heading .uagb-highlight' => array_merge(
array(
'background' => $attr['highLightBackground'],
'color' => $attr['highLightColor'],
'-webkit-text-fill-color' => $attr['highLightColor'],
'font-family' => $attr['highLightFontFamily'],
'font-style' => $attr['highLightFontStyle'],
'text-decoration' => $attr['highLightDecoration'],
'text-transform' => $attr['highLightTransform'],
'font-weight' => $attr['highLightFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['highLightFontSize'], $attr['highLightFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['highLightLineHeight'], $attr['highLightLineHeightType'] ),
'padding-top' => UAGB_Helper::get_css_value(
$attr['highLightTopPadding'],
$attr['highLightPaddingUnit']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['highLightRightPadding'],
$attr['highLightPaddingUnit']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['highLightBottomPadding'],
$attr['highLightPaddingUnit']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['highLightLeftPadding'],
$attr['highLightPaddingUnit']
),
),
$highLight_border_css
),
'.wp-block-uagb-advanced-heading .uagb-highlight:hover' => array(
'border-color' => $attr['highLightBorderHColor'],
),
);
$heading_text_shadow_color = ( ! empty( $attr['headShadowColor'] ) ? UAGB_Helper::get_css_value( $attr['headShadowHOffset'], 'px' ) . ' ' . UAGB_Helper::get_css_value( $attr['headShadowVOffset'], 'px' ) . ' ' . UAGB_Helper::get_css_value( $attr['headShadowBlur'], 'px' ) . ' ' . $attr['headShadowColor'] : '' );
if ( 'gradient' === $attr['headingColorType'] ) {
$selectors['.wp-block-uagb-advanced-heading .uagb-heading-text'] = array_merge(
$selectors['.wp-block-uagb-advanced-heading .uagb-heading-text'],
array(
'background' => $attr['headingGradientColor'],
'-webkit-background-clip' => 'text',
'-webkit-text-fill-color' => 'transparent',
'filter' => 'drop-shadow( ' . $heading_text_shadow_color . ' )',
)
);
$selectors['.wp-block-uagb-advanced-heading a'] = array_merge(
$selectors['.wp-block-uagb-advanced-heading a'],
array(
'-webkit-text-fill-color' => $attr['linkColor'],
)
);
$selectors['.wp-block-uagb-advanced-heading a:hover'] = array_merge(
$selectors['.wp-block-uagb-advanced-heading a:hover'],
array(
'-webkit-text-fill-color' => $attr['linkHColor'],
)
);
} else {
$selectors['.wp-block-uagb-advanced-heading .uagb-heading-text'] = array_merge(
$selectors['.wp-block-uagb-advanced-heading .uagb-heading-text'],
array(
'text-shadow' => $heading_text_shadow_color,
)
);
}
// Text Selection & highlight.
$highlightSelectionText = array(
'color' => $attr['highLightColor'],
'background' => $attr['highLightBackground'],
'-webkit-text-fill-color' => $attr['highLightColor'],
);
$selectors['.wp-block-uagb-advanced-heading .uagb-highlight::-moz-selection'] = $highlightSelectionText;
$selectors['.wp-block-uagb-advanced-heading .uagb-highlight::selection'] = $highlightSelectionText;
$seperatorStyle = isset( $attr['seperatorStyle'] ) ? $attr['seperatorStyle'] : '';
if ( 'none' !== $seperatorStyle ) {
$selectors['.wp-block-uagb-advanced-heading .uagb-separator'] = array(
'border-top-style' => $attr['seperatorStyle'],
'border-top-width' => UAGB_Helper::get_css_value(
$attr['separatorHeight'],
$attr['separatorHeightType']
),
'width' => UAGB_Helper::get_css_value(
$attr['separatorWidth'],
$attr['separatorWidthType']
),
'border-color' => $attr['separatorColor'],
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['separatorSpace'],
$attr['separatorSpaceType']
),
);
$t_selectors['.wp-block-uagb-advanced-heading .uagb-separator'] = array(
'width' => UAGB_Helper::get_css_value(
$attr['separatorWidthTablet'],
$attr['separatorWidthType']
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['separatorSpaceTablet'],
$attr['separatorSpaceType']
),
);
$m_selectors['.wp-block-uagb-advanced-heading .uagb-separator'] = array(
'width' => UAGB_Helper::get_css_value(
$attr['separatorWidthMobile'],
$attr['separatorWidthType']
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['separatorSpaceMobile'],
$attr['separatorSpaceType']
),
);
}
$t_selectors['.wp-block-uagb-advanced-heading '] = array(
'text-align' => $attr['headingAlignTablet'],
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginTablet'], $attr['blockMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-advanced-heading .uagb-highlight'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['highLightTopPaddingTablet'], $attr['highLightPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['highLightRightPaddingTablet'], $attr['highLightPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['highLightBottomPaddingTablet'], $attr['highLightPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['highLightLeftPaddingTablet'], $attr['highLightPaddingUnitTablet'] ),
),
$highLight_border_css_tablet
);
$m_selectors['.wp-block-uagb-advanced-heading '] = array(
'text-align' => $attr['headingAlignMobile'],
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginMobile'], $attr['blockMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-advanced-heading .uagb-highlight'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['highLightTopPaddingMobile'], $attr['highLightPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['highLightRightPaddingMobile'], $attr['highLightPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['highLightBottomPaddingMobile'], $attr['highLightPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['highLightLeftPaddingMobile'], $attr['highLightPaddingUnitMobile'] ),
),
$highLight_border_css_mobile
);
$t_selectors['.wp-block-uagb-advanced-heading .uagb-desc-text'] = array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['subHeadSpaceTablet'],
$attr['subHeadSpaceType']
),
);
$m_selectors['.wp-block-uagb-advanced-heading .uagb-desc-text'] = array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['subHeadSpaceMobile'],
$attr['subHeadSpaceType']
),
);
if ( $attr['headingDescToggle'] || 'none' !== $attr['seperatorStyle'] ) {
$selectors[' .uagb-heading-text'] = array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['headSpace'],
'px'
),
);
$t_selectors[' .uagb-heading-text'] = array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['headSpaceTablet'],
$attr['headSpaceType']
),
);
$m_selectors[' .uagb-heading-text'] = array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['headSpaceMobile'],
$attr['headSpaceType']
),
);
}
$combined_selectors = UAGB_Helper::get_combined_selectors(
'advanced-heading',
array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
),
$attr
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'head', ' .uagb-heading-text', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'subHead', ' .uagb-desc-text', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'highLight', '.wp-block-uagb-advanced-heading .uagb-highlight', $combined_selectors );
$base_selector = ( $attr['classMigrate'] ) ? '.wp-block-uagb-advanced-heading.uagb-block-' : '#uagb-adv-heading-';
return UAGB_Helper::generate_all_css(
$combined_selectors,
$base_selector . $id,
isset( $gbs_class ) ? '.wp-block-uagb-advanced-heading' . $gbs_class : ''
);

View File

@@ -0,0 +1,35 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.6.0
*
* @package uagb
*/
$block_slug = 'uagb/animations-extension';
$block_data = array(
'slug' => '',
'title' => __( 'Animations Extension', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add animations to Spectra blocks.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => true,
'attributes' => array(),
'deprecated' => false,
'static_dependencies' => array(
'uagb-aos-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'aos' ),
'dep' => array(),
'type' => 'js',
),
'uagb-aos-css' => array(
'type' => 'css',
),
'uagb-animation-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'spectra-animations' ),
'dep' => array( 'uagb-aos-js' ),
'type' => 'js',
'skipEditor' => true,
),
),
);

View File

@@ -0,0 +1,27 @@
<?php
/**
* Frontend JS File.
*
* @since 2.6.0
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
$animation_data = apply_filters(
'uagb_animation_data',
array(
'UAGAnimationType' => $attr['UAGAnimationType'],
),
$id
);
ob_start();
?>
window.addEventListener( 'load', function() {
UAGBAnimation.init( <?php echo wp_json_encode( $animation_data ); ?> );
} );
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,164 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'classMigrate' => false,
'block_id ' => '',
'skinStyle' => 'border',
'align' => 'left',
'descColor' => '',
'descFontSize' => 18,
'descFontSizeType' => 'px',
'descFontSizeTablet' => '',
'descFontSizeMobile' => '',
'descFontFamily' => '',
'descFontWeight' => '',
'descFontStyle' => 'italic',
'descLineHeightType' => 'em',
'descLineHeight' => 1.5,
'descLineHeightTablet' => '',
'descLineHeightMobile' => '',
'descLoadGoogleFonts' => false,
'descSpace' => 25,
'descSpaceTablet' => 20,
'descSpaceMobile' => 15,
'descSpaceUnit' => 'px',
'author' => 'Author Name',
'authorColor' => '#888888',
'authorFontSize' => '',
'authorFontSizeType' => 'px',
'authorFontSizeTablet' => '',
'authorFontSizeMobile' => '',
'authorFontFamily' => '',
'authorFontWeight' => '',
'authorFontStyle' => '',
'authorLineHeightType' => 'em',
'authorLineHeight' => '',
'authorLineHeightTablet' => '',
'authorLineHeightMobile' => '',
'authorLoadGoogleFonts' => false,
'authorSpace' => 15,
'authorSpaceTablet' => 15,
'authorSpaceMobile' => 15,
'authorImageWidth' => 40,
'authorImageWidthTablet' => 35,
'authorImageWidthMobile' => 30,
'authorImageWidthUnit' => 'px',
'authorImageGap' => 10,
'authorImageGapTablet' => 10,
'authorImageGapMobile' => 10,
'authorImageGapUnit' => 'px',
'authorImgBorderRadius' => 100,
'authorImgBorderRadiusTablet' => 100,
'authorImgBorderRadiusMobile' => 100,
'authorImgPosition' => 'left',
'stack' => 'none',
'enableTweet' => true,
'iconView' => 'icon_text',
'iconSkin' => 'classic',
'tweetLinkColor' => '#1DA1F2',
'tweetBtnColor' => '#fff',
'tweetBtnBgColor' => '#1DA1F2',
'tweetBtnHoverColor' => '',
'tweetBtnBgHoverColor' => '#1DA1F2',
'tweetBtnFontSize' => 15,
'tweetBtnFontSizeType' => 'px',
'tweetBtnFontSizeTablet' => '',
'tweetBtnFontSizeMobile' => '',
'tweetBtnFontFamily' => '',
'tweetBtnFontWeight' => '',
'tweetBtnFontStyle' => '',
'tweetBtnLineHeightType' => 'em',
'tweetBtnLineHeight' => '',
'tweetBtnLineHeightTablet' => '',
'tweetBtnLineHeightMobile' => '',
'tweetBtnLoadGoogleFonts' => false,
'tweetBtnHrPadding' => 10,
'tweetBtnVrPadding' => 10,
'paddingBtnLeftMobile' => '',
'paddingBtnRightMobile' => '',
'paddingBtnTopMobile' => '',
'paddingBtnBottomMobile' => '',
'mobilePaddingBtnUnit' => 'px',
'paddingBtnLeftTablet' => '',
'paddingBtnRightTablet' => '',
'paddingBtnTopTablet' => '',
'paddingBtnBottomTablet' => '',
'paddingBtnUnit' => 'px',
'mobilePaddingBtnUnit' => 'px',
'tabletPaddingBtnUnit' => 'px',
'tabletPaddingBtnUnit' => 'px',
'tweetIconSpacing' => 10,
'tweetIconSpacingUnit' => 'px',
'borderColor' => '#abb8c3',
'borderStyle' => 'solid',
'borderWidth' => 4,
'borderWidthUnit' => 'px',
'borderGap' => 15,
'borderGapTablet' => 15,
'borderGapMobile' => 15,
'borderGapUnit' => 'px',
'verticalPadding' => '',
'verticalPaddingTablet' => '',
'verticalPaddingMobile' => '',
'verticalPaddingUnit' => 'px',
'quoteStyle' => 'style_2',
'quoteColor' => '#3d3d3d',
'quoteSize' => 25,
'quoteSizeType' => 'px',
'quoteSizeTablet' => '',
'quoteSizeMobile' => '',
'quoteTopMargin' => '',
'quoteBottomMargin' => 15,
'quoteLeftMargin' => '',
'quoteRightMargin' => 20,
'quoteTopMarginTablet' => '',
'quoteBottomMarginTablet' => '',
'quoteLeftMarginTablet' => '',
'quoteRightMarginTablet' => '',
'quoteTopMarginMobile' => '',
'quoteBottomMarginMobile' => '',
'quoteLeftMarginMobile' => '',
'quoteRightMarginMobile' => '',
'quoteUnit' => 'px',
'quotetabletUnit' => 'px',
'quotemobileUnit' => 'px',
'quoteBorderRadius' => 100,
'quoteBorderRadiusUnit' => '%',
'quoteBgColor' => '#f4f4f4',
'quoteHoverColor' => '',
'quoteBgHoverColor' => '',
'borderHoverColor' => '',
'iconTargetUrl' => 'current',
'customUrl' => '',
'iconShareVia' => '',
'quotePadding' => 10,
'quotePaddingType' => 'px',
'quotePaddingTablet' => '',
'quotePaddingMobile' => '',
'descTransform' => '',
'authorTransform' => '',
'tweetBtnTransform' => '',
'descDecoration' => '',
'authorDecoration' => '',
'tweetBtnDecoration' => '',
'descriptionText' => 'Click here to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.',
'descLetterSpacing' => '',
'descLetterSpacingTablet' => '',
'descLetterSpacingMobile' => '',
'descLetterSpacingType' => 'px',
'authorLetterSpacing' => '',
'authorLetterSpacingTablet' => '',
'authorLetterSpacingMobile' => '',
'authorLetterSpacingType' => 'px',
'tweetBtnLetterSpacing' => '',
'tweetBtnLetterSpacingTablet' => '',
'tweetBtnLetterSpacingMobile' => '',
'tweetBtnLetterSpacingType' => 'px',
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/blockquote';
$block_data = array(
'doc' => 'blockquote',
'slug' => '',
'admin_categories' => array( 'social' ),
'link' => 'blockquote-legacy',
'title' => __( 'Blockquote', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Display qoutes/quoted texts using blockquote.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'blockquote' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'blockquote',
),
);

View File

@@ -0,0 +1,430 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_blockquote_gfont( $attr );
$tweetBtnPaddingTop = isset( $attr['paddingBtnTop'] ) ? $attr['paddingBtnTop'] : $attr['tweetBtnVrPadding'];
$tweetBtnPaddingBottom = isset( $attr['paddingBtnBottom'] ) ? $attr['paddingBtnBottom'] : $attr['tweetBtnVrPadding'];
$tweetBtnPaddingLeft = isset( $attr['paddingBtnLeft'] ) ? $attr['paddingBtnLeft'] : $attr['tweetBtnHrPadding'];
$tweetBtnPaddingRight = isset( $attr['paddingBtnRight'] ) ? $attr['paddingBtnRight'] : $attr['tweetBtnHrPadding'];
if ( 'center' !== $attr['align'] || 'border' === $attr['skinStyle'] ) {
$attr['authorSpace'] = 0;
$attr['authorSpaceTablet'] = 0;
$attr['authorSpaceMobile'] = 0;
}
// Set align to left for border style.
$text_align = $attr['align'];
if ( 'border' === $attr['skinStyle'] ) {
$text_align = 'left';
}
$selectors = array(
' .uagb-blockquote__content' => array(
'color' => $attr['descColor'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpace'], $attr['descSpaceUnit'] ),
'text-align' => $text_align,
),
' cite.uagb-blockquote__author' => array(
'color' => $attr['authorColor'],
'text-align' => $text_align,
),
' .uagb-blockquote__skin-border blockquote.uagb-blockquote' => array( // for backward compatibility.
'border-color' => $attr['borderColor'],
'border-left-style' => $attr['borderStyle'],
'border-left-width' => UAGB_Helper::get_css_value( $attr['borderWidth'], $attr['borderWidthUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['borderGap'], $attr['borderGapUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['verticalPadding'], $attr['verticalPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['verticalPadding'], $attr['verticalPaddingUnit'] ),
),
'.uagb-blockquote__skin-border blockquote.uagb-blockquote' => array(
'border-color' => $attr['borderColor'],
'border-left-style' => $attr['borderStyle'],
'border-left-width' => UAGB_Helper::get_css_value( $attr['borderWidth'], $attr['borderWidthUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['borderGap'], $attr['borderGapUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['verticalPadding'], $attr['verticalPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['verticalPadding'], $attr['verticalPaddingUnit'] ),
),
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon-wrap' => array( // For Backword.
'background' => $attr['quoteBgColor'],
'border-radius' => UAGB_Helper::get_css_value( $attr['quoteBorderRadius'], '%' ),
'margin-top' => UAGB_Helper::get_css_value( $attr['quoteTopMargin'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['quoteBottomMargin'], 'px' ),
'margin-left' => UAGB_Helper::get_css_value( $attr['quoteLeftMargin'], 'px' ),
'margin-right' => UAGB_Helper::get_css_value( $attr['quoteRightMargin'], 'px' ),
'padding' => UAGB_Helper::get_css_value( $attr['quotePadding'], $attr['quotePaddingType'] ),
),
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon' => array( // For Backword.
'width' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon' => array(
'background' => $attr['quoteBgColor'],
'border-radius' => UAGB_Helper::get_css_value( $attr['quoteBorderRadius'], $attr['quoteBorderRadiusUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['quoteTopMargin'], $attr['quoteUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['quoteBottomMargin'], $attr['quoteUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['quoteLeftMargin'], $attr['quoteUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['quoteRightMargin'], $attr['quoteUnit'] ),
'padding' => UAGB_Helper::get_css_value( $attr['quotePadding'], $attr['quotePaddingType'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
'fill' => $attr['quoteColor'],
),
'.uagb-blockquote__style-style_1 .uagb-blockquote' => array(
'text-align' => $attr['align'],
),
' .uagb-blockquote__author-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['authorSpace'],
'px'
),
),
' .uagb-blockquote__author-wrap img' => array(
'width' => UAGB_Helper::get_css_value( $attr['authorImageWidth'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['authorImageWidth'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['authorImgBorderRadius'], '%' ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-right img' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['authorImageGap'], $attr['authorImageGapUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-top img' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['authorImageGap'], $attr['authorImageGapUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-left img' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['authorImageGap'], $attr['authorImageGapUnit'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon:hover svg' => array(
'fill' => $attr['quoteHoverColor'],
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon:hover' => array(
'background' => $attr['quoteBgHoverColor'],
),
'.uagb-blockquote__skin-border blockquote.uagb-blockquote:hover' => array(
'border-left-color' => $attr['borderHoverColor'],
),
// Backword css.
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'fill' => $attr['quoteColor'],
'width' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSize'], $attr['quoteSizeType'] ),
),
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon:hover svg' => array(
'fill' => $attr['quoteHoverColor'],
),
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon-wrap:hover' => array(
'background' => $attr['quoteBgHoverColor'],
),
' .uagb-blockquote__skin-border blockquote.uagb-blockquote:hover' => array(
'border-left-color' => $attr['borderHoverColor'],
),
'.uagb-blockquote__align-center blockquote.uagb-blockquote' => array(
'text-align' => $attr['align'],
),
// End backword.
);
if ( $attr['enableTweet'] ) {
$selectors['.uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button'] = array(
'color' => $attr['tweetLinkColor'],
);
$selectors['.uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button svg'] = array(
'fill' => $attr['tweetLinkColor'],
);
$selectors[' .uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button'] = array( // for backward compatibility.
'color' => $attr['tweetBtnColor'],
'background-color' => $attr['tweetBtnBgColor'],
'padding-left' => UAGB_Helper::get_css_value( $tweetBtnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $tweetBtnPaddingRight, $attr['paddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
);
$selectors['.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button'] = array(
'color' => $attr['tweetBtnColor'],
'background-color' => $attr['tweetBtnBgColor'],
'padding-left' => UAGB_Helper::get_css_value( $tweetBtnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $tweetBtnPaddingRight, $attr['paddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
);
$selectors['.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button svg'] = array(
'fill' => $attr['tweetBtnColor'],
);
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button'] = array(
'color' => $attr['tweetBtnColor'],
'background-color' => $attr['tweetBtnBgColor'],
'padding-left' => UAGB_Helper::get_css_value( $tweetBtnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $tweetBtnPaddingRight, $attr['paddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $tweetBtnPaddingBottom, $attr['paddingBtnUnit'] ),
);
// Backword CSS.
$selectors[' .uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button'] = array(
'color' => $attr['tweetBtnColor'],
'background-color' => $attr['tweetBtnBgColor'],
'padding-left' => UAGB_Helper::get_css_value( $tweetBtnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $tweetBtnPaddingRight, $attr['paddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $tweetBtnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $tweetBtnPaddingBottom, $attr['paddingBtnUnit'] ),
);
$selectors[' .uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:before'] = array(
'border-right-color' => $attr['tweetBtnBgColor'],
);
$selectors[' .uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
'background-color' => $attr['tweetBtnBgHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
'background-color' => $attr['tweetBtnBgHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors[' .uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover:before'] = array(
'border-right-color' => $attr['tweetBtnBgHoverColor'],
);
// End Backword.
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button svg'] = array(
'fill' => $attr['tweetBtnColor'],
);
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:before'] = array(
'border-right-color' => $attr['tweetBtnBgColor'],
);
$selectors[' a.uagb-blockquote__tweet-button svg'] = array(
'width' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSize'], $attr['tweetBtnFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSize'], $attr['tweetBtnFontSizeType'] ),
);
$icon_margin = is_rtl() ? 'margin-left' : 'margin-right';
$selectors['.uagb-blockquote__tweet-icon_text a.uagb-blockquote__tweet-button svg'] = array(
$icon_margin => UAGB_Helper::get_css_value( $attr['tweetIconSpacing'], $attr['tweetIconSpacingUnit'] ),
);
// Hover CSS.
$selectors['.uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-link a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
'background-color' => $attr['tweetBtnBgHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover'] = array(
'color' => $attr['tweetBtnHoverColor'],
'background-color' => $attr['tweetBtnBgHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover svg'] = array(
'fill' => $attr['tweetBtnHoverColor'],
);
$selectors['.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button:hover:before'] = array(
'border-right-color' => $attr['tweetBtnBgHoverColor'],
);
}
$t_selectors = array(
' a.uagb-blockquote__tweet-button svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSizeTablet'], $attr['tweetBtnFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSizeTablet'], $attr['tweetBtnFontSizeType'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon' => array(
'padding' => UAGB_Helper::get_css_value( $attr['quotePaddingTablet'], $attr['quotePaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['quoteTopMarginTablet'], $attr['quotetabletUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['quoteBottomMarginTablet'], $attr['quotetabletUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['quoteLeftMarginTablet'], $attr['quotetabletUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['quoteRightMarginTablet'], $attr['quotetabletUnit'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['quoteSizeTablet'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSizeTablet'], $attr['quoteSizeType'] ),
),
'.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomTablet'], $attr['tabletPaddingBtnUnit'] ),
),
'.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomTablet'], $attr['tabletPaddingBtnUnit'] ),
),
// Backword css.
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['quoteSizeTablet'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSizeTablet'], $attr['quoteSizeType'] ),
),
' .uagb-blockquote__author-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['authorSpaceTablet'],
'px'
),
),
' .uagb-blockquote__author-wrap img' => array(
'width' => UAGB_Helper::get_css_value( $attr['authorImageWidthTablet'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['authorImageWidthTablet'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['authorImgBorderRadiusTablet'], '%' ),
),
'.uagb-blockquote__skin-border blockquote.uagb-blockquote' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['borderGapTablet'], $attr['borderGapUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['verticalPaddingTablet'], $attr['verticalPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['verticalPaddingTablet'], $attr['verticalPaddingUnit'] ),
),
' .uagb-blockquote__content' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpaceTablet'], $attr['descSpaceUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-right img' => array(
'margin-left' => ( 'tablet' === $attr['stack'] ) ? '0px' : UAGB_Helper::get_css_value( $attr['authorImageGapTablet'], $attr['authorImageGapUnit'] ),
'margin-bottom' => ( 'tablet' === $attr['stack'] ) ? UAGB_Helper::get_css_value( $attr['authorImageGapTablet'], $attr['authorImageGapUnit'] ) : '0px',
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-top img' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['authorImageGapTablet'], $attr['authorImageGapUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-left img' => array(
'margin-right' => ( 'tablet' === $attr['stack'] ) ? '0px' : UAGB_Helper::get_css_value( $attr['authorImageGapTablet'], $attr['authorImageGapUnit'] ),
'margin-bottom' => ( 'tablet' === $attr['stack'] ) ? UAGB_Helper::get_css_value( $attr['authorImageGapTablet'], $attr['authorImageGapUnit'] ) : '0px',
),
);
$m_selectors = array(
' a.uagb-blockquote__tweet-button svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSizeMobile'], $attr['tweetBtnFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['tweetBtnFontSizeMobile'], $attr['tweetBtnFontSizeType'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon' => array(
'padding' => UAGB_Helper::get_css_value( $attr['quotePaddingMobile'], $attr['quotePaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['quoteTopMarginMobile'], $attr['quotemobileUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['quoteBottomMarginMobile'], $attr['quotemobileUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['quoteLeftMarginMobile'], $attr['quotemobileUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['quoteRightMarginMobile'], $attr['quotemobileUnit'] ),
),
'.uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['quoteSizeMobile'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSizeMobile'], $attr['quoteSizeType'] ),
),
'.uagb-blockquote__tweet-style-classic a.uagb-blockquote__tweet-button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomMobile'], $attr['mobilePaddingBtnUnit'] ),
),
'.uagb-blockquote__tweet-style-bubble a.uagb-blockquote__tweet-button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomMobile'], $attr['mobilePaddingBtnUnit'] ),
),
' .uagb-blockquote__skin-quotation .uagb-blockquote__icon svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['quoteSizeMobile'], $attr['quoteSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['quoteSizeMobile'], $attr['quoteSizeType'] ),
),
' .uagb-blockquote__author-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['authorSpaceMobile'],
'px'
),
),
' .uagb-blockquote__author-wrap img' => array(
'width' => UAGB_Helper::get_css_value( $attr['authorImageWidthMobile'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['authorImageWidthMobile'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['authorImgBorderRadiusMobile'], '%' ),
),
' .uagb-blockquote__author-wrap img' => array(
'width' => UAGB_Helper::get_css_value( $attr['authorImageWidthMobile'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['authorImageWidthMobile'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['authorImgBorderRadiusMobile'], '%' ),
),
'.uagb-blockquote__skin-border blockquote.uagb-blockquote' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['borderGapMobile'], $attr['borderGapUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['verticalPaddingMobile'], $attr['verticalPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['verticalPaddingMobile'], $attr['verticalPaddingUnit'] ),
),
' .uagb-blockquote__content' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpaceMobile'], $attr['descSpaceUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-right img' => array(
'margin-left' => ( 'none' !== $attr['stack'] ) ? '0px' : UAGB_Helper::get_css_value( $attr['authorImageGapMobile'], $attr['authorImageGapUnit'] ),
'margin-bottom' => ( 'none' !== $attr['stack'] ) ? UAGB_Helper::get_css_value( $attr['authorImageGapMobile'], $attr['authorImageGapUnit'] ) : '0px',
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-top img' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['authorImageGapMobile'], $attr['authorImageGapUnit'] ),
),
' .uagb-blockquote__author-wrap.uagb-blockquote__author-at-left img' => array(
'margin-right' => ( 'none' !== $attr['stack'] ) ? '0px' : UAGB_Helper::get_css_value( $attr['authorImageGapMobile'], $attr['authorImageGapUnit'] ),
'margin-bottom' => ( 'none' !== $attr['stack'] ) ? UAGB_Helper::get_css_value( $attr['authorImageGapMobile'], $attr['authorImageGapUnit'] ) : '0px',
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'tweetBtn', ' .uagb-blockquote a.uagb-blockquote__tweet-button', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'author', ' cite.uagb-blockquote__author', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'desc', ' .uagb-blockquote__content', $combined_selectors );
$base_selector = ( $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-blockquote-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,64 @@
<?php
/**
* Frontend JS File.
*
* @since 2.0.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var mixed[] $attr
*/
if ( ! $attr['enableTweet'] ) {
return '';
}
$target = $attr['iconTargetUrl'];
$base_selector = ( isset( $attr['classMigrate'] ) && $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-blockquote-';
$selector = $base_selector . $id;
$share_link = 'https://twitter.com/intent/tweet';
$text = rawurlencode( $attr['descriptionText'] );
if ( ! empty( trim( $attr['author'] ) ) ) {
$text .= ' — ' . $attr['author'];
}
$share_link = add_query_arg( 'text', $text, $share_link );
if ( 'current' === $target ) {
$share_link = add_query_arg( 'url', rawurlencode( home_url() . add_query_arg( false, false ) ), $share_link );
} else {
$share_link = add_query_arg( 'url', rawurlencode( $attr['customUrl'] ), $share_link );
}
if ( ! empty( trim( $attr['iconShareVia'] ) ) ) {
$user_name = $attr['iconShareVia'];
if ( '@' === substr( $user_name, 0, 1 ) ) {
$user_name = substr( $user_name, 1 );
}
$share_link = add_query_arg( 'via', rawurlencode( $user_name ), $share_link );
}
ob_start();
?>
var selector = document.querySelectorAll( '<?php echo esc_attr( $selector ); ?>' );
if ( selector.length > 0 ) {
var blockquote__tweet = selector[0].getElementsByClassName("uagb-blockquote__tweet-button");
if ( blockquote__tweet.length > 0 ) {
blockquote__tweet[0].addEventListener("click",function(){
var request_url = "<?php echo esc_url_raw( $share_link ); ?>";
window.open( request_url );
});
}
}
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,146 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$disable_v_h_padding = apply_filters( 'uagb_disable_v_h_padding', false );
$border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'btn' );
$enable_legacy_blocks = UAGB_Admin_Helper::get_admin_settings_option( 'uag_enable_legacy_blocks' );
$inherit_from_theme = 'enabled' === UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme', 'disabled' );
return array_merge(
array(
'inheritFromTheme' => $inherit_from_theme,
'buttonType' => 'primary',
'block_id' => '',
'label' => '#Click Here',
'link' => '',
'opensInNewTab' => false,
'target' => '',
'size' => '',
'topTabletPadding' => '',
'rightTabletPadding' => '',
'bottomTabletPadding' => '',
'leftTabletPadding' => '',
'topMobilePadding' => '',
'rightMobilePadding' => '',
'bottomMobilePadding' => '',
'leftMobilePadding' => '',
'paddingUnit' => 'px',
'mobilePaddingUnit' => 'px',
'tabletPaddingUnit' => 'px',
'paddingLink' => '',
'color' => '',
'background' => '',
'hColor' => '',
'hBackground' => '',
'sizeType' => 'px',
'sizeTypeTablet' => 'px',
'sizeTypeMobile' => 'px',
'sizeMobile' => '',
'sizeTablet' => '',
'lineHeight' => '',
'lineHeightType' => 'em',
'lineHeightMobile' => '',
'lineHeightTablet' => '',
'icon' => '',
'iconPosition' => 'after',
'iconSpace' => 8,
'iconSpaceTablet' => '',
'iconSpaceMobile' => '',
'iconSize' => 15,
'iconSizeTablet' => '',
'iconSizeMobile' => '',
'LoadGoogleFonts' => '',
'noFollow' => false,
'fontFamily' => '',
'fontWeight' => '',
'fontStyle' => '',
'transform' => '',
'decoration' => '',
'backgroundType' => 'color',
'hoverbackgroundType' => 'color',
'topMargin' => '',
'rightMargin' => '',
'bottomMargin' => '',
'leftMargin' => '',
'topMarginTablet' => '',
'rightMarginTablet' => '',
'bottomMarginTablet' => '',
'leftMarginTablet' => '',
'topMarginMobile' => '',
'rightMarginMobile' => '',
'bottomMarginMobile' => '',
'leftMarginMobile' => '',
'marginType' => 'px',
'marginLink' => '',
'boxShadowColor' => '#00000026',
'boxShadowHOffset' => 0,
'boxShadowVOffset' => 0,
'boxShadowBlur' => '',
'boxShadowSpread' => '',
'boxShadowPosition' => 'outset',
'useSeparateBoxShadows' => true,
'boxShadowColorHover' => '',
'boxShadowHOffsetHover' => 0,
'boxShadowVOffsetHover' => 0,
'boxShadowBlurHover' => '',
'boxShadowSpreadHover' => '',
'boxShadowPositionHover' => 'outset',
'iconColor' => '',
'iconHColor' => '',
'buttonSize' => '',
'removeText' => false,
'gradientValue' => '',
'gradientColor1' => '#06558a',
'gradientColor2' => '#0063A1',
'gradientType' => 'linear',
'gradientLocation1' => 0,
'gradientLocationTablet1' => '',
'gradientLocationMobile1' => '',
'gradientLocation2' => 100,
'gradientLocationTablet2' => '',
'gradientLocationMobile2' => '',
'gradientAngle' => 0,
'gradientAngleTablet' => '',
'gradientAngleMobile' => '',
'selectGradient' => 'basic',
'hovergradientValue' => '',
'hovergradientColor1' => '#06558a',
'hovergradientColor2' => '#0063A1',
'hovergradientType' => 'linear',
'hovergradientLocation1' => 0,
'hovergradientLocationTablet1' => '',
'hovergradientLocationMobile1' => '',
'hovergradientLocation2' => 100,
'hovergradientLocationTablet2' => '',
'hovergradientLocationMobile2' => '',
'hovergradientAngle' => 0,
'hovergradientAngleTablet' => '',
'hovergradientAngleMobile' => '',
'hoverselectGradient' => 'basic',
'backgroundOpacity' => '',
'backgroundHoverOpacity' => '',
// letter spacing.
'letterSpacing' => '',
'letterSpacingTablet' => '',
'letterSpacingMobile' => '',
'letterSpacingType' => 'px',
'borderWidth' => '',
'borderRadius' => '',
'borderStyle' => 'solid',
'borderColor' => '#000',
'borderHColor' => '',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
),
$border_attribute
);

View File

@@ -0,0 +1,30 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/buttons-child';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Button', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Customize this button as per your need.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'extension' => false,
'dynamic_assets' => array(
'dir' => 'buttons-child',
),
'deprecated' => false,
'static_dependencies' => array(
'uagb-button-child-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'uagb-button-child' ),
'dep' => array(),
'type' => 'js',
),
),
);

View File

@@ -0,0 +1,28 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_buttons_gfont( $attr );
$all_selectors = UAGB_Block_Helper::get_buttons_child_selectors( $attr, $id, true );
$combined_selectors = array(
'desktop' => $all_selectors['selectors'],
'tablet' => $all_selectors['t_selectors'],
'mobile' => $all_selectors['m_selectors'],
);
if ( ! $attr['inheritFromTheme'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, '', ' .uagb-button__link', $combined_selectors );
}
return UAGB_Helper::generate_all_css(
$combined_selectors,
'.wp-block-uagb-buttons .uagb-block-' . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,20 @@
<?php
/**
* Frontend JS File.
*
* @var int $id
* @since 2.13.1
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
ob_start();
?>
window.addEventListener( 'load', function() {
UAGBButtonChild.init( '<?php echo esc_attr( $selector ); ?>' );
});
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,118 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$default_buttons_child = array();
for ( $i = 1; $i <= 2; $i++ ) {
$default_buttons_child[] = array(
'size' => '',
'vPadding' => '',
'hPadding' => '',
'borderWidth' => '',
'borderRadius' => '',
'borderStyle' => 'none',
'borderColor' => '',
'borderHColor' => '',
'color' => '',
'background' => '',
'hColor' => '',
'hBackground' => '',
'sizeType' => 'px',
'sizeMobile' => '',
'sizeTablet' => '',
'lineHeightType' => 'em',
'lineHeight' => '',
'lineHeightMobile' => '',
'lineHeightTablet' => '',
);
}
return array(
'classMigrate' => false,
'childMigrate' => false,
'block_id' => '',
'align' => 'center',
'btn_count' => '1',
'buttons' => $default_buttons_child,
'gap' => 10,
'gapTablet' => '',
'gapMobile' => '',
'inheritGap' => false,
'flexWrap' => false,
'stack' => 'none',
'fontFamily' => '',
'fontWeight' => '',
'loadGoogleFonts' => false,
'fontStyle' => '',
'fontTransform' => '',
'fontDecoration' => '',
'alignTablet' => 'center',
'alignMobile' => 'center',
'fontSizeType' => 'px',
'fontSizeTypeTablet' => 'px',
'fontSizeTypeMobile' => 'px',
'fontSize' => '',
'fontSizeMobile' => '',
'fontSizeTablet' => '',
'lineHeightType' => 'px',
'lineHeight' => '',
'lineHeightMobile' => '',
'lineHeightTablet' => '',
'buttonSize' => 'default',
'buttonSizeTablet' => 'default',
'buttonSizeMobile' => 'default',
'topPadding' => '',
'rightPadding' => '',
'bottomPadding' => '',
'leftPadding' => '',
'topTabletPadding' => '',
'rightTabletPadding' => '',
'bottomTabletPadding' => '',
'leftTabletPadding' => '',
'topMobilePadding' => '',
'rightMobilePadding' => '',
'bottomMobilePadding' => '',
'leftMobilePadding' => '',
'paddingUnit' => 'px',
'mobilePaddingUnit' => 'px',
'tabletPaddingUnit' => 'px',
'topMargin' => '',
'rightMargin' => '',
'bottomMargin' => '',
'leftMargin' => '',
'topMarginTablet' => '',
'rightMarginTablet' => '',
'bottomMarginTablet' => '',
'leftMarginTablet' => '',
'topMarginMobile' => '',
'rightMarginMobile' => '',
'bottomMarginMobile' => '',
'leftMarginMobile' => '',
'marginType' => 'px',
'marginLink' => '',
'verticalAlignment' => '',
// letter spacing.
'fontLetterSpacing' => '',
'fontLetterSpacingTablet' => '',
'fontLetterSpacingMobile' => '',
'fontLetterSpacingType' => 'px',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/buttons';
$block_data = array(
'doc' => 'multi-buttons',
'slug' => '',
'admin_categories' => array( 'creative', 'core' ),
'link' => 'buttons-legacy',
'title' => __( 'Buttons', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add multiple buttons to redirect user to different webpages.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'buttons' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'buttons',
),
);

View File

@@ -0,0 +1,299 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var mixed[] $attr
*/
// Adds Fonts.
UAGB_Block_JS::blocks_buttons_gfont( $attr );
$m_selectors = array();
$t_selectors = array();
$selectors = array();
$button_desktop_padding = array();
$button_tablet_padding = array();
$button_mobile_padding = array();
if ( ! $attr['inheritGap'] ) {
if ( 'desktop' === $attr['stack'] ) {
// High specificity needed here as to make it uniform as across all the device breakpoints as for other device breakpoints this was taking the higher specificity.
$selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'flex-direction' => 'column',
'gap' => UAGB_Helper::get_css_value( $attr['gap'], 'px' ),
);
$t_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gapTablet'], 'px' ),
);
$m_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gapMobile'], 'px' ),
);
} elseif ( 'tablet' === $attr['stack'] ) {
$selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gap'], 'px' ),
);
$t_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
'gap' => UAGB_Helper::get_css_value( $attr['gapTablet'], 'px' ),
);
$m_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
'gap' => UAGB_Helper::get_css_value( $attr['gapMobile'], 'px' ),
);
} elseif ( 'mobile' === $attr['stack'] ) {
$selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'flex-direction' => 'row',
'gap' => UAGB_Helper::get_css_value( $attr['gap'], 'px' ),
);
$t_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gapTablet'], 'px' ),
);
$m_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
'gap' => UAGB_Helper::get_css_value( $attr['gapMobile'], 'px' ),
);
} elseif ( 'none' === $attr['stack'] ) {
$selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gap'], 'px' ),
);
$t_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gapTablet'], 'px' ),
);
$m_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'gap' => UAGB_Helper::get_css_value( $attr['gapMobile'], 'px' ),
);
}
}
if ( $attr['inheritGap'] ) {
if ( 'desktop' === $attr['stack'] ) {
$selectors[' .uagb-buttons__wrap '] = array(
'flex-direction' => 'column',
);
} elseif ( 'tablet' === $attr['stack'] ) {
$t_selectors[' .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
);
$m_selectors[' .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
);
} elseif ( 'mobile' === $attr['stack'] ) {
$selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'flex-direction' => 'row',
);
$m_selectors['.wp-block-uagb-buttons.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'flex-direction' => 'column',
);
}
}
if ( $attr['flexWrap'] ) {
$selectors[' .uagb-buttons__wrap ']['flex-wrap'] = 'wrap';
}
$vAlign = '';
switch ( $attr['verticalAlignment'] ) {
case 'top':
$vAlign = 'flex-start';
break;
case 'bottom':
$vAlign = 'flex-end';
break;
default:
$vAlign = 'center';
break;
}
if ( 'full' !== $attr['align'] ) {
$selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'justify-content' => $attr['align'],
'align-items' => $vAlign,
);
} else {
$selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'width' => '100%',
'align-items' => $vAlign,
);
$selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap .wp-block-button '] = array(
'width' => '100%',
);
}
if ( 'full' !== $attr['alignTablet'] ) {
$t_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'justify-content' => $attr['alignTablet'],
'align-items' => $vAlign,
);
$t_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap .wp-block-button'] = array(
'width' => 'auto',
);
} else {
$t_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'width' => '100%',
);
$t_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap .wp-block-button '] = array(
'width' => '100%',
);
}
if ( 'full' !== $attr['alignMobile'] ) {
$m_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap '] = array(
'justify-content' => $attr['alignMobile'],
'align-items' => $vAlign,
);
$m_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap .wp-block-button'] = array(
'width' => 'auto',
);
} else {
$m_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap'] = array(
'width' => '100%',
);
$m_selectors['.uagb-buttons__outer-wrap .uagb-buttons__wrap .wp-block-button '] = array(
'width' => '100%',
);
}
if ( $attr['childMigrate'] ) {
$button_desktop_style = array( // For Backword user.
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'],
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['fontSize'], $attr['fontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeight'], $attr['lineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['fontLetterSpacing'], $attr['fontLetterSpacingType'] ),
);
if ( 'default' === $attr['buttonSize'] ) {
$button_desktop_padding = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPadding'], $attr['paddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPadding'], $attr['paddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPadding'], $attr['paddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPadding'], $attr['paddingUnit'] ),
);
$button_tablet_padding = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topTabletPadding'], $attr['tabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomTabletPadding'], $attr['tabletPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftTabletPadding'], $attr['tabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightTabletPadding'], $attr['tabletPaddingUnit'] ),
);
$button_mobile_padding = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topMobilePadding'], $attr['mobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomMobilePadding'], $attr['mobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftMobilePadding'], $attr['mobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightMobilePadding'], $attr['mobilePaddingUnit'] ),
);
}
$button_tablet_style = array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeTablet'], $attr['fontSizeTypeTablet'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightTablet'], $attr['lineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['fontLetterSpacingTablet'], $attr['fontLetterSpacingType'] ),
);
$button_mobile_style = array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeMobile'], $attr['fontSizeTypeMobile'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightMobile'], $attr['lineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['fontLetterSpacingMobile'], $attr['fontLetterSpacingType'] ),
);
$button_desktop_style = $button_desktop_padding ? array_merge( $button_desktop_style, $button_desktop_padding ) : $button_desktop_style;
$button_tablet_style = $button_tablet_padding ? array_merge( $button_tablet_style, $button_tablet_padding ) : $button_tablet_style;
$button_mobile_style = $button_mobile_padding ? array_merge( $button_mobile_style, $button_mobile_padding ) : $button_mobile_style;
$selectors[' .uagb-buttons-repeater:not(.wp-block-button__link)'] = $button_desktop_style; // For Backword user.
$selectors[' .uagb-button__wrapper .uagb-buttons-repeater.wp-block-button__link'] = $button_desktop_style; // For New User.
$selectors[' .uagb-button__wrapper .uagb-buttons-repeater.ast-outline-button'] = $button_desktop_style; // For Secondary color from Astra Customizer.
$t_selectors[' .uagb-buttons-repeater:not(.wp-block-button__link)'] = $button_tablet_style; // For Backword user.
$t_selectors[' .uagb-buttons-repeater.wp-block-button__link'] = $button_tablet_style; // For New User.
$m_selectors[' .uagb-buttons-repeater:not(.wp-block-button__link)'] = $button_mobile_style; // For Backword user.
$m_selectors[' .uagb-buttons-repeater.wp-block-button__link'] = $button_mobile_style; // For New User.
$selectors[' .uagb-button__wrapper'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['topMargin'], $attr['marginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMargin'], $attr['marginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMargin'], $attr['marginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMargin'], $attr['marginType'] ),
);
$t_selectors[' .uagb-button__wrapper'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginTablet'], $attr['marginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginTablet'], $attr['marginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginTablet'], $attr['marginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginTablet'], $attr['marginType'] ),
);
$m_selectors[' .uagb-button__wrapper'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginMobile'], $attr['marginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginMobile'], $attr['marginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginMobile'], $attr['marginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginMobile'], $attr['marginType'] ),
);
}
if ( ! $attr['childMigrate'] ) {
$defaults = UAGB_DIR . 'includes/blocks/buttons-child/attributes.php';
if ( file_exists( $defaults ) ) {
$default_attr = include $defaults;
}
$default_attr = ( ! empty( $default_attr ) && is_array( $default_attr ) ) ? $default_attr : array();
foreach ( $attr['buttons'] as $key => $button ) {
if ( $attr['btn_count'] <= $key ) {
break;
}
$button = array_merge( $default_attr, $button );
$wrapper = ( ! $attr['childMigrate'] ) ? ' .uagb-buttons-repeater-' . $key . '.uagb-button__wrapper' : ' .uagb-buttons-repeater';
$selectors[ $wrapper ] = array(
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'],
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
);
$child_selectors = UAGB_Block_Helper::get_buttons_child_selectors( $button, $key, $attr['childMigrate'] );
$selectors = array_merge( $selectors, $child_selectors['selectors'] );
$t_selectors = array_merge( $t_selectors, $child_selectors['t_selectors'] );
$m_selectors = array_merge( $m_selectors, $child_selectors['m_selectors'] );
}
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = ( $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-buttons-';
return UAGB_Helper::generate_all_css(
$combined_selectors,
$base_selector . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,239 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$cta_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'btn' );
$second_cta_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'secondCta' );
$inherit_from_theme = 'enabled' === UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme', 'disabled' );
return array_merge(
array(
'classMigrate' => false,
'inheritFromTheme' => $inherit_from_theme,
'secInheritFromTheme' => $inherit_from_theme,
'textAlign' => 'left',
'titleColor' => '',
'descColor' => '',
'ctaPosition' => 'right',
'titleTag' => '',
'htmlTag' => 'div',
'titleFontSize' => '',
'titleFontSizeType' => 'px',
'titleFontSizeTypeTablet' => 'px',
'titleFontSizeTypeMobile' => 'px',
'titleFontSizeMobile' => '',
'titleFontSizeTablet' => '',
'titleFontFamily' => '',
'titleFontWeight' => '',
'titleLineHeightType' => 'em',
'titleLineHeight' => '',
'titleLineHeightTablet' => '',
'titleLineHeightMobile' => '',
'titleLoadGoogleFonts' => false,
'descFontSize' => '',
'descFontSizeType' => 'px',
'descFontSizeTypeTablet' => 'px',
'descFontSizeTypeMobile' => 'px',
'descFontSizeMobile' => '',
'descFontSizeTablet' => '',
'descFontFamily' => '',
'descFontWeight' => '',
'descLineHeightType' => 'em',
'descLineHeight' => '',
'descLineHeightTablet' => '',
'descLineHeightMobile' => '',
'descLoadGoogleFonts' => false,
'titleSpace' => 10,
'titleSpaceTablet' => '',
'titleSpaceMobile' => '',
'titleSpaceType' => 'px',
'descSpace' => 10,
'descSpaceTablet' => '',
'descSpaceMobile' => '',
'descSpaceType' => 'px',
'buttonAlign' => '',
'ctaTarget' => false,
'showIcon' => true,
'showSecondIcon' => true,
'ctaIcon' => 'right-long',
'ctaIconPosition' => 'after',
'ctaIconSpace' => 10,
'ctaIconSpaceTablet' => '',
'ctaIconSpaceMobile' => '',
'ctaType' => 'button',
'ctaLink' => '#',
'ctaFontSize' => '',
'ctaFontSizeType' => 'px',
'ctaFontSizeTypeTablet' => 'px',
'ctaFontSizeTypeMobile' => 'px',
'ctaFontSizeMobile' => '',
'ctaFontSizeTablet' => '',
'ctaFontFamily' => '',
'ctaFontWeight' => '',
'ctaLoadGoogleFonts' => false,
'ctaBtnLinkColor' => '',
'ctaBgType' => 'color',
'ctaBgHoverType' => 'color',
'ctaBgColor' => '',
'ctaBgHoverColor' => '',
'ctaBtnVertPadding' => '',
'ctaBtnHrPadding' => '',
'stack' => 'tablet',
'stackBtn' => 'none',
'showTitle' => true,
'showDesc' => true,
'ctaLeftSpace' => 0,
'ctaLeftSpaceTablet' => '',
'ctaLeftSpaceMobile' => '',
'ctaLeftSpaceType' => 'px',
'ctaRightSpace' => 0,
'ctaRightSpaceTablet' => '',
'ctaRightSpaceMobile' => '',
'ctaRightSpaceType' => 'px',
'contentWidth' => 70,
'contentWidthTablet' => '',
'contentWidthMobile' => '',
'contentWidthType' => '%',
'ctaLinkHoverColor' => '',
'ctaTopPaddingTablet' => '',
'ctaRightPaddingTablet' => '',
'ctaBottomPaddingTablet' => '',
'ctaLeftPaddingTablet' => '',
'ctaTopPaddingMobile' => '',
'ctaRightPaddingMobile' => '',
'ctaBottomPaddingMobile' => '',
'ctaLeftPaddingMobile' => '',
'ctaPaddingUnit' => 'px',
'mobileCTAPaddingUnit' => 'px',
'tabletCTAPaddingUnit' => 'px',
'ctaPaddingLink' => '',
'titleTransform' => '',
'titleDecoration' => '',
'descTransform' => '',
'descDecoration' => '',
'ctaTransform' => '',
'ctaDecoration' => '',
'titleFontStyle' => '',
'descFontStyle' => '',
'ctaFontStyle' => '',
'secondCtaBgType' => 'color',
'secondCtaBgHoverType' => 'color',
'secondCtaFontFamily' => '',
'secondCtaLoadGoogleFonts' => false,
'secondCtaFontWeight' => '',
'secondCtaFontStyle' => '',
'secondCtaFontTransform' => '',
'secondCtaFontDecoration' => '',
'secondCtaTopPadding' => '',
'secondCtaRightPadding' => '',
'secondCtaBottomPadding' => '',
'secondCtaLeftPadding' => '',
'secondCtaTopMobilePadding' => '',
'secondCtaRightMobilePadding' => '',
'secondCtaBottomMobilePadding' => '',
'secondCtaLeftMobilePadding' => '',
'secondCtaTopTabletPadding' => '',
'secondCtaRightTabletPadding' => '',
'secondCtaBottomTabletPadding' => '',
'secondCtaLeftTabletPadding' => '',
'secondCtaPaddingUnit' => 'px',
'secondCtaMobilePaddingUnit' => 'px',
'secondCtaTabletPaddingUnit' => 'px',
'secondCtaPaddingLink' => '',
'secondCtaColor' => '',
'secondCtaBackground' => '',
'secondCtaHoverColor' => '',
'secondCtaHoverBackground' => '',
'secondCtaFontSize' => 14,
'secondCtaFontSizeType' => 'px',
'secondCtaFontSizeTypeTablet' => 'px',
'secondCtaFontSizeTypeMobile' => 'px',
'secondCtaFontSizeMobile' => '',
'secondCtaFontSizeTablet' => '',
'secondCtaIcon' => 'right-long',
'secondCtaIconPosition' => 'right',
'secondCtaIconSpace' => 10,
'secondCtaIconSpaceTablet' => '',
'secondCtaIconSpaceMobile' => '',
'stackBtn' => 'none',
'gapBtn' => 15,
'gapBtnTablet' => '',
'gapBtnMobile' => '',
'textAlignTablet' => 'center',
'textAlignMobile' => 'center',
'overallBlockTopPadding' => '',
'overallBlockRightPadding' => '',
'overallBlockBottomPadding' => '',
'overallBlockLeftPadding' => '',
'overallBlockTopMobilePadding' => '',
'overallBlockRightMobilePadding' => '',
'overallBlockBottomMobilePadding' => '',
'overallBlockLeftMobilePadding' => '',
'overallBlockTopTabletPadding' => '',
'overallBlockRightTabletPadding' => '',
'overallBlockBottomTabletPadding' => '',
'overallBlockLeftTabletPadding' => '',
'overallBlockPaddingUnit' => 'px',
'overallBlockMobilePaddingUnit' => 'px',
'overallBlockTabletPaddingUnit' => 'px',
'overallBlockPaddingLink' => '',
'overallBlockTopMargin' => '',
'overallBlockRightMargin' => '',
'overallBlockBottomMargin' => '',
'overallBlockLeftMargin' => '',
'overallBlockTopMobileMargin' => '',
'overallBlockRightMobileMargin' => '',
'overallBlockBottomMobileMargin' => '',
'overallBlockLeftMobileMargin' => '',
'overallBlockTopTabletMargin' => '',
'overallBlockRightTabletMargin' => '',
'overallBlockBottomTabletMargin' => '',
'overallBlockLeftTabletMargin' => '',
'overallBlockMarginUnit' => 'px',
'overallBlockMobileMarginUnit' => 'px',
'overallBlockTabletMarginUnit' => 'px',
'overallBlockMarginLink' => '',
'buttonRightSpace' => 5,
'buttonRightSpaceTablet' => '',
'buttonRightSpaceMobile' => '',
'buttonRightSpaceType' => 'px',
'titleLetterSpacing' => '',
'titleLetterSpacingTablet' => '',
'titleLetterSpacingMobile' => '',
'titleLetterSpacingType' => 'px',
'descLetterSpacing' => '',
'descLetterSpacingTablet' => '',
'descLetterSpacingMobile' => '',
'descLetterSpacingType' => 'px',
'ctaLetterSpacing' => '',
'ctaLetterSpacingTablet' => '',
'ctaLetterSpacingMobile' => '',
'ctaLetterSpacingType' => 'px',
'secondCtaLetterSpacing' => '',
'secondCtaLetterSpacingTablet' => '',
'secondCtaLetterSpacingMobile' => '',
'secondCtaLetterSpacingType' => 'px',
'ctaBorderColor' => '',
'ctaBorderhoverColor' => '',
'ctaBorderStyle' => 'solid',
'ctaBorderWidth' => '',
'ctaBorderRadius' => '',
'btncontentWidth' => 30,
'btncontentWidthTablet' => '',
'btncontentWidthMobile' => '',
'btncontentWidthType' => '%',
'enabledSecondCtaButton' => false,
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
'enableMultilineParagraph' => false,
),
$second_cta_border_attribute,
$cta_border_attribute
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/call-to-action';
$block_data = array(
'slug' => '',
'doc' => 'call-to-action-2',
'admin_categories' => array( 'core', 'content' ),
'link' => 'call-to-action-legacy',
'title' => __( 'Call To Action', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a button along with heading and description.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'call-to-action' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'call-to-action',
),
);

View File

@@ -0,0 +1,684 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_call_to_action_gfont( $attr );
$content_width_tablet_fallback = is_numeric( $attr['contentWidthTablet'] ) ? $attr['contentWidthTablet'] : $attr['contentWidth'];
$content_width_mobile_fallback = is_numeric( $attr['contentWidthMobile'] ) ? $attr['contentWidthMobile'] : $content_width_tablet_fallback;
$btn_content_width_tablet_fallback = is_numeric( $attr['btncontentWidthTablet'] ) ? $attr['btncontentWidthTablet'] : $attr['btncontentWidth'];
$btn_content_width_mobile_fallback = is_numeric( $attr['btncontentWidthMobile'] ) ? $attr['btncontentWidthMobile'] : $attr['btncontentWidth'];
$t_selectors = array();
$m_selectors = array();
$svg_size = UAGB_Helper::get_css_value( $attr['ctaFontSize'], $attr['ctaFontSizeType'] );
$m_svg_size = UAGB_Helper::get_css_value( $attr['ctaFontSizeMobile'], $attr['ctaFontSizeTypeMobile'] );
$t_svg_size = UAGB_Helper::get_css_value( $attr['ctaFontSizeTablet'], $attr['ctaFontSizeTypeTablet'] );
$btn_padding_top = isset( $attr['ctaTopPadding'] ) ? $attr['ctaTopPadding'] : $attr['ctaBtnVertPadding'];
$btn_padding_bottom = isset( $attr['ctaBottomPadding'] ) ? $attr['ctaBottomPadding'] : $attr['ctaBtnVertPadding'];
$btn_padding_left = isset( $attr['ctaLeftPadding'] ) ? $attr['ctaLeftPadding'] : $attr['ctaBtnHrPadding'];
$btn_padding_right = isset( $attr['ctaRightPadding'] ) ? $attr['ctaRightPadding'] : $attr['ctaBtnHrPadding'];
if ( 'left' === $attr['textAlign'] ) {
$alignment = 'flex-start';
} elseif ( 'right' === $attr['textAlign'] ) {
$alignment = 'flex-end';
} else {
$alignment = 'center';
}
if ( 'left' === $attr['textAlignTablet'] ) {
$alignmentTablet = 'flex-start';
} elseif ( 'right' === $attr['textAlignTablet'] ) {
$alignmentTablet = 'flex-end';
} else {
$alignmentTablet = 'center';
}
if ( 'left' === $attr['textAlignMobile'] ) {
$alignmentMobile = 'flex-start';
} elseif ( 'right' === $attr['textAlignMobile'] ) {
$alignmentMobile = 'flex-end';
} else {
$alignmentMobile = 'center';
}
$selectors = array(
'.wp-block-uagb-call-to-action .uagb-cta__title' => array(
'color' => $attr['titleColor'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['titleSpace'], $attr['titleSpaceType'] ),
),
'.wp-block-uagb-call-to-action .uagb-cta__desc' => array(
'color' => $attr['descColor'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpace'], $attr['descSpaceType'] ),
),
' .uagb-cta__align-button-after' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['ctaIconSpace'], 'px' ),
),
' .uagb-cta__align-button-before' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['ctaIconSpace'], 'px' ),
),
' .uagb-cta__button-wrapper .uagb-cta-with-svg' => array(
'font-size' => $svg_size,
'width' => $svg_size,
'height' => $svg_size,
'line-height' => $svg_size,
),
' .uagb-cta__button-wrapper .uagb-cta__block-link svg' => array(
'fill' => $attr['ctaBtnLinkColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg' => array(
'font-size' => $svg_size,
'width' => $svg_size,
'height' => $svg_size,
'line-height' => $svg_size,
'fill' => $attr['ctaBtnLinkColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper:hover > svg' => array(
'fill' => $attr['ctaLinkHoverColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper:focus > svg' => array(
'fill' => $attr['ctaLinkHoverColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'width' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'fill' => $attr['secondCtaColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta-second__button:hover > svg' => array(
'fill' => $attr['secondCtaHoverColor'],
),
'.wp-block-uagb-call-to-action a.uagb-cta-second__button:focus > svg' => array(
'fill' => $attr['secondCtaHoverColor'],
),
);
if ( 'text' === $attr['ctaType'] ) {
$selectors[' .uagb-cta__button-wrapper a.uagb-cta-typeof-text'] = array(
'color' => $attr['ctaBtnLinkColor'],
);
$selectors[' .uagb-cta__button-wrapper a.uagb-cta-typeof-text:hover '] = array(
'color' => $attr['ctaLinkHoverColor'],
);
$selectors[' .uagb-cta__button-wrapper a.uagb-cta-typeof-text:focus '] = array(
'color' => $attr['ctaLinkHoverColor'],
);
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper'] = array(
'color' => $attr['ctaBtnLinkColor'],
);
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper:hover '] = array(
'color' => $attr['ctaLinkHoverColor'],
);
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper:focus '] = array(
'color' => $attr['ctaLinkHoverColor'],
);
}
$selectors[' .uagb-cta__content-wrap'] = array(
'text-align' => $attr['textAlign'],
);
$selectors[' .uagb-cta__wrap'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidth'], $attr['contentWidthType'] ),
'text-align' => $attr['textAlign'],
);
$selectors['.wp-block-uagb-call-to-action'] = array(
'text-align' => $attr['textAlign'],
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopPadding'], $attr['overallBlockPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomPadding'], $attr['overallBlockPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftPadding'], $attr['overallBlockPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightPadding'], $attr['overallBlockPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMargin'], $attr['overallBlockMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMargin'], $attr['overallBlockMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMargin'], $attr['overallBlockMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMargin'], $attr['overallBlockMarginUnit'] ),
);
if ( 'left' === $attr['textAlign'] && 'right' === $attr['ctaPosition'] ) {
$selectors[' .uagb-cta__left-right-wrap .uagb-cta__content'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['ctaLeftSpace'], 'px' ),
'margin-right' => '0',
);
}
$t_selectors = array(
'.wp-block-uagb-call-to-action .uagb-cta__title' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['titleSpaceTablet'], $attr['titleSpaceType'] ),
),
'.wp-block-uagb-call-to-action .uagb-cta__desc' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpaceTablet'], $attr['descSpaceType'] ),
),
' .uagb-cta__button-wrapper .uagb-cta-with-svg' => array(
'font-size' => $t_svg_size,
'width' => $t_svg_size,
'height' => $t_svg_size,
'line-height' => $t_svg_size,
),
'.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper svg' => array(
'font-size' => $t_svg_size,
'width' => $t_svg_size,
'height' => $t_svg_size,
'line-height' => $t_svg_size,
),
'.wp-block-uagb-call-to-action a.uagb-cta-second__button svg' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeTablet'], $attr['secondCtaFontSizeTypeTablet'] ),
'width' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeTablet'], $attr['secondCtaFontSizeTypeTablet'] ),
'height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeTablet'], $attr['secondCtaFontSizeTypeTablet'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeTablet'], $attr['secondCtaFontSizeTypeTablet'] ),
),
);
$t_selectors['.wp-block-uagb-call-to-action.uagb-cta__content-stacked-tablet '] = array(
'display' => 'inherit',
);
$t_selectors['.uagb-cta__content-stacked-tablet .uagb-cta__wrap'] = array(
'width' => '100%',
);
$m_selectors = array(
'.wp-block-uagb-call-to-action .uagb-cta__title' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['titleSpaceMobile'], $attr['titleSpaceType'] ),
),
'.wp-block-uagb-call-to-action .uagb-cta__desc' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['descSpaceMobile'], $attr['descSpaceType'] ),
),
' .uagb-cta__button-wrapper .uagb-cta-with-svg' => array(
'font-size' => $m_svg_size,
'width' => $m_svg_size,
'height' => $m_svg_size,
'line-height' => $m_svg_size,
),
'.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper svg' => array(
'font-size' => $m_svg_size,
'width' => $m_svg_size,
'height' => $m_svg_size,
'line-height' => $m_svg_size,
),
'.wp-block-uagb-call-to-action a.uagb-cta-second__button svg' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeMobile'], $attr['secondCtaFontSizeTypeMobile'] ),
'width' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeMobile'], $attr['secondCtaFontSizeTypeMobile'] ),
'height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeMobile'], $attr['secondCtaFontSizeTypeMobile'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSizeMobile'], $attr['secondCtaFontSizeTypeMobile'] ),
),
);
$m_selectors['.wp-block-uagb-call-to-action.uagb-cta__content-stacked-mobile '] = array(
'display' => 'inherit',
);
$m_selectors['.uagb-cta__content-stacked-mobile .uagb-cta__wrap'] = array(
'width' => '100%',
);
if ( 'desktop' === $attr['stackBtn'] ) {
$selectors[' .uagb-cta__buttons'] = array(
'flex-direction' => 'column',
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtn'], 'px' ),
);
$t_selectors[' .uagb-cta__buttons '] = array(
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtnTablet'], 'px' ),
);
$m_selectors[' .uagb-cta__buttons '] = array(
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtnMobile'], 'px' ),
);
} elseif ( 'tablet' === $attr['stackBtn'] ) {
$selectors[' .uagb-cta__buttons '] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtn'], 'px' ),
);
$t_selectors[' .uagb-cta__buttons'] = array(
'flex-direction' => 'column',
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtnTablet'], 'px' ),
);
$m_selectors[' .uagb-cta__buttons'] = array(
'flex-direction' => 'column',
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtnMobile'], 'px' ),
);
} elseif ( 'mobile' === $attr['stackBtn'] ) {
$selectors[' .uagb-cta__buttons '] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtn'], 'px' ),
);
$t_selectors[' .uagb-cta__buttons'] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtnTablet'], 'px' ),
);
$m_selectors[' .uagb-cta__buttons'] = array(
'flex-direction' => 'column',
'row-gap' => UAGB_Helper::get_css_value( $attr['gapBtnMobile'], 'px' ),
);
} elseif ( 'none' === $attr['stackBtn'] ) {
$selectors[' .uagb-cta__buttons'] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtn'], 'px' ),
);
$t_selectors[' .uagb-cta__buttons'] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtnTablet'], 'px' ),
);
$m_selectors[' .uagb-cta__buttons'] = array(
'column-gap' => UAGB_Helper::get_css_value( $attr['gapBtnMobile'], 'px' ),
'justify-content' => 'center',
);
}
if ( 'button' === $attr['ctaType'] && $attr['enabledSecondCtaButton'] ) {
$selectors['.wp-block-button .uagb-cta__buttons'] = array(
'width' => UAGB_Helper::get_css_value( $attr['btncontentWidth'], $attr['btncontentWidthType'] ),
);
$t_selectors['.wp-block-button .uagb-cta__buttons'] = array(
'width' => UAGB_Helper::get_css_value( $btn_content_width_tablet_fallback, $attr['btncontentWidthType'] ),
);
$m_selectors['.wp-block-button .uagb-cta__buttons'] = array(
'width' => UAGB_Helper::get_css_value( $btn_content_width_mobile_fallback, $attr['btncontentWidthType'] ),
);
}
$cta_icon_spacing = UAGB_Helper::get_css_value( $attr['ctaIconSpace'], 'px' );
$cta_icon_spacing_tablet = UAGB_Helper::get_css_value( $attr['ctaIconSpaceTablet'], 'px' );
$cta_icon_spacing_mobile = UAGB_Helper::get_css_value( $attr['ctaIconSpaceMobile'], 'px' );
$right_side_margin = 'margin-right';
$left_side_margin = 'margin-left';
if ( ! is_rtl() ) {
$right_side_margin = 'margin-left';
$left_side_margin = 'margin-right';
}
if ( 'before' === $attr['ctaIconPosition'] ) {
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$left_side_margin => $cta_icon_spacing,
'font-size' => $svg_size,
'width' => $svg_size,
'height' => $svg_size,
'line-height' => $svg_size,
'fill' => $attr['ctaBtnLinkColor'],
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$left_side_margin => $cta_icon_spacing_tablet,
);
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$left_side_margin => $cta_icon_spacing_mobile,
);
} else {
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$right_side_margin => $cta_icon_spacing,
'font-size' => $svg_size,
'width' => $svg_size,
'height' => $svg_size,
'line-height' => $svg_size,
'fill' => $attr['ctaBtnLinkColor'],
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$right_side_margin => $cta_icon_spacing_tablet,
);
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper > svg'] = array(
$right_side_margin => $cta_icon_spacing_mobile,
);
}
if ( 'none' === $attr['ctaType'] || 'all' === $attr['ctaType'] ) {
$selectors[' .uagb-cta__wrap'] = array(
'width' => '100%',
);
}
if ( 'right' === $attr['ctaPosition'] && ( 'text' === $attr['ctaType'] || 'button' === $attr['ctaType'] ) ) {
$selectors['.wp-block-uagb-call-to-action '] = array(
'display' => 'flex',
'justify-content' => 'space-between',
);
$selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__content'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidth'], $attr['contentWidthType'] ),
);
$selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__link-wrapper'] = array(
'width' => UAGB_Helper::get_css_value( ( 100 - $attr['contentWidth'] ), $attr['contentWidthType'] ),
);
$t_selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__content'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidthTablet'], $attr['contentWidthType'] ),
);
$t_selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__link-wrapper'] = array(
'width' => UAGB_Helper::get_css_value( ( 100 - $content_width_tablet_fallback ), $attr['contentWidthType'] ),
);
$m_selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__content'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidthMobile'], $attr['contentWidthType'] ),
);
$m_selectors[' .uagb-cta__content-right .uagb-cta__left-right-wrap .uagb-cta__link-wrapper'] = array(
'width' => UAGB_Helper::get_css_value( ( 100 - $content_width_mobile_fallback ), $attr['contentWidthType'] ),
);
$selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper '] = array(
'align-self' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
'height' => 'fit-content',
'margin-left' => 'auto',
);
}
$t_selectors[' .uagb-cta__wrap'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidthTablet'], $attr['contentWidthType'] ),
'text-align' => $attr['textAlignTablet'],
);
$m_selectors[' .uagb-cta__wrap'] = array(
'width' => UAGB_Helper::get_css_value( $attr['contentWidthMobile'], $attr['contentWidthType'] ),
'text-align' => $attr['textAlignMobile'],
);
if ( 'desktop' === $attr['stack'] ) {
$selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignment,
);
$t_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignmentTablet,
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
);
$m_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignmentMobile,
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
);
} elseif ( 'tablet' === $attr['stack'] ) {
$selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'row',
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
);
$t_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignmentTablet,
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightTabletPadding'], $attr['overallBlockTabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightTabletMargin'], $attr['overallBlockTabletMarginUnit'] ),
);
$m_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignmentMobile,
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
);
} elseif ( 'mobile' === $attr['stack'] ) {
$selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'row',
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
);
$t_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'row',
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
);
$m_selectors['.wp-block-uagb-call-to-action '] = array(
'flex-direction' => 'column',
'align-items' => $alignmentMobile,
'padding-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobilePadding'], $attr['overallBlockMobilePaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['overallBlockTopMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['overallBlockBottomMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['overallBlockLeftMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['overallBlockRightMobileMargin'], $attr['overallBlockMobileMarginUnit'] ),
);
} elseif ( 'none' === $attr['stack'] ) {
$selectors['.wp-block-uagb-call-to-action '] = array(
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
'flex-direction' => 'row',
);
$t_selectors['.wp-block-uagb-call-to-action '] = array(
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
'flex-direction' => 'row',
);
$m_selectors['.wp-block-uagb-call-to-action '] = array(
'align-items' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
'flex-direction' => 'row',
);
$selectors['.wp-block-uagb-call-to-action .uagb-cta__buttons'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['buttonRightSpace'], $attr['buttonRightSpaceType'] ),
);
$t_selectors['.wp-block-uagb-call-to-action .uagb-cta__buttons'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['buttonRightSpaceTablet'], $attr['buttonRightSpaceType'] ),
);
$m_selectors[' .uagb-cta__outer-wrap .uagb-cta__buttons'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['buttonRightSpaceMobile'], $attr['buttonRightSpaceType'] ),
);
}
$second_cta_icon_spacing = UAGB_Helper::get_css_value( $attr['secondCtaIconSpace'], 'px' );
$second_cta_icon_spacing_tablet = UAGB_Helper::get_css_value( $attr['secondCtaIconSpaceTablet'], 'px' );
$second_cta_icon_spacing_mobile = UAGB_Helper::get_css_value( $attr['secondCtaIconSpaceMobile'], 'px' );
if ( 'before' === $attr['secondCtaIconPosition'] ) {
$selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$left_side_margin => $second_cta_icon_spacing,
'font-size' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'width' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'fill' => $attr['secondCtaColor'],
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$left_side_margin => $second_cta_icon_spacing_tablet,
);
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$left_side_margin => $second_cta_icon_spacing_mobile,
);
} else {
$selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$right_side_margin => $second_cta_icon_spacing,
'font-size' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'width' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['secondCtaFontSize'], $attr['secondCtaFontSizeType'] ),
'fill' => $attr['secondCtaColor'],
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$right_side_margin => $second_cta_icon_spacing_tablet,
);
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta-second__button > svg'] = array(
$right_side_margin => $second_cta_icon_spacing_mobile,
);
}
if ( ! $attr['secInheritFromTheme'] ) {
$second_cta_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'secondCta' );
$second_cta_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'secondCta', 'tablet' );
$second_cta_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'secondCta', 'mobile' );
$selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button'] = array_merge(
array(
'color' => $attr['secondCtaColor'],
'background-color' => ( 'color' === $attr['secondCtaBgType'] ) ? $attr['secondCtaBackground'] : 'transparent',
'padding-top' => UAGB_Helper::get_css_value( $attr['secondCtaTopPadding'], $attr['secondCtaPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['secondCtaBottomPadding'], $attr['secondCtaPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['secondCtaLeftPadding'], $attr['secondCtaPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['secondCtaRightPadding'], $attr['secondCtaPaddingUnit'] ),
'align-self' => 'top' === $attr['buttonAlign'] ? 'flex-start' : 'center',
'height' => 'fit-content',
),
$second_cta_border
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button:hover'] = array(
'color' => $attr['secondCtaHoverColor'],
'background-color' => ( 'color' === $attr['secondCtaBgHoverType'] ) ? $attr['secondCtaHoverBackground'] . '!important' : 'transparent',
'border-color' => $attr['secondCtaBorderHColor'],
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button:focus'] = array(
'color' => $attr['secondCtaHoverColor'],
'background-color' => ( 'color' === $attr['secondCtaBgHoverType'] ) ? $attr['secondCtaHoverBackground'] . '!important' : 'transparent',
'border-color' => $attr['secondCtaBorderHColor'],
);
$t_selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button'] = $second_cta_border_tablet;
$m_selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button'] = $second_cta_border_mobile;
$m_selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['secondCtaTopMobilePadding'], $attr['secondCtaMobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['secondCtaBottomMobilePadding'], $attr['secondCtaMobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['secondCtaLeftMobilePadding'], $attr['secondCtaMobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['secondCtaRightMobilePadding'], $attr['secondCtaMobilePaddingUnit'] ),
);
$t_selectors['.wp-block-uagb-call-to-action.wp-block-button a.uagb-cta-second__button'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['secondCtaTopTabletPadding'], $attr['secondCtaTabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['secondCtaBottomTabletPadding'], $attr['secondCtaTabletPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['secondCtaLeftTabletPadding'], $attr['secondCtaTabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['secondCtaRightTabletPadding'], $attr['secondCtaTabletPaddingUnit'] ),
);
}
if ( ! $attr['inheritFromTheme'] && 'button' === $attr['ctaType'] ) {
$cta_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn' );
$cta_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$cta_border,
( isset( $attr['ctaBorderWidth'] ) ? $attr['ctaBorderWidth'] : '' ),
( isset( $attr['ctaBorderRadius'] ) ? $attr['ctaBorderRadius'] : '' ),
( isset( $attr['ctaBorderColor'] ) ? $attr['ctaBorderColor'] : '' ),
( isset( $attr['ctaBorderStyle'] ) ? $attr['ctaBorderStyle'] : '' )
);
$cta_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'tablet' );
$cta_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'mobile' );
$selectors[' .uagb-cta__button-wrapper a.uagb-cta-typeof-button'] = array_merge(
array(
'color' => $attr['ctaBtnLinkColor'] ? $attr['ctaBtnLinkColor'] : '#333',
'background-color' => ( 'color' === $attr['ctaBgType'] ) ? $attr['ctaBgColor'] : 'transparent',
'padding-top' => UAGB_Helper::get_css_value( $btn_padding_top, $attr['ctaPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $btn_padding_bottom, $attr['ctaPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $btn_padding_left, $attr['ctaPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $btn_padding_right, $attr['ctaPaddingUnit'] ),
),
$cta_border
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__button-wrapper a.uagb-cta-typeof-button:hover'] = array(
'color' => $attr['ctaLinkHoverColor'],
'background-color' => ( 'color' === $attr['ctaBgHoverType'] ) ? $attr['ctaBgHoverColor'] : 'transparent',
'border-color' => $attr['btnBorderHColor'] ? $attr['btnBorderHColor'] : $attr['ctaBorderhoverColor'],
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__button-wrapper a.uagb-cta-typeof-button:focus'] = array(
'color' => $attr['ctaLinkHoverColor'],
'background-color' => ( 'color' === $attr['ctaBgHoverType'] ) ? $attr['ctaBgHoverColor'] : 'transparent',
'border-color' => $attr['btnBorderHColor'] ? $attr['btnBorderHColor'] : $attr['ctaBorderhoverColor'],
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__buttons a.uagb-cta__button-link-wrapper.wp-block-button__link'] = array_merge(
array(
'color' => $attr['ctaBtnLinkColor'],
'background-color' => ( 'color' === $attr['ctaBgType'] ) ? $attr['ctaBgColor'] : 'transparent',
'padding-top' => UAGB_Helper::get_css_value( $btn_padding_top, $attr['ctaPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $btn_padding_bottom, $attr['ctaPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $btn_padding_left, $attr['ctaPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $btn_padding_right, $attr['ctaPaddingUnit'] ),
),
$cta_border
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__buttons a.uagb-cta__button-link-wrapper.wp-block-button__link:hover'] = array(
'color' => $attr['ctaLinkHoverColor'],
'background-color' => ( 'color' === $attr['ctaBgHoverType'] ) ? $attr['ctaBgHoverColor'] : 'transparent',
'border-color' => $attr['btnBorderHColor'] ? $attr['btnBorderHColor'] : $attr['ctaBorderhoverColor'],
);
$selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__buttons a.uagb-cta__button-link-wrapper.wp-block-button__link:focus'] = array(
'color' => $attr['ctaLinkHoverColor'],
'background-color' => ( 'color' === $attr['ctaBgHoverType'] ) ? $attr['ctaBgHoverColor'] : 'transparent',
'border-color' => $attr['btnBorderHColor'] ? $attr['btnBorderHColor'] : $attr['ctaBorderhoverColor'],
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['ctaTopPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['ctaBottomPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['ctaLeftPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['ctaRightPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
);
$t_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper'] = $cta_border_tablet;
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['ctaTopPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['ctaBottomPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['ctaLeftPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['ctaRightPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
);
$m_selectors['.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper'] = $cta_border_mobile;
$t_selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__buttons a.uagb-cta__button-link-wrapper.wp-block-button__link'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['ctaTopPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['ctaBottomPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['ctaLeftPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['ctaRightPaddingTablet'], $attr['tabletCTAPaddingUnit'] ),
),
$cta_border_tablet
);
$m_selectors['.wp-block-uagb-call-to-action.wp-block-button .uagb-cta__buttons a.uagb-cta__button-link-wrapper.wp-block-button__link'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['ctaTopPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['ctaBottomPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['ctaLeftPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['ctaRightPaddingMobile'], $attr['mobileCTAPaddingUnit'] ),
),
$cta_border_mobile
);
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
if ( ! $attr['inheritFromTheme'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'cta', '.wp-block-uagb-call-to-action a.uagb-cta__button-link-wrapper', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'cta', ' .uagb-cta__button-wrapper a.uagb-cta__button-link-wrapper', $combined_selectors );
}
if ( ! $attr['secInheritFromTheme'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'secondCta', '.wp-block-uagb-call-to-action a.uagb-cta-second__button', $combined_selectors );
}
if ( 'text' === $attr['ctaType'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'cta', ' .uagb-cta__button-wrapper a.uagb-cta-typeof-text', $combined_selectors );
}
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'title', ' .uagb-cta__title', $combined_selectors );
if ( $attr['enableMultilineParagraph'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'desc', ' .uagb-cta__desc p', $combined_selectors );
} else {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'desc', ' .uagb-cta__desc', $combined_selectors );
}
$base_selector = ( $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-cta-block-';
return UAGB_Helper::generate_all_css(
$combined_selectors,
$base_selector . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,229 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$field_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'input' );
$button_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'btn' );
return array_merge(
array(
'block_id' => '',
'align' => 'left',
'formId' => '0',
'fieldStyle' => 'box',
'fieldHrPadding' => 10,
'fieldVrPadding' => 10,
'fieldBgColor' => '#fafafa',
'fieldLabelColor' => '#333',
'fieldInputColor' => '#333',
'buttonAlignment' => 'left',
'buttonAlignmentTablet' => '',
'buttonAlignmentMobile' => '',
'buttonVrPadding' => 10,
'buttonHrPadding' => 25,
'buttonTextColor' => '#333',
'buttonBgColor' => '',
'buttonTextHoverColor' => '',
'buttonBgHoverColor' => '',
'fieldSpacing' => '',
'fieldSpacingTablet' => '',
'fieldSpacingMobile' => '',
'fieldLabelSpacing' => '',
'fieldLabelSpacingMobile' => '',
'fieldLabelSpacingTablet' => '',
'labelFontSize' => '',
'labelFontSizeType' => 'px',
'labelFontSizeTablet' => '',
'labelFontSizeMobile' => '',
'labelFontFamily' => '',
'labelFontWeight' => '',
'labelFontStyle' => '',
'labelTransform' => '',
'labelDecoration' => '',
'labelLineHeightType' => 'px',
'labelLineHeight' => '',
'labelLineHeightTablet' => '',
'labelLineHeightMobile' => '',
'labelLoadGoogleFonts' => false,
'inputFontSize' => '',
'inputFontSizeType' => 'px',
'inputFontSizeTablet' => '',
'inputFontSizeMobile' => '',
'inputFontFamily' => '',
'inputFontWeight' => '',
'inputFontStyle' => '',
'inputTransform' => '',
'inputDecoration' => '',
'inputLineHeightType' => 'px',
'inputLineHeight' => '',
'inputLineHeightTablet' => '',
'inputLineHeightMobile' => '',
'inputLoadGoogleFonts' => false,
'buttonFontSize' => '',
'buttonFontSizeType' => 'px',
'buttonFontSizeTablet' => '',
'buttonFontSizeMobile' => '',
'buttonFontFamily' => '',
'buttonFontWeight' => '',
'buttonFontStyle' => '',
'buttonTransform' => '',
'buttonDecoration' => '',
'buttonLineHeightType' => 'px',
'buttonLineHeight' => '',
'buttonLineHeightTablet' => '',
'buttonLineHeightMobile' => '',
'buttonLoadGoogleFonts' => false,
'enableOveride' => true,
'radioCheckSize' => '',
'radioCheckSizeTablet' => '',
'radioCheckSizeMobile' => '',
'radioCheckBgColor' => '',
'radioCheckSelectColor' => '',
'radioCheckLableColor' => '',
'radioCheckBorderColor' => '#abb8c3',
'radioCheckBorderWidth' => '',
'radioCheckBorderWidthTablet' => '',
'radioCheckBorderWidthMobile' => '',
'radioCheckBorderWidthUnit' => 'px',
'radioCheckBorderRadius' => '',
'radioCheckFontSize' => '',
'radioCheckFontSizeType' => 'px',
'radioCheckFontSizeTablet' => '',
'radioCheckFontSizeMobile' => '',
'radioCheckFontFamily' => '',
'radioCheckFontWeight' => '',
'radioCheckFontStyle' => '',
'radioCheckTransform' => '',
'radioCheckDecoration' => '',
'radioCheckLineHeightType' => 'px',
'radioCheckLineHeight' => '',
'radioCheckLineHeightTablet' => '',
'radioCheckLineHeightMobile' => '',
'radioCheckLoadGoogleFonts' => false,
'validationMsgPosition' => 'default',
'validationMsgColor' => '#ff0000',
'validationMsgBgColor' => '',
'enableHighlightBorder' => false,
'highlightBorderColor' => '#ff0000',
'validationMsgFontSize' => '',
'validationMsgFontSizeType' => 'px',
'validationMsgFontSizeTablet' => '',
'validationMsgFontSizeMobile' => '',
'validationMsgFontFamily' => '',
'validationMsgFontWeight' => '',
'validationMsgFontStyle' => '',
'validationMsgTransform' => '',
'validationMsgDecoration' => '',
'validationMsgLineHeightType' => 'em',
'validationMsgLineHeight' => '',
'validationMsgLineHeightTablet' => '',
'validationMsgLineHeightMobile' => '',
'validationMsgLoadGoogleFonts' => false,
'successMsgColor' => '',
'successMsgBgColor' => '',
'successMsgBorderColor' => '',
'errorMsgColor' => '',
'errorMsgBgColor' => '',
'errorMsgBorderColor' => '',
'msgBorderSize' => '',
'msgBorderSizeUnit' => 'px',
'msgBorderRadius' => '',
'msgVrPadding' => '',
'msgHrPadding' => '',
'msgFontSize' => '',
'msgFontSizeType' => 'px',
'msgFontSizeTablet' => '',
'msgFontSizeMobile' => '',
'msgFontFamily' => '',
'msgFontWeight' => '',
'msgFontStyle' => '',
'msgTransform' => '',
'msgDecoration' => '',
'msgLineHeightType' => 'em',
'msgLineHeight' => '',
'msgLineHeightTablet' => '',
'msgLineHeightMobile' => '',
'msgLoadGoogleFonts' => false,
'radioCheckBorderRadiusType' => 'px',
'msgBorderRadiusType' => 'px',
'fieldBorderRadiusType' => 'px',
'buttonBorderRadiusType' => 'px',
'messageTopPaddingTablet' => '',
'messageBottomPaddingTablet' => '',
'messageLeftPaddingTablet' => '',
'messageRightPaddingTablet' => '',
'messageTopPaddingMobile' => '',
'messageBottomPaddingMobile' => '',
'messageLeftPaddingMobile' => '',
'messageRightPaddingMobile' => '',
'messagePaddingTypeDesktop' => 'px',
'messagePaddingTypeTablet' => 'px',
'messagePaddingTypeMobile' => 'px',
'messageSpacingLink' => false,
'buttonTopPaddingTablet' => '',
'buttonBottomPaddingTablet' => '',
'buttonLeftPaddingTablet' => '',
'buttonRightPaddingTablet' => '',
'buttonTopPaddingMobile' => '',
'buttonBottomPaddingMobile' => '',
'buttonLeftPaddingMobile' => '',
'buttonRightPaddingMobile' => '',
'buttonPaddingTypeDesktop' => 'px',
'buttonPaddingTypeTablet' => 'px',
'buttonPaddingTypeMobile' => 'px',
'buttonSpacingLink' => false,
'fieldTopPaddingTablet' => '',
'fieldBottomPaddingTablet' => '',
'fieldLeftPaddingTablet' => '',
'fieldRightPaddingTablet' => '',
'fieldTopPaddingMobile' => '',
'fieldBottomPaddingMobile' => '',
'fieldLeftPaddingMobile' => '',
'fieldRightPaddingMobile' => '',
'fieldPaddingTypeDesktop' => 'px',
'fieldPaddingTypeTablet' => 'px',
'fieldPaddingTypeMobile' => 'px',
'fieldSpacingLink' => false,
'labelLetterSpacing' => '',
'labelLetterSpacingTablet' => '',
'labelLetterSpacingMobile' => '',
'labelLetterSpacingType' => 'px',
'inputLetterSpacing' => '',
'inputLetterSpacingTablet' => '',
'inputLetterSpacingMobile' => '',
'inputLetterSpacingType' => 'px',
'radioCheckLetterSpacing' => '',
'radioCheckLetterSpacingTablet' => '',
'radioCheckLetterSpacingMobile' => '',
'radioCheckLetterSpacingType' => 'px',
'buttonLetterSpacing' => '',
'buttonLetterSpacingTablet' => '',
'buttonLetterSpacingMobile' => '',
'buttonLetterSpacingType' => 'px',
'validationMsgLetterSpacing' => '',
'validationMsgLetterSpacingTablet' => '',
'validationMsgLetterSpacingMobile' => '',
'validationMsgLetterSpacingType' => 'px',
'msgLetterSpacing' => '',
'msgLetterSpacingTablet' => '',
'msgLetterSpacingMobile' => '',
'msgLetterSpacingType' => 'px',
'fieldBorderStyle' => 'solid',
'fieldBorderWidth' => 1,
'fieldBorderRadius' => 0,
'fieldBorderColor' => '#eeeeee',
'fieldBorderFocusColor' => '',
'buttonBorderStyle' => 'solid',
'buttonBorderWidth' => 1,
'buttonBorderRadius' => 0,
'buttonBorderColor' => '#333',
'buttonBorderHoverColor' => '#333',
),
$field_border_attribute,
$button_border_attribute
);

View File

@@ -0,0 +1,26 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/cf7-styler';
$block_data = array(
'doc' => 'contact-form-7-styler',
'slug' => '',
'admin_categories' => array( 'form' ),
'link' => 'contact-form-7-styler-legacy',
'title' => __( 'Contact Form 7 Designer', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Highly customize and style your Contact Form 7 forms.', 'ultimate-addons-for-gutenberg' ),
'is_active' => class_exists( 'WPCF7_ContactForm' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'cf7-styler' ),
'deprecated' => true,
'dynamic_assets' => array(
'dir' => 'cf7-styler',
),
);

View File

@@ -0,0 +1,590 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_cf7_styler_gfont( $attr );
$message_top_padding_dekstop = isset( $attr['messageTopPaddingDesktop'] ) ? $attr['messageTopPaddingDesktop'] : $attr['msgVrPadding'];
$message_bottom_padding_dekstop = isset( $attr['messageBottomPaddingDesktop'] ) ? $attr['messageBottomPaddingDesktop'] : $attr['msgVrPadding'];
$message_left_padding_dekstop = isset( $attr['messageLeftPaddingDesktop'] ) ? $attr['messageLeftPaddingDesktop'] : $attr['msgHrPadding'];
$message_right_padding_dekstop = isset( $attr['messageRightPaddingDesktop'] ) ? $attr['messageRightPaddingDesktop'] : $attr['msgHrPadding'];
$button_top_padding_dekstop = isset( $attr['buttonTopPaddingDesktop'] ) ? $attr['buttonTopPaddingDesktop'] : $attr['buttonVrPadding'];
$button_bottom_padding_dekstop = isset( $attr['buttonBottomPaddingDesktop'] ) ? $attr['buttonBottomPaddingDesktop'] : $attr['buttonVrPadding'];
$button_left_padding_dekstop = isset( $attr['buttonLeftPaddingDesktop'] ) ? $attr['buttonLeftPaddingDesktop'] : $attr['buttonHrPadding'];
$button_right_padding_dekstop = isset( $attr['buttonRightPaddingDesktop'] ) ? $attr['buttonRightPaddingDesktop'] : $attr['buttonHrPadding'];
$field_top_padding_dekstop = isset( $attr['fieldTopPaddingDesktop'] ) ? UAGB_Helper::get_css_value( $attr['fieldTopPaddingDesktop'], $attr['fieldPaddingTypeDesktop'] ) : UAGB_Helper::get_css_value( $attr['fieldVrPadding'], $attr['fieldPaddingTypeDesktop'] );
$field_bottom_padding_dekstop = isset( $attr['fieldBottomPaddingDesktop'] ) ? UAGB_Helper::get_css_value( $attr['fieldBottomPaddingDesktop'], $attr['fieldPaddingTypeDesktop'] ) : UAGB_Helper::get_css_value( $attr['fieldVrPadding'], $attr['fieldPaddingTypeDesktop'] );
$field_left_padding_dekstop = isset( $attr['fieldLeftPaddingDesktop'] ) ? UAGB_Helper::get_css_value( $attr['fieldLeftPaddingDesktop'], $attr['fieldPaddingTypeDesktop'] ) : UAGB_Helper::get_css_value( $attr['fieldHrPadding'], $attr['fieldPaddingTypeDesktop'] );
$field_right_padding_dekstop = isset( $attr['fieldRightPaddingDesktop'] ) ? UAGB_Helper::get_css_value( $attr['fieldRightPaddingDesktop'], $attr['fieldPaddingTypeDesktop'] ) : UAGB_Helper::get_css_value( $attr['fieldHrPadding'], $attr['fieldPaddingTypeDesktop'] );
$field_vr_padding = isset( $attr['fieldTopPaddingDesktop'] ) ? $attr['fieldTopPaddingDesktop'] : $attr['fieldVrPadding'];
$border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'input' );
$border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$border,
( isset( $attr['fieldBorderWidth'] ) ? $attr['fieldBorderWidth'] : '' ),
( isset( $attr['fieldBorderRadius'] ) ? $attr['fieldBorderRadius'] : '' ),
( isset( $attr['fieldBorderColor'] ) ? $attr['fieldBorderColor'] : '' ),
( isset( $attr['fieldBorderStyle'] ) ? $attr['fieldBorderStyle'] : '' )
);
$border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'input', 'tablet' );
$border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'input', 'mobile' );
$btn_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn' );
$btn_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$btn_border,
( isset( $attr['buttonBorderWidth'] ) ? $attr['buttonBorderWidth'] : '' ),
( isset( $attr['buttonBorderRadius'] ) ? $attr['buttonBorderRadius'] : '' ),
( isset( $attr['buttonBorderColor'] ) ? $attr['buttonBorderColor'] : '' ),
( isset( $attr['buttonBorderStyle'] ) ? $attr['buttonBorderStyle'] : '' )
);
$btn_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'tablet' );
$btn_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'mobile' );
$selectors = array(
' .wpcf7 .wpcf7-form' => array(
'text-align' => $attr['align'],
),
' .wpcf7 form.wpcf7-form:not(input)' => array(
'color' => $attr['fieldLabelColor'],
),
' .wpcf7 input:not([type=submit])' => array_merge(
array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'padding-left' => $field_left_padding_dekstop,
'padding-right' => $field_right_padding_dekstop,
'padding-top' => $field_top_padding_dekstop,
'padding-bottom' => $field_bottom_padding_dekstop,
'margin-top' => UAGB_Helper::get_css_value( $attr['fieldLabelSpacing'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldSpacing'], 'px' ),
'text-align' => $attr['align'],
),
$border
),
' .wpcf7 select' => array_merge(
array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldLabelColor'],
'margin-top' => UAGB_Helper::get_css_value( $attr['fieldLabelSpacing'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldSpacing'], 'px' ),
'text-align' => $attr['align'],
),
$border
),
' .wpcf7 select.wpcf7-form-control.wpcf7-select:not([multiple="multiple"])' => array(
'padding-left' => $field_left_padding_dekstop,
'padding-right' => $field_right_padding_dekstop,
'padding-top' => $field_top_padding_dekstop,
'padding-bottom' => $field_bottom_padding_dekstop,
),
' .wpcf7 select.wpcf7-select[multiple="multiple"] option' => array(
'padding-left' => $field_left_padding_dekstop,
'padding-right' => $field_right_padding_dekstop,
'padding-top' => $field_top_padding_dekstop,
'padding-bottom' => $field_bottom_padding_dekstop,
),
' .wpcf7 textarea' => array_merge(
array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'padding-left' => $field_left_padding_dekstop,
'padding-right' => $field_right_padding_dekstop,
'padding-top' => $field_top_padding_dekstop,
'padding-bottom' => $field_bottom_padding_dekstop,
'margin-top' => UAGB_Helper::get_css_value( $attr['fieldLabelSpacing'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldSpacing'], 'px' ),
'text-align' => $attr['align'],
),
$border
),
' .wpcf7 textarea::placeholder' => array(
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
),
' .wpcf7 input::placeholder' => array(
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
),
// Focus.
' .wpcf7 form input:not([type=submit]):focus' => array(
'border-color' => ! empty( $attr['inputBorderHColor'] ) ? $attr['inputBorderHColor'] : $attr['fieldBorderFocusColor'],
),
' .wpcf7 form select:focus' => array(
'border-color' => ! empty( $attr['inputBorderHColor'] ) ? $attr['inputBorderHColor'] : $attr['fieldBorderFocusColor'],
),
' .wpcf7 textarea:focus' => array(
'border-color' => ! empty( $attr['inputBorderHColor'] ) ? $attr['inputBorderHColor'] : $attr['fieldBorderFocusColor'],
),
// Submit button.
' .wpcf7 input.wpcf7-form-control.wpcf7-submit' => array_merge(
array(
'color' => $attr['buttonTextColor'],
'background-color' => $attr['buttonBgColor'],
'padding-left' => UAGB_Helper::get_css_value( $button_left_padding_dekstop, $attr['buttonPaddingTypeDesktop'] ),
'padding-right' => UAGB_Helper::get_css_value( $button_right_padding_dekstop, $attr['buttonPaddingTypeDesktop'] ),
'padding-top' => UAGB_Helper::get_css_value( $button_top_padding_dekstop, $attr['buttonPaddingTypeDesktop'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $button_bottom_padding_dekstop, $attr['buttonPaddingTypeDesktop'] ),
),
$btn_border
),
' .wpcf7 input.wpcf7-form-control.wpcf7-submit:hover' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['buttonBorderHoverColor'],
),
' .wpcf7 input.wpcf7-form-control.wpcf7-submit:focus' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['buttonBorderHoverColor'],
),
// Check box Radio.
' .wpcf7 .wpcf7-checkbox input[type="checkbox"]:checked + span:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
'border-color' => $attr['inputBorderHColor'],
),
' .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array_merge(
array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => $field_top_padding_dekstop,
'width' => $field_top_padding_dekstop,
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
),
$border
),
' .wpcf7 .wpcf7-acceptance input[type="checkbox"]:checked + span:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
'border-color' => $attr['inputBorderHColor'],
),
' .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array_merge(
array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => $field_top_padding_dekstop,
'width' => $field_top_padding_dekstop,
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
),
$border
),
' .wpcf7 .wpcf7-radio input[type="radio"] + span:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => $field_top_padding_dekstop,
'width' => $field_top_padding_dekstop,
'border-style' => $attr['inputBorderStyle'],
'border-color' => $attr['inputBorderColor'],
'border-top-width' => UAGB_Helper::get_css_value( $attr['inputBorderTopWidth'], 'px' ),
'border-left-width' => UAGB_Helper::get_css_value( $attr['inputBorderLeftWidth'], 'px' ),
'border-right-width' => UAGB_Helper::get_css_value( $attr['inputBorderRightWidth'], 'px' ),
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidth'], 'px' ),
),
' .wpcf7 .wpcf7-radio input[type="radio"]:checked + span:before' => array(
'border-color' => $attr['inputBorderHColor'],
),
// Underline border.
' .uagb-cf7-styler__field-style-underline .wpcf7 input:not([type=submit])' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['inputBorderColor'],
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidth'], 'px' ),
'border-top-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopLeftRadius'], 'px' ),
'border-top-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopRightRadius'], 'px' ),
'border-bottom-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomRightRadius'], 'px' ),
'border-bottom-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomLeftRadius'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline textarea' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['inputBorderColor'],
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidth'], 'px' ),
'border-top-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopLeftRadius'], 'px' ),
'border-top-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopRightRadius'], 'px' ),
'border-bottom-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomRightRadius'], 'px' ),
'border-bottom-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomLeftRadius'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline select' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['inputBorderColor'],
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidth'], 'px' ),
'border-top-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopLeftRadius'], 'px' ),
'border-top-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopRightRadius'], 'px' ),
'border-bottom-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomRightRadius'], 'px' ),
'border-bottom-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomLeftRadius'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline .wpcf7-checkbox input[type="checkbox"] + span:before' => array(
'border-style' => $attr['inputBorderStyle'],
),
' .uagb-cf7-styler__field-style-underline .wpcf7 input[type="radio"] + span:before' => array(
'border-style' => $attr['inputBorderStyle'],
),
' .uagb-cf7-styler__field-style-underline .wpcf7-acceptance input[type="checkbox"] + span:before' => array(
'border-style' => $attr['inputBorderStyle'],
),
' .uagb-cf7-styler__field-style-box .wpcf7-checkbox input[type="checkbox"]:checked + span:before' => array_merge(
array(
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
),
$border
),
' .uagb-cf7-styler__field-style-box .wpcf7-acceptance input[type="checkbox"]:checked + span:before' => array_merge(
array(
'font-size' => 'calc( ' . $field_vr_padding . 'px / 1.2 )',
),
$border
),
' .wpcf7-radio input[type="radio"]:checked + span:before' => array(
'background-color' => $attr['fieldInputColor'],
),
// Override check box.
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidth'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['radioCheckBorderRadius'], $attr['radioCheckBorderRadiusType'] ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-checkbox input[type="checkbox"]:checked + span:before' => array(
'border-color' => $attr['inputBorderHColor'],
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidth'], 'px' ),
'border-radius' => UAGB_Helper::get_css_value( $attr['radioCheckBorderRadius'], $attr['radioCheckBorderRadiusType'] ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-acceptance input[type="checkbox"]:checked + span:before' => array(
'border-color' => $attr['inputBorderHColor'],
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 input[type="radio"] + span:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSize'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidth'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7-radio input[type="radio"]:checked + span:before' => array(
'background-color' => $attr['radioCheckSelectColor'],
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 form .wpcf7-list-item-label' => array(
'color' => $attr['radioCheckLableColor'],
),
' span.wpcf7-not-valid-tip' => array(
'color' => $attr['validationMsgColor'],
),
' .uagb-cf7-styler__highlight-border input.wpcf7-form-control.wpcf7-not-valid' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-cf7-styler__highlight-border .wpcf7-form-control.wpcf7-not-valid .wpcf7-list-item-label:before' => array(
'border-color' => $attr['highlightBorderColor'] . '!important',
),
' .uagb-cf7-styler__highlight-style-bottom_right .wpcf7-form-control-wrap .wpcf7-not-valid-tip' => array(
'background-color' => $attr['validationMsgBgColor'],
),
' .wpcf7 form .wpcf7-response-output' => array(
'border-width' => UAGB_Helper::get_css_value( $attr['msgBorderSize'], $attr['msgBorderSizeUnit'] ),
'border-radius' => UAGB_Helper::get_css_value( $attr['msgBorderRadius'], $attr['msgBorderRadiusType'] ),
'padding-top' => UAGB_Helper::get_css_value( $message_top_padding_dekstop, $attr['messagePaddingTypeDesktop'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $message_bottom_padding_dekstop, $attr['messagePaddingTypeDesktop'] ),
'padding-left' => UAGB_Helper::get_css_value( $message_left_padding_dekstop, $attr['messagePaddingTypeDesktop'] ),
'padding-right' => UAGB_Helper::get_css_value( $message_right_padding_dekstop, $attr['messagePaddingTypeDesktop'] ),
),
' .wpcf7 form.failed .wpcf7-response-output' => array(
'background-color' => $attr['errorMsgBgColor'],
'border-color' => $attr['errorMsgBorderColor'],
'color' => $attr['errorMsgColor'],
),
' .wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.unaccepted .wpcf7-response-output' => array(
'background-color' => $attr['errorMsgBgColor'],
'border-color' => $attr['errorMsgBorderColor'],
'color' => $attr['errorMsgColor'],
),
' .wpcf7 form.sent .wpcf7-response-output' => array(
'background-color' => $attr['successMsgBgColor'],
'border-color' => $attr['successMsgBorderColor'],
'color' => $attr['successMsgColor'],
),
);
$field_padding_tablet = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldTopPaddingTablet'], $attr['fieldPaddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldBottomPaddingTablet'], $attr['fieldPaddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldLeftPaddingTablet'], $attr['fieldPaddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldRightPaddingTablet'], $attr['fieldPaddingTypeTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['fieldLabelSpacingTablet'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldSpacingTablet'], 'px' ),
);
$t_selectors = array(
' .wpcf7 input:not([type=submit])' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .wpcf7 select' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .uagb-cf7-styler__field-style-box .wpcf7-checkbox input[type="checkbox"]:checked + span:before' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .uagb-cf7-styler__field-style-box .wpcf7-acceptance input[type="checkbox"]:checked + span:before' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .wpcf7 textarea' => array_merge(
$border_tablet,
$field_padding_tablet
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthTablet'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthTablet'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 input[type="radio"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeTablet'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthTablet'], 'px' ),
),
' .wpcf7 form.wpcf7-form:not(input)' => array(
'color' => $attr['fieldLabelColor'],
),
' .wpcf7-response-output' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['messageTopPaddingTablet'], $attr['messagePaddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['messageBottomPaddingTablet'], $attr['messagePaddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['messageLeftPaddingTablet'], $attr['messagePaddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['messageRightPaddingTablet'], $attr['messagePaddingTypeTablet'] ),
),
' .wpcf7 input.wpcf7-form-control.wpcf7-submit' => array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['buttonTopPaddingTablet'], $attr['buttonPaddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['buttonBottomPaddingTablet'], $attr['buttonPaddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['buttonLeftPaddingTablet'], $attr['buttonPaddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['buttonRightPaddingTablet'], $attr['buttonPaddingTypeTablet'] ),
),
$btn_border_tablet
),
// underline border.
' .uagb-cf7-styler__field-style-underline .wpcf7 input:not([type=submit])' => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline select' => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7-checkbox input[type='checkbox'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7 input[type='radio'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7-acceptance input[type='checkbox'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline textarea' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['inputBorderColor'],
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthTablet'], 'px' ),
'border-top-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopLeftRadiusTablet'], 'px' ),
'border-top-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopRightRadiusTablet'], 'px' ),
'border-bottom-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomRightRadiusTablet'], 'px' ),
'border-bottom-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomLeftRadiusTablet'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 input:not([type=submit])' => $field_padding_tablet,
' .uagb-cf7-styler__check-style-enabled .wpcf7 select.wpcf7-form-control.wpcf7-select:not([multiple="multiple"])' => $field_padding_tablet,
' .uagb-cf7-styler__check-style-enabled .wpcf7 select.wpcf7-select[multiple="multiple"] option' => $field_padding_tablet,
' .uagb-cf7-styler__check-style-enabled .wpcf7 textarea' => $field_padding_tablet,
);
$field_padding_mobile = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldTopPaddingMobile'], $attr['fieldPaddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldBottomPaddingMobile'], $attr['fieldPaddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldLeftPaddingMobile'], $attr['fieldPaddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldRightPaddingMobile'], $attr['fieldPaddingTypeMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['fieldLabelSpacingMobile'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldSpacingMobile'], 'px' ),
);
$m_selectors = array(
' .wpcf7 input:not([type=submit])' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .wpcf7 select' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .uagb-cf7-styler__field-style-box .wpcf7-checkbox input[type="checkbox"]:checked + span:before' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .uagb-cf7-styler__field-style-box .wpcf7-acceptance input[type="checkbox"]:checked + span:before' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .wpcf7 textarea' => array_merge(
$border_mobile,
$field_padding_mobile
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-checkbox input[type="checkbox"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthMobile'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 .wpcf7-acceptance input[type="checkbox"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthMobile'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 input[type="radio"] + span:before' => array(
'height' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['radioCheckSizeMobile'], 'px' ),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value( $attr['radioCheckBorderWidthMobile'], 'px' ),
),
' .wpcf7-response-output' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['messageTopPaddingMobile'], $attr['messagePaddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['messageBottomPaddingMobile'], $attr['messagePaddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['messageLeftPaddingMobile'], $attr['messagePaddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['messageRightPaddingMobile'], $attr['messagePaddingTypeMobile'] ),
),
' .wpcf7 input.wpcf7-form-control.wpcf7-submit' => array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['buttonTopPaddingMobile'], $attr['buttonPaddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['buttonBottomPaddingMobile'], $attr['buttonPaddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['buttonLeftPaddingMobile'], $attr['buttonPaddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['buttonRightPaddingMobile'], $attr['buttonPaddingTypeMobile'] ),
),
$btn_border_mobile
),
' .wpcf7 form.wpcf7-form:not(input)' => array(
'color' => $attr['fieldLabelColor'],
),
// underline border.
' .uagb-cf7-styler__field-style-underline .wpcf7 input:not([type=submit])' => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline select' => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7-checkbox input[type='checkbox'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7 input[type='radio'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
),
" .uagb-cf7-styler__field-style-underline .wpcf7-acceptance input[type='checkbox'] + span:before" => array(
'border-style' => 'none',
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
),
' .uagb-cf7-styler__field-style-underline textarea' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['inputBorderColor'],
'border-bottom-style' => $attr['inputBorderStyle'],
'border-bottom-width' => UAGB_Helper::get_css_value( $attr['inputBorderBottomWidthMobile'], 'px' ),
'border-top-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopLeftRadiusMobile'], 'px' ),
'border-top-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderTopRightRadiusMobile'], 'px' ),
'border-bottom-right-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomRightRadiusMobile'], 'px' ),
'border-bottom-left-radius' => UAGB_Helper::get_css_value( $attr['inputBorderBottomLeftRadiusMobile'], 'px' ),
),
' .uagb-cf7-styler__check-style-enabled .wpcf7 input:not([type=submit])' => $field_padding_mobile,
' .wpcf7 select.wpcf7-form-control.wpcf7-select:not([multiple="multiple"])' => $field_padding_mobile,
' .wpcf7 select.wpcf7-select[multiple="multiple"] option' => $field_padding_mobile,
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'radioCheck', ' .uagb-cf7-styler__check-style-enabled .wpcf7 form .wpcf7-list-item-label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'validationMsg', ' span.wpcf7-not-valid-tip', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'msg', ' .wpcf7-response-output', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'button', ' .wpcf7 input.wpcf7-form-control.wpcf7-submit', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' .wpcf7 form .wpcf7-list-item-label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' .wpcf7 form label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .wpcf7 select', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .wpcf7 textarea', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .wpcf7 input:not([type=submit])', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, '.uagb-block-' . $id );

View File

@@ -0,0 +1,77 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'column' );
return array_merge(
array(
'classMigrate' => false,
'block_id' => '',
'topPadding' => '',
'bottomPadding' => '',
'leftPadding' => '',
'rightPadding' => '',
'topMargin' => '',
'bottomMargin' => '',
'leftMargin' => '',
'rightMargin' => '',
'topPaddingTablet' => '',
'bottomPaddingTablet' => '',
'leftPaddingTablet' => '',
'rightPaddingTablet' => '',
'topPaddingMobile' => '',
'bottomPaddingMobile' => '',
'leftPaddingMobile' => '',
'rightPaddingMobile' => '',
'topMarginMobile' => '',
'bottomMarginMobile' => '',
'leftMarginMobile' => '',
'rightMarginMobile' => '',
'topMarginTablet' => '',
'bottomMarginTablet' => '',
'leftMarginTablet' => '',
'rightMarginTablet' => '',
'colWidth' => '',
'colWidthTablet' => '',
'colWidthMobile' => '',
'backgroundType' => 'none',
'backgroundImage' => '',
'backgroundPosition' => 'center-center',
'backgroundSize' => 'cover',
'backgroundRepeat' => 'no-repeat',
'backgroundAttachment' => 'scroll',
'backgroundColor' => '',
'gradientColor1' => '',
'gradientColor2' => '',
'gradientType' => 'linear',
'gradientLocation1' => 0,
'gradientLocation2' => 100,
'gradientAngle' => 0,
'backgroundImageColor' => '',
'align' => 'center',
'alignMobile' => '',
'alignTablet' => '',
'mobileMarginType' => 'px',
'tabletMarginType' => 'px',
'desktopMarginType' => 'px',
'mobilePaddingType' => 'px',
'tabletPaddingType' => 'px',
'desktopPaddingType' => 'px',
'overlayType' => 'color',
'gradientOverlayColor1' => '',
'gradientOverlayColor2' => '',
'gradientOverlayType' => 'linear',
'gradientOverlayLocation1' => '0',
'gradientOverlayLocation2' => '100',
'gradientOverlayAngle' => '0',
'gradientValue' => '',
'selectGradient' => 'basic',
),
$border_attribute
);

View File

@@ -0,0 +1,23 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/column';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Column', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Immediate child of Advanced Columns.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'extension' => false,
'dynamic_assets' => array(
'dir' => 'column',
),
'deprecated' => true,
);

View File

@@ -0,0 +1,166 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
global $content_width;
$bg_type = ( isset( $attr['backgroundType'] ) ) ? $attr['backgroundType'] : 'none';
$overlay_type = ( isset( $attr['overlayType'] ) ) ? $attr['overlayType'] : 'none';
$border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'column' );
$border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$border,
( isset( $attr['borderWidth'] ) ? $attr['borderWidth'] : '' ),
( isset( $attr['borderRadius'] ) ? $attr['borderRadius'] : '' ),
( isset( $attr['borderColor'] ) ? $attr['borderColor'] : '' ),
( isset( $attr['borderStyle'] ) ? $attr['borderStyle'] : '' )
);
$border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'column', 'tablet' );
$border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'column', 'mobile' );
$style = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPadding'], $attr['desktopPaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPadding'], $attr['desktopPaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPadding'], $attr['desktopPaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPadding'], $attr['desktopPaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['topMargin'], $attr['desktopMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMargin'], $attr['desktopMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMargin'], $attr['desktopMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMargin'], $attr['desktopMarginType'] ),
),
$border
);
$m_selectors = array();
$t_selectors = array();
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
if ( 'image' === $bg_type ) {
$style['background-image'] = ( isset( $attr['backgroundImage'] ) && isset( $attr['backgroundImage']['url'] ) ) ? "url('" . $attr['backgroundImage']['url'] . "' )" : null;
$style['background-position'] = $position;
$style['background-attachment'] = $attr['backgroundAttachment'];
$style['background-repeat'] = $attr['backgroundRepeat'];
$style['background-size'] = $attr['backgroundSize'];
}
$selectors = array(
'.uagb-column__wrap' => $style,
);
$selectors['.uagb-column__wrap:hover'] = array(
'border-color' => $attr['columnBorderHColor'],
);
if ( 'image' === $bg_type ) {
if ( 'color' === $overlay_type ) {
$selectors[' > .uagb-column__overlay'] = array(
'background-color' => $attr['backgroundImageColor'],
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 101 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
);
} else {
if ( $attr['gradientValue'] ) {
$selectors[' > .uagb-column__overlay']['background-image'] = $attr['gradientValue'];
} else {
$selectors[' > .uagb-column__overlay']['background-color'] = 'transparent';
$selectors[' > .uagb-column__overlay']['opacity'] = ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '';
if ( 'linear' === $attr['gradientOverlayType'] ) {
$selectors[' > .uagb-column__overlay']['background-image'] = 'linear-gradient(' . $attr['gradientOverlayAngle'] . 'deg, ' . $attr['gradientOverlayColor1'] . ' ' . $attr['gradientOverlayLocation1'] . '%, ' . $attr['gradientOverlayColor2'] . ' ' . $attr['gradientOverlayLocation2'] . '%)';
} else {
$selectors[' > .uagb-column__overlay']['background-image'] = 'radial-gradient( at center center, ' . $attr['gradientOverlayColor1'] . ' ' . $attr['gradientOverlayLocation1'] . '%, ' . $attr['gradientOverlayColor2'] . ' ' . $attr['gradientOverlayLocation2'] . '%)';
}
}
}
} elseif ( 'color' === $bg_type ) {
$selectors[' > .uagb-column__overlay'] = array(
'background-color' => $attr['backgroundColor'],
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 101 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
);
} elseif ( 'gradient' === $bg_type ) {
$gradientColor1 = isset( $attr['gradientColor1'] ) ? $attr['gradientColor1'] : '';
$gradientColor2 = isset( $attr['gradientColor2'] ) ? $attr['gradientColor2'] : '';
$gradientType = isset( $attr['gradientType'] ) ? $attr['gradientType'] : '';
$gradientLocation1 = isset( $attr['gradientLocation1'] ) ? $attr['gradientLocation1'] : '';
$gradientLocation2 = isset( $attr['gradientLocation2'] ) ? $attr['gradientLocation2'] : '';
$gradientAngle = isset( $attr['gradientAngle'] ) ? $attr['gradientAngle'] : '';
if ( 'basic' === $attr['selectGradient'] && $attr['gradientValue'] ) {
$gradient = $attr['gradientValue'];
} elseif ( 'linear' === $gradientType && 'advanced' === $attr['selectGradient'] ) {
$gradient = 'linear-gradient(' . $gradientAngle . 'deg, ' . $gradientColor1 . ' ' . $gradientLocation1 . '%, ' . $gradientColor2 . ' ' . $gradientLocation2 . '%)';
} elseif ( 'radial' === $gradientType && 'advanced' === $attr['selectGradient'] ) {
$gradient = 'radial-gradient( at center center, ' . $gradientColor1 . ' ' . $gradientLocation1 . '%, ' . $gradientColor2 . ' ' . $gradientLocation2 . '%)';
}
$selectors[' > .uagb-column__overlay']['background-image'] = $gradient;
}
$selectors[' > .uagb-column__overlay']['border-radius'] = $attr['columnBorderTopLeftRadius'] . ' ' . $attr['columnBorderTopRightRadius'] . ' ' . $attr['columnBorderBottomLeftRadius'] . ' ' . $attr['columnBorderBottomRightRadius'];
if ( '' !== $attr['colWidth'] && 0 !== $attr['colWidth'] ) {
$selectors['.uagb-column__wrap']['width'] = UAGB_Helper::get_css_value( $attr['colWidth'], '%' );
}
$m_selectors = array(
'.uagb-column__wrap' => array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingMobile'], $attr['mobilePaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginMobile'], $attr['mobileMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginMobile'], $attr['mobileMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginMobile'], $attr['mobileMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginMobile'], $attr['mobileMarginType'] ),
),
$border_mobile
),
);
$t_selectors = array(
'.uagb-column__wrap' => array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingTablet'], $attr['tabletPaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginTablet'], $attr['tabletMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginTablet'], $attr['tabletMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginTablet'], $attr['tabletMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginTablet'], $attr['tabletMarginType'] ),
),
$border_tablet
),
);
if ( '' !== $attr['colWidthTablet'] && 0 !== $attr['colWidthTablet'] ) {
$t_selectors['.uagb-column__wrap']['width'] = UAGB_Helper::get_css_value( $attr['colWidthTablet'], '%' );
}
if ( '' !== $attr['colWidthMobile'] && 0 !== $attr['colWidthMobile'] ) {
$m_selectors['.uagb-column__wrap']['width'] = UAGB_Helper::get_css_value( $attr['colWidthMobile'], '%' );
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = ( $attr['classMigrate'] ) ? '.wp-block-uagb-column.uagb-block-' : '#uagb-column-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,92 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'columns' );
return array_merge(
array(
'classMigrate' => false,
'block_id' => '',
'columns' => '2',
'align' => '',
'vAlign' => '',
'stack' => 'mobile',
'topPadding' => '20',
'bottomPadding' => '20',
'leftPadding' => '20',
'rightPadding' => '20',
'topMargin' => '0',
'bottomMargin' => '0',
'topPaddingTablet' => '',
'bottomPaddingTablet' => '',
'leftPaddingTablet' => '',
'rightPaddingTablet' => '',
'topPaddingMobile' => '',
'bottomPaddingMobile' => '',
'leftPaddingMobile' => '',
'rightPaddingMobile' => '',
'topMarginMobile' => '',
'bottomMarginMobile' => '',
'topMarginTablet' => '',
'bottomMarginTablet' => '',
'contentWidth' => 'theme',
'width' => '900',
'widthType' => 'px',
'tag' => 'section',
'backgroundType' => 'none',
'backgroundImage' => '',
'backgroundPosition' => 'center-center',
'backgroundSize' => 'cover',
'backgroundRepeat' => 'no-repeat',
'backgroundAttachment' => 'scroll',
'backgroundVideo' => '',
'backgroundColor' => '',
'gradientColor1' => '',
'gradientColor2' => '',
'gradientType' => 'linear',
'gradientLocation1' => '0',
'gradientLocation2' => '100',
'gradientAngle' => '0',
'gradientPosition' => 'center center',
'selectGradient' => 'basic',
'backgroundVideoOpacity' => '50',
'backgroundVideoColor' => '',
'backgroundImageColor' => '',
'columnGap' => '10',
'bottomType' => 'none',
'bottomColor' => '#333',
'bottomHeight' => '',
'bottomHeightTablet' => '',
'bottomHeightMobile' => '',
'bottomWidth' => '',
'topType' => 'none',
'topColor' => '#333',
'topHeight' => '',
'topHeightTablet' => '',
'topHeightMobile' => '',
'topWidth' => '',
'bottomFlip' => '',
'topFlip' => '',
'mobileMarginType' => 'px',
'tabletMarginType' => 'px',
'desktopMarginType' => 'px',
'mobilePaddingType' => 'px',
'tabletPaddingType' => 'px',
'desktopPaddingType' => 'px',
'boxShadowColor' => '',
'boxShadowHOffset' => 0,
'boxShadowVOffset' => 0,
'boxShadowBlur' => '',
'boxShadowSpread' => '',
'boxShadowPosition' => 'outset',
'gradientValue' => 'linear-gradient(90deg, rgb(6, 147, 227, 0.5) 0%, rgb(155, 81, 224, 0.5) 100%)',
'overlayType' => 'color',
),
$border_attribute
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/columns';
$block_data = array(
'admin_categories' => array(),
'doc' => 'advanced-columns',
'slug' => '',
'link' => 'advanced-columns-legacy',
'title' => __( 'Advanced Columns', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Insert a number of columns within a single row.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'columns' ),
'deprecated' => true,
'dynamic_assets' => array(
'dir' => 'columns',
),
);

View File

@@ -0,0 +1,231 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
global $content_width;
$bg_type = ( isset( $attr['backgroundType'] ) ) ? $attr['backgroundType'] : 'none';
$overlay_type = ( isset( $attr['overlayType'] ) ) ? $attr['overlayType'] : 'color';
$border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'columns' );
$border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$border,
( isset( $attr['borderWidth'] ) ? $attr['borderWidth'] : '' ),
( isset( $attr['borderRadius'] ) ? $attr['borderRadius'] : '' ),
( isset( $attr['borderColor'] ) ? $attr['borderColor'] : '' ),
( isset( $attr['borderStyle'] ) ? $attr['borderStyle'] : '' )
);
$border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'columns', 'tablet' );
$border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'columns', 'mobile' );
$top_margin = isset( $attr['topMarginDesktop'] ) ? $attr['topMarginDesktop'] : $attr['topMargin'];
$bottom_margin = isset( $attr['bottomMarginDesktop'] ) ? $attr['bottomMarginDesktop'] : $attr['bottomMargin'];
$left_margin = isset( $attr['leftMarginDesktop'] ) ? $attr['leftMarginDesktop'] : '';
$right_margin = isset( $attr['rightMarginDesktop'] ) ? $attr['rightMarginDesktop'] : '';
$mobile_top_margin = $attr['topMarginMobile'];
$mobile_bottom_margin = $attr['bottomMarginMobile'];
$mobile_left_margin = isset( $attr['leftMarginMobile'] ) ? $attr['leftMarginMobile'] : '';
$mobile_right_margin = isset( $attr['rightMarginMobile'] ) ? $attr['rightMarginMobile'] : '';
$tablet_top_margin = $attr['topMarginTablet'];
$tablet_bottom_margin = $attr['bottomMarginTablet'];
$tablet_left_margin = isset( $attr['leftMarginTablet'] ) ? $attr['leftMarginTablet'] : '';
$tablet_right_margin = isset( $attr['rightMarginTablet'] ) ? $attr['rightMarginTablet'] : '';
$m_selectors = array();
$t_selectors = array();
$boxShadowPositionCSS = $attr['boxShadowPosition'];
if ( 'outset' === $attr['boxShadowPosition'] ) {
$boxShadowPositionCSS = '';
}
$style = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPadding'], $attr['desktopPaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPadding'], $attr['desktopPaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPadding'], $attr['desktopPaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPadding'], $attr['desktopPaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $top_margin, $attr['desktopMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $bottom_margin, $attr['desktopMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $left_margin, $attr['desktopMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $right_margin, $attr['desktopMarginType'] ),
);
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
if ( 'image' === $bg_type ) {
$style['background-image'] = ( isset( $attr['backgroundImage'] ) && isset( $attr['backgroundImage']['url'] ) ) ? "url('" . $attr['backgroundImage']['url'] . "' )" : null;
$style['background-position'] = $position;
$style['background-attachment'] = $attr['backgroundAttachment'];
$style['background-repeat'] = $attr['backgroundRepeat'];
$style['background-size'] = $attr['backgroundSize'];
}
$inner_width = '100%';
if ( isset( $attr['contentWidth'] ) ) {
if ( 'theme' === $attr['contentWidth'] ) {
$inner_width = UAGB_Helper::get_css_value( $content_width, 'px' );
} elseif ( 'custom' === $attr['contentWidth'] ) {
$inner_width = UAGB_Helper::get_css_value( $attr['width'], $attr['widthType'] );
}
}
$video_opacity = 0.5;
if ( isset( $attr['backgroundVideoOpacity'] ) && '' !== $attr['backgroundVideoOpacity'] ) {
$video_opacity = ( 1 < $attr['backgroundVideoOpacity'] ) ? ( ( 100 - $attr['backgroundVideoOpacity'] ) / 100 ) : ( ( 1 - $attr['backgroundVideoOpacity'] ) );
}
$selectors = array(
'.wp-block-uagb-columns.uagb-columns__wrap' => $style,
' .uagb-columns__video-wrap' => array(
'opacity' => $video_opacity,
),
' > .uagb-columns__inner-wrap' => array( // For backward user.
'max-width' => $inner_width,
),
' .uagb-column__inner-wrap' => array( // For backward user.
'padding' => UAGB_Helper::get_css_value( $attr['columnGap'], 'px' ),
),
' .uagb-column__wrap' => array(
'padding' => UAGB_Helper::get_css_value( $attr['columnGap'], 'px' ),
),
' .uagb-columns__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeight'], 'px' ),
),
' .uagb-columns__shape.uagb-columns__shape-top .uagb-columns__shape-fill' => array(
'fill' => UAGB_Helper::hex2rgba( $attr['topColor'], ( isset( $attr['topDividerOpacity'] ) && '' !== $attr['topDividerOpacity'] ) ? $attr['topDividerOpacity'] : 100 ),
),
' .uagb-columns__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeight'], 'px' ),
),
' .uagb-columns__shape.uagb-columns__shape-bottom .uagb-columns__shape-fill' => array(
'fill' => UAGB_Helper::hex2rgba( $attr['bottomColor'], ( isset( $attr['bottomDividerOpacity'] ) && '' !== $attr['bottomDividerOpacity'] ) ? $attr['bottomDividerOpacity'] : 100 ),
),
'.wp-block-uagb-columns' => array(
'box-shadow' => UAGB_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) . ' ' . UAGB_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) . ' ' . UAGB_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) . ' ' . UAGB_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) . ' ' . $attr['boxShadowColor'] . ' ' . $boxShadowPositionCSS,
),
);
if ( '' !== $attr['topWidth'] ) {
$selectors[' .uagb-columns__shape-top svg']['width'] = 'calc( ' . $attr['topWidth'] . '% + 1.3px )';
}
if ( '' !== $attr['bottomWidth'] ) {
$selectors[' .uagb-columns__shape-bottom svg']['width'] = 'calc( ' . $attr['bottomWidth'] . '% + 1.3px )';
}
if ( 'video' === $bg_type ) {
if ( 'color' === $overlay_type ) {
$selectors[' > .uagb-columns__overlay'] = array(
'background-color' => $attr['backgroundVideoColor'],
);
} else {
$selectors[' > .uagb-columns__overlay']['background-image'] = $attr['gradientValue'];
}
} elseif ( 'image' === $bg_type ) {
if ( 'color' === $overlay_type ) {
$selectors[' > .uagb-columns__overlay'] = array(
'background-color' => $attr['backgroundImageColor'],
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 101 !== $attr['backgroundOpacity'] && 0 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
);
} else {
if ( $attr['gradientValue'] ) {
$selectors[' > .uagb-columns__overlay']['background-image'] = $attr['gradientValue'];
} else {
$selectors[' > .uagb-columns__overlay']['background-color'] = 'transparent';
$selectors[' > .uagb-columns__overlay']['opacity'] = ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 101 !== $attr['backgroundOpacity'] && 0 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '';
if ( 'linear' === $attr['gradientOverlayType'] ) {
$selectors[' > .uagb-columns__overlay']['background-image'] = 'linear-gradient(' . $attr['gradientOverlayAngle'] . 'deg, ' . $attr['gradientOverlayColor1'] . ' ' . $attr['gradientOverlayLocation1'] . '%, ' . $attr['gradientOverlayColor2'] . ' ' . $attr['gradientOverlayLocation2'] . '%)';
} else {
$selectors[' > .uagb-columns__overlay']['background-image'] = 'radial-gradient( at ' . $gradientOverlayPosition . ', ' . $attr['gradientOverlayColor1'] . ' ' . $attr['gradientOverlayLocation1'] . '%, ' . $attr['gradientOverlayColor2'] . ' ' . $attr['gradientOverlayLocation2'] . '%)';
}
}
}
} elseif ( 'color' === $bg_type ) {
$selectors[' > .uagb-columns__overlay'] = array(
'background-color' => $attr['backgroundColor'],
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 101 !== $attr['backgroundOpacity'] && 0 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
);
} elseif ( 'gradient' === $bg_type ) {
$selectors[' > .uagb-columns__overlay']['background-color'] = 'transparent';
$selectors[' > .uagb-columns__overlay']['opacity'] = ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] && 0 !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '';
$gradientColor1 = isset( $attr['gradientColor1'] ) ? $attr['gradientColor1'] : '';
$gradientColor2 = isset( $attr['gradientColor2'] ) ? $attr['gradientColor2'] : '';
$gradientType = isset( $attr['gradientType'] ) ? $attr['gradientType'] : '';
$gradientLocation1 = isset( $attr['gradientLocation1'] ) ? $attr['gradientLocation1'] : '';
$gradientLocation2 = isset( $attr['gradientLocation2'] ) ? $attr['gradientLocation2'] : '';
$gradientAngle = isset( $attr['gradientAngle'] ) ? $attr['gradientAngle'] : '';
if ( 'basic' === $attr['selectGradient'] && $attr['gradientValue'] ) {
$gradient = $attr['gradientValue'];
} elseif ( 'linear' === $gradientType && 'advanced' === $attr['selectGradient'] ) {
$gradient = 'linear-gradient(' . $gradientAngle . 'deg, ' . $gradientColor1 . ' ' . $gradientLocation1 . '%, ' . $gradientColor2 . ' ' . $gradientLocation2 . '%)';
} elseif ( 'radial' === $gradientType && 'advanced' === $attr['selectGradient'] ) {
$gradient = 'radial-gradient( at center center, ' . $gradientColor1 . ' ' . $gradientLocation1 . '%, ' . $gradientColor2 . ' ' . $gradientLocation2 . '%)';
}
$selectors[' > .uagb-columns__overlay']['background-image'] = $gradient;
}
$selectors[' > .uagb-columns__overlay']['border-radius'] = $border['border-top-left-radius'] . ' ' . $border['border-top-right-radius'] . ' ' . $border['border-bottom-left-radius'] . ' ' . $border['border-bottom-right-radius'];
$m_selectors = array(
'.wp-block-uagb-columns.uagb-columns__wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingMobile'], $attr['mobilePaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingMobile'], $attr['mobilePaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $mobile_top_margin, $attr['mobileMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $mobile_bottom_margin, $attr['mobileMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $mobile_left_margin, $attr['mobileMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $mobile_right_margin, $attr['mobileMarginType'] ),
),
' .uagb-columns__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeightMobile'], 'px' ),
),
' .uagb-columns__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeightMobile'], 'px' ),
),
);
$t_selectors = array(
'.wp-block-uagb-columns.uagb-columns__wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingTablet'], $attr['tabletPaddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingTablet'], $attr['tabletPaddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $tablet_top_margin, $attr['tabletMarginType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $tablet_bottom_margin, $attr['tabletMarginType'] ),
'margin-left' => UAGB_Helper::get_css_value( $tablet_left_margin, $attr['tabletMarginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $tablet_right_margin, $attr['tabletMarginType'] ),
),
' .uagb-columns__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeightTablet'], 'px' ),
),
' .uagb-columns__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeightTablet'], 'px' ),
),
);
$selectors['.uagb-columns__wrap'] = $border;
$selectors['.uagb-columns__wrap:hover']['border-color'] = $attr['columnsBorderHColor'];
$t_selectors['.uagb-columns__wrap'] = $border_tablet;
$m_selectors['.uagb-columns__wrap'] = $border_mobile;
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = ( $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-columns-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,300 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'container' );
$default_width = UAGB_Admin_Helper::get_global_content_width();
$default_padding = UAGB_Admin_Helper::get_admin_settings_option( 'uag_container_global_padding', '' );
$default_elements_gap = UAGB_Admin_Helper::get_admin_settings_option( 'uag_container_global_elements_gap', 20 );
$grid_css_object = array(
array(
'default' => 'custom',
'min' => array(
'unit' => 'px',
'value' => 10,
),
'max' => array(
'unit' => 'fr',
'value' => 1,
),
'custom' => array(
'unit' => 'fr',
'value' => 1,
),
),
);
return array_merge(
array(
'block_id' => '',
'widthDesktop' => 100,
'widthTablet' => '',
'widthMobile' => 100,
'widthType' => '%',
'minHeightDesktop' => '',
'minHeightTablet' => '',
'minHeightMobile' => '',
'minHeightType' => 'px',
'minHeightTypeTablet' => 'px',
'minHeightTypeMobile' => 'px',
'directionDesktop' => 'column',
'directionTablet' => '',
'directionMobile' => '',
'alignItemsDesktop' => 'center',
'alignItemsTablet' => '',
'alignItemsMobile' => '',
'justifyContentDesktop' => 'center',
'justifyContentTablet' => '',
'justifyContentMobile' => '',
'wrapDesktop' => 'nowrap',
'wrapTablet' => '',
'wrapMobile' => 'wrap',
'alignContentDesktop' => '',
'alignContentTablet' => '',
'alignContentMobile' => '',
'backgroundType' => 'none',
'backgroundImageDesktop' => '',
'backgroundImageTablet' => '',
'backgroundImageMobile' => '',
'backgroundPositionDesktop' => array(
'x' => 0.5,
'y' => 0.5,
),
'backgroundPositionTablet' => '',
'backgroundPositionMobile' => '',
'backgroundSizeDesktop' => 'cover',
'backgroundSizeTablet' => '',
'backgroundSizeMobile' => '',
'backgroundRepeatDesktop' => 'no-repeat',
'backgroundRepeatTablet' => '',
'backgroundRepeatMobile' => '',
'backgroundAttachmentDesktop' => 'scroll',
'backgroundAttachmentTablet' => '',
'backgroundAttachmentMobile' => '',
'backgroundColor' => '',
'backgroundOpacity' => '',
'backgroundImageColor' => '#FFFFFF75',
'gradientValue' => 'linear-gradient(90deg, rgba(6, 147, 227, 0.5) 0%, rgba(155, 81, 224, 0.5) 100%)',
'boxShadowColor' => '#00000070',
'boxShadowHOffset' => 0,
'boxShadowVOffset' => 0,
'boxShadowBlur' => '',
'boxShadowSpread' => '',
'boxShadowPosition' => 'outset',
'boxShadowColorHover' => '',
'boxShadowHOffsetHover' => 0,
'boxShadowVOffsetHover' => 0,
'boxShadowBlurHover' => '',
'boxShadowSpreadHover' => '',
'boxShadowPositionHover' => 'outset',
'topPaddingDesktop' => $default_padding,
'bottomPaddingDesktop' => $default_padding,
'leftPaddingDesktop' => $default_padding,
'rightPaddingDesktop' => $default_padding,
'topPaddingTablet' => '',
'bottomPaddingTablet' => '',
'leftPaddingTablet' => '',
'rightPaddingTablet' => '',
'topPaddingMobile' => '',
'bottomPaddingMobile' => '',
'leftPaddingMobile' => '',
'rightPaddingMobile' => '',
'paddingType' => 'px',
'paddingTypeTablet' => 'px',
'paddingTypeMobile' => 'px',
'paddingLink' => true,
'topMarginDesktop' => '',
'bottomMarginDesktop' => '',
'leftMarginDesktop' => '',
'rightMarginDesktop' => '',
'topMarginTablet' => '',
'bottomMarginTablet' => '',
'leftMarginTablet' => '',
'rightMarginTablet' => '',
'topMarginMobile' => '',
'bottomMarginMobile' => '',
'leftMarginMobile' => '',
'rightMarginMobile' => '',
'marginType' => 'px',
'marginTypeTablet' => 'px',
'marginTypeMobile' => 'px',
'marginLink' => true,
'rowGapDesktop' => $default_elements_gap,
'rowGapTablet' => '',
'rowGapMobile' => '',
'rowGapType' => 'px',
'rowGapTypeTablet' => 'px',
'rowGapTypeMobile' => 'px',
'columnGapDesktop' => $default_elements_gap,
'columnGapTablet' => '',
'columnGapMobile' => '',
'columnGapType' => 'px',
'columnGapTypeTablet' => 'px',
'columnGapTypeMobile' => 'px',
'contentWidth' => 'alignfull',
'innerContentWidth' => 'alignwide',
'innerContentCustomWidthDesktop' => $default_width,
'innerContentCustomWidthTablet' => 1024,
'innerContentCustomWidthMobile' => 767,
'innerContentCustomWidthType' => 'px',
'innerContentCustomWidthTypeTablet' => 'px',
'innerContentCustomWidthTypeMobile' => 'px',
'bottomType' => 'none',
'bottomColor' => '#333',
'bottomHeight' => '',
'bottomHeightTablet' => '',
'bottomHeightMobile' => '',
'bottomWidth' => 100,
'topType' => 'none',
'topColor' => '#333',
'topHeight' => '',
'topHeightTablet' => '',
'topHeightMobile' => '',
'topWidth' => 100,
'topFlip' => false,
'bottomFlip' => false,
'topContentAboveShape' => false,
'bottomContentAboveShape' => false,
'backgroundCustomSizeDesktop' => 100,
'backgroundCustomSizeTablet' => '',
'backgroundCustomSizeMobile' => '',
'backgroundCustomSizeType' => '%',
'overlayType' => 'none',
'overlayOpacity' => 1,
'overlayBlendMode' => 'normal',
'overlayBlendModeTablet' => '',
'overlayBlendModeMobile' => '',
'customPosition' => 'default',
'centralizedPosition' => false,
'xPositionDesktop' => '',
'xPositionTablet' => '',
'xPositionMobile' => '',
'xPositionType' => 'px',
'xPositionTypeTablet' => 'px',
'xPositionTypeMobile' => 'px',
'yPositionDesktop' => '',
'yPositionTablet' => '',
'yPositionMobile' => '',
'yPositionType' => 'px',
'yPositionTypeTablet' => 'px',
'yPositionTypeMobile' => 'px',
'backgroundVideoColor' => '#FFFFFF75',
'backgroundVideo' => '',
'backgroundVideoOpacity' => '',
'topInvert' => false,
'bottomInvert' => false,
'textColor' => '',
'linkColor' => '',
'linkHoverColor' => '',
'isBlockRootParent' => false,
'widthTypeTablet' => '%',
'widthTypeMobile' => '%',
'overflow' => 'visible',
'equalHeight' => false,
'gradientColor1' => '#06558a',
'gradientColor2' => '#0063A1',
'gradientType' => 'linear',
'gradientLocation1' => 0,
'gradientLocationTablet1' => '',
'gradientLocationMobile1' => '',
'gradientLocation2' => 100,
'gradientLocationTablet2' => '',
'gradientLocationMobile2' => '',
'gradientAngle' => 0,
'gradientAngleTablet' => '',
'gradientAngleMobile' => '',
'selectGradient' => 'basic',
'backgroundOverlayType' => 'none',
'backgroundOverlayImageDesktop' => '',
'backgroundOverlayImageTablet' => '',
'backgroundOverlayImageMobile' => '',
'backgroundPositionOverlayDesktop' => array(
'x' => 0.5,
'y' => 0.5,
),
'backgroundPositionOverlayTablet' => '',
'backgroundPositionOverlayMobile' => '',
'backgroundSizeOverlayDesktop' => 'cover',
'backgroundSizeOverlayTablet' => '',
'backgroundSizeOverlayMobile' => '',
'backgroundRepeatOverlayDesktop' => 'no-repeat',
'backgroundRepeatOverlayTablet' => '',
'backgroundRepeatOverlayMobile' => '',
'backgroundAttachmentOverlayDesktop' => 'scroll',
'backgroundAttachmentOverlayTablet' => '',
'backgroundAttachmentOverlayMobile' => '',
'backgroundOverlayOpacity' => 1,
'backgroundOverlayColor' => '#FFFFFF75',
'backgroundImageOverlayColor' => '#FFFFFF75',
'backgroundCustomSizeOverlayDesktop' => 100,
'backgroundCustomSizeOverlayTablet' => '',
'backgroundCustomSizeOverlayMobile' => '',
'backgroundCustomOverlaySizeType' => '%',
'customOverlayPosition' => 'default',
'xPositionOverlayDesktop' => '',
'xPositionOverlayTablet' => '',
'xPositionOverlayMobile' => '',
'xPositionOverlayType' => 'px',
'xPositionOverlayTypeTablet' => 'px',
'xPositionOverlayTypeMobile' => 'px',
'yPositionOverlayDesktop' => '',
'yPositionOverlayTablet' => '',
'yPositionOverlayMobile' => '',
'yPositionOverlayType' => 'px',
'yPositionOverlayTypeTablet' => 'px',
'yPositionOverlayTypeMobile' => 'px',
'gradientOverlayColor1' => '#06558a',
'gradientOverlayColor2' => '#0063A1',
'gradientOverlayType' => 'linear',
'gradientOverlayLocation1' => 0,
'gradientOverlayLocationTablet1' => '',
'gradientOverlayLocationMobile1' => '',
'gradientOverlayLocation2' => 100,
'gradientOverlayLocationTablet2' => '',
'gradientOverlayLocationMobile2' => '',
'gradientOverlayAngle' => 0,
'gradientOverlayAngleTablet' => '',
'gradientOverlayAngleMobile' => '',
'selectOverlayGradient' => 'basic',
'backgroundVideoFallbackImage' => '',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
'childrenWidthDesktop' => '',
'childrenWidthTablet' => '',
'childrenWidthMobile' => '',
// Grid attributes.
'layout' => '',
'gridColumnDesktop' => $grid_css_object,
'gridColumnTablet' => $grid_css_object,
'gridColumnMobile' => $grid_css_object,
'gridRowDesktop' => $grid_css_object,
'gridRowTablet' => $grid_css_object,
'gridRowMobile' => $grid_css_object,
'gridAlignItemsDesktop' => 'stretch',
'gridAlignItemsTablet' => 'stretch',
'gridAlignItemsMobile' => 'stretch',
'gridJustifyItemsDesktop' => 'stretch',
'gridJustifyItemsTablet' => 'stretch',
'gridJustifyItemsMobile' => 'stretch',
'gridAlignContentDesktop' => 'stretch',
'gridAlignContentTablet' => 'stretch',
'gridAlignContentMobile' => 'stretch',
'gridJustifyContentDesktop' => 'stretch',
'gridJustifyContentTablet' => 'stretch',
'gridJustifyContentMobile' => 'stretch',
'orderDesktop' => 'initial',
'orderTablet' => 'initial',
'orderMobile' => 'initial',
'customOrderDesktop' => '',
'customOrderTablet' => '',
'customOrderMobile' => '',
),
$border_attribute
);

View File

@@ -0,0 +1,33 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/container';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'content', 'core' ),
'link' => 'container-layout-legacy',
'doc' => 'container',
'title' => __( 'Container', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Create beautiful layouts with flexbox powered container block.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'container' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'container',
),
'static_dependencies' => array(
'uagb-block-positioning-js' => array(
'type' => 'js',
),
'uagb-block-positioning-css' => array(
'type' => 'css',
),
),
);

View File

@@ -0,0 +1,889 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var mixed[] $attr
* @var int $id
*/
if ( ! function_exists( 'generate_background_object' ) ) {
/**
* Generate background object for a specific device
*
* @since 2.19.8
*
* @param array $attr Block attributes.
* @param string $fallbackImage Fallback image URL.
* @param string $device Device type (desktop, tablet, mobile).
* @return array Background object.
*/
function generate_background_object( $attr, $fallbackImage, $device = 'desktop' ) {
$suffix = ucfirst( $device );
$suffix = 'desktop' === $device ? '' : $suffix;
// Safely get values with defaults.
$backgroundRepeat = isset( $attr[ 'backgroundRepeat' . $suffix ] ) ? $attr[ 'backgroundRepeat' . $suffix ] : 'no-repeat';
$backgroundPosition = isset( $attr[ 'backgroundPosition' . $suffix ] ) ? $attr[ 'backgroundPosition' . $suffix ] : 'center';
$backgroundSize = isset( $attr[ 'backgroundSize' . $suffix ] ) ? $attr[ 'backgroundSize' . $suffix ] : 'cover';
$backgroundAttachment = isset( $attr[ 'backgroundAttachment' . $suffix ] ) ? $attr[ 'backgroundAttachment' . $suffix ] : 'scroll';
$backgroundCustomSize = isset( $attr[ 'backgroundCustomSize' . $suffix ] ) ? $attr[ 'backgroundCustomSize' . $suffix ] : '';
$backgroundImageColor = isset( $attr['backgroundImageColor'] ) ? $attr['backgroundImageColor'] : '';
$overlayType = isset( $attr['overlayType'] ) ? $attr['overlayType'] : 'none';
$backgroundCustomSizeType = isset( $attr['backgroundCustomSizeType'] ) ? $attr['backgroundCustomSizeType'] : 'px';
return array(
'backgroundType' => 'image',
'backgroundImage' => array(
'type' => 'image',
'url' => $fallbackImage,
),
'backgroundRepeat' => $backgroundRepeat,
'backgroundPosition' => $backgroundPosition,
'backgroundSize' => $backgroundSize,
'backgroundAttachment' => $backgroundAttachment,
'backgroundImageColor' => $backgroundImageColor,
'overlayType' => $overlayType,
'backgroundCustomSize' => $backgroundCustomSize,
'backgroundCustomSizeType' => $backgroundCustomSizeType,
);
}
}
// For Global Block Styles.
$base_selector = ! empty( $is_gbs ) && ! empty( $gbs_class ) ? $gbs_class : '.uagb-block-' . $id;
$inner_content_custom_width_tablet_fallback = is_numeric( $attr['innerContentCustomWidthTablet'] ) ? $attr['innerContentCustomWidthTablet'] : $attr['innerContentCustomWidthDesktop'];
$inner_content_custom_width_mobile_fallback = is_numeric( $attr['innerContentCustomWidthMobile'] ) ? $attr['innerContentCustomWidthMobile'] : $inner_content_custom_width_tablet_fallback;
$box_shadow_position_css = $attr['boxShadowPosition'];
if ( 'outset' === $attr['boxShadowPosition'] ) {
$box_shadow_position_css = '';
}
$box_shadow_position_css_hover = $attr['boxShadowPositionHover'];
if ( 'outset' === $attr['boxShadowPositionHover'] ) {
$box_shadow_position_css_hover = '';
}
$border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'container' );
$border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'container', 'tablet' );
$border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'container', 'mobile' );
// If there's no border-color, set it to inherit.
if ( empty( $border['border-color'] ) ) {
$border['border-color'] = 'inherit';
}
$container_bg_overlay_css = array();
$container_bg_overlay_css_mobile = array();
$container_bg_overlay_css_tablet = array();
// When overlay is present, we need to handle background differently.
if ( $attr['overlayType'] && 'none' !== $attr['overlayType'] ) {
// For overlay, we need to get the background CSS without the overlay merged in.
// We'll handle the overlay separately for the ::before pseudo-element.
$temp_attr = $attr;
$temp_attr['overlayType'] = 'none'; // Temporarily disable overlay to get just the background.
$container_bg_css_desktop = UAGB_Block_Helper::get_background_css_by_device( $temp_attr );
$container_bg_css_tablet = UAGB_Block_Helper::get_background_css_by_device( $temp_attr, 'Tablet' );
$container_bg_css_mobile = UAGB_Block_Helper::get_background_css_by_device( $temp_attr, 'Mobile' );
// Get the overlay CSS for the pseudo-element.
$container_bg_overlay_css = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Desktop', 'yes' );
$container_bg_overlay_css_tablet = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Tablet', 'yes' );
$container_bg_overlay_css_mobile = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Mobile', 'yes' );
} else {
// No overlay, use the regular background CSS.
$container_bg_css_desktop = UAGB_Block_Helper::get_background_css_by_device( $attr );
$container_bg_css_tablet = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Tablet' );
$container_bg_css_mobile = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Mobile' );
}
$video_bg_css = UAGB_Block_Helper::get_background_css_by_device( $attr, 'Desktop', 'no' );
// Tablet.
$left_padding_tablet = '' !== $attr['leftPaddingTablet'] ? $attr['leftPaddingTablet'] : $attr['leftPaddingDesktop'];
$right_padding_tablet = '' !== $attr['rightPaddingTablet'] ? $attr['rightPaddingTablet'] : $attr['rightPaddingDesktop'];
$top_padding_tablet = '' !== $attr['topPaddingTablet'] ? $attr['topPaddingTablet'] : $attr['topPaddingDesktop'];
$bottom_padding_tablet = '' !== $attr['bottomPaddingTablet'] ? $attr['bottomPaddingTablet'] : $attr['bottomPaddingDesktop'];
$left_margin_tablet = '' !== $attr['leftMarginTablet'] ? $attr['leftMarginTablet'] : $attr['leftMarginDesktop'];
$right_margin_tablet = '' !== $attr['rightMarginTablet'] ? $attr['rightMarginTablet'] : $attr['rightMarginDesktop'];
$top_margin_tablet = '' !== $attr['topMarginTablet'] ? $attr['topMarginTablet'] : $attr['topMarginDesktop'];
$bottom_margin_tablet = '' !== $attr['bottomMarginTablet'] ? $attr['bottomMarginTablet'] : $attr['bottomMarginDesktop'];
$column_gap_tablet = ! empty( $attr['columnGapTablet'] ) ? $attr['columnGapTablet'] : $attr['columnGapDesktop'];
// Mobile.
$left_padding_mobile = '' !== $attr['leftPaddingMobile'] ? $attr['leftPaddingMobile'] : $left_padding_tablet;
$right_padding_mobile = '' !== $attr['rightPaddingMobile'] ? $attr['rightPaddingMobile'] : $right_padding_tablet;
$top_padding_mobile = '' !== $attr['topPaddingMobile'] ? $attr['topPaddingMobile'] : $top_padding_tablet;
$bottom_padding_mobile = '' !== $attr['bottomPaddingMobile'] ? $attr['bottomPaddingMobile'] : $bottom_padding_tablet;
$left_margin_mobile = '' !== $attr['leftMarginMobile'] ? $attr['leftMarginMobile'] : $left_margin_tablet;
$right_margin_mobile = '' !== $attr['rightMarginMobile'] ? $attr['rightMarginMobile'] : $right_margin_tablet;
$top_margin_mobile = '' !== $attr['topMarginMobile'] ? $attr['topMarginMobile'] : $top_margin_tablet;
$bottom_margin_mobile = '' !== $attr['bottomMarginMobile'] ? $attr['bottomMarginMobile'] : $bottom_margin_tablet;
$column_gap_mobile = ! empty( $attr['columnGapMobile'] ) ? $attr['columnGapMobile'] : $column_gap_tablet;
$order_tablet = 'initial' !== $attr['orderTablet'] ? $attr['orderTablet'] : $attr['orderDesktop'];
$order_mobile = 'initial' !== $attr['orderMobile'] ? $attr['orderMobile'] : $order_tablet;
$custom_order_tablet = '' !== $attr['customOrderTablet'] ? $attr['customOrderTablet'] : $attr['customOrderDesktop'];
$custom_order_mobile = '' !== $attr['customOrderMobile'] ? $attr['customOrderMobile'] : $custom_order_tablet;
$is_layout_grid = 'grid' === $attr['layout'];
$has_inner_blocks_wrap = 'alignwide' === $attr['innerContentWidth'] && 'alignfull' === $attr['contentWidth'];
$should_merge_inner_container_css = ( $attr['isBlockRootParent'] && ! $has_inner_blocks_wrap ) || ! $attr['isBlockRootParent'] || 'alignwide' !== $attr['innerContentWidth'];
$container_css = array_merge(
array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightDesktop'], $attr['minHeightType'] ),
'box-shadow' =>
UAGB_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) .
' ' .
$attr['boxShadowColor'] .
' ' .
$box_shadow_position_css,
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingDesktop'], $attr['paddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingDesktop'], $attr['paddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingDesktop'], $attr['paddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingDesktop'], $attr['paddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginDesktop'], $attr['marginType'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginDesktop'], $attr['marginType'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginDesktop'], $attr['marginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginDesktop'], $attr['marginType'] ),
'overflow' => $attr['overflow'],
'order' => 'custom' === $attr['orderDesktop'] ? $attr['customOrderDesktop'] : $attr['orderDesktop'],
),
$border
);
$container_css = array_merge( $container_css, $container_bg_css_desktop );
$inner_container_css = array(
'flex-direction' => $attr['directionDesktop'],
'align-items' => $attr['alignItemsDesktop'],
'justify-content' => $attr['justifyContentDesktop'],
'flex-wrap' => $attr['wrapDesktop'],
'align-content' => $attr['alignContentDesktop'],
);
// Keeping $inner_container_css empty array because it will be used when layout is grid.
if ( $is_layout_grid ) {
$inner_container_css = array();
}
if ( $should_merge_inner_container_css ) {
$container_css = array_merge( $container_css, $inner_container_css );
}
// Handle backward opacity for video.
// If this was saved in the updated version, backgroundVideoOpacity will be 0, and this will be skipped.
if ( 'video' === $attr['backgroundType'] && ! empty( $attr['backgroundVideoOpacity'] ) ) {
$attr['overlayOpacity'] = $attr['backgroundVideoOpacity'];
}
$background_video_opacity_value = ( isset( $attr['overlayOpacity'] ) && 'none' !== $attr['overlayType'] && ( ( 'color' === $attr['overlayType'] && ! empty( $attr['backgroundVideoColor'] ) ) || ( 'gradient' === $attr['overlayType'] && ! empty( $attr['gradientValue'] ) ) ) ) ? 1 - $attr['overlayOpacity'] : 1;
$bg_video_image_fallback = ! empty( $attr['backgroundVideoFallbackImage']['url'] ) ? $attr['backgroundVideoFallbackImage']['url'] : '';
$selectors = array(
$base_selector . '.wp-block-uagb-container' => array(
'color' => $attr['textColor'],
),
$base_selector . '.wp-block-uagb-container *' => array(
'color' => $attr['textColor'],
),
$base_selector . ' a' => array(
'color' => $attr['linkColor'],
),
$base_selector . ' a:hover' => array(
'color' => $attr['linkHoverColor'],
),
$base_selector . ' .uagb-container__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeight'], 'px' ),
),
$base_selector . ' .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill' => array(
'fill' => UAGB_Helper::hex2rgba( $attr['topColor'], ( isset( $attr['topDividerOpacity'] ) && '' !== $attr['topDividerOpacity'] ) ? $attr['topDividerOpacity'] : 100 ),
),
$base_selector . ' .uagb-container__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeight'], 'px' ),
),
$base_selector . ' .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill' => array(
'fill' => UAGB_Helper::hex2rgba( $attr['bottomColor'], ( isset( $attr['bottomDividerOpacity'] ) && '' !== $attr['bottomDividerOpacity'] ) ? $attr['bottomDividerOpacity'] : 100 ),
),
$base_selector . ' .uagb-container__video-wrap video' => array(
'opacity' => $background_video_opacity_value,
),
);
if ( $bg_video_image_fallback ) {
$selectors[ $base_selector . ' .uagb-container__video-wrap video' ]['background'] = 'url(' . $bg_video_image_fallback . ') 50% 50%;';
$selectors[ $base_selector . ' .uagb-container__video-wrap video' ]['background-size'] = 'cover';
}
if ( '' !== $attr['topWidth'] ) {
$selectors[ $base_selector . ' .uagb-container__shape-top svg' ]['width'] = 'calc( ' . $attr['topWidth'] . '% + 1.3px )';
}
if ( '' !== $attr['bottomWidth'] ) {
$selectors[ $base_selector . ' .uagb-container__shape-bottom svg' ]['width'] = 'calc( ' . $attr['bottomWidth'] . '% + 1.3px )';
}
$container_tablet_css = array_merge(
array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightTablet'], $attr['minHeightTypeTablet'] ),
'padding-top' => UAGB_Helper::get_css_value( $top_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $bottom_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $left_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $right_padding_tablet, $attr['paddingTypeTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $top_margin_tablet, $attr['marginTypeTablet'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $bottom_margin_tablet, $attr['marginTypeTablet'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $left_margin_tablet, $attr['marginTypeTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $right_margin_tablet, $attr['marginTypeTablet'] ),
'order' => 'custom' === $order_tablet ? $custom_order_tablet : $order_tablet,
),
$border_tablet
);
if ( ! empty( $container_bg_css_tablet ) ) {
$container_tablet_css = array_merge( $container_tablet_css, $container_bg_css_tablet );
}
$inner_container_tablet_css = array(
'flex-direction' => $attr['directionTablet'],
'align-items' => $attr['alignItemsTablet'],
'justify-content' => $attr['justifyContentTablet'],
'flex-wrap' => $attr['wrapTablet'],
'align-content' => $attr['alignContentTablet'],
);
// Keeping $inner_container_tablet_css empty array because it will be used when layout is grid.
if ( $is_layout_grid ) {
$inner_container_tablet_css = array();
}
if ( $should_merge_inner_container_css && ! $is_layout_grid ) {
$container_tablet_css = array_merge( $container_tablet_css, $inner_container_tablet_css );
}
$t_selectors = array(
$base_selector . ' .uagb-container__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeightTablet'], 'px' ),
),
$base_selector . ' .uagb-container__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeightTablet'], 'px' ),
),
);
$container_mobile_css = array_merge(
array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightMobile'], $attr['minHeightTypeMobile'] ),
'padding-top' => UAGB_Helper::get_css_value( $top_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $bottom_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $left_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $right_padding_mobile, $attr['paddingTypeMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $top_margin_mobile, $attr['marginTypeMobile'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $bottom_margin_mobile, $attr['marginTypeMobile'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $left_margin_mobile, $attr['marginTypeMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $right_margin_mobile, $attr['marginTypeMobile'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], $attr['rowGapTypeMobile'] ),
'column-gap' => UAGB_Helper::get_css_value( $attr['columnGapMobile'], $attr['columnGapTypeMobile'] ),
'order' => 'custom' === $order_mobile ? $custom_order_mobile : $order_mobile,
),
$border_mobile
);
if ( ! empty( $container_bg_css_mobile ) ) {
$container_mobile_css = array_merge( $container_mobile_css, $container_bg_css_mobile );
}
$inner_container_mobile_css = array(
'flex-direction' => $attr['directionMobile'],
'align-items' => $attr['alignItemsMobile'],
'justify-content' => $attr['justifyContentMobile'],
'flex-wrap' => $attr['wrapMobile'],
'align-content' => $attr['alignContentMobile'],
);
// Keeping $inner_container_mobile_css empty array because it will be used when layout is grid.
if ( $is_layout_grid ) {
$inner_container_mobile_css = array();
}
if ( $should_merge_inner_container_css && ! $is_layout_grid ) {
$container_mobile_css = array_merge( $container_mobile_css, $inner_container_mobile_css );
}
$m_selectors = array(
$base_selector . ' .uagb-container__shape-bottom svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['bottomHeightMobile'], 'px' ),
),
$base_selector . ' .uagb-container__shape-top svg' => array(
'height' => UAGB_Helper::get_css_value( $attr['topHeightMobile'], 'px' ),
),
);
if ( ! $is_layout_grid ) {
// Add row and column gap if layout is not grid.
$container_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapDesktop'], $attr['rowGapType'] );
$container_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapDesktop'], $attr['columnGapType'] );
$inner_container_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapDesktop'], $attr['rowGapType'] );
$inner_container_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapDesktop'], $attr['columnGapType'] );
// for tablet devices.
$container_tablet_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapTablet'], $attr['rowGapTypeTablet'] );
$container_tablet_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapTablet'], $attr['columnGapTypeTablet'] );
$inner_container_tablet_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapTablet'], $attr['rowGapTypeTablet'] );
$inner_container_tablet_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapTablet'], $attr['columnGapTypeTablet'] );
// for mobile devices.
$container_mobile_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapMobile'], $attr['rowGapTypeMobile'] );
$container_mobile_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapMobile'], $attr['columnGapTypeMobile'] );
$inner_container_mobile_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapMobile'], $attr['rowGapTypeMobile'] );
$inner_container_mobile_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapMobile'], $attr['columnGapTypeMobile'] );
}
// Add max-width and width if layout is not grid.
$selectors[ '.uagb-is-root-container .uagb-block-' . $id ] = array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'max-width' => UAGB_Helper::get_css_value( $attr['widthDesktop'], $attr['widthType'] ),
'width' => '100%',
);
$t_selectors[ '.uagb-is-root-container ' . $base_selector ] = array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'max-width' => UAGB_Helper::get_css_value( $attr['widthTablet'], $attr['widthTypeTablet'] ),
'width' => '100%',
);
$m_selectors[ '.uagb-is-root-container ' . $base_selector ] = array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'max-width' => UAGB_Helper::get_css_value( $attr['widthMobile'], $attr['widthTypeMobile'] ),
'width' => '100%',
);
if ( $has_inner_blocks_wrap ) {
$selectors[ '.uagb-is-root-container.alignfull' . $base_selector . ' > .uagb-container-inner-blocks-wrap' ] = array_merge(
array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'--inner-content-custom-width' => 'min( 100%, ' . $attr['innerContentCustomWidthDesktop'] . $attr['innerContentCustomWidthType'] . ')',
'max-width' => 'var(--inner-content-custom-width)',
'width' => '100%',
),
$inner_container_css
);
$t_selectors[ '.uagb-is-root-container.alignfull' . $base_selector . ' > .uagb-container-inner-blocks-wrap' ] = array_merge(
array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'--inner-content-custom-width' => 'min( 100%, ' . $inner_content_custom_width_tablet_fallback . $attr['innerContentCustomWidthTypeTablet'] . ')',
'max-width' => 'var(--inner-content-custom-width)',
'width' => '100%',
),
$inner_container_tablet_css
);
$m_selectors[ '.uagb-is-root-container.alignfull' . $base_selector . ' > .uagb-container-inner-blocks-wrap' ] = array_merge(
array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
'--inner-content-custom-width' => 'min( 100%, ' . $inner_content_custom_width_mobile_fallback . $attr['innerContentCustomWidthTypeMobile'] . ')',
'max-width' => 'var(--inner-content-custom-width)',
'width' => '100%',
),
$inner_container_mobile_css
);
}
if ( $is_layout_grid ) {
$grid_base_selector = $base_selector . '.uagb-layout-grid';
$container_base_selector = $has_inner_blocks_wrap && $attr['isBlockRootParent'] ? $grid_base_selector . ' > .uagb-container-inner-blocks-wrap' : $grid_base_selector;
$grid_css = array();
$grid_css['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapDesktop'], $attr['rowGapType'] );
$grid_css['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapDesktop'], $attr['columnGapType'] );
// Grid css for desktop.
$selectors[ $container_base_selector ] = array_merge( $grid_css, UAGB_Block_Helper::grid_css_object( $attr, 'Desktop' ) );
// Grid css for tablet.
$grid_css_tablet = array();
$grid_css_tablet['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapTablet'], $attr['rowGapTypeTablet'] );
$grid_css_tablet['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapTablet'], $attr['columnGapTypeTablet'] );
$t_selectors[ $container_base_selector ] = array_merge( $grid_css_tablet, UAGB_Block_Helper::grid_css_object( $attr, 'Tablet' ) );
// Grid css for mobile.
$grid_css_mobile = array();
$grid_css_mobile['row-gap'] = UAGB_Helper::get_css_value( $attr['rowGapMobile'], $attr['rowGapTypeMobile'] );
$grid_css_mobile['column-gap'] = UAGB_Helper::get_css_value( $attr['columnGapMobile'], $attr['columnGapTypeMobile'] );
$m_selectors[ $container_base_selector ] = array_merge( $grid_css_mobile, UAGB_Block_Helper::grid_css_object( $attr, 'Mobile' ) );
}
if ( 'video' === $attr['backgroundType'] ) {
$selectors[ $base_selector . ' .uagb-container__video-wrap' ] = array_merge( $video_bg_css, $border );
$t_selectors[ $base_selector . ' .uagb-container__video-wrap' ] = $border_tablet;
$m_selectors[ $base_selector . ' .uagb-container__video-wrap' ] = $border_mobile;
$selectorClass = '.wp-block-uagb-container' . $base_selector;
$selectors[ $base_selector . ' > div:not(.uagb-container__video-wrap):not(.uagb-container__shape)' ] = array(
'position' => 'relative',
);
$selectors[ $selectorClass ] = $inner_container_css;
$t_selectors[ $selectorClass ] = $inner_container_tablet_css;
$m_selectors[ $selectorClass ] = $inner_container_mobile_css;
$selectors[ $base_selector ] = array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightDesktop'], $attr['minHeightType'] ),
'box-shadow' =>
UAGB_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) .
' ' .
$attr['boxShadowColor'] .
' ' .
$box_shadow_position_css,
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingDesktop'], $attr['paddingType'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingDesktop'], $attr['paddingType'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingDesktop'], $attr['paddingType'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingDesktop'], $attr['paddingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['topMarginDesktop'], $attr['marginType'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $attr['bottomMarginDesktop'], $attr['marginType'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $attr['leftMarginDesktop'], $attr['marginType'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['rightMarginDesktop'], $attr['marginType'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['rowGapDesktop'], $attr['rowGapType'] ),
'column-gap' => UAGB_Helper::get_css_value( $attr['columnGapDesktop'], $attr['columnGapType'] ),
'overflow' => $attr['overflow'],
);
$t_selectors[ $base_selector ] = array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightTablet'], $attr['minHeightTypeTablet'] ),
'padding-top' => UAGB_Helper::get_css_value( $top_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $bottom_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $left_padding_tablet, $attr['paddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $right_padding_tablet, $attr['paddingTypeTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $top_margin_tablet, $attr['marginTypeTablet'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $bottom_margin_tablet, $attr['marginTypeTablet'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $left_margin_tablet, $attr['marginTypeTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $right_margin_tablet, $attr['marginTypeTablet'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], $attr['rowGapTypeTablet'] ),
'column-gap' => UAGB_Helper::get_css_value( $attr['columnGapTablet'], $attr['columnGapTypeTablet'] ),
);
$m_selectors[ $base_selector ] = array(
'min-height' => UAGB_Helper::get_css_value( $attr['minHeightMobile'], $attr['minHeightTypeMobile'] ),
'padding-top' => UAGB_Helper::get_css_value( $top_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $bottom_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $left_padding_mobile, $attr['paddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $right_padding_mobile, $attr['paddingTypeMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $top_margin_mobile, $attr['marginTypeMobile'] ) . ' !important',
'margin-bottom' => UAGB_Helper::get_css_value( $bottom_margin_mobile, $attr['marginTypeMobile'] ) . ' !important',
'margin-left' => UAGB_Helper::get_css_value( $left_margin_mobile, $attr['marginTypeMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $right_margin_mobile, $attr['marginTypeMobile'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], $attr['rowGapTypeMobile'] ),
'column-gap' => UAGB_Helper::get_css_value( $attr['columnGapMobile'], $attr['columnGapTypeMobile'] ),
);
$selectors[ '.wp-block-uagb-container' . $base_selector . ':hover .uagb-container__video-wrap' ] = array(
'border-color' => $attr['containerBorderHColor'],
);
// If hover blur or hover color are set, show the hover shadow.
if ( ( ( '' !== $attr['boxShadowBlurHover'] ) && ( null !== $attr['boxShadowBlurHover'] ) ) || '' !== $attr['boxShadowColorHover'] ) {
$selectors[ $base_selector . ':hover ' ]['box-shadow'] = UAGB_Helper::get_css_value( $attr['boxShadowHOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlurHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpreadHover'], 'px' ) .
' ' .
$attr['boxShadowColorHover'] .
' ' .
$box_shadow_position_css_hover;
}
} else {
$selectors[ $base_selector ] = $container_css; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$t_selectors[ $base_selector ] = $container_tablet_css; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$m_selectors[ $base_selector ] = $container_mobile_css; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$selectors[ '.wp-block-uagb-container' . $base_selector . ':hover' ] = array(
'border-color' => $attr['containerBorderHColor'],
);
// If hover blur or hover color are set, show the hover shadow.
if ( ( ( '' !== $attr['boxShadowBlurHover'] ) && ( null !== $attr['boxShadowBlurHover'] ) ) || '' !== $attr['boxShadowColorHover'] ) {
$selectors[ $base_selector . ':hover' ]['box-shadow'] = UAGB_Helper::get_css_value( $attr['boxShadowHOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlurHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpreadHover'], 'px' ) .
' ' .
$attr['boxShadowColorHover'] .
' ' .
$box_shadow_position_css_hover;
}
}
if ( 'default' === $attr['contentWidth'] ) {
$selectors[ $base_selector ]['max-width'] = UAGB_Helper::get_css_value( $attr['widthDesktop'], $attr['widthType'] ) . ' !important';
$selectors[ $base_selector ]['margin-left'] = ( '' !== $attr['leftMarginDesktop'] ? UAGB_Helper::get_css_value( $attr['leftMarginDesktop'], $attr['marginType'] ) . ' !important' : '' );
$selectors[ $base_selector ]['margin-right'] = ( '' !== $attr['rightMarginDesktop'] ? UAGB_Helper::get_css_value( $attr['rightMarginDesktop'], $attr['marginType'] ) . ' !important' : '' );
// FSE container width compatibility.
$common_fullwidth_restrictions = ( 'auto' !== $attr['childrenWidthDesktop'] && ! $is_layout_grid );
$is_fse_container = ( $common_fullwidth_restrictions && wp_is_block_theme() && ! get_queried_object() );
// WooCommerce template pages.
$is_checkout = function_exists( 'is_checkout' ) && is_checkout();
$is_cart = function_exists( 'is_cart' ) && is_cart();
$is_order_confirmation = function_exists( 'is_order_received_page' ) && is_order_received_page();
$is_product_catalog = function_exists( 'is_shop' ) && is_shop();
$is_product_search = function_exists( 'is_product_search' ) && is_product_search();
$is_products_by_attribute = function_exists( 'is_product_taxonomy' ) && is_product_taxonomy();
$is_products_by_category = function_exists( 'is_product_category' ) && is_product_category();
$is_products_by_tag = function_exists( 'is_product_tag' ) && is_product_tag();
$is_single_product = function_exists( 'is_product' ) && is_product();
$requires_fullwidth = $common_fullwidth_restrictions && (
$is_fse_container ||
$is_checkout ||
$is_cart ||
$is_order_confirmation ||
$is_product_catalog ||
$is_product_search ||
$is_products_by_attribute ||
$is_products_by_category ||
$is_products_by_tag ||
$is_single_product
);
// Add the FSE compatibility width when required.
$selectors[ $base_selector ]['width'] = $requires_fullwidth ? '100%' : '';
$t_selectors[ $base_selector ]['max-width'] = UAGB_Helper::get_css_value( $attr['widthTablet'], $attr['widthTypeTablet'] ) . ' !important';
$t_selectors[ $base_selector ]['margin-left'] = ( '' !== $attr['leftMarginTablet'] ? UAGB_Helper::get_css_value( $left_margin_tablet, $attr['marginTypeTablet'] ) . ' !important' : '' );
$t_selectors[ $base_selector ]['margin-right'] = ( '' !== $attr['rightMarginTablet'] ? UAGB_Helper::get_css_value( $right_margin_tablet, $attr['marginTypeTablet'] ) . ' !important' : '' );
$m_selectors[ $base_selector ]['max-width'] = UAGB_Helper::get_css_value( $attr['widthMobile'], $attr['widthTypeMobile'] ) . ' !important';
$m_selectors[ $base_selector ]['margin-left'] = ( '' !== $attr['leftMarginMobile'] ? UAGB_Helper::get_css_value( $left_margin_mobile, $attr['marginTypeMobile'] ) . ' !important' : '' );
$m_selectors[ $base_selector ]['margin-right'] = ( '' !== $attr['rightMarginMobile'] ? UAGB_Helper::get_css_value( $right_margin_mobile, $attr['marginTypeMobile'] ) . ' !important' : '' );
}
// Add the overlay CSS if needed.
if (
! empty( $attr['overlayType'] )
&& 'none' !== $attr['overlayType']
&& ! empty( $container_bg_overlay_css )
&& is_array( $container_bg_overlay_css )
) {
$desktop_border_width = array(
'top' => is_numeric( $attr['containerBorderTopWidth'] ) ? $attr['containerBorderTopWidth'] : 0,
'right' => is_numeric( $attr['containerBorderRightWidth'] ) ? $attr['containerBorderRightWidth'] : 0,
'bottom' => is_numeric( $attr['containerBorderBottomWidth'] ) ? $attr['containerBorderBottomWidth'] : 0,
'left' => is_numeric( $attr['containerBorderLeftWidth'] ) ? $attr['containerBorderLeftWidth'] : 0,
);
$tablet_border_width = array(
'top' => is_numeric( $attr['containerBorderTopWidthTablet'] ) ? $attr['containerBorderTopWidthTablet'] : $desktop_border_width['top'],
'right' => is_numeric( $attr['containerBorderRightWidthTablet'] ) ? $attr['containerBorderRightWidthTablet'] : $desktop_border_width['right'],
'bottom' => is_numeric( $attr['containerBorderBottomWidthTablet'] ) ? $attr['containerBorderBottomWidthTablet'] : $desktop_border_width['bottom'],
'left' => is_numeric( $attr['containerBorderLeftWidthTablet'] ) ? $attr['containerBorderLeftWidthTablet'] : $desktop_border_width['left'],
);
$mobile_border_width = array(
'top' => is_numeric( $attr['containerBorderTopWidthMobile'] ) ? $attr['containerBorderTopWidthMobile'] : $tablet_border_width['top'],
'right' => is_numeric( $attr['containerBorderRightWidthMobile'] ) ? $attr['containerBorderRightWidthMobile'] : $tablet_border_width['right'],
'bottom' => is_numeric( $attr['containerBorderBottomWidthMobile'] ) ? $attr['containerBorderBottomWidthMobile'] : $tablet_border_width['bottom'],
'left' => is_numeric( $attr['containerBorderLeftWidthMobile'] ) ? $attr['containerBorderLeftWidthMobile'] : $tablet_border_width['left'],
);
$selectors = array_merge(
$selectors,
array(
$base_selector . '::before' => array_merge(
array(
'content' => '""',
'position' => 'absolute',
'pointer-events' => 'none',
'top' => '-' . UAGB_Helper::get_css_value( $desktop_border_width['top'], 'px' ),
'left' => '-' . UAGB_Helper::get_css_value( $desktop_border_width['left'], 'px' ),
'width' => 'calc(100% + ' . UAGB_Helper::get_css_value( $desktop_border_width['left'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $desktop_border_width['right'], 'px' ) . ')',
'height' => 'calc(100% + ' . UAGB_Helper::get_css_value( $desktop_border_width['top'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $desktop_border_width['bottom'], 'px' ) . ')',
),
$border,
$container_bg_overlay_css
),
$base_selector . ':hover::before' => array(
'border-color' => $attr['containerBorderHColor'],
),
)
);
$t_selectors = array_merge(
$t_selectors,
array(
$base_selector . '::before' => array_merge(
array(
'top' => '-' . UAGB_Helper::get_css_value( $tablet_border_width['top'], 'px' ),
'left' => '-' . UAGB_Helper::get_css_value( $tablet_border_width['left'], 'px' ),
'width' => 'calc(100% + ' . UAGB_Helper::get_css_value( $tablet_border_width['left'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $tablet_border_width['right'], 'px' ) . ')',
'height' => 'calc(100% + ' . UAGB_Helper::get_css_value( $tablet_border_width['top'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $tablet_border_width['bottom'], 'px' ) . ')',
),
$border_tablet,
$container_bg_overlay_css_tablet
),
)
);
$m_selectors = array_merge(
$m_selectors,
array(
$base_selector . '::before' => array_merge(
array(
'top' => '-' . UAGB_Helper::get_css_value( $mobile_border_width['top'], 'px' ),
'left' => '-' . UAGB_Helper::get_css_value( $mobile_border_width['left'], 'px' ),
'width' => 'calc(100% + ' . UAGB_Helper::get_css_value( $mobile_border_width['left'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $mobile_border_width['right'], 'px' ) . ')',
'height' => 'calc(100% + ' . UAGB_Helper::get_css_value( $mobile_border_width['top'], 'px' ) . ' + ' . UAGB_Helper::get_css_value( $mobile_border_width['bottom'], 'px' ) . ')',
),
$border_mobile,
$container_bg_overlay_css_mobile
),
)
);
if ( 'image' === $attr['overlayType'] ) {
$t_selectors[ $base_selector . '::before' ] = array_merge(
$t_selectors[ $base_selector . '::before' ],
$container_bg_overlay_css_tablet
);
$m_selectors[ $base_selector . '::before' ] = array_merge(
$m_selectors[ $base_selector . '::before' ],
$container_bg_overlay_css_mobile
);
};
}//end if;
$z_index = isset( $attr['zIndex'] ) ? $attr['zIndex'] : '';
$z_index_tablet = isset( $attr['zIndexTablet'] ) ? $attr['zIndexTablet'] : '';
$z_index_mobile = isset( $attr['zIndexMobile'] ) ? $attr['zIndexMobile'] : '';
$selectors[ $base_selector . '.uag-blocks-common-selector' ] = array(
'--z-index-desktop' => $z_index,
'--z-index-tablet' => $z_index_tablet,
'--z-index-mobile' => $z_index_mobile,
);
$auto_width = array( 'width' => 'auto !important' );
$set_width = array( 'width' => '100%' );
$base_width_selector = $base_selector . '.wp-block-uagb-container > *:not( .wp-block-uagb-column ):not( .wp-block-uagb-section ):not( .uagb-container__shape ):not( .uagb-container__video-wrap ):not( .uagb-slider-container ):not( .spectra-container-link-overlay ):not(.spectra-image-gallery__control-lightbox):not(.wp-block-uagb-lottie):not(.uagb-container-inner-blocks-wrap)';
$base_width_selector_2 = $base_selector . '.wp-block-uagb-container > .uagb-container-inner-blocks-wrap > *:not( .wp-block-uagb-column ):not( .wp-block-uagb-section ):not( .uagb-container__shape ):not( .uagb-container__video-wrap ):not( .uagb-slider-container ):not(.spectra-image-gallery__control-lightbox)';
// Add auto width to the inner blocks in desktop.
if ( ! empty( $attr['directionDesktop'] ) ) {
if ( 'auto' === $attr['childrenWidthDesktop'] ) {
$selectors[ $base_width_selector ] = $auto_width;
$selectors[ $base_width_selector_2 ] = $auto_width;
}
}
// Add auto width to the inner blocks in tablet.
if ( ! empty( $attr['directionTablet'] ) ) {
if ( 'auto' === $attr['childrenWidthTablet'] ) {
$t_selectors[ $base_width_selector ] = $auto_width;
$t_selectors[ $base_width_selector_2 ] = $auto_width;
} else {
$t_selectors[ $base_width_selector ] = $set_width;
$t_selectors[ $base_width_selector_2 ] = $set_width;
}
}
// Add auto width to the inner blocks in mobile.
if ( ! empty( $attr['directionMobile'] ) ) {
if ( 'auto' === $attr['childrenWidthMobile'] ) {
$m_selectors[ $base_width_selector ] = $auto_width;
$m_selectors[ $base_width_selector_2 ] = $auto_width;
} else {
$m_selectors[ $base_width_selector ] = $set_width;
$m_selectors[ $base_width_selector_2 ] = $set_width;
}
}
if ( ! empty( $attr['isGridCssInParent'] ) ) {
$gridChildrenCSS = array();
$gridChildrenCSSTab = array(
// Add default css for the Tablet.
'grid-column' => 'span 1',
'grid-row' => 'span 1',
);
$gridChildrenCSSMobile = array(
// Add default css for the Mobile.
'grid-column' => 'span 1',
'grid-row' => 'span 1',
);
if ( ! empty( $attr['gridSettingType'] ) && 'advance' === $attr['gridSettingType'] ) {
// For desktop.
if ( ! empty( $attr['gridColumnStart'] ) && ! empty( $attr['gridColumnEnd'] ) ) {
$gridChildrenCSS['grid-column'] = $attr['gridColumnStart'] . ' / ' . $attr['gridColumnEnd'];
}
if ( ! empty( $attr['gridRowStart'] ) && ! empty( $attr['gridRowEnd'] ) ) {
$gridChildrenCSS['grid-row'] = $attr['gridRowStart'] . ' / ' . $attr['gridRowEnd'];
}
// For tablet.
if ( ! empty( $attr['gridColumnStartTablet'] ) && ! empty( $attr['gridColumnEndTablet'] ) ) {
$gridChildrenCSSTab['grid-column'] = $attr['gridColumnStartTablet'] . ' / ' . $attr['gridColumnEndTablet'];
}
if ( ! empty( $attr['gridRowStartTablet'] ) && ! empty( $attr['gridRowEndTablet'] ) ) {
$gridChildrenCSSTab['grid-row'] = $attr['gridRowStartTablet'] . ' / ' . $attr['gridRowEndTablet'];
}
// For mobile.
if ( ! empty( $attr['gridColumnStartMobile'] ) && ! empty( $attr['gridColumnEndMobile'] ) ) {
$gridChildrenCSSMobile['grid-column'] = $attr['gridColumnStartMobile'] . ' / ' . $attr['gridColumnEndMobile'];
}
if ( ! empty( $attr['gridRowStartMobile'] ) && ! empty( $attr['gridRowEndMobile'] ) ) {
$gridChildrenCSSMobile['grid-row'] = $attr['gridRowStartMobile'] . ' / ' . $attr['gridRowEndMobile'];
}
} else {
// For desktop.
if ( ! empty( $attr['gridColumnSpan'] ) ) {
$gridChildrenCSS['grid-column'] = 'span ' . $attr['gridColumnSpan'];
}
if ( ! empty( $attr['gridRowSpan'] ) ) {
$gridChildrenCSS['grid-row'] = 'span ' . $attr['gridRowSpan'];
}
// For tablet.
if ( ! empty( $attr['gridColumnSpanTablet'] ) ) {
$gridChildrenCSSTab['grid-column'] = 'span ' . $attr['gridColumnSpanTablet'];
}
if ( ! empty( $attr['gridRowSpanTablet'] ) ) {
$gridChildrenCSSTab['grid-row'] = 'span ' . $attr['gridRowSpanTablet'];
}
// For mobile.
if ( ! empty( $attr['gridColumnSpanMobile'] ) ) {
$gridChildrenCSSMobile['grid-column'] = 'span ' . $attr['gridColumnSpanMobile'];
}
if ( ! empty( $attr['gridRowSpanMobile'] ) ) {
$gridChildrenCSSMobile['grid-row'] = 'span ' . $attr['gridRowSpanMobile'];
}
}
// For desktop.
if ( ! empty( $attr['gridAlignItems'] ) ) {
$gridChildrenCSS['align-self'] = $attr['gridAlignItems'];
}
if ( ! empty( $attr['gridJustifyItems'] ) ) {
$gridChildrenCSS['justify-self'] = $attr['gridJustifyItems'];
}
// For tablet.
if ( ! empty( $attr['gridAlignItemsTablet'] ) ) {
$gridChildrenCSSTab['align-self'] = $attr['gridAlignItemsTablet'];
}
if ( ! empty( $attr['gridJustifyItemsTablet'] ) ) {
$gridChildrenCSSTab['justify-self'] = $attr['gridJustifyItemsTablet'];
}
// For mobile.
if ( ! empty( $attr['gridAlignItemsMobile'] ) ) {
$gridChildrenCSSMobile['align-self'] = $attr['gridAlignItemsMobile'];
}
if ( ! empty( $attr['gridJustifyItemsMobile'] ) ) {
$gridChildrenCSSMobile['justify-self'] = $attr['gridJustifyItemsMobile'];
}
$selectors[ $base_selector ] = array_merge( $selectors[ $base_selector ], $gridChildrenCSS );
$t_selectors[ $base_selector ] = array_merge( $t_selectors[ $base_selector ], $gridChildrenCSSTab );
$m_selectors[ $base_selector ] = array_merge( $m_selectors[ $base_selector ], $gridChildrenCSSMobile );
}
// Add dynamic content fallback handling.
if ( ! empty( $attr['dynamicContent']['bgImage']['enable'] ) ) {
$dynamicContent = $attr['dynamicContent']['bgImage'];
// Get the fallback image from the advanced field.
$fallbackImage = '';
if ( ! empty( $dynamicContent['advanced'] ) ) {
$advancedParts = explode( '|', $dynamicContent['advanced'] );
if ( count( $advancedParts ) > 1 ) {
$fallbackImage = $advancedParts[1];
}
}
if ( $fallbackImage ) {
// Generate background objects for each device.
$bg_obj_desktop = generate_background_object( $attr, $fallbackImage, 'desktop' );
$container_bg_css_desktop = UAGB_Block_Helper::uag_get_background_obj( $bg_obj_desktop, 'no' );
// Add the CSS to the selectors if it exists.
if ( ! empty( $container_bg_css_desktop ) ) {
$selectors[ $base_selector ] = array_merge(
isset( $selectors[ $base_selector ] ) ? $selectors[ $base_selector ] : array(),
$container_bg_css_desktop
);
}
// Add tablet version if needed.
if ( isset( $attr['backgroundRepeatTablet'] ) && ! empty( $attr['backgroundRepeatTablet'] ) ) {
$bg_obj_tablet = generate_background_object( $attr, $fallbackImage, 'tablet' );
$container_bg_css_tablet = UAGB_Block_Helper::uag_get_background_obj( $bg_obj_tablet, 'no' );
if ( ! empty( $container_bg_css_tablet ) ) {
$t_selectors[ $base_selector ] = array_merge(
isset( $t_selectors[ $base_selector ] ) ? $t_selectors[ $base_selector ] : array(),
$container_bg_css_tablet
);
}
}
// Add mobile version if needed.
if ( isset( $attr['backgroundRepeatMobile'] ) && ! empty( $attr['backgroundRepeatMobile'] ) ) {
$bg_obj_mobile = generate_background_object( $attr, $fallbackImage, 'mobile' );
$container_bg_css_mobile = UAGB_Block_Helper::uag_get_background_obj( $bg_obj_mobile, 'no' );
if ( ! empty( $container_bg_css_mobile ) ) {
$m_selectors[ $base_selector ] = array_merge(
isset( $m_selectors[ $base_selector ] ) ? $m_selectors[ $base_selector ] : array(),
$container_bg_css_mobile
);
}
}
}
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
return UAGB_Helper::generate_all_css( $combined_selectors, '.wp-block-uagb-container' );

View File

@@ -0,0 +1,39 @@
<?php
/**
* Frontend JS File.
*
* @since 2.8.0
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined elsewhere.
*
* @var int $id The block ID.
*/
$selector = '.uagb-block-' . $id;
$js = '';
if ( ! empty( $attr['UAGPosition'] ) && is_string( $attr['UAGPosition'] ) ) {
$position_attrs = array_merge(
$attr,
array(
'UAGStickyLocation' => ! empty( $attr['UAGStickyLocation'] ) ? $attr['UAGStickyLocation'] : 'top',
'UAGStickyRestricted' => ! empty( $attr['UAGStickyRestricted'] ) ? $attr['UAGStickyRestricted'] : false,
'UAGStickyOffset' => ( ! empty( $attr['UAGStickyOffset'] ) && is_numeric( $attr['UAGStickyOffset'] ) ) ? $attr['UAGStickyOffset'] : 0,
)
);
ob_start();
?>
window.addEventListener("load", function(){
UAGBBlockPositioning.init( <?php echo wp_json_encode( $position_attrs ); ?>, "<?php echo esc_attr( $selector ); ?>" );
});
<?php
$js = ob_get_clean();
}
return $js;
?>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/content-timeline-child';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Content Timeline Child', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add and customize displaying content of this timeline.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'static_css' => 'timeline',
'deprecated' => false,
);

View File

@@ -0,0 +1,150 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'classMigrate' => false,
'blockName' => 'content-timeline',
'align' => '',
'alignTablet' => '',
'alignMobile' => '',
'headingColor' => '',
'subHeadingColor' => '',
'separatorBg' => '#eee',
'backgroundColor' => '#eee',
'separatorColor' => '#eee',
'separatorFillColor' => '#0693e3',
'separatorBorder' => '#eee',
'borderFocus' => '#0693e3',
'horizontalSpace' => 10,
'horizontalSpaceTablet' => '',
'horizontalSpaceMobile' => '',
'horizontalSpaceUnit' => 'px',
'horizontalSpaceUnitTablet' => 'px',
'horizontalSpaceUnitMobile' => 'px',
'verticalSpace' => 15,
'verticalSpaceTablet' => '',
'verticalSpaceMobile' => '',
'verticalSpaceUnit' => 'px',
'verticalSpaceUnitTablet' => 'px',
'verticalSpaceUnitMobile' => 'px',
'headFontSizeType' => 'px',
'headFontSize' => '',
'headFontSizeTablet' => '',
'headFontSizeMobile' => '',
'headFontFamily' => '',
'headFontWeight' => '',
'headFontStyle' => '',
'headLineHeightType' => 'em',
'headLineHeight' => '',
'headLineHeightTablet' => '',
'headLineHeightMobile' => '',
'headLoadGoogleFonts' => false,
'timelinAlignment' => 'center',
'timelinAlignmentTablet' => '',
'timelinAlignmentMobile' => '',
'arrowlinAlignment' => 'center',
'subHeadFontSizeType' => 'px',
'subHeadFontSize' => '',
'subHeadFontSizeTablet' => '',
'subHeadFontSizeMobile' => '',
'subHeadFontFamily' => '',
'subHeadFontWeight' => '',
'subHeadFontStyle' => '',
'subHeadLineHeightType' => 'em',
'subHeadLineHeight' => '',
'subHeadLineHeightTablet' => '',
'subHeadLineHeightMobile' => '',
'subHeadLoadGoogleFonts' => false,
'headSpace' => 5,
'headSpaceTablet' => '',
'headSpaceMobile' => '',
'separatorwidth' => 3,
'borderwidth' => 0,
'iconColor' => '#333',
'iconFocus' => '#fff',
'iconBgFocus' => '#0693e3',
'dateColor' => '#333',
'dateFontsizeType' => 'px',
'dateFontsize' => '12',
'dateFontsizeTablet' => '',
'dateFontsizeMobile' => '',
'dateFontSizeType' => '',
'dateFontSize' => '',
'dateFontSizeTablet' => '',
'dateFontSizeMobile' => '',
'dateFontFamily' => '',
'dateFontWeight' => '',
'dateFontStyle' => '',
'dateLineHeightType' => 'em',
'dateLineHeight' => '',
'dateLineHeightTablet' => '',
'dateLineHeightMobile' => '',
'dateLoadGoogleFonts' => false,
'connectorBgsize' => 35,
'connectorBgsizeTablet' => '',
'connectorBgsizeMobile' => '',
'dateBottomspace' => 5,
'dateBottomspaceTablet' => '',
'dateBottomspaceMobile' => '',
'borderRadius' => 2,
'borderRadiusTablet' => '',
'borderRadiusMobile' => '',
'bgPadding' => 20,
'iconSize' => 12,
'iconSizeTablet' => '',
'iconSizeMobile' => '',
'stack' => 'tablet',
'topMarginTablet' => '',
'rightMarginTablet' => '',
'bottomMarginTablet' => '',
'leftMarginTablet' => '',
'topMarginMobile' => '',
'rightMarginMobile' => '',
'bottomMarginMobile' => '',
'leftMarginMobile' => '',
'marginUnit' => 'px',
'mobileMarginUnit' => 'px',
'tabletMarginUnit' => 'px',
'marginLink' => false,
'topPadding' => '',
'bottomPadding' => '',
'leftPadding' => '',
'rightPadding' => '',
'topPaddingTablet' => '',
'rightPaddingTablet' => '',
'bottomPaddingTablet' => '',
'leftPaddingTablet' => '',
'topPaddingMobile' => '',
'rightPaddingMobile' => '',
'bottomPaddingMobile' => '',
'leftPaddingMobile' => '',
'paddingUnit' => 'px',
'mobilePaddingUnit' => 'px',
'tabletPaddingUnit' => 'px',
'paddingLink' => false,
'headTransform' => '',
'subHeadTransform' => '',
'dateTransform' => '',
'headDecoration' => '',
'subHeadDecoration' => '',
'dateDecoration' => '',
'headLetterSpacing' => '',
'headLetterSpacingTablet' => '',
'headLetterSpacingMobile' => '',
'headLetterSpacingType' => 'px',
'subHeadLetterSpacing' => '',
'subHeadLetterSpacingTablet' => '',
'subHeadLetterSpacingMobile' => '',
'subHeadLetterSpacingType' => 'px',
'dateLetterSpacing' => '',
'dateLetterSpacingTablet' => '',
'dateLetterSpacingMobile' => '',
'dateLetterSpacingType' => 'px',
);

View File

@@ -0,0 +1,33 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/content-timeline';
$block_data = array(
'doc' => 'content-timeline',
'slug' => '',
'admin_categories' => array( 'content' ),
'link' => 'content-timeline-legacy',
'title' => __( 'Content Timeline', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Create a timeline displaying contents of your site.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'content-timeline' ),
'deprecated' => false,
'static_dependencies' => array(
'uagb-timeline-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'timeline' ),
'dep' => array(),
'type' => 'js',
),
),
'static_css' => 'timeline',
'dynamic_assets' => array(
'dir' => 'content-timeline',
),
);

View File

@@ -0,0 +1,372 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_content_timeline_gfont( $attr );
$selectors = array();
$t_selectors = array();
$m_selectors = array();
$top_margin = isset( $attr['topMargin'] ) ? $attr['topMargin'] : $attr['verticalSpace'];
$bottom_margin = isset( $attr['bottomMargin'] ) ? $attr['bottomMargin'] : $attr['verticalSpace'];
$left_margin = isset( $attr['leftMargin'] ) ? $attr['leftMargin'] : $attr['horizontalSpace'];
$right_margin = isset( $attr['rightMargin'] ) ? $attr['rightMargin'] : $attr['horizontalSpace'];
$top_padding = isset( $attr['topPadding'] ) ? $attr['topPadding'] : $attr['bgPadding'];
$bottom_padding = isset( $attr['bottomPadding'] ) ? $attr['bottomPadding'] : $attr['bgPadding'];
$left_padding = isset( $attr['leftPadding'] ) ? $attr['leftPadding'] : $attr['bgPadding'];
$right_padding = isset( $attr['rightPadding'] ) ? $attr['rightPadding'] : $attr['bgPadding'];
$date_font_size = '' !== $attr['dateFontSize'] ? $attr['dateFontSize'] : $attr['dateFontsize'];
$date_font_size_type = '' !== $attr['dateFontSizeType'] ? $attr['dateFontSizeType'] : $attr['dateFontsizeType'];
$selectors = array(
' .uagb-timeline__heading' => array(
'text-align' => $attr['align'],
'color' => $attr['headingColor'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpace'], 'px' ),
),
' .uagb-timeline__marker.uagb-timeline__in-view-icon svg' => array(
'fill' => $attr['iconFocus'],
'color' => $attr['iconFocus'],
),
' .uagb-timeline__heading-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpace'], 'px' ),
),
' .uagb-timeline-desc-content' => array(
'text-align' => $attr['align'],
'color' => $attr['subHeadingColor'],
),
' .uagb-timeline__day-new' => array(
'text-align' => $attr['align'],
),
' .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
'border-right-color' => $attr['backgroundColor'],
),
' .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
'border-right-color' => $attr['backgroundColor'],
),
// Old timeline CSS.
' .uagb-timeline__center-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
' .uagb-timeline__right-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
' .uagb-timeline__right-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
' .uagb-timeline__center-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
' .uagb-timeline__left-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
// Old timeline CSS End.
// New timeline CSS.
'.uagb-timeline__center-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
'.uagb-timeline__right-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
'.uagb-timeline__right-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-left-color' => $attr['backgroundColor'],
),
'.uagb-timeline__center-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
'.uagb-timeline__left-block .uagb-timeline__day-left .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
// New timeline CSS End.
' .uagb-timeline__line__inner' => array(
'background-color' => $attr['separatorFillColor'],
),
' .uagb-timeline__line' => array(
'background-color' => $attr['separatorColor'],
'width' => UAGB_Helper::get_css_value( $attr['separatorwidth'], 'px' ),
),
'.uagb-timeline__right-block .uagb-timeline__line' => array(
'right' => 'calc( ' . $attr['connectorBgsize'] . 'px / 2 )',
),
'.uagb-timeline__left-block .uagb-timeline__line' => array(
'left' => 'calc( ' . $attr['connectorBgsize'] . 'px / 2 )',
),
'.uagb-timeline__center-block .uagb-timeline__line' => array(
'right' => 'calc( ' . $attr['connectorBgsize'] . 'px / 2 )',
),
' .uagb-timeline__marker' => array(
'background-color' => $attr['separatorBg'],
'min-height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
'min-width' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
'line-height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
'border' => $attr['borderwidth'] . 'px solid ' . $attr['separatorBorder'],
),
'.uagb-timeline__left-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
),
'.uagb-timeline__right-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsize'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
' .uagb-timeline__field:not(:last-child)' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['verticalSpace'], $attr['verticalSpaceUnit'] ),
),
' .uagb-timeline__date-hide.uagb-timeline__date-inner' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspace'], 'px' ),
'color' => $attr['dateColor'],
'text-align' => $attr['align'],
),
' .uagb-timeline__date-hide.uagb-timeline__inner-date-new' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspace'], 'px' ),
'color' => $attr['dateColor'],
'text-align' => $attr['align'],
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpace'], $attr['horizontalSpaceUnit'] ),
),
' .uagb-timeline__date-new' => array(
'color' => $attr['dateColor'],
'font-size' => UAGB_Helper::get_css_value( $date_font_size, $date_font_size_type ),
),
'.uagb-timeline__right-block .uagb-timeline__date-hide.uagb-timeline__date-inner' => array(
'font-size' => UAGB_Helper::get_css_value( $date_font_size, $date_font_size_type ),
),
'.uagb-timeline__left-block .uagb-timeline__date-hide.uagb-timeline__date-inner' => array(
'font-size' => UAGB_Helper::get_css_value( $date_font_size, $date_font_size_type ),
),
' .uagb-events-new .uagb-timeline__events-inner-new' => array( // Old user CSS.
'padding' => UAGB_Helper::get_css_value( $attr['bgPadding'], 'px' ),
),
' .uagb-timeline__events-inner-new' => array(
'background-color' => $attr['backgroundColor'],
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadius'], 'px' ),
),
' .uagb-timeline__events-inner--content' => array(
'padding-left' => UAGB_Helper::get_css_value( $left_padding, $attr['paddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $right_padding, $attr['paddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $top_padding, $attr['paddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $bottom_padding, $attr['paddingUnit'] ),
),
' .uagb-timeline__marker svg' => array(
'color' => $attr['iconColor'],
'width' => UAGB_Helper::get_css_value( $attr['iconSize'], 'px' ),
'fill' => $attr['iconColor'],
),
' .uagb-timeline__marker.uagb-timeline__in-view-icon' => array(
'background' => $attr['iconBgFocus'],
'border-color' => $attr['borderFocus'],
),
);
$m_selectors = array(
' .uagb-timeline__heading' => array(
'text-align' => $attr['alignMobile'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpaceMobile'], 'px' ),
),
' .uagb-timeline-desc-content' => array(
'text-align' => $attr['alignMobile'],
),
' .uagb-timeline__day-new' => array(
'text-align' => $attr['alignMobile'],
),
' .uagb-timeline__heading-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpaceMobile'], 'px' ),
),
' .uagb-timeline__date-hide.uagb-timeline__date-inner' => array(
'text-align' => $attr['alignMobile'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspaceMobile'], 'px' ),
),
' .uagb-timeline__date-hide.uagb-timeline__inner-date-new' => array(
'text-align' => $attr['alignMobile'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspaceMobile'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceMobile'], $attr['horizontalSpaceUnitMobile'] ),
),
' .uagb-timeline__events-inner--content' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingMobile'], $attr['mobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingMobile'], $attr['mobilePaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingMobile'], $attr['mobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingMobile'], $attr['mobilePaddingUnit'] ),
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadiusMobile'], 'px' ),
),
'.uagb-timeline__right' => array(
'text-align' => $attr['alignMobile'],
),
' .uagb-timeline__marker svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['iconSizeMobile'], 'px' ),
),
' .uagb-timeline__marker' => array(
'background-color' => $attr['separatorBg'],
'min-height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
'min-width' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
'line-height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
'border' => $attr['borderwidth'] . 'px solid ' . $attr['separatorBorder'],
),
'.uagb-timeline__left-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
),
'.uagb-timeline__right-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeMobile'], 'px' ),
),
' .uagb-timeline__field:not(:last-child)' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['verticalSpaceMobile'], $attr['verticalSpaceUnitMobile'] ),
),
);
$t_selectors = array(
' .uagb-timeline__marker svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['iconSizeTablet'], 'px' ),
),
' .uagb-timeline__heading' => array(
'text-align' => $attr['alignTablet'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpaceTablet'], 'px' ),
),
' .uagb-timeline__heading-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headSpaceTablet'], 'px' ),
),
' .uagb-timeline-desc-content' => array(
'text-align' => $attr['alignTablet'],
),
' .uagb-timeline__day-new' => array(
'text-align' => $attr['alignTablet'],
),
' .uagb-timeline__date-hide.uagb-timeline__date-inner' => array(
'text-align' => $attr['alignTablet'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspaceTablet'], 'px' ),
),
' .uagb-timeline__date-hide.uagb-timeline__inner-date-new' => array(
'text-align' => $attr['alignTablet'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['dateBottomspaceTablet'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__day-right .uagb-timeline__arrow:after' => array(
'border-right-color' => $attr['backgroundColor'],
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__marker' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-left' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
'.uagb-timeline__left-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
'.uagb-timeline__right-block .uagb-timeline__day-new.uagb-timeline__day-right' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['horizontalSpaceTablet'], $attr['horizontalSpaceUnitTablet'] ),
),
' .uagb-timeline__events-inner--content' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['leftPaddingTablet'], $attr['tabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['rightPaddingTablet'], $attr['tabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['topPaddingTablet'], $attr['tabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['bottomPaddingTablet'], $attr['tabletPaddingUnit'] ),
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadiusTablet'], 'px' ),
),
'.uagb-timeline__right' => array(
'text-align' => $attr['alignTablet'],
),
' .uagb-timeline__marker svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['iconSizeTablet'], 'px' ),
),
' .uagb-timeline__marker' => array(
'background-color' => $attr['separatorBg'],
'min-height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
'min-width' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
'line-height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
'border' => $attr['borderwidth'] . 'px solid ' . $attr['separatorBorder'],
),
'.uagb-timeline__left-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
),
'.uagb-timeline__right-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__left .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
),
'.uagb-timeline__center-block .uagb-timeline__right .uagb-timeline__arrow' => array(
'height' => UAGB_Helper::get_css_value( $attr['connectorBgsizeTablet'], 'px' ),
),
' .uagb-timeline__field:not(:last-child)' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['verticalSpaceTablet'], $attr['verticalSpaceUnitTablet'] ),
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = ( $attr['classMigrate'] ) ? '.uagb-block-' : '#uagb-ctm-';
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'head', ' .uagb-timeline__heading', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'date', ' .uagb-timeline__date-new', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'date', ' .uagb-timeline__date-hide.uagb-timeline__inner-date-new', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'date', ' .uagb-timeline__date-hide.uagb-timeline__date-inner', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'subHead', ' .uagb-timeline-desc-content', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id . '.uagb-timeline__outer-wrap' );

View File

@@ -0,0 +1,32 @@
<?php
/**
* Frontend JS File.
*
* @since 2.0.0
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
$timelineAlignment = $attr['timelinAlignment'];
$timelineAlignmentTablet = ! empty( $attr['timelinAlignmentTablet'] ) ? $attr['timelinAlignmentTablet'] : $attr['timelinAlignment'];
$timelineAlignmentMobile = ! empty( $attr['timelinAlignmentMobile'] ) ? $attr['timelinAlignmentMobile'] : $timelineAlignmentTablet;
$js_attr = array(
'block_id' => $attr['block_id'],
'timelinAlignment' => $timelineAlignment,
'timelinAlignmentTablet' => $timelineAlignmentTablet,
'timelinAlignmentMobile' => $timelineAlignmentMobile,
);
ob_start();
?>
window.addEventListener("DOMContentLoaded", function(){
UAGBTimelineClasses( <?php echo wp_json_encode( $js_attr ); ?>, '<?php echo esc_attr( $selector ); ?>' );
});
window.addEventListener("resize", function(){
UAGBTimelineClasses( <?php echo wp_json_encode( $js_attr ); ?>, '<?php echo esc_attr( $selector ); ?>' );
});
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,208 @@
<?php
/**
* Attributes File.
*
* @since 2.4.0
*
* @package uagb
*/
$box_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'box' );
$additional_attributes = apply_filters(
'spectra_countdown_attributes',
array()
);
return array_merge(
array(
'block_id' => '',
'isFrontend' => true,
'timerType' => 'date',
'timerEndAction' => 'zero',
'redirectURL' => '',
'endDateTime' => '2023-01-01T00:00:00Z',
'displayEndDateTime' => '2023-01-01T00:00:00Z',
'showDays' => true,
'showHours' => true,
'showMinutes' => true,
'showSeconds' => true,
'showSeparator' => true,
'separatorType' => ':',
'ariaLiveType' => 'off',
'showLabels' => true,
'labelDays' => __( 'DAYS', 'ultimate-addons-for-gutenberg' ),
'labelHours' => __( 'HOURS', 'ultimate-addons-for-gutenberg' ),
'labelMinutes' => __( 'MINUTES', 'ultimate-addons-for-gutenberg' ),
'labelSeconds' => __( 'SECONDS', 'ultimate-addons-for-gutenberg' ),
// Digit.
'digitLoadGoogleFonts' => false,
'digitColor' => '',
'digitFontFamily' => 'Default',
'digitFontWeight' => '',
'digitFontStyle' => 'normal',
'digitTransform' => '',
'digitDecoration' => '',
'digitFontSizeType' => 'px',
'digitFontSizeTypeTablet' => 'px',
'digitFontSizeTypeMobile' => 'px',
'digitLineHeightType' => 'em',
'digitLetterSpacingType' => 'em',
'digitFontSize' => '',
'digitFontSizeTablet' => '',
'digitFontSizeMobile' => '',
'digitLineHeight' => '',
'digitLineHeightTablet' => '',
'digitLineHeightMobile' => '',
'digitLetterSpacing' => '',
'digitLetterSpacingTablet' => '',
'digitLetterSpacingMobile' => '',
// Label.
'labelLoadGoogleFonts' => false,
'labelColor' => '',
'labelFontFamily' => 'Default',
'labelFontWeight' => '',
'labelFontStyle' => 'normal',
'labelTransform' => '',
'labelDecoration' => '',
'labelFontSizeType' => 'px',
'labelFontSizeTypeTablet' => 'px',
'labelFontSizeTypeMobile' => 'px',
'labelLineHeightType' => 'em',
'labelLetterSpacingType' => 'em',
'labelFontSize' => '',
'labelFontSizeTablet' => '',
'labelFontSizeMobile' => '',
'labelLineHeight' => '',
'labelLineHeightTablet' => '',
'labelLineHeightMobile' => '',
'labelLetterSpacing' => '',
'labelLetterSpacingTablet' => '',
'labelLetterSpacingMobile' => '',
// Separator Styles.
'separatorFontFamily' => '',
'separatorFontWeight' => '',
'separatorFontStyle' => '',
'separatorFontSize' => '',
'separatorColor' => '',
'separatorFontSizeType' => 'px',
'separatorFontSizeTypeTablet' => 'px',
'separatorFontSizeTypeMobile' => 'px',
'separatorFontSizeMobile' => '',
'separatorFontSizeTablet' => '',
'separatorLineHeight' => '',
'separatorLineHeightType' => 'em',
'separatorLineHeightMobile' => '',
'separatorLineHeightTablet' => '',
'separatorRightSpacing' => 26,
'separatorRightSpacingTablet' => 14,
'separatorRightSpacingMobile' => 12,
'separatorTopSpacing' => '',
'separatorTopSpacingTablet' => '',
'separatorTopSpacingMobile' => '',
// Block Margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
// Block Padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
// Box Padding.
'boxTopPadding' => '',
'boxRightPadding' => '',
'boxLeftPadding' => '',
'boxBottomPadding' => '',
'boxTopPaddingTablet' => '',
'boxRightPaddingTablet' => '',
'boxLeftPaddingTablet' => '',
'boxBottomPaddingTablet' => '',
'boxTopPaddingMobile' => '',
'boxRightPaddingMobile' => '',
'boxLeftPaddingMobile' => '',
'boxBottomPaddingMobile' => '',
'boxPaddingUnit' => 'px',
'boxPaddingUnitTablet' => 'px',
'boxPaddingUnitMobile' => 'px',
// Box Align.
'align' => 'center',
'alignTablet' => '',
'alignMobile' => '',
// Box Align.
'boxAlign' => 'center',
'boxAlignTablet' => 'center',
'boxAlignMobile' => 'center',
// Box Width.
'boxWidth' => '',
'boxWidthTablet' => '',
'boxWidthMobile' => '',
// Square Box.
'isSquareBox' => true,
// Box Spacing.
'boxSpacing' => 38,
'boxSpacingTablet' => 20,
'boxSpacingMobile' => 18,
// Internal Box Spacing - Gap between digits and labels.
'internalBoxSpacing' => '',
'internalBoxSpacingTablet' => '',
'internalBoxSpacingMobile' => '',
// Box Flex.
'boxFlex' => 'column',
'boxFlexTablet' => 'column',
'boxFlexMobile' => 'column',
// Label vertical alignment.
'labelVerticalAlignment' => 'center',
'labelVerticalAlignmentTablet' => '',
'labelVerticalAlignmentMobile' => '',
// Box Background.
'boxBgType' => 'transparent',
'boxBgColor' => '',
// Box - Box Shadow.
// Box Shadow.
'useSeparateBoxShadows' => true,
'boxShadowColor' => '#00000070',
'boxShadowHOffset' => 0,
'boxShadowVOffset' => 0,
'boxShadowBlur' => '',
'boxShadowSpread' => '',
'boxShadowPosition' => '',
'boxShadowColorHover' => '',
'boxShadowHOffsetHover' => 0,
'boxShadowVOffsetHover' => 0,
'boxShadowBlurHover' => '',
'boxShadowSpreadHover' => '',
'boxShadowPositionHover' => '',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
),
$additional_attributes,
$box_border_attribute,
array(
'boxBorderStyle' => 'default',
)
);

View File

@@ -0,0 +1,31 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.4.0
*
* @package uagb
*/
$block_slug = 'uagb/countdown';
$block_data = array(
'doc' => 'countdown',
'slug' => '',
'admin_categories' => array( 'creative', 'core' ),
'link' => 'countdown-legacy',
'title' => __( 'Countdown', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'This block allows you to add countdown timers.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'countdown' ),
'static_dependencies' => array(
'uagb-countdown-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'uagb-countdown' ),
'dep' => array(),
'type' => 'js',
),
),
'dynamic_assets' => array(
'dir' => 'countdown',
),
);

View File

@@ -0,0 +1,364 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.4.0
*
* @package uagb
*/
$attr = isset( $attr ) ? $attr : array();
UAGB_Block_JS::blocks_countdown_gfont( $attr );
$is_rtl = is_rtl();
$child_selector_type = $is_rtl ? 'first' : 'last';
$pseudo_element_selector_type = $is_rtl ? 'before' : 'after';
$separator_selector = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box:not(:' . $child_selector_type . '-child) .wp-block-uagb-countdown__time::' . $pseudo_element_selector_type;
// On showSeconds disable this selector is used to remove the separator after minutes.
$min_separator_removal_selector = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-minutes:not(:' .
$child_selector_type .
'-child) .wp-block-uagb-countdown__time.wp-block-uagb-countdown__time-minutes::' .
$pseudo_element_selector_type;
// On showSeconds and showMinutes disable this selector is used to remove the separator after hours.
$hour_separator_removal_selector = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-hours:not(:' .
$child_selector_type .
'-child) .wp-block-uagb-countdown__time.wp-block-uagb-countdown__time-hours::' .
$pseudo_element_selector_type;
// On showSeconds, showMinutes and showHours disable this selector is used to remove the separator after days.
$days_separator_removal_selector = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-days:not(:' .
$child_selector_type .
'-child) .wp-block-uagb-countdown__time.wp-block-uagb-countdown__time-days::' .
$pseudo_element_selector_type;
// Box Border CSS.
$box_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'box' );
$box_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'box', 'tablet' );
$box_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'box', 'mobile' );
// Box Shadow.
$box_shadow_properties = array(
'horizontal' => $attr['boxShadowHOffset'],
'vertical' => $attr['boxShadowVOffset'],
'blur' => $attr['boxShadowBlur'],
'spread' => $attr['boxShadowSpread'],
'color' => $attr['boxShadowColor'],
'position' => $attr['boxShadowPosition'],
);
$box_shadow_hover_properties = array(
'horizontal' => $attr['boxShadowHOffsetHover'],
'vertical' => $attr['boxShadowVOffsetHover'],
'blur' => $attr['boxShadowBlurHover'],
'spread' => $attr['boxShadowSpreadHover'],
'color' => $attr['boxShadowColorHover'],
'position' => $attr['boxShadowPositionHover'],
'alt_color' => $attr['boxShadowColor'],
);
$box_shadow_css = UAGB_Block_Helper::generate_shadow_css( $box_shadow_properties );
$box_shadow_hover_css = UAGB_Block_Helper::generate_shadow_css( $box_shadow_hover_properties );
$m_selectors = array();
$t_selectors = array();
$selectors = array(
'.wp-block-uagb-countdown' => array(
'justify-content' => $attr['align'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMargin'], $attr['blockMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMargin'], $attr['blockMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMargin'], $attr['blockMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMargin'], $attr['blockMarginUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPadding'], $attr['blockPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPadding'], $attr['blockPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPadding'], $attr['blockPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPadding'], $attr['blockPaddingUnit'] ),
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box-days' => array(
'display' => $attr['showDays'] ? '' : 'none',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box-hours' => array(
'display' => $attr['showHours'] ? '' : 'none',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box-minutes' => array(
'display' => $attr['showMinutes'] ? '' : 'none',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box-seconds' => array(
'display' => $attr['showSeconds'] ? '' : 'none',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box' => array_merge(
array(
'aspect-ratio' => $attr['isSquareBox'] ? 1 : 'auto',
'width' => UAGB_Helper::get_css_value( $attr['boxWidth'], 'px' ),
'height' => $attr['isSquareBox'] ? UAGB_Helper::get_css_value( $attr['boxWidth'], 'px' ) : 'auto',
'flex-direction' => $attr['boxFlex'],
'justify-content' => ( 'column' !== $attr['boxFlex'] ) ? $attr['boxAlign'] : 'center',
'align-items' => ( 'row' !== $attr['boxFlex'] ) ? $attr['boxAlign'] : 'center',
'background-color' => ( 'transparent' !== $attr['boxBgType'] ) ? $attr['boxBgColor'] : 'transparent',
'padding-top' => UAGB_Helper::get_css_value( $attr['boxTopPadding'], $attr['boxPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['boxRightPadding'], $attr['boxPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['boxBottomPadding'], $attr['boxPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['boxLeftPadding'], $attr['boxPaddingUnit'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacing'], 'px' ),
'column-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacing'], 'px' ),
'box-shadow' => $box_shadow_css,
),
$box_border_css
),
'.wp-block-uagb-countdown:hover .wp-block-uagb-countdown__box' => array(
'border-color' => $attr['boxBorderHColor'],
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-minutes:not(:last-child)' => array(
'margin-right' => $attr['showSeconds'] ? UAGB_Helper::get_css_value( $attr['boxSpacing'], 'px' ) : 'unset',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-hours:not(:last-child)' => array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacing'], 'px' ) : 'unset',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-days:not(:last-child)' => array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] || $attr['showHours'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacing'], 'px' ) : 'unset',
),
'.wp-block-uagb-countdown .wp-block-uagb-countdown__time' => array(
'font-family' => $attr['digitFontFamily'],
'font-style' => $attr['digitFontStyle'],
'text-decoration' => $attr['digitDecoration'],
'font-weight' => $attr['digitFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['digitFontSize'], $attr['digitFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['digitLineHeight'], $attr['digitLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['digitLetterSpacing'], $attr['digitLetterSpacingType'] ),
'color' => $attr['digitColor'],
),
'.wp-block-uagb-countdown div.wp-block-uagb-countdown__label' => array(
'align-self' => ( ! $attr['isSquareBox'] && ( 'row' === $attr['boxFlex'] ) ) ? $attr['labelVerticalAlignment'] : 'unset',
'font-family' => $attr['labelFontFamily'],
'font-style' => $attr['labelFontStyle'],
'text-decoration' => $attr['labelDecoration'],
'text-transform' => $attr['labelTransform'],
'font-weight' => $attr['labelFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSize'], $attr['labelFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeight'], $attr['labelLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacing'], $attr['labelLetterSpacingType'] ),
'color' => $attr['labelColor'],
),
);
// If using separate box shadow hover settings, then generate CSS for it.
if ( $attr['useSeparateBoxShadows'] ) {
$selectors['.wp-block-uagb-countdown:hover .wp-block-uagb-countdown__box']['box-shadow'] = $box_shadow_hover_css;
}
// TABLET SELECTORS.
$t_selectors['.wp-block-uagb-countdown'] = array(
'justify-content' => $attr['alignTablet'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginTablet'], $attr['blockMarginUnitTablet'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box'] = array_merge(
array(
'width' => UAGB_Helper::get_css_value( $attr['boxWidthTablet'], 'px' ),
'height' => $attr['isSquareBox'] ? UAGB_Helper::get_css_value( $attr['boxWidthTablet'], 'px' ) : 'auto',
'flex-direction' => $attr['boxFlexTablet'],
'justify-content' => ( 'column' !== $attr['boxFlexTablet'] ) ? $attr['boxAlignTablet'] : 'center',
'align-items' => ( 'row' !== $attr['boxFlexTablet'] ) ? $attr['boxAlignTablet'] : 'center',
'padding-top' => UAGB_Helper::get_css_value( $attr['boxTopPaddingTablet'], $attr['boxPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['boxRightPaddingTablet'], $attr['boxPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['boxBottomPaddingTablet'], $attr['boxPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['boxLeftPaddingTablet'], $attr['boxPaddingUnitTablet'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacingTablet'], 'px' ),
'column-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacingTablet'], 'px' ),
),
$box_border_css_tablet
);
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-minutes:not(:last-child)'] = array(
'margin-right' => $attr['showSeconds'] ? UAGB_Helper::get_css_value( $attr['boxSpacingTablet'], 'px' ) : 'unset',
);
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-hours:not(:last-child)'] = array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacingTablet'], 'px' ) : 'unset',
);
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-days:not(:last-child)'] = array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] || $attr['showHours'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacingTablet'], 'px' ) : 'unset',
);
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__time'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['digitFontSizeTablet'], $attr['digitFontSizeTypeTablet'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['digitLineHeightTablet'], $attr['digitLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['digitLetterSpacingTablet'], $attr['digitLetterSpacingType'] ),
);
$t_selectors['.wp-block-uagb-countdown div.wp-block-uagb-countdown__label'] = array(
'align-self' => ( ! $attr['isSquareBox'] && ( 'row' === $attr['boxFlexTablet'] ) ) ? $attr['labelVerticalAlignmentTablet'] : 'unset',
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSizeTablet'], $attr['labelFontSizeTypeTablet'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeightTablet'], $attr['labelLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacingTablet'], $attr['labelLetterSpacingType'] ),
);
// MOBILE SELECTORS.
$m_selectors['.wp-block-uagb-countdown'] = array(
'justify-content' => $attr['alignMobile'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginMobile'], $attr['blockMarginUnitMobile'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box'] = array_merge(
array(
'width' => UAGB_Helper::get_css_value( $attr['boxWidthMobile'], 'px' ),
'height' => $attr['isSquareBox'] ? UAGB_Helper::get_css_value( $attr['boxWidthMobile'], 'px' ) : 'auto',
'flex-direction' => $attr['boxFlexMobile'],
'justify-content' => ( 'column' !== $attr['boxFlexMobile'] ) ? $attr['boxAlignMobile'] : 'center',
'align-items' => ( 'row' !== $attr['boxFlexMobile'] ) ? $attr['boxAlignMobile'] : 'center',
'padding-top' => UAGB_Helper::get_css_value( $attr['boxTopPaddingMobile'], $attr['boxPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['boxRightPaddingMobile'], $attr['boxPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['boxBottomPaddingMobile'], $attr['boxPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['boxLeftPaddingMobile'], $attr['boxPaddingUnitMobile'] ),
'row-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacingMobile'], 'px' ),
'column-gap' => UAGB_Helper::get_css_value( $attr['internalBoxSpacingMobile'], 'px' ),
),
$box_border_css_mobile
);
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-minutes:not(:last-child)'] = array(
'margin-right' => $attr['showSeconds'] ? UAGB_Helper::get_css_value( $attr['boxSpacingMobile'], 'px' ) : 'unset',
);
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-hours:not(:last-child)'] = array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacingMobile'], 'px' ) : 'unset',
);
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box.wp-block-uagb-countdown__box-days:not(:last-child)'] = array(
'margin-right' => ( $attr['showSeconds'] || $attr['showMinutes'] || $attr['showHours'] ) ? UAGB_Helper::get_css_value( $attr['boxSpacingMobile'], 'px' ) : 'unset',
);
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__time'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['digitFontSizeMobile'], $attr['digitFontSizeTypeMobile'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['digitLineHeightMobile'], $attr['digitLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['digitLetterSpacingMobile'], $attr['digitLetterSpacingType'] ),
);
$m_selectors['.wp-block-uagb-countdown div.wp-block-uagb-countdown__label'] = array(
'align-self' => ( ! $attr['isSquareBox'] && ( 'row' === $attr['boxFlexMobile'] ) ) ? $attr['labelVerticalAlignmentMobile'] : 'unset',
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSizeMobile'], $attr['labelFontSizeTypeMobile'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeightMobile'], $attr['labelLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacingMobile'], $attr['labelLetterSpacingType'] ),
);
if ( true === $attr['showSeparator'] ) {
$selectors[ $separator_selector ] = array(
'content' => $attr['separatorType'] ? "'" . $attr['separatorType'] . "'" : '',
'font-family' => $attr['separatorFontFamily'],
'font-style' => $attr['separatorFontStyle'],
'font-weight' => $attr['separatorFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['separatorFontSize'], $attr['separatorFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['separatorLineHeight'], $attr['separatorLineHeightType'] ),
'color' => $attr['separatorColor'],
'right' => is_int( $attr['separatorRightSpacing'] ) ? UAGB_Helper::get_css_value( -$attr['separatorRightSpacing'], 'px' ) : '',
'top' => UAGB_Helper::get_css_value( $attr['separatorTopSpacing'], 'px' ),
);
$selectors[ $min_separator_removal_selector ] = array(
'display' => $attr['showSeconds'] ? '' : 'none',
);
$selectors[ $hour_separator_removal_selector ] = array(
'display' => ( $attr['showMinutes'] || $attr['showSeconds'] ) ? '' : 'none',
);
$selectors[ $days_separator_removal_selector ] = array(
'display' => ( $attr['showHours'] || $attr['showMinutes'] || $attr['showSeconds'] ) ? '' : 'none',
);
$t_selectors[ $separator_selector ] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['separatorFontSizeTablet'], $attr['separatorFontSizeTypeTablet'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['separatorLineHeightTablet'], $attr['separatorLineHeightType'] ),
'right' => is_int( $attr['separatorRightSpacingTablet'] ) ? UAGB_Helper::get_css_value( -$attr['separatorRightSpacingTablet'], 'px' ) : '',
'top' => UAGB_Helper::get_css_value( $attr['separatorTopSpacingTablet'], 'px' ),
);
$m_selectors[ $separator_selector ] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['separatorFontSizeMobile'], $attr['separatorFontSizeTypeMobile'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['separatorLineHeightMobile'], $attr['separatorLineHeightType'] ),
'right' => is_int( $attr['separatorRightSpacingMobile'] ) ? UAGB_Helper::get_css_value( -$attr['separatorRightSpacingMobile'], 'px' ) : '',
'top' => UAGB_Helper::get_css_value( $attr['separatorTopSpacingMobile'], 'px' ),
);
}
// RTL support for box gap.
if ( $is_rtl ) {
$boxGapSelectorLTR = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box:not(:last-child)';
$boxGapSelectorRTL = '.wp-block-uagb-countdown .wp-block-uagb-countdown__box:not(:first-child)';
$selectors[ $boxGapSelectorLTR ]['margin-right'] = 'unset';
$t_selectors[ $boxGapSelectorLTR ]['margin-right'] = 'unset';
$m_selectors[ $boxGapSelectorLTR ]['margin-right'] = 'unset';
$selectors[ $boxGapSelectorRTL ]['margin-right'] = UAGB_Helper::get_css_value( $attr['boxSpacing'], 'px' );
$t_selectors[ $boxGapSelectorRTL ]['margin-right'] = UAGB_Helper::get_css_value( $attr['boxSpacingTablet'], 'px' );
$m_selectors[ $boxGapSelectorRTL ]['margin-right'] = UAGB_Helper::get_css_value( $attr['boxSpacingMobile'], 'px' );
}
if ( ! empty( $attr['globalBlockStyleId'] ) && empty( $attr['isSquareBox'] ) ) {
$selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['aspect-ratio'] = '';
$selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['height'] = '';
// For Tablet.
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['aspect-ratio'] = '';
$t_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['height'] = '';
// For Mobile.
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['aspect-ratio'] = '';
$m_selectors['.wp-block-uagb-countdown .wp-block-uagb-countdown__box']['height'] = '';
}
$combined_selectors = UAGB_Helper::get_combined_selectors(
'countdown',
array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
),
$attr
);
$base_selector = '.uagb-block-';
return UAGB_Helper::generate_all_css(
$combined_selectors,
$base_selector . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,36 @@
<?php
/**
* Frontend JS File.
*
* @since 2.4.0
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
$countdown_options = apply_filters(
'uagb_countdown_options',
array(
'block_id' => $attr['block_id'],
'endDateTime' => $attr['endDateTime'],
'showDays' => $attr['showDays'],
'showHours' => $attr['showHours'],
'showMinutes' => $attr['showMinutes'],
'isFrontend' => true,
'timerEndAction' => $attr['timerEndAction'],
'redirectURL' => $attr['redirectURL'],
),
$id,
$attr
);
ob_start();
?>
window.addEventListener( 'load', function() {
UAGBCountdown.init( '<?php echo esc_attr( $selector ); ?>', <?php echo wp_json_encode( $countdown_options ); ?> );
});
<?php
$dynamic_js = apply_filters( 'spectra_countdown_frontend_dynamic_js', ob_get_clean(), $selector, $countdown_options );
return $dynamic_js;
?>

View File

@@ -0,0 +1,218 @@
<?php
/**
* Attributes File.
*
* @since 2.1.0
*
* @package uagb
*/
$icon_wrap_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'iconWrap' );
return array_merge(
array(
'block_id' => '',
'isFrontend' => true,
'layout' => 'number',
'align' => 'center',
'alignTablet' => '',
'alignMobile' => '',
'startNumber' => 0,
'endNumber' => 80,
'totalNumber' => 100,
'decimalPlaces' => 0,
'numberPrefix' => '',
'numberSuffix' => '%',
'animationDuration' => 1500,
'thousandSeparator' => ',',
// heading.
'heading' => __( 'Add Your Title Here…', 'ultimate-addons-for-gutenberg' ),
'headingTag' => '',
'headingFontFamily' => 'Default',
'headingFontWeight' => '',
'headingFontStyle' => 'normal',
'headingTransform' => '',
'headingFontSize' => '',
'headingColor' => '#4B4F58',
'headingTransform' => '',
'headingDecoration' => '',
'headingFontSizeType' => 'px',
'headingFontSizeMobile' => '',
'headingFontSizeTablet' => '',
'headingLineHeight' => 'em',
'headingLineHeightType' => 'em',
'headingLineHeightMobile' => '',
'headingLineHeightTablet' => '',
'headingLetterSpacingType' => 'px',
'headingLetterSpacing' => '',
'headingLetterSpacingTablet' => '',
'headingLetterSpacingMobile' => '',
// Heading Margin.
'headingTopMargin' => '',
'headingRightMargin' => '',
'headingLeftMargin' => '',
'headingBottomMargin' => '',
'headingTopMarginTablet' => '',
'headingRightMarginTablet' => '',
'headingLeftMarginTablet' => '',
'headingBottomMarginTablet' => '',
'headingTopMarginMobile' => '',
'headingRightMarginMobile' => '',
'headingLeftMarginMobile' => '',
'headingBottomMarginMobile' => '',
'headingMarginUnit' => 'px',
'headingMarginUnitTablet' => 'px',
'headingMarginUnitMobile' => 'px',
// Block Margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
// Block Padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
// number.
'numberColor' => '',
'numberFontFamily' => '',
'numberFontStyle' => 'normal',
'numberTransform' => '',
'numberDecoration' => '',
'numberFontSizeType' => 'px',
'numberLineHeightType' => 'em',
'numberFontSize' => '',
'numberFontWeight' => '',
'numberFontSizeTablet' => '',
'numberFontSizeMobile' => '',
'numberLineHeight' => '',
'numberLineHeightTablet' => '',
'numberLineHeightMobile' => '',
'numberTopMargin' => '',
'numberRightMargin' => '',
'numberLeftMargin' => '',
'numberBottomMargin' => '',
'numberTopMarginTablet' => '',
'numberRightMarginTablet' => '',
'numberLeftMarginTablet' => '',
'numberBottomMarginTablet' => '',
'numberTopMarginMobile' => '',
'numberRightMarginMobile' => '',
'numberLeftMarginMobile' => '',
'numberBottomMarginMobile' => '',
'numberMarginUnit' => 'px',
'numberMarginUnitTablet' => 'px',
'numberMarginUnitMobile' => 'px',
'numberLetterSpacingType' => 'px',
'numberLetterSpacing' => '',
'numberLetterSpacingTablet' => '',
'numberLetterSpacingMobile' => '',
// Prefix.
'prefixRightDistance' => 0,
'prefixRightDistanceTablet' => '',
'prefixRightDistanceMobile' => '',
// Suffix.
'suffixLeftDistance' => 0,
'suffixLeftDistanceTablet' => '',
'suffixLeftDistanceMobile' => '',
// circle.
'circleSize' => 230,
'circleStokeSize' => 8,
'circleForeground' => '#007cba',
'circleBackground' => '#eaeaea',
// bar.
'barSize' => '',
'barForeground' => '#007cba',
'barBackground' => '#eaeaea',
'barFlip' => false,
// Box Shadow.
'boxShadowColor' => '#00000070',
'boxShadowHOffset' => 0,
'boxShadowVOffset' => 0,
'boxShadowBlur' => '',
'boxShadowSpread' => '',
'boxShadowPosition' => '',
'boxShadowColorHover' => '',
'boxShadowHOffsetHover' => 0,
'boxShadowVOffsetHover' => 0,
'boxShadowBlurHover' => '',
'boxShadowSpreadHover' => '',
'boxShadowPositionHover' => '',
'showIcon' => true,
// Icon and Image.
'sourceType' => 'icon',
'icon' => 'star',
'iconColor' => '#4B4F58',
'iconBackgroundColor' => '',
'iconHoverColor' => '',
'iconBackgroundHoverColor' => '',
'iconSize' => 30,
'iconSizeTablet' => '',
'iconSizeMobile' => '',
'iconSizeType' => 'px',
'iconSizeTypeTablet' => 'px',
'iconSizeTypeMobile' => 'px',
'iconImgPosition' => 'top',
'imageWidthType' => true,
'imageWidth' => '',
'imageWidthTablet' => '',
'imageWidthMobile' => '',
'imageWidthUnit' => 'px',
'imageWidthUnitTablet' => 'px',
'imageWidthUnitMobile' => 'px',
// Icon Padding.
'iconTopPadding' => '',
'iconRightPadding' => '',
'iconLeftPadding' => '',
'iconBottomPadding' => '',
'iconTopPaddingTablet' => '',
'iconRightPaddingTablet' => '',
'iconLeftPaddingTablet' => '',
'iconBottomPaddingTablet' => '',
'iconTopPaddingMobile' => '',
'iconRightPaddingMobile' => '',
'iconLeftPaddingMobile' => '',
'iconBottomPaddingMobile' => '',
'iconPaddingUnit' => 'px',
'iconPaddingUnitTablet' => 'px',
'iconPaddingUnitMobile' => 'px',
'iconTopMargin' => '',
'iconRightMargin' => '',
'iconLeftMargin' => '',
'iconBottomMargin' => '',
'iconTopMarginTablet' => '',
'iconRightMarginTablet' => '',
'iconLeftMarginTablet' => '',
'iconBottomMarginTablet' => '',
'iconTopMarginMobile' => '',
'iconRightMarginMobile' => '',
'iconLeftMarginMobile' => '',
'iconBottomMarginMobile' => '',
'iconMarginUnit' => 'px',
'iconMarginUnitTablet' => 'px',
'iconMarginUnitMobile' => 'px',
),
$icon_wrap_border_attribute
);

View File

@@ -0,0 +1,34 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.1.0
*
* @package uagb
*/
$block_slug = 'uagb/counter';
$block_data = array(
'doc' => 'counter',
'slug' => '',
'admin_categories' => array( 'content', 'post' ),
'link' => 'counter',
'title' => __( 'Counter', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'This block allows you to add number counter.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'counter' ),
'static_dependencies' => array(
'uagb-counter-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'spectra-counter' ),
'dep' => array(),
'type' => 'js',
),
'uagb-countUp-js' => array(
'type' => 'js',
),
),
'dynamic_assets' => array(
'dir' => 'counter',
),
);

View File

@@ -0,0 +1,413 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.1.0
*
* @package uagb
*/
// Add fonts.
UAGB_Block_JS::blocks_counter_gfont( $attr );
$attr['prefixRightDistanceTablet'] = is_numeric( $attr['prefixRightDistanceTablet'] ) ? $attr['prefixRightDistanceTablet'] : $attr['prefixRightDistance'];
$attr['prefixRightDistanceMobile'] = is_numeric( $attr['prefixRightDistanceMobile'] ) ? $attr['prefixRightDistanceMobile'] : $attr['prefixRightDistanceTablet'];
$attr['suffixLeftDistanceTablet'] = is_numeric( $attr['suffixLeftDistanceTablet'] ) ? $attr['suffixLeftDistanceTablet'] : $attr['suffixLeftDistance'];
$attr['suffixLeftDistanceMobile'] = is_numeric( $attr['suffixLeftDistanceMobile'] ) ? $attr['suffixLeftDistanceMobile'] : $attr['suffixLeftDistanceTablet'];
$attr['iconSizeTablet'] = is_numeric( $attr['iconSizeTablet'] ) ? $attr['iconSizeTablet'] : $attr['iconSize'];
$attr['iconSizeMobile'] = is_numeric( $attr['iconSizeMobile'] ) ? $attr['iconSizeMobile'] : $attr['iconSizeTablet'];
$attr['imageWidthTablet'] = is_numeric( $attr['imageWidthTablet'] ) ? $attr['imageWidthTablet'] : $attr['imageWidth'];
$attr['imageWidthMobile'] = is_numeric( $attr['imageWidthMobile'] ) ? $attr['imageWidthMobile'] : $attr['imageWidthTablet'];
// Icon, Image Border CSS.
$icon_wrap_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'iconWrap' );
$icon_wrap_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'iconWrap', 'tablet' );
$icon_wrap_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'iconWrap', 'mobile' );
$circle_pos = ( $attr['circleSize'] / 2 );
$circle_radius = $circle_pos - ( $attr['circleStokeSize'] / 2 );
$circle_dash = round( floatval( 2 * pi() * $circle_radius ), 2 );
// Icon and Image Common Padding.
$icon_and_image_spacing = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopPadding'], $attr['iconPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightPadding'], $attr['iconPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomPadding'], $attr['iconPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftPadding'], $attr['iconPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopMargin'], $attr['iconMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightMargin'], $attr['iconMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMargin'], $attr['iconMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftMargin'], $attr['iconMarginUnit'] ),
);
$icon_and_image_spacing_tablet = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopPaddingTablet'], $attr['iconPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightPaddingTablet'], $attr['iconPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomPaddingTablet'], $attr['iconPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftPaddingTablet'], $attr['iconPaddingUnitTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopMarginTablet'], $attr['iconMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightMarginTablet'], $attr['iconMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMarginTablet'], $attr['iconMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftMarginTablet'], $attr['iconMarginUnitTablet'] ),
);
$icon_and_image_spacing_mobile = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopPaddingMobile'], $attr['iconPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightPaddingMobile'], $attr['iconPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomPaddingMobile'], $attr['iconPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftPaddingMobile'], $attr['iconPaddingUnitMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopMarginMobile'], $attr['iconMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightMarginMobile'], $attr['iconMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMarginMobile'], $attr['iconMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftMarginMobile'], $attr['iconMarginUnitMobile'] ),
);
$box_shadow_position_css = $attr['boxShadowPosition'];
if ( 'outset' === $attr['boxShadowPosition'] ) {
$box_shadow_position_css = '';
}
$box_shadow_position_css_hover = $attr['boxShadowPositionHover'];
if ( 'outset' === $attr['boxShadowPositionHover'] ) {
$box_shadow_position_css_hover = '';
}
$m_selectors = array();
$t_selectors = array();
$selectors = array(
'.wp-block-uagb-counter' => array(
'text-align' => $attr['align'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMargin'], $attr['blockMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMargin'], $attr['blockMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMargin'], $attr['blockMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMargin'], $attr['blockMarginUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPadding'], $attr['blockPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPadding'], $attr['blockPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPadding'], $attr['blockPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPadding'], $attr['blockPaddingUnit'] ),
),
'.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap' => array_merge(
$icon_and_image_spacing
),
'.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap img' => $icon_wrap_border_css,
'.wp-block-uagb-counter:hover .wp-block-uagb-counter__image-wrap img' => array(
'border-color' => $attr['iconWrapBorderHColor'],
),
'.wp-block-uagb-counter .wp-block-uagb-counter__icon' => array_merge(
array(
'background-color' => $attr['iconBackgroundColor'],
),
$icon_and_image_spacing,
$icon_wrap_border_css
),
'.wp-block-uagb-counter:hover .wp-block-uagb-counter__icon' => array(
'background-color' => $attr['iconBackgroundHoverColor'],
'border-color' => $attr['iconWrapBorderHColor'],
),
'.wp-block-uagb-counter .wp-block-uagb-counter__icon svg' => array(
'fill' => $attr['iconColor'],
'width' => UAGB_Helper::get_css_value( $attr['iconSize'], $attr['iconSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['iconSize'], $attr['iconSizeType'] ),
),
'.wp-block-uagb-counter:hover .wp-block-uagb-counter__icon svg' => array(
'fill' => $attr['iconHoverColor'],
),
'.wp-block-uagb-counter .wp-block-uagb-counter__title' => array(
'font-family' => $attr['headingFontFamily'],
'font-style' => $attr['headingFontStyle'],
'text-decoration' => $attr['headingDecoration'],
'text-transform' => $attr['headingTransform'],
'font-weight' => $attr['headingFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['headingFontSize'], $attr['headingFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['headingLineHeight'], $attr['headingLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['headingLetterSpacing'], $attr['headingLetterSpacingType'] ),
'color' => $attr['headingColor'],
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMargin'], $attr['headingMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMargin'], $attr['headingMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMargin'], $attr['headingMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMargin'], $attr['headingMarginUnit'] ),
),
'.wp-block-uagb-counter .wp-block-uagb-counter__number' => array(
'font-family' => $attr['numberFontFamily'],
'font-style' => $attr['numberFontStyle'],
'text-decoration' => $attr['numberDecoration'],
'text-transform' => $attr['numberTransform'],
'font-weight' => $attr['numberFontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['numberFontSize'], $attr['numberFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['numberLineHeight'], $attr['numberLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['numberLetterSpacing'], $attr['numberLetterSpacingType'] ),
'color' => $attr['numberColor'],
'margin-top' => UAGB_Helper::get_css_value( $attr['numberTopMargin'], $attr['numberMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['numberRightMargin'], $attr['numberMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMargin'], $attr['numberMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['numberLeftMargin'], $attr['numberMarginUnit'] ),
),
'.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-prefix' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['prefixRightDistance'], 'px' ),
),
'.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-suffix' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['suffixLeftDistance'], 'px' ),
),
'.wp-block-uagb-counter--circle .wp-block-uagb-counter-circle-container' => array(
'max-width' => UAGB_Helper::get_css_value( $attr['circleSize'], 'px' ),
),
'.wp-block-uagb-counter--circle .wp-block-uagb-counter-circle-container svg circle' => array(
'stroke-width' => UAGB_Helper::get_css_value( $attr['circleStokeSize'], 'px' ),
'stroke' => $attr['circleBackground'],
'r' => UAGB_Helper::get_css_value( $circle_radius, 'px' ),
'cx' => UAGB_Helper::get_css_value( $circle_pos, 'px' ),
'cy' => UAGB_Helper::get_css_value( $circle_pos, 'px' ),
),
'.wp-block-uagb-counter--circle .wp-block-uagb-counter-circle-container svg .uagb-counter-circle__progress' => array(
'stroke' => $attr['circleForeground'],
'stroke-dasharray' => UAGB_Helper::get_css_value( $circle_dash, 'px' ),
'stroke-dashoffset' => UAGB_Helper::get_css_value( $circle_dash, 'px' ),
),
'.wp-block-uagb-counter--bars' => array(
'flex-direction' => $attr['barFlip'] ? 'column-reverse' : 'column',
),
'.wp-block-uagb-counter--bars .wp-block-uagb-counter-bars-container' => array(
'background' => $attr['barBackground'],
),
'.wp-block-uagb-counter--bars .wp-block-uagb-counter-bars-container .wp-block-uagb-counter__number' => array(
'height' => UAGB_Helper::get_css_value( $attr['barSize'], 'px' ),
'background' => $attr['barForeground'],
'padding-top' => UAGB_Helper::get_css_value( $attr['numberTopMargin'], $attr['numberMarginUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['numberRightMargin'], $attr['numberMarginUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMargin'], $attr['numberMarginUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['numberLeftMargin'], $attr['numberMarginUnit'] ),
),
);
// tablet.
$t_selectors['.wp-block-uagb-counter'] = array(
'text-align' => $attr['alignTablet'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginTablet'], $attr['blockMarginUnitTablet'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap'] = $icon_and_image_spacing_tablet;
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap img'] = $icon_wrap_border_css_tablet;
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__icon'] = array_merge(
$icon_and_image_spacing_tablet,
$icon_wrap_border_css_tablet
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__icon svg'] = array(
'width' => UAGB_Helper::get_css_value( $attr['iconSizeTablet'], $attr['iconSizeTypeTablet'] ),
'height' => UAGB_Helper::get_css_value( $attr['iconSizeTablet'], $attr['iconSizeTypeTablet'] ),
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__title'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['headingFontSizeTablet'], $attr['headingFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['headingLineHeightTablet'], $attr['headingLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['headingLetterSpacingTablet'], $attr['headingLetterSpacingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMarginTablet'], $attr['headingMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['numberFontSizeTablet'], $attr['numberFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['numberLineHeightTablet'], $attr['numberLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['numberLetterSpacingTablet'], $attr['numberLetterSpacingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['numberTopMarginTablet'], $attr['numberMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['numberRightMarginTablet'], $attr['numberMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMarginTablet'], $attr['numberMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['numberLeftMarginTablet'], $attr['numberMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-prefix'] = array(
'margin-right' => UAGB_Helper::get_css_value( $attr['prefixRightDistanceTablet'], 'px' ),
);
$t_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-suffix'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['suffixLeftDistanceTablet'], 'px' ),
);
$t_selectors['.wp-block-uagb-counter--bars .wp-block-uagb-counter-bars-container .wp-block-uagb-counter__number'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['numberTopMarginTablet'], $attr['numberMarginUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['numberRightMarginTablet'], $attr['numberMarginUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMarginTablet'], $attr['numberMarginUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['numberLeftMarginTablet'], $attr['numberMarginUnitTablet'] ),
);
// mobile.
$m_selectors['.wp-block-uagb-counter'] = array(
'text-align' => $attr['alignMobile'],
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginMobile'], $attr['blockMarginUnitMobile'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap'] = $icon_and_image_spacing_mobile;
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__image-wrap img'] = $icon_wrap_border_css_mobile;
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__icon'] = array_merge(
$icon_and_image_spacing_mobile,
$icon_wrap_border_css_mobile
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__icon svg'] = array(
'width' => UAGB_Helper::get_css_value( $attr['iconSizeMobile'], $attr['iconSizeTypeMobile'] ),
'height' => UAGB_Helper::get_css_value( $attr['iconSizeMobile'], $attr['iconSizeTypeMobile'] ),
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__title'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['headingFontSizeMobile'], $attr['headingFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['headingLineHeightMobile'], $attr['headingLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['headingLetterSpacingMobile'], $attr['headingLetterSpacingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMarginMobile'], $attr['headingMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['numberFontSizeMobile'], $attr['numberFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['numberLineHeightMobile'], $attr['numberLineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['numberLetterSpacingMobile'], $attr['numberLetterSpacingType'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['numberTopMarginMobile'], $attr['numberMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['numberRightMarginMobile'], $attr['numberMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMarginMobile'], $attr['numberMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['numberLeftMarginMobile'], $attr['numberMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-prefix'] = array(
'margin-right' => UAGB_Helper::get_css_value( $attr['prefixRightDistanceMobile'], 'px' ),
);
$m_selectors['.wp-block-uagb-counter .wp-block-uagb-counter__number .uagb-counter-block-suffix'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['suffixLeftDistanceMobile'], 'px' ),
);
$m_selectors['.wp-block-uagb-counter--bars .wp-block-uagb-counter-bars-container .wp-block-uagb-counter__number'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['numberTopMarginMobile'], $attr['numberMarginUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['numberRightMarginMobile'], $attr['numberMarginUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['numberBottomMarginMobile'], $attr['numberMarginUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['numberLeftMarginMobile'], $attr['numberMarginUnitMobile'] ),
);
if ( $attr['imageWidthType'] ) {
// Image.
$selectors[' .wp-block-uagb-counter__image-wrap .wp-block-uagb-counter__image'] = array(
'width' => UAGB_Helper::get_css_value( $attr['imageWidth'], $attr['imageWidthUnit'] ),
);
$t_selectors[' .wp-block-uagb-counter__image-wrap .wp-block-uagb-counter__image'] = array(
'width' => UAGB_Helper::get_css_value( $attr['imageWidthTablet'], $attr['imageWidthUnitTablet'] ),
);
$m_selectors[' .wp-block-uagb-counter__image-wrap .wp-block-uagb-counter__image'] = array(
'width' => UAGB_Helper::get_css_value( $attr['imageWidthMobile'], $attr['imageWidthUnitMobile'] ),
);
}
if ( 'number' === $attr['layout'] && ( 'left-number' === $attr['iconImgPosition'] || 'right-number' === $attr['iconImgPosition'] ) ) {
$selectors[' .wp-block-uagb-counter__number'] = array(
'display' => 'flex',
'align-items' => 'center',
'justify-content' => $attr['align'],
);
$t_selectors[' .wp-block-uagb-counter__number'] = array(
'justify-content' => $attr['alignTablet'],
);
$m_selectors[' .wp-block-uagb-counter__number'] = array(
'justify-content' => $attr['alignMobile'],
);
}
// In case of 'Bar' layout, we need to add padding to the number element and remove the margin.
if ( 'bars' === $attr['layout'] ) {
$num_container = '.wp-block-uagb-counter .wp-block-uagb-counter__number';
$selectors[ $num_container ]['margin-top'] = 'unset';
$selectors[ $num_container ]['margin-bottom'] = 'unset';
$selectors[ $num_container ]['margin-left'] = 'unset';
$selectors[ $num_container ]['margin-right'] = 'unset';
$t_selectors[ $num_container ]['margin-top'] = 'unset';
$t_selectors[ $num_container ]['margin-bottom'] = 'unset';
$t_selectors[ $num_container ]['margin-left'] = 'unset';
$t_selectors[ $num_container ]['margin-right'] = 'unset';
$m_selectors[ $num_container ]['margin-top'] = 'unset';
$m_selectors[ $num_container ]['margin-bottom'] = 'unset';
$m_selectors[ $num_container ]['margin-left'] = 'unset';
$m_selectors[ $num_container ]['margin-right'] = 'unset';
if ( 0 === $attr['endNumber'] ) {
$selectors[ $num_container ]['padding-left'] = 'unset';
$selectors[ $num_container ]['padding-right'] = 'unset';
$t_selectors[ $num_container ]['padding-left'] = 'unset';
$t_selectors[ $num_container ]['padding-right'] = 'unset';
$m_selectors[ $num_container ]['padding-left'] = 'unset';
$m_selectors[ $num_container ]['padding-right'] = 'unset';
}
$bar_container = '.wp-block-uagb-counter .wp-block-uagb-counter-bars-container';
$bar_container_hover = '.wp-block-uagb-counter:hover .wp-block-uagb-counter-bars-container';
$selectors[ $bar_container ]['box-shadow'] = UAGB_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) .
' ' .
$attr['boxShadowColor'] .
' ' .
$box_shadow_position_css;
// If hover blur or hover color are set, show the hover shadow.
if ( ( ( '' !== $attr['boxShadowBlurHover'] ) && ( null !== $attr['boxShadowBlurHover'] ) ) || '' !== $attr['boxShadowColorHover'] ) {
$selectors[ $bar_container_hover ]['box-shadow'] = UAGB_Helper::get_css_value( $attr['boxShadowHOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowVOffsetHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowBlurHover'], 'px' ) .
' ' .
UAGB_Helper::get_css_value( $attr['boxShadowSpreadHover'], 'px' ) .
' ' .
$attr['boxShadowColorHover'] .
' ' .
$box_shadow_position_css_hover;
}
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = '.uagb-block-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,39 @@
<?php
/**
* Frontend JS File.
*
* @since 2.1.0
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
$counter_options = apply_filters(
'uagb_counter_options',
array(
'layout' => $attr['layout'],
'heading' => $attr['heading'],
'numberPrefix' => $attr['numberPrefix'],
'numberSuffix' => $attr['numberSuffix'],
'startNumber' => $attr['startNumber'],
'endNumber' => $attr['endNumber'],
'totalNumber' => $attr['totalNumber'],
'decimalPlaces' => $attr['decimalPlaces'],
'animationDuration' => $attr['animationDuration'],
'thousandSeparator' => $attr['thousandSeparator'],
'circleSize' => $attr['circleSize'],
'circleStokeSize' => $attr['circleStokeSize'],
'isFrontend' => $attr['isFrontend'],
),
$id
);
ob_start();
?>
window.addEventListener( 'load', function() {
UAGBCounter.init( '<?php echo esc_attr( $selector ); ?>', <?php echo wp_json_encode( $counter_options ); ?> );
});
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/faq-child';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'FAQ Child', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a frequently asked question/accordian to display information.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'extension' => false,
'deprecated' => false,
);

View File

@@ -0,0 +1,186 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'overall' );
$icon_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'icon' );
return array_merge(
array(
'block_id' => '',
'layout' => 'accordion',
'inactiveOtherItems' => true,
'expandFirstItem' => false,
'enableSchemaSupport' => false,
'align' => 'left',
'enableSeparator' => false,
'rowsGap' => 10,
'rowsGapTablet' => '',
'rowsGapMobile' => '',
'rowsGapUnit' => 'px',
'boxBgType' => 'color',
'boxBgHoverType' => 'color',
'boxBgColor' => '',
'boxBgHoverColor' => '',
'boxPaddingTypeMobile' => 'px',
'boxPaddingTypeTablet' => 'px',
'boxPaddingTypeDesktop' => 'px',
'vBoxPaddingMobile' => 10,
'hBoxPaddingMobile' => 10,
'vBoxPaddingTablet' => 10,
'hBoxPaddingTablet' => 10,
'vBoxPaddingDesktop' => 10,
'hBoxPaddingDesktop' => 10,
'questionTextColor' => '',
'questionTextActiveColor' => '',
'questionPaddingTypeDesktop' => 'px',
'questionPaddingTypeTablet' => 'px',
'questionPaddingTypeMobile' => 'px',
'vquestionPaddingMobile' => 10,
'vquestionPaddingTablet' => 10,
'vquestionPaddingDesktop' => 10,
'hquestionPaddingMobile' => 10,
'hquestionPaddingTablet' => 10,
'hquestionPaddingDesktop' => 10,
'answerTextColor' => '',
'answerPaddingTypeDesktop' => 'px',
'answerPaddingTypeTablet' => 'px',
'answerPaddingTypeMobile' => 'px',
'vanswerPaddingMobile' => 10,
'vanswerPaddingTablet' => 10,
'vanswerPaddingDesktop' => 10,
'hanswerPaddingMobile' => 10,
'hanswerPaddingTablet' => 10,
'hanswerPaddingDesktop' => 10,
'iconColor' => '',
'iconActiveColor' => '',
'gapBtwIconQUestion' => 10,
'gapBtwIconQUestionTablet' => 10,
'gapBtwIconQUestionMobile' => 10,
'questionloadGoogleFonts' => false,
'answerloadGoogleFonts' => false,
'questionFontFamily' => 'Default',
'questionFontWeight' => '',
'questionFontSize' => '',
'questionFontSizeType' => 'px',
'questionFontSizeTablet' => '',
'questionFontSizeMobile' => '',
'questionLineHeight' => '',
'questionLineHeightType' => 'em',
'questionLineHeightTablet' => '',
'questionLineHeightMobile' => '',
'answerFontFamily' => 'Default',
'answerFontWeight' => '',
'answerFontSize' => '',
'answerFontSizeType' => 'px',
'answerFontSizeTablet' => '',
'answerFontSizeMobile' => '',
'answerLineHeight' => '',
'answerLineHeightType' => 'em',
'answerLineHeightTablet' => '',
'answerLineHeightMobile' => '',
'icon' => 'plus',
'iconActive' => 'minus',
'iconAlign' => 'row',
'iconSize' => 12,
'iconSizeMobile' => '',
'iconSizeTablet' => '',
'iconSizeType' => 'px',
'columnsGap' => 10,
'columnsGapTablet' => '',
'columnsGapMobile' => '',
'columnsGapUnit' => 'px',
'columns' => 2,
'tcolumns' => 2,
'mcolumns' => 1,
'schema' => '',
'enableToggle' => true,
'questionLeftPaddingTablet' => 10,
'questionBottomPaddingTablet' => 10,
'questionLeftPaddingDesktop' => 10,
'questionBottomPaddingDesktop' => 10,
'questionLeftPaddingMobile' => 10,
'questionBottomPaddingMobile' => 10,
'questionSpacingLink' => '',
'answerSpacingLink' => '',
'answerTopPadding' => 10,
'answerRightPadding' => 10,
'answerBottomPadding' => 10,
'answerLeftPadding' => 10,
'answerTopPaddingTablet' => 10,
'answerRightPaddingTablet' => 10,
'answerBottomPaddingTablet' => 10,
'answerLeftPaddingTablet' => 10,
'answerTopPaddingMobile' => 10,
'answerRightPaddingMobile' => 10,
'answerBottomPaddingMobile' => 10,
'answerLeftPaddingMobile' => 10,
'questionFontStyle' => '',
'questionTransform' => '',
'questionDecoration' => '',
'answerFontStyle' => '',
'answerTransform' => '',
'answerDecoration' => '',
'questionLetterSpacing' => '',
'questionLetterSpacingTablet' => '',
'questionLetterSpacingMobile' => '',
'questionLetterSpacingType' => 'px',
'answerLetterSpacing' => '',
'answerLetterSpacingTablet' => '',
'answerLetterSpacingMobile' => '',
'answerLetterSpacingType' => 'px',
'questionTextBgColor' => '',
'questionTextActiveBgColor' => '',
'borderStyle' => 'solid',
'borderWidth' => 1,
'borderRadius' => 2,
'borderColor' => '#1e1e1e',
'borderHoverColor' => '',
'iconBgSize' => '',
'iconBgSizeTablet' => '',
'iconBgSizeMobile' => '',
'iconBgSizeType' => 'px',
'iconBgColor' => '',
// padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
'blockPaddingLink' => true,
// margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
'blockMarginLink' => true,
),
$border_attribute,
$icon_border_attribute
);

View File

@@ -0,0 +1,32 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/faq';
$block_data = array(
'doc' => 'faq-schema-or-accordion',
'slug' => '',
'admin_categories' => array( 'seo' ),
'link' => 'faq-schema-legacy',
'title' => __( 'FAQ', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add accordions/FAQ schema to your page.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'faq' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'faq',
),
'static_dependencies' => array(
'uagb-faq-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'faq' ),
'dep' => array(),
'type' => 'js',
),
),
);

View File

@@ -0,0 +1,409 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_faq_gfont( $attr );
$icon_color = $attr['iconColor'];
$icon_active_color = $attr['iconActiveColor'];
$attr['questionBottomPaddingDesktop'] = ( 10 === $attr['questionBottomPaddingDesktop'] && 10 !== $attr['vquestionPaddingDesktop'] ) ? $attr['vquestionPaddingDesktop'] : $attr['questionBottomPaddingDesktop'];
$attr['questionLeftPaddingDesktop'] = ( 10 === $attr['questionLeftPaddingDesktop'] && 10 !== $attr['hquestionPaddingDesktop'] ) ? $attr['hquestionPaddingDesktop'] : $attr['questionLeftPaddingDesktop'];
$attr['questionBottomPaddingTablet'] = ( 10 === $attr['questionBottomPaddingTablet'] && 10 !== $attr['vquestionPaddingTablet'] ) ? $attr['vquestionPaddingTablet'] : $attr['questionBottomPaddingTablet'];
$attr['questionLeftPaddingTablet'] = ( 10 === $attr['questionLeftPaddingTablet'] && 10 !== $attr['hquestionPaddingTablet'] ) ? $attr['hquestionPaddingTablet'] : $attr['questionLeftPaddingTablet'];
$attr['questionBottomPaddingMobile'] = ( 10 === $attr['questionBottomPaddingMobile'] && 10 !== $attr['vquestionPaddingMobile'] ) ? $attr['vquestionPaddingMobile'] : $attr['questionBottomPaddingMobile'];
$attr['questionLeftPaddingMobile'] = ( 10 === $attr['questionLeftPaddingMobile'] && 10 !== $attr['hquestionPaddingMobile'] ) ? $attr['hquestionPaddingMobile'] : $attr['questionLeftPaddingMobile'];
if ( ! isset( $attr['iconColor'] ) || '' === $attr['iconColor'] ) {
$icon_color = $attr['questionTextColor'];
}
if ( ! isset( $attr['iconActiveColor'] ) || '' === $attr['iconActiveColor'] ) {
$icon_active_color = $attr['questionTextActiveColor'];
}
$icon_size = UAGB_Helper::get_css_value( $attr['iconSize'], $attr['iconSizeType'] );
$t_icon_size = UAGB_Helper::get_css_value( $attr['iconSizeTablet'], $attr['iconSizeType'] );
$m_icon_size = UAGB_Helper::get_css_value( $attr['iconSizeMobile'], $attr['iconSizeType'] );
$answer_top_padding_desktop = isset( $attr['answerTopPadding'] ) ? $attr['answerTopPadding'] : $attr['vanswerPaddingDesktop'];
$answer_bottom_padding_desktop = isset( $attr['answerBottomPadding'] ) ? $attr['answerBottomPadding'] : $attr['vanswerPaddingDesktop'];
$answer_left_padding_desktop = isset( $attr['answerLeftPadding'] ) ? $attr['answerLeftPadding'] : $attr['hanswerPaddingDesktop'];
$answer_right_padding_desktop = isset( $attr['answerRightPadding'] ) ? $attr['answerRightPadding'] : $attr['hanswerPaddingDesktop'];
$answer_top_padding_tablet = isset( $attr['answerTopPaddingTablet'] ) ? $attr['answerTopPaddingTablet'] : $attr['vanswerPaddingTablet'];
$answer_bottom_padding_tablet = isset( $attr['answerBottomPaddingTablet'] ) ? $attr['answerBottomPaddingTablet'] : $attr['vanswerPaddingTablet'];
$answer_left_padding_tablet = isset( $attr['answerLeftPaddingTablet'] ) ? $attr['answerLeftPaddingTablet'] : $attr['hanswerPaddingTablet'];
$answer_right_padding_tablet = isset( $attr['answerRightPaddingTablet'] ) ? $attr['answerRightPaddingTablet'] : $attr['hanswerPaddingTablet'];
$answer_top_padding_mobile = isset( $attr['answerTopPaddingMobile'] ) ? $attr['answerTopPaddingMobile'] : $attr['vanswerPaddingMobile'];
$answer_bottom_padding_mobile = isset( $attr['answerBottomPaddingMobile'] ) ? $attr['answerBottomPaddingMobile'] : $attr['vanswerPaddingMobile'];
$answer_left_padding_mobile = isset( $attr['answerLeftPaddingMobile'] ) ? $attr['answerLeftPaddingMobile'] : $attr['hanswerPaddingMobile'];
$answer_right_padding_mobile = isset( $attr['answerRightPaddingMobile'] ) ? $attr['answerRightPaddingMobile'] : $attr['hanswerPaddingMobile'];
$border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overall' );
$border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$border,
( isset( $attr['borderWidth'] ) ? $attr['borderWidth'] : '' ),
( isset( $attr['borderRadius'] ) ? $attr['borderRadius'] : '' ),
( isset( $attr['borderColor'] ) ? $attr['borderColor'] : '' ),
( isset( $attr['borderStyle'] ) ? $attr['borderStyle'] : '' )
);
$border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overall', 'tablet' );
$border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overall', 'mobile' );
$icon_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon' );
$icon_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon', 'tablet' );
$icon_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon', 'mobile' );
$selectors = array(
' .uagb-icon svg' => array(
'width' => $icon_size,
'height' => $icon_size,
'font-size' => $icon_size,
'fill' => $icon_color,
),
' .uagb-icon-active svg' => array(
'width' => $icon_size,
'height' => $icon_size,
'font-size' => $icon_size,
'fill' => $icon_active_color,
),
' .uagb-faq-child__outer-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowsGap'], $attr['rowsGapUnit'] ),
),
' .uagb-faq-item' => array_merge(
array(
'background-color' => ( 'color' === $attr['boxBgType'] ) ? $attr['boxBgColor'] : 'transparent',
),
$border
),
' .uagb-faq-item:hover' => array(
'background-color' => ( 'color' === $attr['boxBgHoverType'] ) ? $attr['boxBgHoverColor'] : 'transparent',
'border-color' => ! empty( $attr['overallBorderHColor'] ) ? $attr['overallBorderHColor'] : $attr['borderHoverColor'],
),
' .uagb-faq-item .uagb-question' => array(
'color' => $attr['questionTextColor'],
),
' .uagb-faq-item.uagb-faq-item-active .uagb-question' => array(
'color' => $attr['questionTextActiveColor'],
),
' .uagb-faq-item:hover .uagb-question' => array(
'color' => $attr['questionTextActiveColor'],
),
' .uagb-faq-questions-button' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['vquestionPaddingDesktop'], $attr['questionPaddingTypeDesktop'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['questionBottomPaddingDesktop'], $attr['questionPaddingTypeDesktop'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['hquestionPaddingDesktop'], $attr['questionPaddingTypeDesktop'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['questionLeftPaddingDesktop'], $attr['questionPaddingTypeDesktop'] ),
'background-color' => $attr['questionTextBgColor'],
),
' .uagb-faq-item.uagb-faq-item-active .uagb-faq-questions-button' => array(
'background-color' => $attr['questionTextActiveBgColor'],
),
' .uagb-faq-item:hover .uagb-faq-questions-button' => array(
'background-color' => $attr['questionTextActiveBgColor'],
),
' .uagb-faq-content' => array(
'padding-top' => UAGB_Helper::get_css_value( $answer_top_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'padding-right' => UAGB_Helper::get_css_value( $answer_right_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'padding-left' => UAGB_Helper::get_css_value( $answer_left_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
),
' .uagb-faq-content span' => array(
'margin-top' => UAGB_Helper::get_css_value( $answer_top_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'margin-right' => UAGB_Helper::get_css_value( $answer_right_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
'margin-left' => UAGB_Helper::get_css_value( $answer_left_padding_desktop, $attr['answerPaddingTypeDesktop'] ),
),
'.uagb-faq-icon-row .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestion'], 'px' ),
),
'.uagb-faq-icon-row-reverse .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestion'], 'px' ),
),
'.wp-block-uagb-faq .uagb-faq-item .uagb-faq-icon-wrap' => array_merge(
array(
'padding' => UAGB_Helper::get_css_value( $attr['iconBgSize'], $attr['iconBgSizeType'] ),
'background-color' => $attr['iconBgColor'],
),
$icon_border
),
'.wp-block-uagb-faq .uagb-faq-item .uagb-faq-icon-wrap:hover' => array(
'border-color' => $attr['iconBorderHColor'],
),
' .uagb-faq-item:hover .uagb-icon svg' => array(
'fill' => $icon_active_color,
),
' .uagb-faq-item .uagb-faq-questions-button.uagb-faq-questions' => array(
'flex-direction' => $attr['iconAlign'],
),
' .uagb-faq-item .uagb-faq-content' => array(
'color' => $attr['answerTextColor'],
),
'.uagb-faq__outer-wrap' => array(
'margin-top' => UAGB_Helper::get_css_value(
$attr['blockTopMargin'],
$attr['blockMarginUnit']
),
'margin-right' => UAGB_Helper::get_css_value(
$attr['blockRightMargin'],
$attr['blockMarginUnit']
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomMargin'],
$attr['blockMarginUnit']
),
'margin-left' => UAGB_Helper::get_css_value(
$attr['blockLeftMargin'],
$attr['blockMarginUnit']
),
'padding-top' => UAGB_Helper::get_css_value(
$attr['blockTopPadding'],
$attr['blockPaddingUnit']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['blockRightPadding'],
$attr['blockPaddingUnit']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomPadding'],
$attr['blockPaddingUnit']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['blockLeftPadding'],
$attr['blockPaddingUnit']
),
),
);
$t_selectors = array(
'.uagb-faq-icon-row .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestionTablet'], 'px' ),
),
'.uagb-faq-icon-row-reverse .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestionTablet'], 'px' ),
),
'.wp-block-uagb-faq .uagb-faq-item .uagb-faq-icon-wrap' => array_merge(
array(
'padding' => UAGB_Helper::get_css_value( $attr['iconBgSizeTablet'], $attr['iconBgSizeType'] ),
),
$icon_border_tablet
),
' .uagb-faq-questions-button' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['vquestionPaddingTablet'], $attr['questionPaddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['questionBottomPaddingTablet'], $attr['questionPaddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['hquestionPaddingTablet'], $attr['questionPaddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['questionLeftPaddingTablet'], $attr['questionPaddingTypeTablet'] ),
),
' .uagb-faq-content' => array(
'padding-top' => UAGB_Helper::get_css_value( $answer_top_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $answer_right_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $answer_left_padding_tablet, $attr['answerPaddingTypeTablet'] ),
),
' .uagb-faq-content span' => array(
'margin-top' => UAGB_Helper::get_css_value( $answer_top_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $answer_right_padding_tablet, $attr['answerPaddingTypeTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $answer_left_padding_tablet, $attr['answerPaddingTypeTablet'] ),
),
' .uagb-icon svg' => array(
'width' => $t_icon_size,
'height' => $t_icon_size,
'font-size' => $t_icon_size,
),
' .uagb-icon-active svg' => array(
'width' => $t_icon_size,
'height' => $t_icon_size,
'font-size' => $t_icon_size,
),
' .uagb-faq-child__outer-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowsGapTablet'], $attr['rowsGapUnit'] ),
),
' .uagb-faq-item' => $border_tablet,
'.uagb-faq__outer-wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingTablet'], $attr['blockPaddingUnitTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginTablet'], $attr['blockMarginUnitTablet'] ),
),
);
$m_selectors = array(
'.uagb-faq-icon-row .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-right' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestionMobile'], 'px' ),
),
' .uagb-faq-item' => $border_mobile,
'.uagb-faq-icon-row-reverse .uagb-faq-item .uagb-faq-icon-wrap' => array(
'margin-left' => UAGB_Helper::get_css_value( $attr['gapBtwIconQUestionMobile'], 'px' ),
),
' .uagb-faq-child__outer-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowsGapMobile'], $attr['rowsGapUnit'] ),
),
'.wp-block-uagb-faq .uagb-faq-item .uagb-faq-icon-wrap' => array_merge(
array(
'padding' => UAGB_Helper::get_css_value( $attr['iconBgSizeMobile'], $attr['iconBgSizeType'] ),
),
$icon_border_mobile
),
' .uagb-faq-questions-button' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['vquestionPaddingMobile'], $attr['questionPaddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['questionBottomPaddingMobile'], $attr['questionPaddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['hquestionPaddingMobile'], $attr['questionPaddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['questionLeftPaddingMobile'], $attr['questionPaddingTypeMobile'] ),
),
' .uagb-faq-content' => array(
'padding-top' => UAGB_Helper::get_css_value( $answer_top_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $answer_right_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $answer_left_padding_mobile, $attr['answerPaddingTypeMobile'] ),
),
' .uagb-faq-content span' => array(
'margin-top' => UAGB_Helper::get_css_value( $answer_top_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $answer_bottom_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $answer_right_padding_mobile, $attr['answerPaddingTypeMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $answer_left_padding_mobile, $attr['answerPaddingTypeMobile'] ),
),
' .uagb-icon svg' => array(
'width' => $m_icon_size,
'height' => $m_icon_size,
'font-size' => $m_icon_size,
),
' .uagb-icon-active svg' => array(
'width' => $m_icon_size,
'height' => $m_icon_size,
'font-size' => $m_icon_size,
),
'.uagb-faq__outer-wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['blockTopPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['blockRightPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['blockLeftPaddingMobile'], $attr['blockPaddingUnitMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginMobile'], $attr['blockMarginUnitMobile'] ),
),
);
if ( 'accordion' === $attr['layout'] && true === $attr['inactiveOtherItems'] ) {
$selectors[' .wp-block-uagb-faq-child.uagb-faq-child__outer-wrap .uagb-faq-content '] = array(
'display' => 'none',
);
}
if ( 'accordion' === $attr['layout'] && true === $attr['expandFirstItem'] ) {
$selectors['.uagb-faq__wrap.uagb-buttons-layout-wrap > .uagb-faq-child__outer-wrap:first-child.uagb-faq-item.uagb-faq-item-active .uagb-faq-content '] = array(
'display' => 'block',
);
$selectors['.uagb-faq__wrap.uagb-buttons-layout-wrap > .uagb-faq-child__outer-wrap:first-child .uagb-faq-item.uagb-faq-item-active .uagb-faq-content '] = array(
'display' => 'block',
);
}
if ( true === $attr['enableSeparator'] ) {
$selectors[' .uagb-faq-child__outer-wrap .uagb-faq-content '] =
array(
'border-style' => 'solid',
'border-top-color' => $attr['overallBorderColor'],
'border-top-width' => UAGB_Helper::get_css_value( $attr['overallBorderTopWidth'], 'px' ),
'border-right-width' => '0px',
'border-bottom-width' => '0px',
'border-left-width' => '0px',
);
$t_selectors[' .uagb-faq-child__outer-wrap .uagb-faq-content '] =
array(
'border-style' => 'solid',
'border-top-color' => $attr['overallBorderColor'],
'border-top-width' => UAGB_Helper::get_css_value( $attr['overallBorderTopWidthTablet'], 'px' ),
'border-right-width' => '0px',
'border-bottom-width' => '0px',
'border-left-width' => '0px',
);
$m_selectors[' .uagb-faq-child__outer-wrap .uagb-faq-content '] =
array(
'border-style' => 'solid',
'border-top-color' => $attr['overallBorderColor'],
'border-top-width' => UAGB_Helper::get_css_value( $attr['overallBorderTopWidthMobile'], 'px' ),
'border-right-width' => '0px',
'border-bottom-width' => '0px',
'border-left-width' => '0px',
);
$selectors[' .uagb-faq-child__outer-wrap .uagb-faq-content:hover '] = array(
'border-top-color' => ! empty( $attr['overallBorderHColor'] ) ? $attr['overallBorderHColor'] : $attr['borderHoverColor'],
);
}
if ( 'grid' === $attr['layout'] ) {
$selectors['.uagb-faq-layout-grid.uagb-faq__wrap .uagb-faq-child__outer-wrap '] = array(
'text-align' => $attr['align'],
);
$selectors['.uagb-faq-layout-grid .uagb-faq__wrap .uagb-faq-child__outer-wrap '] = array(
'text-align' => $attr['align'],
);
$selectors['.uagb-faq-layout-grid .uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-template-columns' => 'repeat(' . $attr['columns'] . ', 1fr)',
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGap'], $attr['columnsGapUnit'] ),
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGap'], $attr['rowsGapUnit'] ),
'display' => 'grid',
);
$t_selectors['.uagb-faq-layout-grid .uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGapTablet'], $attr['columnsGapUnit'] ),
'grid-template-columns' => 'repeat(' . $attr['tcolumns'] . ', 1fr)',
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGapTablet'], $attr['rowsGapUnit'] ),
);
$m_selectors['.uagb-faq-layout-grid .uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-template-columns' => 'repeat(' . $attr['mcolumns'] . ', 1fr)',
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGapMobile'], $attr['columnsGapUnit'] ),
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGapMobile'], $attr['rowsGapUnit'] ),
);
$selectors['.uagb-faq-layout-grid.uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-template-columns' => 'repeat(' . $attr['columns'] . ', 1fr)',
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGap'], $attr['columnsGapUnit'] ),
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGap'], $attr['rowsGapUnit'] ),
'display' => 'grid',
);
$t_selectors['.uagb-faq-layout-grid.uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-template-columns' => 'repeat(' . $attr['tcolumns'] . ', 1fr)',
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGapTablet'], $attr['columnsGapUnit'] ),
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGapTablet'], $attr['rowsGapUnit'] ),
);
$m_selectors['.uagb-faq-layout-grid.uagb-faq__wrap.uagb-buttons-layout-wrap '] = array(
'grid-template-columns' => 'repeat(' . $attr['mcolumns'] . ', 1fr)',
'grid-column-gap' => UAGB_Helper::get_css_value( $attr['columnsGapMobile'], $attr['columnsGapUnit'] ),
'grid-row-gap' => UAGB_Helper::get_css_value( $attr['rowsGapMobile'], $attr['rowsGapUnit'] ),
);
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'question', ' .uagb-faq-questions-button .uagb-question', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'answer', ' .uagb-faq-item .uagb-faq-content', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, '.uagb-block-' . $id );

View File

@@ -0,0 +1,18 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-accept';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Accept', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a consent statement with a checkbox in your form.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-checkbox';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Checkbox', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add checkboxes to allow mulitple choices from optons.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-date';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Datepicker', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a calendar based date picker in your form.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-email';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Email', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add an email address field in your form', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-hidden';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Hidden', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a hidden field in your form to pass data', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-name';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Name', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a name field in your form', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,20 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-phone';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Phone', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a phone number field in your form', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'selectPhoneCode' => '+44',
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-radio';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Radio', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add radio select boxes to allow a single choice from options.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,20 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-select';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'xyz' ),
'link' => '',
'title' => __( 'Select', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a select dropdown to list choices.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-textarea';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Textarea', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a text field in your form', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-toggle';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Toggle', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a toggle button in your form.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,19 @@
<?php
/**
* Block Information.
*
* @since 2.0.14
*
* @package uagb
*/
$block_slug = 'uagb/forms-upload';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Upload', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a attachment in your form.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,20 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms-url';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'xyz' ),
'link' => '',
'title' => __( 'URL', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add a URL input field in your form.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'deprecated' => false,
);

View File

@@ -0,0 +1,242 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$success_message_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'successMsg' );
$failed_message_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'errorMsg' );
$input_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'field' );
$toggle_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'checkBoxToggle' );
$submit_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'btn' );
$inherit_from_theme = 'enabled' === ( 'deleted' !== UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme_fallback', 'deleted' ) ? 'disabled' : UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme', 'disabled' ) );
return array_merge(
array(
'block_id' => '',
'formPaddingTop' => 25,
'formPaddingRight' => 25,
'formPaddingBottom' => 25,
'formPaddingLeft' => 25,
'formPaddingTopTab' => 25,
'formPaddingRightTab' => 25,
'formPaddingBottomTab' => 25,
'formPaddingLeftTab' => 25,
'formPaddingTopMob' => 25,
'formPaddingRightMob' => 25,
'formPaddingBottomMob' => 25,
'formPaddingLeftMob' => 25,
'formPaddingUnit' => 'px',
'formPaddingUnitTab' => 'px',
'formPaddingUnitMob' => 'px',
'submitButtonText' => __( 'Submit', 'ultimate-addons-for-gutenberg' ),
'formLabel' => __( 'Spectra Form', 'ultimate-addons-for-gutenberg' ),
'buttonAlign' => 'left',
'buttonAlignTablet' => '',
'buttonAlignMobile' => '',
'confirmationType' => 'message',
'confirmationMessage' => __( 'The form has been submitted Successfully!', 'ultimate-addons-for-gutenberg' ),
'confirmationUrl' => '',
'buttonSize' => 'medium',
'submitColor' => '',
'submitBgType' => 'color',
'submitBgHoverType' => 'color',
'submitColorHover' => '',
'submitBgColor' => '',
'submitBgColorHover' => '',
'toggleSize' => 15,
'toggleSizeTablet' => '',
'toggleSizeMobile' => '',
'toggleColor' => '#ffffff',
'toggleActiveColor' => '#017cba',
'toggleDotColor' => '#1e1e1e',
'toggleDotActiveColor' => '#ffffff',
'toggleWidthSize' => 0,
'toggleWidthSizeTablet' => '',
'toggleWidthSizeMobile' => '',
'toggleHeightSize' => 0,
'toggleHeightSizeTablet' => 0,
'toggleHeightSizeMobile' => 0,
'vPaddingSubmit' => '',
'hPaddingSubmit' => '',
'submitTextloadGoogleFonts' => false,
'sendAfterSubmitEmail' => true,
'afterSubmitToEmail' => '',
'afterSubmitBccEmail' => '',
'afterSubmitCcEmail' => '',
'afterSubmitEmailSubject' => __( 'Form Submission', 'ultimate-addons-for-gutenberg' ),
'submitTextFontFamily' => 'Default',
'submitTextFontWeight' => '',
'submitTextFontSize' => 15,
'submitTextFontSizeType' => 'px',
'submitTextFontSizeTablet' => 15,
'submitTextFontSizeMobile' => 15,
'submitTextLineHeight' => '',
'submitTextLineHeightType' => 'em',
'submitTextLineHeightTablet' => '',
'submitTextLineHeightMobile' => '',
'labelloadGoogleFonts' => false,
'labelFontFamily' => 'Default',
'labelFontWeight' => '',
'labelFontSize' => 15,
'labelFontSizeType' => 'px',
'labelFontSizeTablet' => 15,
'labelFontSizeMobile' => 15,
'labelLineHeight' => '',
'labelLineHeightType' => 'em',
'labelLineHeightTablet' => '',
'labelLineHeightMobile' => '',
'inputloadGoogleFonts' => false,
'inputFontFamily' => 'Default',
'inputFontWeight' => '',
'inputFontSize' => '',
'inputFontSizeType' => 'px',
'inputFontSizeTablet' => '',
'inputFontSizeMobile' => '',
'inputLineHeight' => '',
'inputLineHeightType' => 'em',
'inputLineHeightTablet' => '',
'inputLineHeightMobile' => '',
'labelColor' => '',
'labelHoverColor' => '',
'inputColor' => '',
'bgColor' => '',
'bgHoverColor' => '',
'bgActiveColor' => '',
'inputplaceholderColor' => '',
'inputplaceholderHoverColor' => '',
'inputplaceholderActiveColor' => '',
'inputactiveColor' => '',
'vPaddingField' => 10,
'hPaddingField' => 10,
'fieldGap' => 20,
'fieldGapTablet' => '',
'fieldGapMobile' => '',
'formStyle' => 'boxed',
'overallAlignment' => 'left',
'overallAlignmentTablet' => '',
'overallAlignmentMobile' => '',
'labelAlignment' => null,
'labelAlignmentTablet' => '',
'labelAlignmentMobile' => '',
'successMessageTextColor' => '',
'successMessageBGColor' => '',
'failedMessage' => __( 'There has been some error while submitting the form. Please verify all form fields again.', 'ultimate-addons-for-gutenberg' ),
'failedMessageTextColor' => '',
'failedMessageBGColor' => '',
'reCaptchaEnable' => false,
'reCaptchaType' => 'v2',
'reCaptchaSiteKeyV2' => '',
'reCaptchaSecretKeyV2' => '',
'reCaptchaSiteKeyV3' => '',
'reCaptchaSecretKeyV3' => '',
'hidereCaptchaBatch' => false,
'paddingBtnTopTablet' => '',
'paddingBtnRightTablet' => '',
'paddingBtnBottomTablet' => '',
'paddingBtnLeftTablet' => '',
'paddingBtnTopMobile' => '',
'paddingBtnRightMobile' => '',
'paddingBtnBottomMobile' => '',
'paddingBtnLeftMobile' => '',
'paddingBtnUnit' => 'px',
'mobilePaddingBtnUnit' => 'px',
'tabletPaddingBtnUnit' => 'px',
'submitTextTransform' => '',
'submitTextDecoration' => '',
'submitTextFontStyle' => '',
'labelTransform' => '',
'labelDecoration' => '',
'labelFontStyle' => '',
'inputTransform' => '',
'inputDecoration' => '',
'inputFontStyle' => '',
'fieldGapType' => 'px',
'paddingFieldTop' => 12,
'paddingFieldRight' => 12,
'paddingFieldBottom' => 12,
'paddingFieldLeft' => 12,
'paddingFieldTopTablet' => '',
'paddingFieldRightTablet' => '',
'paddingFieldBottomTablet' => '',
'paddingFieldLeftTablet' => '',
'paddingFieldTopMobile' => '',
'paddingFieldRightMobile' => '',
'paddingFieldBottomMobile' => '',
'paddingFieldLeftMobile' => '',
'paddingFieldUnit' => 'px',
'paddingFieldUnitmobile' => 'px',
'paddingFieldUnitTablet' => 'px',
'toggleSizeType' => 'px',
'captchaMessage' => __( 'Please fill up the above captcha.', 'ultimate-addons-for-gutenberg' ),
'labelGap' => 10,
'labelGapTablet' => '',
'labelGapMobile' => '',
'labelGapUnit' => 'px',
'displayLabels' => true,
'submitTextLetterSpacing' => '',
'submitTextLetterSpacingTablet' => '',
'submitTextLetterSpacingMobile' => '',
'submitTextLetterSpacingType' => 'px',
'inputLetterSpacing' => '',
'inputLetterSpacingTablet' => '',
'inputLetterSpacingMobile' => '',
'inputLetterSpacingType' => 'px',
'labelLetterSpacing' => '',
'labelLetterSpacingTablet' => '',
'labelLetterSpacingMobile' => '',
'labelLetterSpacingType' => 'px',
'inputborderStyle' => 'solid',
'inputborderWidth' => 1,
'inputborderRadius' => 3,
'inputborderColor' => '#BDBDBD',
'inputborderHoverColor' => '',
'successMessageborderStyle' => 'solid',
'successMessageborderWidth' => 2,
'successMessageborderRadius' => 3,
'successMessageborderColor' => 'green',
'successMessageborderHoverColor' => '',
'submitborderStyle' => '',
'submitborderWidth' => '',
'submitborderRadius' => 3,
'submitborderColor' => '',
'submitborderHoverColor' => '',
'gradientValue' => 'linear-gradient(90deg, rgba(6, 147, 227, 0.5) 0%, rgba(155, 81, 224, 0.5) 100%)',
'gradientColor1' => '#06558a',
'gradientColor2' => '#0063A1',
'gradientType' => 'linear',
'gradientLocation1' => 0,
'gradientLocationTablet1' => '',
'gradientLocationMobile1' => '',
'gradientLocation2' => 100,
'gradientLocationTablet2' => '',
'gradientLocationMobile2' => '',
'gradientAngle' => 0,
'gradientAngleTablet' => '',
'gradientAngleMobile' => '',
'selectGradient' => 'basic',
'gradientHValue' => 'linear-gradient(90deg, rgba(6, 147, 227, 0.5) 0%, rgba(155, 81, 224, 0.5) 100%)',
'gradientHColor1' => '#06558a',
'gradientHColor2' => '#0170b9',
'gradientHType' => 'linear',
'gradientHLocation1' => 0,
'gradientHLocationTablet1' => '',
'gradientHLocationMobile1' => '',
'gradientHLocation2' => 100,
'gradientHLocationTablet2' => '',
'gradientHLocationMobile2' => '',
'gradientHAngle' => 0,
'gradientHAngleTablet' => '',
'gradientHAngleMobile' => '',
'selectHGradient' => 'default',
'inheritFromTheme' => $inherit_from_theme,
),
$success_message_border_attribute,
$failed_message_border_attribute,
$input_border_attribute,
$toggle_border_attribute,
$submit_border_attribute
);

View File

@@ -0,0 +1,31 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/forms';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'form' ),
'link' => 'forms-legacy',
'doc' => 'uag-forms-block',
'title' => __( 'Form', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add easily customizable forms to gather information.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'forms' ),
'deprecated' => false,
'static_dependencies' => array(
'uagb-forms-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'forms' ),
'dep' => array(),
'type' => 'js',
),
),
'dynamic_assets' => array(
'dir' => 'forms',
),
);

View File

@@ -0,0 +1,822 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined elsewhere.
*
* @var mixed[] $attr
*/
// Adds Fonts.
UAGB_Block_JS::blocks_forms_gfont( $attr );
$selectors = array();
$m_selectors = array();
$t_selectors = array();
$btnPaddingTop = isset( $attr['paddingBtnTop'] ) ? $attr['paddingBtnTop'] : $attr['vPaddingSubmit'];
$btnPaddingBottom = isset( $attr['paddingBtnBottom'] ) ? $attr['paddingBtnBottom'] : $attr['vPaddingSubmit'];
$btnPaddingLeft = isset( $attr['paddingBtnLeft'] ) ? $attr['paddingBtnLeft'] : $attr['hPaddingSubmit'];
$btnPaddingRight = isset( $attr['paddingBtnRight'] ) ? $attr['paddingBtnRight'] : $attr['hPaddingSubmit'];
$paddingFieldTop = isset( $attr['paddingFieldTop'] ) ? $attr['paddingFieldTop'] : $attr['vPaddingField'];
$paddingFieldBottom = isset( $attr['paddingFieldBottom'] ) ? $attr['paddingFieldBottom'] : $attr['vPaddingField'];
$paddingFieldLeft = isset( $attr['paddingFieldLeft'] ) ? $attr['paddingFieldLeft'] : $attr['hPaddingField'];
$paddingFieldRight = isset( $attr['paddingFieldRight'] ) ? $attr['paddingFieldRight'] : $attr['hPaddingField'];
$toggle_size_number_tablet = is_numeric( $attr['toggleSizeTablet'] ) ? $attr['toggleSizeTablet'] : $attr['toggleSize'];
$toggle_size_number_mobile = is_numeric( $attr['toggleSizeMobile'] ) ? $attr['toggleSizeMobile'] : $toggle_size_number_tablet;
$toggle_width_size_number_tablet = is_numeric( $attr['toggleWidthSizeTablet'] ) ? $attr['toggleWidthSizeTablet'] : $attr['toggleWidthSize'];
$toggle_width_size_number_mobile = is_numeric( $attr['toggleWidthSizeMobile'] ) ? $attr['toggleWidthSizeMobile'] : $toggle_width_size_number_tablet;
$input_overall_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'field' );
$input_overall_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$input_overall_border,
( isset( $attr['inputborderWidth'] ) ? $attr['inputborderWidth'] : '' ),
( isset( $attr['inputborderRadius'] ) ? $attr['inputborderRadius'] : '' ),
( isset( $attr['inputborderColor'] ) ? $attr['inputborderColor'] : '' ),
( isset( $attr['inputborderStyle'] ) ? $attr['inputborderStyle'] : '' )
);
$input_overall_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'field', 'tablet' );
$input_overall_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'field', 'mobile' );
$input_underline_border = ( isset( $attr['fieldBorderBottomWidth'] ) ? UAGB_Helper::get_css_value( $attr['fieldBorderBottomWidth'], 'px' ) : '' );
$success_message_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'successMsg' );
$success_message_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$success_message_border,
( isset( $attr['successMessageBorderWidth'] ) ? $attr['successMessageBorderWidth'] : '' ),
( isset( $attr['successMessageBorderRadius'] ) ? $attr['successMessageBorderRadius'] : '' ),
( isset( $attr['successMessageBorderColor'] ) ? $attr['successMessageBorderColor'] : '' ),
( isset( $attr['successMessageBorderStyle'] ) ? $attr['successMessageBorderStyle'] : '' )
);
$success_message_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'successMsg', 'tablet' );
$success_message_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'successMsg', 'mobile' );
$failed_message_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'errorMsg' );
$failed_message_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$failed_message_border,
( isset( $attr['failedMessageBorderWidth'] ) ? $attr['failedMessageBorderWidth'] : '' ),
( isset( $attr['failedMessageBorderRadius'] ) ? $attr['failedMessageBorderRadius'] : '' ),
( isset( $attr['failedMessageBorderColor'] ) ? $attr['failedMessageBorderColor'] : '' ),
( isset( $attr['failedMessageBorderStyle'] ) ? $attr['failedMessageBorderStyle'] : '' )
);
$failed_message_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'errorMsg', 'tablet' );
$failed_message_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'errorMsg', 'mobile' );
$toggle_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'checkBoxToggle' );
$toggle_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$toggle_border,
( isset( $attr['inputborderWidth'] ) ? $attr['inputborderWidth'] : '' ),
( isset( $attr['inputborderRadius'] ) ? $attr['inputborderRadius'] : '' ),
( isset( $attr['inputborderColor'] ) ? $attr['inputborderColor'] : '' ),
( isset( $attr['inputborderStyle'] ) ? $attr['inputborderStyle'] : '' )
);
$toggle_border_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'checkBoxToggle', 'tablet' );
$toggle_border_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'checkBoxToggle', 'mobile' );
// Individual Toggle Border Width Fallback for Math Calculations.
$toggle_border_top_tablet_fallback = isset( $toggle_border_tablet['border-top-width'] ) ? ( ! empty( $toggle_border_tablet['border-top-width'] ) ? $toggle_border_tablet['border-top-width'] : $toggle_border['border-top-width'] ) : $toggle_border['border-top-width'];
$toggle_border_left_tablet_fallback = isset( $toggle_border_tablet['border-left-width'] ) ? ( ! empty( $toggle_border_tablet['border-left-width'] ) ? $toggle_border_tablet['border-left-width'] : $toggle_border['border-left-width'] ) : $toggle_border['border-left-width'];
$toggle_border_right_tablet_fallback = isset( $toggle_border_tablet['border-right-width'] ) ? ( ! empty( $toggle_border_tablet['border-right-width'] ) ? $toggle_border_tablet['border-right-width'] : $toggle_border['border-right-width'] ) : $toggle_border['border-right-width'];
$toggle_border_bottom_tablet_fallback = isset( $toggle_border_tablet['border-bottom-width'] ) ? ( ! empty( $toggle_border_tablet['border-bottom-width'] ) ? $toggle_border_tablet['border-bottom-width'] : $toggle_border['border-bottom-width'] ) : $toggle_border['border-bottom-width'];
$toggle_border_top_mobile_fallback = isset( $toggle_border_mobile['border-top-width'] ) ? ( ! empty( $toggle_border_mobile['border-top-width'] ) ? $toggle_border_mobile['border-top-width'] : $toggle_border_top_tablet_fallback ) : $toggle_border_top_tablet_fallback;
$toggle_border_left_mobile_fallback = isset( $toggle_border_mobile['border-left-width'] ) ? ( ! empty( $toggle_border_mobile['border-left-width'] ) ? $toggle_border_mobile['border-left-width'] : $toggle_border_left_tablet_fallback ) : $toggle_border_left_tablet_fallback;
$toggle_border_right_mobile_fallback = isset( $toggle_border_mobile['border-right-width'] ) ? ( ! empty( $toggle_border_mobile['border-right-width'] ) ? $toggle_border_mobile['border-right-width'] : $toggle_border_right_tablet_fallback ) : $toggle_border_right_tablet_fallback;
$toggle_border_bottom_mobile_fallback = isset( $toggle_border_mobile['border-bottom-width'] ) ? ( ! empty( $toggle_border_mobile['border-bottom-width'] ) ? $toggle_border_mobile['border-bottom-width'] : $toggle_border_bottom_tablet_fallback ) : $toggle_border_bottom_tablet_fallback;
// Individual Toggle Border Radius Fallback for Inner Dot.
$toggle_border_radius_tl_tablet_fallback = isset( $toggle_border_tablet['border-top-left-radius'] ) ? ( ! empty( $toggle_border_tablet['border-top-left-radius'] ) ? $toggle_border_tablet['border-top-left-radius'] : $toggle_border['border-top-left-radius'] ) : $toggle_border['border-top-left-radius'];
$toggle_border_radius_tr_tablet_fallback = isset( $toggle_border_tablet['border-top-right-radius'] ) ? ( ! empty( $toggle_border_tablet['border-top-right-radius'] ) ? $toggle_border_tablet['border-top-right-radius'] : $toggle_border['border-top-right-radius'] ) : $toggle_border['border-top-right-radius'];
$toggle_border_radius_bl_tablet_fallback = isset( $toggle_border_tablet['border-bottom-left-radius'] ) ? ( ! empty( $toggle_border_tablet['border-bottom-left-radius'] ) ? $toggle_border_tablet['border-bottom-left-radius'] : $toggle_border['border-bottom-left-radius'] ) : $toggle_border['border-bottom-left-radius'];
$toggle_border_radius_br_tablet_fallback = isset( $toggle_border_tablet['border-bottom-right-radius'] ) ? ( ! empty( $toggle_border_tablet['border-bottom-right-radius'] ) ? $toggle_border_tablet['border-bottom-right-radius'] : $toggle_border['border-bottom-right-radius'] ) : $toggle_border['border-bottom-right-radius'];
$toggle_border_radius_tl_mobile_fallback = isset( $toggle_border_mobile['border-top-left-radius'] ) ? ( ! empty( $toggle_border_mobile['border-top-left-radius'] ) ? $toggle_border_mobile['border-top-left-radius'] : $toggle_border_radius_tl_tablet_fallback ) : $toggle_border_radius_tl_tablet_fallback;
$toggle_border_radius_tr_mobile_fallback = isset( $toggle_border_mobile['border-top-right-radius'] ) ? ( ! empty( $toggle_border_mobile['border-top-right-radius'] ) ? $toggle_border_mobile['border-top-right-radius'] : $toggle_border_radius_tr_tablet_fallback ) : $toggle_border_radius_tr_tablet_fallback;
$toggle_border_radius_bl_mobile_fallback = isset( $toggle_border_mobile['border-bottom-left-radius'] ) ? ( ! empty( $toggle_border_mobile['border-bottom-left-radius'] ) ? $toggle_border_mobile['border-bottom-left-radius'] : $toggle_border_radius_bl_tablet_fallback ) : $toggle_border_radius_bl_tablet_fallback;
$toggle_border_radius_br_mobile_fallback = isset( $toggle_border_mobile['border-bottom-right-radius'] ) ? ( ! empty( $toggle_border_mobile['border-bottom-right-radius'] ) ? $toggle_border_mobile['border-bottom-right-radius'] : $toggle_border_radius_br_tablet_fallback ) : $toggle_border_radius_br_tablet_fallback;
$btn_border = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn' );
$btn_border = UAGB_Block_Helper::uag_generate_deprecated_border_css(
$btn_border,
( isset( $attr['submitborderWidth'] ) ? $attr['submitborderWidth'] : '' ),
( isset( $attr['submitborderRadius'] ) ? $attr['submitborderRadius'] : '' ),
( isset( $attr['submitborderColor'] ) ? $attr['submitborderColor'] : '' ),
( isset( $attr['submitborderStyle'] ) ? $attr['submitborderStyle'] : '' )
);
$btn_border_Tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'tablet' );
$btn_border_Mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'mobile' );
// fallback for forms select field.
$forms_padding_right_mobile_fallback = (int) $attr['paddingFieldRightMobile'] + 30;
$forms_padding_right_tablet_fallback = (int) $attr['paddingFieldRightTablet'] + 30;
$selectors = array(
'.uagb-forms__outer-wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['formPaddingTop'], $attr['formPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['formPaddingRight'], $attr['formPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['formPaddingBottom'], $attr['formPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['formPaddingLeft'], $attr['formPaddingUnit'] ),
),
' .uagb-forms-main-form textarea' => array(
'text-align' => $attr['overallAlignment'],
),
' .uagb-forms-input' => array(
'text-align' => $attr['overallAlignment'],
),
' .uagb-forms-input-label' => array(
'display' => $attr['displayLabels'] ? 'block' : 'none',
'text-align' => null === $attr['labelAlignment'] ? $attr['overallAlignment'] : $attr['labelAlignment'],
),
' .uagb-forms-main-form .uagb-forms-field-set' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldGap'], $attr['fieldGapType'] ),
),
' .uagb-forms-main-form .uagb-forms-input-label' => array(
'color' => $attr['labelColor'],
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSize'], $attr['labelFontSizeType'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['labelGap'], $attr['labelGapUnit'] ),
),
' .uagb-forms-success-message' => array_merge(
array(
'background-color' => $attr['successMessageBGColor'],
'color' => $attr['successMessageTextColor'],
),
$success_message_border
),
' .uagb-forms-success-message:hover' => array(
'border-color' => $attr['successMsgBorderHColor'],
),
' .uagb-forms-failed-message' => array_merge(
array(
'background-color' => $attr['failedMessageBGColor'],
'color' => $attr['failedMessageTextColor'],
),
$failed_message_border
),
' .uagb-forms-failed-message:hover' => array(
'border-color' => $attr['errorMsgBorderHColor'],
),
' .uagb-forms-main-form .uagb-forms-input:focus' => array(
'outline' => ' none !important',
'border-color' => ! empty( $attr['fieldBorderHColor'] ) ? $attr['fieldBorderHColor'] : $attr['inputborderHoverColor'],
'background-color' => $attr['bgActiveColor'] . ' !important',
),
' .uagb-forms-main-form .uagb-forms-input:focus::placeholder' => array(
'color' => $attr['inputplaceholderActiveColor'] . ' !important',
),
// Hover Colors.
' .uagb-forms-field-set:hover .uagb-forms-input-label' => array(
'color' => $attr['labelHoverColor'],
),
' .uagb-forms-field-set:hover .uagb-forms-input' => array(
'background-color' => $attr['bgHoverColor'],
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['submitborderHoverColor'],
),
' .uagb-forms-field-set:hover .uagb-forms-input::placeholder' => array(
'color' => $attr['inputplaceholderHoverColor'],
),
' .uagb-slider.round' => array(
// Important is added to override the usual border radius we set with a completely round one.
'border-radius' => UAGB_Helper::get_css_value( 20 + $attr['toggleWidthSize'], 'px' ) . ' !important',
),
// Drop icon position css.
// select control color.
' .uagb-form-phone-country' => array(
'background' => 'url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9JzE4cHgnIGhlaWdodD0nMThweCcgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIj48cGF0aCBkPSJtMzk2LjYgMTYwIDE5LjQgMjAuN0wyNTYgMzUyIDk2IDE4MC43bDE5LjMtMjAuN0wyNTYgMzEwLjV6IiBmaWxsPSIjMWQyMzI3IiBjbGFzcz0iZmlsbC0wMDAwMDAiPjwvcGF0aD48L3N2Zz4=) no-repeat',
'-moz-appearance' => 'none !important',
'-webkit-appearance' => ' none !important',
'background-position' => ' top 50% right ' . UAGB_Helper::get_css_value( $attr['paddingFieldRight'], $attr['paddingFieldUnit'] ),
'appearance' => 'none !important',
'color' => $attr['inputplaceholderColor'],
),
' .uagb-forms-field-set:hover .uagb-form-phone-country' => array(
'color' => $attr['inputplaceholderHoverColor'],
),
);
if ( 'full' !== $attr['buttonAlign'] ) {
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'text-align' => $attr['buttonAlign'],
);
} else {
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'display' => 'grid',
);
}
$t_selectors = array(
'.uagb-forms__outer-wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['formPaddingTopTab'], $attr['formPaddingUnitTab'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['formPaddingRightTab'], $attr['formPaddingUnitTab'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['formPaddingBottomTab'], $attr['formPaddingUnitTab'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['formPaddingLeftTab'], $attr['formPaddingUnitTab'] ),
),
' .uagb-forms-main-form .uagb-forms-field-set' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldGapTablet'], $attr['fieldGapType'] ),
),
' .uagb-forms-main-form .uagb-forms-input-label' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['labelGapTablet'], $attr['labelGapUnit'] ),
),
' .uagb-slider.round' => array(
// Important is added to override the usual border radius we set with a completely round one.
'border-radius' => UAGB_Helper::get_css_value( 20 + $toggle_width_size_number_tablet, 'px' ) . ' !important',
),
' .uagb-forms-success-message' => $success_message_border_tablet,
' .uagb-forms-failed-message' => $failed_message_border_tablet,
// Drop icon position css.
' .uagb-form-phone-country' => array(
'background-position' => 'top 50% right ' . UAGB_Helper::get_css_value( $attr['paddingFieldRightTablet'] ? $attr['paddingFieldRightTablet'] : 12, $attr['paddingFieldUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $forms_padding_right_tablet_fallback, $attr['paddingFieldUnitTablet'] ),
),
' .uagb-forms-main-form textarea' => array(
'text-align' => $attr['overallAlignmentTablet'],
),
' .uagb-forms-input' => array(
'text-align' => $attr['overallAlignmentTablet'],
),
' .uagb-forms-input-label' => array(
'text-align' => $attr['labelAlignmentTablet'],
),
);
if ( 'full' !== $attr['buttonAlignTablet'] ) {
$t_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'text-align' => $attr['buttonAlignTablet'],
);
} else {
$t_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'display' => 'grid',
);
}
$m_selectors = array(
'.uagb-forms__outer-wrap' => array(
'padding-top' => UAGB_Helper::get_css_value( $attr['formPaddingTopMob'], $attr['formPaddingUnitMob'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['formPaddingRightMob'], $attr['formPaddingUnitMob'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['formPaddingBottomMob'], $attr['formPaddingUnitMob'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['formPaddingLeftMob'], $attr['formPaddingUnitMob'] ),
),
' .uagb-forms-main-form .uagb-forms-field-set' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['fieldGapMobile'], $attr['fieldGapType'] ),
),
' .uagb-forms-main-form .uagb-forms-input-label' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['labelGapMobile'], $attr['labelGapUnit'] ),
),
' .uagb-slider.round' => array(
// Important is added to override the usual border radius we set with a completely round one.
'border-radius' => UAGB_Helper::get_css_value( 20 + $toggle_width_size_number_mobile, 'px' ) . ' !important',
),
' .uagb-forms-success-message' => $success_message_border_mobile,
' .uagb-forms-failed-message' => $failed_message_border_mobile,
// Drop icon position css.
' .uagb-form-phone-country' => array(
'background-position' => 'top 50% right ' . UAGB_Helper::get_css_value( $attr['paddingFieldRightMobile'] ? $attr['paddingFieldRightMobile'] : 6, $attr['paddingFieldUnitmobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $forms_padding_right_mobile_fallback, $attr['paddingFieldUnitmobile'] ),
),
' .uagb-forms-main-form textarea' => array(
'text-align' => $attr['overallAlignmentMobile'],
),
' .uagb-forms-input' => array(
'text-align' => $attr['overallAlignmentMobile'],
),
' .uagb-forms-input-label' => array(
'text-align' => $attr['labelAlignmentMobile'],
),
);
if ( 'full' !== $attr['buttonAlignMobile'] ) {
$m_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'text-align' => $attr['buttonAlignMobile'],
);
} else {
$m_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap'] = array(
'display' => 'grid',
);
}
// Checkbox Field css.
$selectors[' .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = array(
'background-color' => $attr['toggleColor'],
'width' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
);
$selectors[' .uagb-forms-checkbox-wrap > label'] = array(
'color' => $attr['inputColor'],
);
// Radio Button Field css.
$selectors[' .uagb-forms-radio-wrap input[type=radio] + label:before'] = array(
'background-color' => $attr['toggleColor'],
'width' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
);
$selectors[' .uagb-forms-radio-wrap > label'] = array(
'color' => $attr['inputColor'],
);
// Toggle Field css.
$selectors[' .uagb-slider'] = array(
'background-color' => $attr['toggleColor'],
);
$selectors[' .uagb-forms-main-form .uagb-switch'] = array(
'height' => 'calc(' . $toggle_border['border-top-width'] . ' + ' . $toggle_border['border-bottom-width'] . ' + ' . UAGB_Helper::get_css_value(
(int) ( 20 + $attr['toggleWidthSize'] + ( ( 20 + $attr['toggleWidthSize'] ) / 3 ) ),
'px'
) . ')',
'width' => 'calc(' . $toggle_border['border-left-width'] . ' + ' . $toggle_border['border-right-width'] . ' + ' . UAGB_Helper::get_css_value(
(int) ( ( ( 20 + $attr['toggleWidthSize'] ) * 2.5 ) + ( ( 20 + $attr['toggleWidthSize'] ) / 3 ) ),
'px'
) . ')',
);
$selectors[' .uagb-forms-main-form .uagb-slider:before'] = array(
'height' => UAGB_Helper::get_css_value( 20 + $attr['toggleWidthSize'], 'px' ),
'width' => UAGB_Helper::get_css_value( 20 + $attr['toggleWidthSize'], 'px' ),
'top' => UAGB_Helper::get_css_value( (int) ( ( 20 + $attr['toggleWidthSize'] ) / 6 ), 'px' ),
'bottom' => UAGB_Helper::get_css_value( (int) ( ( 20 + $attr['toggleWidthSize'] ) / 6 ), 'px' ),
'left' => UAGB_Helper::get_css_value( (int) ( ( 20 + $attr['toggleWidthSize'] ) / 6 ), 'px' ),
'background-color' => $attr['toggleDotColor'],
'border-radius' => $toggle_border['border-top-left-radius'] . ' ' . $toggle_border['border-top-right-radius'] . ' ' . $toggle_border['border-bottom-right-radius'] . ' ' . $toggle_border['border-bottom-left-radius'],
);
$selectors[' .uagb-switch input:checked + .uagb-slider'] = array(
'background-color' => $attr['toggleActiveColor'],
'border-color' => ! empty( $attr['checkBoxToggleBorderHColor'] ) ? $attr['checkBoxToggleBorderHColor'] : $attr['inputborderHoverColor'],
);
$selectors[' .uagb-switch input:checked + .uagb-slider:before'] = array(
'transform' => 'translateX(' . UAGB_Helper::get_css_value(
(int) ( ( ( ( 20 + $attr['toggleWidthSize'] ) * 2.5 ) - ( 20 + $attr['toggleWidthSize'] ) ) ),
'px'
) . ')',
'background-color' => $attr['toggleDotActiveColor'],
);
$selectors[' .uagb-switch input:focus + .uagb-slider'] = array(
'box-shadow' => '0 0 1px' . $attr['toggleActiveColor'],
);
// Accept Field css.
$selectors[' .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = array(
'background-color' => $attr['toggleColor'],
'width' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSize'], $attr['toggleSizeType'] ),
);
$selectors[' .uagb-forms-accept-wrap > label'] = array(
'color' => $attr['inputColor'],
);
if ( 'boxed' === $attr['formStyle'] ) {
$selectors[' .uagb-forms-main-form .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = $toggle_border;
$selectors[' .uagb-forms-main-form .uagb-forms-checkbox-wrap > input'] = array(
'color' => $attr['inputColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-radio-wrap input[type=radio] + label:before'] = $toggle_border;
$selectors[' .uagb-forms-main-form .uagb-forms-radio-wrap > input'] = array(
'color' => $attr['inputColor'],
);
$selectors[' .uagb-forms-main-form .uagb-slider'] = $toggle_border;
$selectors[' .uagb-forms-main-form .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = $toggle_border;
$selectors[' .uagb-forms-main-form .uagb-forms-accept-wrap > input'] = array(
'color' => $attr['inputColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-input'] = array_merge(
array(
'background-color' => $attr['bgColor'],
'color' => $attr['inputColor'],
),
$input_overall_border
);
$selectors[' .uagb-forms-main-form .uagb-forms-input.uagb-form-phone-country'] = array(
'padding-top' => UAGB_Helper::get_css_value( ( $paddingFieldTop - 1 ), $attr['paddingFieldUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( ( $paddingFieldBottom - 1 ), $attr['paddingFieldUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $paddingFieldLeft, $attr['paddingFieldUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $paddingFieldRight, $attr['paddingFieldUnit'] ),
);
$selectors[' .uagb-forms-input:hover'] = array(
'border-color' => ! empty( $attr['fieldBorderHColor'] ) ? $attr['fieldBorderHColor'] : $attr['inputborderHoverColor'],
);
$selectors[' .uagb-forms-input::placeholder'] = array(
'color' => $attr['inputplaceholderColor'],
);
$t_selectors[' .uagb-forms-main-form .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = $toggle_border_tablet;
$t_selectors[' .uagb-forms-main-form .uagb-forms-radio-wrap input[type=radio] + label:before'] = $toggle_border_tablet;
$t_selectors[' .uagb-forms-main-form .uagb-slider'] = $toggle_border_tablet;
$t_selectors[' .uagb-forms-main-form .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = $toggle_border_tablet;
$t_selectors[' .uagb-forms-main-form .uagb-forms-input'] = $input_overall_border_tablet;
$m_selectors[' .uagb-forms-main-form .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = $toggle_border_mobile;
$m_selectors[' .uagb-forms-main-form .uagb-forms-radio-wrap input[type=radio] + label:before'] = $toggle_border_mobile;
$m_selectors[' .uagb-forms-main-form .uagb-slider'] = $toggle_border_mobile;
$m_selectors[' .uagb-forms-main-form .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = $toggle_border_mobile;
$m_selectors[' .uagb-forms-main-form .uagb-forms-input'] = $input_overall_border_mobile;
}
$selectors[' .uagb-forms-main-form .uagb-forms-input'] = array(
'padding-top' => UAGB_Helper::get_css_value( $paddingFieldTop, $attr['paddingFieldUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $paddingFieldBottom, $attr['paddingFieldUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $paddingFieldLeft, $attr['paddingFieldUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $paddingFieldRight, $attr['paddingFieldUnit'] ),
);
$t_selectors[' .uagb-forms-main-form .uagb-forms-input'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingFieldTopTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingFieldBottomTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingFieldLeftTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingFieldRightTablet'], $attr['paddingFieldUnitTablet'] ),
);
$t_selectors[' .uagb-forms-main-form .uagb-forms-input.uagb-form-phone-country'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingFieldTopTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingFieldBottomTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingFieldLeftTablet'], $attr['paddingFieldUnitTablet'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingFieldRightTablet'], $attr['paddingFieldUnitTablet'] ),
);
$t_selectors[' .uagb-switch input:checked + .uagb-slider:before'] = array(
'transform' => 'translateX(' . UAGB_Helper::get_css_value(
(int) ( ( ( ( 20 + $toggle_width_size_number_tablet ) * 2.5 ) - ( 20 + $toggle_width_size_number_tablet ) ) ),
'px'
) . ')',
);
$m_selectors[' .uagb-forms-main-form .uagb-forms-input.uagb-form-phone-country'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingFieldTopMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingFieldBottomMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingFieldLeftMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingFieldRightMobile'], $attr['paddingFieldUnitmobile'] ),
);
$m_selectors[' .uagb-forms-main-form .uagb-forms-input'] = array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingFieldTopMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingFieldBottomMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingFieldLeftMobile'], $attr['paddingFieldUnitmobile'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingFieldRightMobile'], $attr['paddingFieldUnitmobile'] ),
);
$m_selectors[' .uagb-switch input:checked + .uagb-slider:before'] = array(
'transform' => 'translateX(' . UAGB_Helper::get_css_value(
(int) ( ( ( ( 20 + $toggle_width_size_number_mobile ) * 2.5 ) - ( 20 + $toggle_width_size_number_mobile ) ) ),
'px'
) . ')',
);
if ( 'underlined' === $attr['formStyle'] ) {
$selectors[' .uagb-forms-main-form .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = array(
'border-bottom' => UAGB_Helper::get_css_value( $attr['checkBoxToggleBorderBottomWidth'], 'px' ) . ' ' . $attr['checkBoxToggleBorderStyle'] . ' ' . $attr['checkBoxToggleBorderColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = array(
'border-bottom' => UAGB_Helper::get_css_value( $attr['checkBoxToggleBorderBottomWidth'], 'px' ) . ' ' . $attr['checkBoxToggleBorderStyle'] . ' ' . $attr['checkBoxToggleBorderColor'],
);
$selectors[' .uagb-forms-main-form .uagb-slider'] = array(
'border-bottom' => UAGB_Helper::get_css_value( $attr['checkBoxToggleBorderBottomWidth'], 'px' ) . ' ' . $attr['checkBoxToggleBorderStyle'] . ' ' . $attr['checkBoxToggleBorderColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-radio-wrap input[type=radio] + label:before'] = array(
'border-bottom' => UAGB_Helper::get_css_value( $attr['checkBoxToggleBorderBottomWidth'], 'px' ) . ' ' . $attr['checkBoxToggleBorderStyle'] . ' ' . $attr['checkBoxToggleBorderColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-input'] = array_merge(
array(
'border-top' => 0,
'border-left' => 0,
'border-right' => 0,
'outline' => 0,
'border-radius' => 0,
'background' => 'transparent',
'border-bottom' => UAGB_Helper::get_css_value( $attr['fieldBorderBottomWidth'], 'px' ) . ' ' . $attr['fieldBorderStyle'] . ' ' . $attr['fieldBorderColor'],
'color' => $attr['inputColor'],
'padding-top' => UAGB_Helper::get_css_value( $paddingFieldTop, $attr['paddingFieldUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $paddingFieldBottom, $attr['paddingFieldUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $paddingFieldLeft, $attr['paddingFieldUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $paddingFieldRight, $attr['paddingFieldUnit'] ),
),
$input_overall_border
);
$selectors['.uagb-forms__outer-wrap .uagb-forms-main-form .uagb-forms-input'] = array(
'border-top-width' => 0,
'border-right-width' => 0,
'border-left-width' => 0,
'border-bottom-width' => $input_underline_border,
);
$selectors[' .uagb-forms-input:hover'] = array(
'border-color' => ! empty( $attr['fieldBorderHColor'] ) ? $attr['fieldBorderHColor'] : $attr['inputborderHoverColor'],
);
$selectors[' .uagb-forms-input::placeholder'] = array(
'color' => $attr['inputplaceholderColor'],
);
}
// Element Active CSS.
$selectors[' .uagb-forms-checkbox-wrap input[type=checkbox]:checked + label:before'] = array(
'color' => $attr['toggleDotActiveColor'],
'background-color' => $attr['toggleActiveColor'],
'border-color' => $attr['checkBoxToggleBorderHColor'],
'font-size' => 'calc(' . $attr['toggleSize'] . $attr['toggleSizeType'] . ' / 1.2)',
);
$selectors[' .uagb-forms-radio-wrap input[type=radio]:checked + label:before'] = array(
'background-color' => $attr['toggleDotActiveColor'],
'border-color' => $attr['checkBoxToggleBorderHColor'],
'box-shadow' => 'inset 0 0 0 4px ' . $attr['toggleActiveColor'],
'font-size' => 'calc(' . $attr['toggleSize'] . 'px / 1.2)',
);
$selectors[' .uagb-forms-accept-wrap input[type=checkbox]:checked + label:before'] = array(
'color' => $attr['toggleDotActiveColor'],
'background-color' => $attr['toggleActiveColor'],
'border-color' => $attr['checkBoxToggleBorderHColor'],
'font-size' => 'calc(' . $attr['toggleSize'] . $attr['toggleSizeType'] . ' / 1.2)',
);
// Checkbox Field css.
$t_selectors[' .uagb-forms-checkbox-wrap input[type=checkbox]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_tablet . $attr['toggleSizeType'] . ' / 1.2)',
);
$t_selectors[' .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
);
// Radio Button Field css.
$t_selectors[' .uagb-forms-radio-wrap input[type=radio]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_tablet . 'px / 1.2)',
);
$t_selectors[' .uagb-forms-radio-wrap input[type=radio] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
);
// Accept Field css.
$t_selectors[' .uagb-forms-accept-wrap input[type=checkbox]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_tablet . $attr['toggleSizeType'] . ' / 1.2)',
);
$t_selectors[' .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeTablet'], $attr['toggleSizeType'] ),
);
$t_selectors[' .uagb-forms-main-form .uagb-switch'] = array(
'height' => 'calc(' . $toggle_border_top_tablet_fallback . ' + ' . $toggle_border_bottom_tablet_fallback . ' + ' . UAGB_Helper::get_css_value(
(int) ( 20 + $toggle_width_size_number_tablet + ( ( 20 + $toggle_width_size_number_tablet ) / 3 ) ),
'px'
) . ')',
'width' => 'calc(' . $toggle_border_left_tablet_fallback . ' + ' . $toggle_border_right_tablet_fallback . ' + ' . UAGB_Helper::get_css_value(
(int) ( ( ( 20 + $toggle_width_size_number_tablet ) * 2.5 ) + ( ( 20 + $toggle_width_size_number_tablet ) / 3 ) ),
'px'
) . ')',
);
$t_selectors[' .uagb-forms-main-form .uagb-slider:before'] = array(
'height' => 'calc(20px + ' . $toggle_width_size_number_tablet . 'px)',
'width' => 'calc(20px + ' . $toggle_width_size_number_tablet . 'px)',
'top' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_tablet ) / 6 ), 'px' ),
'bottom' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_tablet ) / 6 ), 'px' ),
'left' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_tablet ) / 6 ), 'px' ),
'border-radius' => $toggle_border_radius_tl_tablet_fallback . ' ' . $toggle_border_radius_tr_tablet_fallback . ' ' . $toggle_border_radius_br_tablet_fallback . ' ' . $toggle_border_radius_bl_tablet_fallback,
);
// Checkbox Field css.
$m_selectors[' .uagb-forms-checkbox-wrap input[type=checkbox]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_mobile . $attr['toggleSizeType'] . ' / 1.2)',
);
$m_selectors[' .uagb-forms-checkbox-wrap input[type=checkbox] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
);
// Radio Button Field css.
$m_selectors[' .uagb-forms-radio-wrap input[type=radio]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_mobile . 'px / 1.2)',
);
$m_selectors[' .uagb-forms-radio-wrap input[type=radio] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
);
// Accept Field css.
$m_selectors[' .uagb-forms-accept-wrap input[type=checkbox]:checked + label:before'] = array(
'font-size' => 'calc(' . $toggle_size_number_mobile . $attr['toggleSizeType'] . ' / 1.2)',
);
$m_selectors[' .uagb-forms-accept-wrap input[type=checkbox] + label:before'] = array(
'width' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
'height' => UAGB_Helper::get_css_value( $attr['toggleSizeMobile'], $attr['toggleSizeType'] ),
);
$m_selectors[' .uagb-forms-main-form .uagb-switch'] = array(
'height' => 'calc(' . $toggle_border_top_mobile_fallback . ' + ' . $toggle_border_bottom_mobile_fallback . ' + ' . UAGB_Helper::get_css_value(
(int) ( 20 + $toggle_width_size_number_mobile + ( ( 20 + $toggle_width_size_number_mobile ) / 3 ) ),
'px'
) . ')',
'width' => 'calc(' . $toggle_border_left_mobile_fallback . ' + ' . $toggle_border_right_mobile_fallback . ' + ' . UAGB_Helper::get_css_value(
(int) ( ( ( 20 + $toggle_width_size_number_mobile ) * 2.5 ) + ( ( 20 + $toggle_width_size_number_mobile ) / 3 ) ),
'px'
) . ')',
);
$m_selectors[' .uagb-forms-main-form .uagb-slider:before'] = array(
'height' => 'calc(20px + ' . $toggle_width_size_number_mobile . 'px)',
'width' => 'calc(20px + ' . $toggle_width_size_number_mobile . 'px)',
'top' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_mobile ) / 6 ), 'px' ),
'bottom' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_mobile ) / 6 ), 'px' ),
'left' => UAGB_Helper::get_css_value( (int) ( ( 20 + $toggle_width_size_number_mobile ) / 6 ), 'px' ),
'border-radius' => $toggle_border_radius_tl_mobile_fallback . ' ' . $toggle_border_radius_tr_mobile_fallback . ' ' . $toggle_border_radius_br_mobile_fallback . ' ' . $toggle_border_radius_bl_mobile_fallback,
);
if ( ! $attr['inheritFromTheme'] ) {
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link '] = array_merge(
array(
'font-size' => UAGB_Helper::get_css_value( $attr['submitTextFontSize'], $attr['submitTextFontSizeType'] ),
'color' => $attr['submitColor'],
'padding-top' => UAGB_Helper::get_css_value( $btnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $btnPaddingBottom, $attr['paddingBtnUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $btnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $btnPaddingRight, $attr['paddingBtnUnit'] ),
),
$btn_border
);
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button '] = array_merge(
array(
'font-size' => UAGB_Helper::get_css_value( $attr['submitTextFontSize'], $attr['submitTextFontSizeType'] ),
'color' => $attr['submitColor'],
'padding-top' => UAGB_Helper::get_css_value( $btnPaddingTop, $attr['paddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $btnPaddingBottom, $attr['paddingBtnUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $btnPaddingLeft, $attr['paddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $btnPaddingRight, $attr['paddingBtnUnit'] ),
),
$btn_border
);
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:hover '] = array(
'color' => $attr['submitColorHover'],
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['submitborderHoverColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button:hover'] = array(
'color' => $attr['submitColorHover'],
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['submitborderHoverColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:focus '] = array(
'color' => $attr['submitColorHover'],
'background-color' => ( 'color' === $attr['submitBgHoverType'] ) ? $attr['submitBgColorHover'] : 'transparent',
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['submitborderHoverColor'],
);
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button:focus'] = array(
'color' => $attr['submitColorHover'],
'background-color' => ( 'color' === $attr['submitBgHoverType'] ) ? $attr['submitBgColorHover'] : 'transparent',
'border-color' => ! empty( $attr['btnBorderHColor'] ) ? $attr['btnBorderHColor'] : $attr['submitborderHoverColor'],
);
$selectors['.uagb-forms__full-btn .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button'] = array(
'width' => '100%',
'padding' => '10px 15px',
);
$selectors['.uagb-forms__small-btn .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button']['padding'] = '5px 10px';
$selectors['.uagb-forms__medium-btn .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button']['padding'] = '12px 24px';
$selectors['.uagb-forms__large-btn .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button']['padding'] = '20px 30px';
$selectors['.uagb-forms__extralarge-btn .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button']['padding'] = '30px 65px';
if ( 'transparent' === $attr['submitBgType'] ) {
$selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link']['background'] = 'transparent';
} elseif ( 'color' === $attr['submitBgType'] ) {
$selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link']['background'] = $attr['submitBgColor'];
} elseif ( 'gradient' === $attr['submitBgType'] ) {
$bg_obj = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientValue'],
'gradientColor1' => $attr['gradientColor1'],
'gradientColor2' => $attr['gradientColor2'],
'gradientType' => $attr['gradientType'],
'gradientLocation1' => $attr['gradientLocation1'],
'gradientLocation2' => $attr['gradientLocation2'],
'gradientAngle' => $attr['gradientAngle'],
'selectGradient' => $attr['selectGradient'],
);
$bg_obj_tablet = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientValue'],
'gradientColor1' => $attr['gradientColor1'],
'gradientColor2' => $attr['gradientColor2'],
'gradientType' => $attr['gradientType'],
'gradientLocation1' => is_numeric( $attr['gradientLocationTablet1'] ) ? $attr['gradientLocationTablet1'] : $bg_obj['gradientLocation1'],
'gradientLocation2' => is_numeric( $attr['gradientLocationTablet2'] ) ? $attr['gradientLocationTablet2'] : $bg_obj['gradientLocation2'],
'gradientAngle' => is_numeric( $attr['gradientAngleTablet'] ) ? $attr['gradientAngleTablet'] : $bg_obj['gradientAngle'],
'selectGradient' => $attr['selectGradient'],
);
$bg_obj_mobile = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientValue'],
'gradientColor1' => $attr['gradientColor1'],
'gradientColor2' => $attr['gradientColor2'],
'gradientType' => $attr['gradientType'],
'gradientLocation1' => is_numeric( $attr['gradientLocationMobile1'] ) ? $attr['gradientLocationMobile1'] : $bg_obj_tablet['gradientLocation1'],
'gradientLocation2' => is_numeric( $attr['gradientLocationMobile2'] ) ? $attr['gradientLocationMobile2'] : $bg_obj_tablet['gradientLocation2'],
'gradientAngle' => is_numeric( $attr['gradientAngleMobile'] ) ? $attr['gradientAngleMobile'] : $bg_obj_tablet['gradientAngle'],
'selectGradient' => $attr['selectGradient'],
);
$btn_bg_css = UAGB_Block_Helper::uag_get_background_obj( $bg_obj );
$btn_bg_css_tablet = UAGB_Block_Helper::uag_get_background_obj( $bg_obj_tablet );
$btn_bg_css_mobile = UAGB_Block_Helper::uag_get_background_obj( $bg_obj_mobile );
$selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link'] = $btn_bg_css;
$t_selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link'] = $btn_bg_css_tablet;
$m_selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link'] = $btn_bg_css_mobile;
}
// Hover.
if ( 'transparent' === $attr['submitBgHoverType'] ) {
$selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:hover'] = array(
'background' => 'transparent',
);
} elseif ( 'color' === $attr['submitBgHoverType'] ) {
$selectors[' .uagb-forms-main-form .wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:hover'] = array(
'background' => $attr['submitBgColorHover'],
);
} elseif ( 'gradient' === $attr['submitBgHoverType'] ) {
$bg_hover_obj = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientHValue'],
'gradientColor1' => $attr['gradientHColor1'],
'gradientColor2' => $attr['gradientHColor2'],
'gradientType' => $attr['gradientHType'],
'gradientLocation1' => $attr['gradientHLocation1'],
'gradientLocation2' => $attr['gradientHLocation2'],
'gradientAngle' => $attr['gradientHAngle'],
'selectGradient' => $attr['selectHGradient'],
);
$bg_hover_obj_tablet = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientHValue'],
'gradientColor1' => $attr['gradientHColor1'],
'gradientColor2' => $attr['gradientHColor2'],
'gradientType' => $attr['gradientHType'],
'gradientLocation1' => $attr['gradientHLocationTablet1'] ? $attr['gradientHLocationTablet1'] : $bg_hover_obj['gradientLocation1'],
'gradientLocation2' => $attr['gradientHLocationTablet2'] ? $attr['gradientHLocationTablet2'] : $bg_hover_obj['gradientLocation2'],
'gradientAngle' => $attr['gradientHAngleTablet'] ? $attr['gradientHAngleTablet'] : $bg_hover_obj['gradientAngle'],
'selectGradient' => $attr['selectHGradient'],
);
$bg_hover_obj_mobile = array(
'backgroundType' => 'gradient',
'gradientValue' => $attr['gradientHValue'],
'gradientColor1' => $attr['gradientHColor1'],
'gradientColor2' => $attr['gradientHColor2'],
'gradientType' => $attr['gradientHType'],
'gradientLocation1' => $attr['gradientHLocationMobile1'] ? $attr['gradientHLocationMobile1'] : $bg_hover_obj_tablet['gradientLocation1'],
'gradientLocation2' => $attr['gradientHLocationMobile2'] ? $attr['gradientHLocationMobile2'] : $bg_hover_obj_tablet['gradientLocation2'],
'gradientAngle' => $attr['gradientHAngleMobile'] ? $attr['gradientHAngleMobile'] : $bg_hover_obj_tablet['gradientAngle'],
'selectGradient' => $attr['selectHGradient'],
);
$btn_hover_bg_css = UAGB_Block_Helper::uag_get_background_obj( $bg_hover_obj );
$btn_hover_bg_css_tablet = UAGB_Block_Helper::uag_get_background_obj( $bg_hover_obj_tablet );
$btn_hover_bg_css_mobile = UAGB_Block_Helper::uag_get_background_obj( $bg_hover_obj_mobile );
$selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button.wp-block-button__link:hover'] = $btn_hover_bg_css;
$t_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button.wp-block-button__link:hover'] = $btn_hover_bg_css_tablet;
$m_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap .uagb-forms-main-submit-button.wp-block-button__link:hover'] = $btn_hover_bg_css_mobile;
}
$t_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftTablet'], $attr['tabletPaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightTablet'], $attr['tabletPaddingBtnUnit'] ),
),
$btn_border_Tablet
);
$t_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link '] = $btn_border_Tablet;
$m_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button'] = array_merge(
array(
'padding-top' => UAGB_Helper::get_css_value( $attr['paddingBtnTopMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['paddingBtnBottomMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['paddingBtnLeftMobile'], $attr['mobilePaddingBtnUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['paddingBtnRightMobile'], $attr['mobilePaddingBtnUnit'] ),
),
$btn_border_Mobile
);
$m_selectors[' .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link '] = $btn_border_Mobile;
};
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
if ( ! $attr['inheritFromTheme'] ) {
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'submitText', ' .uagb-forms-main-form .uagb-forms-main-submit-button', $combined_selectors );
}
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' .uagb-forms-main-form .uagb-forms-input-label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .uagb-forms-main-form .uagb-forms-input::placeholder', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .uagb-forms-main-form .uagb-forms-input', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, '.uagb-block-' . $id );

View File

@@ -0,0 +1,60 @@
<?php
/**
* Frontend JS File.
*
* @since 2.0.0
*
* @package uagb
*/
$selector = '.uagb-block-' . $id;
$current_post_id = get_the_ID();
$curr_user = wp_get_current_user();
$default_email = $curr_user->user_email;
// Define the attributes with expected types and default values.
/**
* $js_attr Configuration Array
*
* - block_id (string): Unique block ID.
* - reCaptchaEnable (bool): Whether reCAPTCHA is enabled. Default: false.
* - reCaptchaType (string): Type of reCAPTCHA ('v2' or 'v3'). Default: 'v2'.
* - reCaptchaSiteKeyV2 (string): Site key for reCAPTCHA v2. Default: ''.
* - reCaptchaSecretKeyV2 (string): Secret key for reCAPTCHA v2. Default: ''.
* - reCaptchaSiteKeyV3 (string): Site key for reCAPTCHA v3. Default: ''.
* - reCaptchaSecretKeyV3 (string): Secret key for reCAPTCHA v3. Default: ''.
* - afterSubmitToEmail (string): Email address for submissions. Default: $default_email (sanitized).
* - afterSubmitCcEmail (string): CC email address for submissions. Default: ''.
* - afterSubmitBccEmail (string): BCC email address for submissions. Default: ''.
* - afterSubmitEmailSubject (string): Email subject after submission. Default: 'Form Submission'.
* - sendAfterSubmitEmail (bool): Whether to send an email after submission. Default: true.
* - confirmationType (string): Confirmation type ('message' or 'url'). Default: 'message'.
* - hidereCaptchaBatch (bool): Whether to hide reCAPTCHA for batch submissions. Default: false.
* - captchaMessage (string): Custom message for CAPTCHA validation. Default: 'Please fill up the above captcha.'.
* - confirmationUrl (string): Redirect URL for confirmation. Default: ''.
*/
$js_attr = array(
'block_id' => $attr['block_id'],
'reCaptchaEnable' => isset( $attr['reCaptchaEnable'] ) ? filter_var( $attr['reCaptchaEnable'], FILTER_VALIDATE_BOOLEAN ) : false,
'reCaptchaType' => isset( $attr['reCaptchaType'] ) && is_string( $attr['reCaptchaType'] ) ? sanitize_text_field( $attr['reCaptchaType'] ) : 'v2',
'reCaptchaSiteKeyV2' => isset( $attr['reCaptchaSiteKeyV2'] ) && is_string( $attr['reCaptchaSiteKeyV2'] ) ? sanitize_text_field( $attr['reCaptchaSiteKeyV2'] ) : '',
'reCaptchaSecretKeyV2' => isset( $attr['reCaptchaSecretKeyV2'] ) && is_string( $attr['reCaptchaSecretKeyV2'] ) ? sanitize_text_field( $attr['reCaptchaSecretKeyV2'] ) : '',
'reCaptchaSiteKeyV3' => isset( $attr['reCaptchaSiteKeyV3'] ) && is_string( $attr['reCaptchaSiteKeyV3'] ) ? sanitize_text_field( $attr['reCaptchaSiteKeyV3'] ) : '',
'reCaptchaSecretKeyV3' => isset( $attr['reCaptchaSecretKeyV3'] ) && is_string( $attr['reCaptchaSecretKeyV3'] ) ? sanitize_text_field( $attr['reCaptchaSecretKeyV3'] ) : '',
'afterSubmitToEmail' => isset( $attr['afterSubmitToEmail'] ) && is_string( $attr['afterSubmitToEmail'] ) && '' !== trim( $attr['afterSubmitToEmail'] ) ? sanitize_email( $attr['afterSubmitToEmail'] ) : sanitize_email( $default_email ),
'afterSubmitCcEmail' => isset( $attr['afterSubmitCcEmail'] ) && is_string( $attr['afterSubmitCcEmail'] ) && '' !== trim( $attr['afterSubmitCcEmail'] ) ? sanitize_email( $attr['afterSubmitCcEmail'] ) : '',
'afterSubmitBccEmail' => isset( $attr['afterSubmitBccEmail'] ) && is_string( $attr['afterSubmitBccEmail'] ) && '' !== trim( $attr['afterSubmitBccEmail'] ) ? sanitize_email( $attr['afterSubmitBccEmail'] ) : '',
'afterSubmitEmailSubject' => isset( $attr['afterSubmitEmailSubject'] ) && is_string( $attr['afterSubmitEmailSubject'] ) ? sanitize_text_field( $attr['afterSubmitEmailSubject'] ) : __( 'Form Submission', 'ultimate-addons-for-gutenberg' ),
'sendAfterSubmitEmail' => isset( $attr['sendAfterSubmitEmail'] ) ? filter_var( $attr['sendAfterSubmitEmail'], FILTER_VALIDATE_BOOLEAN ) : true,
'confirmationType' => isset( $attr['confirmationType'] ) && is_string( $attr['confirmationType'] ) ? sanitize_text_field( $attr['confirmationType'] ) : 'message',
'hidereCaptchaBatch' => isset( $attr['hidereCaptchaBatch'] ) ? filter_var( $attr['hidereCaptchaBatch'], FILTER_VALIDATE_BOOLEAN ) : false,
'captchaMessage' => isset( $attr['captchaMessage'] ) && is_string( $attr['captchaMessage'] ) ? sanitize_textarea_field( $attr['captchaMessage'] ) : __( 'Please fill up the above captcha.', 'ultimate-addons-for-gutenberg' ),
'confirmationUrl' => isset( $attr['confirmationUrl'] ) && is_string( $attr['confirmationUrl'] ) ? UAGB_Forms::validate_confirmation_url( $attr['confirmationUrl'] ) : '',
);
ob_start();
?>
window.addEventListener("DOMContentLoaded", function(){
UAGBForms.init( <?php echo wp_json_encode( $js_attr ); ?>, '<?php echo esc_attr( $selector ); ?>', <?php echo wp_json_encode( $current_post_id ); ?> );
});
<?php
return ob_get_clean();
?>

View File

@@ -0,0 +1,252 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'align' => 'left',
'enableAjax' => false,
'enableTabSupport' => false,
'formTabIndex' => '0',
'formId' => '0',
'titleDescStyle' => 'yes',
'titleDescAlignment' => 'left',
'fieldStyle' => 'box',
'fieldHrPadding' => 10,
'fieldVrPadding' => 10,
'fieldBgColor' => '#fafafa',
'fieldLabelColor' => '#333',
'fieldInputColor' => '#333',
'fieldBorderStyle' => 'solid',
'fieldBorderWidth' => 1,
'fieldBorderWidthTablet' => '',
'fieldBorderWidthMobile' => '',
'fieldBorderWidthType' => 'px',
'fieldBorderRadius' => 0,
'fieldBorderColor' => '#eeeeee',
'fieldBorderFocusColor' => '',
'buttonAlignment' => 'left',
'buttonVrPadding' => 10,
'buttonHrPadding' => 25,
'buttonTextColor' => '#333',
'buttonBgColor' => '#ffffff',
'buttonTextHoverColor' => '',
'buttonBgHoverColor' => '#ffffff',
'buttonBorderStyle' => 'solid',
'buttonBorderWidth' => 1,
'buttonBorderWidthTablet' => '',
'buttonBorderWidthMobile' => '',
'buttonBorderWidthType' => 'px',
'buttonBorderRadius' => 0,
'buttonBorderColor' => '#333',
'buttonBorderHoverColor' => '',
'fieldSpacing' => '',
'fieldSpacingTablet' => '',
'fieldSpacingMobile' => '',
'fieldLabelSpacing' => '',
'fieldLabelSpacingMobile' => '',
'fieldLabelSpacingTablet' => '',
'enableLabel' => false,
'textAreaHeight' => 'auto',
'textAreaHeightTablet' => 'auto',
'textAreaHeightMobile' => 'auto',
'labelFontSize' => '',
'labelFontSizeType' => 'px',
'labelFontSizeTablet' => '',
'labelFontSizeMobile' => '',
'labelFontFamily' => '',
'labelFontWeight' => '',
'labelFontStyle' => '',
'labelTransform' => '',
'labelDecoration' => '',
'labelLineHeightType' => 'px',
'labelLineHeight' => '',
'labelLineHeightTablet' => '',
'labelLineHeightMobile' => '',
'labelLoadGoogleFonts' => false,
'inputFontSize' => '',
'inputFontSizeType' => 'px',
'inputFontSizeTablet' => '',
'inputFontSizeMobile' => '',
'inputFontFamily' => '',
'inputFontWeight' => '',
'inputFontStyle' => '',
'inputTransform' => '',
'inputDecoration' => '',
'inputLineHeightType' => 'px',
'inputLineHeight' => '',
'inputLineHeightTablet' => '',
'inputLineHeightMobile' => '',
'inputLoadGoogleFonts' => false,
'buttonFontSize' => '',
'buttonFontSizeType' => 'px',
'buttonFontSizeTablet' => '',
'buttonFontSizeMobile' => '',
'buttonFontFamily' => '',
'buttonFontWeight' => '',
'buttonFontStyle' => '',
'buttonTransform' => '',
'buttonDecoration' => '',
'buttonLineHeightType' => 'px',
'buttonLineHeight' => '',
'buttonLineHeightTablet' => '',
'buttonLineHeightMobile' => '',
'buttonLoadGoogleFonts' => false,
'enableOveride' => true,
'radioCheckSize' => '20',
'radioCheckSizeTablet' => '',
'radioCheckSizeMobile' => '',
'radioCheckBgColor' => '#fafafa',
'radioCheckSelectColor' => '',
'radioCheckLableColor' => '',
'radioCheckBorderColor' => '#cbcbcb',
'radioCheckBorderWidth' => '1',
'radioCheckBorderWidthTablet' => '',
'radioCheckBorderWidthMobile' => '',
'radioCheckBorderWidthType' => 'px',
'radioCheckBorderRadius' => '',
'radioCheckFontSize' => '',
'radioCheckFontSizeType' => 'px',
'radioCheckFontSizeTablet' => '',
'radioCheckFontSizeMobile' => '',
'radioCheckFontFamily' => '',
'radioCheckFontWeight' => '',
'radioCheckFontStyle' => '',
'radioCheckTransform' => '',
'radioCheckDecoration' => '',
'radioCheckLineHeightType' => 'px',
'radioCheckLineHeight' => '',
'radioCheckLineHeightTablet' => '',
'radioCheckLineHeightMobile' => '',
'radioCheckLoadGoogleFonts' => false,
'validationMsgColor' => '#ff0000',
'advancedValidationSettings' => false,
'highlightBorderColor' => '#ff0000',
'validationMsgFontSize' => '',
'validationMsgBgColor' => '',
'validationMsgFontSizeType' => 'px',
'validationMsgFontSizeTablet' => '',
'validationMsgFontSizeMobile' => '',
'validationMsgFontFamily' => '',
'validationMsgFontWeight' => '',
'validationMsgFontStyle' => '',
'validationMsgTransform' => '',
'validationMsgDecoration' => '',
'validationMsgLineHeightType' => 'em',
'validationMsgLineHeight' => '',
'validationMsgLineHeightTablet' => '',
'validationMsgLineHeightMobile' => '',
'validationMsgLoadGoogleFonts' => false,
'successMsgBorderColor' => '',
'errorMsgColor' => '',
'errorMsgBgColor' => '',
'errorMsgBorderColor' => '',
'msgBorderSize' => '',
'msgBorderSizeType' => 'px',
'msgBorderRadius' => '',
'msgVrPadding' => '',
'msgHrPadding' => '',
'msgFontSize' => '',
'msgFontSizeType' => 'px',
'msgFontSizeTablet' => '',
'msgFontSizeMobile' => '',
'msgFontFamily' => '',
'msgFontWeight' => '',
'msgFontStyle' => '',
'msgTransform' => '',
'msgDecoration' => '',
'msgLineHeightType' => 'em',
'msgLineHeight' => '',
'msgLineHeightTablet' => '',
'msgLineHeightMobile' => '',
'msgLoadGoogleFonts' => false,
'radioCheckBorderRadiusType' => 'px',
'msgBorderRadiusType' => 'px',
'fieldBorderRadiusType' => 'px',
'buttonBorderRadiusType' => 'px',
'successMsgColor' => '',
'successMsgFontSize' => '',
'successMsgFontSizeType' => 'px',
'successMsgFontSizeTablet' => '',
'successMsgFontSizeMobile' => '',
'successMsgFontFamily' => '',
'successMsgFontWeight' => '',
'successMsgFontStyle' => '',
'successMsgTransform' => '',
'successMsgDecoration' => '',
'successMsgLineHeightType' => 'em',
'successMsgLineHeight' => '',
'successMsgLineHeightTablet' => '',
'successMsgLineHeightMobile' => '',
'successMsgLoadGoogleFonts' => false,
'msgleftPadding' => '',
'msgrightPadding' => '',
'msgtopPadding' => '',
'msgbottomPadding' => '',
'msgleftMobilePadding' => '',
'msgrightMobilePadding' => '',
'msgtopMobilePadding' => '',
'msgbottomMobilePadding' => '',
'msgleftTabletPadding' => '',
'msgrightTabletPadding' => '',
'msgtopTabletPadding' => '',
'msgbottomTabletPadding' => '',
'msgtabletPaddingUnit' => 'px',
'msgmobilePaddingUnit' => 'px',
'msgpaddingUnit' => 'px',
'buttonleftMobilePadding' => '',
'buttonrightMobilePadding' => '',
'buttontopMobilePadding' => '',
'buttonbottomMobilePadding' => '',
'buttonleftTabletPadding' => '',
'buttonrightTabletPadding' => '',
'buttontopTabletPadding' => '',
'buttonbottomTabletPadding' => '',
'buttontabletPaddingUnit' => 'px',
'buttonmobilePaddingUnit' => 'px',
'buttonpaddingUnit' => 'px',
'fieldleftMobilePadding' => '',
'fieldrightMobilePadding' => '',
'fieldtopMobilePadding' => '',
'fieldbottomMobilePadding' => '',
'fieldleftTabletPadding' => '',
'fieldrightTabletPadding' => '',
'fieldtopTabletPadding' => '',
'fieldbottomTabletPadding' => '',
'fieldtabletPaddingUnit' => 'px',
'fieldmobilePaddingUnit' => 'px',
'fieldpaddingUnit' => 'px',
'labelLetterSpacing' => '',
'labelLetterSpacingTablet' => '',
'labelLetterSpacingMobile' => '',
'labelLetterSpacingType' => 'px',
'inputLetterSpacing' => '',
'inputLetterSpacingTablet' => '',
'inputLetterSpacingMobile' => '',
'inputLetterSpacingType' => 'px',
'radioCheckLetterSpacing' => '',
'radioCheckLetterSpacingTablet' => '',
'radioCheckLetterSpacingMobile' => '',
'radioCheckLetterSpacingType' => 'px',
'buttonLetterSpacing' => '',
'buttonLetterSpacingTablet' => '',
'buttonLetterSpacingMobile' => '',
'buttonLetterSpacingType' => 'px',
'validationMsgLetterSpacing' => '',
'validationMsgLetterSpacingTablet' => '',
'validationMsgLetterSpacingMobile' => '',
'validationMsgLetterSpacingType' => 'px',
'msgLetterSpacing' => '',
'msgLetterSpacingTablet' => '',
'msgLetterSpacingMobile' => '',
'msgLetterSpacingType' => 'px',
'successMsgLetterSpacing' => '',
'successMsgLetterSpacingTablet' => '',
'successMsgLetterSpacingMobile' => '',
'successMsgLetterSpacingType' => 'px',
);

View File

@@ -0,0 +1,26 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/gf-styler';
$block_data = array(
'doc' => 'gravity-form',
'slug' => '',
'admin_categories' => array( 'form' ),
'link' => 'gravity-form-styler-legacy',
'title' => __( 'Gravity Form Designer', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Highly customize and style your forms created by Gravity Forms.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'is_active' => class_exists( 'GFForms' ),
'priority' => Spectra_Block_Prioritization::get_block_priority( 'gf-styler' ),
'deprecated' => true,
'dynamic_assets' => array(
'dir' => 'gf-styler',
),
);

View File

@@ -0,0 +1,914 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_gf_styler_gfont( $attr );
$attr['msgVrPadding'] = ( '' === $attr['msgVrPadding'] ) ? '0' : $attr['msgVrPadding'];
$attr['msgHrPadding'] = ( '' === $attr['msgHrPadding'] ) ? '0' : $attr['msgHrPadding'];
$attr['textAreaHeight'] = ( 'auto' === $attr['msgHrPadding'] ) ?
$attr['textAreaHeight'] : $attr['textAreaHeight'] . 'px';
$button_top_padding = isset( $attr['buttontopPadding'] ) ? $attr['buttontopPadding'] : $attr['buttonVrPadding'];
$button_bottom_padding = isset( $attr['buttonbottomPadding'] ) ? $attr['buttonbottomPadding'] : $attr['buttonVrPadding'];
$button_left_padding = isset( $attr['buttonleftPadding'] ) ? $attr['buttonleftPadding'] : $attr['buttonHrPadding'];
$button_right_padding = isset( $attr['buttonrightPadding'] ) ? $attr['buttonrightPadding'] : $attr['buttonHrPadding'];
$msg_top_padding = isset( $attr['msgtopPadding'] ) ? $attr['msgtopPadding'] : $attr['msgVrPadding'];
$msg_bottom_padding = isset( $attr['msgbottomPadding'] ) ? $attr['msgbottomPadding'] : $attr['msgVrPadding'];
$msg_left_padding = isset( $attr['msgleftPadding'] ) ? $attr['msgleftPadding'] : $attr['msgHrPadding'];
$msg_right_padding = isset( $attr['msgrightPadding'] ) ? $attr['msgrightPadding'] : $attr['msgHrPadding'];
$field_top_padding = isset( $attr['fieldtopPadding'] ) ? $attr['fieldtopPadding'] : $attr['fieldVrPadding'];
$field_bottom_padding = isset( $attr['fieldbottomPadding'] ) ? $attr['fieldbottomPadding'] : $attr['fieldVrPadding'];
$field_left_padding = isset( $attr['fieldleftPadding'] ) ? $attr['fieldleftPadding'] : $attr['fieldHrPadding'];
$field_right_padding = isset( $attr['fieldrightPadding'] ) ? $attr['fieldrightPadding'] : $attr['fieldHrPadding'];
$selectors = array(
' .gform_wrapper form' => array(
'text-align' => $attr['align'],
),
' .gform_wrapper .gfield_label' => array(
'color' => $attr['fieldLabelColor'],
),
' .wp-block-uagb-gf-styler form:not(input)' => array(
'color' => $attr['fieldLabelColor'],
),
' .gform_heading' => array(
'text-align' => $attr['titleDescAlignment'],
),
' .gform_wrapper input:not([type=submit])' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'border-style' => $attr['fieldBorderStyle'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacing'],
'px'
),
'text-align' => $attr['align'],
),
// Focus.
' .gform_wrapper.gravity-theme input:not([type=submit]):focus' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' .gform_wrapper.gravity-theme select:focus' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' .gform_wrapper.gravity-theme textarea:focus' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' input[type=button]' => array(
'color' => $attr['buttonTextColor'],
'background-color' => $attr['buttonBgColor'],
'border-color' => $attr['buttonBorderColor'],
'border-style' => $attr['buttonBorderStyle'],
'border-width' => UAGB_Helper::get_css_value(
$attr['buttonBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['buttonBorderRadius'],
$attr['buttonBorderRadiusType']
),
'padding-left' => UAGB_Helper::get_css_value( $button_left_padding, $attr['buttonpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $button_right_padding, $attr['buttonpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $button_top_padding, $attr['buttonpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $button_bottom_padding, $attr['buttonpaddingUnit'] ),
),
' input[type=button]:hover' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => $attr['buttonBorderHoverColor'],
),
' input[type=button]:focus' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => $attr['buttonBorderHoverColor'],
),
' .gform_wrapper select ' => array(
'background-color' => $attr['fieldBgColor'],
'border-style' => $attr['fieldBorderStyle'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacing'],
'px'
),
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
),
' .chosen-container-single span' => array(
'background-color' => $attr['fieldBgColor'],
'border-style' => $attr['fieldBorderStyle'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacing'],
'px'
),
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
),
' .chosen-container-single.chosen-container-active .chosen-single span' => array(
'margin-bottom' => 0,
),
' select.wpgf-form-control.wpgf-select:not([multiple="multiple"])' => array(
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
),
' select.wpgf-select[multiple="multiple"] option' => array(
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
),
' .gform_wrapper .gfield textarea' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
'border-style' => $attr['fieldBorderStyle'],
'padding-left' => UAGB_Helper::get_css_value( $field_left_padding, $attr['fieldpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $field_right_padding, $attr['fieldpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $field_top_padding, $attr['fieldpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $field_bottom_padding, $attr['fieldpaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacing'],
'px'
),
'text-align' => $attr['align'],
'height' => $attr['textAreaHeight'],
),
' .gform_wrapper.gravity-theme .gfield textarea.large:focus' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' textarea::placeholder' => array(
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
),
' input::placeholder' => array(
'color' => $attr['fieldInputColor'],
'text-align' => $attr['align'],
),
' .gform_wrapper.gravity-theme .gfield_label' => array(
'color' => $attr['fieldLabelColor'],
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSize'], $attr['labelFontSizeType'] ),
'font-family' => $attr['labelFontFamily'],
'text-transform' => $attr['labelTransform'],
'text-decoration' => $attr['labelDecoration'] . '!important',
'font-style' => $attr['labelFontStyle'],
'font-weight' => $attr['labelFontWeight'],
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeight'], $attr['labelLineHeightType'] ),
),
' form .gfield_radio label.gfield_label' => array(
'color' => $attr['fieldLabelColor'],
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSize'], $attr['labelFontSizeType'] ),
'font-family' => $attr['labelFontFamily'],
'text-transform' => $attr['labelTransform'],
'text-decoration' => $attr['labelDecoration'] . '!important',
'font-style' => $attr['labelFontStyle'],
'font-weight' => $attr['labelFontWeight'],
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeight'], $attr['labelLineHeightType'] ),
),
' form .gfield_checkbox label.gfield_label' => array(
'color' => $attr['fieldLabelColor'],
'font-size' => UAGB_Helper::get_css_value( $attr['labelFontSize'], $attr['labelFontSizeType'] ),
'font-family' => $attr['labelFontFamily'],
'text-transform' => $attr['labelTransform'],
'text-decoration' => $attr['labelDecoration'] . '!important',
'font-style' => $attr['labelFontStyle'],
'font-weight' => $attr['labelFontWeight'],
'line-height' => UAGB_Helper::get_css_value( $attr['labelLineHeight'], $attr['labelLineHeightType'] ),
),
' .gform_wrapper.gravity-theme .gfield_checkbox ' => array(
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
),
' .gform_wrapper.gravity-theme .gfield_radio ' => array(
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacing'],
'px'
),
),
// Submit button.
' input.gform_button' => array(
'color' => $attr['buttonTextColor'],
'background-color' => $attr['buttonBgColor'],
'border-color' => $attr['buttonBorderColor'],
'border-style' => $attr['buttonBorderStyle'],
'border-width' => UAGB_Helper::get_css_value(
$attr['buttonBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['buttonBorderRadius'],
$attr['buttonBorderRadiusType']
),
'padding-left' => UAGB_Helper::get_css_value( $button_left_padding, $attr['buttonpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $button_right_padding, $attr['buttonpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $button_top_padding, $attr['buttonpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $button_bottom_padding, $attr['buttonpaddingUnit'] ),
),
' .gform_footer.top_label input[type="submit"]' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['buttonFontSize'], $attr['buttonFontSizeType'] ),
),
' input.gform_button:hover' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => $attr['buttonBorderHoverColor'],
),
' input.gform_button:focus' => array(
'color' => $attr['buttonTextHoverColor'],
'background-color' => $attr['buttonBgHoverColor'],
'border-color' => $attr['buttonBorderHoverColor'],
),
// Check box Radio.
' .gfield_checkbox input[type="checkbox"]:checked + label:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'font-size' => 'calc( ' . $attr['fieldVrPadding'] . 'px / 1.2 )',
'border-color' => $attr['fieldBorderFocusColor'],
),
' .gfield_checkbox input[type="checkbox"] + label:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'border-style' => $attr['fieldBorderStyle'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
'font-size' => 'calc( ' . $attr['fieldVrPadding'] . 'px / 1.2 )',
),
' input[type="checkbox"]:checked + label:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'font-size' => 'calc( ' . $attr['fieldVrPadding'] . 'px / 1.2 )',
'border-color' => $attr['fieldBorderFocusColor'],
),
' input[type="checkbox"] + label:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'font-size' => 'calc( ' . $attr['fieldVrPadding'] . 'px / 1.2 )',
'border-color' => $attr['fieldBorderColor'],
'border-style' => $attr['fieldBorderStyle'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
),
' .wp-block-uagb-gf-styler .gform_wrapper .ginput_container_select select' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
),
' .gfield_radio input[type="radio"] + label:before' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'height' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'width' => UAGB_Helper::get_css_value( $attr['fieldVrPadding'], 'px' ),
'border-style' => $attr['fieldBorderStyle'],
'border-color' => $attr['fieldBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
),
' .gfield_radio input[type="radio"]:checked + label:before' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
// Underline border.
' .uagb-gf-styler__field-style-underline .gform_wrapper input:not([type=submit])' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['fieldBorderColor'],
'border-bottom-style' => 'solid',
'border-bottom-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
),
' .uagb-gf-styler__field-style-underline .gform_wrapper .gfield textarea' => array(
'background-color' => $attr['fieldBgColor'],
'color' => $attr['fieldInputColor'],
'border-style' => 'none',
'border-bottom-color' => $attr['fieldBorderColor'],
'border-bottom-style' => 'solid',
'border-bottom-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
),
' .uagb-gf-styler__field-style-underline select' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['fieldBorderColor'],
'border-bottom-style' => 'solid',
'border-bottom-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
),
' .uagb-gf-styler__field-style-underline textarea' => array(
'border-style' => 'none',
'border-bottom-color' => $attr['fieldBorderColor'],
'border-bottom-style' => 'solid',
'border-bottom-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidth'],
$attr['fieldBorderWidthType']
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['fieldBorderRadius'],
$attr['fieldBorderRadiusType']
),
),
' .uagb-gf-styler__check-style-enabled .gfield_checkbox input[type="checkbox"] + label:before' => array(
'border-style' => 'solid',
),
' .uagb-gf-styler__check-style-enabled input[type="radio"] + label:before' => array(
'border-style' => 'solid',
),
' .uagb-gf-styler__field-style-box .gfield_checkbox input[type="checkbox"]:checked + label:before' => array(
'border-style' => 'solid',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderRadius'],
$attr['radioCheckBorderRadiusType']
),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
),
' .uagb-gf-styler__field-style-box input[type="checkbox"]:checked + label:before' => array(
'border-style' => 'solid',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderRadius'],
$attr['radioCheckBorderRadiusType']
),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
),
' .gfield_radio input[type="radio"]:checked + label:before' => array(
'background-color' => $attr['fieldInputColor'],
),
// Override check box.
' .uagb-gf-styler__check-style-enabled .gfield_checkbox input[type="checkbox"] + label:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-style' => 'solid',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderRadius'],
$attr['radioCheckBorderRadiusType']
),
),
' .uagb-gf-styler__check-style-enabled .gfield_checkbox input[type="checkbox"]:checked + label:before' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' .uagb-gf-styler__check-style-enabled input[type="checkbox"] + label:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderRadius'],
$attr['radioCheckBorderRadiusType']
),
),
' .uagb-gf-styler__check-style-enabled input[type="checkbox"]:checked + label:before' => array(
'border-color' => $attr['fieldBorderFocusColor'],
),
' .uagb-gf-styler__check-style-enabled input[type="radio"] + label:before' => array(
'background-color' => $attr['radioCheckBgColor'],
'color' => $attr['radioCheckSelectColor'],
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSize'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSize'] . 'px / 1.2 )',
'border-color' => $attr['radioCheckBorderColor'],
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderRadius'],
$attr['radioCheckBorderRadiusType']
),
),
' .uagb-gf-styler__check-style-enabled .gfield_radio input[type="radio"]:checked + label:before' => array(
'background-color' => $attr['radioCheckSelectColor'],
'border-color' => $attr['fieldBorderFocusColor'],
),
' .uagb-gf-styler__check-style-enabled form .gfield_radio label' => array(
'color' => $attr['radioCheckLableColor'],
),
' .uagb-gf-styler__check-style-enabled form .gfield_checkbox label' => array(
'color' => $attr['radioCheckLableColor'],
),
// Validation Errors.
' .gform_wrapper .gfield_description.validation_message' => array(
'color' => $attr['validationMsgColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper .gfield.gfield_error' => array(
'background-color' => $attr['validationMsgBgColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper .gfield_error .ginput_container input' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper .gfield_error .ginput_container select' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper .gfield_error .ginput_container .chosen-single' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper .gfield_error .ginput_container textarea' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper li.gfield.gfield_error' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper li.gfield.gfield_error.gfield_contains_required.gfield_creditcard_warning' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes li.gfield_error .gfield_checkbox input[type="checkbox"] + label:before' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes li.gfield_error .ginput_container_consent input[type="checkbox"] + label:before' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes li.gfield_error .gfield_radio input[type="radio"] + label:before' => array(
'border-color' => $attr['highlightBorderColor'],
),
' .uagb-gf-styler__error-yes .gform_wrapper li.gfield_error input[type="text"]' => array(
'border' => $attr['fieldBorderWidth'] . $attr['fieldBorderWidthType'] . ' ' . $attr['fieldBorderStyle'] . ' ' . $attr['fieldBorderColor'] . '!important',
),
' .uael-gf-style-underline.uagb-gf-styler__error-yes .gform_wrapper li.gfield_error input[type="text"]' => array(
'border-width' => $attr['fieldBorderWidth'] . $attr['fieldBorderWidthType'] . ' !important',
'border-style' => 'solid !important',
'border-color' => $attr['fieldBorderColor'] . '!important',
),
' .gform_wrapper.gravity-theme div.validation_message' => array(
'color' => $attr['errorMsgColor'],
'background-color' => $attr['errorMsgBgColor'],
'border-color' => $attr['errorMsgBorderColor'],
'border-style' => 'solid',
'border-width' => UAGB_Helper::get_css_value(
$attr['msgBorderSize'],
'px'
),
'border-radius' => UAGB_Helper::get_css_value(
$attr['msgBorderRadius'],
$attr['msgBorderRadiusType']
),
'padding-left' => UAGB_Helper::get_css_value( $msg_left_padding, $attr['msgpaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $msg_right_padding, $attr['msgpaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $msg_top_padding, $attr['msgpaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $msg_bottom_padding, $attr['msgpaddingUnit'] ),
),
' .gform_confirmation_message' => array(
'color' => $attr['successMsgColor'],
),
);
$t_selectors = array(
' .uagb-gf-styler__field-style-box .gfield_checkbox input[type="checkbox"]:checked + label:before' => array(
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthTablet'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
),
' .uagb-gf-styler__field-style-box input[type="checkbox"]:checked + label:before' => array(
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthTablet'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
),
' .uagb-gf-styler__check-style-enabled .gfield_checkbox input[type="checkbox"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthTablet'],
'px'
),
),
' .uagb-gf-styler__check-style-enabled input[type="checkbox"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
),
' .uagb-gf-styler__check-style-enabled input[type="radio"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeTablet'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeTablet'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthTablet'],
'px'
),
),
' form.wpgf-form:not(input)' => array(
'color' => $attr['fieldLabelColor'],
),
' .gform_wrapper.gravity-theme input:not([type=submit])' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingTablet'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingTablet'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthTablet'],
$attr['fieldBorderWidthType']
),
),
' .gform_wrapper.gravity-theme .gfield textarea.large' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingTablet'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingTablet'],
'px'
),
'height' => 'auto' === $attr['textAreaHeightTablet'] ? $attr['textAreaHeightTablet'] : UAGB_Helper::get_css_value(
$attr['textAreaHeightTablet'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthTablet'],
$attr['fieldBorderWidthType']
),
),
' input.gform_button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['buttonleftTabletPadding'], $attr['buttontabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['buttonrightTabletPadding'], $attr['buttontabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['buttontopTabletPadding'], $attr['buttontabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['buttonbottomTabletPadding'], $attr['buttontabletPaddingUnit'] ),
'border-width' => UAGB_Helper::get_css_value(
$attr['buttonBorderWidthTablet'],
'px'
),
),
' .gform_wrapper.gravity-theme div.validation_message' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['msgleftTabletPadding'], $attr['msgtabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['msgrightTabletPadding'], $attr['msgtabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['msgtopTabletPadding'], $attr['msgtabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['msgbottomTabletPadding'], $attr['msgtabletPaddingUnit'] ),
),
' .gform_wrapper.gravity-theme select ' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingTablet'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingTablet'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthTablet'],
$attr['fieldBorderWidthType']
),
),
);
$m_selectors = array(
' .uagb-gf-styler__field-style-box .gfield_checkbox input[type="checkbox"]:checked + label:before' => array(
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthMobile'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
),
' .uagb-gf-styler__field-style-box input[type="checkbox"]:checked + label:before' => array(
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthMobile'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
),
' .uagb-gf-styler__check-style-enabled .gfield_checkbox input[type="checkbox"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthMobile'],
'px'
),
),
' .uagb-gf-styler__check-style-enabled input[type="checkbox"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidth'],
'px'
),
),
' .uagb-gf-styler__check-style-enabled input[type="radio"] + label:before' => array(
'height' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'width' => UAGB_Helper::get_css_value(
$attr['radioCheckSizeMobile'],
'px'
),
'font-size' => 'calc( ' . $attr['radioCheckSizeMobile'] . 'px / 1.2 )',
'border-width' => UAGB_Helper::get_css_value(
$attr['radioCheckBorderWidthMobile'],
'px'
),
),
' .gform_wrapper.gravity-theme input:not([type=submit])' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingMobile'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingMobile'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthMobile'],
$attr['fieldBorderWidthType']
),
),
' .gform_wrapper.gravity-theme .gfield textarea.large' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomMobilePadding'], $attr['fieldmobilePaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingMobile'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingMobile'],
'px'
),
'height' => 'auto' === $attr['textAreaHeightMobile'] ? $attr['textAreaHeightMobile'] : UAGB_Helper::get_css_value(
$attr['textAreaHeightMobile'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthMobile'],
$attr['fieldBorderWidthType']
),
),
' input.gform_button' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['buttonleftMobilePadding'], $attr['buttonmobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['buttonrightMobilePadding'], $attr['buttonmobilePaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['buttontopMobilePadding'], $attr['buttonmobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['buttonbottomMobilePadding'], $attr['buttonmobilePaddingUnit'] ),
'border-width' => UAGB_Helper::get_css_value(
$attr['buttonBorderWidthMobile'],
'px'
),
),
' .gform_wrapper.gravity-theme div.validation_message' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['msgleftMobilePadding'], $attr['msgmobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['msgrightMobilePadding'], $attr['msgmobilePaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['msgtopMobilePadding'], $attr['msgmobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['msgbottomMobilePadding'], $attr['msgmobilePaddingUnit'] ),
),
' .gform_wrapper.gravity-theme select ' => array(
'padding-left' => UAGB_Helper::get_css_value( $attr['fieldleftTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['fieldrightTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-top' => UAGB_Helper::get_css_value( $attr['fieldtopTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['fieldbottomTabletPadding'], $attr['fieldtabletPaddingUnit'] ),
'margin-top' => UAGB_Helper::get_css_value(
$attr['fieldLabelSpacingTablet'],
'px'
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['fieldSpacingTablet'],
'px'
),
'border-width' => UAGB_Helper::get_css_value(
$attr['fieldBorderWidthTablet'],
$attr['fieldBorderWidthType']
),
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'validationMsg', ' .gform_wrapper.gravity-theme .validation_message', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'validationMsg', ' span.wpgf-not-valid-tip', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'successMsg', ' .gform_confirmation_message', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'msg', ' .gform_wrapper div.validation_error', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'msg', ' .wpgf-response-output', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'button', ' input.gform_button, input.gform_previous_button, input.gform_next_button', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' form .gfield_checkbox label.gfield_label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' form .gfield_radio label.gfield_label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'label', ' .gform_wrapper.gravity-theme label.gfield_label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' textarea', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' select', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .gform_wrapper.gravity-theme input:not([type=submit])', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'radioCheck', ' .uagb-gf-styler__check-style-enabled form .gfield_checkbox label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'input', ' .chosen-container-single span', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'radioCheck', ' .uagb-gf-styler__check-style-enabled form .gfield_radio label', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, '.uagb-block-' . $id );

View File

@@ -0,0 +1,15 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'height' => '300',
'heightTablet' => '300',
'heightMobile' => '300',
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/google-map';
$block_data = array(
'doc' => 'google-map',
'slug' => '',
'admin_categories' => array( 'content' ),
'link' => 'google-maps-legacy',
'title' => __( 'Google Maps', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Show a Google Map location on your website.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'google-map' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'google-map',
),
);

View File

@@ -0,0 +1,38 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
$t_selectors = array();
$m_selectors = array();
$selectors = array();
$selectors = array(
' .uagb-google-map__iframe' => array(
'height' => UAGB_Helper::get_css_value( $attr['height'], 'px' ),
),
);
$m_selectors = array(
' .uagb-google-map__iframe' => array(
'height' => UAGB_Helper::get_css_value( $attr['heightMobile'], 'px' ),
),
);
$t_selectors = array(
' .uagb-google-map__iframe' => array(
'height' => UAGB_Helper::get_css_value( $attr['heightTablet'], 'px' ),
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
return UAGB_Helper::generate_all_css( $combined_selectors, ' .uagb-block-' . $id );

View File

@@ -0,0 +1,70 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'titleFontFamily' => 'Default',
'titleFontWeight' => '',
'titleFontSizeType' => 'px',
'titleFontSize' => '',
'titleFontSizeTablet' => '',
'titleFontSizeMobile' => '',
'descriptionFontFamily' => 'Default',
'descriptionFontWeight' => '',
'descriptionFontSizeType' => 'px',
'descriptionFontSize' => '',
'descriptionFontSizeTablet' => '',
'descriptionFontSizeMobile' => '',
'urlFontFamily' => 'Default',
'urlFontWeight' => '',
'urlFontSizeType' => 'px',
'urlFontSize' => '',
'urlFontSizeTablet' => '',
'urlFontSizeMobile' => '',
'titleColor' => '',
'descriptionColor' => '',
'urlColor' => '',
'urlFontStyle' => '',
'urlTransform' => '',
'urlDecoration' => '',
'titleFontStyle' => '',
'titleTransform' => '',
'titleDecoration' => '',
'descriptionFontStyle' => '',
'descriptionTransform' => '',
'descriptionDecoration' => '',
'descriptionLetterSpacing' => '',
'descriptionLetterSpacingTablet' => '',
'descriptionLetterSpacingMobile' => '',
'descriptionLetterSpacingType' => 'px',
'descriptionLineHeightType' => 'em',
'descriptionLineHeight' => '',
'descriptionLineHeightTablet' => '',
'descriptionLineHeightMobile' => '',
'titleLineHeightType' => 'em',
'titleLineHeight' => '',
'titleLineHeightTablet' => '',
'titleLineHeightMobile' => '',
'titleLoadGoogleFonts' => false,
'titleLetterSpacing' => '',
'titleLetterSpacingTablet' => '',
'titleLetterSpacingMobile' => '',
'titleLetterSpacingType' => 'px',
'urlLineHeightType' => 'em',
'urlLineHeight' => '',
'urlLineHeightTablet' => '',
'urlLineHeightMobile' => '',
'urlLetterSpacing' => '',
'urlLetterSpacingTablet' => '',
'urlLetterSpacingMobile' => '',
'urlLetterSpacingType' => 'px',
);

View File

@@ -0,0 +1,21 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/how-to-step';
$block_data = array(
'slug' => '',
'title' => __( 'Step', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add relevant content for this step.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'dynamic_assets' => array(
'dir' => 'how-to-step',
),
'deprecated' => false,
);

View File

@@ -0,0 +1,37 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_how_to_step_gfont( $attr );
$t_selectors = array();
$m_selectors = array();
$selectors = array(
' .uagb-step-link-text' => array(
'color' => $attr['urlColor'],
),
' .uagb-how-to-step-name' => array(
'color' => $attr['titleColor'],
),
' .uagb-how-to-step-description' => array(
'color' => $attr['descriptionColor'],
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'url', ' .uagb-step-link-text', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'title', ' .uagb-how-to-step-name', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'description', ' .uagb-how-to-step-description', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, ' .uagb-block-' . $id );

View File

@@ -0,0 +1,97 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'overallAlignment' => 'left',
'tools_count' => 1,
'material_count' => 1,
'tools' => '',
'materials' => '',
'showTotaltime' => true,
'showEstcost' => true,
'showTools' => true,
'showMaterials' => true,
'mainimage' => '',
'imgSize' => 'thumbnail',
'timeSpace' => 5,
'costSpace' => 5,
'time' => '30',
'cost' => '65',
'currencyType' => ' USD',
'headingAlign' => 'left',
'descriptionAlign' => 'left',
'headingColor' => '',
'showEstcostcolor' => '',
'showTotaltimecolor' => '',
'subHeadingColor' => '',
'headingTag' => 'h3',
'headSpace' => 15,
'headFontFamily' => 'Default',
'headFontWeight' => '500',
'headFontStyle' => '',
'headFontSizeType' => 'px',
'headLineHeightType' => 'em',
'headFontSize' => '',
'headFontSizeTablet' => '',
'headFontSizeMobile' => '',
'headLineHeight' => '',
'headLineHeightTablet' => '',
'headLineHeightMobile' => '',
'subHeadFontFamily' => 'Default',
'subHeadFontWeight' => '',
'subHeadFontStyle' => '',
'subHeadFontSize' => '',
'subHeadFontSizeType' => 'px',
'subHeadFontSizeTablet' => '',
'subHeadFontSizeMobile' => '',
'subHeadLineHeight' => '',
'subHeadLineHeightType' => 'em',
'subHeadLineHeightTablet' => '',
'subHeadLineHeightMobile' => '',
'separatorSpace' => 15,
'headLoadGoogleFonts' => false,
'subHeadLoadGoogleFonts' => false,
'priceFontSizeType' => 'px',
'priceFontSize' => 18,
'priceFontSizeTablet' => '',
'priceFontSizeMobile' => '',
'priceFontFamily' => 'Default',
'priceFontWeight' => '500',
'priceFontStyle' => '',
'priceLineHeightType' => 'em',
'priceLineHeight' => '',
'priceLineHeightTablet' => '',
'priceLineHeightMobile' => '',
'priceLoadGoogleFonts' => false,
'row_gap' => 20,
'step_gap' => '',
'schema' => '',
'headTransform' => '',
'headDecoration' => '',
'subHeadTransform' => '',
'subHeadDecoration' => '',
'priceTransform' => '',
'priceDecoration' => '',
'rowGapTablet' => '',
'rowGapMobile' => '',
// letter spacing.
'headLetterSpacing' => '',
'headLetterSpacingTablet' => '',
'headLetterSpacingMobile' => '',
'headLetterSpacingType' => 'px',
'priceLetterSpacing' => '',
'priceLetterSpacingTablet' => '',
'priceLetterSpacingMobile' => '',
'priceLetterSpacingType' => 'px',
'subHeadLetterSpacing' => '',
'subHeadLetterSpacingTablet' => '',
'subHeadLetterSpacingMobile' => '',
'subHeadLetterSpacingType' => 'px',
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/how-to';
$block_data = array(
'doc' => 'how-to-schema',
'slug' => '',
'admin_categories' => array( 'seo' ),
'link' => 'how-to-schema-legacy',
'title' => __( 'How To', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add instructions/steps on processes using how to block.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'how-to' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'how-to',
),
);

View File

@@ -0,0 +1,257 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
UAGB_Block_JS::blocks_how_to_gfont( $attr );
$t_selectors = array();
$m_selectors = array();
$selectors = array(
' .uagb-how-to-main-wrap' => array( // For Backword.
'text-align' => $attr['overallAlignment'],
),
'.uagb-how-to-main-wrap' => array(
'text-align' => $attr['overallAlignment'],
),
'.uagb-how-to-main-wrap p.uagb-howto-desc-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-howto__source-wrap' => array( // For Backword.
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-howto__source-image' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap span.uagb-howto__time-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
'justify-content' => $attr['overallAlignment'],
),
'.uagb-how-to-main-wrap span.uagb-howto__cost-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
'justify-content' => $attr['overallAlignment'],
),
' h4.uagb-howto-req-steps-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' h4.uagb-howto-req-materials-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools__wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-materials-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
// for backward compatibility.
' .uagb-how-to-materials .uagb-how-to-materials-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-tools__wrap .uagb-how-to-tools-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-how-to-main-wrap span.uagb-howto__cost-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-how-to-main-wrap span.uagb-howto__time-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
'.uagb-how-to-main-wrap p' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-howto__source-wrap' => array( // For Backword.
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-howto__source-image' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['row_gap'], 'px' ),
),
' .uagb-infobox__content-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['step_gap'], 'px' ),
),
' .uagb-infobox__content-wrap:last-child' => array(
'margin-bottom' => '0px',
),
' .uagb-how-to-step-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['step_gap'], 'px' ),
),
' .uagb-how-to-step-wrap:last-child' => array(
'margin-bottom' => '0px',
),
' span.uagb-howto__time-wrap .uagb-howto-timeNeeded-value' => array(
'margin-left' => UAGB_Helper::get_css_value(
$attr['timeSpace'],
'px'
),
),
' span.uagb-howto__cost-wrap .uagb-howto-estcost-value' => array(
'margin-left' => UAGB_Helper::get_css_value(
$attr['costSpace'],
'px'
),
),
' ' . $attr['headingTag'] . '.uagb-howto-heading-text' => array(
'color' => $attr['headingColor'],
),
' p.uagb-howto-desc-text' => array(
'color' => $attr['subHeadingColor'],
),
' span.uagb-howto__time-wrap p' => array(
'color' => $attr['subHeadingColor'],
),
' span.uagb-howto__cost-wrap p' => array(
'color' => $attr['subHeadingColor'],
),
' span.uagb-howto__time-wrap h4.uagb-howto-timeNeeded-text' => array(
'color' => $attr['showTotaltimecolor'],
),
' span.uagb-howto__cost-wrap h4.uagb-howto-estcost-text' => array(
'color' => $attr['showTotaltimecolor'],
),
' .uagb-how-to-tools__wrap .uagb-howto-req-tools-text' => array( // For Backword.
'color' => $attr['showTotaltimecolor'],
),
' .uagb-howto-req-tools-text' => array(
'color' => $attr['showTotaltimecolor'],
),
' .uagb-howto-req-materials-text' => array(
'color' => $attr['showTotaltimecolor'],
),
' .uagb-how-to-steps__wrap .uagb-howto-req-steps-text' => array(
'color' => $attr['showTotaltimecolor'],
),
' .uagb-howto-req-steps-text' => array(
'color' => $attr['showTotaltimecolor'],
),
);
$selectors[' .uagb-tools__label'] = array(
'color' => $attr['subHeadingColor'],
);
$selectors[' .uagb-materials__label'] = array(
'color' => $attr['subHeadingColor'],
);
$t_selectors = array(
'.uagb-how-to-main-wrap p.uagb-howto-desc-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-howto__source-image' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap span.uagb-howto__time-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap span.uagb-howto__cost-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
' h4.uagb-howto-req-steps-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
' h4.uagb-howto-req-materials-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools__wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-materials-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapTablet'], 'px' ),
),
);
$m_selectors = array(
'.uagb-how-to-main-wrap p.uagb-howto-desc-text' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-howto__source-image' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap span.uagb-howto__time-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap span.uagb-howto__cost-wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
' h4.uagb-howto-req-steps-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
' h4.uagb-howto-req-materials-text' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-tools__wrap' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
'.uagb-how-to-main-wrap .uagb-how-to-materials-child__wrapper:last-child' => array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['rowGapMobile'], 'px' ),
),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'subHead', ' p', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'price', ' h4', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'head', ' .uagb-howto-heading-text', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'subHead', ' .uagb-tools__label', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'subHead', ' .uagb-materials__label', $combined_selectors );
return UAGB_Helper::generate_all_css( $combined_selectors, ' .uagb-block-' . $id );

View File

@@ -0,0 +1,58 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'image_icon' => 'icon',
'icon' => 'fab fa-facebook',
'image' => '',
'icon_color' => '',
'icon_hover_color' => '',
'icon_bg_color' => '',
'icon_bg_hover_color' => '',
'icon_border_color' => '',
'icon_border_hover_color' => '',
'label_color' => '',
'label_hover_color' => '',
'link' => '#',
'target' => false,
// margin.
'childTopMargin' => '',
'childRightMargin' => '',
'childLeftMargin' => '',
'childBottomMargin' => '',
'childTopMarginTablet' => '',
'childRightMarginTablet' => '',
'childLeftMarginTablet' => '',
'childBottomMarginTablet' => '',
'childTopMarginMobile' => '',
'childRightMarginMobile' => '',
'childLeftMarginMobile' => '',
'childBottomMarginMobile' => '',
'childMarginUnit' => 'px',
'childMarginUnitTablet' => 'px',
'childMarginUnitMobile' => 'px',
'childMarginLink' => '',
// padding.
'childTopPadding' => '',
'childRightPadding' => '',
'childLeftPadding' => '',
'childBottomPadding' => '',
'childTopPaddingTablet' => '',
'childRightPaddingTablet' => '',
'childLeftPaddingTablet' => '',
'childBottomPaddingTablet' => '',
'childTopPaddingMobile' => '',
'childRightPaddingMobile' => '',
'childLeftPaddingMobile' => '',
'childBottomPaddingMobile' => '',
'childPaddingUnit' => 'px',
'childPaddingUnitTablet' => 'px',
'childPaddingUnitMobile' => 'px',
'childPaddingLink' => '',
);

View File

@@ -0,0 +1,23 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/icon-list-child';
$block_data = array(
'slug' => '',
'link' => '',
'title' => __( 'Icon', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add and customize content for this list component.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'is_child' => true,
'extension' => false,
'dynamic_assets' => array(
'dir' => 'icon-list-child',
),
'deprecated' => false,
);

View File

@@ -0,0 +1,24 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
$selectors = UAGB_Block_Helper::get_icon_list_child_selectors( $attr, $id, true )['desktop'];
$t_selectors = UAGB_Block_Helper::get_icon_list_child_selectors( $attr, $id, true )['tablet'];
$m_selectors = UAGB_Block_Helper::get_icon_list_child_selectors( $attr, $id, true )['mobile'];
$desktop = UAGB_Helper::generate_css( $selectors, '.uagb-block-' . $id );
$tablet = UAGB_Helper::generate_css( $t_selectors, '.uagb-block-' . $id );
$mobile = UAGB_Helper::generate_css( $m_selectors, '.uagb-block-' . $id );
$generated_css = array(
'desktop' => $desktop,
'tablet' => $tablet,
'mobile' => $mobile,
);
return $generated_css;

View File

@@ -0,0 +1,128 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'classMigrate' => false,
'childMigrate' => false,
'align' => 'left',
'alignTablet' => '',
'alignMobile' => '',
'icon_count' => '1',
'icons' => array(
array(
'label' => __( 'Label #1', 'ultimate-addons-for-gutenberg' ),
'image_icon' => 'icon',
'icon' => '',
'image' => '',
'icon_color' => '',
'icon_hover_color' => '',
'icon_bg_color' => '',
'icon_bg_hover_color' => '',
'icon_border_color' => '',
'icon_border_hover_color' => '',
'label_color' => '',
'label_hover_color' => '',
'link' => '#',
'target' => false,
),
),
'gap' => '10',
'gapTablet' => '',
'gapMobile' => '',
'gapType' => 'px',
'inner_gap' => '15',
'innerGapTablet' => '',
'innerGapMobile' => '',
'innerGapType' => 'px',
'size' => '16',
'sizeType' => 'px',
'sizeMobile' => '',
'sizeTablet' => '',
'bgSize' => '0',
'bgSizeType' => 'px',
'bgSizeTablet' => '',
'bgSizeMobile' => '',
'border' => '0',
'borderTablet' => '',
'borderMobile' => '',
'borderType' => 'px',
'borderRadius' => '0',
'borderRadiusTablet' => '',
'borderRadiusMobile' => '',
'borderRadiusType' => 'px',
'fontSize' => '',
'fontSizeType' => 'px',
'fontSizeMobile' => '',
'fontSizeTablet' => '',
'lineHeight' => '',
'lineHeightType' => 'em',
'lineHeightMobile' => '',
'lineHeightTablet' => '',
'fontFamily' => '',
'fontWeight' => '',
'loadGoogleFonts' => false,
'icon_layout' => 'vertical',
'iconLayoutTablet' => '',
'iconLayoutMobile' => '',
'fontStyle' => '',
'fontTransform' => '',
'fontDecoration' => '',
'hideLabel' => false,
'iconPosition' => 'middle',
'iconPositionTablet' => '',
'iconPositionMobile' => '',
'iconPlacement' => 'before',
'iconColor' => '',
'iconHoverColor' => '',
'iconBgColor' => '',
'iconBgHoverColor' => '',
'iconBorderColor' => '',
'iconBorderHoverColor' => '',
'labelColor' => '',
'labelHoverColor' => '',
'labelLetterSpacing' => '',
'labelLetterSpacingTablet' => '',
'labelLetterSpacingMobile' => '',
'labelLetterSpacingType' => 'px',
// margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
'blockMarginLink' => '',
'parentIcon' => 'circle-arrow-right',
// padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
'blockPaddingLink' => '',
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/icon-list';
$block_data = array(
'doc' => 'icon-list',
'slug' => '',
'admin_categories' => array( 'creative' ),
'link' => 'icon-list-legacy',
'title' => __( 'Icon List', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Create a list highlighted with icons/images.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'icon-list' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'icon-list',
),
);

View File

@@ -0,0 +1,500 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
*
* @package uagb
*/
// Adds Fonts.
// We have used the same buttons gfont function because the inputs to these functions are same.
// If need be please add a new function for Info Box and go ahead.
UAGB_Block_JS::blocks_buttons_gfont( $attr );
$font_size_fallback = is_numeric( $attr['fontSize'] ) ? $attr['fontSize'] : 16;
// Responsive Fallback Values that Need to be Numeric for Math.
$size_tablet_fallback = is_numeric( $attr['sizeTablet'] ) ? $attr['sizeTablet'] : $attr['size'];
$size_mobile_fallback = is_numeric( $attr['sizeMobile'] ) ? $attr['sizeMobile'] : $size_tablet_fallback;
$bg_size_tablet_fallback = is_numeric( $attr['bgSizeTablet'] ) ? $attr['bgSizeTablet'] : $attr['bgSize'];
$bg_size_mobile_fallback = is_numeric( $attr['bgSizeMobile'] ) ? $attr['bgSizeMobile'] : $bg_size_tablet_fallback;
$tborder_fallback = is_numeric( $attr['borderTablet'] ) ? $attr['borderTablet'] : $attr['border'];
$mborder_fallback = is_numeric( $attr['borderMobile'] ) ? $attr['borderMobile'] : $tborder_fallback;
$font_size_tablet_fallback = is_numeric( $attr['fontSizeTablet'] ) ? $attr['fontSizeTablet'] : $font_size_fallback;
$font_size_mobile_fallback = is_numeric( $attr['fontSizeMobile'] ) ? $attr['fontSizeMobile'] : $font_size_tablet_fallback;
$tgap_fallback = is_numeric( $attr['gapTablet'] ) ? $attr['gapTablet'] : $attr['gap'];
$mgap_fallback = is_numeric( $attr['gapMobile'] ) ? $attr['gapMobile'] : $tgap_fallback;
$alignment = ( 'left' === $attr['align'] ) ? 'flex-start' : ( ( 'right' === $attr['align'] ) ? 'flex-end' : 'center' );
$alignment_tablet = ( 'left' === $attr['alignTablet'] ) ? 'flex-start' : ( ( 'right' === $attr['alignTablet'] ) ? 'flex-end' : ( ( 'center' === $attr['alignTablet'] ) ? 'center' : $alignment ) );
$alignment_mobile = ( 'left' === $attr['alignMobile'] ) ? 'flex-start' : ( ( 'right' === $attr['alignMobile'] ) ? 'flex-end' : ( ( 'center' === $attr['alignMobile'] ) ? 'center' : $alignment_tablet ) );
$icon_layout = $attr['icon_layout'];
$icon_layout_tablet = ! empty( $attr['iconLayoutTablet'] ) ? $attr['iconLayoutTablet'] : $icon_layout;
$icon_layout_mobile = ! empty( $attr['iconLayoutMobile'] ) ? $attr['iconLayoutMobile'] : $icon_layout_tablet;
$m_selectors = array();
$t_selectors = array();
$icon_size = UAGB_Helper::get_css_value( $attr['size'], $attr['sizeType'] );
$m_icon_size = UAGB_Helper::get_css_value( $size_mobile_fallback, $attr['sizeType'] );
$t_icon_size = UAGB_Helper::get_css_value( $size_tablet_fallback, $attr['sizeType'] );
// The Math ( 3 * Icon Size ) / 5 aligns perfectly with the current defaults ( Font Size: 16px, Line Height: 1.8em ).
$half_size = 3 * $attr['size'] / 5;
$half_size_tablet = 3 * $size_tablet_fallback / 5;
$half_size_mobile = 3 * $size_mobile_fallback / 5;
$position = 'top' === $attr['iconPosition'] ? 'flex-start' : 'center';
$tablet_position = '';
$mobile_position = '';
if ( 'top' === $attr['iconPositionTablet'] ) {
$tablet_position = 'flex-start';
} elseif ( 'middle' === $attr['iconPositionTablet'] ) {
$tablet_position = 'center';
} else {
$tablet_position = $position;
}
if ( 'top' === $attr['iconPositionMobile'] ) {
$mobile_position = 'flex-start';
} elseif ( 'middle' === $attr['iconPositionMobile'] ) {
$mobile_position = 'center';
} else {
$mobile_position = $tablet_position;
}
$selectors = array(
// Desktop Icon Size CSS starts.
' .uagb-icon-list__source-image' => array(
'width' => $icon_size,
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap svg' => array(
'width' => $icon_size,
'height' => $icon_size,
'font-size' => $icon_size,
'color' => $attr['iconColor'],
'fill' => $attr['iconColor'],
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap' => array_merge(
array(
'background' => $attr['iconBgColor'],
'border-color' => $attr['iconBorderColor'],
'padding' => UAGB_Helper::get_css_value( $attr['bgSize'], $attr['bgSizeType'] ),
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadius'], 'px' ),
'border-style' => ( $attr['border'] > 0 ) ? 'solid' : '',
'border-width' => UAGB_Helper::get_css_value( $attr['border'], $attr['borderType'] ),
'align-self' => $position,
)
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__label' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSize'], $attr['fontSizeType'] ),
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'line-height' => $attr['lineHeight'] . $attr['lineHeightType'],
),
' .uagb-icon-list__wrap' => array(
'display' => 'flex',
'flex-direction' => 'row',
'justify-content' => $alignment,
'-webkit-box-pack' => $alignment,
'-ms-flex-pack' => $alignment,
'-webkit-box-align' => 'center',
'-ms-flex-align' => 'center',
'align-items' => 'center',
'margin-top' => UAGB_Helper::get_css_value(
$attr['blockTopMargin'],
$attr['blockMarginUnit']
),
'margin-right' => UAGB_Helper::get_css_value(
$attr['blockRightMargin'],
$attr['blockMarginUnit']
),
'margin-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomMargin'],
$attr['blockMarginUnit']
),
'margin-left' => UAGB_Helper::get_css_value(
$attr['blockLeftMargin'],
$attr['blockMarginUnit']
),
'padding-top' => UAGB_Helper::get_css_value(
$attr['blockTopPadding'],
$attr['blockPaddingUnit']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['blockRightPadding'],
$attr['blockPaddingUnit']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomPadding'],
$attr['blockPaddingUnit']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['blockLeftPadding'],
$attr['blockPaddingUnit']
),
),
' .wp-block-uagb-icon-list-child:hover .uagb-icon-list__source-wrap svg' => array(
'color' => $attr['iconHoverColor'],
'fill' => $attr['iconHoverColor'],
),
' .wp-block-uagb-icon-list-child:hover .uagb-icon-list__label' => array(
'color' => $attr['labelHoverColor'],
),
' .wp-block-uagb-icon-list-child:hover .uagb-icon-list__source-wrap' => array(
'background' => $attr['iconBgHoverColor'],
'border-color' => $attr['iconBorderHoverColor'],
),
' .uagb-icon-list__label' => array(
'text-align' => $attr['align'],
),
);
if ( $attr['childMigrate'] ) {
$selectors[' .wp-block-uagb-icon-list-child'] = array(
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['fontSize'], $attr['fontSizeType'] ),
'line-height' => $attr['lineHeight'] . $attr['lineHeightType'],
);
}
$t_selectors = array(
' .uagb-icon-list__source-image' => array(
'width' => $t_icon_size,
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap svg' => array(
'width' => $t_icon_size,
'height' => $t_icon_size,
'font-size' => $t_icon_size,
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap ' => array_merge(
array(
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadiusTablet'], $attr['borderRadiusType'] ),
'padding' => UAGB_Helper::get_css_value( $bg_size_tablet_fallback, 'px' ),
'border-style' => ( $tborder_fallback > 0 ) ? 'solid' : '',
'border-width' => UAGB_Helper::get_css_value( $tborder_fallback, $attr['borderType'] ),
'align-self' => $tablet_position,
)
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__label' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeTablet'], $attr['fontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightTablet'], $attr['lineHeightType'] ),
),
' .uagb-icon-list__wrap' => array(
'display' => 'flex',
'flex-direction' => 'row',
'justify-content' => $alignment_tablet,
'-webkit-box-pack' => $alignment_tablet,
'-ms-flex-pack' => $alignment_tablet,
'-webkit-box-align' => 'center',
'-ms-flex-align' => 'center',
'align-items' => 'center',
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginTablet'], $attr['blockMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginTablet'], $attr['blockMarginUnitTablet'] ),
'padding-top' => UAGB_Helper::get_css_value(
$attr['blockTopPaddingTablet'],
$attr['blockPaddingUnitTablet']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['blockRightPaddingTablet'],
$attr['blockPaddingUnitTablet']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomPaddingTablet'],
$attr['blockPaddingUnitTablet']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['blockLeftPaddingTablet'],
$attr['blockPaddingUnitTablet']
),
),
' .uagb-icon-list__label' => array(
'text-align' => $attr['alignTablet'],
),
);
$m_selectors = array(
' .uagb-icon-list__source-image' => array(
'width' => $m_icon_size,
),
' .uagb-icon-list__label' => array(
'text-align' => $attr['alignMobile'],
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap svg' => array(
'width' => $m_icon_size,
'height' => $m_icon_size,
'font-size' => $m_icon_size,
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__source-wrap' => array_merge(
array(
'border-radius' => UAGB_Helper::get_css_value( $attr['borderRadiusMobile'], $attr['borderRadiusType'] ),
'padding' => UAGB_Helper::get_css_value( $bg_size_mobile_fallback, 'px' ),
'border-style' => ( $mborder_fallback > 0 ) ? 'solid' : '',
'border-width' => UAGB_Helper::get_css_value( $mborder_fallback, $attr['borderType'] ),
'align-self' => $mobile_position,
)
),
' .wp-block-uagb-icon-list-child .uagb-icon-list__label' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeMobile'], $attr['fontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightMobile'], $attr['lineHeightType'] ),
),
' .uagb-icon-list__wrap' => array(
'display' => 'flex',
'flex-direction' => 'row',
'justify-content' => $alignment_mobile,
'-webkit-box-pack' => $alignment_mobile,
'-ms-flex-pack' => $alignment_mobile,
'-webkit-box-align' => 'center',
'-ms-flex-align' => 'center',
'align-items' => 'center',
'margin-top' => UAGB_Helper::get_css_value( $attr['blockTopMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['blockRightMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['blockBottomMarginMobile'], $attr['blockMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['blockLeftMarginMobile'], $attr['blockMarginUnitMobile'] ),
'padding-top' => UAGB_Helper::get_css_value(
$attr['blockTopPaddingMobile'],
$attr['blockPaddingUnitMobile']
),
'padding-right' => UAGB_Helper::get_css_value(
$attr['blockRightPaddingMobile'],
$attr['blockPaddingUnitMobile']
),
'padding-bottom' => UAGB_Helper::get_css_value(
$attr['blockBottomPaddingMobile'],
$attr['blockPaddingUnitMobile']
),
'padding-left' => UAGB_Helper::get_css_value(
$attr['blockLeftPaddingMobile'],
$attr['blockPaddingUnitMobile']
),
),
);
$selectors[' .wp-block-uagb-icon-list-child .uagb-icon-list__label'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSize'], $attr['fontSizeType'] ),
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'line-height' => $attr['lineHeight'] . $attr['lineHeightType'],
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacing'], $attr['labelLetterSpacingType'] ),
'color' => $attr['labelColor'],
);
$m_selectors[' .wp-block-uagb-icon-list-child .uagb-icon-list__label'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeMobile'], $attr['fontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightMobile'], $attr['lineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacingMobile'], $attr['labelLetterSpacingType'] ),
);
$t_selectors[' .wp-block-uagb-icon-list-child .uagb-icon-list__label'] = array(
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeTablet'], $attr['fontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lineHeightTablet'], $attr['lineHeightType'] ),
'letter-spacing' => UAGB_Helper::get_css_value( $attr['labelLetterSpacingTablet'], $attr['labelLetterSpacingType'] ),
);
if ( 'horizontal' === $icon_layout ) {
$selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => UAGB_Helper::get_css_value( ( $attr['gap'] / 2 ), $attr['gapType'] ),
'margin-right' => UAGB_Helper::get_css_value( ( $attr['gap'] / 2 ), $attr['gapType'] ),
'display' => 'inline-flex',
);
$selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child:first-child'] = array(
'margin-left' => 0,
);
$selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child:last-child'] = array(
'margin-right' => 0,
);
} elseif ( 'vertical' === $icon_layout ) {
$selectors[' .uagb-icon-list__wrap']['flex-direction'] = 'column';
$selectors[' .uagb-icon-list__wrap']['align-items'] = $alignment;
$selectors[' .uagb-icon-list__wrap']['-webkit-box-align'] = $alignment;
$selectors[' .uagb-icon-list__wrap']['-ms-flex-align'] = $alignment;
$selectors[' .uagb-icon-list__wrap']['justify-content'] = 'center';
$selectors[' .uagb-icon-list__wrap']['-webkit-box-pack'] = 'center';
$selectors[' .uagb-icon-list__wrap']['-ms-flex-pack'] = 'center';
$selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => 0,
'margin-right' => 0,
'margin-bottom' => UAGB_Helper::get_css_value( $attr['gap'], $attr['gapType'] ),
);
}
if ( 'horizontal' === $icon_layout_tablet ) {
$t_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => UAGB_Helper::get_css_value( ( $tgap_fallback / 2 ), $attr['gapType'] ),
'margin-right' => UAGB_Helper::get_css_value( ( $tgap_fallback / 2 ), $attr['gapType'] ),
'display' => 'inline-flex',
);
$t_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child:first-child'] = array(
'margin-left' => 0,
);
} elseif ( 'vertical' === $icon_layout_tablet ) {
$t_selectors[' .uagb-icon-list__wrap']['flex-direction'] = 'column';
$t_selectors[' .uagb-icon-list__wrap']['align-items'] = $alignment_tablet;
$t_selectors[' .uagb-icon-list__wrap']['-webkit-box-align'] = $alignment_tablet;
$t_selectors[' .uagb-icon-list__wrap']['-ms-flex-align'] = $alignment_tablet;
$t_selectors[' .uagb-icon-list__wrap']['justify-content'] = 'center';
$t_selectors[' .uagb-icon-list__wrap']['-webkit-box-pack'] = 'center';
$t_selectors[' .uagb-icon-list__wrap']['-ms-flex-pack'] = 'center';
$t_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => 0,
'margin-right' => 0,
'margin-bottom' => UAGB_Helper::get_css_value( $tgap_fallback, $attr['gapType'] ),
);
}
if ( 'horizontal' === $icon_layout_mobile ) {
$m_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => UAGB_Helper::get_css_value( ( $mgap_fallback / 2 ), $attr['gapType'] ),
'margin-right' => UAGB_Helper::get_css_value( ( $mgap_fallback / 2 ), $attr['gapType'] ),
'display' => 'inline-flex',
);
$m_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child:first-child'] = array(
'margin-left' => 0,
);
} elseif ( 'vertical' === $icon_layout_mobile ) {
$m_selectors[' .uagb-icon-list__wrap']['flex-direction'] = 'column';
$m_selectors[' .uagb-icon-list__wrap']['align-items'] = $alignment_mobile;
$m_selectors[' .uagb-icon-list__wrap']['-webkit-box-align'] = $alignment_mobile;
$m_selectors[' .uagb-icon-list__wrap']['-ms-flex-align'] = $alignment_mobile;
$m_selectors[' .uagb-icon-list__wrap']['justify-content'] = 'center';
$m_selectors[' .uagb-icon-list__wrap']['-webkit-box-pack'] = 'center';
$m_selectors[' .uagb-icon-list__wrap']['-ms-flex-pack'] = 'center';
$m_selectors['.wp-block-uagb-icon-list .wp-block-uagb-icon-list-child'] = array(
'margin-left' => 0,
'margin-right' => 0,
'margin-bottom' => UAGB_Helper::get_css_value( $mgap_fallback, $attr['gapType'] ),
);
}
if ( ! $attr['childMigrate'] ) {
$defaults = UAGB_DIR . 'includes/blocks/icon-list-child/attributes.php';
if ( file_exists( $defaults ) ) {
$default_attr = include $defaults;
}
$default_attr = ( ! empty( $default_attr ) && is_array( $default_attr ) ) ? $default_attr : array();
foreach ( $attr['icons'] as $key => $icon ) {
$wrapper = ( ! $attr['childMigrate'] ) ? ' .uagb-icon-list__repeater-' . $key . '.wp-block-uagb-icon-list-child' : ' .wp-block-uagb-icon-list-child';
$selectors[ $wrapper ] = array(
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['fontSize'], $attr['sizeType'] ),
'line-height' => $attr['lineHeight'] . $attr['lineHeightType'],
);
$m_selectors_child[ $wrapper . ' .uagb-icon-list__label' ] = array(
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeMobile'], $attr['sizeType'] ),
'line-height' => $attr['lineHeightMobile'] . $attr['lineHeightType'],
);
$t_selectors_child[ $wrapper . ' .uagb-icon-list__label' ] = array(
'font-family' => $attr['fontFamily'],
'text-transform' => $attr['fontTransform'],
'text-decoration' => $attr['fontDecoration'] . '!important',
'font-style' => $attr['fontStyle'],
'font-weight' => $attr['fontWeight'],
'font-size' => UAGB_Helper::get_css_value( $attr['fontSizeTablet'], $attr['sizeType'] ),
'line-height' => $attr['lineHeightTablet'] . $attr['lineHeightType'],
);
if ( $attr['icon_count'] <= $key ) {
break;
}
$icon = array_merge( $default_attr, (array) $icon );
$child_selectors = UAGB_Block_Helper::get_icon_list_child_selectors( $icon, $key, $attr['childMigrate'] );
$selectors = array_merge( $selectors, (array) $child_selectors );
$t_selectors = array_merge( $t_selectors, (array) $t_selectors_child );
$m_selectors = array_merge( $m_selectors, (array) $m_selectors_child );
}
}
if ( 'right' === $attr['align'] && $attr['hideLabel'] ) {
$selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => '0px',
);
$m_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => '0px',
);
$t_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => '0px',
);
} else {
if ( 'before' === $attr['iconPlacement'] && ! $attr['hideLabel'] ) {
$selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => UAGB_Helper::get_css_value( $attr['inner_gap'], $attr['innerGapType'] ),
);
$m_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => UAGB_Helper::get_css_value( $attr['innerGapMobile'], $attr['innerGapType'] ),
);
$t_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-right' => UAGB_Helper::get_css_value( $attr['innerGapTablet'], $attr['innerGapType'] ),
);
} elseif ( 'after' === $attr['iconPlacement'] && ! $attr['hideLabel'] ) {
$selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['inner_gap'], $attr['innerGapType'] ),
);
$m_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['innerGapMobile'], $attr['innerGapType'] ),
);
$t_selectors[' .uagb-icon-list__source-wrap'] = array(
'margin-left' => UAGB_Helper::get_css_value( $attr['innerGapTablet'], $attr['innerGapType'] ),
);
$selectors[' .wp-block-uagb-icon-list-child '] = array(
'flex-direction' => 'row-reverse',
);
}
if ( 'center' === $attr['align'] ) {
$selectors[' .wp-block-uagb-icon-list-child'] = array(
'text-align' => 'center',
);
}
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = ( $attr['classMigrate'] ) ? '.wp-block-uagb-icon-list.uagb-block-' : '#uagb-icon-list-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,101 @@
<?php
/**
* Attributes File.
*
* @since 2.4.0
*
* @package uagb
*/
$icon_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'icon' );
return array_merge(
$icon_border_attribute,
array(
// Size.
'icon' => '',
'iconSize' => 40,
'iconSizeTablet' => '',
'iconSizeMobile' => '',
'iconSizeUnit' => 'px',
// Alignment.
'align' => 'center',
'alignTablet' => '',
'alignMobile' => '',
// Rotation.
'rotation' => 0,
'rotationUnit' => 'deg',
// StyleSettings.
'iconView' => 'none',
'iconBorderWidth' => 3,
// Color.
'iconColor' => '#333',
'iconBorderColor' => '',
'iconBackgroundColorType' => 'classic',
'iconBackgroundColor' => '',
'iconBackgroundGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)',
'iconHoverColor' => '',
'iconHoverBorderColor' => '',
'iconHoverBackgroundColorType' => 'classic',
'iconHoverBackgroundColor' => '',
'iconHoverBackgroundGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)',
// Padding.
'iconTopPadding' => 5,
'iconRightPadding' => 5,
'iconBottomPadding' => 5,
'iconLeftPadding' => 5,
'iconTopTabletPadding' => '',
'iconRightTabletPadding' => '',
'iconBottomTabletPadding' => '',
'iconLeftTabletPadding' => '',
'iconTopMobilePadding' => '',
'iconRightMobilePadding' => '',
'iconBottomMobilePadding' => '',
'iconLeftMobilePadding' => '',
'iconPaddingUnit' => 'px',
'iconMobilePaddingUnit' => 'px',
'iconTabletPaddingUnit' => 'px',
// Margin.
'iconTopMargin' => '',
'iconRightMargin' => '',
'iconBottomMargin' => '',
'iconLeftMargin' => '',
'iconTopTabletMargin' => '',
'iconRightTabletMargin' => '',
'iconBottomTabletMargin' => '',
'iconLeftTabletMargin' => '',
'iconTopMobileMargin' => '',
'iconRightMobileMargin' => '',
'iconBottomMobileMargin' => '',
'iconLeftMobileMargin' => '',
'iconMarginUnit' => 'px',
'iconMobileMarginUnit' => 'px',
'iconTabletMarginUnit' => 'px',
// Shadow.
'iconShadowColor' => '#00000070',
'iconShadowHOffset' => 0,
'iconShadowVOffset' => 0,
'iconShadowBlur' => 0,
// Box Shadow.
'useSeparateBoxShadows' => true,
'iconBoxShadowColor' => '#00000070',
'iconBoxShadowHOffset' => 0,
'iconBoxShadowVOffset' => 0,
'iconBoxShadowBlur' => '',
'iconBoxShadowSpread' => '',
'iconBoxShadowPosition' => '',
'iconBoxShadowColorHover' => '',
'iconBoxShadowHOffsetHover' => 0,
'iconBoxShadowVOffsetHover' => 0,
'iconBoxShadowBlurHover' => '',
'iconBoxShadowSpreadHover' => '',
'iconBoxShadowPositionHover' => '',
// Border.
'iconBorderStyle' => 'default',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
'iconAccessabilityMode' => '',
'iconAccessabilityDesc' => '',
)
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information.
*
* @since 2.4.0
*
* @package uagb
*/
$block_slug = 'uagb/icon';
$block_data = array(
'doc' => 'icon',
'slug' => '',
'admin_categories' => array( 'core' ),
'link' => 'icon',
'title' => __( 'Icon', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add stunning customizable icons to your website.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'icon' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'icon',
),
);

View File

@@ -0,0 +1,188 @@
<?php
/**
* Frontend CSS.
*
* @since 2.4.0
* @var mixed[] $attr
*
* @package uagb
*/
$icon_width = UAGB_Helper::get_css_value(
$attr['iconSize'],
is_string( $attr['iconSizeUnit'] ) ? $attr['iconSizeUnit'] : ''
);
$transformation = UAGB_Helper::get_css_value(
$attr['rotation'],
is_string( $attr['rotationUnit'] ) ? $attr['rotationUnit'] : ''
);
$background = 'classic' === $attr['iconBackgroundColorType'] ? $attr['iconBackgroundColor'] : $attr['iconBackgroundGradientColor'];
$hover_background = 'classic' === $attr['iconHoverBackgroundColorType'] ? $attr['iconHoverBackgroundColor'] : $attr['iconHoverBackgroundGradientColor'];
$drop_shadow_properties = array(
'horizontal' => $attr['iconShadowHOffset'],
'vertical' => $attr['iconShadowVOffset'],
'blur' => $attr['iconShadowBlur'],
'color' => $attr['iconShadowColor'],
);
$drop_shadow = UAGB_Block_Helper::generate_shadow_css( $drop_shadow_properties );
$box_shadow_properties = array(
'horizontal' => $attr['iconBoxShadowHOffset'],
'vertical' => $attr['iconBoxShadowVOffset'],
'blur' => $attr['iconBoxShadowBlur'],
'spread' => $attr['iconBoxShadowSpread'],
'color' => $attr['iconBoxShadowColor'],
'position' => $attr['iconBoxShadowPosition'],
);
$box_shadow_hover_properties = array(
'horizontal' => $attr['iconBoxShadowHOffsetHover'],
'vertical' => $attr['iconBoxShadowVOffsetHover'],
'blur' => $attr['iconBoxShadowBlurHover'],
'spread' => $attr['iconBoxShadowSpreadHover'],
'color' => $attr['iconBoxShadowColorHover'],
'position' => $attr['iconBoxShadowPositionHover'],
'alt_color' => $attr['iconBoxShadowColor'],
);
$box_shadow = UAGB_Block_Helper::generate_shadow_css( $box_shadow_properties );
$box_shadow_hover_css = UAGB_Block_Helper::generate_shadow_css( $box_shadow_hover_properties );
$t_selectors = array();
$m_selectors = array();
$selectors['.uagb-icon-wrapper'] = array(
'text-align' => $attr['align'],
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper a'] = array(
'display' => 'contents',
);
$selectors['.uagb-icon-wrapper svg'] = array(
'width' => $icon_width,
'height' => $icon_width,
'transform' => "rotate($transformation)",
'box-sizing' => 'content-box',
'fill' => $attr['iconColor'],
'filter' => $drop_shadow ? "drop-shadow( $drop_shadow )" : '',
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:hover svg'] = array(
'fill' => $attr['iconHoverColor'],
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:focus-visible svg'] = array(
'fill' => $attr['iconHoverColor'],
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper'] = array_merge(
array(
'display' => 'inline-flex',
'background' => $background,
// padding.
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopPadding'], $attr['iconPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightPadding'], $attr['iconPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomPadding'], $attr['iconPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftPadding'], $attr['iconPaddingUnit'] ),
// border.
'border-style' => $attr['iconBorderStyle'],
'border-color' => $attr['iconBorderColor'],
'box-shadow' => $box_shadow,
),
UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon' )
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:hover'] = array(
'border-color' => $attr['iconBorderHColor'],
'background' => $hover_background,
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:focus-visible'] = array(
'border-color' => $attr['iconBorderHColor'],
'background' => $hover_background,
);
$selectors['.uagb-icon-wrapper.wp-block-uagb-icon--has-margin .uagb-icon-margin-wrapper'] = array(
// margin.
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopMargin'], $attr['iconMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightMargin'], $attr['iconMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMargin'], $attr['iconMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftMargin'], $attr['iconMarginUnit'] ),
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:hover'] = array(
'border-color' => $attr['iconBorderHColor'],
'background' => $hover_background,
);
// If using separate box shadow hover settings, then generate CSS for it.
if ( $attr['useSeparateBoxShadows'] ) {
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:hover'] = array(
'box-shadow' => $box_shadow_hover_css,
'border-color' => $attr['iconBorderHColor'],
'background' => $hover_background,
);
$selectors['.uagb-icon-wrapper .uagb-svg-wrapper:focus-visible'] = array(
'box-shadow' => $box_shadow_hover_css,
'border-color' => $attr['iconBorderHColor'],
'background' => $hover_background,
);
};
// Generates css for tablet devices.
$t_icon_width = UAGB_Helper::get_css_value( $attr['iconSizeTablet'], $attr['iconSizeUnit'] );
$t_selectors['.uagb-icon-wrapper'] = array(
'text-align' => $attr['alignTablet'],
);
$t_selectors['.uagb-icon-wrapper svg'] = array(
'width' => $t_icon_width,
'height' => $t_icon_width,
);
$t_selectors['.uagb-icon-wrapper .uagb-svg-wrapper'] = array_merge(
array(
'display' => 'inline-flex',
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopTabletPadding'], $attr['iconTabletPaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightTabletPadding'], $attr['iconTabletPaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomTabletPadding'], $attr['iconTabletPaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftTabletPadding'], $attr['iconTabletPaddingUnit'] ),
),
UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon', 'tablet' )
);
$t_selectors['.uagb-icon-wrapper.wp-block-uagb-icon--has-margin .uagb-icon-margin-wrapper'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopTabletMargin'], $attr['iconTabletMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightTabletMargin'], $attr['iconTabletMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomTabletMargin'], $attr['iconTabletMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftTabletMargin'], $attr['iconTabletMarginUnit'] ),
);
// Generates css for mobile devices.
$m_icon_width = UAGB_Helper::get_css_value( $attr['iconSizeMobile'], $attr['iconSizeUnit'] );
$m_selectors['.uagb-icon-wrapper'] = array(
'text-align' => $attr['alignMobile'],
);
$m_selectors['.uagb-icon-wrapper svg'] = array(
'width' => $m_icon_width,
'height' => $m_icon_width,
);
$m_selectors['.uagb-icon-wrapper .uagb-svg-wrapper'] = array_merge(
array(
'display' => 'inline-flex',
'padding-top' => UAGB_Helper::get_css_value( $attr['iconTopMobilePadding'], $attr['iconMobilePaddingUnit'] ),
'padding-right' => UAGB_Helper::get_css_value( $attr['iconRightMobilePadding'], $attr['iconMobilePaddingUnit'] ),
'padding-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMobilePadding'], $attr['iconMobilePaddingUnit'] ),
'padding-left' => UAGB_Helper::get_css_value( $attr['iconLeftMobilePadding'], $attr['iconMobilePaddingUnit'] ),
),
UAGB_Block_Helper::uag_generate_border_css( $attr, 'icon', 'mobile' )
);
$m_selectors['.uagb-icon-wrapper.wp-block-uagb-icon--has-margin .uagb-icon-margin-wrapper'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['iconTopMobileMargin'], $attr['iconMobileMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['iconRightMobileMargin'], $attr['iconMobileMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['iconBottomMobileMargin'], $attr['iconMobileMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['iconLeftMobileMargin'], $attr['iconMobileMarginUnit'] ),
);
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
return UAGB_Helper::generate_all_css(
$combined_selectors,
' .uagb-block-' . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,22 @@
<?php
/**
* Frontend JS File.
*
* @since 2.15.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var string $id
*/
$block_name = 'icon';
$selector = '.uagb-block-' . $id;
$js = '';
$js .= Spectra_Icon::render_icon_click( $id );
return $js;

View File

@@ -0,0 +1,272 @@
<?php
/**
* Attributes File.
*
* @since 2.1.0
*
* @package uagb
*/
$arrow_border_attributes = UAGB_Block_Helper::uag_generate_border_attribute(
'arrow',
array(
'borderStyle' => 'none',
'borderTopWidth' => 4,
'borderRightWidth' => 4,
'borderBottomWidth' => 4,
'borderLeftWidth' => 4,
'borderTopLeftRadius' => 50,
'borderTopRightRadius' => 50,
'borderBottomLeftRadius' => 50,
'borderBottomRightRadius' => 50,
)
);
$btn_border_attributes = UAGB_Block_Helper::uag_generate_border_attribute( 'btn' );
$image_border_attributes = UAGB_Block_Helper::uag_generate_border_attribute( 'image' );
$main_title_border_attributes = UAGB_Block_Helper::uag_generate_border_attribute(
'mainTitle',
array(
'borderTopWidth' => 2,
'borderRightWidth' => 0,
'borderBottomWidth' => 2,
'borderLeftWidth' => 0,
)
);
return array_merge(
array(
// Block Requirements.
'block_id' => '',
'classMigrate' => false,
// Editor Requirements.
'readyToRender' => false,
'tileSize' => 0,
'focusList' => array(),
'focusListObject' => array(),
// Gallery Settings.
'mediaGallery' => array(),
'mediaIDs' => array(),
'feedLayout' => 'grid',
'imageDisplayCaption' => true,
'galleryImageSize' => 'large',
'galleryImageSizeTablet' => 'large',
'galleryImageSizeMobile' => 'medium',
'imageClickEvent' => 'none',
'disableLazyLoad' => false,
// Lightbox Settings.
'lightboxDisplayCaptions' => false,
'lightboxThumbnails' => false,
'lightboxDisplayCount' => false,
'lightboxCloseIcon' => 'xmark',
'lightboxCaptionHeight' => 50,
'lightboxCaptionHeightTablet' => '',
'lightboxCaptionHeightMobile' => '',
'lightboxIconSize' => 24,
'lightboxIconSizeTablet' => '',
'lightboxIconSizeMobile' => '',
// Caption Settings.
'captionVisibility' => 'hover',
'captionDisplayType' => 'overlay',
'imageCaptionAlignment' => 'center center',
'imageCaptionAlignment01' => 'center',
'imageCaptionAlignment02' => 'center',
'imageDefaultCaption' => __( 'No Caption', 'ultimate-addons-for-gutenberg' ),
'captionPaddingTop' => 8,
'captionPaddingRight' => 8,
'captionPaddingBottom' => 8,
'captionPaddingLeft' => 8,
'captionPaddingTopTab' => 8,
'captionPaddingRightTab' => 8,
'captionPaddingBottomTab' => 8,
'captionPaddingLeftTab' => 8,
'captionPaddingTopMob' => 8,
'captionPaddingRightMob' => 8,
'captionPaddingBottomMob' => 8,
'captionPaddingLeftMob' => 8,
'captionPaddingUnit' => 'px',
'captionPaddingUnitTab' => 'px',
'captionPaddingUnitMob' => 'px',
'captionPaddingUnitLink' => true,
'captionGap' => 0,
'captionGapUnit' => 'px',
// Layout Settings.
'columnsDesk' => 3,
'columnsTab' => 3,
'columnsMob' => 2,
'gridImageGap' => 8,
'gridImageGapTab' => '',
'gridImageGapMob' => '',
'gridImageGapUnit' => 'px',
'gridImageGapUnitTab' => 'px',
'gridImageGapUnitMob' => 'px',
'feedMarginTop' => '',
'feedMarginRight' => '',
'feedMarginBottom' => '',
'feedMarginLeft' => '',
'feedMarginTopTab' => '',
'feedMarginRightTab' => '',
'feedMarginBottomTab' => '',
'feedMarginLeftTab' => '',
'feedMarginTopMob' => '',
'feedMarginRightMob' => '',
'feedMarginBottomMob' => '',
'feedMarginLeftMob' => '',
'feedMarginUnit' => 'px',
'feedMarginUnitTab' => 'px',
'feedMarginUnitMob' => 'px',
'feedMarginUnitLink' => true,
// Layout Specific Settings.
'carouselStartAt' => 0,
'carouselSquares' => false,
'carouselLoop' => true,
'carouselAutoplay' => true,
'carouselAutoplaySpeed' => 2000,
'carouselPauseOnHover' => true,
'carouselTransitionSpeed' => 500,
'gridPages' => 1,
'gridPageNumber' => 1,
// Pagination Settings.
'feedPagination' => false,
'paginateUseArrows' => true,
'paginateUseDots' => true,
'paginateUseLoader' => true,
'paginateLimit' => 9,
'paginateButtonAlign' => 'center',
'paginateButtonText' => __( 'Load More Images', 'ultimate-addons-for-gutenberg' ),
'paginateButtonPaddingTop' => '',
'paginateButtonPaddingRight' => '',
'paginateButtonPaddingBottom' => '',
'paginateButtonPaddingLeft' => '',
'paginateButtonPaddingTopTab' => '',
'paginateButtonPaddingRightTab' => '',
'paginateButtonPaddingBottomTab' => '',
'paginateButtonPaddingLeftTab' => '',
'paginateButtonPaddingTopMob' => '',
'paginateButtonPaddingRightMob' => '',
'paginateButtonPaddingBottomMob' => '',
'paginateButtonPaddingLeftMob' => '',
'paginateButtonPaddingUnit' => 'px',
'paginateButtonPaddingUnitTab' => 'px',
'paginateButtonPaddingUnitMob' => 'px',
'paginateButtonPaddingUnitLink' => true,
// Image Styling.
'imageEnableZoom' => true,
'imageZoomType' => 'zoom-in',
'captionBackgroundEnableBlur' => false,
'captionBackgroundBlurAmount' => 0,
'captionBackgroundBlurAmountHover' => 5,
// Lightbox Styling.
'lightboxEdgeDistance' => 10,
'lightboxEdgeDistanceTablet' => '',
'lightboxEdgeDistanceMobile' => '',
'lightboxBackgroundEnableBlur' => true,
'lightboxBackgroundBlurAmount' => 5,
'lightboxBackgroundColor' => 'rgba(0,0,0,0.75)',
'lightboxIconColor' => 'rgba(255,255,255,1)',
'lightboxCaptionColor' => 'rgba(255,255,255,1)',
'lightboxCaptionBackgroundColor' => 'rgba(0,0,0,1)',
// Caption Typography Styling.
'captionLoadGoogleFonts' => false,
'captionFontFamily' => 'Default',
'captionFontWeight' => '',
'captionFontStyle' => 'normal',
'captionTransform' => '',
'captionDecoration' => 'none',
'captionFontSizeType' => 'px',
'captionFontSize' => '',
'captionFontSizeTab' => '',
'captionFontSizeMob' => '',
'captionLineHeightType' => 'em',
'captionLineHeight' => '',
'captionLineHeightTab' => '',
'captionLineHeightMob' => '',
// Pagination Button Typography Styling.
'loadMoreLoadGoogleFonts' => false,
'loadMoreFontFamily' => 'Default',
'loadMoreFontWeight' => '',
'loadMoreFontStyle' => 'normal',
'loadMoreTransform' => '',
'loadMoreDecoration' => 'none',
'loadMoreFontSizeType' => 'px',
'loadMoreFontSize' => '',
'loadMoreFontSizeTab' => '',
'loadMoreFontSizeMob' => '',
'loadMoreLineHeightType' => 'em',
'loadMoreLineHeight' => '',
'loadMoreLineHeightTab' => '',
'loadMoreLineHeightMob' => '',
// Lightbox Typography Styling.
'lightboxLoadGoogleFonts' => false,
'lightboxFontFamily' => 'Default',
'lightboxFontWeight' => '',
'lightboxFontStyle' => 'normal',
'lightboxTransform' => '',
'lightboxDecoration' => 'none',
'lightboxFontSizeType' => 'px',
'lightboxFontSize' => '',
'lightboxFontSizeTab' => '',
'lightboxFontSizeMob' => '',
'lightboxLineHeightType' => 'em',
'lightboxLineHeight' => '',
'lightboxLineHeightTab' => '',
'lightboxLineHeightMob' => '',
// Hoverable Styling.
'captionBackgroundEffect' => 'none',
'captionBackgroundEffectHover' => 'none',
'captionBackgroundEffectAmount' => 100,
'captionBackgroundEffectAmountHover' => 0,
'captionColor' => 'rgba(255,255,255,1)',
'captionColorHover' => 'rgba(255,255,255,1)',
'captionBackgroundColor' => 'rgba(0,0,0,0.75)',
'captionBackgroundColorHover' => 'rgba(0,0,0,0.75)',
'overlayColor' => 'rgba(0,0,0,0)',
'overlayColorHover' => 'rgba(0,0,0,0)',
'captionSeparateColors' => false,
// Pagination Styling.
'paginateArrowDistance' => -24,
'paginateArrowDistanceUnit' => 'px',
'paginateArrowSize' => 24,
'paginateDotDistance' => 8,
'paginateDotDistanceUnit' => 'px',
'paginateLoaderSize' => 18,
'paginateButtonTextColor' => '',
'paginateButtonTextColorHover' => '',
'paginateColor' => '',
'paginateColorHover' => '',
// Box Shadow Styling.
'imageBoxShadowColor' => '',
'imageBoxShadowHOffset' => 0,
'imageBoxShadowVOffset' => 0,
'imageBoxShadowBlur' => '',
'imageBoxShadowSpread' => '',
'imageBoxShadowPosition' => 'outset',
'imageBoxShadowColorHover' => '',
'imageBoxShadowHOffsetHover' => 0,
'imageBoxShadowVOffsetHover' => 0,
'imageBoxShadowBlurHover' => '',
'imageBoxShadowSpreadHover' => '',
'imageBoxShadowPositionHover' => 'outset',
),
$arrow_border_attributes,
$btn_border_attributes,
$image_border_attributes,
$main_title_border_attributes,
array(
'arrowBorderStyle' => 'none',
'arrowBorderTopWidth' => 4,
'arrowBorderRightWidth' => 4,
'arrowBorderBottomWidth' => 4,
'arrowBorderLeftWidth' => 4,
'arrowBorderTopLeftRadius' => 50,
'arrowBorderTopRightRadius' => 50,
'arrowBorderBottomLeftRadius' => 50,
'arrowBorderBottomRightRadius' => 50,
),
array(
'mainTitleBorderTopWidth' => 2,
'mainTitleBorderRightWidth' => 0,
'mainTitleBorderBottomWidth' => 2,
'mainTitleBorderLeftWidth' => 0,
)
);

View File

@@ -0,0 +1,49 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.1.0
*
* @package uagb
*/
$block_slug = 'uagb/image-gallery';
$block_data = array(
'doc' => 'image-gallery',
'slug' => '',
'admin_categories' => array( 'content', 'creative' ),
'link' => 'image-gallery-legacy',
'title' => __( 'Image Gallery', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Create a highly customizable image gallery', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'image-gallery' ),
'static_dependencies' => array(
'uagb-image-gallery-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'image-gallery' ),
'dep' => array(),
'type' => 'js',
),
'uagb-masonry' => array(
'type' => 'js',
),
'uagb-imagesloaded' => array(
'type' => 'js',
),
'uagb-slick-js' => array(
'type' => 'js',
),
'uagb-swiper-js' => array(
'type' => 'js',
),
'uagb-slick-css' => array(
'type' => 'css',
),
'uagb-swiper-css' => array(
'type' => 'css',
),
),
'dynamic_assets' => array(
'dir' => 'image-gallery',
),
);

View File

@@ -0,0 +1,851 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.1.0
*
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var mixed[] $attr
*/
$attr = isset( $attr ) ? $attr : array();
// Adds Fonts.
UAGB_Block_JS::blocks_image_gallery_gfont( $attr );
// Arrow & Dots Default Color Fallback ( Not from Theme ).
$arrow_dot_color = $attr['paginateColor'] ? $attr['paginateColor'] : '#007cba';
// Block Visibility Based on Layout Type.
$hide_this_block = in_array( $attr['feedLayout'], array( 'carousel', 'masonry' ), true );
// Range Fallback.
$paginate_dot_distance_fallback = is_numeric( $attr['paginateDotDistance'] ) ? $attr['paginateDotDistance'] : 0;
// Responsive Slider Fallback.
$grid_image_gap_tablet_fallback = is_numeric( $attr['gridImageGapTab'] ) ? $attr['gridImageGapTab'] : $attr['gridImageGap'];
$grid_image_gap_mobile_fallback = is_numeric( $attr['gridImageGapMob'] ) ? $attr['gridImageGapMob'] : $grid_image_gap_tablet_fallback;
// Border Attributes.
$arrow_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'arrow' );
$arrow_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'arrow', 'tablet' );
$arrow_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'arrow', 'mobile' );
$btn_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn' );
$btn_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'tablet' );
$btn_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'btn', 'mobile' );
$image_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image' );
$image_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image', 'tablet' );
$image_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image', 'mobile' );
$main_title_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'mainTitle' );
$main_title_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'mainTitle', 'tablet' );
$main_title_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'mainTitle', 'mobile' );
// Text Decoration compatibility CSS.
$text_decoration_prop = '' === $attr['captionDecoration'] && defined( 'ASTRA_THEME_SETTINGS' ) && function_exists( 'astra_get_font_extras' ) && function_exists( 'astra_get_option' ) ? astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'text-decoration' ) : $attr['captionDecoration'];
// Box Shadow CSS.
$image_box_shadow_css = (
UAGB_Helper::get_css_value( $attr['imageBoxShadowHOffset'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowVOffset'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowBlur'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowSpread'], 'px' )
) . (
$attr['imageBoxShadowColor'] ? ( ' ' . $attr['imageBoxShadowColor'] ) : ''
) . ' ' . (
( 'inset' === $attr['imageBoxShadowPosition'] ) ? ( ' ' . $attr['imageBoxShadowPosition'] ) : ''
);
$image_box_shadow_hover_css = (
UAGB_Helper::get_css_value( $attr['imageBoxShadowHOffsetHover'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowVOffsetHover'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowBlurHover'], 'px' )
) . ' ' . (
UAGB_Helper::get_css_value( $attr['imageBoxShadowSpreadHover'], 'px' )
) . (
$attr['imageBoxShadowColorHover'] ? ( ' ' . $attr['imageBoxShadowColorHover'] ) : ''
) . ' ' . (
( 'inset' === $attr['imageBoxShadowPositionHover'] ) ? ( ' ' . $attr['imageBoxShadowPositionHover'] ) : ''
);
$selectors = array(
// Feed Selectors.
'.wp-block-uagb-image-gallery' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['feedMarginUnit'],
$attr['feedMarginTop'],
$attr['feedMarginRight'],
$attr['feedMarginBottom'],
$attr['feedMarginLeft']
),
'visibility' => $hide_this_block ? 'hidden' : '',
),
// Control Settings.
' .spectra-image-gallery__control-arrows svg' => array(
'fill' => $arrow_dot_color,
),
' .spectra-image-gallery__control-arrows svg:hover' => array(
'fill' => $attr['paginateColorHover'],
),
' .spectra-image-gallery__control-arrows--carousel' => $arrow_border_css,
' .spectra-image-gallery__control-arrows--carousel:hover' => array(
'border-color' => $attr['arrowBorderHColor'],
),
' .spectra-image-gallery__control-arrows--carousel.slick-prev' => array(
'left' => UAGB_Helper::get_css_value(
$attr['paginateArrowDistance'],
$attr['paginateArrowDistanceUnit']
),
),
' .spectra-image-gallery__control-arrows--carousel.slick-next' => array(
'right' => UAGB_Helper::get_css_value(
$attr['paginateArrowDistance'],
$attr['paginateArrowDistanceUnit']
),
),
' .spectra-image-gallery__layout--carousel ul.slick-dots' => array(
'top' => UAGB_Helper::get_css_value( $paginate_dot_distance_fallback, 'px' ),
),
' .spectra-image-gallery__layout--carousel ul.slick-dots li button:before' => array(
'color' => $arrow_dot_color,
),
' .spectra-image-gallery__layout--carousel ul.slick-dots li button:hover:before' => array(
'color' => $attr['paginateColorHover'],
),
' .spectra-image-gallery__control-dots li button::before' => array(
'color' => $arrow_dot_color,
),
' .spectra-image-gallery__control-dots li button:hover::before' => array(
'color' => $attr['paginateColorHover'],
),
' .spectra-image-gallery__control-loader' => array(
'margin-top' => UAGB_Helper::get_css_value( $paginate_dot_distance_fallback, $attr['paginateDotDistanceUnit'] ),
),
' .spectra-image-gallery__control-loader div' => array(
'background-color' => $attr['paginateColor'],
'width' => UAGB_Helper::get_css_value( $attr['paginateLoaderSize'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['paginateLoaderSize'], 'px' ),
'border-radius' => '100%',
'padding' => 0,
),
' .spectra-image-gallery__control-button' => array_merge(
array(
'margin-top' => UAGB_Helper::get_css_value( $paginate_dot_distance_fallback, $attr['paginateDotDistanceUnit'] ),
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['paginateButtonPaddingUnit'],
$attr['paginateButtonPaddingTop'],
$attr['paginateButtonPaddingRight'],
$attr['paginateButtonPaddingBottom'],
$attr['paginateButtonPaddingLeft']
),
'color' => $attr['paginateButtonTextColor'],
'background-color' => $attr['paginateColor'],
'font-family' => 'Default' === $attr['loadMoreFontFamily'] ? '' : $attr['loadMoreFontFamily'],
'font-weight' => $attr['loadMoreFontWeight'],
'font-style' => $attr['loadMoreFontStyle'],
'text-decoration' => $attr['loadMoreDecoration'],
'text-transform' => $attr['loadMoreTransform'],
'font-size' => UAGB_Helper::get_css_value( $attr['loadMoreFontSize'], $attr['loadMoreFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['loadMoreLineHeight'], $attr['loadMoreLineHeightType'] ),
),
$btn_border_css
),
' .spectra-image-gallery__control-button:hover' => array(
'color' => $attr['paginateButtonTextColorHover'],
'background-color' => $attr['paginateColorHover'],
'border-color' => $attr['btnBorderHColor'],
),
// Media Wrapper Selectors.
' .spectra-image-gallery__layout--grid' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$attr['gridImageGap'],
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__layout--isogrid' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $attr['gridImageGap'] / 2 ),
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__layout--isogrid .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$attr['gridImageGap'] / 2,
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__layout--masonry' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $attr['gridImageGap'] / 2 ),
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__layout--masonry .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$attr['gridImageGap'] / 2,
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__layout--carousel' => array(
// Override Slick Slider Margin.
'margin-bottom' => UAGB_Helper::get_css_value(
$paginate_dot_distance_fallback,
'px'
) . ' !important',
),
' .spectra-image-gallery__layout--carousel .spectra-image-gallery__media-wrapper' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnit'],
0,
$attr['gridImageGap'] / 2
),
),
' .spectra-image-gallery__layout--carousel .slick-list' => array(
'margin' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnit'],
0,
-( $attr['gridImageGap'] / 2 )
),
),
' .spectra-image-gallery__layout--tiled' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$attr['gridImageGap'],
$attr['gridImageGapUnit']
),
),
' .spectra-image-gallery__media' => array_merge(
$image_border_css,
array(
'box-shadow' => $image_box_shadow_css,
)
),
' .spectra-image-gallery__media:hover' => array(
'border-color' => $attr['imageBorderHColor'],
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media' => array(
'box-shadow' => $image_box_shadow_hover_css,
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media' => array(
'box-shadow' => $image_box_shadow_hover_css,
'border-color' => $attr['imageBorderHColor'],
),
// Thumbnail Selectors.
' .spectra-image-gallery__media-thumbnail-blurrer' => array(
'-webkit-backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmount'],
'px'
) . ')',
'backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmount'],
'px'
) . ')',
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-blurrer' => array(
'-webkit-backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmountHover'],
'px'
) . ')',
'backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmountHover'],
'px'
) . ')',
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-blurrer' => array(
'-webkit-backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmountHover'],
'px'
) . ')',
'backdrop-filter' => 'blur(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundBlurAmountHover'],
'px'
) . ')',
),
// Caption Wrapper Selectors.
' .spectra-image-gallery__media-thumbnail-caption-wrapper--overlay' => array(
'background-color' => $attr['imageDisplayCaption'] ? ( ( 'hover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : $attr['captionBackgroundColor'] ) : $attr['overlayColor'],
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-caption-wrapper--overlay' => array(
'background-color' => $attr['imageDisplayCaption'] ? ( ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'] ) ) : $attr['overlayColorHover'],
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-caption-wrapper--overlay' => array(
'background-color' => $attr['imageDisplayCaption'] ? ( ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'] ) ) : $attr['overlayColorHover'],
),
' .spectra-image-gallery__media-thumbnail-caption-wrapper--bar-inside' => array(
'-webkit-align-items' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 1, 'flex' ),
'align-items' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 1, 'flex' ),
'-webkit-justify-content' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 2, 'flex' ),
'justify-content' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 2, 'flex' ),
),
// Caption Selectors.
' .spectra-image-gallery__media-thumbnail-caption a' => array(
'color' => ( 'hover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : $attr['captionColor'],
),
' .spectra-image-gallery__media-thumbnail-caption' => array(
'color' => ( 'hover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : $attr['captionColor'],
'text-align' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 2 ),
'font-family' => 'Default' === $attr['captionFontFamily'] ? '' : $attr['captionFontFamily'],
'font-weight' => $attr['captionFontWeight'],
'font-style' => $attr['captionFontStyle'],
'text-decoration' => $text_decoration_prop,
'text-transform' => $attr['captionTransform'],
'font-size' => UAGB_Helper::get_css_value( $attr['captionFontSize'], $attr['captionFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['captionLineHeight'], $attr['captionLineHeightType'] ),
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['captionPaddingUnit'],
$attr['captionPaddingTop'],
$attr['captionPaddingRight'],
$attr['captionPaddingBottom'],
$attr['captionPaddingLeft']
),
),
' .spectra-image-gallery__media-thumbnail-caption--overlay' => array(
'-webkit-align-items' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 1, 'flex' ),
'align-items' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 1, 'flex' ),
'-webkit-justify-content' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 2, 'flex' ),
'justify-content' => UAGB_Block_Helper::get_matrix_alignment( $attr['imageCaptionAlignment'], 2, 'flex' ),
),
' .spectra-image-gallery__media-thumbnail-caption--bar-inside' => array_merge(
array(
'background-color' => ( 'hover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : $attr['captionBackgroundColor'],
),
$main_title_border_css,
array(
'border-color' => ( 'hover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : $attr['mainTitleBorderColor'],
)
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-caption--bar-inside' => array(
'background-color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'] ),
'border-color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'antiHover' !== $attr['captionVisibility'] ) ? $attr['mainTitleBorderHColor'] : $attr['mainTitleBorderColor'] ),
),
'spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-caption--bar-inside' => array(
'background-color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'] ),
'border-color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' !== $attr['captionVisibility'] || $attr['captionSeparateColors'] ) ? $attr['mainTitleBorderHColor'] : $attr['mainTitleBorderColor'] ),
),
' .spectra-image-gallery__media-thumbnail-caption--bar-outside' => array_merge(
array(
'background-color' => $attr['captionBackgroundColor'],
),
$main_title_border_css
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-caption--bar-outside' => array(
'background-color' => $attr['captionSeparateColors'] ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'],
'border-color' => $attr['captionSeparateColors'] ? $attr['mainTitleBorderHColor'] : $attr['mainTitleBorderColor'],
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-caption--bar-outside' => array(
'background-color' => $attr['captionSeparateColors'] ? $attr['captionBackgroundColorHover'] : $attr['captionBackgroundColor'],
'border-color' => $attr['captionSeparateColors'] ? $attr['mainTitleBorderHColor'] : $attr['mainTitleBorderColor'],
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-caption' => array(
'color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionColorHover'] : $attr['captionColor'] ),
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-caption' => array(
'color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionColorHover'] : $attr['captionColor'] ),
),
' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-caption a' => array(
'color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionColorHover'] : $attr['captionColor'] ),
),
' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-caption a' => array(
'color' => ( 'antiHover' === $attr['captionVisibility'] ) ? 'rgba(0,0,0,0)' : ( ( 'always' === $attr['captionVisibility'] && $attr['captionSeparateColors'] ) ? $attr['captionColorHover'] : $attr['captionColor'] ),
),
// Lightbox Selectors.
'+.spectra-image-gallery__control-lightbox' => array(
'background-color' => $attr['lightboxBackgroundColor'],
'backdrop-filter' => $attr['lightboxBackgroundEnableBlur'] ? 'blur( ' . $attr['lightboxBackgroundBlurAmount'] . 'px)' : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--caption' => array(
'color' => $attr['lightboxCaptionColor'],
'background' => 'linear-gradient(rgba(0,0,0,0), ' . $attr['lightboxCaptionBackgroundColor'] . ')',
'min-height' => UAGB_Helper::get_css_value( $attr['lightboxCaptionHeight'], 'px' ),
'font-family' => ( 'Default' === $attr['lightboxFontFamily'] ) ? '' : $attr['lightboxFontFamily'],
'font-weight' => $attr['lightboxFontWeight'],
'font-style' => $attr['lightboxFontStyle'],
'text-decoration' => $attr['lightboxDecoration'],
'text-transform' => $attr['lightboxTransform'],
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxFontSize'], $attr['lightboxFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxLineHeight'], $attr['lightboxLineHeightType'] ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--thumbnails-wrapper' => array(
'background-color' => $attr['lightboxDisplayCaptions'] ? $attr['lightboxCaptionBackgroundColor'] : 'transparent',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--count' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'left' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'right' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ) : '',
'color' => $attr['lightboxIconColor'],
'font-family' => ( 'Default' === $attr['lightboxFontFamily'] ) ? '' : $attr['lightboxFontFamily'],
'font-weight' => 'normal',
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ) . ' * 3 / 4 )' : '',
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ) . ' * 3 / 4 )' : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'right' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'left' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ) : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['lightboxIconSize'], 'px' ),
'fill' => $attr['lightboxIconColor'],
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-prev' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'color' => $attr['lightboxIconColor'],
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-next' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'color' => $attr['lightboxIconColor'],
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-prev' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'left' => 'auto',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-next' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistance'], 'px' ),
'right' => 'auto',
),
);
$t_selectors = array(
'.wp-block-uagb-image-gallery' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['feedMarginUnitTab'],
$attr['feedMarginTopTab'],
$attr['feedMarginRightTab'],
$attr['feedMarginBottomTab'],
$attr['feedMarginLeftTab']
),
),
' .spectra-image-gallery__control-arrows--carousel' => $arrow_border_css_tablet,
' .spectra-image-gallery__control-button' => array_merge(
array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['paginateButtonPaddingUnitTab'],
$attr['paginateButtonPaddingTopTab'],
$attr['paginateButtonPaddingRightTab'],
$attr['paginateButtonPaddingBottomTab'],
$attr['paginateButtonPaddingLeftTab']
),
'font-size' => UAGB_Helper::get_css_value( $attr['loadMoreFontSizeTab'], $attr['loadMoreFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['loadMoreLineHeightTab'], $attr['loadMoreLineHeightType'] ),
),
$btn_border_css_tablet
),
' .spectra-image-gallery__layout--grid' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$grid_image_gap_tablet_fallback,
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__layout--isogrid' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $grid_image_gap_tablet_fallback / 2 ),
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__layout--isogrid .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$grid_image_gap_tablet_fallback / 2,
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__layout--masonry' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $grid_image_gap_tablet_fallback / 2 ),
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__layout--masonry .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$grid_image_gap_tablet_fallback / 2,
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__layout--carousel .spectra-image-gallery__media-wrapper' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnitTab'],
0,
$grid_image_gap_tablet_fallback
),
),
' .spectra-image-gallery__layout--carousel .slick-list' => array(
'margin' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnitTab'],
0,
-$grid_image_gap_tablet_fallback
),
),
' .spectra-image-gallery__layout--tiled' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$grid_image_gap_tablet_fallback,
$attr['gridImageGapUnitTab']
),
),
' .spectra-image-gallery__media' => $image_border_css_tablet,
' .spectra-image-gallery__media-thumbnail-caption' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['captionFontSizeTab'], $attr['captionFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['captionLineHeightTab'], $attr['captionLineHeightType'] ),
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['captionPaddingUnit'],
$attr['captionPaddingTop'],
$attr['captionPaddingRight'],
$attr['captionPaddingBottom'],
$attr['captionPaddingLeft']
),
),
' .spectra-image-gallery__media-thumbnail-caption--bar-inside' => $main_title_border_css_tablet,
' .spectra-image-gallery__media-thumbnail-caption--bar-outside' => $main_title_border_css_tablet,
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--caption' => array(
'min-height' => UAGB_Helper::get_css_value( $attr['lightboxCaptionHeightTablet'], 'px' ),
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxFontSizeTab'], $attr['lightboxFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxLineHeightTab'], $attr['lightboxLineHeightType'] ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--count' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'left' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'right' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ) : '',
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ) . ' * 3 / 4 )' : '',
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ) . ' * 3 / 4 )' : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'right' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'left' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ) : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeTablet'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-prev' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-next' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-prev' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'left' => 'auto',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-next' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceTablet'], 'px' ),
'right' => 'auto',
),
);
$m_selectors = array(
'.wp-block-uagb-image-gallery' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['feedMarginUnitMob'],
$attr['feedMarginTopMob'],
$attr['feedMarginRightMob'],
$attr['feedMarginBottomMob'],
$attr['feedMarginLeftMob']
),
),
' .spectra-image-gallery__control-arrows--carousel' => $arrow_border_css_mobile,
' .spectra-image-gallery__control-button' => array_merge(
array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['paginateButtonPaddingUnitMob'],
$attr['paginateButtonPaddingTopMob'],
$attr['paginateButtonPaddingRightMob'],
$attr['paginateButtonPaddingBottomMob'],
$attr['paginateButtonPaddingLeftMob']
),
'font-size' => UAGB_Helper::get_css_value( $attr['loadMoreFontSizeMob'], $attr['loadMoreFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['loadMoreLineHeightMob'], $attr['loadMoreLineHeightType'] ),
),
$btn_border_css_mobile
),
' .spectra-image-gallery__layout--grid' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$grid_image_gap_mobile_fallback,
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__layout--isogrid' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $grid_image_gap_mobile_fallback / 2 ),
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__layout--isogrid .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$grid_image_gap_mobile_fallback / 2,
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__layout--masonry' => array(
'margin' => UAGB_Helper::get_css_value(
-abs( $grid_image_gap_mobile_fallback / 2 ),
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__layout--masonry .spectra-image-gallery__media-wrapper--isotope' => array(
'padding' => UAGB_Helper::get_css_value(
$grid_image_gap_mobile_fallback / 2,
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__layout--carousel .spectra-image-gallery__media-wrapper' => array(
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnitMob'],
0,
$grid_image_gap_mobile_fallback
),
),
' .spectra-image-gallery__layout--carousel .slick-list' => array(
'margin' => UAGB_Block_Helper::generate_spacing(
$attr['gridImageGapUnitMob'],
0,
-$grid_image_gap_mobile_fallback
),
),
' .spectra-image-gallery__layout--tiled .spectra-image-gallery__media-wrapper' => array(
'grid-gap' => UAGB_Helper::get_css_value(
$grid_image_gap_mobile_fallback,
$attr['gridImageGapUnitMob']
),
),
' .spectra-image-gallery__media' => $image_border_css_mobile,
' .spectra-image-gallery__media-thumbnail-caption' => array(
'font-size' => UAGB_Helper::get_css_value( $attr['captionFontSizeMob'], $attr['captionFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['captionLineHeightMob'], $attr['captionLineHeightType'] ),
'padding' => UAGB_Block_Helper::generate_spacing(
$attr['captionPaddingUnit'],
$attr['captionPaddingTop'],
$attr['captionPaddingRight'],
$attr['captionPaddingBottom'],
$attr['captionPaddingLeft']
),
),
' .spectra-image-gallery__media-thumbnail-caption--bar-inside' => $main_title_border_css_mobile,
' .spectra-image-gallery__media-thumbnail-caption--bar-outside' => $main_title_border_css_mobile,
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--caption' => array(
'min-height' => UAGB_Helper::get_css_value( $attr['lightboxCaptionHeightMobile'], 'px' ),
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxFontSizeMob'], $attr['lightboxFontSizeType'] ),
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxLineHeightMob'], $attr['lightboxLineHeightType'] ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--count' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'left' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'right' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ) : '',
'font-size' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ) . ' * 3 / 4 )' : '',
'line-height' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ) ? 'calc(' . UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ) . ' * 3 / 4 )' : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close' => array(
'top' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'right' => is_rtl() ? '' : UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'left' => is_rtl() ? UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ) : '',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--close svg' => array(
'width' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ),
'height' => UAGB_Helper::get_css_value( $attr['lightboxIconSizeMobile'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-prev' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-next' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-prev' => array(
'right' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'left' => 'auto',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main.swiper-rtl .swiper-button-next' => array(
'left' => UAGB_Helper::get_css_value( $attr['lightboxEdgeDistanceMobile'], 'px' ),
'right' => 'auto',
),
// Arrow Size can be implemented for all other screen sizes if needed.
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-prev::after' => array(
'font-size' => '24px',
),
'+.spectra-image-gallery__control-lightbox .spectra-image-gallery__control-lightbox--main .swiper-button-next::after' => array(
'font-size' => '24px',
),
);
// Background Effect based styling.
switch ( $attr['captionBackgroundEffect'] ) {
case 'none':
$selectors[' .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-thumbnail']['filter'] = 'none';
break;
case 'grayscale':
case 'sepia':
$selectors[' .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = $attr['captionBackgroundEffect'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmount'],
'%'
) . ')';
$selectors[' .spectra-image-gallery__media-thumbnail']['filter'] = $attr['captionBackgroundEffect'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmount'],
'%'
) . ')';
break;
};
switch ( $attr['captionBackgroundEffectHover'] ) {
case 'none':
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['filter'] = 'none';
break;
case 'grayscale':
case 'sepia':
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = $attr['captionBackgroundEffectHover'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmountHover'],
'%'
) . ')';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['filter'] = $attr['captionBackgroundEffectHover'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmountHover'],
'%'
) . ')';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['-webkit-filter'] = $attr['captionBackgroundEffectHover'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmountHover'],
'%'
) . ')';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['filter'] = $attr['captionBackgroundEffectHover'] . '(' . UAGB_Helper::get_css_value(
$attr['captionBackgroundEffectAmountHover'],
'%'
) . ')';
break;
};
if ( ! $attr['captionBackgroundEnableBlur'] ) {
$selectors[' .spectra-image-gallery__media-thumbnail-blurrer']['-webkit-backdrop-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-thumbnail-blurrer']['backdrop-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-blurrer']['-webkit-backdrop-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-blurrer']['backdrop-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-blurrer']['-webkit-backdrop-filter'] = 'none';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-blurrer']['backdrop-filter'] = 'none';
}
// Caption Type based styling.
if ( $attr['imageDisplayCaption'] && ( 'bar-outside' === $attr['captionDisplayType'] ) ) {
if ( 'top' === $attr['imageCaptionAlignment01'] ) {
$selectors[' .spectra-image-gallery__media-thumbnail-caption-wrapper']['margin-bottom'] = UAGB_Helper::get_css_value(
$attr['captionGap'],
$attr['captionGapUnit']
);
} else {
$selectors[' .spectra-image-gallery__media-thumbnail-caption-wrapper']['margin-top'] = UAGB_Helper::get_css_value(
$attr['captionGap'],
$attr['captionGapUnit']
);
}
}
// Grid based styling.
if ( 'grid' === $attr['feedLayout'] && $attr['feedPagination'] ) {
$selectors[' .spectra-image-gallery__control-wrapper']['margin-top'] = UAGB_Helper::get_css_value(
$paginate_dot_distance_fallback,
$attr['paginateDotDistanceUnit']
);
}
// Carousel based styling.
if ( 'carousel' === $attr['feedLayout'] ) {
if ( $attr['carouselSquares'] ) {
$selectors[' .spectra-image-gallery__media--carousel']['aspect-ratio'] = 1;
$selectors[' .spectra-image-gallery__media-thumbnail--carousel']['height'] = '100%';
$selectors[' .spectra-image-gallery__media-thumbnail--carousel']['width'] = '100%';
$selectors[' .spectra-image-gallery__media-thumbnail--carousel']['-o-object-fit'] = 'cover';
$selectors[' .spectra-image-gallery__media-thumbnail--carousel']['object-fit'] = 'cover';
}
} else {
$selectors[' .spectra-image-gallery__iso-ref-wrapper']['overflow'] = 'auto';
}
// Masonry based styling.
if ( 'masonry' === $attr['feedLayout'] && $attr['feedPagination'] && ! $attr['paginateUseLoader'] ) {
$selectors[' .spectra-image-gallery__control-wrapper']['-webkit-justify-content'] = $attr['paginateButtonAlign'];
$selectors[' .spectra-image-gallery__control-wrapper']['justify-content'] = $attr['paginateButtonAlign'];
$selectors[' .spectra-image-gallery__control-wrapper']['-webkit-align-items'] = 'center';
$selectors[' .spectra-image-gallery__control-wrapper']['align-items'] = 'center';
}
// New Zoom Effect on Hover.
switch ( $attr['imageZoomType'] ) {
case 'zoom-in':
if ( $attr['imageEnableZoom'] ) {
$selectors[' .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.005, 1.005, 1.005)';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.1, 1.1, 1.1)';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.1, 1.1, 1.1)';
}
break;
case 'zoom-out':
if ( $attr['imageEnableZoom'] ) {
$selectors[' .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.1, 1.1, 1.1)';
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.005, 1.005, 1.005)';
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail']['transform'] = 'scale3d(1.005, 1.005, 1.005)';
}
break;
}
// Box Shadow Application Based on Type.
if ( 'outset' === $attr['imageBoxShadowPosition'] ) {
$selectors[' .spectra-image-gallery__media']['box-shadow'] = $image_box_shadow_css;
$selectors[' .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPositionHover'] ) ? ( ' ' . $attr['imageBoxShadowPositionHover'] ) : ''
);
} else {
$selectors[' .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = $image_box_shadow_css;
$selectors[' .spectra-image-gallery__media']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPositionHover'] ) ? ( ' ' . $attr['imageBoxShadowPositionHover'] ) : ''
);
}
if ( 'outset' === $attr['imageBoxShadowPositionHover'] ) {
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media']['box-shadow'] = $image_box_shadow_hover_css;
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPosition'] ) ? ( ' ' . $attr['imageBoxShadowPosition'] ) : ''
);
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media']['box-shadow'] = $image_box_shadow_hover_css;
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPosition'] ) ? ( ' ' . $attr['imageBoxShadowPosition'] ) : ''
);
} else {
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = $image_box_shadow_hover_css;
$selectors[' .spectra-image-gallery__media-wrapper:hover .spectra-image-gallery__media']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPosition'] ) ? ( ' ' . $attr['imageBoxShadowPosition'] ) : ''
);
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media-thumbnail-blurrer']['box-shadow'] = $image_box_shadow_hover_css;
$selectors[' .spectra-image-gallery__media-wrapper:focus-visible .spectra-image-gallery__media']['box-shadow'] = '0 0 transparent' . (
( 'inset' === $attr['imageBoxShadowPosition'] ) ? ( ' ' . $attr['imageBoxShadowPosition'] ) : ''
);
}
// Slick Dot Positioning in the Editor.
$selectors[' .spectra-image-gallery__layout--carousel .slick-dots']['margin-bottom'] = '30px !important';
$combined_selectors = UAGB_Helper::get_combined_selectors(
'image-gallery',
array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
),
$attr
);
$base_selector = '.uagb-block-';
return UAGB_Helper::generate_all_css( $combined_selectors, $base_selector . $id );

View File

@@ -0,0 +1,121 @@
<?php
/**
* Frontend JS File.
*
* @since 2.1.0
*
* @package uagb
*/
$block_name = 'image-gallery';
$selector = '.uagb-block-' . $id;
$js = '';
$is_rtl = is_rtl();
$slick_options = apply_filters(
'uagb_image_gallery_slick_options',
array(
'arrows' => is_bool( $attr['paginateUseArrows'] ) ? $attr['paginateUseArrows'] : true,
'dots' => is_bool( $attr['paginateUseDots'] ) ? $attr['paginateUseDots'] : true,
'initialSlide' => is_int( $attr['carouselStartAt'] ) ? $attr['carouselStartAt'] : (int) $attr['carouselStartAt'],
'infinite' => is_bool( $attr['carouselLoop'] ) ? $attr['carouselLoop'] : true,
'autoplay' => is_bool( $attr['carouselAutoplay'] ) ? $attr['carouselAutoplay'] : true,
'autoplaySpeed' => is_int( $attr['carouselAutoplaySpeed'] ) ? $attr['carouselAutoplaySpeed'] : (int) $attr['carouselAutoplaySpeed'],
'pauseOnHover' => is_bool( $attr['carouselPauseOnHover'] ) ? $attr['carouselPauseOnHover'] : true,
'speed' => is_int( $attr['carouselTransitionSpeed'] ) ? $attr['carouselTransitionSpeed'] : (int) $attr['carouselTransitionSpeed'],
'slidesToShow' => is_int( $attr['columnsDesk'] ) ? $attr['columnsDesk'] : (int) $attr['columnsDesk'],
'prevArrow' => "<button type='button' data-role='none' class='spectra-image-gallery__control-arrows spectra-image-gallery__control-arrows--carousel slick-prev slick-arrow' aria-label='Previous' tabindex='0' role='button'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 512' width='" . esc_attr( $attr['paginateArrowSize'] ) . "' height='" . esc_attr( $attr['paginateArrowSize'] ) . "'><path d='M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z'></path></svg></button>",
'nextArrow' => "<button type='button' data-role='none' class='spectra-image-gallery__control-arrows spectra-image-gallery__control-arrows--carousel slick-next slick-arrow' aria-label='Previous' tabindex='0' role='button'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 512' width='" . esc_attr( $attr['paginateArrowSize'] ) . "' height='" . esc_attr( $attr['paginateArrowSize'] ) . "'><path d='M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z'></path></svg></button>",
'rtl' => $is_rtl,
'responsive' => array(
array(
'breakpoint' => 1024,
'settings' => array(
'slidesToShow' => is_int( $attr['columnsTab'] ) ? $attr['columnsTab'] : (int) $attr['columnsTab'],
),
),
array(
'breakpoint' => 767,
'settings' => array(
'slidesToShow' => is_int( $attr['columnsMob'] ) ? $attr['columnsMob'] : (int) $attr['columnsMob'],
),
),
),
),
$id
);
// The Thumbnail Swiper Association is handled in the JS in Class Spectra Image Gallery.
$lightbox_options = apply_filters(
'uagb_image_gallery_lightbox_options',
array(
'lazy' => true,
'slidesPerView' => 1,
'navigation' => array(
'nextEl' => $selector . '+.spectra-image-gallery__control-lightbox .swiper-button-next',
'prevEl' => $selector . '+.spectra-image-gallery__control-lightbox .swiper-button-prev',
),
'keyboard' => array(
'enabled' => true,
),
),
$id
);
$thumbnail_options = apply_filters(
'uagb_image_gallery_thumbnail_options',
array(
'centeredSlides' => true,
'slidesPerView' => 5,
'slideToClickedSlide' => true,
'watchSlidesProgres' => true,
'watchSlidesVisibility' => true,
// Swiper Breakpoints go Upward.
'breakpoints' => array(
768 => array(
'slidesPerView' => 7,
),
1024 => array(
'slidesPerView' => 9,
),
),
),
$id
);
$settings = wp_json_encode( $slick_options );
$lightbox_settings = is_array( $lightbox_options ) ? $lightbox_options : array();
$thumbnail_settings = ( ! empty( $attr['lightboxThumbnails'] ) && is_array( $thumbnail_options ) ) ? $thumbnail_options : array();
if ( $attr['mediaGallery'] ) {
switch ( $attr['feedLayout'] ) {
case 'grid':
$js = $attr['feedPagination']
? Spectra_Image_Gallery::render_frontend_grid_pagination( $id, $attr, $selector, $lightbox_settings, $thumbnail_settings )
: '';
break;
case 'masonry':
$js = Spectra_Image_Gallery::render_frontend_masonry_layout( $id, $attr, $selector, $lightbox_settings, $thumbnail_settings );
break;
case 'carousel':
$js = Spectra_Image_Gallery::render_frontend_carousel_layout( $id, $settings, $selector );
break;
case 'tiled':
$js = Spectra_Image_Gallery::render_frontend_tiled_layout( $id );
break;
}
switch ( $attr['imageClickEvent'] ) {
case 'lightbox':
$js .= Spectra_Image_Gallery::render_frontend_lightbox( $id, $attr, $lightbox_settings, $thumbnail_settings, $selector );
break;
case 'image':
$js .= Spectra_Image_Gallery::render_image_click( $id, $attr );
break;
case 'url':
$js = apply_filters( 'uagb_image_gallery_pro_custom_url_js', $js, $id, $attr );
break;
}
}
return $js;

View File

@@ -0,0 +1,183 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$image_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'image' );
$overlay_attribute = UAGB_Block_Helper::uag_generate_border_attribute(
'overlay'
);
return array_merge(
array(
'height' => '',
'width' => '',
'widthTablet' => '',
'heightTablet' => '',
'widthMobile' => '',
'heightMobile' => '',
'layout' => 'default',
// image.
'imageTopMargin' => '',
'imageRightMargin' => '',
'imageLeftMargin' => '',
'imageBottomMargin' => '',
'imageTopMarginTablet' => '',
'imageRightMarginTablet' => '',
'imageLeftMarginTablet' => '',
'imageBottomMarginTablet' => '',
'imageTopMarginMobile' => '',
'imageRightMarginMobile' => '',
'imageLeftMarginMobile' => '',
'imageBottomMarginMobile' => '',
'imageMarginUnit' => 'px',
'imageMarginUnitTablet' => 'px',
'imageMarginUnitMobile' => 'px',
'align' => '',
'alignTablet' => '',
'alignMobile' => '',
// heading.
'headingShowOn' => 'always',
'headingLoadGoogleFonts' => false,
'headingFontFamily' => 'Default',
'headingFontWeight' => '',
'headingFontStyle' => 'normal',
'headingTransform' => '',
'headingFontSize' => '',
'headingColor' => '#fff',
'headingTransform' => '',
'headingDecoration' => '',
'headingFontSizeType' => 'px',
'headingFontSizeTypeTablet' => 'px',
'headingFontSizeTypeMobile' => 'px',
'headingFontSizeMobile' => '',
'headingFontSizeTablet' => '',
'headingLineHeight' => 'em',
'headingLineHeightType' => 'em',
'headingLineHeightMobile' => '',
'headingLineHeightTablet' => '',
'headingTopMargin' => '',
'headingRightMargin' => '',
'headingLeftMargin' => '',
'headingBottomMargin' => '',
'headingTopMarginTablet' => '',
'headingRightMarginTablet' => '',
'headingLeftMarginTablet' => '',
'headingBottomMarginTablet' => '',
'headingTopMarginMobile' => '',
'headingRightMarginMobile' => '',
'headingLeftMarginMobile' => '',
'headingBottomMarginMobile' => '',
'headingMarginUnit' => 'px',
'headingMarginUnitTablet' => 'px',
'headingMarginUnitMobile' => 'px',
// overlay.
'overlayOpacity' => 0.2,
'overlayHoverOpacity' => 1,
'overlayPositionFromEdge' => 15,
'overlayPositionFromEdgeUnit' => 'px',
'overlayBackground' => '',
// caption.
'captionShowOn' => 'hover',
'captionAlign' => 'center',
'captionColor' => '',
'captionLoadGoogleFonts' => false,
'captionFontFamily' => '',
'captionFontStyle' => 'normal',
'captionTransform' => '',
'captionDecoration' => '',
'captionFontSizeType' => 'px',
'captionFontSizeTypeTablet' => 'px',
'captionFontSizeTypeMobile' => 'px',
'captionLineHeightType' => 'em',
'captionFontSize' => '',
'captionFontWeight' => '',
'captionFontSizeTablet' => '',
'captionFontSizeMobile' => '',
'captionLineHeight' => '',
'captionLineHeightTablet' => '',
'captionLineHeightMobile' => '',
'captionTopMargin' => '',
'captionRightMargin' => '',
'captionLeftMargin' => '',
'captionBottomMargin' => '',
'captionTopMarginTablet' => '',
'captionRightMarginTablet' => '',
'captionLeftMarginTablet' => '',
'captionBottomMarginTablet' => '',
'captionTopMarginMobile' => '',
'captionRightMarginMobile' => '',
'captionLeftMarginMobile' => '',
'captionBottomMarginMobile' => '',
'captionMarginUnit' => 'px',
'captionMarginUnitTablet' => 'px',
'captionMarginUnitMobile' => 'px',
// seperator.
'seperatorShowOn' => 'hover',
'seperatorStyle' => '',
'seperatorColor' => '#fff',
'seperatorWidth' => 30,
'separatorWidthType' => '%',
'seperatorThickness' => 2,
'seperatorThicknessUnit' => 'px',
'seperatorTopMargin' => '',
'seperatorRightMargin' => '',
'seperatorLeftMargin' => '',
'seperatorBottomMargin' => '',
'seperatorTopMarginTablet' => '',
'seperatorRightMarginTablet' => '',
'seperatorLeftMarginTablet' => '',
'seperatorBottomMarginTablet' => '',
'seperatorTopMarginMobile' => '',
'seperatorRightMarginMobile' => '',
'seperatorLeftMarginMobile' => '',
'seperatorBottomMarginMobile' => '',
'seperatorMarginUnit' => 'px',
'seperatorMarginUnitTablet' => 'px',
'seperatorMarginUnitMobile' => 'px',
// image shadow.
'useSeparateBoxShadows' => true,
'imageBoxShadowColor' => '#00000070',
'imageBoxShadowHOffset' => 0,
'imageBoxShadowVOffset' => 0,
'imageBoxShadowBlur' => '',
'imageBoxShadowSpread' => '',
'imageBoxShadowPosition' => 'outset',
'imageBoxShadowColorHover' => '',
'imageBoxShadowHOffsetHover' => 0,
'imageBoxShadowVOffsetHover' => 0,
'imageBoxShadowBlurHover' => '',
'imageBoxShadowSpreadHover' => '',
'imageBoxShadowPositionHover' => 'outset',
// mask.
'maskShape' => 'none',
'maskSize' => 'auto',
'maskPosition' => 'center center',
'maskRepeat' => 'no-repeat',
'objectFit' => '',
'objectFitTablet' => '',
'objectFitMobile' => '',
'headingLetterSpacing' => '',
'headingLetterSpacingTablet' => '',
'headingLetterSpacingMobile' => '',
'headingLetterSpacingType' => 'px',
'captionLetterSpacing' => '',
'captionLetterSpacingTablet' => '',
'captionLetterSpacingMobile' => '',
'captionLetterSpacingType' => 'px',
'customHeightSetDesktop' => false,
'customHeightSetTablet' => false,
'customHeightSetMobile' => false,
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
'disableLazyLoad' => false,
'imgRole' => 'img',
),
$image_attribute,
$overlay_attribute
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/image';
$block_data = array(
'slug' => '',
'admin_categories' => array( 'content', 'core' ),
'link' => 'image-block-legacy',
'doc' => 'image',
'title' => __( 'Image', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add images on your webpage with multiple customization options.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'image' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'image',
),
);

View File

@@ -0,0 +1,359 @@
<?php
/**
* Frontend CSS & Google Fonts loading File.
*
* @since 2.0.0
* @var mixed[] $attr
* @package uagb
*/
/**
* Adding this comment to avoid PHPStan errors of undefined variable as these variables are defined else where.
*
* @var int $id
*/
// Add fonts.
UAGB_Block_JS::blocks_advanced_image_gfont( $attr );
$m_selectors = array();
$t_selectors = array();
$image_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image' );
$image_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image', 'tablet' );
$image_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'image', 'mobile' );
$overlay_border_css = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overlay' );
$overlay_border_css_tablet = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overlay', 'tablet' );
$overlay_border_css_mobile = UAGB_Block_Helper::uag_generate_border_css( $attr, 'overlay', 'mobile' );
$width_tablet = '' !== $attr['widthTablet'] ? $attr['widthTablet'] . 'px' : $attr['width'] . 'px';
$width_mobile = '' !== $attr['widthMobile'] ? $attr['widthMobile'] . 'px' : $width_tablet;
$height_tablet = '' !== $attr['heightTablet'] ? $attr['heightTablet'] . 'px' : $attr['height'] . 'px';
$height_mobile = '' !== $attr['heightMobile'] ? $attr['heightMobile'] . 'px' : $height_tablet;
$align = '';
$alignTablet = '';
$alignMobile = '';
switch ( $attr['align'] ) {
case 'left':
$align = 'flex-start';
break;
case 'right':
$align = 'flex-end';
break;
case 'center':
$align = 'center';
break;
}
switch ( $attr['alignTablet'] ) {
case 'left':
$alignTablet = 'flex-start';
break;
case 'right':
$alignTablet = 'flex-end';
break;
case 'center':
$alignTablet = 'center';
break;
}
switch ( $attr['alignMobile'] ) {
case 'left':
$alignMobile = 'flex-start';
break;
case 'right':
$alignMobile = 'flex-end';
break;
case 'center':
$alignMobile = 'center';
break;
}
$box_shadow_properties = array(
'horizontal' => $attr['imageBoxShadowHOffset'],
'vertical' => $attr['imageBoxShadowVOffset'],
'blur' => $attr['imageBoxShadowBlur'],
'spread' => $attr['imageBoxShadowSpread'],
'color' => $attr['imageBoxShadowColor'],
'position' => $attr['imageBoxShadowPosition'],
);
$box_shadow_hover_properties = array(
'horizontal' => $attr['imageBoxShadowHOffsetHover'],
'vertical' => $attr['imageBoxShadowVOffsetHover'],
'blur' => $attr['imageBoxShadowBlurHover'],
'spread' => $attr['imageBoxShadowSpreadHover'],
'color' => $attr['imageBoxShadowColorHover'],
'position' => $attr['imageBoxShadowPositionHover'],
'alt_color' => $attr['imageBoxShadowColor'],
);
$box_shadow_css = UAGB_Block_Helper::generate_shadow_css( $box_shadow_properties );
$box_shadow_hover_css = UAGB_Block_Helper::generate_shadow_css( $box_shadow_hover_properties );
$attr['captionDecoration'] = '' === $attr['captionDecoration'] && defined( 'ASTRA_THEME_SETTINGS' ) && function_exists( 'astra_get_font_extras' ) && function_exists( 'astra_get_option' ) ? astra_get_font_extras( astra_get_option( 'body-font-extras' ), 'text-decoration' ) : $attr['captionDecoration'];
$selectors = array(
'.wp-block-uagb-image' => array(
'margin-top' => UAGB_Helper::get_css_value( $attr['imageTopMargin'], $attr['imageMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['imageRightMargin'], $attr['imageMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['imageBottomMargin'], $attr['imageMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['imageLeftMargin'], $attr['imageMarginUnit'] ),
'text-align' => $attr['align'],
'justify-content' => $align,
'align-self' => $align,
),
' .wp-block-uagb-image__figure' => array(
'align-items' => $align,
),
'.wp-block-uagb-image--layout-default figure img' => array_merge(
array(
'box-shadow' => $box_shadow_css,
),
$image_border_css
),
'.wp-block-uagb-image .wp-block-uagb-image__figure img:hover' => array(
'border-color' => $attr['imageBorderHColor'],
),
'.wp-block-uagb-image .wp-block-uagb-image__figure figcaption' => array(
'color' => $attr['captionColor'],
'margin-top' => UAGB_Helper::get_css_value( $attr['captionTopMargin'], $attr['captionMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['captionRightMargin'], $attr['captionMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['captionBottomMargin'], $attr['captionMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['captionLeftMargin'], $attr['captionMarginUnit'] ),
'align-self' => ( 'overlay' !== $attr['layout'] ? $attr['captionAlign'] : '' ),
),
'.wp-block-uagb-image .wp-block-uagb-image__figure figcaption a' => array(
'color' => $attr['captionColor'],
),
// overlay.
'.wp-block-uagb-image--layout-overlay figure img' => array_merge(
array(
'box-shadow' => $box_shadow_css,
),
$image_border_css
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__color-wrapper' => array_merge(
array(
'background' => $attr['overlayBackground'],
'opacity' => $attr['overlayOpacity'],
),
$image_border_css
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__color-wrapper:hover' => array(
'border-color' => $attr['imageBorderHColor'],
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner' => array_merge(
$overlay_border_css,
array(
'left' => UAGB_Helper::get_css_value( $attr['overlayPositionFromEdge'], $attr['overlayPositionFromEdgeUnit'] ),
'right' => UAGB_Helper::get_css_value( $attr['overlayPositionFromEdge'], $attr['overlayPositionFromEdgeUnit'] ),
'top' => UAGB_Helper::get_css_value( $attr['overlayPositionFromEdge'], $attr['overlayPositionFromEdgeUnit'] ),
'bottom' => UAGB_Helper::get_css_value( $attr['overlayPositionFromEdge'], $attr['overlayPositionFromEdgeUnit'] ),
)
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading' => array(
'color' => $attr['headingColor'],
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMargin'], $attr['headingMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMargin'], $attr['headingMarginUnit'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMargin'], $attr['headingMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMargin'], $attr['headingMarginUnit'] ),
'opacity' => 'always' === $attr['headingShowOn'] ? 1 : 0,
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading a' => array(
'color' => $attr['headingColor'],
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner .uagb-image-caption' => array(
'opacity' => 'always' === $attr['captionShowOn'] ? 1 : 0,
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image__figure:hover .wp-block-uagb-image--layout-overlay__inner' => array(
'border-color' => $attr['overlayBorderHColor'],
),
'.wp-block-uagb-image--layout-overlay .wp-block-uagb-image__figure:hover .wp-block-uagb-image--layout-overlay__color-wrapper' => array(
'opacity' => $attr['overlayHoverOpacity'],
),
// Seperator.
'.wp-block-uagb-image .wp-block-uagb-image--layout-overlay__inner .uagb-image-separator' => array(
'width' => UAGB_Helper::get_css_value( $attr['seperatorWidth'], $attr['separatorWidthType'] ),
'border-top-width' => UAGB_Helper::get_css_value( $attr['seperatorThickness'], $attr['seperatorThicknessUnit'] ),
'border-top-color' => $attr['seperatorColor'],
'border-top-style' => $attr['seperatorStyle'],
'margin-bottom' => UAGB_Helper::get_css_value( $attr['seperatorBottomMargin'], $attr['seperatorMarginUnit'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['seperatorTopMargin'], $attr['seperatorMarginUnit'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['seperatorLeftMargin'], $attr['seperatorMarginUnit'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['seperatorRightMargin'], $attr['seperatorMarginUnit'] ),
'opacity' => 'always' === $attr['seperatorShowOn'] ? 1 : 0,
),
);
$selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img'] = array(
'object-fit' => $attr['objectFit'],
'width' => $attr['width'] . 'px',
'height' => 'auto',
);
if ( $attr['customHeightSetDesktop'] ) {
$selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img']['height'] = $attr['height'] . 'px';
}
if ( 'hover' === $attr['headingShowOn'] ) {
$selectors['.wp-block-uagb-image .wp-block-uagb-image__figure:hover .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading'] = array(
'opacity' => 1,
);
}
if ( 'hover' === $attr['captionShowOn'] ) {
$selectors['.wp-block-uagb-image .wp-block-uagb-image__figure:hover .wp-block-uagb-image--layout-overlay__inner .uagb-image-caption'] = array(
'opacity' => 1,
);
}
if ( 'hover' === $attr['seperatorShowOn'] ) {
$selectors['.wp-block-uagb-image .wp-block-uagb-image__figure:hover .wp-block-uagb-image--layout-overlay__inner .uagb-image-separator'] = array(
'opacity' => 1,
);
}
// If using separate box shadow hover settings, then generate CSS for it.
if ( $attr['useSeparateBoxShadows'] ) {
$selectors['.wp-block-uagb-image--layout-default figure:hover img'] = array(
'box-shadow' => $box_shadow_hover_css,
);
$selectors['.wp-block-uagb-image--layout-overlay figure:hover img'] = array(
'box-shadow' => $box_shadow_hover_css,
);
};
if ( 'none' !== $attr['maskShape'] ) {
$imagePath = UAGB_URL . 'assets/images/masks/' . $attr['maskShape'] . '.svg';
if ( 'custom' === $attr['maskShape'] ) {
$imagePath = $attr['maskCustomShape']['url'];
}
if ( ! empty( $imagePath ) ) {
$selectors[ '.wp-block-uagb-image .wp-block-uagb-image__figure img, .uagb-block-' . $id . ' .wp-block-uagb-image--layout-overlay__color-wrapper' ] = array(
'mask-image' => 'url(' . $imagePath . ')',
'-webkit-mask-image' => 'url(' . $imagePath . ')',
'mask-size' => $attr['maskSize'],
'-webkit-mask-size' => $attr['maskSize'],
'mask-repeat' => $attr['maskRepeat'],
'-webkit-mask-repeat' => $attr['maskRepeat'],
'mask-position' => $attr['maskPosition'],
'-webkit-mask-position' => $attr['maskPosition'],
);
}
}
// tablet.
$t_selectors['.wp-block-uagb-image--layout-default figure img'] = $image_border_css_tablet;
$t_selectors['.wp-block-uagb-image--layout-overlay figure img'] = $image_border_css_tablet;
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img'] = array(
'width' => UAGB_Helper::get_css_value( $attr['widthTablet'], 'px' ),
);
$t_selectors['.wp-block-uagb-image'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['imageTopMarginTablet'], $attr['imageMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['imageRightMarginTablet'], $attr['imageMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['imageBottomMarginTablet'], $attr['imageMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['imageLeftMarginTablet'], $attr['imageMarginUnitTablet'] ),
'text-align' => $attr['alignTablet'],
'justify-content' => $alignTablet,
'align-self' => $alignTablet,
);
$t_selectors[' .wp-block-uagb-image__figure'] = array(
'align-items' => $alignTablet,
);
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure figcaption'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['captionTopMarginTablet'], $attr['captionMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['captionRightMarginTablet'], $attr['captionMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['captionBottomMarginTablet'], $attr['captionMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['captionLeftMarginTablet'], $attr['captionMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner'] = $overlay_border_css_tablet;
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMarginTablet'], $attr['headingMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMarginTablet'], $attr['headingMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image--layout-overlay__inner .uagb-image-separator'] = array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['seperatorBottomMarginTablet'], $attr['seperatorMarginUnitTablet'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['seperatorTopMarginTablet'], $attr['seperatorMarginUnitTablet'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['seperatorLeftMarginTablet'], $attr['seperatorMarginUnitTablet'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['seperatorRightMarginTablet'], $attr['seperatorMarginUnitTablet'] ),
);
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img'] = array(
'object-fit' => $attr['objectFitTablet'],
'width' => $width_tablet,
'height' => 'auto',
);
if ( $attr['customHeightSetTablet'] ) {
$t_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img']['height'] = $height_tablet;
}
// mobile.
$m_selectors['.wp-block-uagb-image--layout-default figure img'] = $image_border_css_mobile;
$m_selectors['.wp-block-uagb-image--layout-overlay figure img'] = $image_border_css_mobile;
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img'] = array(
'width' => UAGB_Helper::get_css_value( $attr['widthMobile'], 'px' ),
);
$m_selectors['.wp-block-uagb-image'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['imageTopMarginMobile'], $attr['imageMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['imageRightMarginMobile'], $attr['imageMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['imageBottomMarginMobile'], $attr['imageMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['imageLeftMarginMobile'], $attr['imageMarginUnitMobile'] ),
'text-align' => $attr['alignMobile'],
'justify-content' => $alignMobile,
'align-self' => $alignMobile,
);
$m_selectors[' .wp-block-uagb-image__figure'] = array(
'align-items' => $alignMobile,
);
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure figcaption'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['captionTopMarginMobile'], $attr['captionMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['captionRightMarginMobile'], $attr['captionMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['captionBottomMarginMobile'], $attr['captionMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['captionLeftMarginMobile'], $attr['captionMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading'] = array(
'margin-top' => UAGB_Helper::get_css_value( $attr['headingTopMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['headingRightMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-bottom' => UAGB_Helper::get_css_value( $attr['headingBottomMarginMobile'], $attr['headingMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['headingLeftMarginMobile'], $attr['headingMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner'] = $overlay_border_css_mobile;
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image--layout-overlay__inner .uagb-image-separator'] = array(
'margin-bottom' => UAGB_Helper::get_css_value( $attr['seperatorBottomMarginMobile'], $attr['seperatorMarginUnitMobile'] ),
'margin-top' => UAGB_Helper::get_css_value( $attr['seperatorTopMarginMobile'], $attr['seperatorMarginUnitMobile'] ),
'margin-left' => UAGB_Helper::get_css_value( $attr['seperatorLeftMarginMobile'], $attr['seperatorMarginUnitMobile'] ),
'margin-right' => UAGB_Helper::get_css_value( $attr['seperatorRightMarginMobile'], $attr['seperatorMarginUnitMobile'] ),
);
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img'] = array(
'object-fit' => $attr['objectFitMobile'],
'width' => $width_mobile,
'height' => 'auto',
);
if ( $attr['customHeightSetMobile'] ) {
$m_selectors['.wp-block-uagb-image .wp-block-uagb-image__figure img']['height'] = $height_mobile;
}
$combined_selectors = array(
'desktop' => $selectors,
'tablet' => $t_selectors,
'mobile' => $m_selectors,
);
$base_selector = '.uagb-block-';
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'heading', '.wp-block-uagb-image--layout-overlay .wp-block-uagb-image--layout-overlay__inner .uagb-image-heading', $combined_selectors );
$combined_selectors = UAGB_Helper::get_typography_css( $attr, 'caption', '.wp-block-uagb-image .wp-block-uagb-image__figure figcaption', $combined_selectors );
return UAGB_Helper::generate_all_css(
$combined_selectors,
$base_selector . $id,
isset( $gbs_class ) ? $gbs_class : ''
);

View File

@@ -0,0 +1,302 @@
<?php
/**
* Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$cta_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute(
'btn'
);
$inherit_from_theme = 'enabled' === UAGB_Admin_Helper::get_admin_settings_option( 'uag_btn_inherit_from_theme', 'disabled' );
$infobox_border_attribute = UAGB_Block_Helper::uag_generate_border_attribute( 'infobox' );
$image_width_default = ( 'yes' === get_option( 'uagb-old-user-less-than-2' ) ) ? 120 : '';
return array_merge(
array(
'classMigrate' => false,
'inheritFromTheme' => $inherit_from_theme,
'headingAlign' => 'center',
'headingAlignTablet' => '',
'headingAlignMobile' => '',
'headingColor' => '',
'subHeadingColor' => '',
'prefixColor' => '',
'prefixFontSize' => '',
'prefixFontSizeType' => 'px',
'prefixFontSizeTypeTablet' => 'px',
'prefixFontSizeTypeMobile' => 'px',
'prefixFontSizeTablet' => '',
'prefixFontSizeMobile' => '',
'prefixFontFamily' => '',
'prefixFontWeight' => '',
'prefixFontStyle' => '',
'prefixLineHeightType' => 'em',
'prefixLineHeight' => '',
'prefixLineHeightTablet' => '',
'prefixLineHeightMobile' => '',
'prefixLoadGoogleFonts' => false,
'headFontSize' => '',
'headFontSizeType' => 'px',
'headFontSizeTypeTablet' => 'px',
'headFontSizeTypeMobile' => 'px',
'headFontSizeTablet' => '',
'headFontSizeMobile' => '',
'headFontFamily' => '',
'headFontWeight' => '',
'headFontStyle' => '',
'headLineHeightType' => 'em',
'headLineHeight' => '',
'headLineHeightTablet' => '',
'headLineHeightMobile' => '',
'headLoadGoogleFonts' => false,
'subHeadFontSize' => '',
'subHeadFontSizeType' => 'px',
'subHeadFontSizeTypeTablet' => 'px',
'subHeadFontSizeTypeMobile' => 'px',
'subHeadFontSizeTablet' => '',
'subHeadFontSizeMobile' => '',
'subHeadFontFamily' => '',
'subHeadFontWeight' => '',
'subHeadFontStyle' => '',
'subHeadLineHeightType' => 'em',
'subHeadLineHeight' => '',
'subHeadLineHeightTablet' => '',
'subHeadLineHeightMobile' => '',
'subHeadLoadGoogleFonts' => false,
'separatorWidth' => '',
'separatorWidthTablet' => '',
'separatorWidthMobile' => '',
'separatorHeight' => '',
'separatorWidthType' => '%',
'icon' => 'circle-check',
'iconColor' => '#333',
'iconSize' => '30',
'iconSizeTablet' => '',
'iconSizeMobile' => '',
'iconSizeType' => 'px',
'iconimgPosition' => 'above-title',
'block_id' => '',
'iconHover' => '',
'iconimgBorderRadius' => '0',
'seperatorStyle' => 'solid',
'seperatorWidth' => '30',
'seperatorWidthMobile' => '',
'seperatorWidthTablet' => '',
'seperatorColor' => '#333',
'seperatorThickness' => '2',
'thicknessUnit' => 'px',
'htmlTag' => 'div',
'ctaType' => 'none',
'ctaBgType' => 'color',
'ctaBgHoverType' => 'color',
'ctaLinkColor' => '',
'ctaFontSize' => '',
'ctaFontSizeType' => 'px',
'ctaFontSizeMobile' => '',
'ctaFontSizeTablet' => '',
'ctaFontFamily' => '',
'ctaFontWeight' => '',
'ctaFontStyle' => '',
'ctaLineHeightType' => 'em',
'ctaLineHeight' => '',
'ctaLineHeightTablet' => '',
'ctaLineHeightMobile' => '',
'ctaLetterSpacing' => '',
'ctaLetterSpacingTablet' => '',
'ctaLetterSpacingMobile' => '',
'ctaLetterSpacingType' => 'px',
'ctaLoadGoogleFonts' => false,
'ctaBtnLinkColor' => '',
'ctaBgColor' => '',
'paddingBtnUnit' => 'px',
'mobilePaddingBtnUnit' => 'px',
'tabletPaddingBtnUnit' => 'px',
'paddingBtnTop' => '',
'paddingBtnRight' => '',
'paddingBtnBottom' => '',
'paddingBtnLeft' => '',
'paddingBtnTopTablet' => '',
'paddingBtnRightTablet' => '',
'paddingBtnBottomTablet' => '',
'paddingBtnLeftTablet' => '',
'paddingBtnTopMobile' => '',
'paddingBtnRightMobile' => '',
'paddingBtnBottomMobile' => '',
'paddingBtnLeftMobile' => '',
'iconLeftMargin' => '10',
'iconRightMargin' => '10',
'iconTopMargin' => '5',
'iconBottomMargin' => '15',
'iconMarginLeftTablet' => '',
'iconMarginRightTablet' => '',
'iconMarginTopTablet' => '',
'iconMarginBottomTablet' => '',
'iconMarginLeftMobile' => '',
'iconMarginRightMobile' => '',
'iconMarginTopMobile' => '',
'iconMarginBottomMobile' => '',
'iconMarginUnit' => 'px',
'iconTabletMarginUnit' => 'px',
'iconMobileMarginUnit' => 'px',
'imageSize' => 'thumbnail',
'imageWidth' => $image_width_default,
'ctaLinkHoverColor' => '',
'ctaBgHoverColor' => '',
'showCtaIcon' => true,
'ctaIcon' => 'right-long',
'ctaIconSpace' => '5',
'ctaIconSpaceTablet' => '',
'ctaIconSpaceMobile' => '',
'ctaIconSpaceType' => 'px',
'ctaTransform' => '',
'ctaDecoration' => '',
'prefixTransform' => '',
'prefixDecoration' => '',
'headTransform' => '',
'headDecoration' => '',
'subHeadTransform' => '',
'subHeadDecoration' => '',
'imageWidthUnit' => 'px',
'imageWidthUnitTablet' => 'px',
'imageWidthUnitMobile' => 'px',
'iconimgBorderRadiusUnit' => 'px',
'imageWidthMobile' => '',
'imageWidthTablet' => '',
'ctaIconPosition' => 'after',
'imageWidthType' => true,
'headTabletSpace' => '',
'headMobileSpace' => '',
'headSpaceUnit' => 'px',
'headSpace' => '10',
'headTopMargin' => '',
'headRightMargin' => '',
'headLeftMargin' => '',
'headMarginTopTablet' => '',
'headMarginRightTablet' => '',
'headMarginLeftTablet' => '',
'headMarginTopMobile' => '',
'headMarginRightMobile' => '',
'headMarginLeftMobile' => '',
'headMobileMarginUnit' => 'px',
'headTabletMarginUnit' => 'px',
'headLetterSpacing' => '',
'headLetterSpacingTablet' => '',
'headLetterSpacingMobile' => '',
'headLetterSpacingType' => 'px',
'seperatorMobileSpace' => '',
'seperatorTabletSpace' => '',
'seperatorSpaceUnit' => 'px',
'seperatorSpace' => 0,
'separatorTopMargin' => '',
'separatorRightMargin' => '',
'separatorLeftMargin' => '',
'separatorMarginTopTablet' => '',
'separatorMarginRightTablet' => '',
'separatorMarginLeftTablet' => '',
'separatorMarginTopMobile' => '',
'separatorMarginRightMobile' => '',
'separatorMarginLeftMobile' => '',
'separatorMobileMarginUnit' => 'px',
'separatorTabletMarginUnit' => 'px',
'stack' => 'tablet',
'subHeadTabletSpace' => '',
'subHeadMobileSpace' => '',
'subHeadSpaceUnit' => 'px',
'subHeadSpace' => '20',
'subHeadTopMargin' => '',
'subHeadRightMargin' => '',
'subHeadLeftMargin' => '',
'subHeadMarginTopTablet' => '',
'subHeadMarginRightTablet' => '',
'subHeadMarginLeftTablet' => '',
'subHeadMarginTopMobile' => '',
'subHeadMarginRightMobile' => '',
'subHeadMarginLeftMobile' => '',
'subHeadMobileMarginUnit' => 'px',
'subHeadTabletMarginUnit' => 'px',
'subHeadLetterSpacing' => '',
'subHeadLetterSpacingTablet' => '',
'subHeadLetterSpacingMobile' => '',
'subHeadLetterSpacingType' => 'px',
'prefixTabletSpace' => '',
'prefixMobileSpace' => '',
'prefixSpaceUnit' => 'px',
'prefixSpace' => '10',
'prefixTopMargin' => '5',
'prefixRightMargin' => '',
'prefixLeftMargin' => '',
'prefixMarginTopTablet' => '',
'prefixMarginRightTablet' => '',
'prefixMarginLeftTablet' => '',
'prefixMarginTopMobile' => '',
'prefixMarginRightMobile' => '',
'prefixMarginLeftMobile' => '',
'prefixMobileMarginUnit' => 'px',
'prefixTabletMarginUnit' => 'px',
'prefixLetterSpacing' => '',
'prefixLetterSpacingTablet' => '',
'prefixLetterSpacingMobile' => '',
'prefixLetterSpacingType' => 'px',
// icon image.
'iconView' => 'none',
'iconShape' => 'Circle',
'iconBackgroundColor' => '#6EC1E3',
'iconBackgroundHoverColor' => '',
'iconBorderWidth' => 3,
// Padding.
'blockTopPadding' => '',
'blockRightPadding' => '',
'blockLeftPadding' => '',
'blockBottomPadding' => '',
'blockTopPaddingTablet' => '',
'blockRightPaddingTablet' => '',
'blockLeftPaddingTablet' => '',
'blockBottomPaddingTablet' => '',
'blockTopPaddingMobile' => '',
'blockRightPaddingMobile' => '',
'blockLeftPaddingMobile' => '',
'blockBottomPaddingMobile' => '',
'blockPaddingUnit' => 'px',
'blockPaddingUnitTablet' => 'px',
'blockPaddingUnitMobile' => 'px',
'blockPaddingLink' => '',
// margin.
'blockTopMargin' => '',
'blockRightMargin' => '',
'blockLeftMargin' => '',
'blockBottomMargin' => '',
'blockTopMarginTablet' => '',
'blockRightMarginTablet' => '',
'blockLeftMarginTablet' => '',
'blockBottomMarginTablet' => '',
'blockTopMarginMobile' => '',
'blockRightMarginMobile' => '',
'blockLeftMarginMobile' => '',
'blockBottomMarginMobile' => '',
'blockMarginUnit' => 'px',
'blockMarginUnitTablet' => 'px',
'blockMarginUnitMobile' => 'px',
'blockMarginLink' => true,
'ctaBorderStyle' => 'solid',
'ctaBorderColor' => '',
'ctaBorderWidth' => 1,
'ctaBorderRadius' => 0,
'ctaBorderhoverColor' => '',
// For Global Block Styles.
'globalBlockStyleName' => '',
'globalBlockStyleId' => '',
'enableMultilineParagraph' => false,
),
$cta_border_attribute,
$infobox_border_attribute
);

View File

@@ -0,0 +1,25 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/info-box';
$block_data = array(
'doc' => 'infobox',
'slug' => '',
'admin_categories' => array( 'core', 'content' ),
'link' => 'info-box-legacy',
'title' => __( 'Info Box', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Add image/icon, seperator and text description using a single block.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'info-box' ),
'deprecated' => false,
'dynamic_assets' => array(
'dir' => 'info-box',
),
);

View File

@@ -0,0 +1,91 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
return array(
'block_id' => '',
'c_id' => null,
'cookies' => false,
'close_cookie_days' => 1,
'textColor' => '',
'titleColor' => '',
'noticeColor' => '#FFD54F',
'contentBgColor' => '',
'fontSize' => '14',
'icon' => 'rectangle-xmark',
'iconSize' => 16,
'iconSizeTab' => '',
'iconSizeMob' => '',
'iconSizeUnit' => 'px',
'noticeDismiss' => '',
'noticeDismissColor' => '',
'noticeAlignment' => 'left',
'titleFontFamily' => 'Default',
'titleFontWeight' => '',
'titleFontSizeType' => 'px',
'titleLineHeightType' => '',
'titleFontSize' => '',
'titleFontSizeTablet' => '',
'titleFontSizeMobile' => '',
'titleLineHeight' => '',
'titleLineHeightTablet' => '',
'titleLineHeightMobile' => '',
'descFontFamily' => 'Default',
'descFontWeight' => '',
'descFontSize' => '',
'descFontSizeType' => 'px',
'descFontSizeTablet' => '',
'descFontSizeMobile' => '',
'descLineHeight' => '',
'descLineHeightType' => '',
'descLineHeightTablet' => '',
'descLineHeightMobile' => '',
'titleLoadGoogleFonts' => '',
'descLoadGoogleFonts' => '',
'contentPaddingUnit' => 'px',
'mobileContentPaddingUnit' => 'px',
'tabletContentPaddingUnit' => 'px',
'contentPaddingLink' => false,
'titleHrPadding' => 15,
'titleVrPadding' => 15,
'contentHrPadding' => 15,
'contentVrPadding' => 15,
'contentTopPadding' => '',
'contentBottomPadding' => '',
'contentLeftPadding' => '',
'contentRightPadding' => '',
'titlePaddingUnit' => 'px',
'mobileTitlePaddingUnit' => 'px',
'tabletTitlePaddingUnit' => 'px',
'titlePaddingLink' => false,
'layout' => 'modern',
'highlightWidth' => 10,
'highlightWidthTablet' => 10,
'highlightWidthMobile' => 10,
'titleTransform' => '',
'titleDecoration' => '',
'descTransform' => '',
'descDecoration' => '',
'titleFontStyle' => '',
'descFontStyle' => '',
// letter spacing.
'titleLetterSpacing' => '',
'titleLetterSpacingTablet' => '',
'titleLetterSpacingMobile' => '',
'titleLetterSpacingType' => 'px',
'descLetterSpacing' => '',
'descLetterSpacingTablet' => '',
'descLetterSpacingMobile' => '',
'descLetterSpacingType' => 'px',
'titleLeftPadding' => '',
'titleRightPadding' => '',
'titleTopPadding' => '',
'titleBottomPadding' => '',
);

View File

@@ -0,0 +1,36 @@
<?php
/**
* Block Information & Attributes File.
*
* @since 2.0.0
*
* @package uagb
*/
$block_slug = 'uagb/inline-notice';
$block_data = array(
'doc' => 'inline-notice',
'slug' => '',
'admin_categories' => array( 'content' ),
'link' => 'inline-notice-legacy',
'title' => __( 'Inline Notice', 'ultimate-addons-for-gutenberg' ),
'description' => __( 'Highlight important information using inline notice block.', 'ultimate-addons-for-gutenberg' ),
'default' => true,
'extension' => false,
'priority' => Spectra_Block_Prioritization::get_block_priority( 'inline-notice' ),
'deprecated' => false,
'static_dependencies' => array(
'uagb-inline-notice-js' => array(
'src' => UAGB_Scripts_Utils::get_js_url( 'inline-notice' ),
'dep' => array( 'uagb-cookie-lib' ),
'skipEditor' => true,
'type' => 'js',
),
'uagb-cookie-lib' => array(
'type' => 'js',
),
),
'dynamic_assets' => array(
'dir' => 'inline-notice',
),
);

Some files were not shown because too many files have changed in this diff Show More