JSFiddle - React, Tailwind, and code Playground

by gabs00

HTML

<div class="container">
    <ul id="list">
    </ul>
</div>

JavaScript

var items = [], top = [], bottom = [], middle = [];

for(var i = 0; i < 50; i++){
    items.push('Item #'+ i);   
}
for(var i = 0; i < 20; i++){
       middle.push(items.shift());
}
var h;
while(h = items.shift()){
    bottom.push(h);   
}
var obj = {top:top, bottom:bottom, displayed:middle}
    
function scroll(timeline){
    function scroll_up(){
        var i = 0;
        top_length = timeline.top.length;
        max = (top_length < 20) ? top_length:20;
        while(i < max){
            timeline.top.pop()
            i++;    
        }
    }
    return {
        up: 
    }
}