Video yükleniyor...
Video Yüklenemedi
#tinyCSStip You may have seen some of my demos using this on CodePen.IO already. Pure CSS halftone effect in 3 declarations: ✨ background layering a pattern and a map ✨ blend mode multiplication of the two layers ✨ contrast bump up to push all greys to either black or white
27,203 görüntüleme • 2 yıl önce •via X (Twitter)
10 Yorum

I first came up with the idea and gave a talk on it almost half a decade ago. And then I refined the topic a bit for another talk which used these slides you may have seen me share before.

Pattern part may be anything small & repeating. We may also use thin blurry stripes - linear-gradient, rays - repeating-conic-gradient, rings - repeating-radial-gradient Map part may also be another type of gradient or even a .jpg

A `linear-gradient()` pattern coupled with a `linear-gradient()` map is what's behind this retro wave demo And animating the map's `background-position` is how we get this progressive close/ open blinds effect

The .jpg image map case is... special. Most of my demos use extra pseudos/ elements and `mix-blend-mode` for compatibility reasons. But Safari, only browser to support `filter()` (*not* `filter`!) allows for the no extra pseudo/ element #halftone solution

Animating a custom property* that the gradients used for the effect depend on can also produce cool effects, like in - also an entry for this week's #CodePenChallenge😎 And a solution to *not yet in Firefox stable, only in Nightly

A couple more such halftone patterns, both of which have a video of me coding them from scratch. ✨ ✨ #CSS

And here are two more demos showcasing animated halftone patterns, while the elements they're on either fill the full viewport or are positioned in 3D. ✨ ✨ #CSS

Finally, some pure #CSS, single element halftone patterned cards: ✨ ✨

3 more such animated pure #CSS, single element animated halftone patterns on @CodePen: ✨ ✨ ✨

@CodePen 🤯

