refactored JS, added styled successful pin and functionality for it ,currently working
fully operational with localhost, after successful post, window closes after 8 seconds