PageSourceSearch

https://ravandarman.com/blog/wp-content/themes/hello-child/assets/script.js?ver=1790292185

js ravandarman.com collected 2026-09-25 02:46:50 UTC 5,455 bytes, 166 lines download raw bytes

1jQuery(document).ready(function($){
2	$('.cat-content .elementor-nav-menu > li > a').on('click' , function(e){
3        e.preventDefault();
4		$(this).parent('li').toggleClass('active');
5		 $(this).siblings('.sub-menu').toggleClass('active');
6    });
7	$('#ez-toc-widget-container').on('click' , function(){
8		$('.ez-toc-title-container').toggleClass('open');
9		$('#ez-toc-widget-container nav').slideToggle(300);
10	});
11    $('.cat-header').on('click' , function(){
12        $('.dwah-humber').toggleClass('openToggle');
13        $('.cat-content').slideToggle('300');
14    });
15    $('.btn-search').on('click' , function(e){
16        e.preventDefault();
17        $('.search-box').slideToggle('100');
18    });
19	  $('.grid-posts-horz .elementor-post-info__terms-list').each(function() {
20    var text = $(this).html();
21    text = text.replace(/,\s*/g, '');
22    $(this).html(text);
23  });
24      $('.copy-link').on('click', function(e) {
25        e.preventDefault();
26        const tempInput = $('<input>');
27        $('body').append(tempInput);
28        tempInput.val(window.location.href).select();
29        document.execCommand('copy');
30        tempInput.remove();
31        if ($('#copy-message').length === 0) {
32            $('body').append('<div id="copy-message">لینک کپی شد!</div>');
33        }
34        $('#copy-message').css({
35            'position': 'fixed',
36            'top': '50%',
37            'left': '50%',
38            'transform': 'translate(-50%, -50%)',
39            'background': 'rgba(0, 0, 0, 0.8)',
40            'color': '#fff',
41            'padding': '1rem 2rem',
42            'border-radius': '10px',
43            'font-size': '18px',
44            'z-index': '9999',
45            'display': 'none'
46        }).fadeIn(300);
47
48        setTimeout(function() {
49            $('#copy-message').fadeOut(300);
50        }, 2000);
51    });
52});
53
54document.addEventListener("DOMContentLoaded", function () {
55    const slider = document.querySelector("#topExpert");
56    if (!slider || window.innerWidth > 768) return;
57
58    let items = Array.from(slider.querySelectorAll(".userprofmain"));
59    let index = 1; // از آیتم واقعی شماره 1 شروع می‌کنیم
60    const firstClone = items[0].cloneNode(true);
61    const lastClone = items[items.length - 1].cloneNode(true);
62
63    slider.insertBefore(lastClone, items[0]);   // کلون آخر → جلوی لیست
64    slider.appendChild(firstClone);             // کلون اول → آخر لیست
65
66    items = Array.from(slider.querySelectorAll(".userprofmain"));
67
68    function getItemWidth() {
69        return items[0].getBoundingClientRect().width + 21;
70    }
71
72    slider.style.transform = `translateX(${index * getItemWidth()}px)`;
73
74    const pagination = document.createElement("div");
75    pagination.style.display = "flex";
76    pagination.style.justifyContent = "center";
77    pagination.style.gap = "6px";
78    pagination.style.marginBottom = "30px";
79
80    for (let i = 0; i < items.length - 2; i++) {
81        const dot = document.createElement("span");
82        dot.style.width = "8px";
83        dot.style.height = "8px";
84        dot.style.borderRadius = "99px";
85        dot.style.background = i === 0 ? "#27B080" : "#bbb";
86        pagination.appendChild(dot);
87    }
88
89    slider.after(pagination);
90    const dots = pagination.querySelectorAll("span");
91
92    function updatePagination(i) {
93        const realIndex = (i - 1 + (dots.length)) % dots.length;
94
95        dots.forEach((dot, k) => {
96            dot.style.background = k === realIndex ? "#27B080" : "#bbb";
97            dot.style.width = k === realIndex ? "24px" : "8px";
98        });
99    }
100
101    function goToSlide(i, animated = true) {
102        const w = getItemWidth();
103        slider.style.transition = animated ? "transform 0.4s ease" : "none";
104        slider.style.transform = `translateX(${i * w}px)`;
105        updatePagination(i);
106    }
107
108    function autoSlide() {
109        index++;
110        goToSlide(index);
111    }
112
113    let autoTimer = setInterval(autoSlide, 4000);
114
115    slider.addEventListener("transitionend", () => {
116        if (items[index] === firstClone) {
117            index = 1; // برگشت به آیتم واقعی اول
118            goToSlide(index, false);
119        }
120        if (items[index] === lastClone) {
121            index = items.length - 2; // برگشت به آخرین آیتم واقعی
122            goToSlide(index, false);
123        }
124    });
125
126    let startX = 0;
127    let currentX = 0;
128    let isDragging = false;
129
130    slider.addEventListener("touchstart", (e) => {
131        clearInterval(autoTimer);
132        slider.style.transition = "none";
133        startX = e.touches[0].clientX;
134        isDragging = true;
135    });
136
137    slider.addEventListener("touchmove", (e) => {
138        if (!isDragging) return;
139        currentX = e.touches[0].clientX;
140
141        const diff = currentX - startX;
142        const w = getItemWidth();
143        const base = index * w;
144
145        slider.style.transform = `translateX(${base + diff}px)`;
146    });
147
148    slider.addEventListener("touchend", () => {
149        if (!isDragging) return;
150        isDragging = false;
151
152        const diff = currentX - startX;
153        const threshold = 50;
154
155        if (diff < -threshold) {
156			            index--; // کشیدن به راست → اسلاید قبلی
157
158        } else if (diff > threshold) {
159			            index++; // کشیدن به چپ → اسلاید بعدی
160
161        }
162
163        goToSlide(index);
164        autoTimer = setInterval(autoSlide, 4000);
165    });
166});

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.