HN2new | past | comments | ask | show | jobs | submitlogin

Can I achieve the frosted glass effect with a gif? E.g. semi transparent and a blur of the background that are visible through the button.


Nope, gifs only support binary transparency (transparent or opaque).

APNG would let you do frosted glass though. And I was expecting to add "but support is dire" but... actually it's not so bad? https://caniuse.com/?search=apng says 97%, only browsers with no support are legacy (IE and Opera mini), pretty much all browsers have supported it for years.

WebP and AVIF also have animation and alpha channel support, so these are also options.

Caveat emptor though, I don't have much experience with animation and alpha on any of these formats, so I don't know how buggy support is.


You can generate the gif dynamically. Unless you’re doing a lot of resizing, the one time cost of building the gif will amortize quickly across the total runtime of the animation.


The content beneath the button can scroll up and down. I doubt that it will be worthwhile generating a new gif for every single frame while scrolling.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: