Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

This works by using: - normal border-radius - a ::before pseudo-element for the tab - Framer Motion to handle the drag interaction - a tiny distance-to-progress calculation that updates the border radii

309,845 görüntüleme • 2 ay önce •via X (Twitter)

36 Yorum

Haz profil fotoğrafı
Haz2 ay önce

That's cool. I built it a while ago. The biggest challenge is syncing it with nonlinear transitions:

daniel petho profil fotoğrafı
daniel petho2 ay önce

ufff this is so goooood!

Kevin Grajeda profil fotoğrafı
Kevin Grajeda2 ay önce

🙌thanks

Said fatah profil fotoğrafı
Said fatah2 ay önce

recreated it using clip-path , this was a fun exercise for my frontend skills .

Spanky McDoob profil fotoğrafı
Spanky McDoob2 ay önce

theres a point where it gets too pointy on the slide, i wonder if that can be fixed

Mathieu Jouhet profil fotoğrafı
Mathieu Jouhet2 ay önce

This reminds me of the technique I used and explain in my how to round svg polygons @observablehq notebook:

Moe Amaya profil fotoğrafı
Moe Amaya2 ay önce

Sooo good

Mona profil fotoğrafı
Mona2 ay önce

really cool!

Rasmus Andersson profil fotoğrafı
Rasmus Andersson2 ay önce

Very nice! Add smoothing to the curves (squircle style) and it’ll look even more organic I bet

Kevin Grajeda profil fotoğrafı
Kevin Grajeda2 ay önce

Will do!

shawn. profil fotoğrafı
shawn.2 ay önce

thank you for this

Igor bedesqui profil fotoğrafı
Igor bedesqui2 ay önce

amazing post thank you

John Rees profil fotoğrafı
John Rees2 ay önce

would you mind sharing what you created this animation with? it's so effective for explaining things!

Ashutosh Rana • UX for AI Products profil fotoğrafı
Ashutosh Rana • UX for AI Products2 ay önce

Preety cool, the amount of details is crazy

Edoardo Galati profil fotoğrafı
Edoardo Galati2 ay önce

So smooth!

Rakibul profil fotoğrafı
Rakibul2 ay önce

superb

Rico profil fotoğrafı
Rico2 ay önce

soo tufff

رِزق profil fotoğrafı
رِزق2 ay önce

The devil is in the details. 😫

Rene Wang profil fotoğrafı
Rene Wang2 ay önce

love your attention on details. gonna feature this on

AI Mastery Guide profil fotoğrafı
AI Mastery Guide2 ay önce

That distance to progress trick is such a clever way to handle the drag.

Wes Winder profil fotoğrafı
Wes Winder2 ay önce

that's beautiful

Isaiah profil fotoğrafı
Isaiah2 ay önce

