Файловый менеджер - Редактировать - /home/digitalm/www/zetaworks/wp-content/themes/uncode/library/js/animations.js
Назад
(function($) { "use strict"; UNCODE.animations = function() { var runWaypoints_TO, runWaypoints_carousel_TO, runWaypoints_delay = 0, highlightComplexFunc = function($wrap, ev){ var $lines = $('.heading-line-wrap', $wrap), not_animate = false; if ( $wrap.data('animate') === true ) { not_animate = true; } var $rotatingTxt = $('.uncode-rotating-text-start', $wrap); if ( $rotatingTxt.length && $rotatingTxt.attr('data-animated') !== 'true' ) { return; } $lines.each(function(_key, _value){ var $line = $(_value), $inners = $('.split-word-inner', $line), $highlights = $('.heading-text-highlight-inner', $line); var highlitInnerFunc = function(ev){ var delay = 0; $highlights.each(function(h_key, high){ var $highlight = $(high), $split = $highlight.closest('.split-word:not(.uncode-rotating-span)'), $nextSplit = $split.nextUntil(), $next = $('.heading-text-highlight-inner', $nextSplit), countCh = $split.text().length; $highlight.css({ '-webkit-transition-duration': (30 * countCh) + 'ms', '-moz-transition-duration': (30 * countCh) + 'ms', '-o-transition-duration': (30 * countCh) + 'ms', 'transition-duration': (30 * countCh) + 'ms', }); delay += (30 * countCh); $next.css({ '-webkit-transition-delay': delay + 'ms', '-moz-transition-delay': delay + 'ms', '-o-transition-delay': delay + 'ms', 'transition-delay': delay + 'ms', }); }); $highlights.removeAttr('data-animated'); if ( _key+1 === $lines.length ) { $wrap.data('animate', true); } }; if ( $('.heading-text-highlight-inner[data-animated="yes"]', $line).length ) { if ( not_animate ) { $highlights.each(function(h_key, high){ var $highlight = $(high); $highlight.css({ '-webkit-transition-duration': '0ms', '-moz-transition-duration': '0ms', '-o-transition-duration': '0ms', 'transition-duration': '0ms', }); }); $highlights.removeAttr('data-animated'); } else { if ( typeof ev !== 'undefined' && ev.type === 'defer-highlights' ) { highlitInnerFunc(); } else { $inners.last().one('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', highlitInnerFunc); } } } }); }; $.each($('.header-content-inner'), function(index, val) { var element = $(val), transition = ''; if (element.hasClass('top-t-bottom')) transition = 'top-t-bottom'; if (element.hasClass('bottom-t-top')) transition = 'bottom-t-top'; if (element.hasClass('left-t-right')) transition = 'left-t-right'; if (element.hasClass('right-t-left')) transition = 'right-t-left'; if (element.hasClass('zoom-in')) transition = 'zoom-in'; if (element.hasClass('zoom-out')) transition = 'zoom-out'; if (element.hasClass('alpha-anim')) transition = 'alpha-anim'; if (transition != '') { $(val).removeClass(transition); var container = element, containerDelay = container.attr('data-delay'), containerSpeed = container.attr('data-speed'), items = $('.header-title > *, .post-info', container); $.each(items, function(index, val) { var element = $(val), //speedAttr = (containerSpeed == undefined) ? containerSpeed : '', delayAttr = (containerDelay != undefined) ? containerDelay : 400; if (!element.hasClass('animate_when_almost_visible')) { delayAttr = Number(delayAttr) + (400 * index); if (containerSpeed != undefined) element.attr('data-speed', containerSpeed); element.addClass(transition + ' animate_when_almost_visible').attr('data-delay', delayAttr); } }); container.css('opacity', 1); } }); window.waypoint_animation = function(ev) { $.each($('.animate_when_almost_visible:not(.start_animation):not(.t-inside):not(.drop-image-separator), .tmb-media .animate_when_almost_visible:not(.start_animation), .animate_when_almost_visible.has-rotating-text'), function(index, val) { if ( $(val).hasClass('el-text-split') ) { return true; } if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { return; } var run = true, $carousel = $(val).closest('.owl-carousel'); if ( $carousel.length ) { run = false; } if (run) { new Waypoint({ context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, element: val, handler: function() { var element = $(this.element), index = element.index(), delayAttr = element.attr('data-delay'); if (delayAttr == undefined) delayAttr = 0; requestTimeout(function() { element.addClass('start_animation'); }, delayAttr); if (!UNCODE.isUnmodalOpen) { this.destroy(); } }, offset: UNCODE.isFullPage ? '100%' : '90%' }); } }); $.each($('.animate_inner_when_almost_visible'), function(index, val) { if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { return; } var run = true, $carousel = $(val).closest('.owl-carousel'); if ( $carousel.length ) { run = false; } if (run) { new Waypoint({ context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, element: val, handler: function() { var $element = $(this.element), $childs = $('.animate_when_parent_almost_visible', $element); $childs.each(function(key,el){ var $child = $(el), delaySpeed = $child.attr('data-speed'), delayAttr = $child.attr('data-delay'), intervalAttr = $child.attr('data-interval'); if (delayAttr == undefined) { delayAttr = 50*key; } requestTimeout(function() { $child.addClass('start_animation'); if ( $child.hasClass('anim-line-checker') ) { $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { var $line = $child.closest('.heading-line-wrap'); }); } var $wrapText = $child.closest('.animate_inner_when_almost_visible'); highlightComplexFunc($wrapText, ev); if ( $child.hasClass('anim-tot-checker') ) { $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { if ( $child.hasClass('anim-tot-checker') ) { $wrapText.addClass('already-animated'); $element.trigger('already-animated'); } }); } }, delayAttr ); }); $element.addClass('start_animation'); if (!UNCODE.isUnmodalOpen) { this.destroy(); } }, offset: UNCODE.isFullPage ? '100%' : '90%' }); } }); } window.waypoint_carousel_animation = function(ev) { $.each($('.owl-carousel').find('.animate_when_almost_visible:not(.start_animation):not(.t-inside):not(.drop-image-separator), .tmb-media .animate_when_almost_visible:not(.start_animation)'), function(index, val) { if ( $(val).hasClass('el-text-split') ) { return true; } if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { return; } var run = true, $carousel = $(val).closest('.owl-carousel'), $first_item = $(val).closest('.owl-item[data-index="1"]'), $all_first = $('.owl-item[data-index="1"]', $carousel); if ( ! ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) && $carousel.attr('data-front-edited') !== 'true' ) { run = false; } if (run) { new Waypoint({ context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, element: val, handler: function() { var element = $(this.element), index = element.index(), delayAttr = element.attr('data-delay'); if (delayAttr == undefined) delayAttr = 0; requestTimeout(function() { if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) { $all_first.attr('data-already-reached', 'true'); } element.addClass('start_animation'); }, delayAttr); if (!UNCODE.isUnmodalOpen) { this.destroy(); } }, offset: UNCODE.isFullPage ? '100%' : '90%' }); } }); $.each($('.owl-carousel').find('.animate_inner_when_almost_visible'), function(index, val) { if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { return; } var run = true, $carousel = $(val).closest('.owl-carousel'), $first_item = $(val).closest('.owl-item[data-index="1"]'), $all_first = $('.owl-item[data-index="1"]', $carousel); if ( ! ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) && $carousel.attr('data-front-edited') !== 'true' ) { run = false; } if (run) { new Waypoint({ context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, element: val, handler: function() { var $element = $(this.element), $childs = $('.animate_when_parent_almost_visible', $element); $childs.each(function(key,el){ var $child = $(el), delaySpeed = $child.attr('data-speed'), delayAttr = $child.attr('data-delay'), intervalAttr = $child.attr('data-interval'); if (delayAttr == undefined) { delayAttr = 50*key; } requestTimeout(function() { if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) { $all_first.attr('data-already-reached', 'true'); } $child.addClass('start_animation'); if ( $child.hasClass('anim-line-checker') ) { $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { var $line = $child.closest('.heading-line-wrap'); }); } var $wrapText = $child.closest('.animate_inner_when_almost_visible'); highlightComplexFunc($wrapText, ev); if ( $child.hasClass('anim-tot-checker') ) { $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { if ( $child.hasClass('anim-tot-checker') ) { $wrapText.addClass('already-animated'); } }); } }, delayAttr ); }); $element.addClass('start_animation'); if (!UNCODE.isUnmodalOpen) { this.destroy(); } }, offset: UNCODE.isFullPage ? '100%' : '90%' }); } }); } var runWaypoints = function(ev){ if ( typeof runWaypoints_TO !== 'undefined' && runWaypoints_TO !== '' ) { runWaypoints_delay = 400; } clearRequestTimeout(runWaypoints_TO); runWaypoints_TO = requestTimeout(function() { window.waypoint_animation(ev); }, runWaypoints_delay); clearRequestTimeout(runWaypoints_carousel_TO); runWaypoints_carousel_TO = requestTimeout(function() { window.waypoint_carousel_animation(ev); }, 400); }; runWaypoints(); $( document.body ).on( 'uncode_waypoints defer-highlights', function(ev) { runWaypoints(ev); }); if ( $('body').hasClass('compose-mode') && typeof window.parent.vc !== 'undefined' ) { window.parent.vc.events.on( 'shortcodeView:updated', runWaypoints ); } }; })(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Генерация страницы: 0.04 |
proxy
|
phpinfo
|
Настройка