Игровые новости / Assetto Corsa Rally
Вышло обновление 0.4 Assetto Corsa Rally. Добавлены Peugeot 306 Maxi Kit Car и Subaru Impreza S3 Group A, снежный покров на трассах Alsace и Wales,…
Игровые новости / Project Motor Racing
Дополнение Japanese GT500 для Project Motor Racing внезапно убрали из магазинов Steam, PS Store и Xbox. Разработчики назвали причину — «деликатное…
Игровые новости / Track Day: From Street to Circuit
В Track Day: From Street to Circuit показали карьерный режим. Лазерное сканирование трассы Тор-Познань, клоны реальных машин и старт с убитых авто.…
Игровые новости / Gran Turismo 7
Обновление Gran Turismo 7 1.69 выходит 23 апреля 2026 года на PS4 и PS5. Три новых автомобиля: Renault Twingo, Yangwang U9, Porsche 911 (964) Turbo S…
Теория и практика / iRacing
iRacing полностью переписывает графический движок. Spark, многопоточность, новая физика шин, фовеативный рендеринг в VR и звук с реверберацией.…
Игровые новости / Assetto Corsa Evo
Assetto Corsa EVO Update 0.6 уже доступен. В обновлении: Ferrari 296 GT3, Lamborghini Countach, Porsche 911 GT3 R rennsport, трасса Sebring…
Теория и практика / 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. Когда выйдет обновление, какие ещё…
${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);
{slinks}
Back to top button