CSS transition applied through JavaScript problem

My button transition to the second one is good and working but I want the background to be included in the transition, for example, In the first page I have blue background, A description box, and a “Get Started” button. I want the background color to change into red with the same transition with my button and description box then vice versa when I get to the second page. Also, my “home” button in the second page is not working, I mean the transition isn’t applied when I click it.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Home</title>
  <link rel="stylesheet" href="home.css">
</head>
<body>
  <div class="description">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.</div>

  <button id="getStartedButton" class="slide">Get started</button>

  <div class="about">HIIIIIIIIIIIIIIIII</div>
  <button id="homeButton" class="homebut">Home</button>

  <script src="home.js"></script> <!-- Include JavaScript file -->
</body>
</html>
body {
    background-color: blue;
  }
  
  .description {
    position: relative;
    margin: 100px auto 50px;
    /* shorthand for margin */
    width: 500px;
    height: 225px;
    border-radius: 30px;
    padding: 75px 25px;
    /* shorthand for padding */
    background: linear-gradient(
      90deg,
      rgba(10, 135, 0, 1) 0%,
      rgba(217, 98, 0, 1) 45%,
      rgba(25, 179, 0, 1) 92%
    );
    color: aliceblue;
    font-size: 20px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: justify;
    line-height: 25px;
    /* Transition for description opacity */
  }
  
  .hide-description {
    animation: myAnim 2s ease-in-out 1s 1 normal forwards;
  }
  
  @keyframes myAnim {
    0% {
      transform: translateY(0%);
      opacity: 1;
    }
    95% {
      transform: translateY(-190vh);
      opacity: 1;
    }
    100% {
      transform: translateY(-200vh);
      opacity: 0;
    }
  }
  
  .slide {
    position: relative;
    margin-left: 100vh;
    /* shorthand for margin */
    width: 150px;
    height: 100px;
    border-radius: 30px;
    background: linear-gradient(
      90deg,
      rgba(10, 135, 0, 1) 0%,
      rgba(217, 98, 0, 1) 45%,
      rgba(25, 179, 0, 1) 92%
    );
    color: aliceblue;
    font-size: 20px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    line-height: 25px;
    /* Add your button styling here */
  }
  
  .hide-button {
    animation: myAnim 2s ease-in-out 1s 1 normal forwards;
  }
  
  .about {
    opacity: 0;
    position: fixed;
    top: 45%;
    left: 33.3%;
    transform: translate(50%, 200vh);
    margin: 0 auto;
    width: 500px;
    height: 225px;
    border-radius: 30px;
    padding: 75px 25px;
    /* shorthand for padding */
    background: linear-gradient(
      90deg,
      rgba(10, 135, 0, 1) 0%,
      rgba(217, 98, 0, 1) 45%,
      rgba(25, 179, 0, 1) 92%
    );
    color: aliceblue;
    font-size: 20px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: justify;
    line-height: 25px;
    transition: all 2s ease-in-out;
  }
  
  
  .show-about {
    animation: myAnim1 2s ease-in-out 0s 1 normal both;  }

    @keyframes myAnim1 {
        0% {
            opacity: 0;
            transform: translateY(50%);
        }
    
        100% {
            opacity: 1;
            transform: translateY(-50%);
        }
    }
    

    .homebut {
      opacity: 0;
      position: fixed;
      margin-top: 85vh;
      margin-left: 46%;
      /* shorthand for margin */
      width: 150px;
      height: 100px;
      border-radius: 30px;
      background: linear-gradient(
        90deg,
        rgba(10, 135, 0, 1) 0%,
        rgba(217, 98, 0, 1) 45%,
        rgba(25, 179, 0, 1) 92%
      );
      color: aliceblue;
      font-size: 20px;
      font-family: Arial, Helvetica, sans-serif;
      text-align: center;
      line-height: 25px;
      /* Add your button styling here */
    }

    .show-homebut {
      animation: myAnim2 2s ease-in-out 0s 1 normal both;  }
  
      @keyframes myAnim2 {
          0% {
              opacity: 0;
              transform: translateY(50%);
          }

          50% {
            opacity: 0;
            transform: translateY(0%);
        }
      
          100% {
              opacity: 1;
              transform: translateY(-50%);
          }
      }

      .show-slide {
        animation: myAnim3 2s ease-in-out 0s 1 normal both;  }
    
        @keyframes myAnim3 {
            0% {
                opacity: 0;
                transform: translateY(-50%);
            }
  
            50% {
              opacity: 0;
              transform: translateY(0%);
          }
        
            100% {
                opacity: 1;
                transform: translateY(50%);
            }
        }
     

        .show-description {
          animation: myAnim4 2s ease-in-out 0s 1 normal both;  }
      
          @keyframes myAnim4 {
              0% {
                  opacity: 0;
                  transform: translateY(-50%);
              }
          
              100% {
                  opacity: 1;
                  transform: translateY(50%);
              }
          }
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
});

I want everything to slide up and down and please help me fix my code

New contributor

Gon Amparo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật