流动线条记录

新人工作时,查找资料自学使用

 <div class="line">

    <div class="light-line right-top" >

      <div class="line-block gradient"></div>

    </div>

  </div>

样式文件夹

<style>

.line {

  position: absolute;

  left: 50%;

  top: 27%;

}

.light-line {

  position: absolute;

  top: 20px;

  left: 15px;

  width: 320px;

  height: 320px;

}

.light-line-r {

  position: absolute;

  top: 20px;

  left: 360px;

  width: 320px;

  height: 320px;

}

/* 渐变流光效果线条,要将横向宽度设置为超过100%的值,否则无动画效果 */

.line-block {

  position: relative;

  width: 100%;

  height: 6px;

  background: linear-gradient(-90deg,

      #7B5A39 1%, transparent 24%, #FFD03B 25%, #7B5A39 40%, #7B5A39 50%,

      #7B5A39 50%, transparent 74%, #FFD03B 75%, #7B5A39 90%, #7B5A39 100%);

  background-size: 200% 100%;

}

/* 指定使用Gradient动画,5s完成一次动画,匀速,无限循环 */

.gradient {

  animation: Gradient 5s linear infinite;

  -webkit-animation: Gradient 5s linear infinite;

  -moz-animation: Gradient 5s linear infinite;

}

/* 定义Gradient动画效果:初始时显示最右端,结束时显示最左端(向右滚动) */

@keyframes Gradient {

  0% {

    background-position: 100% 100%;

  }

  100% {

    background-position: 0% 100%;

  }

}

/* 兼容写法.. */

@-webkit-keyframes Gradient {

  0% {

    background-position: 100% 100%;

  }

  100% {

    background-position: 0% 100%;

  }

}

/* 兼容写法.. */

@-moz-keyframes Gradient {

  0% {

    background-position: 100% 100%;

  }

  100% {

    background-position: 0% 100%;

  }

}


 

/* .right-top {

  transform: rotate(90deg);

} */

</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值