css动态边框

参考:

Clip-path实现按钮流动边框动画_在线clip-path-CSDN博客

https://www.5axxw.com/questions/simple/9ju5yt#google_vignette

html 复制代码
              <div class="bottom-top-item-centent bottom-top-item-left">
                <vue-seamless-scroll :data="listLeftData" :class-option="defaultLeftOption">
                  <ul class="ul-scoll">
                    <li v-for="(item, index) in listLeftData" :key='index'>
                      <span class="title">{{ item.title }}</span>
                      <span class="date">{{ item.time }}</span>
                    </li>
                  </ul>
                </vue-seamless-scroll>
              </div>
css 复制代码
            .bottom-top-item-left {
              width: 94%;
              height: 130px;
              overflow: hidden;
              border: 1px solid #283dff;
              // animation: border-flow 2s linear infinite;
              position: relative;
              transition: all .5s;


              .ul-scoll {
                padding: 10px;
                margin: 0 auto;
                border: 2px solid transparent;


                /* 背景不重复 */
                li {
                  list-style: none;
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                  margin: 4px;
                  padding: 2px;
                  color: #fff;
                  font-size: 14px;
                  // background: rgba(198, 142, 226, 0.2);
                }

                &:last-child {
                  padding: 0;

                  li {
                    &:last-child {
                      // padding: 0 2px;
                      padding-bottom: 0;
                      margin: 0 4px;
                    }

                    &:first-child {
                      margin-top: 0;
                    }
                  }
                }
              }

              &::after,
              &::before {
                content: "";
                position: absolute;
                border: 2px solid rgb(216, 125, 13);
                width: 99%;
                height: 126px;
                // border-radius: 10px;
                /* 简写为 */
                inset: 0px;
                /* 添加动画 */
                animation: pathRotate 3s infinite linear;
              }

              &::before {
                // border-color: rgb(250, 255, 192);
                border-color: #0efcff;
              }

              @keyframes pathRotate {

                0%,
                100% {
                  clip-path: inset(0 0 98% 0);
                  // border-image: linear-gradient(to right, #f0c3e3 0%, #8ec5fc 100%);
                  // border-image-slice: 1;
                }

                25% {
                  clip-path: inset(0 98% 0 0);
                  // border-image: linear-gradient(to right, #8ec5fc 0%, #f0c3e3 100%);
                  // border-image-slice: 1;
                }

                50% {
                  clip-path: inset(98% 0 0 0);
                }

                75% {
                  clip-path: inset(0 0 0 98%);
                }
              }

              &::after {
                animation-delay: -1.5s;
              }

              &:hover {
                filter: brightness(1.5);
              }

            }

            // @keyframes border-flow {
            //   0% {
            //     border-left-color: #000;
            //     border-top-color: #afc;
            //   }

            //   25% {
            //     border-top-color: transparent;
            //     border-right-color: #afc; //#bcf;
            //   }

            //   50% {
            //     border-right-color: transparent;
            //     border-bottom-color: #afc; // pink;
            //   }

            //   75% {
            //     border-bottom-color: transparent;
            //     border-left-color: #afc; // #dcf;
            //   }

            //   100% {
            //     border-left-color: transparent;
            //     border-top-color: #afc; // hotpink;
            //   }
            // }
相关推荐
Smile_Gently2 小时前
前端:最简单封装nmp插件(组件)过程。
前端·javascript·vue.js·elementui·vue
luckycoke8 小时前
小程序立体轮播
前端·css·小程序
一 乐8 小时前
高校体育场管理系统系统|体育场管理系统小程序设计与实现(源码+数据库+文档)
前端·javascript·数据库·spring boot·高校体育馆系统
懒羊羊我小弟8 小时前
常用Webpack Loader汇总介绍
前端·webpack·node.js
祈澈菇凉9 小时前
ES6模块的异步加载是如何实现的?
前端·javascript·es6
我爱学习_zwj9 小时前
4.从零开始学会Vue--{{组件通信}}
前端·javascript·vue.js·笔记·前端框架
顾比魁9 小时前
XSS盲打:当攻击者“盲狙”管理员
前端·网络安全·xss
黑客老李9 小时前
新手小白如何挖掘cnvd通用漏洞之存储xss漏洞(利用xss钓鱼)
java·运维·服务器·前端·xss
晚风予星9 小时前
简记|LogicFlow自定义BPMN元素节点
前端
Json____10 小时前
使用html css js 开发一个 教育机构前端静态网站模板
前端·css·html·js·前端学习·企业站·教育机构网站