Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Ilima

Members
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

3 Newbie

About Ilima

  • Rank
    Member
  1. Thanks 😊 I think I figured it out. What I wanted to do is basically if state says "second" then move the box to the second option: https://codesandbox.io/s/gsap-draggable-react-hooks-4ez0l?file=/src/Box.jsx Thank you Team Green for the reactive help!
  2. Thank you on that! I use React Hooks as well, but my team is still using React Components 😅 Probably it will take some time for us to change everything to hooks 🤔
  3. Yup 👍🏻 it worked! Thank you so much ☺️ Now I just need to figure out how to put the box on the second or third options based on database. Do you know any way to do that?
  4. It's weird... I have the similar Draggable with onDrag function which passes this as instance of react function. Here is the Demo Example on that: https://codesandbox.io/s/cool-forest-ddzft?file=/src/drag.js For now I made the function work within the ComponentDidMount, and it worked: https://codesandbox.io/s/funny-haslett-jj95u?file=/src/Box.jsx But this is not the approach that would be good later. Is there a better way to find the Box and update the State? Or even move the Box based on State, the data will be based on db, where the box could be on the Second Grid or Third.
  5. Unfortunately didn't do anything, same problem Here is the demo with those changes https://codesandbox.io/s/funny-haslett-jj95u?file=/src/Box.jsx
  6. I need to be able to get the position of the box or a way to know where the box moved and update the state. onDragEnd I can't pass the this.x for some reason, not sure if I'm missing anything. Here is the Demo: https://codesandbox.io/s/stoic-wood-zuyel?file=/src/Box.jsx
  7. Thank you so much! Solved my issue, also looks like I was just not using the state values. gsap.to(".dialGrip", 0.6, { rotation: function (i) { return i === 0 ? rotation * 2 : rotation * 3; }, stagger: 0, });
  8. I'm trying to make this codepen example into React. But unable to do it with new version of Gsap and also new to GreenSock's animation. Here is the current React example in sandbox: https://codesandbox.io/s/cool-forest-ddzft?file=/src/drag.js
  9. 🤯 and I wasted my all day for this transparent circle! Thank you so much!
  10. Sorry again 🤔 I think the link above doesn't work... Here is the link: https://codesandbox.io/s/gallant-morning-2ggfm
  11. Hmm I think I just didn't save it... I'm new to Sandbox, can you see now?
  12. I removed it from Sandbox, since I'm just trying to get help with Draggable only
  13. Sorry about the mess. Updated it and here is the link https://codesandbox.io/s/bold-ishizaka-6st9k?file=/src/drag.jsx
  14. I'm trying to use Draggable with React and I don't seem to make it work. Currently I have this code and the version of react: "dependencies": { "gsap": "^3.5.1", "react": "^16.8.1", "react-dom": "^16.8.1", "react-gsap": "^2.2.1", } Update: Here is the link to code: https://codesandbox.io/s/gallant-morning-2ggfm
×