Jump to content
Search Community

OSUblake last won the day on September 16 2023

OSUblake had the most liked content!

OSUblake

Moderators
  • Posts

    9,196
  • Joined

  • Last visited

  • Days Won

    708

Posts posted by OSUblake

  1. 2 minutes ago, ZachSaucier said:

    Use "rotation" and not "rotate". "rotate" is a convenience that GSAP adds for tweens, quickSetter doesn't do things like that.

     

    That's what I tried first, but maybe I spelled it wrong. 🤷‍♂️

     

    Regardless, I think rotate should work. That's what I want to set.

     

  2. 1 minute ago, spassvogel said:

    Okay I must have read that in a forum post somewhere. Probably the documentation is a more sensible place to start. Thanks again.

     

    Yeah, that's a problem with finding answers on the forums. Most stuff posted before 2020 is going show the older syntax.

  3. Hard to say without seeing your project. Can you make simple repo showing the problem?

     

    Also, you should be consistent with your imports and syntax. There is no need to use TweenLite/Max or TimelineLite/Max anymore.

     

    import * as PIXI from 'pixi.js';
    import { gsap } from 'gsap'
    import { PixiPlugin } from 'gsap/PixiPlugin';
    
    gsap.registerPlugin(PixiPlugin); 
    PixiPlugin.registerPIXI(PIXI);
    
    gsap.from(ref.current, { 
      duration: 1, 
      pixi: { 
        scale: 0.2, 
        rotation:60 
      }
    });

     

    Please follow the installation instructions.

    https://greensock.com/docs/v3/Installation

     

    And the migration guide.

     

     

    • Like 1
  4. 15 minutes ago, GreenSock said:

    Good catch - it was actually killing the animations themselves, but the bug had to do with it not removing the tween from its parent if (and only if) it was a tween with an internal timeline (meaning it had a stagger or keyframes).

     

    Well that's strange as none of the tweens had staggers or keyframes in that demo. 

    • Like 1
  5. 1 hour ago, Black Ducas said:

    Horizontal scroll necessarily needs to be scrolled by mouse wheel up/down like we tried to do here:

     

    By horizontal scrolling, I meant actual scrolling that can be done by the browser, so you can scroll horizontally with touch or a trackpad. That's just animating a container on the x axis. But what were you looking for gsap to implement in your example?

     

    And technically you can scroll horizontally with a mouse wheel by holding shift, but most people don't know that. 

     

    Or with JavaScript. A quick and dirty example. Don't use this code.

     

    See the Pen b106a113c226a2c49813f9c0725c8681 by osublake (@osublake) on CodePen

     

     

    • Like 2
  6. 7 minutes ago, wpsoul said:

    I am also waiting new plugin. Currently, I am using Scroll magic because it has one cool feature like Pin option and horizontal scroll. I hope new plugin will also have it. 

     

    It does, but I'm wondering why people do horizontal scrolling. Kind of a pain when you only have a mouse wheel that goes up and down.

     

     

  7. 3 minutes ago, Gingah said:

    At first I thought that was the same example I was working off of earlier, but that's a great addition!

     

    Thanks. It's similar to what I did to create an online/real-time word game with draggable and firebase.   

     

    8 minutes ago, Gingah said:

    For some reason the fork-button disappeared, but I put some of the code I was using into it, and the location-fidelity seems to work exactly as expected: 

     

    Yeah, I have CodePen to automatically create private pens, and it won't let you fork private pens. I don't understand the logic behind that because it's just an inconvenience as you can still copy and paste the code.

     

     

    • Like 1
  8. 👆 I probably wrote that wrong after looking at the localForage docs.

     

    This gives matching results.

     

    async onDragEnd() {
          
      await map.setItem(this.target.id, {
        src: this.target.getAttribute("href"),
        x: this.x,
        y: this.y
      });
    
      const res = await map.getItem(this.target.id);
      console.log("\n");
      console.log(res.x, res.y);
      console.log(this.x, this.y);      
    },

     

    But some positioning looks off when you reload, and there are some errors in the console.

     

  9. 5 hours ago, ZachSaucier said:

    Most likely the different in positioning is due to setting some values with GSAP and some not with GSAP.

     

    I'm not sure what the problem is,  but I did this as a sanity check before making that demo.

     

    onDragEnd: function () {
      window.map.setItem(this.target.getAttributeNS(null, "id"), {
        src: this.target.getAttributeNS("http://www.w3.org/1999/xlink", "href"),
        // x: this.target.getBoundingClientRect().x,
        // y: this.target.getBoundingClientRect().y        
        x: this.x,
        y: this.y
      });
    
      // *** THESE SHOULD MATCH ***
      map.getItem(this.target.id).then(res => {
        console.log("\n")
        console.log(res.x, res.y)
        console.log(this.x, this.y)
      });      
    }

     

    The values stored are not the same as the draggable, so there has to be a logic error somewhere, or a problem with localForage.

     

×
×
  • Create New...