更新第34个小实例

This commit is contained in:
DESKTOP-BM6RJU5\wyanh 2021-11-06 17:31:28 +08:00
parent 3f811b6bbc
commit 58f1c2cdcb
3 changed files with 112 additions and 1 deletions

View File

@ -37,4 +37,5 @@
30. HTML5+CSS3小实例之边框滑动按钮的悬停效果
31. HTML5+CSS3小实例之雷达扫描特效
32. HTML5+CSS3小实例之毛玻璃炫光按钮
33. HTML5+CSS3小实例之手机充电特效
33. HTML5+CSS3小实例之手机充电特效
34. HTML5+CSS3小实例之超酷的字体发光效果

83
css/34.css Normal file
View File

@ -0,0 +1,83 @@
*{
/* 初始化 取消页面元素的内外边距 */
margin: 0;
padding: 0;
}
.container{
/* 100%窗口高度 */
height: 100vh;
/* 弹性布局 水平、垂直居中 */
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
}
span{
font-size: 100px;
font-weight: bold;
color: #111;
/* 大写 */
text-transform: uppercase;
/* 字间距 */
letter-spacing: 5px;
/* 模糊滤镜 */
filter: blur(2px);
/* 执行动画:动画名称 时长 线性的 无限次播放 */
animation: animate 2.5s linear infinite;
}
/* 接下来为每一个span元素设置动画延迟时间 */
span:nth-child(1){
animation-delay: 0s;
}
span:nth-child(2){
animation-delay: 0.25s;
}
span:nth-child(3){
animation-delay: 0.5s;
}
span:nth-child(4){
animation-delay: 0.75s;
}
span:nth-child(5){
animation-delay: 1s;
}
span:nth-child(6){
animation-delay: 1.25s;
}
span:nth-child(7){
animation-delay: 1.5s;
}
span:nth-child(8){
animation-delay: 1.75s;
}
span:nth-child(9){
animation-delay: 2s;
}
span:nth-child(10){
animation-delay: 2.25s;
}
/* 定义动画 */
@keyframes animate {
0%,100%{
color: #fff;
/* 模糊滤镜 */
filter: blur(2px);
/* 文字阴影 */
text-shadow:
0 0 10px #32ff7e,
0 0 20px #32ff7e,
0 0 30px #32ff7e,
0 0 40px #32ff7e,
0 0 100px #32ff7e,
0 0 200px #32ff7e,
0 0 300px #32ff7e,
0 0 400px #32ff7e
;
}
5%,95%{
color: #111;
filter: blur(0px);
text-shadow: none;
}
}

27
html/34.html Normal file
View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>超酷的字体发光效果</title>
<link rel="stylesheet" href="../css/34.css">
</head>
<body>
<div class="container">
<span>h</span>
<span>e</span>
<span>l</span>
<span>l</span>
<span>o</span>
<span>w</span>
<span>o</span>
<span>r</span>
<span>l</span>
<span>d</span>
</div>
</body>
</html>