Jump to content
Search Community

Search the Community

Showing results for tags 'modifiers'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 8 results

  1. Hi. This is my first post here. I got stuck working on an animation with brief like this: Actually I have just problem with the wrapping. If I move box in y axis value of boxHeight and do repeat refresh it overrides modifiers: const sectionHeight = gsap.getProperty('section', 'height'); const boxSize = sectionHeight/elements.length; gsap.set('.box', {y: sectionHeight, x: 200, height: boxSize, width: boxSize}); gsap.to('.box', { repeatDelay: 1, y: '-=' + (boxSize), duration: 1, repeat: -1, ease: "none", repeatRefresh: true, modifiers: { x: gsap.utils.unitize(y => parseFloat(y) + (sectionHeight - boxSize)) } Can I do this with modifiers alone so that I got move theme above section and got stop/delay between each step of 'y: boxSize'. https://codepen.io/olivetum-the-sans/details/zYgNyjX
  2. Pixelcaps

    ModifiersPlugin import for gsap 2

    Hello, I am getting this error for an animation -> invalid modifiers tween value: [object Object]. I am using gsap version 2 inside a React project. I've read from another forum post that its because the plugin is not loaded. My question is how do you load it inside an actual project, not codepen?
  3. GreenSock

    GSAP 1.19.0 Released

    Note: This page was created for GSAP version 2. We have since released GSAP 3 with many improvements. While it is backward compatible with most GSAP 2 features, some parts may need to be updated to work properly. Please see the GSAP 3 release notes for details. GSAP version 1.19.0 introduces some exciting new features for advanced users as well as conveniences for everyone (even the "greenest" novices). The most noteworthy improvements are summarized below: Function-based values Instead of a number (x:100) or string (width:"300px") or relative value (y:"+=50"), you can now define most values as a function that'll get called once for each target the first time the tween renders, and whatever is returned by that function will be used as the value. This can be very useful for randomizing things or applying conditional logic. See it in action in the demos below. See the Pen BzmGba by GreenSock (@GreenSock) on CodePen. ...and more GSAP 1.19.0 is more ES6-friendly (for example, you can npm install gsap and then import {TweenLite, Elastic, TimelineMax} from "gsap" in your project). Plenty of bug fixes too. See the whole list in the github changelog. DOWNLOAD GSAP TODAY Happy tweening!
  4. benoit

    Modifiers plugin and others values

    Hi, How to deal with others properties in modifiers function ? var animation = TweenMax.to(".box", 25, { ease: Linear.easeNone, x : "+=600", modifiers: { x: function (x) { return x%600; }, /* opacity: function(i){ if(x>400){ return 0 } return 1; } */ }, repeat: -1 });
  5. maximus8891

    Using Modifiers plugin with Draggable

    Hi, I've tried using Modifiers Plugin with Draggable as follows: Draggable.create(".box", { type:"x", modifiers: { x: function(x) { return x % 500; } } }); It did not work. Is there any other way to override the x value before it is applied to the draggable element while dragging? Alternatively I was trying to find a way to initiate dragging on an element without applying the transforms to it. Thanks, Max
  6. OSUblake

    ModifiersPlugin helper functions

    Just wanted to share some nice functions I came across that can be used with the ModifiersPlugin. Doing a normal modulus calculation restarts the value at 0, which may not be what you want. 500 % 500 // => 0 This function will allow you to do a modulus operation for a min/max range. wrap(500, -100, 500); // => -100 function wrap(value, min, max) { var v = value - min; var r = max - min; return ((r + v % r) % r) + min; } And this is a modified version of that function that will make the modulus value "yoyo". mirroredWrap(600, -100, 500); // => 400 function mirroredWrap(value, min, max) { var v = value - min; var r1 = max - min; var r2 = r1 * 2; v = (r2 + v % r2) % r2; return v > r1 ? (r2 - v) + min : v + min; } With the first wrap function you can do some interesting stuff, like making an object appear in two different places, kind of like in those old asteroid games. http://codepen.io/osublake/pen/XpbmYr/?editors=0010 And with the mirroredWrap, you can do stuff like creating multiple bounces with a single tween. http://codepen.io/osublake/pen/mRJeNX/?editors=0010 .
  7. Picadipity

    Picadipity landing page

    Try out picadipity.com to see GreenSock in action! From your help I was able to build a control that features infinite looping of pictures using modifiers. The control also supports draggable and throwable behavior with stops at notches that centers the pictures. I am using the following: <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/utils/Draggable.min.js"></script> <script th:src="@{js/greensock/ModifiersPlugin.min.js}"></script> <script th:src="@{js/greensock/ThrowPropsPlugin.min.js}"></script> This has been great fun developing this control!
  8. OSUblake

    Feature Request: Wrap values (modulo)

    I've been noticing lately that it would be very handy if there was a way to wrap values during a tween, just like the hours on a clock. 9 + 4 hours = 1. I made a demo that does this for positioning, but it's not very performant because it creates a lot of tweens on every update. http://codepen.io/osublake/pen/4d1b3311b08073d0bebfa061a2199e61?editors=0010 Creating something like that could be greatly simplified if there was a way for GSAP to do that internally. A modulo operator has been proposed for a future version of ECMAScript using this syntax. -2 mod 12 So we could use the word "mod" to tell GSAP to run the value through a modulo function before applying the value. TweenLite.to(foo, 1, { x: "800mod600" }); So what's going to happen is that it will tween to 600, go back to 0, and tween to 200. This would make creating carousels/sliders a breeze. var index = 0; $("#prev").click(function() { move(-1); }) $("#next").click(function() { move(1); }) function move(steps) { index += steps; TweenLite.to(".slider", 1, { xPercent: index + "00mod500" }); } Pretty simple! No cloning, calculating positions, or secondary updates required. And because it's position will automatically reset, you can click through the slides as fast you want. The only problem I see with the mod is that it resets the value to 0. This is probably not something you want to happen for something like scaling, so there should be a way to define a base value. Maybe something like this. TweenLite.to(foo, 1, { scale: "2mod0.5+=1" }); Thoughts?
×
×
  • Create New...