• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

Experimenting With Scroll-Pushed corner-shape Animations

Admin by Admin
March 24, 2026
Home Coding
Share on FacebookShare on Twitter


Over the previous few years, there’s been lots of discuss and experimentation with scroll-driven animations. It’s a really shiny function for certain, and as quickly because it’s supported in Firefox (with no flag), it’ll be baseline. It’s a part of Interop 2026, in order that ought to be comparatively quickly. Basically, scroll-driven animations tie an animation timeline’s place to a scroll place, so if you happen to had been 50% scrolled you then’d even be 50% into the animation, they usually’re surprisingly straightforward to arrange too.

I’ve been seeing important curiosity within the new CSS corner-shape property as properly, though it solely works in Chrome for now. This permits us to create corners that aren’t as rounded, or aren’t even rounded in any respect, permitting for some intriguing shapes that take little-to-no effort to create. What’s much more intriguing although is that corner-shape is mathematical, so it’s simply animated.

Therefore, say good day to scroll-driven corner-shape animations (requires Chrome 139+ to work absolutely):

corner-shape in a nutshell

Actual fast β€” the totally different values for corner-shape:

corner-shape key phrase superellipse() equal
sq. superellipse(infinity)
squircle superellipse(2)
spherical superellipse(1)
bevel superellipse(0)
scoop superellipse(-1)
notch superellipse(-infinity)

Showing the same magenta-colored rectangle with the six difference CSS corner-shape property values applied to it in a three-by-three grid.

However what’s this superellipse() perform all about? Nicely, principally, these key phrase values are the results of this perform. For instance, superellipse(2) creates corners that aren’t fairly squared however aren’t fairly rounded both (the β€œsquircle”). Whether or not you employ a key phrase or the superellipse() perform straight, a mathematical equation is used both means, which is what makes it animatable. With that in thoughts, let’s dive into that demo above.

Animating corner-shape

The demo isn’t too sophisticated, so I’ll begin off by dropping the CSS right here, after which I’ll clarify the way it works line-by-line:

@keyframes bend-it-like-beckham {
  from {
    corner-shape: superellipse(notch);
    /* or */
    corner-shape: superellipse(-infinity);
  }

  to {
    corner-shape: superellipse(sq.);
    /* or */
    corner-shape: superellipse(infinity);
  }
}

physique::earlier than {
  /* Fill viewport */
  content material: "";
  place: fastened;
  inset: 0;

  /* Allow click-through */
  pointer-events: none;

  /* Invert underlying layer */
  mix-blend-mode: distinction;
  background: white;

  /* Don’t overlook this! */
  border-bottom-left-radius: 100%;

  /* Animation settings */
  animation: bend-it-like-beckham;
  animation-timeline: scroll();
}

/* Added to playing cards */
.no-filter {
  isolation: isolate;
}

Within the code snippet above, physique::earlier than mixed with content material: "" creates a pseudo-element of the with no content material that’s then fastened to each fringe of the viewport. Additionally, since this animating form shall be on prime of the content material, pointer-events: none ensures that we will nonetheless work together with stated content material.

For the form’s shade I’m utilizing mix-blend-mode: distinction with background: white, which inverts the underlying layer, a classy impact that to a point solely maintains the identical degree of shade distinction. You gained’t need to apply this impact to every part, so right here’s a utility class to exclude the impact as wanted:

/* Added to playing cards */
.no-filter {
  isolation: isolate;
}

A comparability:

Side-by-side comparison showing blend mode applied on the left and excluded from cards placed in the layout on the right, preventing the card backgrounds from changing.
Left: Full utility of mix mode. Proper: Mix mode excluded from playing cards.

You’ll want to mix corner-shape with border-radius, which makes use of corner-shape: spherical below the hood by default. Sure, that’s proper, border-radius doesn’t really spherical corners β€” corner-shape: spherical does that below the hood. Reasonably, border-radius handles the x-axis and y-axis coordinates to attract from:

