VUE CSS流动边框特效(二)

这篇博客展示了如何利用HTML和CSS创建一个动态的彩色条纹效果。通过设置绝对定位、滤镜、线性渐变背景以及关键帧动画,实现了四个不同角度的色彩流动条纹,营造出视觉上的流动感。该效果适用于网页背景或其他视觉元素,为网站增添动感和现代感。
摘要由CSDN通过智能技术生成

 效果:

HTML: 

 <div class="divSide">
    <span class="s-1" />
    <span class="s-2" />
    <span class="s-3" />
    <span class="s-4" />
</div>

CSS :

.divSide {
  overflow: hidden;
  width: 460px;
  height: 994px;
  position: relative;
  background-color: #021025;
  border: 1px solid rgba(11, 85, 140, 0.5);
  >span{
    position: absolute;
    display: block;
  }
  .s-1 {
    filter: hue-rotate(0deg);
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3a86ff);
    animation: animate1 1s linear infinite;
  }
  .s-2 {
    filter: hue-rotate(60deg);
    top: -100%;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #3a86ff);
    animation: animate2 1s linear infinite;
    animation-delay: 0.25s;
  }
  .s-3 {
    filter: hue-rotate(120deg);
    bottom: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(270deg, transparent, #3a86ff);
    animation: animate3 1s linear infinite;
    animation-delay: 0.5s;
  }
  .s-4 {
    filter: hue-rotate(300deg);
    bottom: -100%;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(360deg, transparent, #3a86ff);
    animation: animate4 1s linear infinite;
    animation-delay: 0.75s;
  }
}
@keyframes animate1 {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}
@keyframes animate2 {
  0% {
    top: -100%;
  }
  50%,
  100% {
    top: 100%;
  }
}
@keyframes animate3 {
  0% {
    right: -100%;
    height: 3px;
  }
  50%,
  100% {
    height: 2px;
    right: 100%;
  }
}
@keyframes animate4 {
  0% {
    bottom: -100%;
  }
  50%,
  100% {
    bottom: 100%;
  }
}

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LEON劉先森

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值