Addressing specific issues: How can CSS create an “organism”?
In the traditional web design, everything is square. However, modern UI Design (e.g. micro-interactivity and neo-ism) is increasingly used
Organic Shapes
or
Blobs
。 These shapes mimic the fluids in nature, and make the pages look more friendly and moving. This tool uses CSS powerful 8 points
border-radius
Properties, get you out of geometry.
1. What is 8 points Border-Radis?
You might know it.
border-radius: 50%
♪ Generate round, but you know ♪
border-radius
Is it really acceptable to accept eight? For example:
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
。 The values behind and behind the slash represent the radius of the horizontal and vertical direction respectively. In this way, we can precisely control the asymmetric contraction of the rectangular four corners, which can create mobility. Blob effects.
Why do developers like to use Blob?
In solving specific page layout problems, Blob has an irreplaceable role:
- Break the grid single-sense: Places a light Blob in a neat graphics list background that effectively attracts the visual focus of the user.
- As the bottom of the illustration: Many product introduction pages place 3D models or product maps in a Blob shape, adding a sense of hierarchy.
-
Dynamic interaction:
Combined CSS
transitionoranimationYou can make Bloom shakes in the user's suspension, and you can give him excellent interactive feedback.
3. Performance optimization recommendations
Although you can draw Bloom using complex SVG paths, Pure CSS Blob There are clear advantages:
- Extremely fast load: Only one line of code is required, and no external vector file is required to be downloaded.
-
GPU acceleration:
border-radiusThe transformation can be processed by the composite layer of the browser, with the animation extremely smooth. -
Response format:
Just set the width and height.
remor%And Blob can adapt to the various sizes of the screen.
How can it be applied in the project?
You can copy the creation.
border-radius
Code, apply to any
div
Go on. Recommendations are accompanied by
linear-gradient
Background to gain a better visual depth:
.blob-container {
width: 300px;
height: 300px;
background: linear-gradient(135deg, #7fbf4a, #f72585);
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}