get_render_attribute_string( 'counter' ) ); ?>>
render_counter_icon();
}
$this->render_counter_content();
?>
<#
var iconImage,
position;
view.addInlineEditingAttributes('title');
view.addRenderAttribute('title', 'class', 'premium-counter-title-val');
position = settings.premium_counter_icon_position;
var delimiter = settings.premium_counter_t_separator,
round = '' === settings.premium_counter_d_after ? 0 : settings.premium_counter_d_after;
view.addRenderAttribute( 'counter', {
'class': [ 'premium-counter', 'premium-counter-area', position ],
'data-duration': settings.premium_counter_speed * 1000,
'data-from-value': settings.premium_counter_start_value,
'data-to-value': settings.premium_counter_end_value,
'data-delimiter': delimiter,
'data-rounding': round
});
if ( 'yes' === settings.draw_svg ) {
view.addRenderAttribute( 'counter', 'class', 'premium-drawer-hover' );
}
function getCounterContent() {
var startValue = settings.premium_counter_start_value;
view.addRenderAttribute( 'counter_wrap', 'class', ['premium-init-wrapper', settings.title_display ]);
view.addRenderAttribute( 'value', 'id', 'counter-' + view.getID() );
view.addRenderAttribute( 'value', 'class', 'premium-counter-init' );
#>
<# if ( '' !== settings.premium_counter_preffix ) { #>
{{{ settings.premium_counter_preffix }}}
<# } #>
{{{ startValue }}}
<# if ( '' !== settings.premium_counter_suffix ) { #>
{{{ settings.premium_counter_suffix }}}
<# } #>
<# if ( '' !== settings.premium_counter_title ) { #>
{{{ settings.premium_counter_title }}}
<# if ( '' !== settings.premium_counter_desc ) { #>
{{{ settings.premium_counter_desc }}}
<# } #>
<# } #>
<#
}
function renderCounterIcon() {
var iconStyle = 'simple' !== settings.premium_counter_icon_style ? ' icon-bg ' + settings.premium_counter_icon_style : '',
animation = settings.premium_counter_icon_animation,
flexWidth = '';
var iconType = settings.premium_counter_icon_image;
if( 'icon' === iconType || 'svg' === iconType ) {
view.addRenderAttribute( 'icon', 'class', 'premium-drawable-icon' );
if( 'icon' === iconType ) {
var iconHTML = 'yes' !== settings.draw_svg ? elementor.helpers.renderIcon( view, settings.premium_counter_icon_updated, { 'class': ['premium-svg-nodraw', 'premium-drawable-icon'], 'aria-hidden': true }, 'i' , 'object' ) : false,
migrated = elementor.helpers.isIconMigrated( settings, 'premium_counter_icon_updated' );
}
if ( 'yes' === settings.draw_svg ) {
if ( 'icon' === iconType ) {
view.addRenderAttribute( 'icon', 'class', settings.premium_counter_icon_updated.value );
}
view.addRenderAttribute(
'icon',
{
'class' : 'premium-svg-drawer',
'data-svg-reverse' : settings.lottie_reverse,
'data-svg-loop' : settings.lottie_loop,
'data-svg-sync' : settings.svg_sync,
'data-svg-hover' : settings.svg_hover,
'data-svg-fill' : settings.svg_color,
'data-svg-frames' : settings.frames,
'data-svg-yoyo' : settings.svg_yoyo,
'data-svg-point' : settings.lottie_reverse ? settings.end_point.size : settings.start_point.size,
}
);
} else {
view.addRenderAttribute( 'icon', 'class', 'premium-svg-nodraw' );
}
} else if( 'custom' === iconType ) {
if( 'simple' === settings.premium_counter_icon_style ) {
flexWidth = ' flex-width ';
}
} else {
view.addRenderAttribute( 'counter_lottie', {
'class': [
'premium-counter-animation',
'premium-lottie-animation'
],
'data-lottie-url': settings.lottie_url,
'data-lottie-loop': settings.lottie_loop,
'data-lottie-reverse': settings.lottie_reverse
});
}
view.addRenderAttribute( 'icon_wrap', 'class', 'premium-counter-icon' );
var iconClass = 'icon' + flexWidth + iconStyle;
#>
<#
if( 'yes' === settings.icon_switcher ) {
renderCounterIcon();
}
getCounterContent();
#>