She stares st me when I'm not looking but ignores me up close?

So this girl used to stare at me a lot for the past year and a half and would look away when I catch her. Now she still stares at me when I'm not looking but when I'm close she pretends I don't exist. She'll talk with her friends and laugh with them, so I don't think she is shy. But why is she like this?
She stares st me when I'm not looking but ignores me up close?
Post Opinion