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;
}
相关推荐
老虎06274 分钟前
JavaWeb前端02(JavaScript)
开发语言·前端·javascript
耀耀切克闹灬4 分钟前
WEB前端基础知识梳理(四)
前端
anyup15 分钟前
🔥🔥 10 天 Star 破百!uView Pro 文档也开源啦:完全免费、无广告、高效上手
前端·vue.js·uni-app
Rasir20 分钟前
第七章:高级特性与项目优化
前端
春日野柚20 分钟前
前端打包优化分析
前端·webpack
yvvvy24 分钟前
DNS 解析全解析:从域名到 IP 的“桥梁”之旅
前端
柯南二号30 分钟前
【后端】SpringBoot中HttpServletRequest参数为啥不需要前端透传
前端·spring boot·后端
Dignity_呱38 分钟前
如何在不发版时,实现小程序的 AB 测试?
前端·面试·微信小程序
跟橙姐学代码1 小时前
学Python,先把这“三板斧”练到炉火纯青!(零基础也能看懂)
前端·python
Jimmy1 小时前
客户端存储 - IndexedDB
前端·javascript·indexeddb