Файловый менеджер - Редактировать - /home/digitalm/www/zetaworks/wp-content/themes/uncode/library/js/textMarquee.min.js
Назад
(function($){"use strict";var marqueeAttempts=0,marqueeTO;UNCODE.textMarquee=function($titles){typeof $titles=="undefined"&&($titles=$(".un-text-marquee"));if(!$titles.length)return;$titles.each(function(){var $title=$(this),$span=$("> span",$title),txt,first=!0,newW=UNCODE.wwidth;$(".marquee-clone-wrap",$title).remove(),txt=$title.text(),$(".marquee-original-core",$span).length||($span=$("> span",$title).wrapInner('<span class="marquee-original-core" />').addClass("marquee-original"));var checkResize,spanW,$prepended=$('<span class="marquee-clone-wrap wrap-prepended" />'),$appended=$('<span class="marquee-clone-wrap wrap-appended" />'),clearSpeed,speed=10;$span.prepend($prepended),$span.append($appended);var continuousTextMarquee=function(){var bound=$title.css({transform:"none",opacity:0}).offset(),xStrt=first||$title.hasClass("un-marquee-infinite")?0:UNCODE.wwidth-bound.left,xEnd=$title.hasClass("un-marquee-infinite")?spanW:spanW+bound.left,xSpeed=$title.hasClass("un-marquee-infinite")?spanW+bound.left:xStrt+(UNCODE.wwidth+bound.left),direction=$title.hasClass("un-marquee-opposite")?1:-1,marqueeTL=new TimelineMax({paused:!0,reversed:!0}),inview=new Waypoint.Inview({element:$title[0],enter:function(direction){marqueeTL.play()},exited:function(direction){marqueeTL.pause()}});marqueeTL.fromTo($title,{opacity:1,x:xStrt},{duration:xSpeed/UNCODE.wwidth*speed,x:xEnd*direction,onComplete:function(){first=!1,continuousTextMarquee()},ease:Linear.easeNone})},runTextMarquee=function(){var time=Date.now(),textMarqueeScroll=function(){var bound=bound=$title[0].getBoundingClientRect(),wait=100,direction=$title.hasClass("un-marquee-scroll-opposite")?-1:1;bound.top===0&&bound.bottom===0&&bound.left===0&&bound.right===0&&bound.height===0&&bound.width===0&&bound.x===0&&bound.y===0&&marqueeAttempts<2&&(clearRequestTimeout(marqueeTO),marqueeTO=requestTimeout(function(){marqueeAttempts++,UNCODE.textMarquee()},100)),time+wait-Date.now()<0&&(bound.top>bound.height*-4&&bound.top-bound.height<UNCODE.wheight*2&&(gsap.killTweensOf($title),gsap.to($title,{duration:.5,x:(UNCODE.wheight*.35-bound.top)*.5*direction})),time=Date.now())};textMarqueeScroll(),$(window).on("load scroll",function(){textMarqueeScroll()})},cloneSpan=function($_title,cntnt){$_title.hasClass("un-marquee-infinite")&&$("> span.marquee-clone-wrap",$_title).text(""),gsap.to($_title,{duration:0,x:0}),spanW=$span.outerWidth();if(!spanW)return;var part=Math.ceil(UNCODE.wwidth/spanW)*2;if($_title.hasClass("un-marquee-infinite"))for(var i=0;i<part;i++)$prepended[0].textContent+=cntnt+" ",$appended[0].textContent+=cntnt+" ";if($("body").hasClass("compose-mode"))return;($_title.hasClass("un-marquee")||$_title.hasClass("un-marquee-opposite"))&&continuousTextMarquee(),($_title.hasClass("un-marquee-scroll")||$_title.hasClass("un-marquee-scroll-opposite"))&&runTextMarquee()},marqueResize=function(){clearRequestTimeout(checkResize),checkResize=requestTimeout(function(){newW!==UNCODE.wwidth&&(gsap.killTweensOf($title),UNCODE.textMarquee(),newW=UNCODE.wwidth)},1e3)};$(window).off("resize",marqueResize).on("resize",marqueResize),cloneSpan($title,txt),$("body").hasClass("compose-mode")&&typeof window.parent.vc!="undefined"&&window.parent.vc.events.on("shortcodeView:updated",function(e){var $_titles=$(".un-text-marquee",e.view.$el);UNCODE.textMarquee($_titles)})})}})(jQuery)
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Генерация страницы: 0.04 |
proxy
|
phpinfo
|
Настройка