最近工作中要做1个用于图象精准定位的标志,以便让这个标示标志没死板,决策做个简易的动漫,动漫实际效果像波浪纹1样起伏,这样标志就更美观大方漂亮了,喜爱的同学能够跟随来学,10分简易,欢迎纠正沟通交流。
先上实际效果图:
本动漫必须用到的关键特性:animation, transition 和 Keyframes 特性
Step 1:HTML 编码:
XML/HTML Code拷贝內容到剪贴板
- <div class="example">
- <div class="dot"></div>
- </div>
Step 2: CSS款式:设定animation特性
CSS Code拷贝內容到剪贴板
- .dot:before{
- content:' ';
- position: absolute;
- z-index:2;
- left:0;
- top:0;
- width:10px;
- height:10px;
- background-color: #ff4200;
- border-radius: 50%;
- }
-
- .dot:after {
- content:' ';
- position: absolute;
- z-index:1;
- width:10px;
- height:10px;
- background-color: #ff4200;
- border-radius: 50%;
- box-shadow: 0 0 10px rgba(0,0,0,.3) inset;
- -webkit-animation-name:'ripple';
- -webkit-animation-duration: 1s;
- -webkit-animation-timing-function: ease;
- -webkit-animation-delay: 0s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: normal;
- }
设定动漫方法,像波浪纹1样,从小增大变无,因此大家要设定宽高从0 – 50px,全透明度从有至无,这样就可以完成水波涟漪实际效果啦。
CSS Code拷贝內容到剪贴板
- @keyframes ripple {
- 0% {
- left:5px;
- top:5px;
- opcity:75;
- width:0;
- height:0;
- }
- 100% {
- left:-20px;
- top:-20px;
- opacity: 0;
- width:50px;
- height:50px;
- }
- }
实际效果进行了,此实例较为合适图象精准定位标志用,自然还能够有更好的计划方案去替代,健全这个款式与动漫实际效果。