3 ms·
I was bored so I made a super simple implementation of this: https://codepen.io/Nezteb/pen/MWZBapL https://codepen.io/Nezteb/pen/MWZBapL
by Nezteb 3y ago
I was bored so I made a super simple implementation of this: https://codepen.io/Nezteb/pen/MWZBapL https://codepen.io/Nezteb/pen/MWZBapL
- diath 3y agoThat doesn't seem to work in Firefox: > TypeError: input.getBoundingClientRect is not a function
- Nezteb 3y agoWomp womp; I'm not sure why. Someday I'll try it out on Firefox and maybe fix it.
- orlp 3y agoDoesn't work with touch.
- Nezteb 3y agoI'm not surprsied. I suck at CSS and just wanted a basic/brittle example that worked in Chrome. Anyone is free to fork my CodePen and make it better though. :D
- ellyagg 3y agoI thought they meant the object automatically snaps to the nearest target in real-time.
- Nezteb 3y agoThe person who described the algorithm made it that way, but I added a `const closeEnoughToSnapDistance = 200` to make it more like Trello; once you get close enough, it will snap.