Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 1085

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 62k
Author
Asked: November 25, 20242024-11-25T04:52:07+00:00 2024-11-25T04:52:07+00:00

Big Text Animation on Scroll

  • 62k

Today, I embarked on an exciting journey with GSAP (GreenSock Animation Platform) and its powerful ScrollTrigger plugin. Here's a quick rundown of what I learned and how I brought my ideas to life.

Basics of GSAP

GSAP is a robust JavaScript library for creating high-performance animations. I started by animating simple elements, which was surprisingly easy and effective.

Discovering ScrollTrigger

ScrollTrigger, a GSAP plugin, allows you to animate elements based on scroll position. Here are some key properties:

  • trigger: Select the element to animate.
  • scroller: Usually set to “body”.
  • start: Define when the animation starts.
  • end: Define when the animation ends.
  • markers: Visualize start and end points (useful for debugging).
  • scrub: Smoothly control animation with scroll (can be a Boolean or a number between 1-5).
  • pin: Pin the element during the animation.

My Big Text Animation

I created an engaging big text animation that moves as you scroll down the page. Here’s the code and a brief explanation:

gsap.to(".page2 h1", {     transform: "translateX(-250%)",     scrollTrigger: {         trigger: ".page2",         scroller: "body",         start: "top 0%",         end: "top -100%",         scrub: 2,         pin: true     } }); 
Enter fullscreen mode Exit fullscreen mode

<!DOCTYPE html> <html lang="en"> <head>     <title>Big Scroll Text Animation</title>     <link rel="stylesheet" href="style.css"> </head> <body>     <div class="page1">         <h1>Welcome to Big Scroll Text Animation</h1>     </div>     <div class="page2">         <h1>BIG SCROLL ANIMATION</h1>     </div>     <div class="page3"></div>     <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>     <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>     <script src="script.js"></script> </body> </html> 
Enter fullscreen mode Exit fullscreen mode

* {     margin: 0;     padding: 0;     font-family: sans-serif; } html, body {     height: 100vh;     width: 100vw; } body {     overflow-x: hidden; } .page1, .page3 {     display: flex;     align-items: center;     justify-content: center;     height: 100vh;     width: 100vw; } .page1 { background-color: black; } .page1 h1 { color: white; } .page2 {     background-color: cornsilk;     height: 100%;     align-items: center; } .page2 h1 {     color: black;     font-size: 70vh;     font-weight: 400; } .page3 { background-color: black; }  
Enter fullscreen mode Exit fullscreen mode

You can see this animation in action here on CodePen.

Today was a fantastic learning experience, and I'm excited to continue exploring the capabilities of GSAP and ScrollTrigger. Stay tuned for more animations!

gsapjavascriptprogrammingwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.