Why does light bend in glass? - Refraction and Mirages visualized with Huygens principle

Why does light bend when it enters glass? and how mirages happen. Using the Huygens principle, to show why refraction will make the light bend. Also showing why Inferior mirage happens. All this with the Huygens principle. (Animated and explained)