css实现炫酷的多彩边框走光动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现炫酷的多彩边框走光动画效果代码

代码标签: css 炫酷 多彩 边框 走光 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
  
<style>
.box {
  --border-angle: 0deg;
  border-radius: 12px;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 2px 4px hsl(0 0% 0% / 25%);
  animation: border-angle-rotate 2s infinite linear;
  border: 0.5rem solid transparent;
  position: relative;

  &.a {
    background: linear-gradient(white, white) padding-box,
      conic-gradient(
          from var(--border-angle),
          oklch(100% 100% 0deg),
          oklch(100% 100% 45deg),
          oklch(100% 100% 90deg),
          oklch(100% 100% 135deg),
          oklch(100% 100% 180deg),
          oklch(100% 100% 225deg),
          oklch(100% 100% 270deg),
          oklch(100% 100% 315deg),
          oklch(100% 100% 360deg)
        )
        border-box;
  }

  &.b {
    background: linear-gradient(white, white) padding-box,
      conic-gradient(
          from var(--border-angle),
          var(--bg) 50%,
        white
        )
        border-box;
  }

  &.c {
    border-radius: 100%;
    background: radial-gradient(circle, var(--bg) 60%, transparent 60%);

    &:before,
    &:after {
      content: "";
      display: block;
      position: absolute;
      inset: 4px;
      border-radius: 100%;
      animation: border-angle-rotate 4s infinite linear;
      z-index: -1;
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0