How to use pure CSS to achieve an animation effect without DOM elements

This article mainly introduces how to use pure CSS to realize an animation effect without DOM elements, have a certain reference value, and friends needed can be referred to. I hope that everyone has a big gain after reading this article. Let’s take a look at you with everyone.

Effect Preview

怎么使用纯CSS实现一个没有DOM元素的动画效果 Code Interpretation

No DOM element, write CSS directly.


body {Position: fixed; margin: 0; width: 100vw; height: 100VH;}
   
Set background pattern with fake elements: (123) :: before {content: ‘; position: fixed; width: 200Vmax; Height: 200VMAX; Background-Color: SteelBlue; color: Turquoise ; background-image: linear-gradient (45deg, currentColor 25%, transparent 25%, transparent 75%, currentColor 75%), linear-gradient (45deg, currentColor 25%, transparent 25%, transparent 75%, currentCoLOR 75%); Background-Position: 0 0, 5Vmax 5Vmax; Background-Size: 10Vmax 10Vmax;

Translation background pattern:
   
Body :: before {top: 50%; Left: 50%; Animation: 9s move infinite ease-in-out alternate;} @ keyframes move {from {left: -40%; TOP: -40%;} to {LEFT : -60%; TOP: -60%;}}

   
body :: before {animation: 9S move infinite ease-in-out alternate, 9s -1.5s rotating infinite ease-in-out alternate;} @ Keyframes Rotating {TO {Transform: Rotate (180DEG);}}

Plash page:
  Body {TOP: 50%; Left: 50%; Animation: 3s move infinite ease-in-out alternate;}  

  body {animation: 3s move infinite ease-in-out alternate, 3s zoom infinite ease-in-out alternate;} @ Keyframes Zoom {TO {Transform: Scale (10);}}  
Finally, increase the color change effect:

@keyframes rotating {to {Transform: Rotate (180DEG); Filter: hue-rotate (1TURN);}}
   
Thank you can read this article carefully, I hope that Xiaobian share how to use pure CSS to achieve no DOM The animation of the element is helpful to everyone, and we also hope that you will support Tumi Clouds, pay attention to Tumi cloud industry information channel. If you encounter problems, you will find Tumi clouds, and the detailed solution is waiting for you!

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment