function Counter() {
const [list1, setList1] = createSignal([1, 2, 3, 4, 5]);
const [list2, setList2] = createSignal([6, 7, 8, 9, 10]);
setTimeout(() => {
setList1([1, 2, 3, 4, 5, 8, 9, 10])
setList2([6, 7])
}, 1000)
return (<>
<div>
<For each={list1()}>{ (item, i) =>
<span style={`position: absolute; color: blue; transform: translate(${i()}em, 0)`}>{item}</span>
}</For>
<For each={list2()}>{ (item, i) =>
<span style={`position: absolute; color: red; transform: translate(${i()}em, 2em)`}>{item}</span>
}</For>
</div>
</>)
}
render(() => <Counter />, document.getElementById("app"));
Bonus would be for animating the color too.