Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Ritesh Malviya

Image sequence animation

Recommended Posts

Hey @Ritesh Malviya welcome to the forum! 💚
I don't know if I understand you 100%, but you can set the canvas width/height like this:

canvas.width = window.innerWidth;
canvas.height = window.innerHeight;


Link to comment
Share on other sites

Canvas is just an image, and should be treated just like you would a normal image, so you can set the size with CSS or GSAP.

#my-canvas {
  height: 400px;


gsap.set("#my-canvas", {
  height: 400


This is the intrinsic size, and should be the size of the images. 

canvas.width = 1158;
canvas.height = 770;


  • Like 3
Link to comment
Share on other sites

animation ends before frame count ends

i need to give dynamic height  for


so that i can scroll till canvas animation  ends, please help! 

Link to comment
Share on other sites

Sorry, I don't understand what you mean.


And I definitely don't think you should be doing all that logic in the render function. You should create your timeline inside the matchMedia functions, and you can use the position paramater and durations to control when/what should happen.

Link to comment
Share on other sites

can you give a example related to my codepen demo please so that i can apply on my project ! please

Link to comment
Share on other sites

First make a demo without any of the frame or canvas stuff. Just use ScrollTrigger to create and control the text animations, then we can add the canvas stuff later.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.