hover box design and some js refactor