Just noticed this little @codepen demo got featured:

https://codepen.io/thebabydino/pen/XJNpeYL

Detailed explanation for the how behind the mathy solution in this thread ๐Ÿ‘‰ https://mastodon.social/@anatudor/116594229219732729

#CSS #cssGradient #code #coding #web #dev #webDev #webDevelopment #frontend #Maths #cssMaths

That is, we need to add:
i*2*ฮฑ_dx

If k > 1, then we need to add half a turn as well, that is:
round(down, k)*180ยฐ

Adding these to the angular progress along the edge, we get the conic-gradient angle producing a point that moves at constant speed along the perimeter.

#CSS #cssGradient #code #coding #web #dev #webDev #webDevelopment #frontend #Maths #cssMaths

If progress at the bottom left corner (= at half the perimeter starting from the top right corner) is 1, then progress at the bottom right corner is the height 100cqh over half the perimeter (one height 100cqh plus one width 100cqw):

f = 100cqh/(100cqh + 100cqw)

Dividing lengths is supported by Safari & Chrome + we have a Firefox fallback https://frontendmasters.com/blog/count-auto-fill-columns/#getting-the-number-of-columns

#CSS #cssGradient #code #coding #web #dev #webDev #webDevelopment #frontend #Maths #cssMaths

Anyway, what we want to animate here linearly isn't a conic-gradient() angle, it's the progress around the perimeter.

This is k, going from 0 to 2. When k is 0, we're at the top right corner. When it's 1, we're at the bottom left corner, having gone across half the perimeter.

What about the progress value at the bottom right? We'll be calling that f, but how much is it?

#CSS #cssGradient #code #coding #web #dev #webDev #webDevelopment #frontend #Maths #cssMaths

On gradient borders & common issues with them https://www.reddit.com/r/css/comments/1tfmohm/comment/ombei2n/

If you've ever wanted to create constant length/ speed border segments on non-square boxes, the how behind the mathy, less code + working with border-radius solution & the stacked children solution (no border-radius).

#CSS #cssGradient #code #coding #web #dev #webDev #webDevelopment #frontend #Maths #cssMaths

Because someone hearted this old @codepen demo done with 2 radio buttons + their labels in a group and it made me notice the title still said "smooth transition Chromium only" - it's been working cross-browser since the summer of 2024! ๐Ÿฅณ๐ŸŽ‰๐ŸŽ‡

https://codepen.io/thebabydino/pen/BadeGMp

#CSS #cssGradient #cssMask #coding #web #dev #webDev #webDevelopment #code #frontend

Missed this, made on the 1st of Jan on @codepen:

โœจ Sliding border glow on hover for beveled cards, heavily commented https://codepen.io/thebabydino/pen/EayVXKj

Trivial if we have `corner-shape` support & even simpler with `border-area`. But here it's cross-browser.

Detailed explanation of the Maths behind on Ko-fi/ Patreon. This way, you get to both become smarter and support my work so I can continue coding.

#CSS #Maths #cssMaths #cssGradient #cssMask #code #coding #frontend #web #dev #webDev #webDevelopment

My most hearted @codepen demos of '26:

โœจ Pure #CSS #3D animated carousel https://codepen.io/thebabydino/pen/dPXVyqN

โœจ Scatter & #pixelate CSS gradient https://codepen.io/thebabydino/pen/zxBrmdL

โœจ Cards with concave rounding on irregular grid https://codepen.io/thebabydino/pen/WbxpKPQ

First two need very little code and are heavily commented.

#SVG #filter #svgFilter #code #coding #cssTransform #cssTransforms #css3D #cssGradient #cssGrid #layout #cssLayout #cssSubgrid #frontend #web #dev #webDev #webDevelopment

Torn on @codepen: https://codepen.io/thebabydino/pen/XWQQKJd

Absolutely no text duplication whatsoever, not in the markup, not in the `content` of any pseudo. No images save for the "newspaper" background (which doesn't include the torn edges, screen #2) and for #CSS gradients.

Just some #SVG #filter magic! ๐Ÿช„โœจ

#svgFilter #cssGradient #textEffects #code #textEffect #coding #frontend #web #dev #webDevelopment #webDev