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;
}
相关推荐
大蝴蝶博努奇a2 分钟前
使用ChatGPT 解决各类代码报错
前端
胡志辉9 分钟前
深入浅出 call、apply、bind
前端·javascript·后端
iccb101344 分钟前
5年,一个程序员是如何把私有化在线客服系统做到第一名的
前端·后端·github
假如让我当三天老蒯1 小时前
回归基本功:Map/Set 与 WeakMap/WeakSet 的区别
前端·面试
IT乐手1 小时前
48队都装不下你|国足第24次让全世界失望
前端
SoaringHeart2 小时前
Flutter最佳实践:IM聊天文字链接自动识别跳转
前端·flutter
掘金一周3 小时前
企业中要做智能体,最佳的方案是什么? | 沸点周刊 6.18
前端·人工智能·ai编程
Darling噜啦啦3 小时前
CSS 3D 变换与 Flex 布局实战:从零打造旋转立方体
前端·css
秃头网友小李3 小时前
前端难点:keep-alive 缓存什么?RouterView 的 key 为什么要带 scopeId?
前端·vue.js
鱼人3 小时前
CSS 变量:一个变量救你一百次复制粘贴
前端