Jump to content
Search Community

kalaschnik

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by kalaschnik

  1. Update, I added some eventListener for mouseenter and mouseleave, and noticed that those listener don’t use the bounding box rather than the shape itself and the actual mouse entry position (hence the names mouseenter, mouseleave :)). Interesting. Thinking about a way to combine draggable, hitTest and the detection of mouseenter, mouseleave ...?

  2. Hey GSAP people,

     

    My app asks the user to sort things in a stacked circles (or rather rings, as stacked circles are also an issue for the hitTest()). I highlight the corresponding circle whenever hovering the dragged object over it. I noticed, however, that hitTest()  seems to use the bounding box, and thus I could place objects outside the circles or in other rings when coming e.g., from a northwest direction.

     

    Is there any way to solve this issue?

     

    circle-gsap-hittest.gif.311f74d270fb8f9d70801bd7aa82404a.gif

    See the Pen MWXzwGo by Kalaschnik (@Kalaschnik) on CodePen

  3. Hey all,

     

    is there any dynamic way (instead of defining: `x/y: <coords>` to move an object to the center of another object?

     

    Let’s say my `anchor` is not always fixed at the same spot. And my `ball` needs to dynamically read out the current target coords from the anchor. What is the best way to achieve that?

     

    Thank you!

    See the Pen zYJRvXP by Kalaschnik (@Kalaschnik) on CodePen

  4. Hey all,

     

    I am super new to gsap. Before buying Club GreenSock, I would like to estimate if my specific use case can be covered with the inertia plugin.

     

    My scenario:

    I got shapes sitting in a "home" area. The user is required to categorize the shapes either in the center, middle or outer circle. If the shape gets droped on the SVG background they need hover back to the gray home area. If the shape gets dropped within on of the three circle areas the should align centered. Therefore, I thought it would make sense to create some "gravity-hooks" (see ids), which will be hidden later, but make sure the shape is centered on this line or circle (for the center)

     

     

    I guess it is possible, but since I am dealing with no grid I was not sure how to tackle that issue.

     

    See the Pen MWXzwGo?editors=1011 by Kalaschnik (@Kalaschnik) on CodePen

  5. Hey Rodrigo.

     

    Indeed maybe I wasn’t clear. The module is set to: "module": "es2022",

     

    To reproduce my error:

    1. Download/clone the repo

    2. npm i

    3. npm i gsap

    4. Within app.ts: import { gsap } from 'gsap';

    5. Error appears.

     

    It seems that gsap wants to set module to "module": "CommonJS", but that would create a lot other issues...

  6. Hey all,

     

    I would like to integrate gsap in my next project. For this project I rely on Webpack 5 configured to use TypeScript w/ top-level await support.

    For this startup config I have a repo:

    https://github.com/kalaschnik/multipurpose-webpack-config-typescript

     

    When I try to npm i gsap and to load import { gsap } from 'gsap';

     

    I get this error: Cannot find module 'gsap'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?ts(2792)

     

    Is there any working Webpack/TypeScript (w/ top-level await) config that works with gsap? Maybe I am missing something else here...

×
×
  • Create New...