yes thank you so much for the debug view! so cool (:

Nicolas profil fotoğrafı
Nicolas2 ay önce

Love those details nobody notices, they're what puts the app ahead of competitors.

Avi Ashkenazi profil fotoğrafı
Avi Ashkenazi2 ay önce

Love the details

Chauve Camille profil fotoğrafı
Chauve Camille2 ay önce

It's really good. 🔥

meowhib profil fotoğrafı
meowhib2 ay önce

is there any design reasoning behind why the blue circle is smaller than the red one?

MIKE SUNDAY profil fotoğrafı
MIKE SUNDAY2 ay önce

I love this.

Said fatah profil fotoğrafı
Said fatah2 ay önce

sick ! recreating this right now !

Saksham Arora profil fotoğrafı
Saksham Arora2 ay önce

This is so cool. Thanks for the clear breakdown

猫不困 profil fotoğrafı
猫不困2 ay önce

学到了,大佬 Learned something, expert!

Eerie Pariah profil fotoğrafı
Eerie Pariah2 ay önce

Nobody will notice this

Alireza Najafi profil fotoğrafı
Alireza Najafi2 ay önce

Could we have borders around the selected tab and the content area with this approach? I tried this but it got very messy

Noel profil fotoğrafı
Noel2 ay önce

Distance-to-progress driving the border radii is such a clean trick. Most people overbuild this with SVG morphs — mapping drag distance to radius keeps it buttery and still reads like real material.

Jawad Sarwar profil fotoğrafı
Jawad Sarwar2 ay önce

So cool!

oluwasefunmi. profil fotoğrafı
oluwasefunmi.2 ay önce

This is so cool!

Michael Stevanus Hartono profil fotoğrafı
Michael Stevanus Hartono2 ay önce

woww soo cool kevin 👏

Benzer Videolar

CSS Trick! 🤙 You can create gradient borders on translucent elements using mask-clip and mask-composite with a pseudo-element 🔥 .gradient-border::after { mask-clip: padding-box, border-box; mask-composite: intersect; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); } It's the same "Transparent border trick" from before. But, now you apply it to a pseudo-element 😎 The trick is to create a pseudo-element with a gradient background and then mask it so we only see the part we want, the border ✨ mask-clip defines the area affected by a mask. Similar to how you can define background-size. Using padding-box and border-box constrains the two masks. mask-composite is the magic part ✨ It defines a compositing operation for stacked mask layers. Using intersect means that the parts that overlap get replaced. And this seems to work in all browsers 🙌 As for the rest of the styles... – Make sure you set pointer-events: none on the pseudo-element – Make sure it fills the parent element. You can use position: absolute and inset: 0 – Make sure the background fills the space including the border-width. You can use calc to achieve that: --bg-size: calc(100% + (2px * var(--border))); background: var(--gradient) center center / var(--bg-size) var(--bg-size); That's it! 🚀 Gradient borders on translucent elements. You can set all the backdrop-filter: blur() you like! 😅 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

269,966 görüntüleme • 3 yıl önce

CSS Tip! ✨ It's 2024 and you have a new way to make animated borders 🚀 .glow::after { offset-path: rect(0 100% 100% 0 round var(--radius)); animation: loop; } @​keyframes loop { to { offset-distance: 100%; }} Using the offset-* properties you can animate elements along the perimeter of others 😍 The rect() value gained support in Safari 17.2 🙌 To start, you create an element and put it inside your main element. For example, you put a span inside the button 🤙 Click me! Make the element fill its parent with absolute positioning and inset [data-glow] { position: absolute; inset: 0; } Now the good part, you use a pseudoelement on that element and define an offset-path [data-glow]::after { content: ""; offset-path: rect(0 auto auto 0 round var(--radius)); animation: loop 2.6s infinite linear; } With the rect value, you are saying the path fills the parent container: top: 0 right: auto || 100% bottom: auto || 100% left: 0 Then you can use round to make sure the path uses the same radius as whatever the parent has The @​keyframes animation merely animates the offset-distance of that pseudoelement to 100% @​keyframes loop { to { offset-distance: 100%; }} You can see this more clearly in the video 🫶 The offset-* properties also include an offset-anchor property. This allows you to dictate which point of the element follows the path. For example: anchor-offset: 100% 50%; This means that the "right, center" of the element will follow the perimeter of the parent element 🤙 Lastly, the visuals 🎨 For color, you can use a gradient such as a linear gradient to fill the pseudo-element. [data-glow]::after { background: radial-gradient( circle at right, hsl(320 90% 100%), transparent 50% ); } Then clip away everything so you only have the border and can still have translucent backgrounds, etc. Use a mask with mask-composite ✨ A little transparent border trick: [data-glow] { border: 2px solid transparent; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); mask-clip: padding-box, border-box; mask-composite: intersect; } Bit of a long one. Hope you find it useful 🙏 CodePen.IO link below 👇

jhey ʕ•ᴥ•ʔ

283,498 görüntüleme • 2 yıl önce