Virus?

I was watching pornhub and then this other tab opens and says that my phone will be locked within a day. I'm afraid it might be some type of virus. i just exited out but I'm not sure if i should worry or not. Has anyone ever gone through this? Do i have a virus or did i do the right thing and exit out?