Top.Mail.Ru
World of Outlaws: Dirt Racing Game - описание игры, системные требования, оценки игроков, дата выхода

World of Outlaws: Dirt Racing — это гоночный симулятор, созданный для фанатов грунтовых гонок. Игра позволяет погрузиться в атмосферу профессиональных соревнований на грунтовых трассах, включая культовые серии World of Outlaws. Основное внимание уделено реализму, так что игроки смогут почувствовать … Подробнее

Видеоматериалы по игре World of Outlaws: Dirt Racing 24

Видео галерея из World of Outlaws: Dirt Racing 24 - трейлеры, геймплей

${platformName}

${video.title}

${categoryName} `; // Динамически загружаем превью getVideoThumbnail(video, (thumbnailUrl) => { const thumbnailContainer = videoCard.querySelector('.video-thumbnail'); thumbnailContainer.innerHTML = ` ${video.title}
${platformName}
`; }); videoCard.addEventListener('click', (e) => { if (!e.target.closest('.clickable-category')) { openVideoInModal(video); } }); return videoCard; } // Рендеринг порции видео function renderVideosChunk(videos) { currentVideos = videos; currentIndex = Math.min(videos.length, currentIndex + videosPerPage); const chunk = videos.slice(0, currentIndex); videoGallery.innerHTML = ""; if (videos.length === 0) { videoGallery.innerHTML = "

Нет видео для отображения.

"; return; } chunk.forEach(video => { const videoCard = createVideoCard(video); videoGallery.appendChild(videoCard); }); } // Рендеринг кнопки "Показать ещё" function renderLoadMoreButton(filteredVideos) { const loadMoreContainer = document.getElementById("load-more-container"); if (loadMoreContainer) loadMoreContainer.remove(); if (currentIndex >= filteredVideos.length) return; const container = document.createElement("div"); container.id = "load-more-container"; container.style.textAlign = "center"; container.style.marginTop = "20px"; const button = document.createElement("button"); button.textContent = "Показать ещё"; button.style.padding = "10px 20px"; button.style.fontSize = "16px"; button.addEventListener("click", () => { renderVideosChunk(filteredVideos); renderLoadMoreButton(filteredVideos); }); container.appendChild(button); videoGallery.parentElement.appendChild(container); } // Рендеринг кнопок фильтрации function renderFilterButtons(categoriesList) { filterButtonsContainer.innerHTML = ""; const allButton = document.createElement("button"); allButton.textContent = "Все"; allButton.dataset.categoryId = "all"; allButton.classList.add("active"); allButton.addEventListener("click", () => { document.querySelectorAll(".filter-buttons button").forEach(btn => btn.classList.remove("active")); allButton.classList.add("active"); const filteredVideos = filterVideos('all'); currentIndex = 0; renderVideosChunk(filteredVideos); renderLoadMoreButton(filteredVideos); }); filterButtonsContainer.appendChild(allButton); categoriesList.forEach(category => { if (category.id === 'all') return; const button = document.createElement("button"); button.textContent = category.name; button.dataset.categoryId = category.id; button.addEventListener("click", () => { document.querySelectorAll(".filter-buttons button").forEach(btn => btn.classList.remove("active")); button.classList.add("active"); const filteredVideos = filterVideos(category.id); currentIndex = 0; renderVideosChunk(filteredVideos); renderLoadMoreButton(filteredVideos); }); filterButtonsContainer.appendChild(button); }); } // Обработчик клика по категории document.addEventListener('click', (e) => { if (e.target.classList.contains('clickable-category')) { e.preventDefault(); e.stopPropagation(); const categoryId = e.target.dataset.categoryId; const button = document.querySelector(`.filter-buttons button[data-category-id="${categoryId}"]`); if (button) button.click(); } }); // Инициализация renderFilterButtons(categories); const initialVideos = filterVideos('all'); renderVideosChunk(initialVideos); renderLoadMoreButton(initialVideos);
Back to top button
Подписаться

Подпишитесь на наш
Телеграм канал и будьте в курсе последних новостей

Подписаться

Подпишитесь на нашу
группу ВКонтакте и не пропустите ничего важного!