HTML/canvas/javascript logic gate simulator