/** * @file seminar.js * @brief JavaScript pro interaktivní funkce na stránce semináře (seminar.php). * * Tento skript: * - Přidává funkce pro horizontální posouvání karet lektorů pomocí tlačítek "předchozí" a "následující" (šipky). * - Umožňuje posouvání karet v závislosti na šířce okna pro různé zařízení (mobil, tablet, desktop). * - Přidává hover efekty pro obrázky v sekci "Předsálí" a "2. varianta". */ document.getElementById("prevBtn").addEventListener("click", function () { const lectorCardsWrapper = document.querySelector(".lectorCardsWrapper"); if (window.innerWidth <= 576) { lectorCardsWrapper.scrollBy({ left: -550, behavior: "smooth" }); // Upraveno pro max-width 576px } else if (window.innerWidth <= 767) { lectorCardsWrapper.scrollBy({ left: -300, behavior: "smooth" }); // Upraveno pro mobilní rozlišení } else if (window.innerWidth >= 768 && window.innerWidth <= 992) { lectorCardsWrapper.scrollBy({ left: -600, behavior: "smooth" }); // Upraveno pro rozlišení na tabletu } else if (window.innerWidth <= 1399 && window.innerWidth >= 1230) { lectorCardsWrapper.scrollBy({ left: -760, behavior: "smooth" }); } else if (window.innerWidth >= 1200 && window.innerWidth <= 1230) { lectorCardsWrapper.scrollBy({ left: -700, behavior: "smooth" }); } else { lectorCardsWrapper.scrollBy({ left: -870, behavior: "smooth" }); } }); document.getElementById("nextBtn").addEventListener("click", function () { const lectorCardsWrapper = document.querySelector(".lectorCardsWrapper"); if (window.innerWidth <= 576) { lectorCardsWrapper.scrollBy({ left: 550, behavior: "smooth" }); // Upraveno pro max-width 576px } else if (window.innerWidth <= 767) { lectorCardsWrapper.scrollBy({ left: 300, behavior: "smooth" }); // Upraveno pro mobilní rozlišení } else if (window.innerWidth >= 768 && window.innerWidth <= 992) { lectorCardsWrapper.scrollBy({ left: 600, behavior: "smooth" }); // Upraveno pro rozlišení na tabletu } else if (window.innerWidth <= 1399 && window.innerWidth >= 1230) { lectorCardsWrapper.scrollBy({ left: 760, behavior: "smooth" }); } else if (window.innerWidth >= 1200 && window.innerWidth <= 1230) { lectorCardsWrapper.scrollBy({ left: 700, behavior: "smooth" }); } else { lectorCardsWrapper.scrollBy({ left: 870, behavior: "smooth" }); } }); //HOVER PŘEDSÁLÍ document.addEventListener("DOMContentLoaded", function () { const hoverText = document.querySelector(".hover-text"); const schoolingImage = document.getElementById("schoolingImage"); const hoverText2 = document.querySelector(".hover-text2"); const schoolingImage2 = document.getElementById("schoolingImage2"); if (hoverText && schoolingImage) { hoverText.addEventListener("mouseover", function () { schoolingImage.src = "media/fotogalery/rent/7.1.png"; // Změna na nový zdroj obrázku }); hoverText.addEventListener("mouseout", function () { schoolingImage.src = "media/rent/schooling/1.png"; // Změna zpět na původní zdroj obrázku }); } if (hoverText2 && schoolingImage2) { hoverText2.addEventListener("mouseover", function () { schoolingImage2.src = "media/fotogalery/rent/4.1.png"; // Změna na nový zdroj obrázku }); hoverText2.addEventListener("mouseout", function () { schoolingImage2.src = "media/rent/schooling/2.png"; // Změna zpět na původní zdroj obrázku }); } });