网站logo css亮光扫过特效

在图片上出现白光条并划过,无限循环的模式

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>logo扫光效果</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <style>
        .logo {
            width: 200px;
            height: 70px;
            display: flex;
            line-height: 70px;
            position: relative;
            overflow: hidden;
        }

        .logo img {
            width: 100%;
            height: 70px;
        }

        /**根据logo外div样式名称修改before前名称**/
        .logo:before {
            content: "";
            position: absolute;
            left: -10px;
            /**第一个数字参数控制扫光速度,数字越大越慢**/
            top: -460px;
            width: 200px;
            height: 10px;
            /**光标的宽度,可根据实际调整**/
            background-color: rgba(255, 255, 255, .5);
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            transform: rotate(-45deg);
            -webkit-animation: searchLights 1s ease-in 1s infinite;
            -o-animation: searchLights 1s ease-in 1s infinite;
            animation: searchLights 1.5s ease-in 1s infinite;
            /**第一个数字参数控制扫光速度,数字越大越慢**/
        }

        @-webkit-keyframes searchLights {
            0% {
                left: -80px;
                top: 0;
            }

            to {
                left: 130px;
                top: 0px;
            }
        }

        @-o-keyframes searchLights {
            0% {
                left: -80px;
                top: 0;
            }

            to {
                left: 130px;
                top: 0px;
            }
        }

        @-moz-keyframes searchLights {
            0% {
                left: -80px;
                top: 0;
            }

            to {
                left: 130px;
                top: 0px;
            }
        }

        @keyframes searchLights {
            0% {
                left: -80px;
                top: 0;
            }

            to {
                left: 130px;
                top: 0px;
            }
        }
    </style>
</head>

<body>
    <div class="logo">
        <img src='https://t7.baidu.com/it/u=1699454570,2952675447&fm=190&app=131&size=f242,150&n=0&f=JPEG&fmt=auto?s=1BF6E816C8B47F800B7547C402007026&sec=1716224400&t=98a45f665487a7ddd2acbf73f5a79e72'>
    </div>
</body>

</html>

 

作者:Carver-大脸猫

出处:https://www.cnblogs.com/carver/articles/18200200

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

转载请注明原处

posted @   Carver-大脸猫  阅读(14)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up light_mode palette
选择主题