ive seen this before
it might have overheated (perhaps you slept on top of it)
if the iPhone detects that it's overheating it will shut down the AC charging circuit ( which creates heat)
we need more details
Yes I slept on top of it. No i wasn't charging it in my computer. Yes it was in the charger
How exactly do you sleep on your iPhone?
Maybe turned the Maps app on - which can drain a battery faster than a charger can charge it.
Lock the phone, and don't sleep on it!
iPhone are for talking on.
Mattresses are for sleeping on.
If you mix these up you can ruin and iPhone and/or look like a crazy person.