POW: Packaged Offline/online Webpage
Did you know that the PNG image format can contain arbitrary data - such as a ZIP file - in its metadata? I sure didn’t. Turns out you can store a whole static site in a PNG file. 😮
Did you know that the PNG image format can contain arbitrary data - such as a ZIP file - in its metadata? I sure didn’t. Turns out you can store a whole static site in a PNG file. 😮
There are so many wonderful animations on Cassie Evans’ website that I love, from the way the site title is drawn in to all the effects when you hover/interact with certain things.
Standard drop-down menus that contain sub-menus very often have no concept of user intent, and this can lead to a repeating frustration that most of us have likely run into: straying off course by even a single pixel can cause the sub-menu to close instantly. Ways around this include adding a delay to try and account for user error, but that doesn’t feel as snappy. Amazon has a really clever solution that accounts for user error yet responds instantly:
At every position of the [pointer] you can picture a triangle between the current mouse position and the upper and lower right corners of the dropdown menu. If the next mouse position is within that triangle, the user is probably moving their [pointer] into the currently displayed submenu. Amazon uses this for a nice effect. As long as the [pointer] stays within that blue triangle the current submenu will stay open. It doesn’t matter if the [pointer] hovers over “Appstore for Android” momentarily – the user is probably heading toward “Learn more about Cloud Drive.”
And if the [pointer] goes outside of the blue triangle, they instantly switch the submenu, giving it a really responsive feel.
So if you’re as geeky as me and think something this trivial is cool, I made a jQuery plugin that fires events when detecting this sort of directional menu aiming: jQuery-menu-aim.
See the source link for more.
Want to see a really interesting use of media queries? Open Lynn Fisher’s site in a desktop browser and resize the window, or watch this (crappy and choppy) video I took of myself doing that:
Here’s a secret: You may not need
scroll
events in your next app. Using anIntersectionObserver
, I show how you can fire a custom event whenposition:sticky
elements become fixed or when they stop sticking. All without the use of scroll listeners.[…]
One of the practical limitations of using CSS sticky position is that it doesn’t provide a platform signal to know when the property is active. In other words, there’s no event to know when an element becomes sticky or when it stops being sticky.
I got frustrated of not being able to tell the tabs apart as I was working on stuff. So this is my so-dumb-it’s-smart solution.