找回密码
 立即注册
搜索
查看: 202|回复: 1

文字动态扫光 转自马黑教程

[复制链接]

1692

主题

3491

回帖

1万

积分

管理员

积分
14259
发表于 2026-10-28 13:52:59 | 显示全部楼层 |阅读模式

君不見高堂明鏡悲白髮

1692

主题

3491

回帖

1万

积分

管理员

积分
14259
 楼主| 发表于 2026-10-28 13:53:26 | 显示全部楼层
<style type="text/css">
.gg {
        font-family: '微软雅黑';
        font-weight: 900;
        font-size: 4rem;
        text-align: center;
        color: transparent;
        background-color: #e8a95b;
        background-clip: text;
        -webkit-background-clip: text;
        position: relative;
}
.gg::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(120deg, transparent 0%, transparent 6rem, white 11rem, transparent 11.15rem, transparent 15rem, rgba(255, 255, 255, 0.3) 20rem, transparent 25rem, transparent 27rem, rgba(255, 255, 255, 0.6) 32rem, white 33rem, rgba(255, 255, 255, 0.3) 33.15rem, transparent 38rem, transparent 40rem, rgba(255, 255, 255, 0.3) 45rem, transparent 50rem, transparent 100%);
    background-clip: text;
    -webkit-background-clip: text;
    background-size: 150% 100%;
    background-repeat: no-repeat;
    animation: shine 5s infinite linear;
}
@keyframes shine {
        0% { background-position: 50% 0; }
        100% { background-position: -190% 0; }
}
</style>


<div style="margin: auto; width: 700px; height: 200px; background: #000; line-height: 200px;">
        <p class="gg" data-text="君不見高堂明鏡悲白髮">君不見高堂明鏡悲白髮</p>
</div>

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

协同嘉业科技有限公司 ( 京ICP备2024053108号-1 )

GMT+8, 2026-11-29 12:15 , Processed in 0.080347 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表