Hacker News new | past | comments | ask | show | jobs | submit login

I was bored so I made a super simple implementation of this: https://codepen.io/Nezteb/pen/MWZBapL



I thought they meant the object automatically snaps to the nearest target in real-time.


The 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.


That doesn't seem to work in Firefox:

> TypeError: input.getBoundingClientRect is not a function


Womp womp; I'm not sure why. Someday I'll try it out on Firefox and maybe fix it.


Doesn't work with touch.


I'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




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: