Why is my guy friend acting hot and cold to me?

This one guy messaged me online a few months ago and we've been talking all day every day ever since. He would always initiate the conversation by saying good morning and talk all day until late at say goodnight with an emoiji. In the short amount of time we've known each other, he's just about told me everything about him including some very personal details. Recently, he's been acting rather cold. He would respond completely differently, ignore my texts mid conversation, and blow me off but if I ignore his texts he gets upset and asks why I did so. He knows I like him and will always talk about encounters with other girls and his crush. Occasionally he will joke around sexually to me about us doing it and flirt a lot. More than one time he has brought up us meeting up and hanging out due to the fact he doesn't live nearby but so far we haven't hung out once. I'm just really confused because he will either act super sweet or completely blow me off and I don't know what to do. Thanks for reading all of this!
Why is my guy friend acting hot and cold to me?
Post Opinion