css之文字连续光影特效、动画、scss

文章目录


效果图


html

html 复制代码
<div>
	<span>C</span>
	<span>O</span>
	<span>L</span>
	<span>O</span>
	<span>R</span>
	<span>F</span>
	<span>U</span>
	<span>L</span>
</div>

scss

css 复制代码
body {
    background-color: #696969;
    text-align: center;
}

span {
    color: #faebd7;
    font-size: 68px;
    font-weight: 700;
    animation: spread 1s ease-in-out infinite alternate;
}

@keyframes spread {
    to {
        color: #ff0266;
        text-shadow: 20px 0 70px #ff0266;
    }
}

@for $i from 1 through 8 {
    span:nth-child(#{$i}) {
        animation-delay: ($i - 1) * 0.2s;
    }
}

css

css 复制代码
body {
  background-color: #696969;
  text-align: center;
}

span {
  color: #faebd7;
  font-size: 68px;
  font-weight: 700;
  animation: spread 1s ease-in-out infinite alternate;
}

@keyframes spread {
  to {
    color: #ff0266;
    text-shadow: 20px 0 70px #ff0266;
  }
}

span:nth-child(1) {
  animation-delay: 0s;
}

span:nth-child(2) {
  animation-delay: 0.2s;
}

span:nth-child(3) {
  animation-delay: 0.4s;
}

span:nth-child(4) {
  animation-delay: 0.6s;
}

span:nth-child(5) {
  animation-delay: 0.8s;
}

span:nth-child(6) {
  animation-delay: 1s;
}

span:nth-child(7) {
  animation-delay: 1.2s;
}

span:nth-child(8) {
  animation-delay: 1.4s;
}
相关推荐
_龙衣36 分钟前
将 swagger 接口导入 apifox 查看及调试
前端·javascript·css·vue.js·css3
进取星辰1 小时前
25、Tailwind:魔法速记术——React 19 样式新思路
前端·react.js·前端框架
x-cmd2 小时前
[250512] Node.js 24 发布:ClangCL 构建,升级 V8 引擎、集成 npm 11
前端·javascript·windows·npm·node.js
夏之小星星2 小时前
el-tree结合checkbox实现数据回显
前端·javascript·vue.js
crazyme_63 小时前
前端自学入门:HTML 基础详解与学习路线指引
前端·学习·html
撸猫7913 小时前
HttpSession 的运行原理
前端·后端·cookie·httpsession
亦世凡华、3 小时前
Rollup入门与进阶:为现代Web应用构建超小的打包文件
前端·经验分享·rollup·配置项目·前端分享
Bl_a_ck4 小时前
【React】Craco 简介
开发语言·前端·react.js·typescript·前端框架
为美好的生活献上中指4 小时前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
augenstern4165 小时前
webpack重构优化
前端·webpack·重构