Your phone WAS NOT hacked. Trust me, it wasn't.
What you encountered was a bit of what we call "scareware." Scareware is a bit of social engineering that tries to scare you into doing something that you really shouldn't, like call a phone number, or visit a malicious Web site, or pay a ransom, etc.
There is no malware on your phone, and you have nothing to worry about. What you encountered amounts to a nasty ad on a Web site. You did exactly what you should do when encountering scareware, you exited the page without doing what the scareware was trying to get you to do. Relax and breathe easy.
You can check out your battery with this free utility:
Coconut Battery (free)
With coconutBattery you are always aware of your current battery health. It shows you live information about the battery in your Mac and iOS devices (iPhone, iPad)
www.coconut-flavour.com
When your battery is at 80% or less of design capacity, it's time for a new battery.