';
}
} else {
if ( ! empty( $icon ) ) {
$icon = '';
$link = '
Learn More
';
}
}
// Assign heading variable
if ( ! empty( $heading ) ) {
$heading = '' . $heading . '
';
}
// Assign main content variable
if ( ! empty( $content ) ) {
$content = wpautop( $content );
}
// Assign animation variables if set
if ( ! empty( $animate ) and $animate !== 'none' ) {
$animate_start = '';
$animate_end = '
';
}
// Output services
echo $animate_start;
$output .= '';
if ( ! empty( $icon ) ) {
$output .= '
' . $icon . '
';
}
$output .= '
' . $heading . $content . $link . '
';
$output .= '
';
echo $output;
echo $animate_end;
// Load animation styles and scripts
if ( ! empty( $animate ) and $animate !== 'none' ) {
if ( ! wp_script_is( 'animate-js', 'enqueued' ) ) {
// Enque styles only if widget is being used
wp_enqueue_style( 'animate-css', plugin_dir_url(SITEORIGIN_PANELS_BASE_FILE) . 'inc/plugins/animate.css/animate.css', array(), '1.0' );
wp_enqueue_style( 'animate-thinkup-css', plugin_dir_url(SITEORIGIN_PANELS_BASE_FILE) . 'widgets-builder/animation/css/animate-thinkup-panels.css', array(), '1.0' );
if ( ! wp_script_is( 'waypoints', 'enqueued' ) ) {
// Enque waypoints only if widget is being used
wp_enqueue_script( 'waypoints', plugin_dir_url(SITEORIGIN_PANELS_BASE_FILE) . 'inc/plugins/waypoints/waypoints.min.js', array( 'jquery' ), '2.0.3', 'true' );
wp_enqueue_script( 'waypoints-sticky', plugin_dir_url(SITEORIGIN_PANELS_BASE_FILE) . 'inc/plugins/waypoints/waypoints-sticky.min.js', array( 'jquery' ), '2.0.3', 'true' );
}
// Enque scripts only if widget is being used
wp_enqueue_script( 'animate-js', plugin_dir_url(SITEORIGIN_PANELS_BASE_FILE) . 'widgets-builder/animation/js/animate-thinkup-panels.js', array( 'jquery' ), '1.1', true );
}
}