Animate from display none

Frontend / Web Development 165.2K צפיות 14/04/2022
פתח ב-YouTube

דרג סרטון זה

התחבר כדי לדרג

תיאור

A common problem people ask me about is animating from, or to display: none, since it's not an animatable property. After making my recent video on the dialog element, I got a lot of questions about animating it in and out, and it just so happens to use `display: none` when it's closed, so I saw it as a good opportunity to take a look at it. 🔗 Links ✅ The video on the dialog element: https://youtu.be/TAB_v6yBXIE ✅ The CodePen: https://codepen.io/kevinpowell/pen/QWaBeGm ✅ Open Props: https://open-props.style/ ✅ Video introducing Open Props: https://youtu.be/szPNMKZazzQ ⌚ Timestamps 00:00 - Introduction 01:32 - What we're starting with 01:59 - Adding the animation on open 02:52 - The problem with backdrop 03:53 - Getting the backdrop to fade in 04:31 - Why it's easy to animate on open but not on close 05:28 - A quick fix for animating the close 06:37 - the problems with this solution 08:37 - Making a "closing" state 09:15 - Making the closing state work 14:06 - The problem with different animations on close 15:01 - Closing when we click outside the modal 19:36 - fixing the backdrop shadow effect #css -- Come hang out with other dev's in my Discord Community 💬 https://discord.gg/nTYCvrK Keep up to date with everything I'm up to ✉ https://www.kevinpowell.co/newsletter Come hang out with me live every Monday on Twitch! 📺 https://www.twitch.tv/kevinpowellcss --- Help support my channel 👨‍🎓 Get a course: https://www.kevinpowell.co/courses 👕 Buy a shirt: https://teespring.com/stores/making-the-internet-awesome 💖 Support me on Patreon: https://www.patreon.com/kevinpowell --- My editor: VS Code - https://code.visualstudio.com/ --- I'm on some other places on the internet too! If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter. Twitter: https://twitter.com/KevinJPowell Codepen: https://codepen.io/kevinpowell/ Github: https://github.com/kevin-powell --- And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

NeTube Bot
פעיל עכשיו