Моя кнопка перехода ко второй хороша и работает, но я хочу, чтобы фон был включен в переход, например: на первой странице у меня есть синий фон, поле описания и кнопка «Начать». Я хочу, чтобы цвет фона изменился на красный с тем же переходом, что и у моей кнопки и поля описания, а затем наоборот, когда я перейду на вторую страницу. Кроме того, моя кнопка «домой» на второй странице не работает, я имею в виду, что переход не применяется, когда я нажимаю на нее. Я хочу, чтобы все двигалось вверх и вниз.
const getStartedButton = document.getElementById("getStartedButton");
const homeButton = document.getElementById("homeButton");
const desc = document.querySelector(".description");
const slideButton = document.querySelector(".slide");
// Event listener for the get started button
getStartedButton.addEventListener("click", function() {
desc.classList.add("hide-description"); // Add class to hide description
slideButton.classList.add("hide-button"); // Add class to hide button
setTimeout(function() {
document.querySelector(".about").classList.add("show-about"); // Add class to show 'about' section after transition ends
document.querySelector(".homebut").classList.add("show-homebut");
desc.style.display = "none";
slideButton.style.display = "none";
}, 2000); // Adjust this time to match the duration of the transition in CSS
});
// Event listener for the home button
homeButton.addEventListener("click", function() {
document.querySelector(".about").classList.remove("show-about"); // Remove class to hide 'about' section
document.querySelector(".homebut").classList.remove("show-homebut");
setTimeout(function() {
desc.classList.remove("hide-description"); // Remove class to show description
slideButton.classList.remove("hide-button"); // Remove class to show button
desc.style.display = "block";
slideButton.style.display = "block";
}, 2000); // Adjust this time to match the duration of the transition in CSS
});
Yusisista Minimap is a web-based application that provides students and visitors with easy access to navigate the UCC Congress campus, allowing them to locate desired facilities, offices, and rooms with ease and efficiency.
Get started
HIIIIIIIIIIIIIIIII
Home
Моя кнопка перехода ко второй хороша и работает, но я хочу, чтобы фон был включен в переход, например: на первой странице у меня есть синий фон, поле описания и кнопка «Начать». Я хочу, чтобы цвет фона изменился на красный с тем же переходом, что и у моей кнопки и поля описания, а затем наоборот, когда я перейду на вторую страницу. Кроме того, моя кнопка «домой» на второй странице не работает, я имею в виду, что переход не применяется, когда я нажимаю на нее. Я хочу, чтобы все двигалось вверх и вниз.
// Event listener for the get started button getStartedButton.addEventListener("click", function() { desc.classList.add("hide-description"); // Add class to hide description slideButton.classList.add("hide-button"); // Add class to hide button setTimeout(function() { document.querySelector(".about").classList.add("show-about"); // Add class to show 'about' section after transition ends document.querySelector(".homebut").classList.add("show-homebut"); desc.style.display = "none"; slideButton.style.display = "none"; }, 2000); // Adjust this time to match the duration of the transition in CSS });
// Event listener for the home button homeButton.addEventListener("click", function() { document.querySelector(".about").classList.remove("show-about"); // Remove class to hide 'about' section document.querySelector(".homebut").classList.remove("show-homebut"); setTimeout(function() { desc.classList.remove("hide-description"); // Remove class to show description slideButton.classList.remove("hide-button"); // Remove class to show button desc.style.display = "block"; slideButton.style.display = "block"; }, 2000); // Adjust this time to match the duration of the transition in CSS });[/code] [code]body { background-color: blue; }
@keyframes myAnim4 { 0% { opacity: 0; transform: translateY(-50%); } 100% { opacity: 1; transform: translateY(50%); } }[/code] [code]Yusisista Minimap is a web-based application that provides students and visitors with easy access to navigate the UCC Congress campus, allowing them to locate desired facilities, offices, and rooms with ease and efficiency.