Yotter icon indicating copy to clipboard operation
Yotter copied to clipboard

Infinite Scrolling

Open FireMasterK opened this issue 3 years ago • 4 comments

This definitely requires JavaScript, but is definitely a nice to have.

FireMasterK avatar Sep 11 '20 20:09 FireMasterK

I am really thinking to be using Javascript for other things, as it would make things much easier and smooth. Always without breaking the site if disabled.

pluja avatar Sep 11 '20 21:09 pluja

That's definitely a possibility, I can start working on that

FireMasterK avatar Sep 12 '20 07:09 FireMasterK

You can go ahead. I would also like to change the UI to look more 'youtube-like'. Other JS things that would be nice is using AJAX in order to be able to follow a user without reloading the whole page.

pluja avatar Sep 12 '20 07:09 pluja

I've got a general idea of how this can be done,

We create a function like https://stackoverflow.com/a/814649

function create(htmlStr) {
    var frag = document.createDocumentFragment(),
        temp = document.createElement('div');
    temp.innerHTML = htmlStr;
    while (temp.firstChild) {
        frag.appendChild(temp.firstChild);
    }
    return frag;
}
var fragment = create(...) // html content from a fetch request, the server generates the next set of cards for the videos, we can do this pagewise
document.querySelector(".cards").appendChild(fragment);

FireMasterK avatar Sep 12 '20 10:09 FireMasterK