Jump to content
Search Community

Lynesth

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

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

Lynesth's Achievements

0

Reputation

  1. Yeah it is more readable But doesn't setting the last TweenMax.to() outside the onComplete function() breaks everything because it overrides the previous' tween 'rotation' property (cannot test right now) ? I noticed you've replaced my '$this' with 'this' to specify the target of your tweens, is it faster that way ? Does TweenMax's code internally retrieve the actual DOM element from jQuery objects so I should pass that instead to save 1 call ? (I guess the gain will be insignificant, but it's not like it's a hard optimization to make) Thank you !
  2. Ok thank you. Yeah, I don't know why I wrote it that way actually instead of simply checking if Math.random() < 0.5 Haha, that's just a leftover of Math.floor(Math.random() * (max - min + 1)) + min before I set min to 1 (was experimenting with different values at first).
  3. Ok so I've got this code here (which is working and all) but it feels... bloated ? I was wondering if maybe I missed something I cannot see anymore to make it better: var chestTween = []; var delays = []; for (var i = 0; i < 9; i++) { delays.push(4 + i * .2); } delays = shuffle(delays); $(".chest").each(function(i, e) { var $this = this; var randX = parseInt(Math.floor(Math.random() * 200 + 1)), randY = parseInt(Math.floor(Math.random() * 200 + 1)), randXS = Math.floor(Math.random() * 2) ? "+=" : "-=", randYS = Math.floor(Math.random() * 2) ? "+=" : "-=", randRot = -Math.floor(Math.random() * (5 - 1 + 1) + 1), randRotE = Math.floor(Math.random() * (5 - 1 + 1) + 1); TweenMax.from( $this, 1, { x: randXS + randX, y: randYS + randY, delay: delays[i], ease: Power4.easeOut } ); TweenMax.fromTo( $this, 1, { rotation: -360, scale: 0 }, { rotation: randRot, scale: 1, ease: Power4.easeOut, delay: delays[i], onComplete: function() { // Pushing those in an array because I need to kill them individually later chestTween.push(TweenMax.to($this, 2, { rotation: randRotE, yoyo: true, repeat: -1, ease: Power1.easeInOut })); } } ); }); The result is this (seems laggy, but it's just because of the recording software): https://imgur.com/ePq3fIx Lyn.
  4. I think so. I'll check what I can do with this. Thank you.
  5. I'm making a website that has some animations. I thought everything was perfect until I tried accessing the website with a computer that doesn't have a dedicated CG/GPU. I then realized that: 1) The animations were pretty laggy 2) It was using a very big amount of CPU to run those Then I thought to myself that I'd make a "low performance version" of the animations and use them if the browser/computer isn't good enough. I'm currently checking this by retrieving the WebGL renderer used by the browser and setting the low perfs version if it doesn't contain "NVIDIA/ATI/AMD" in its name. Would you guys do it some other way ? I tried the failIfMajorPerformanceCaveat thing from canvas context but it didn't help. Is there an easy way to get the FPS count of an animation or some performance indicators that could allow me to achieve this ?
  6. I was only including the local file not doing anything else so it shouldn't even have those calls to the cdnjs version... I'm not sure, maybe it was catching calls from others pages or something. Well it's working now so it's good. Since I'm here, I have a little question, but I'll make another post I think.
  7. Ok nevermind this, it seems that the performance thing isn't as good as it says it is. Closed FF, retried, everything's fine. And I seriously wasn't doing anything special. I even tried with a page containing only this: <html> <body> <script src="/js/TweenMax.min.js"></script> </body> </html> and still got those calls recorded in the call tree :/
  8. Hi there ! I ran FF's performance tab to check some things and noticed calls to functions from scripts that are hosted on your website (all GSAP scripts included in my page are loaded from local files). Here are the "culprits" (not sure if I should disclose the whole URL so I'll just give the filenames): commonEmbedHandler.js externalEmbedHandler.js root_library.js.SOME_KIND_OF_MD5.js May I know what this is ? Thanks, Lyn.
×
×
  • Create New...