PageSourceSearch

https://motorica.org/local/components/motorica/preview/templates/shedule_tag/script.js?17859287371486

js motorica.org collected 2026-09-28 08:08:17 UTC 1,486 bytes, 31 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function () {
2    const blogPreviewSections = document.querySelectorAll('.blog-preview-section');
3
4    blogPreviewSections.forEach(section => {
5        const filterButtons = section.querySelectorAll('.blog-filters .filter-btn');
6        const articles = section.querySelectorAll('.articles-grid .article-card');
7
8        if (filterButtons.length > 0 && articles.length > 0) {
9            filterButtons.forEach(button => {
10                button.addEventListener('click', function () {
11                    // Убираем active класс у всех кнопок в этой секции
12                    filterButtons.forEach(btn => btn.classList.remove('active'));
13                    // Добавляем active класс к нажатой кнопке
14                    this.classList.add('active');
15
16                    const filterValue = this.dataset.filter;
17
18                    articles.forEach(article => {
19                        const categories = article.dataset.categories;
20
21                        if (filterValue === 'all' || (categories && categories.includes(filterValue))) {
22                            article.style.display = 'flex'; // Убедитесь, что это ваш display по умолчанию
23                        } else {
24                            article.style.display = 'none';
25                        }
26                    });
27                });
28            });
29        }
30    });
31});

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.