<img src="https://picsum.photos/id/152/400/400" alt="flowers">
<img src="https://picsum.photos/id/940/400/400" class="alt" alt="flowers">
$n: 12; /* the number of circles/petals */
img {
width: 300px;
aspect-ratio: 1;
--r: calc(50%/(1 + 1/sin(180deg/#{$n})));
$m: (); /* empty variable */
@for $i from 1 through ($n) { /* loop through the number of circles*/
$m: append($m,
radial-gradient(50% 50%,#000 98%,#0000) no-repeat
calc(50% + 50%*cos(360deg*#{$i/$n}))
calc(50% + 50%*sin(360deg*#{$i/$n}))
/ calc(2*var(--r)) calc(2*var(--r)),
comma);
}
mask: radial-gradient(100% 100%,#000 calc(var(--r)/tan(180deg/#{$n})),#0000 calc(var(--r)/tan(180deg/#{$n}) + 1px)) #{'var(--alt,)'},#{$m};
background: linear-gradient(60deg,#2d576d,#e0236f);
}
.alt {
width: 380px;
margin: -20px;
--alt: subtract;
}
body {
margin: 0;
min-height: 100vh;
display: grid;
place-content: center;
place-items: center;
grid-auto-flow: column;
gap: 30px;
background: #E08E79;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.