Jump to content
Search Community

mjpaton

Members
  • Posts

    3
  • Joined

  • Last visited

mjpaton's Achievements

2

Reputation

  1. Awesome - thanks guys! I'd found some of these demos before and managed to get it to a pretty tidy solution. Thank you for all your help!
  2. Thanks Jack! So it sounds like what I want to do is not outside the realms of possibility with GreenSock (up until persistence). Thank you!!
  3. Hi all, I've been playing with GSAP for the last few days figuring out if it will meet my needs, and was hoping for a bit of direction/advice from some of the more seasoned pros here... Code Pen: http://codepen.io/mjpaton/pen/vyJLYq (I hacked this together from the throwprops demo pen I'm looking to use GSAP to graphically display bookings for my business to help staff rostering/scheduling. Think of it as a bowling alley with 8 lanes, and people can book either one lane or two lanes, depending on the size of their party. I need to allocate a staff member per lane to look after the group (drinks, service, coaching etc). So... brace yourself for question onslaught!! Collision Detection: I've looked at some of the responses for previous forum posts for collision detection, but haven't been able to make them work for me in my code (am a rookie). Ultimately I want my staff to be able to drag/drop bookings around, but if they drag a booking and it overlaps an existing booking, they shouldn't be able to drop that booking in the overlapping spot, and it should revert the booking to it's previous position. This fiddle basically represents the desired behaviour, is there a way to do something similar in GSAP? I've seen the hit detection stuff, am more interested in getting something that bounces back to original spot if it detects a hit, but am not smart enough to make that work! Editable Divs: I have to assign staff per booking/lane. Originally I thought I'd just make the divs editable, but that proved to be difficult while also having them draggable. I looked at a couple of previous forum posts, there didn't appear to be a great solution. If that's still true, the workaround I created was to have a bunch of staff divs pre-created, and they can be dragged to wherever they need to go... Is there a more elegant solution? Adding Divs on the fly: I haven't tried this yet, am assuming it would work fine, but was thinking I could have a simple textbox/form to add a staff member div on demand, rather than pre-populating them, which brings me to the next question... Persistence: This will all be generated on a daily basis, or day before, or whenever we stop accepting bookings. I am assuming my staff will roster themselves up using this tool, and then I want to create some form of persistence, because when they refresh the page, I don't want it to revert back to whatever form it was in when I pre-loaded it. A bit more background on how I plan on feeding the data - I've got an API I can call from our booking platform to pull back a list of the days bookings, which I'll then order by start time and allocate automatically from left to right and top to bottom. So there'll be logic to initially define a representation of the bookings graphically assigned with lanes, but if they need to get moved (e.g. Group A is friends with Group B, we want them in the same Arena), I want some level of persistence, even if it's just on a single central machine we use at reception. Not sure if my incoherent ramblings are making sense, please feel free to ask any further clarifying questions! Thanks, Matt
×
×
  • Create New...