Heading 1

Heading 2

Heading 3

Heading 4 & CODE

1. CSS ID and class:

				
					//id for main section 
fullpage 


//heading 1 id
section1
//heading 1 class 
section


//heading 2 id
section2
//heading 2 class 
section

//heading 3 id
section3
//heading 3 class 
section

//heading 4 id
section4
//heading 4 class 
section

//be aware same class for all elements id is diffrent!!! 
				
			

2. CSS code: html element
within Main section on the botton

				
					<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.1.2/fullpage.min.css"
/>
<style>
  .section {
    display: flex;
    flex-direction: column;
    justify-content: bottom;
    align-items: bottom;
    height: 100vh;
    text-align: bottom;
    font-size: 6rem;
    overflow: hidden;
    position: relative;
  }

  }
</style>

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.5/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.5/ScrollTrigger.min.js"></script>
				
			

3. Javascript:

				
					<script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.1.2/fullpage.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/gsap.min.js"></script>

<script>
  document.addEventListener("DOMContentLoaded", function () {
    const fullpageInstance = new fullpage("#fullpage", {
      scrollingSpeed: 1000,
      autoScrolling: true,
      scrollHorizontally: true,
      navigation: false,
      onLeave: function (origin, destination, direction) {
        const words = ["Unknown", "Unseen", "Unfamiliar", "Mystery"];
        const leavingText = origin.item.querySelector("h1");
        const enteringText = destination.item.querySelector("h1");
        const line = destination.item.querySelector(".line");

        // Animate the leaving text to fade out and move up
        gsap.to(leavingText, {
          opacity: 0,
          y: -100,
          duration: 1.5,
          ease: "power2.out",
        });

        // Animate the entering text to fade in and move up
        gsap.fromTo(
          enteringText,
          { y: 100, opacity: 0 },
          {
            y: 0,
            opacity: 1,
            color: destination.item.getAttribute("data-text-color"), // Set text color
            duration: 1.5,
            ease: "power2.out",
            delay: 0.5,
          }
        );

        // Get the destination colors
        const newBgColor = destination.item.getAttribute("data-bg");
        const newTextColor = destination.item.getAttribute("data-text-color");

        // Change background color of destination slide
        destination.item.style.backgroundColor = newBgColor;

        // Change text colors dynamically
        gsap.to(line, { color: newTextColor, duration: 0.5 });

        // Line growth/shrinkage animation
        const newLineWidth = (destination.index + 1) * 150;
        const currentLineWidth = (origin.index + 1) * 150;

        if (direction === "down") {
          gsap.to(line, {
            width: newLineWidth + "px",
            duration: 1.5,
            ease: "power2.out",
          });
        } else {
          gsap.to(line, {
            width: currentLineWidth + "px",
            duration: 1.5,
            ease: "power2.out",
          });
        }
      },
    });

    document.getElementById("link1").addEventListener("click", function () {
      scrollToSection(1);
    });
    document.getElementById("link2").addEventListener("click", function () {
      scrollToSection(2);
    });
    document.getElementById("link3").addEventListener("click", function () {
      scrollToSection(3);
    });
    document.getElementById("link4").addEventListener("click", function () {
      scrollToSection(4);
    });

    function scrollToSection(sectionIndex) {
      fullpageInstance.moveTo(sectionIndex);
    }
  });
</script>
				
			

4. Let make it move:

				
					#section1 {
    transform-origin: center center;
    animation: kenBurns 10s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}