Problem: Morphing Blob Background
Problem description
Given an HTML page containing a <div class="blob"></div> element, write CSS to:
Define at least four CSS custom properties (
--clip1,--clip2,--clip3, and--clip4), each holding apolygon()value describing a distinct blob shape.Set
.blobto fill the viewport (width: 100vw; height: 100vh) and apply a background gradient.Use
clip-path: var(--clip1)initially on.blob.Define a
@keyframes blobMorphanimation that transitionsclip-pathfromvar(--clip1)➔var(--clip2)➔var(--clip3)➔var(--clip4)➔var(--clip1).Apply the
blobMorphanimation to.blobwith an8sduration,ease-in-outtiming, and infinite iteration.
Goal
Write CSS rules to produce a continuously morphing blob background by animating clip-path through multiple polygon shapes using CSS-only techniques.
Constraints
Use only CSS (no JavaScript).
Blob element dimensions should be
width: 100vw; height: 100vh;.For background, use a linear gradient (e.g.,
linear-gradient(135deg, #ff9a9e, #fad0c4)).There should be at least four distinct
clip-pathpolygon definitions stored in CSS variables.Animation name should be
blobMorph.Animation duration should be
8s.Animation timing function should be
ease-in-out.Animation iteration count should be
infinite.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Morphing Blob Background
Problem description
Given an HTML page containing a <div class="blob"></div> element, write CSS to:
Define at least four CSS custom properties (
--clip1,--clip2,--clip3, and--clip4), each holding apolygon()value describing a distinct blob shape.Set
.blobto fill the viewport (width: 100vw; height: 100vh) and apply a background gradient.Use
clip-path: var(--clip1)initially on.blob.Define a
@keyframes blobMorphanimation that transitionsclip-pathfromvar(--clip1)➔var(--clip2)➔var(--clip3)➔var(--clip4)➔var(--clip1).Apply the
blobMorphanimation to.blobwith an8sduration,ease-in-outtiming, and infinite iteration.
Goal
Write CSS rules to produce a continuously morphing blob background by animating clip-path through multiple polygon shapes using CSS-only techniques.
Constraints
Use only CSS (no JavaScript).
Blob element dimensions should be
width: 100vw; height: 100vh;.For background, use a linear gradient (e.g.,
linear-gradient(135deg, #ff9a9e, #fad0c4)).There should be at least four distinct
clip-pathpolygon definitions stored in CSS variables.Animation name should be
blobMorph.Animation duration should be
8s.Animation timing function should be
ease-in-out.Animation iteration count should be
infinite.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.