ec-confettieffect.js
6 months ago
ec-confettieffect.min.js
6 months ago
ecafe-accordion.js
6 months ago
ecafe-accordion.min.js
6 months ago
ecafe-assets.js
6 months ago
ecafe-assets.min.js
6 months ago
ecafe-back-to-top.js
6 months ago
ecafe-back-to-top.min.js
6 months ago
ecafe-changelog.js
6 months ago
ecafe-changelog.min.js
6 months ago
ecafe-chart.js
6 months ago
ecafe-chart.min.js
6 months ago
ecafe-countdown.js
6 months ago
ecafe-countdown.min.js
6 months ago
ecafe-coupon-code.js
6 months ago
ecafe-coupon-code.min.js
6 months ago
ecafe-hover-background.js
6 months ago
ecafe-hover-background.min.js
6 months ago
ecafe-image-accordion.js
6 months ago
ecafe-image-accordion.min.js
6 months ago
ecafe-image-scroll.js
6 months ago
ecafe-image-scroll.min.js
6 months ago
ecafe-infocircle.js
6 months ago
ecafe-infocircle.min.js
6 months ago
ecafe-infounfold.js
6 months ago
ecafe-infounfold.min.js
6 months ago
ecafe-lottie.js
6 months ago
ecafe-lottie.min.js
6 months ago
ecafe-marketing-link.js
6 months ago
ecafe-marketing-link.min.js
6 months ago
ecafe-page-piling.js
6 months ago
ecafe-page-piling.min.js
6 months ago
ecafe-page-scroll-to-id.js
6 months ago
ecafe-page-scroll-to-id.min.js
6 months ago
ecafe-pdf-viewer.js
6 months ago
ecafe-pdf-viewer.min.js
6 months ago
ecafe-post-image.js
6 months ago
ecafe-post-image.min.js
6 months ago
ecafe-post-listing.js
6 months ago
ecafe-post-listing.min.js
6 months ago
ecafe-qrcode.js
6 months ago
ecafe-qrcode.min.js
6 months ago
ecafe-scroll-progress.js
6 months ago
ecafe-scroll-progress.min.js
6 months ago
ecafe-sticky-video.js
6 months ago
ecafe-sticky-video.min.js
6 months ago
ecafe-tabs.js
6 months ago
ecafe-tabs.min.js
6 months ago
ecafe-tilt-custom.js
6 months ago
ecafe-tilt-custom.min.js
6 months ago
ecafe-tippy-custom.js
6 months ago
ecafe-tippy-custom.min.js
6 months ago
ecafe-toc.js
6 months ago
ecafe-toc.min.js
6 months ago
ecafe-whatsapp.js
6 months ago
ecafe-whatsapp.min.js
6 months ago
ecafe.js
6 months ago
ecafe.min.js
6 months ago
ecafe-lottie.js
204 lines
| 1 | (function($) { |
| 2 | "use strict"; |
| 3 | var WidgetLottiesAnimationHandler = function($scope, $) { |
| 4 | var container = $scope.find('.eca-lotties-animation-wrapper'), |
| 5 | data_id = container.data("id"), |
| 6 | container_id = document.getElementById(data_id), |
| 7 | data_path = container.data("path"), |
| 8 | data_loop = container.data("loop"), |
| 9 | data_anim_renderer = container.data("anim_renderer"), |
| 10 | data_playspeed = container.data("playspeed"), |
| 11 | data_play_action = container.data("play_action"), |
| 12 | data_la_scrollbased = container.data("la_scrollbased"), |
| 13 | data_la_section_duration = container.data("la_section_duration"), |
| 14 | data_la_section_duration_tablet = container.data("la_section_duration_tablet"), |
| 15 | data_la_section_duration_mobile = container.data("la_section_duration_mobile"), |
| 16 | data_la_section_offset = container.data("la_section_offset"), |
| 17 | data_la_section_offset_tablet = container.data("la_section_offset_tablet"), |
| 18 | data_la_section_offset_mobile = container.data("la_section_offset_mobile"), |
| 19 | data_la_start_time = container.data("la_start_time"), |
| 20 | data_la_end_time = container.data("la_end_time"), |
| 21 | la_customtrigger = container.data("la_customtrigger"); |
| 22 | |
| 23 | var eca_lotties_animation = bodymovin.loadAnimation({ |
| 24 | container: container_id, |
| 25 | animType: data_anim_renderer, |
| 26 | loop: (data_loop) ? true : false, |
| 27 | autoplay: (data_play_action === 'autoplay') ? true : false, |
| 28 | path: data_path |
| 29 | }); |
| 30 | |
| 31 | if (data_playspeed <= 1) { |
| 32 | eca_lotties_animation.setSpeed(data_playspeed); |
| 33 | } |
| 34 | |
| 35 | var start_time = 1; |
| 36 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 37 | start_time = data_la_start_time; |
| 38 | } |
| 39 | var end_time = eca_lotties_animation.totalFrames; |
| 40 | |
| 41 | |
| 42 | if(data_play_action){ |
| 43 | if(data_play_action === 'default'){ |
| 44 | eca_lotties_animation.goToAndStop(0); |
| 45 | } |
| 46 | |
| 47 | if(data_play_action === 'reverse_second_click'){ |
| 48 | var directionMenu = 1; |
| 49 | container_id.addEventListener('click', (e) => { |
| 50 | eca_lotties_animation.setDirection(directionMenu); |
| 51 | eca_lotties_animation.play(); |
| 52 | directionMenu = -directionMenu; |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | if(data_play_action === 'autoplay'){ |
| 57 | eca_lotties_animation.goToAndPlay(0); |
| 58 | } |
| 59 | |
| 60 | if(data_play_action === 'hover'){ |
| 61 | eca_lotties_animation.goToAndStop(start_time, true) |
| 62 | |
| 63 | if(la_customtrigger != '' && la_customtrigger != undefined){ |
| 64 | jQuery(container_id).closest('.'+la_customtrigger).mouseenter(function() { |
| 65 | var start_time = 1; |
| 66 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 67 | start_time = data_la_start_time; |
| 68 | } |
| 69 | if(data_la_end_time !='' && data_la_end_time !=undefined){ |
| 70 | end_time = data_la_end_time; |
| 71 | }else{ |
| 72 | end_time = eca_lotties_animation.totalFrames; |
| 73 | } |
| 74 | eca_lotties_animation.playSegments([start_time, end_time], !0) |
| 75 | }) |
| 76 | }else{ |
| 77 | jQuery(container_id).mouseenter(function() { |
| 78 | var start_time = 1; |
| 79 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 80 | start_time = data_la_start_time; |
| 81 | } |
| 82 | if(data_la_end_time !='' && data_la_end_time !=undefined){ |
| 83 | end_time = data_la_end_time; |
| 84 | }else{ |
| 85 | end_time = eca_lotties_animation.totalFrames; |
| 86 | } |
| 87 | eca_lotties_animation.playSegments([start_time, end_time], !0) |
| 88 | }) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | if(data_play_action === 'click'){ |
| 93 | eca_lotties_animation.goToAndStop(start_time, true), |
| 94 | jQuery(container_id).on("click", function() { |
| 95 | var start_time = 1; |
| 96 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 97 | start_time = data_la_start_time; |
| 98 | } |
| 99 | if(data_la_end_time !='' && data_la_end_time !=undefined){ |
| 100 | end_time = data_la_end_time; |
| 101 | }else{ |
| 102 | end_time = eca_lotties_animation.totalFrames; |
| 103 | } |
| 104 | eca_lotties_animation.playSegments([start_time, end_time], !0) |
| 105 | }) |
| 106 | } |
| 107 | |
| 108 | if(data_play_action === 'mouseoverout'){ |
| 109 | eca_lotties_animation.goToAndStop(start_time, true) |
| 110 | |
| 111 | if(la_customtrigger != '' && la_customtrigger != undefined){ |
| 112 | jQuery(container_id).closest('.'+la_customtrigger).mouseenter(function() { |
| 113 | var start_time = 1; |
| 114 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 115 | start_time = data_la_start_time; |
| 116 | } |
| 117 | if(data_la_end_time !='' && data_la_end_time !=undefined){ |
| 118 | end_time = data_la_end_time; |
| 119 | }else{ |
| 120 | end_time = eca_lotties_animation.totalFrames; |
| 121 | } |
| 122 | eca_lotties_animation.playSegments([start_time, end_time], !0) |
| 123 | }), |
| 124 | jQuery(container_id).closest('.'+la_customtrigger).mouseleave(function() { |
| 125 | var new_load = eca_lotties_animation.currentRawFrame; |
| 126 | eca_lotties_animation.setDirection(-1), eca_lotties_animation.goToAndPlay(new_load, !0) |
| 127 | }) |
| 128 | }else{ |
| 129 | jQuery(container_id).mouseenter(function() { |
| 130 | var start_time = 1; |
| 131 | if(data_la_start_time !='' && data_la_start_time !=undefined){ |
| 132 | start_time = data_la_start_time; |
| 133 | } |
| 134 | if(data_la_end_time !='' && data_la_end_time !=undefined){ |
| 135 | end_time = data_la_end_time; |
| 136 | }else{ |
| 137 | end_time = eca_lotties_animation.totalFrames; |
| 138 | } |
| 139 | eca_lotties_animation.playSegments([start_time, end_time], !0) |
| 140 | }), |
| 141 | jQuery(container_id).mouseleave(function() { |
| 142 | var new_load = eca_lotties_animation.currentRawFrame; |
| 143 | eca_lotties_animation.setDirection(-1), eca_lotties_animation.goToAndPlay(new_load, !0) |
| 144 | }) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | $(window).on("lotties_load_animation resize scroll", function() { |
| 149 | |
| 150 | if(data_play_action === 'parallax_effect'){ |
| 151 | |
| 152 | var section_offset = container.offset().top; |
| 153 | var deviceGet = $("body").data("elementor-device-mode"); |
| 154 | |
| 155 | var section_duration = data_la_section_duration; |
| 156 | var offset_top = data_la_section_offset; |
| 157 | if(deviceGet == "mobile"){ |
| 158 | section_duration = data_la_section_duration_mobile; |
| 159 | offset_top = data_la_section_offset_mobile; |
| 160 | } |
| 161 | if(deviceGet == "tablet"){ |
| 162 | section_duration = data_la_section_duration_tablet; |
| 163 | offset_top = data_la_section_offset_tablet; |
| 164 | } |
| 165 | |
| 166 | var all_duration = section_duration + section_offset - offset_top; |
| 167 | |
| 168 | var find_scroll_perc = 0; |
| 169 | if( $(window).scrollTop() >= (section_offset - offset_top ) && $(window).scrollTop() <= all_duration && data_la_scrollbased == 'la_custom'){ |
| 170 | var scrollpercent = 100 * ($(window).scrollTop() - (section_offset - offset_top)) / (section_duration); |
| 171 | var find_scroll_perc = Math.round(scrollpercent); |
| 172 | }else if( $(window).scrollTop() >= (section_offset - offset_top ) && $(window).scrollTop() >= all_duration && data_la_scrollbased == 'la_custom'){ |
| 173 | var find_scroll_perc = Math.round(100); |
| 174 | }else if(data_la_scrollbased == 'la_document'){ |
| 175 | var scrollpercent = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()); |
| 176 | var find_scroll_perc = Math.round(scrollpercent); |
| 177 | } |
| 178 | |
| 179 | var start_time = 0; |
| 180 | var stop_time = eca_lotties_animation.totalFrames; |
| 181 | if(data_la_start_time!='' && data_la_start_time!=undefined){ |
| 182 | start_time = data_la_start_time; |
| 183 | } |
| 184 | if(data_la_end_time!='' && data_la_end_time!=undefined){ |
| 185 | stop_time = data_la_end_time; |
| 186 | } |
| 187 | eca_lotties_animation.goToAndStop(start_time, true) |
| 188 | var currframe = ((find_scroll_perc)/100 ) * (stop_time - start_time); |
| 189 | if(currframe >= stop_time){ |
| 190 | eca_lotties_animation.goToAndStop(stop_time, true); |
| 191 | }else{ |
| 192 | eca_lotties_animation.goToAndStop((currframe + start_time), true); |
| 193 | } |
| 194 | } |
| 195 | }), jQuery(window).trigger("lotties_load_animation"); |
| 196 | } |
| 197 | |
| 198 | }; |
| 199 | $(window).on('elementor/frontend/init', function() { |
| 200 | elementorFrontend.hooks.addAction('frontend/element_ready/ecafe-lottie.default', WidgetLottiesAnimationHandler); |
| 201 | }); |
| 202 | })(jQuery); |
| 203 | |
| 204 | /*isonscreen js*/!function(a){"use strict";a.fn.isOnScreen=function(b){var c=this.outerHeight(),d=this.outerWidth();if(!d||!c)return!1;var e=a(window),f={top:e.scrollTop(),left:e.scrollLeft()};f.right=f.left+e.width(),f.bottom=f.top+e.height();var g=this.offset();g.right=g.left+d,g.bottom=g.top+c;var h={top:f.bottom-g.top,left:f.right-g.left,bottom:g.bottom-f.top,right:g.right-f.left};return"function"==typeof b?b.call(this,h):h.top>0&&h.left>0&&h.right>0&&h.bottom>0}}(jQuery); |