animated electric circuit using html5 canvas