HTML5 logic gate simulator