Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

the trick: CSS position: sticky + mix-blend-mode: difference the bonus trick: add an extra layer and chain the blend to block content out 👨‍🍳

160,153 görüntüleme • 1 yıl önce •via X (Twitter)

31 Yorum

𝚐𝚘𝚗𝚍𝚘 profil fotoğrafı
𝚐𝚘𝚗𝚍𝚘1 yıl önce

codepen for the lazy ones

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

ha – you are good at this 🙏😅

𝚐𝚘𝚗𝚍𝚘 profil fotoğrafı
𝚐𝚘𝚗𝚍𝚘1 yıl önce

public service 💪 screenshot, copy text, create link, spam it on X

Kim profil fotoğrafı
Kim1 yıl önce

Wow, amazing tip. 👍

nayma profil fotoğrafı
nayma1 yıl önce

hi jhey, your work is incredible. is your work structured anywhere so that i can learn and try recreating these animations step by step

Zée profil fotoğrafı
Zée1 yıl önce

Learnt a lot. thanks for sharing!

Dustin profil fotoğrafı
Dustin1 yıl önce

These techniques showcase really creative use of CSS blending and positioning to achieve dynamic visual effects. Thanks for sharing these insightful tricks for enhancing web design!

Guillerming.es profil fotoğrafı
Guillerming.es1 yıl önce

Wonderful tip!!

Nowshad profil fotoğrafı
Nowshad1 yıl önce

cooooool

Selena 🏳️‍⚧️ profil fotoğrafı
Selena 🏳️‍⚧️1 yıl önce

I'm interested by debug CSS because the best I do is just border 1px solid red

Ak afridi profil fotoğrafı
Ak afridi1 yıl önce

This is such a clever technique! The sticky + blend-mode combo is brilliant for creating always-visible navigation. Love how you're pushing CSS capabilities - super inspiring work! 🎨

JJ Gerrish profil fotoğrafı
JJ Gerrish1 yıl önce

Thanks for sharing, love the extra layer tip to block content 👌🏻

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

no problem at all – that comes in pretty handy if you have color content that you don't want to intefere 🤙

anotherdeveloper.dev profil fotoğrafı
anotherdeveloper.dev1 yıl önce

Ohhh you back 🥰🥰🥰

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

gonna give it a go 🙏

Tom Zajac profil fotoğrafı
Tom Zajac1 yıl önce

Too bad it only works properly with black and white. Different colors on the logo and buttons only make it look weird.

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

well yes, to be expected, it's "difference". you would expect red to give teal, etc. otherwise you need to introduce blocked out layers or isolate them

Tom Zajac profil fotoğrafı
Tom Zajac1 yıl önce

Is this what `isolation` property is for?

vishal profil fotoğrafı
vishal1 yıl önce

Look amazing 😃

Trevor profil fotoğrafı
Trevor1 yıl önce

When did this property start? I’ve been working with CSS since it was first released and am only just now hearing about it. Super cool.

rhemophrat profil fotoğrafı
rhemophrat1 yıl önce

Slick AF

larry profil fotoğrafı
larry1 yıl önce

great share

Adam McKee profil fotoğrafı
Adam McKee1 yıl önce

I tried blend mode and it broke animation performance by requiring all CSS animations to be done on the main UI thread

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

there is no animation here, not required

Adam McKee profil fotoğrafı
Adam McKee1 yıl önce

Ah, that's good, cuz it wouldn't blend well

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

it is blending, jus' doesn't need animating composited animations on blend layers typically work fine

Giovanni D'Andrea profil fotoğrafı
Giovanni D'Andrea1 yıl önce

ok flashbang ok

NICOLETTI ➖ profil fotoğrafı
NICOLETTI ➖1 yıl önce

@evertjr

Chroma Flow ® profil fotoğrafı
Chroma Flow ®1 yıl önce

Looks amazing

Nam Doan profil fotoğrafı
Nam Doan1 yıl önce

Interesting! So you can achieve that using only css?

Friedrich Stoltzfus profil fotoğrafı
Friedrich Stoltzfus1 yıl önce

Please update your browser

Benzer Videolar

CSS Tip! 💪 You can create these tab controls with CSS :has() + radio buttons ✨ .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } .tabs::after { translate: calc(var(--active, 0) * 100%) 0; width: calc(100% / var(--count)); } Two CSS :has() tricks here combined with a rendering trick 🤙 The tab control is a container using display: grid. You can use :has() to count the number of tabs in the container: .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(input:nth-of-type(4)) { --count: 4; } Using the cascade, the last valid :has() gives you the number of tabs 🫶 Once you know the number of tabs, you know how to size the indicator: .tabs::after { content: ""; position: absolute; height: 100%; width: calc(100% / var(--count)); } It's a pseudoelement that uses --count to determine its size 📏 The next :has() trick is determining which tab is active or :checked as it's an input [type=radio] .tabs:has(:checked:nth-of-type(2)) { --active: 1; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } You can use a zero-indexed translation here. If the second input is :checked, set --active: 1, then translate the pseudoelement on the tabs to that position 👉 .tabs::after { translate: calc(var(--active, 0) * 100%) 0; } The last rendering trick is using mix-blend-mode 👀 The tabs have a black background-color, the pseudoelement is white, and the label text is white. When you use mix-blend-mode: difference on the pseudoelement it will give this effect that the text transitions from white to black sliding across 😎 .tabs::after { color: hsl(0 0% 100%); mix-blend-mode: difference; } You can totally mix up the colors here though and go with a different effect. The mechanics of how you can use CSS :has() is the main point here 🙏 As always, any questions, suggestions, etc. let me know CodePen.IO link below! 👇 (There's even a Tailwind CSS play for this one too 👀)

jhey ʕ•ᴥ•ʔ

437,855 görüntüleme • 2 yıl önce