haltu / muuri

Infinite responsive, sortable, filterable and draggable layouts
https://muuri.dev
MIT License
10.77k stars 643 forks source link

Help in Getting Left to Right Layout Algorithm Functioning #463

Open rcnjstudent opened 3 years ago

rcnjstudent commented 3 years ago

Hello, I saw someone on Issue #61 thread had a great working prototype (still accessible here https://codepen.io/pauldstar/pen/LzEdmp) of what I'm trying to do, but it's setup with Muuri .40 and doesn't work if you try with .9.3. I tried to port this onto the .9.3 version (here's my codepen attempt: https://codepen.io/rcnjstudent/pen/LYWYyrB) but I just can't quite get it work. I think something is going wrong towards the bottom with layout.slots.push statement or something along those lines, I did debug the upper values and compared against the .40 version the other person created and basically matched. Can someone take a peek at my code and see where I'm going wrong with this? I've been playing around with this for hours but just can't seem to make any progress on this last piece (I only know very basic Javascript so chances are it's probably something I'm just not seeing).

arcticmatt commented 3 years ago

@rcnjstudent let me know if you figure this out, also interested in using this algorithm

arcticmatt commented 3 years ago

@rcnjstudent I got something working based on the codepen you linked https://codepen.io/arcticmatt/pen/VwpxZEE?editors=1111.

rcnjstudent commented 3 years ago

@rcnjstudent I got something working based on the codepen you linked https://codepen.io/arcticmatt/pen/VwpxZEE?editors=1111.

Matt, thanks for taking the time to work on this and share. I actually came up with a solution about the same time you did and updated my codepen link with my code. I think yours is probably a bit more polished than mine but it conceptually works.