creating modal library using pure JS