PATH:
home
/
niazsaze
/
public_html
/
wp-content
/
plugins
/
flatsome-plus
/
inc
/
addons
/
amazing-slider
/
assets
/
js
(function ($){ $(document).ready(function () { $('.button-prev').on('mouseenter', function () { $('.swiper-button-prev.swiper-button-prev1').css('background-color', '#f3f3f3'); }); $('.button-prev').on('mouseleave', function () { $('.swiper-button-prev.swiper-button-prev1').css('background-color', ''); }); $('.button-next').on('mouseenter', function () { $('.swiper-button-next.swiper-button-next1').css('background-color', '#f3f3f3'); }); $('.button-next').on('mouseleave', function () { $('.swiper-button-next.swiper-button-next1').css('background-color', ''); }); }); var count = 7; const swiper1 = new Swiper('.swiper1 .swiper', { direction: 'horizontal', speed: 800, rtl: true, loop: true, keyboard: true, effect: "fade", navigation: { nextEl: '.swiper-button-next1', prevEl: '.swiper-button-prev1', }, on:{ init: function(){ var nextIndex = (this.activeIndex + 1) % this.slides.length; const nextSlide = this.slides[nextIndex]; var nexth4Element = $(nextSlide).find('h4'); var nextText = nexth4Element.text(); var prevIndex = (this.activeIndex - 1 + this.slides.length) % this.slides.length; const prevSlide = this.slides[prevIndex]; var prevh4Element = $(prevSlide).find('h4'); var prevText = prevh4Element.text(); $('.swiper1').find('.product-name-left').text(prevText); $('.swiper1').find('.product-name-rigth').text(nextText); } } }); swiper1.on('slideChange', () => { var nextIndex = (swiper1.activeIndex + 1) % swiper1.slides.length; const nextSlide = swiper1.slides[nextIndex]; var nexth4Element = $(nextSlide).find('h4'); var nextText = nexth4Element.text(); var prevIndex = (swiper1.activeIndex - 1 + swiper1.slides.length) % swiper1.slides.length; const prevSlide = swiper1.slides[prevIndex]; var prevh4Element = $(prevSlide).find('h4'); var prevText = prevh4Element.text(); $('.swiper1').find('.product-name-left').text(prevText); $('.swiper1').find('.product-name-rigth').text(nextText); }); const swiper2 = new Swiper('.swiper2', { direction: 'horizontal', speed: 500, loop: true, effect: "fade", rtl: true, navigation: { nextEl: '.swiper-button-next2', prevEl: '.swiper-button-prev2', }, on:{ init:function(){ const activeSlider = this.slides[this.activeIndex]; var activeName = $(activeSlider).find('.slider-name-product').text(); $('.slider-name').empty().text(activeName); } } }); swiper2.on('slideChange', () => { const activeSlider = swiper2.slides[swiper2.activeIndex]; var activeName = $(activeSlider).find('.slider-name-product').text(); $('.slider-name').text(activeName); }) function updateCircle($element, value, maxValue) { var perimeter = 2 * Math.PI * 17.5; // محیط دایره var offset = perimeter * (1 - value / maxValue); $($element).css('stroke-dashoffset', offset); } function decreaseCount() { if (count > 0) { count--; } else { count = 7; swiper1.slideNext(); swiper2.slideNext(); } $('.slider-count .timer-second-count p').text(count); updateCircle('.timer-second-count .foreground-circle', count, 7); $('.timer-second-mobile p').text(count); updateCircle('.timer-second-mobile .foreground-circle', count, 7); } setInterval(decreaseCount, 1000); $('.wdplus-timer').each(function() { var $this = $(this); dayjs.extend(window.dayjs_plugin_utc); dayjs.extend(window.dayjs_plugin_timezone); var time = dayjs.tz($this.data('end-date'), $this.data('timezone')); $this.countdown(time.toDate(), function(event) { if ( 'yes' === $this.data('hide-on-finish') && 'finish' === event.type ) { $this.parent().addClass('wd-hide'); } if( $this.hasClass('slider-timer') ) { $this.html(event.strftime('' + '<div ><span class="slider-timer-days">%-D</span> <span>' + contdonwScript.countdown_days + '</span></div>: ' + '<div ><span class="slider-timer-hours">%H</span> <span>' + contdonwScript.countdown_hours + '</span></div>: ' + '<div ><span class="slider-timer-min">%M</span> <span>' + contdonwScript.countdown_mins + '</span></div>: ' + '<div ><span class="slider-timer-second">%S</span> <span>' + contdonwScript.countdown_sec + '</span></div>')); }else if( $this.hasClass('amazing-slider-timer') ) { updateCircle($this.find('.timer-days .foreground-circle'), event.strftime('%-D'), 60); updateCircle($this.find('.timer-hours .foreground-circle'), event.strftime('%H'), 24); updateCircle($this.find('.timer-min .foreground-circle'), event.strftime('%M'), 60); updateCircle($this.find('.timer-second .foreground-circle'), event.strftime('%S'), 60); $this.find('.timer-days p:first-of-type').text(event.strftime('%-D')); $this.find('.timer-hours p:first-of-type').text(event.strftime('%H')); $this.find('.timer-min p:first-of-type').text(event.strftime('%M')); $this.find('.timer-second p:first-of-type').text(event.strftime('%S')); }else if($this.hasClass('amazing-slider-timer-layou-2')) { $this.find('.timer-days').text(event.strftime('%-D')); $this.find('.timer-hours').text(event.strftime('%H')); $this.find('.timer-min').text(event.strftime('%M')); $this.find('.timer-second').text(event.strftime('%S')); } }); }); })(jQuery);
[-] jquery.countdown.min.js
[edit]
[-] master.js
[edit]
[-] swiper.min.js
[edit]
[-] script.js
[edit]
[+]
..