balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

jquery.animation.js (4945B)


      1 "use strict";
      2 
      3 (function (jQuery) {
      4   'use strict'; // Add/remove the mobile title class, depending on available space and title length
      5 
      6   jQuery.fn.seedprod_responsive_title_shortcode = function () {
      7     jQuery(this).each(function () {
      8       var $titleWrapper = jQuery(this),
      9           $title = $titleWrapper.find('h1, h2, h3, h4, h5, h6'),
     10           $titleMinWidth = $title.data('min-width') ? $title.data('min-width') : $title.outerWidth(),
     11           $wrappingParent = $titleWrapper.parent(),
     12           $wrappingParentWidth = $titleWrapper.parents('.slide-content').length ? $wrappingParent.width() : $wrappingParent.outerWidth(),
     13           $textsWrapper = $titleWrapper.find('.sp-animated-texts-wrapper'),
     14           $loop = $titleWrapper.hasClass("sp-loop-on"),
     15           $width = 0,
     16           $highlightEffects = {
     17         circle: ['M325,18C228.7-8.3,118.5,8.3,78,21C22.4,38.4,4.6,54.6,5.6,77.6c1.4,32.4,52.2,54,142.6,63.7 c66.2,7.1,212.2,7.5,273.5-8.3c64.4-16.6,104.3-57.6,33.8-98.2C386.7-4.9,179.4-1.4,126.3,20.7'],
     18         underline_zigzag: ['M11,126.5c62-5.9,124.1-9.8,186.3-11.8c62.2-1.9,124.5-1.8,186.7,0.2c35,1.2,70.1,3,105,5.4c3.2,0.2,3.2-4.7,0-5 c-42.9-3.4-86-4.4-129-3c-42.9,1.4-85.7,5.2-128.2,11.4c-23.9,3.5-47.7,7.7-71.3,12.7c-2.8,0.6-2.1,4.8,0.7,4.9 c41.2,1.3,82.4,2.6,123.5,3.8c11.7,0.4,23.4,0.7,35.2,1.1c3.2,0.1,3.2-4.9,0-5c-41.2-1.3-82.4-2.6-123.5-3.8 c-11.7-0.4-23.4-0.7-35.2-1.1c0.2,1.6,0.4,3.3,0.7,4.9c41.9-8.8,84.3-15.3,126.9-19.3c42.5-4,85.3-5.7,128-5 c24.1,0.4,48.3,1.6,72.3,3.5c0-1.7,0-3.3,0-5c-62.1-4.3-124.3-6.7-186.5-7c-62.2-0.3-124.5,1.3-186.6,5c-35,2.1-70,4.8-104.9,8.1 C7.8,121.8,7.8,126.8,11,126.5L11,126.5z'],
     19         x: ['M497.4,23.9C301.6,40,155.9,80.6,4,144.4', 'M14.1,27.6c204.5,20.3,393.8,74,467.3,111.7'],
     20         strikethrough: ['M3,75h493.5'],
     21         curly: ['M3,146.1c17.1-8.8,33.5-17.8,51.4-17.8c15.6,0,17.1,18.1,30.2,18.1c22.9,0,36-18.6,53.9-18.6 c17.1,0,21.3,18.5,37.5,18.5c21.3,0,31.8-18.6,49-18.6c22.1,0,18.8,18.8,36.8,18.8c18.8,0,37.5-18.6,49-18.6c20.4,0,17.1,19,36.8,19 c22.9,0,36.8-20.6,54.7-18.6c17.7,1.4,7.1,19.5,33.5,18.8c17.1,0,47.2-6.5,61.1-15.6'],
     22         diagonal: ['M13.5,15.5c131,13.7,289.3,55.5,475,125.5'],
     23         double: ['M8.4,143.1c14.2-8,97.6-8.8,200.6-9.2c122.3-0.4,287.5,7.2,287.5,7.2', 'M8,19.4c72.3-5.3,162-7.8,216-7.8c54,0,136.2,0,267,7.8'],
     24         double_underline: ['M5,125.4c30.5-3.8,137.9-7.6,177.3-7.6c117.2,0,252.2,4.7,312.7,7.6', 'M26.9,143.8c55.1-6.1,126-6.3,162.2-6.1c46.5,0.2,203.9,3.2,268.9,6.4'],
     25         underline: ['M7.7,145.6C109,125,299.9,116.2,401,121.3c42.1,2.2,87.6,11.8,87.3,25.7']
     26       },
     27           $all_paths = '',
     28           $current_path = '',
     29           $highlightSVG = '';
     30 
     31       if ((0 === $titleMinWidth || false === $titleMinWidth || '0' === $titleMinWidth) && (0 === $wrappingParentWidth || false === $wrappingParentWidth || '0' === $wrappingParentWidth)) {
     32         $titleWrapper.removeClass('sp-border-below-title');
     33       } else if ($titleMinWidth + 100 >= $wrappingParentWidth) {
     34         $titleWrapper.addClass('sp-border-below-title');
     35         $title.data('min-width', $titleMinWidth);
     36       } else {
     37         $titleWrapper.removeClass('sp-border-below-title');
     38       }
     39 
     40       if (jQuery($titleWrapper).hasClass('sp-title-rotating')) {
     41         if (!jQuery($titleWrapper).is('.sp-title-typeIn,.sp-title-clipIn')) {
     42           jQuery($textsWrapper).find('.sp-animated-text').each(function () {
     43             var $currentWidth = jQuery(this).width();
     44 
     45             if ($currentWidth > $width) {
     46               $width = $currentWidth;
     47             }
     48           });
     49 
     50           if ('undefined' === typeof $textsWrapper.attr('style') || -1 === $textsWrapper.attr('style').indexOf('width')) {
     51             $textsWrapper.css('width', $width);
     52           }
     53         }
     54 
     55         jQuery($titleWrapper).find('.sp-animated-texts-wrapper').textillate({
     56           selector: '.sp-animated-texts',
     57           type: $textsWrapper.attr('data-length'),
     58           minDisplayTime: $textsWrapper.attr("data-minDisplayTime"),
     59           loop: $loop
     60         });
     61       }
     62       /*
     63       if ( jQuery( $titleWrapper ).hasClass( 'sp-title-highlight' ) ) {
     64       	$all_paths = $highlightEffects[ jQuery( $titleWrapper ).data( 'highlight' ) ];
     65       	$current_path = jQuery();
     66       		$all_paths.forEach( function ( $current ) {
     67       		$current_path = $current_path.add( jQuery( '<path>', { d: $current } ) );
     68       	} );
     69       		$highlightSVG = jQuery( '<svg>', {
     70       		xmlns: 'http://www.w3.org/2000/svg',
     71       		viewBox: '0 0 500 150',
     72       		preserveAspectRatio: 'none'
     73       	} ).html( $current_path );
     74       		if ( jQuery( $titleWrapper ).data( 'active-highlight' ) !== jQuery( $titleWrapper ).data( 'highlight' ) ) {
     75       		jQuery( $titleWrapper ).find( '.sp-highlighted-text' ).append( $highlightSVG[ 0 ].outerHTML );
     76       		$titleWrapper.data( 'active-highlight', jQuery( $titleWrapper ).attr( 'data-highlight' ) );
     77       	}
     78       }
     79       */
     80 
     81     });
     82   };
     83 })(jQuery);