Dynamic Material 3 organic shape morphing and randomize experiment.
<div class="shape" aria-label="Random shape"></div>
<button id="randomize" type="button">Randomize shape</button>.shape {
width: 220px;
aspect-ratio: 1;
background: #ab9df2;
border-radius: 34% 66% 58% 42% / 42% 38% 62% 58%;
transition: border-radius 500ms cubic-bezier(.2, .8, .2, 1);
}const shape = document.querySelector(".shape");
const random = () => Math.round(25 + Math.random() * 50) + "%";
document.querySelector("#randomize").onclick = () => {
shape.style.borderRadius =
`${random()} ${random()} ${random()} ${random()}`;
};No external packages used.