https://jsfiddle.net/t1wcr2cc/

I created the basic functionality that you are looking for. You can add the coloring effects and everything else that you need.