• #CSS动画-spotlight动态追光灯效果#聚光灯效果


    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    
    <style>
        html {
            font-size: 15px;
        }
        
        body {
            background-color: #222;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        
        h1 {
            color: #333;
            font-family: Arial, Helvetica, sans-serif;
            margin: 0;
            padding: 0;
            font-size: 4rem;
            letter-spacing: -.3rem;
            position: relative;
        }
        
        h1::after {
            content: attr(data-spotlight);
            color: transparent;
            position: absolute;
            top: 0;
            left: 0;
            clip-path: ellipse(50px 50px at 20% 50%);
            -webkit-clip-path: ellipse(50px 50px at 20% 50%);
            /* 定义遮罩 */
            animation: SpotLight 5s infinite;
            background-image: url(https://images.unsplash.com/photo-1545494097-1545e22ee878?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80);
            background-size: 150%;
            background-position: center center;
            background-clip: text;
            -webkit-background-clip: text;
        }
        
        @keyframes SpotLight {
            0% {
                clip-path: ellipse(50px 50px at 10% 50%);
                -webkit-clip-path: ellipse(50px 50px at 10% 50%)
            }
            50% {
                clip-path: ellipse(50px 50px at 90% 50%);
                -webkit-clip-path: ellipse(50px 50px at 90% 50%)
            }
            100% {
                clip-path: ellipse(50px 50px at 10% 50%);
                -webkit-clip-path: ellipse(50px 50px at 10% 50%)
            }
        }
    </style>
    
    <body>
        <h1 data-spotlight="Jaycethanks!">Jaycethanks</h1>
    </body>
    
    
    </html>
    
  • 相关阅读:
    mysql ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)
    mysql修改root密码和设置权限
    Navicat Premium 12破解版激活
    获取/设置光标位置
    Go开发工程师
    npm包大全
    war3辅助代码及运行方式
    6.页面绘制-帖子列表页和前端路由
    5.页面绘制-主题列表页(使用ColorUI、uni-app官方组件)
    4.页面绘制-脚本页面和个人中心页面
  • 原文地址:https://www.cnblogs.com/jaycethanks/p/13388905.html
Copyright © 2020-2023  润新知