zoukankan      html  css  js  c++  java
  • 霓虹灯效果

    模拟左右移动的霓虹灯效果

    <style>
            body{
                background:#e2e2e2;
                display: flex;
                justify-content: center;
                align-items: center;
                min-height: 100vh;
            }
            h1{
                font-size: 50px;
                letter-spacing: -3px;
                font-family: Arial, Helvetica, sans-serif;
                position: relative;
            }
            h1::after{
                content: attr(data-spot);
                color: transparent;//文字透明,该功能核心属性
                position: absolute;
                top: 0;
                left: 0;
                clip-path: ellipse(50px 50px at 0% 50%);//只显示裁剪区域内的内容,该功能核心属性
                animation: spotlight 5s infinite;
                background-image: linear-gradient(to right, red , yellow);
                background-clip: text;//背景色剪裁,该功能核心属性
                -webkit-background-clip: text;
    
            }
            @keyframes spotlight{//自定义动画
                0%{
                    clip-path: ellipse(50px 50px at 0% 50%);
                }
                50%{
                    clip-path: ellipse(50px 50px at 100% 50%);
                }
                100%{
                    clip-path: ellipse(50px 50px at 0% 50%);
                }
            }
        </style>
     <h1 data-spot="Yanhuanxinxing">
            Yanhuanxinxing
        </h1>

            

  • 相关阅读:
    GDUFE ACM-1020
    GDUFE ACM-1069(简单的巴什博弈)
    GDUFE ACM-1138
    GDUFE ACM-1009
    GDUFE ACM-1008
    GDUFE ACM-1005
    LCA 最近公共祖先
    51nod
    51nod
    51nod
  • 原文地址:https://www.cnblogs.com/ybhome/p/13644231.html
Copyright © 2011-2022 走看看