I often see some circular wave graphics on mobile devices to display the amount. At first I thought this effect could only be created using canvas, but later I found that it could also be created using CSS. Principle: We all know that setting Let’s take a look at the effect diagram first: //css code .wave { position: relative; width: 200px; height: 200px; background: @color; border: 5px solid #76daff; border-radius: 50%; overflow: hidden; } .wave-box::before, .wave-box::after { content: ''; position: absolute; top: 0; left: 50%; width: 400px; height: 400px; border-radius: 45%; -webkit-transform: translate(-50%, -70%); transform: translate(-50%, -70%); background: rgba(255, 255, 255, 0.5); -webkit-animation: rotate 10s linear infinite; animation: rotate 10s linear infinite; z-index: 10; } @keyframes rotate { 50% { -webkit-transform: translate(-50%, -75%) rotate(180deg); transform: translate(-50%, -75%) rotate(180deg); } 100% { -webkit-transform: translate(-50%, -70%) rotate(180deg); transform: translate(-50%, -70%) rotate(180deg); } } //Or it is more convenient to use a precompiled language, here we use less .wave(@width; @height; @color) { position: relative; width: @width; height: @height; background: @color; border: 5px solid @color; border-radius: 50%; overflow: hidden; &::before, &::after { content: ''; position: absolute; top: 0; left: 50%; width: @width * 2; height: @height * 2; border-radius: 45%; transform: translate(-50%, -70%); background: rgba(255,255,255,0.5); animation: rotate 10s linear infinite; z-index: 10; } &::after { border-radius: 47%; background: rgba(255,255,255,0.5); animation: rotate 10s linear -5s infinite; z-index: 20; } } //Call .wave-box { .wave(200px; 200px; #76daff); } <!-- Called on the page --> <div class="wave-box"></div> Summarize The above is what I introduced to you about using CSS to achieve circular wave effects. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: A brief discussion on the synchronization solution between MySQL and redis cache
>>: Web standards learning to understand the separation of structure and presentation
1 Introduction PostgreSQL is a free software obje...
To put it simply, the IP of the virtual machine u...
Pull the image # docker pull codercom/code-server...
Adding the rel="nofollow" attribute to ...
background Recently, a leader wanted us to build ...
First, you need to determine which fields or fiel...
trigger: Trigger usage scenarios and correspondin...
When the carriage return character ( Ctrl+M ) mak...
This example requires downloading and installing ...
mysql5.5.28 installation tutorial for your refere...
Table of contents Preface Generate SVG Introducti...
Preface var is a way to declare variables in ES5....
I encountered this problem when I was making the ...
When connecting to the local database, navicat fo...
<br />"There are no ugly women in the w...