Загрузка видео...

Не удалось загрузить видео

На главную

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 просмотров • 2 месяцев назад •via X (Twitter)

Комментарии: 36

Фото профиля Haz
Haz2 месяцев назад

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

Фото профиля daniel petho
daniel petho2 месяцев назад

ufff this is so goooood!

Фото профиля Kevin Grajeda
Kevin Grajeda2 месяцев назад

🙌thanks

Фото профиля Said fatah
Said fatah2 месяцев назад

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

Фото профиля Spanky McDoob
Spanky McDoob2 месяцев назад

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

Фото профиля Mathieu Jouhet
Mathieu Jouhet2 месяцев назад

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

Фото профиля Moe Amaya
Moe Amaya2 месяцев назад

Sooo good

Фото профиля Mona
Mona2 месяцев назад

really cool!

Фото профиля Rasmus Andersson
Rasmus Andersson2 месяцев назад

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

Фото профиля Kevin Grajeda
Kevin Grajeda2 месяцев назад

Will do!

Фото профиля shawn.
shawn.2 месяцев назад

thank you for this

Фото профиля Igor bedesqui
Igor bedesqui2 месяцев назад

amazing post thank you

Фото профиля John Rees
John Rees2 месяцев назад

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

Фото профиля Ashutosh Rana • UX for AI Products
Ashutosh Rana • UX for AI Products2 месяцев назад

Preety cool, the amount of details is crazy

Фото профиля Edoardo Galati
Edoardo Galati2 месяцев назад

So smooth!

Фото профиля Rakibul
Rakibul2 месяцев назад

superb

Фото профиля Rico
Rico2 месяцев назад

soo tufff

Фото профиля رِزق
رِزق2 месяцев назад

The devil is in the details. 😫

Фото профиля Rene Wang
Rene Wang2 месяцев назад

love your attention on details. gonna feature this on

Фото профиля AI Mastery Guide
AI Mastery Guide2 месяцев назад

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

Фото профиля Wes Winder
Wes Winder2 месяцев назад

that's beautiful

Фото профиля Isaiah
Isaiah2 месяцев назад

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

Фото профиля Nicolas
Nicolas2 месяцев назад

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

Фото профиля Avi Ashkenazi
Avi Ashkenazi2 месяцев назад

Love the details

Фото профиля Chauve Camille
Chauve Camille2 месяцев назад

It's really good. 🔥

Фото профиля meowhib
meowhib2 месяцев назад

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

Фото профиля MIKE SUNDAY
MIKE SUNDAY2 месяцев назад

I love this.

Фото профиля Said fatah
Said fatah2 месяцев назад

sick ! recreating this right now !

Фото профиля Saksham Arora
Saksham Arora2 месяцев назад

This is so cool. Thanks for the clear breakdown

Фото профиля 猫不困
猫不困2 месяцев назад

学到了,大佬 Learned something, expert!

Фото профиля Eerie Pariah
Eerie Pariah2 месяцев назад

Nobody will notice this

Фото профиля Alireza Najafi
Alireza Najafi2 месяцев назад

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

Фото профиля Noel
Noel2 месяцев назад

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
Jawad Sarwar2 месяцев назад

So cool!

Фото профиля oluwasefunmi.
oluwasefunmi.2 месяцев назад

This is so cool!

Фото профиля Michael Stevanus Hartono
Michael Stevanus Hartono2 месяцев назад

woww soo cool kevin 👏

Похожие видео

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 просмотров • 3 лет назад

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 просмотров • 2 лет назад