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;
}
相关推荐
前端李易安1 小时前
Web常见的攻击方式及防御方法
前端
PythonFun2 小时前
Python技巧:如何避免数据输入类型错误
前端·python
hakesashou2 小时前
python交互式命令时如何清除
java·前端·python
天涯学馆2 小时前
Next.js与NextAuth:身份验证实践
前端·javascript·next.js
HEX9CF2 小时前
【CTF Web】Pikachu xss之href输出 Writeup(GET请求+反射型XSS+javascript:伪协议绕过)
开发语言·前端·javascript·安全·网络安全·ecmascript·xss
ConardLi2 小时前
Chrome:新的滚动捕捉事件助你实现更丝滑的动画效果!
前端·javascript·浏览器
ConardLi2 小时前
安全赋值运算符,新的 JavaScript 提案让你告别 trycatch !
前端·javascript
凌云行者2 小时前
使用rust写一个Web服务器——单线程版本
服务器·前端·rust
华农第一蒟蒻3 小时前
Java中JWT(JSON Web Token)的运用
java·前端·spring boot·json·token
积水成江3 小时前
关于Generator,async 和 await的介绍
前端·javascript·vue.js