PageSourceSearch

https://it-dimension.com/wordpress/wp-content/themes/astra-child/assets/js/portfolio.js

js it-dimension.com collected 2026-10-07 20:28:26 UTC 15,659 bytes, 430 lines download raw bytes

1//file1
2
3let isInitialLoad = true; 
4let prevFilterCount = 0;
5
6var navSelectTechnology = '.itd-ptf-t';
7var navSelectCategory = '.itd-ptf-c';
8
9var navTags = '.itd-ptf-tc-list';
10
11var listBlock = '#itd-ptf-list';
12var setView = 'itd-ptf-position';
13
14var checkBoxFalse = '<svg aria-hidden="true" class="svg-icon icon icon--checkbox-unchecked" focusable="false"><use xlink:href="#icon-checkbox-unchecked"></use></svg>';
15var checkBoxTrue = '<svg aria-hidden="true" class="svg-icon icon icon--checkbox-checked" focusable="false"><use xlink:href="#icon-checkbox-checked"></use></svg>';
16
17var updateEventsParam = false;
18
19jQuery(function ($) {
20    $(navSelectTechnology + ' > p').click(function () {
21        if ($(navSelectTechnology + ' > div').is(':visible')) {
22            $(navSelectTechnology + ' > div').hide();
23            $('.itd-ptf-t > p, .itd-ptf-t > p svg path').attr('style', '');
24        } else {
25            $(navSelectTechnology + ' > div').css('display', 'flex');
26            $('.itd-ptf-t > p, .itd-ptf-t > p svg path').css('cssText', 'color:#002DCB;fill:#002DCB;');
27        }
28    });
29
30    $(listBlock + ' > div').click(function () {
31        var dataHref = $(this).attr('data-href');
32        if (dataHref) {
33            window.location = $(this).attr('data-href');
34        }
35    });
36
37    $(navSelectCategory + ' > p').click(function () {
38        if ($(navSelectCategory + ' > div').is(':visible')) {
39            $(navSelectCategory + ' > div').hide();
40            $('.itd-ptf-c > p, .itd-ptf-c > p svg path').attr('style', '');
41        } else {
42            $(navSelectCategory + ' > div').css('display', 'flex');
43            $('.itd-ptf-c > p, .itd-ptf-c > p svg path').css('cssText', 'color:#002DCB;fill:#002DCB;');
44        }
45    });
46
47    $('body').click(function (e) {
48        if (!$(navSelectTechnology).is(e.target)
49            && $(navSelectTechnology).has(e.target).length === 0
50            && $(navSelectTechnology + " > div").has(e.target).length === 0
51        ) {
52            $(navSelectTechnology + " > div").hide();
53            $('.itd-ptf-t > p, .itd-ptf-t > p svg path').attr('style', '');
54        }
55
56        if (!$(navSelectCategory).is(e.target)
57            && $(navSelectCategory).has(e.target).length === 0
58            && $(navSelectCategory + " > div").has(e.target).length === 0
59        ) {
60            $(navSelectCategory + " > div").hide();
61            $('.itd-ptf-c > p, .itd-ptf-c > p svg path').attr('style', '');
62        }
63    });
64
65    $('.' + setView + ' p').click(function () {
66        var a = $(this).attr('data-type');
67        $(listBlock).attr('class', '');
68        $('.' + setView + ' p').removeClass(setView + '-active');
69
70        $(listBlock).addClass(a);
71        $(this).addClass(setView + '-active')
72    });
73
74    $(navSelectTechnology + ' > div p span,' + navSelectCategory + ' > div p span').append(checkBoxFalse);
75
76    $(navSelectTechnology + ' > div input').change(function () {
77        var a = $(this).val();
78        var b = $(navTags + ' p[data-tech="' + a + '"]').length;
79        $(navSelectTechnology + ' > div input[value="' + a + '"]').siblings('span').find('svg').remove();
80
81        /*
82               if(b > 0){
83                  $(navTags + ' p[data-tech="'+a+'"]').remove();
84                  $(navSelectCategory + ' > div input[value="'+a+'"]').siblings('span').find('svg').remove();
85                  $(navSelectTechnology + ' > div input[value="'+a+'"]').siblings('span').append(checkBoxFalse);
86                  $(navSelectCategory + ' > div input[value="'+a+'"]').siblings('span').append(checkBoxFalse);
87               } else {
88                  var label = $(this).closest('label').clone();
89                  label.find('input').prop('checked', true);
90                  label.appendTo(navTags);
91                  label.find('span').text('x');
92                  label.find('input').attr('onClick', 'removeTag("'+a+'","")');
93        
94                  $(navSelectTechnology + ' > div input[value="'+a+'"]').siblings('span').append(checkBoxTrue);
95               }
96        
97        */
98        $('#clickApplyPage').click(function () {
99            updateList();
100        });
101    });
102
103
104    $(document).on('click', '.ptTagBox .prt-name-category', function(e) {
105        e.preventDefault();
106        e.stopPropagation();
107
108        const slug = $(this).data('slug'); 
109        const type = $(this).data('type'); 
110
111        let targetCheckbox;
112
113        if (type === 'tech') {
114            targetCheckbox = $('.itd-ptf-t input[type="checkbox"][value="' + slug + '"]');
115        } else if (type === 'catg') {
116            targetCheckbox = $('.itd-ptf-c input[type="checkbox"][value="' + slug + '"]');
117        }
118        
119        if (targetCheckbox && targetCheckbox.length > 0) {
120            const isCurrentlyChecked = targetCheckbox.prop('checked');
121            
122            targetCheckbox.prop('checked', !isCurrentlyChecked);
123            
124            updateList();
125
126            isInitialLoad = false;
127        }
128    });
129    
130
131    $(navSelectCategory + ' > div input').change(function () {
132        var b = $(this).val();
133        $(navSelectCategory + ' > div input[value="' + b + '"]').siblings('span').find('svg').remove();
134        var c = $(navTags + ' p[data-catg="' + b + '"]').length;
135        /*
136               if(c > 0){
137                  $(navTags + ' p[data-catg="'+b+'"]').remove();
138                  $(navSelectCategory + ' > div input[value="'+b+'"]').siblings('span').append(checkBoxFalse);
139                  $(navSelectCategory + ' > div input[value="'+b+'"]').closest('p').removeClass('active-category');
140                  $(navSelectCategory + ' > div input[value="'+b+'"]').closest('p').addClass('inactive-category');
141        
142               } else {
143                  var label = $(this).closest('label').clone();
144                  label.find('input').prop('checked', true);
145                  label.appendTo(navTags);
146                  label.find('span').text('x');
147                  label.find('input').attr('onClick', 'removeTag("","'+b+'")');
148        
149                  $(navSelectCategory + ' > div input[value="'+b+'"]').siblings('span').append(checkBoxTrue);
150                  $(navSelectCategory + ' > div input[value="'+b+'"]').closest('p').addClass('active-category');
151                  $(navSelectCategory + ' > div input[value="'+b+'"]').closest('p').removeClass('inactive-category');
152               }
153        */
154        $('#clickApplyCategory').click(function () {
155            updateList();
156        });
157    });
158
159    $('#clickClearCategory').click(function () {
160        $(navSelectCategory + ' > div input').prop('checked', false).change();
161
162        $('#clickApplyCategory').click(function () {
163            isUpdateListEnabled = true;
164            updateList();
165            isUpdateListEnabled = false;
166        });
167    });
168
169
170
171    $('#clickClearPage').click(function () {
172        $(navSelectTechnology + ' > div input').prop('checked', false).change();
173
174        $('#clickApplyPage').click(function () {
175            isUpdateListEnabled = true;
176            updateList();
177            isUpdateListEnabled = false;
178        });
179    });
180
181    var isCategoryAllChecked = false;
182    var isPageAllChecked = false;
183
184    $('#clickAllCategory input').change(function () {
185        isCategoryAllChecked = $(this).prop('checked');
186        $(navSelectCategory + ' > div input').prop('checked', isCategoryAllChecked);
187        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
188    });
189
190    $('#clickAllPage input').change(function () {
191        isPageAllChecked = $(this).prop('checked');
192        $(navSelectTechnology + ' > div input').prop('checked', isPageAllChecked);
193        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
194    });
195
196    $('#clickApplyCategory').click(function () {
197        if (isCategoryAllChecked) {
198            isUpdateListEnabled = true;
199            updateList();
200            isUpdateListEnabled = false;
201        }
202    });
203
204    $('#clickApplyPage').click(function () {
205        if (isPageAllChecked) {
206            isUpdateListEnabled = true;
207            updateList();
208            isUpdateListEnabled = false;
209        }
210    });
211
212    $(navSelectCategory + ' > div input').change(function () {
213        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
214    });
215
216    $(navSelectTechnology + ' > div input').change(function () {
217        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
218    });
219
220    function updateCheckAllCheckbox(checkAllId, containerSelector) {
221        var $checkAll = $(checkAllId + ' input');
222        var $checkboxes = $(containerSelector + ' > div input');
223
224        $checkAll.prop('checked', $checkboxes.length === $checkboxes.filter(':checked').length);
225    }
226
227    $(document).on('change', navSelectTechnology + ' > div input, ' + navSelectCategory + ' > div input', function () {
228        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
229        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
230    });
231
232    $('#clickApplyPage, #clickApplyCategory').click(function () {
233        isUpdateListEnabled = true;
234        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
235        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
236        isUpdateListEnabled = false;
237    });
238
239    $(navSelectTechnology + ' > div input').change(function () {
240        isUpdateListEnabled = true;
241        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
242        isUpdateListEnabled = false;
243    });
244
245    $(navSelectCategory + ' > div input').change(function () {
246        isUpdateListEnabled = true;
247        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
248        isUpdateListEnabled = false;
249    });
250
251    $('#clickApplyPage, #clickApplyCategory').click(function () {
252        updateCheckAllCheckbox('#clickAllPage', navSelectTechnology);
253        updateCheckAllCheckbox('#clickAllCategory', navSelectCategory);
254    });
255
256    function updateCheckAllCheckbox(checkAllSelector, navSelect) {
257        var allCheckboxInputs = $(navSelect + ' > div input');
258        var nonCheckAllCheckboxInputs = allCheckboxInputs.not(checkAllSelector + ' input[type="checkbox"]');
259
260        var allChecked = nonCheckAllCheckboxInputs.length > 0 && nonCheckAllCheckboxInputs.filter(':checked').length === nonCheckAllCheckboxInputs.length;
261        $(checkAllSelector + ' input[type="checkbox"]').prop('checked', allChecked);
262    }
263
264
265
266});
267
268
269
270function removeTag(a, b) {
271    if (b != "") {
272        jQuery(navSelectCategory + ' > div p[data-catg="' + b + '"]').click();
273    } else {
274        jQuery(navSelectTechnology + ' > div p[data-tech="' + a + '"]').click();
275    }
276}
277
278function updateList() {
279    var selectedTech = [];
280    var selectedCatg = [];
281
282    jQuery('.itd-ptf-t > div input:checked').each(function () {
283        var value = jQuery(this).val();
284        if (value !== 'on') {
285            selectedTech.push(value);
286        }
287    });
288
289    jQuery('.itd-ptf-c > div input:checked').each(function () {
290        var value = jQuery(this).val();
291        if (value !== 'on') {
292            selectedCatg.push(value);
293        }
294    });
295
296    var techFilter = selectedTech.length > 0
297        ? '[data-tech*="' + selectedTech.join('"], [data-tech*="') + '"]'
298        : '';
299
300    var catgFilter = selectedCatg.length > 0
301        ? '[data-catg*="' + selectedCatg.join('"], [data-catg*="') + '"]'
302        : '';
303
304    if (techFilter !== '' && catgFilter !== '') {
305        var combinedFilter = techFilter + ', ' + catgFilter;
306    } else {
307        var combinedFilter = techFilter + catgFilter;
308    }
309
310    if (combinedFilter === '') {
311        jQuery(listBlock + " > div").show();
312    } else {
313        jQuery(listBlock + " > div").hide();
314        jQuery(listBlock + " > div" + combinedFilter).show();
315    }
316
317    jQuery('.case-chips').empty();
318
319    selectedTech.forEach(function (tech) {
320        if (tech !== 'on') {
321            var techName = jQuery('.itd-ptf-t > div label:has(input[value="' + tech + '"])').text().trim();
322            jQuery('.case-chips').append('<div class="chip" data-value="' + tech + '"><div class="chip"><span class="chip-text">' + techName + '</span><span class="chip-close">✕</span></div>');
323        }
324    });
325
326    selectedCatg.forEach(function (catg) {
327        if (catg !== 'on') {
328            var catgName = jQuery('.itd-ptf-c > div label:has(input[value="' + catg + '"])').text().trim();
329            jQuery('.case-chips').append('<div class="chip" data-value="' + catg + '"><div class="chip"><span class="chip-text">' + catgName + '</span><span class="chip-close">✕</span></div>');
330        }
331    });
332
333    var techFilterLink = selectedTech.length > 0 && !selectedTech.includes('on')
334        ? 'tech=' + selectedTech.join(',')
335        : '';
336
337    var catgFilterLink = selectedCatg.length > 0 && !selectedCatg.includes('on')
338        ? 'catg=' + selectedCatg.join(',')
339        : '';
340
341    var urlParams = '?' + [catgFilterLink, techFilterLink].filter(Boolean).join('&');
342    history.replaceState(null, null, urlParams);
343
344    jQuery('.chip').click(function () {
345
346        if (jQuery(this).attr('data-value')) {
347            var value = jQuery(this).attr('data-value');
348
349            if (jQuery('.itd-ptf-t > div input[value="' + value + '"]').length > 0) {
350                jQuery('.itd-ptf-t > div input[value="' + value + '"]').prop('checked', false);
351            }
352
353            if (jQuery('.itd-ptf-c > div input[value="' + value + '"]').length > 0) {
354                jQuery('.itd-ptf-c > div input[value="' + value + '"]').prop('checked', false);
355            }
356
357            updateList();
358        }
359    });
360
361    if (!isInitialLoad && selectedTech.length === 0 && selectedCatg.length === 0) {
362      
363        jQuery('html, body').animate({
364            scrollTop: jQuery('.itd-ptf-nav').offset().top - 100
365        }, 1500);
366    }
367
368}
369
370
371jQuery(document).ready(function () {
372    let dataUrl = window.location.search;
373    let urlParams = new URLSearchParams(dataUrl);
374    let urlParamsTech = urlParams.get('tech');
375    let urlParamsCat = urlParams.get('catg');
376
377    if (urlParamsTech != null || urlParamsCat != null) {
378        if (urlParamsTech != null) {
379            let techKey = urlParamsTech.split(',');
380            for (let i = 0; i < techKey.length; i++) {
381                jQuery('.itd-ptf-t > div input[value="' + techKey[i] + '"]').prop('checked', true).change();
382            }
383        }
384
385        if (urlParamsCat != null) {
386            let catKey = urlParamsCat.split(',');
387            for (let i = 0; i < catKey.length; i++) {
388                jQuery('.itd-ptf-c > div input[value="' + catKey[i] + '"]').prop('checked', true).change();
389            }
390        }
391
392        updateList();
393    }
394});
395
396
397
398// //file Lottie
399// var animation = bodymovin.loadAnimation({
400//     container: document.getElementById('bm1'),
401//     renderer: 'svg',
402//     loop: true,
403//     autoplay: true,
404//     path: 'https://assets5.lottiefiles.com/packages/lf20_hdze91qh.json'
405// });
406
407// var animation = bodymovin.loadAnimation({
408//     container: document.getElementById('bm2'),
409//     renderer: 'svg',
410//     loop: true,
411//     autoplay: true,
412//     path: 'https://assets6.lottiefiles.com/packages/lf20_y5udzouv.json'
413// });
414
415// var animation = bodymovin.loadAnimation({
416//     container: document.getElementById('bm3'),
417//     renderer: 'svg',
418//     loop: true,
419//     autoplay: true,
420//     path: 'https://assets5.lottiefiles.com/packages/lf20_bscokrdg.json'
421// });
422
423// var animation = bodymovin.loadAnimation({
424//     container: document.getElementById('bm4'),
425//     renderer: 'svg',
426//     loop: true,
427//     autoplay: true,
428//     path: 'https://assets4.lottiefiles.com/packages/lf20_1japhgcy.json'
429// });
430

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.