Jump to content
Search Community

classikd

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by classikd

  1. Hello,

    I am trying to scale list elements depending on their data-attribute, here is what i have :
     

    <ul>
      <li data-percent="50">1</li>
      <li data-percent="75">2</li>
      <li data-percent="15">3</li>
    </ul>
    let tl = new TimelineMax()
    tl
      .staggerFromTo('[data-percent]', 0.25, { scaleX: 0 }, { scaleX: function(){
        // i would like to return a dynamic value
        return 0.5
      }}, 0.1);

    Is there a way to get the data attribute of the current element ?

    I can't find a solution.

     

    Thank you

  2. Thank you for your answer Jack !

    Yes I use top and left percentage values for responsiveness.
    As i am bad at mathematics I am not able to try your second method, but i tried the first one.

    Here is a codepen: 

    See the Pen JxLWej by classikd (@classikd) on CodePen

     

    You can see in the console that I give a good progress value for each timeline, but unfortunately they are not equidistant :X

    How to explain that ? I put linear easing everywhere... i really don't understand

  3. Hello,

     

     

    I would like to make a half circle navigation, for that i made each nav item following a bezier curve, check its left position in the onUpdate callback, and stop it if its limit was reached.
    My problem is that the items do not stop exactly where they should stop.

    You can see the console.logs i put for the 3rd item to understand. (also look the css inline, this element should stop exactly at left:50%)
    Here is the codepen : 


    I wouldn't have this problem if there were more "OnUpdate" executions, but I think I am going in a  bad direction..

    I also tried to achieve that with time calculation instead, but as i want the item's easing not to be linear it was too difficult for me to find the exact moment they should stop ?

    Please how would you solve such a thing, do you have any solution ?


    Thank you a lot.

     

    See the Pen Zwrrzg by classikd (@classikd) on CodePen

  4. Yes it does help me a lot !

    And you're right i think i'm going to use a function calling itself when completed instead of using the repeat attribute.

    Because i encountered another problem, the timelines added after the infinite animation timeline are never played :D

    I saw on an other post that using the callback method would solve this problem so i'm going to try that.

     

    Thank you PointC.

    • Like 1
  5. Hello,

     

    In my master timeline i would like to play child timelines not from the beginning, from the half for instance.

    I've succeded in using the tweenFromTo() function.

    But the problem is that i have to set the 2 values in seconds, and let's imagine if later i change the duration values in my timelines i will have to make a calculation again to find the 2 values and then change them. Not a convenient method.

     

    Do you know if a better solution exists ?

     

    Thanks a lot.

    See the Pen qrQjMO by classikd (@classikd) on CodePen

  6. Hello,

     

    Those flickering problems can usually be solved by doing a GPU render using 3d properties on elements (translateZ(0), perspective...).

     

    I have added this CSS code and now it looks pretty fine:

    #banner ,
    #banner *{ 
    backface-visibility: hidden; /* Chrome */
    filter: grayscale(0%); /* FF */
    }

    In your case i had to add a filter property for Firefox, i don't know why. Maybe the blur filter you use is the cause of the problem.

    Of course this is not a good method to use the universal selector, this code is just a test I've done fastly.

    Moreover maybe you could use the GSAP force3D property in your JavaScript code instead of CSS.

     

    See the Pen oBRKEo by classikd (@classikd) on CodePen

    • Like 2
  7. Thanks a lot for your helpful advices Jonathan. 

    I recognize that i develop in Chrome by simplicity, it's a little bit faster and i like that each page runs its own process. But is it really worth it...

    I used to use Firefox many years ago but i gave it up following the "script not responding" errors i had which made me crazy !

    Developing in Firefox would have saved my time in this case and it would drive me in the good direction to follow spec, so i'm seriously going to think about it.

    • Like 1
  8. PointC, i'd like to animate the shapes within the SVG, not the SVG itself.

    Well anyways I'll give up 3d animations on SVG shapes, i must read about the browser support i'm not really aware.

    Indeed I understand your choice not to support browsers deviations you're totally right.

    I'm a little bit sad but i will find another way to do what i want.

     

    Thanks all three for your explainations.

    • Like 3
  9. Hello,

     

    I'm trying to make rotationX/rotationY transforms on SVG shapes with the last version, GSAP 1.19.1, but it does not work.

    This is working only with rotation or rotationZ properties.

     

    Here you can see that nothing happens on mouseover event:

     

    But if i am using GSAP 1.19.0 or lower version everything is working well :

    See the Pen NdorKo by classikd (@classikd) on CodePen

     

    Is there a bug or do some properties have changed, i have found nothing about it ?

     

    Thanks for your help.

    See the Pen rjPxKr by classikd (@classikd) on CodePen

  10. That's working perfectly now thanks a lot Carl.

    I have to go deeper in learning TweenMax, with the experience i have now i think i would never have find this method to solve my problem.

     

    I have nested the timeline in another because i tought it was the good way to do, but maybe it's not ?

    It looks well organized, easily readable... as I will have many others timelines following the closing navigation animation.

    But i'm pretty new in animation with this tool and maybe you have a better way to teach me :)

     

    Thanks for your help.

    • Like 2
  11. Hello,

     

    I'm sorry I can't explain very well my issue because I don't know why this behavior happens.

    In my exemple I would like to understand why as soon as i click a navigation link (home or contact), i get my navigation animations disappear (try opening the navigation again, you'll see the navigation appears without animation) 

     

    Do yo have any idea ?

     

    Thanks a lot.

     

    See the Pen bgKMpO by classikd (@classikd) on CodePen

  12. Hahaha PointC, you're totaly right. I spent many hours trying to understand why i can't achieve what i want and i have a kind of headache now.

    Following the advice of Jonathan I succeeded in doing staggerTo() on pseudo elements but i had to add ID attributes and changing the selector to target all pseudo elements, not very pratical:

    See the Pen VPrbRx by classikd (@classikd) on CodePen

     

    It looks like CSS specificity priorities or something like that, but i don't want to understand anymore !!

    I'm going to do simpler, adding DOM elements will be a better solution indeed.

     

    I really want to thank you all three for your help. I really love doing animations with your tools, i actually use GSAP for animating 3D scenes and it makes my job easier. Merci beaucoup.

    • Like 4
  13. Hello,

     

    You're right my example is not good and in this case i should use to() instead. 

    I was trying to show you my problem but forget it :)

     

    Look, in your example if i change the selector to ".box:after" this is no longer working:

    See the Pen ygPVgm by classikd (@classikd) on CodePen

     

    And in this example too, the staggerTo() on :before elements does not work even if i target all :before elements:

    See the Pen egeBWN by classikd (@classikd) on CodePen

     

    I really don't understand why :S Do you see what i am doing wrong ?

     

    I think it's not a problem for me that :before and :after elements are not in the DOM because i use them only for visual effects (effect on hover etc) and i think it's a little bit better than adding tags in html but i might be wrong.

     

    Thanks for your time

×
×
  • Create New...