这个效果是用的障眼法,用四条线在同一个方向运动。
代码如下:
*{
margin: 0;
padding: 0;
}
.big{
margin: 150px auto;
background: black;
width:258px;
height:307px;
position: relative;
}
.big p{
height: 1px;
width: 50px;
background: rgba(7,241,250,1);
position: absolute;
}
.big p:nth-child(1){
top:5px;
left: 5px;
}
.big p:nth-child(2){
height: 50px;
width: 1px;
bottom: 5px;
right: 5px;
}
.big p:nth-child(3){
bottom: 5px;
right: 5px;
}
.big p:nth-child(4){
height: 50px;
width: 1px;
top:5px;
left: 5px;
}
.big p:nth-child(1){
animation:pOne 4s linear infinite;
}
@keyframes pOne
{
0%{
left: 5px;
width: 50px;
}
10%{
left: 5px;
width: 100px;
}
40%{
left:153px;
width: 100px;
}
60%{
left:253px;
width: 0px;
}
80%{
left:5px;
width: 0px;
}
100%{
left:5px;
width: 50px;
}
}
.big p:nth-child(2){
animation:pTow 4s linear infinite;
}
@keyframes pTow
{
0%{
top: 252px;
height: 50px;
}
10%{
top: 302px;
height: 0px;
}
40%{
top: 5px;
height: 0px;
}
60%{
top: 5px;
height: 100px;
}
80%{
top: 202px;
height: 100px;
}
100%{
top: 252px;
height: 50px;
}
}
.big p:nth-child(3){
animation:pThree 4s linear infinite;
}
@keyframes pThree
{
0%{
right: 5px;
width: 50px;
}
10%{
right: 5px;
width: 100px;
}
40%{
right:153px;
width: 100px;
}
50%{
right:253px;
width: 0px;
}
80%{
right:5px;
width: 0px;
}
100%{
right:5px;
width: 50px;
}
}
.big p:nth-child(4){
animation:pFour 4s linear infinite;
}
@keyframes pFour
{
0%{
top: 5px;
height: 50px;
}
10%{
top: 5px;
height: 0px;
}
40%{
top: 302px;
height: 0px;
}
60%{
top: 202px;
height: 100px;
}
80%{
top: 5px;
height: 100px;
}
100%{
top: 5px;
height: 50px;
}
}
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/53942.html
摘要:层叠即表示允许以多种方式来描述样式,一个元素可以被渲染呈现出多种样式。可以让属性的变化过程持续一段时间,而不是立即生效。比如,将元素的颜色从白色改为黑色,通常这个改变是立即生效的,使用后,将按一个曲线速率变化。 showImg(https://segmentfault.com/img/bVZwyL?w=900&h=385); CSS 的全称是 Cascading Style Sheet...
摘要:透视即是以现实的视角来看屏幕上的事物,从而展现的效果。旋转则不再是平面上的旋转,而是三维坐标系的旋转,就包括轴,轴,轴旋转。必须与属性一同使用,而且只影响转换元素。可自由转载引用,但需署名作者且注明文章出处。 showImg(https://segmentfault.com/img/bVzJoZ); 话不多说,先上demo 酷炫css3走马灯/正方体动画: https://bupt-...
摘要:透视即是以现实的视角来看屏幕上的事物,从而展现的效果。旋转则不再是平面上的旋转,而是三维坐标系的旋转,就包括轴,轴,轴旋转。必须与属性一同使用,而且只影响转换元素。可自由转载引用,但需署名作者且注明文章出处。 showImg(https://segmentfault.com/img/bVzJoZ); 话不多说,先上demo 酷炫css3走马灯/正方体动画: https://bupt-...
摘要:前言最近写了一个文字跑马灯的项目需求,刚开始用写,能够完成需求。代码部分预览实现文字跑马灯小结的方式能够完美的满足子需求点和自需求点。 前言 最近写了一个文字跑马灯的项目需求,刚开始用js写,能够完成需求。后面想着换种方式(分别是html和css)来实现同一个需求,以减少性能消耗。 首先,需求分析: 需求点1.判断文字的长度和容器的长度,如果文字长度大于容器长度则开始滚动,否则不滚动;...
阅读 4647·2021-09-06 15:00
阅读 2401·2019-08-30 15:53
阅读 3523·2019-08-23 16:44
阅读 1261·2019-08-23 15:19
阅读 1642·2019-08-23 12:27
阅读 4498·2019-08-23 11:30
阅读 959·2019-08-23 10:33
阅读 612·2019-08-22 16:05