/* Syntax */
border-bottom-left-radius:  ;

/* Utilization */
border-bottom-left-radius: 50% 50%;
/* Or */
border-bottom-left-radius: 50%;
Diagramming the shape showing border-radius applied to the bottom-left corner. The rounded corner is 50% on the y-axis and 50% on the x-axis.

In our case, we’re utilizing border-bottom-left-radius: 100% to slip these coordinates to the other finish of their respective axes. Nonetheless, we’ll be overwriting the implied corner-shape: spherical in our @keyframe animation, so we seek advice from that with animation: bend-it-like-beckham. There’s no must specify a length as a result of it’s a scroll-driven animation, as outlined by animation-timeline: scroll().

Within the @keyframe animation, we’re animating from corner-shape: superellipse(notch), which is like an inset sq.. That is equal to corner-shape: superellipse(-infinity), so it’s not really squared nevertheless it’s so aggressively sharp that it seems squared. This animates to corner-shape: superellipse(sq.) (an outset sq.), or corner-shape: superellipse(infinity).

Animating corner-shape… revisited

The demo above is definitely a bit totally different to the one which I initially shared within the intro. It has one minor flaw, and I’ll present you the right way to repair it, however extra importantly, you’ll be taught extra about an intricate element of corner-shape.

The flaw: at the start and finish of the animation, the curvature seems fairly harsh as a result of we’re animating from notch and sq., proper? It additionally seems like the form is being sucked into the corners. Lastly, the form being caught to the edges of the viewport makes the entire thing really feel too contained.

The answer is straightforward:

/* Change this... */
inset: 0;

/* ...to this */
inset: -1rem;

This stretches the form past the viewport, and though this makes the animation seem to begin late and end early, we will repair that by not animating from/to -infinity/infinity:

@keyframes bend-it-like-beckham {
  from {
    corner-shape: superellipse(-6);
  }

  to {
    corner-shape: superellipse(6);
  }
}

Certain, which means that a part of the form is at all times seen, however we will fiddle with the superellipse() worth to make sure that it stays exterior of the viewport. Right here’s a side-by-side comparability:

Two versions of the same magenta colored rectangle side-by-side. The left shows the top-right corner more rounded than the right which is equally rounded.

And the unique demo (which is the place we’re at now):

Including extra scroll options

Scroll-driven animations work very properly with different scroll options, together with scroll snapping, scroll buttons, scroll markers, easy textual content fragments, and easy JavaScript strategies corresponding to scrollTo()/scroll(), scrollBy(), and scrollIntoView().

For instance, we solely have so as to add the next CSS snippet to introduce scroll snapping that works proper alongside the scroll-driven corner-shape animation that we’ve already arrange:

:root {
  /* Snap vertically */
  scroll-snap-type: y;

  part {
    /* Snap to part begin */
    scroll-snap-align: begin;
  }
}

β€œMasking” with corner-shape

Within the instance under, I’ve basically created a border across the viewport after which a notched form (corner-shape: notch) on prime of it that’s the identical shade because the background (background: inherit). This form fully covers the border at first, however then animates to disclose it (or on this case, the 4 corners of it):

If I make the form a bit extra seen, it’s simpler to see what’s taking place right here, which is that I’m rotating this form as properly (rotate: 5deg), making the form much more fascinating.

A large gray cross shape overlaid on top of a pinkish background. The shape is rotated slightly to the right and extends beyond the boundaries of the background.,

This time round we’re animating border-radius, not corner-shape. Once we animate to border-radius: 20vw / 20vh, 20vw and 20vh refers back to the x-axis and y-axis of every nook, respectively, that means that 20% of the border is revealed as we scroll.

The one different factor price mentioning right here is that we have to fiddle with z-index to make sure that the content material is greater up within the stacking context than the border and form. Apart from that, this instance merely demonstrates one other enjoyable means to make use of corner-shape:

@keyframes tech-corners {
  from {
    border-radius: 0;
  }

  to {
    border-radius: 20vw / 20vh;
  }
}

