Теория и практика / iRacing
Аналитический обзор трёх малоизвестных параметров iRacing в конфигурационных файлах: управление детализацией зеркал, отключение объектов пит-лейн и…
Игровые новости / Automobilista 2
Обзор обновления AMS2 V1.6.9.5: новые формульные классы F-Edge (три модели: V12, V10, V8) и F-Hybrid Gen1, ревизия физики для формульных классов и…
Игровые новости / Assetto Corsa Evo
Kunos Simulazioni официально анонсировали добавление Lamborghini Countach LP5000 Quattrovalvole в ранний доступ Assetto Corsa Evo. Культовый суперкар…
Публикации / Project Motor Racing
Вышел Japanese GT500 Pack для Project Motor Racing. 9 легендарных автомобилей JGTC 2002–2004 и Super GT 2021–2024, включая Toyota Supra A80, Nissan…
Игровые новости / Le Mans Ultimate
В Le Mans Ultimate вышло бесплатное обновление 1.3 с гиперкаром Genesis GMR-001 — первой машиной сезона FIA WEC 2026. Также: поддержка Logitech…
Игровые новости / Assetto Corsa Evo
В версии 0.6 раннего доступа Assetto Corsa EVO появятся Ford Mustang GT3, Ferrari 296 GT3 и трасса Sebring. Когда выйдет обновление, какие ещё…
Игровые новости / Le Mans Ultimate
Le Mans Ultimate: обновление 1.3 и финальный DLC с ELMS выходят 31 марта. Duqueine D09, трасса Барселона, поддержка Logitech Trueforce и ускорение…
Игровые новости / Project Motor Racing
Подробный обзор дополнения Japanese GT500 Pack для Project Motor Racing. Все автомобили Super GT и JGTC, новая трасса Takimiya Circuit, детали…
Игровые новости / Project Motor Racing
Вышло крупное обновление Project Motor Racing 2.0. Подробный разбор: новая карьера с подиумами и спонсорами, переработанная физика с новыми моделями…
Публикации / Новости Hardware / iRacing
iRacing, Apple Vision Pro и NVIDIA CloudXR объединяются, чтобы вывести симрейсинг на новый уровень. Разбираем технологии, перспективы и вызовы…
Игровые новости / Assetto Corsa Evo
Kunos Simulazioni представила Ferrari 288 GTO для обновления Assetto Corsa EVO v0.6. Узнайте, какие ещё 5 машин и новая трасса появятся в игре, а…
Игровые новости / Assetto Corsa Rally
Peugeot 306 Maxi и Subaru Impreza Group A готовятся к выходу в Assetto Corsa Rally. Релиз ожидается в обновлении v0.5 в июне 2026. Подробности о…
${platformName}
${video.title}
${categoryName}
`;
// Динамически загружаем превью
getVideoThumbnail(video, (thumbnailUrl) => {
const thumbnailContainer = videoCard.querySelector('.video-thumbnail');
thumbnailContainer.innerHTML = `
${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);
{mlinks}
Back to top button