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;
            //   }
            // }
相关推荐
风清云淡_A2 小时前
uniapp中检测应用更新的两种方式-升级中心之uni-upgrade-center-app
前端·uni-app
Citrus_732 小时前
css的选择器及优先级
前端·css
ZL_5672 小时前
uniapp中实现评分组件,多用于购买商品后,对商品进行评价等场景
前端·javascript·uni-app
剑亦未配妥3 小时前
前端vue相关常见面试题,包含MVVM、双向绑定原理、性能优化、vue2和vue3性能对比等
前端
想被带飞的鱼3 小时前
vue3中< keep-alive >页面实现缓存及遇到的问题
开发语言·前端·javascript·vue.js
小凡子空白在线学习4 小时前
8 非静态数据成员默认初始化
开发语言·前端·javascript
服装学院的IT男4 小时前
【Android 14源码分析】WMS-窗口显示-流程概览与应用端流程分析
android·前端
霸王蟹4 小时前
uniapp中uni.request的统一封装 (ts版)
前端·javascript·vue.js·笔记·uni-app
liuy52774 小时前
ceph rgw 桶分片之reshard
前端·ceph