Jump to content
GreenSock

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

Elindo

ShockinglyGreen
  • Posts

    52
  • Joined

  • Last visited

About Elindo

Profile Information

  • Gender
    Male
  • Location
    Michigan
  • Interests
    Coding? that counts?

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Elindo's Achievements

  1. Its now scrolling... need to loop it.. Is there a way to do a loop in gsap?
  2. On page load I just want to keep scrolling the word "hello" over and over. Is it possible to make an infinite loop and not crash the computer? And how would you make it run on page load?
  3. Yes, that works. Anyway... how you do to think like javascript?
  4. What could be wrong with this syntax? btnstart.onclick = () => { isButtonBDisabled = false; isButtonADisabled = false; if (animation == stagea1, stagea2, stageb1, stageb2){ animation.isActive(); } else animation = stagestart(); } What I want to do is: Enable buttons A and B <-- this is working Check if A or B are playing any of their tweens, which are located in the functions or stagea1, stagea2, stageb1, and stageb2... if any of these stages are playing, then I want the Start button to do nothing and just let them play. If none of the stages are playing, then I want the Start button to play stagestart. The .isActive I took it from gsap cheat sheet under control methods, but Codepen is telling me it can't read it.
  5. So my friend @nicofonseca created a variable called isbuttonADisabled and gave a value of false.. then called out the variable on another set of buttons to give it a true or false value.. how does JavaScript or gsap recognizes that I am looking to disable the button by simply pulling a word out of the air and giving a true or false value? what if the word was enable and you have the same true or false values? How does JavaScript recognizes between a bunch of words and know what I want?
  6. @nico fonseca Thanks that worked! How do you set the A and B buttons as normally disabled? I see you created 2 variables, one for each button, and then added the variable with a value to the push button sections. Why exactly is this line needed? if(isButtonADisabled) return; I added one variable for both buttons, and didn't do a line as the one you did above.... and of course it didn't work.
  7. Thanks... I'll try that later on.. All my drawings are svg. I am using the reference variable to link them to the svg object drawing. The latest code I have is above.. I need some time to digest the code you are showing.. Thank you much..
  8. btna and btnb are the links for buttons A and B... for whatever reason the buttons are not getting disabled. I added: let disabled = false; gsap.set ("#A, #B", {disabled:true}); btnstop.onclick = () => { if(animation)animation.kill(); animation = stagestop(); btna.disabled = true; btnb.disabled = true; } btnstart.onclick = () => { animation = stagestart(); btna.disabled = false; btnb.disabled = false; } https://codepen.io/Elindo586/pen/vYZLjJz
  9. let disabled = false; btna.setAttribute("disabled", ""); btnb.setAttribute("disabled", ""); btnstop.onclick = () => { if(animation)animation.kill(); animation = stagestop(); btna.disabled = true; btnb.disabled = true; } btnstart.onclick = () => { animation = stagestart(); btna.disabled = false; btnb.disabled = false; } So... what I am doing wrong? I am just creating a variable named disabled and giving it a false value.. then trying to set A and B as normally disabled.. Then expecting button A and B to work and not work when I say disabled is true or false when pushing the start or stop buttons. https://codepen.io/Elindo586/pen/vYZLjJz
  10. I think I can digest that.. How do you set the button to be normally disabled? Can you do something like.. ?? gsap.set ("#A, #B", {disabled:true}); Just to make some notes when I get back. you created a let disabled = false; then a click eventlistener for each button and gave it a name. Then a function to call out the event listener to do an If / else task. Maybe later I can try something like.. let disabled = false; btnstop.onclick = () => { if(animation)animation.kill(); animation = stagestop(); btna.disabled = true; btnb.disabled = true; } btnstart.onclick = () => { animation = stagestart(); btna.disabled = false; btnb.disabled = false; }
  11. Now, I didn't minimize the demo any smaller because everything is linked together However, the items to add some functionality are these last buttons of the code: btnstart.onclick = () => { animation = stagestart(); } btnstop.onclick = () => { if(animation)animation.kill(); animation = stagestop(); } For the STOP button I want it to kill the animation, and go to the stagestop animation (<-- this part is done) And.. once you click the Stop button I want to disable button A and button B... meaning if you push A or B they won't work. How do you go about to do these things about disabling other buttons? For the START button If nothing has been previously touched ... at the very begining of the animation it would play animation stagestart (that is in the code), PLUS enable buttons A and B so they can now be functional. If the STOP button has been pressed, then It would kill animation for button STOP, play animation stagestrat and enable buttons A and B so they can now be functional again. If A or B are playing, then nothing would happen. Buttons A and B would be normally disabled. To play the proper line I suppose I can do something like: if (functionx) function.play (); if (functionx) funtion.kill (); animation = startstage ^^ that is likely wrong.. But how do you go about to enable and disable buttons?
  12. Check this one.. I am getting a syntax error, but I am not sure why I got 2 functions with animations inside of of them. One function will play the entire sequence of the A button if #Rod < x:200 The second function will play the last few tweens of the entire sequence of the A button if #Rod == x:200 I am trying to do an if/ if else for button A... but apparently the code is wrong and I don't know why? I would do something similar for the B button.. btna.onclick = () => { if ("#Rod"< x:200) { animation.kill(); animation = stagea1(); } else if ("#Rod" == x:200) { animation.kill (); animation = stagea2(); } } https://codepen.io/Elindo586/pen/vYZLjJz
×