css3 彩带扩散效果_【css3动画】圆波扩散效果

圆波扩散动画效果,就是一个圆由中心向四周循环扩散的动画效果。圆波扩散动画效果应用非常广泛,例如可以用来表示某一个位置的状态信息,在网页设计中,常常被用来作为登录或切换页面时的等待状态。如下图所示:

【css3动画】圆波扩散效果

本文将使用纯CSS3实现上图动画效果。

实例一:由实心圆点向四周扩散(有阴影)

css3动画圆波扩散效果

@keyframes warn {

0% {

transform: scale(0.3);

-webkit-transform: scale(0.3);

opacity: 0.0;

}

25% {

transform: scale(0.3);

-webkit-transform: scale(0.3);

opacity: 0.1;

}

50% {

transform: scale(0.5);

-webkit-transform: scale(0.5);

opacity: 0.3;

}

75% {

transform: scale(0.8);

-webkit-transform: scale(0.8);

opacity: 0.5;

}

100% {

transform: scale(1);

-webkit-transform: scale(1);

opacity: 0.0;

}

}

@keyframes warn1 {

0% {

transform: scale(0.3);

-webkit-transform: scale(0.3);

opacity: 0.0;

}

25% {

transform: scale(0.3);

-webkit-transform: scale(0.3);

opacity: 0.1;

}

50% {

transform: scale(0.3);

-webkit-transform: scale(0.3);

opacity: 0.3;

}

75% {

transform: scale(0.5);

-webkit-transform: scale(0.5);

opacity: 0.5;

}

100% {

transform: scale(0.8);

-webkit-transform: scale(0.8);

opacity: 0.0;

}

}

.container {

position: relative;

width: 120px;

height: 120px;

left: 10px;

top: 10px;

}

/* 保持大小不变的小圆点 */

.dot {

position: absolute;

width: 7px;

height: 7px;

left: 134px;

top: 134px;

-webkit-border-radius: 50%;

-moz-border-radius: 50%;

border: 1px solid #33ccff;

border-radius: 50%;

background-color:#33ccff; /* 实心圆 ,如果没有这个就是一个小圆圈 */

z-index: 2;

}

/* 产生动画(向外扩散变大)的圆圈 第一个圆 */

.pulse {

position: absolute;

width: 35px;

height: 35px;

left: 120px;

top: 120px;

border: 1px solid #3399ff;

-webkit-border-radius: 50%;

-moz-border-radius: 50%;

border-radius: 50%;

z-index: 1;

opacity: 0;

-webkit-animation: warn 2s ease-out;

-moz-animation: warn 2s ease-out;

animation: warn 2s ease-out;

-webkit-animatio

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,您想了解关于CSS3弧形跑道效果和飞机弧形飞行动画的相关内容,是吗?以下是相关的介绍和实现方法: 1. CSS3弧形跑道效果 CSS3可以用border-radius属性实现圆角效果,如果把四个角都设置为50%,就能实现圆形效果。而如果只把左上角和左下角设置为50%,右上角和右下角设置为0%,就能实现左半圆的效果。用同样的方法,可以实现右半圆、上半圆、下半圆的效果。因此,可以通过组合这些半圆形来实现弧形效果。具体实现方法如下: ``` <div class="path"> <div class="semi-circle-left"></div> <div class="semi-circle-right"></div> </div> .path { position: relative; width: 200px; height: 100px; } .semi-circle-left, .semi-circle-right { position: absolute; width: 100px; height: 100px; border-radius: 50%; } .semi-circle-left { top: 0; left: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; transform: rotate(-90deg); background-color: #f00; } .semi-circle-right { top: 0; right: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; transform: rotate(90deg); background-color: #00f; } ``` 其中,.path表示弧形路径,.semi-circle-left和.semi-circle-right表示左半圆和右半圆。通过设置它们的位置、大小和旋转角度,就能实现弧形路径的效果。 2. CSS3飞机弧形飞行动画 CSS3可以通过animation属性实现动画效果。对于飞机弧形飞行动画,可以将飞机用一个div表示,然后通过关键帧动画来实现飞行效果。具体实现方法如下: ``` <div class="plane"></div> .plane { position: absolute; width: 50px; height: 50px; background-color: #000; border-radius: 50% 50% 0 0; transform: rotate(45deg); animation: fly 5s linear infinite; } @keyframes fly { 0% { top: 0; left: 0; transform: rotate(45deg); } 25% { top: 100px; left: 100px; transform: rotate(135deg); } 50% { top: 200px; left: 200px; transform: rotate(225deg); } 75% { top: 100px; left: 300px; transform: rotate(315deg); } 100% { top: 0; left: 400px; transform: rotate(405deg); } } ``` 其中,.plane表示飞机,通过设置它的大小、颜色、圆角和旋转角度,就能实现飞机的效果。通过设置关键帧,就能实现飞机沿着弧形路径飞行的效果。通过设置animation属性,就能让动画无限循环播放。 希望以上内容能够对您有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值