1 2(function( $ ) { 3 4 $( document ).scroll(function() { 5 bt_bb_animate_elements_adv_progressbar(); 6 }); 7 8 $( document ).ready(function () { 9 bt_bb_animate_elements_adv_progressbar(); 10 }); 11 12 function bt_bb_animate_elements_adv_progressbar( ) { 13 var $elems = $( '.bt_bb_progress_bar_advanced.animate-adv_progressbar:not(.animated-adv_progressbar)' ); 14 $elems.each(function() { 15 var $elm = $( this ); 16 if ( $elm.isOnScreen_adv_progressbar() ) { 17 $elm.addClass( 'animated-adv_progressbar' ); 18 bt_bb_animate_progress_advanced( $elm ); 19 } 20 }); 21 } 22 23 $.fn.isOnScreen_adv_progressbar = function(){ 24 var element = this.get(0); 25 var bounds = element.getBoundingClientRect(); 26 return bounds.top + 75 < window.innerHeight && bounds.bottom > 0; 27 } 28 29 function bt_bb_animate_progress_advanced( elm ) { 30 31 var container = elm.data( 'container' ); 32 var pbid = elm.data( 'container-pbid' ); 33 var container_type = elm.data( 'container-type' ); 34 var container_percentage = elm.data( 'container-percentage' ); 35 var container_text_color = elm.data( 'container-text-color' ); 36 var container_stroke_width = elm.data( 'container-stroke-width' ); 37 var container_trail_color = elm.data( 'container-trail-color' ); 38 var container_trail_width = elm.data( 'container-trail-width' ); 39 var container_easing = elm.data( 'container-easing' );
40 var container_color_from = elm.data( 'container-color-from' ); 41 var container_depth_from = elm.data( 'container-depth-from' ); 42 var container_color_to = elm.data( 'container-color-to' ); 43 var container_depth_to = elm.data( 'container-depth-to' ); 44 var container_fill = elm.data( 'container-fill' ); 45 var container_text = elm.data( 'container-text' ); 46 var container_duration = elm.data( 'container-duration' ); 47 var container_icon = elm.data( 'container-icon' ); 48 49 //console.log(container_type); 50 51 if ( container_type == 'circle') 52 { 53 54 bt_bb_progressbar_circle_init( 55 container, 56 container_percentage, 57 container_text_color, 58 container_stroke_width, 59 container_trail_color, 60 container_trail_width, 61 container_easing, 62 container_color_from, 63 container_depth_from, 64 container_color_to, 65 container_depth_to, 66 container_fill, 67 container_text, 68 container_duration, 69 container_icon, 70 pbid); 71 72 }else{ 73 74 bt_bb_progressbar_semicircle_init( 75 container, 76 container_percentage, 77 container_text_color, 78 container_stroke_width, 79 container_trail_color, 80 container_trail_width, 81 container_easing,
82 container_color_from, 83 container_depth_from, 84 container_color_to, 85 container_depth_to, 86 container_fill, 87 container_text, 88 container_duration, 89 container_icon, 90 pbid); 91 } 92 return false; 93 } 94 95 96})( jQuery ); 97 98function bt_bb_progressbar_circle_init( container, container_percentage, container_text_color, container_stroke_width, 99 container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid ) { 100 101 if ( pbid > 0 ) 102 { 103 container = "#container_" + pbid; 104 } 105 display_icon = ""; 106 107 if (container_icon) 108 { 109 icon_set = container_icon.substring( 0, container_icon.lastIndexOf("_") ); 110 icon_icon = container_icon.substr(container_icon.lastIndexOf("_")+1); 111 display_icon = "<span data-ico-" + icon_set + "=\"&#x" + icon_icon + ";\" class=\"bt_bb_icon_holder\"></span>"; 112 } 113 114 var circle = new ProgressBar.Circle(container, { 115 color: container_text_color, 116 strokeWidth: container_stroke_width, 117 trailColor: container_trail_color, 118 trailWidth: container_trail_width, 119 easing: container_easing, 120 duration: container_duration, 121 text: { 122 value: '', 123 autoStyleContainer: false, 124 style: { 125 color: container_text_color, 126 transform: { 127 prefix: true, 128 } 129 }, 130 autoStyleContainer: false 131 }, 132 from: { color: container_color_from, width: container_depth_from }, 133 to: { color: container_color_to, width: container_depth_to }, 134 fill: container_fill, 135 step: function(state, circle) { 136 circle.path.setAttribute('stroke', state.color); 137 circle.path.setAttribute('stroke-width', state.width); 138 139 var value = Math.round(circle.value() * 100); 140 141 if ( !container_icon ) { 142 circle.setText( value + '%' ); 143 } 144 145 } 146 }); 147 148 if ( container_icon && display_icon ) { 149 circle.setText( display_icon ); 150 } 151 152 if (jQuery( container ).parent().hasClass( "animated-adv_progressbar" ) || jQuery( container ).parent().parent().hasClass( "animated-adv_progressbar" )){ 153 154 circle.animate(container_percentage); 155 } 156 157} 158 159function bt_bb_progressbar_semicircle_init( container,container_percentage, container_text_color, container_stroke_width, 160 container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid ) { 161 162 if ( pbid > 0 ) 163 { 164 container = "#container_" + pbid; 165 } 166 167 display_icon = ""; 168 if ( container_icon ) 169 { 170 icon_set = container_icon.substring( 0, container_icon.lastIndexOf("_") ); 171 icon_icon = container_icon.substr(container_icon.lastIndexOf("_")+1); 172 display_icon = "<span data-ico-" + icon_set + "=\"&#x" + icon_icon + ";\" class=\"bt_bb_icon_holder\"></span>"; 173 } 174 175 var semicircle = new ProgressBar.SemiCircle(container, { 176 strokeWidth: container_stroke_width, 177 easing: container_easing, 178 duration: container_duration, 179 color: container_text_color, 180 trailColor: container_trail_color, 181 trailWidth: container_trail_width, 182 svgStyle: null, 183 text: { 184 value: '', 185 autoStyleContainer: false, 186 style: { 187 color: container_text_color, 188 transform: { 189 prefix: true, 190 } 191 }, 192 alignToBottom: false 193 }, 194 fill: container_fill, 195 from: { color: container_color_from, width: container_depth_from }, 196 to: { color: container_color_to, width: container_depth_to }, 197 step: function(state, semicircle) { 198 semicircle.path.setAttribute('stroke', state.color); 199 semicircle.path.setAttribute('stroke-width', state.width); 200 201 var value = Math.round(semicircle.value() * 100); 202 if ( !container_icon ) { 203 semicircle.setText( value + '%' ); 204 } 205 } 206 }); 207 208 if ( container_icon ) { 209 semicircle.setText( display_icon ); 210 } 211 212 if (jQuery( container ).parent().hasClass( "animated-adv_progressbar" ) || jQuery( container ).parent().parent().hasClass( "animated-adv_progressbar" )){ 213 semicircle.animate(container_percentage); 214 } 215 216 217}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.