/* Border */
physique::earlier than {
  /* Fill (- 1rem) */
  content material: "";
  place: fastened;
  inset: 1rem;
  border: 1rem strong black;
}

/* Notch */
physique::after {
  /* Fill (+ 3rem) */
  content material: "";
  place: fastened;
  inset: -3rem;

  /* Rotated form */
  background: inherit;
  rotate: 5deg;
  corner-shape: notch;

  /* Animation settings */
  animation: tech-corners;
  animation-timeline: scroll();
}

primary {
  /* Stacking repair */
  place: relative;
  z-index: 1;
}

Animating a number of corner-shape parts

On this instance, we now have a number of nested diamond shapes because of corner-shape: bevel, all leveraging the identical scroll-driven animation the place the diamonds enhance in measurement, utilizing padding:



@keyframes diamonds-are-forever {
  from {
    padding: 7rem;
  }

  to {
    padding: 14rem;
  }
}

#diamonds {
  /* Middle them */
  place: fastened;
  inset: 50% auto auto 50%;
  translate: -50% -50%;

  /* #diamonds, the 
s inside */ &, div { corner-shape: bevel; border-radius: 100%; animation: diamonds-are-forever; animation-timeline: scroll(); border: 0.0625rem strong #00000030; } } primary { /* Stacking repair */ place: relative; z-index: 1; }

That’s a wrap

We simply explored animating from one customized superellipse() worth to a different, utilizing corner-shape as a masks to create new shapes (once more, whereas animating it), and animating a number of corner-shape parts directly. There are such a lot of methods to animate corner-shape apart from from one key phrase to a different, and if we make them scroll-driven animations, we will create some actually fascinating results (though, they’d additionally look superior in the event that they had been static).

Tags: AnimationscornershapeExperimentingScrollDriven
Admin

Admin

Next Post
Dragon Ball Tremendous artist Toyotaro teases the manga may nonetheless come again

Dragon Ball Tremendous artist Toyotaro teases the manga may nonetheless come again

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

A Coding Information to Construct an Agentic AI‑Powered Asynchronous Ticketing Assistant Utilizing PydanticAI Brokers, Pydantic v2, and SQLite Database

A Coding Information to Construct an Agentic AI‑Powered Asynchronous Ticketing Assistant Utilizing PydanticAI Brokers, Pydantic v2, and SQLite Database

April 22, 2025
amid negotiations with the DOD, Anthropic submitted a bid to compete in a $100M DOD contest to develop voice-controlled, autonomous drone swarming tech (Katrina Manson/Bloomberg)

amid negotiations with the DOD, Anthropic submitted a bid to compete in a $100M DOD contest to develop voice-controlled, autonomous drone swarming tech (Katrina Manson/Bloomberg)

March 3, 2026

Trending.

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
Moonshot AI Releases π‘¨π’•π’•π’†π’π’•π’Šπ’π’ π‘Ήπ’†π’”π’Šπ’…π’–π’‚π’π’” to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

Moonshot AI Releases π‘¨π’•π’•π’†π’π’•π’Šπ’π’ π‘Ήπ’†π’”π’Šπ’…π’–π’‚π’π’” to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

March 16, 2026
AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

February 23, 2026
10 tricks to begin getting ready! β€’ Yoast

10 tricks to begin getting ready! β€’ Yoast

July 21, 2025
Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

Efecto: Constructing Actual-Time ASCII and Dithering Results with WebGL Shaders

January 5, 2026

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

5 Intelligent Methods To Use Vibration Sensors Round The Home

5 Intelligent Methods To Use Vibration Sensors Round The Home

March 24, 2026
Black Duck launches Signβ„’, bringing agentic AI to utility safety

Black Duck Launches Sign to Sort out the Safety Dangers of AI-Generated Code

March 24, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

Β© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

Β© 2025 https://blog.aimactgrow.com/ - All Rights Reserved