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;
}
相关推荐
拖拉斯旋风18 分钟前
防抖(Debounce)实战解析:如何用闭包优化频繁 AJAX 请求,提升用户体验
前端
老前端的功夫26 分钟前
TypeScript 全局类型声明:declare关键字的深度解析与实战
linux·前端·javascript·ubuntu·typescript·前端框架
golang学习记29 分钟前
VS Code 1.107 发布:AI 不再是插件,而是编辑器的「第一大脑」
前端
EndingCoder40 分钟前
TypeScript 入门:理解其本质与价值
前端·javascript·ubuntu·typescript·node.js
1024小神40 分钟前
cloudflare使用express实现api防止跨域cors
前端
we1less1 小时前
[audio] AudioTrack (七) 播放流程分析
前端
Johnnyhaha1 小时前
Docker Compose Pull 超时与代理踩坑记录
前端
烟袅1 小时前
React 表单的控制欲:什么时候我们真得控制它了,什么时候该放养了?
前端·react.js
不想秃头的程序员1 小时前
吃透 JS 事件委托:从原理到实战,解锁高性能事件处理方案
前端·面试
AntoineGriezmann1 小时前
前端 Token 刷新机制实战:基于 Axios 的 accessToken 自动续期方案
前端