百度云盘  传送门  密码:8oei

发光文字动画效果:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery+CSS3彩色霓虹灯发光文字动画特效</title> <script src="js/jquery.min.js"></script> <style>
body {
height: 100vh;
box-sizing: border-box;
background: #333;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow-y: hidden;
}
body p{
color: #555;
font-family: 'Quicksand', sans-serif;
font-weight: 900;
}
body p i{
transition: .5s;
}
.fa-codepen{
-webkit-animation: fade 3s infinite alternate;
-moz-animation: fade 3s infinite alternate;
-o-animation: fade 3s infinite alternate;
animation: fade 3s infinite alternate;
}
a{
color: #ddd;
}
span {
font-size: 6em;
font-family: "Quicksand", sans-serif;
font-weight: 500;
color: #ddd;
transition: .25s;
}
.pink {
position: absolute;
text-shadow:
2px 2px 1px rgba(0,0,0,.4),
0 0 20px #fe3a80,
0 0 40px rgba(255, 0, 91, .75),
0 0 50px rgba(255, 0, 91, .75),
0 0 100px rgba(255, 0, 91, .75); }
.pink:before{
content:'';
position: absolute;
background: rgba(254, 58, 128, .25);
z-index: -1;
opacity: .7;
filter: blur(50px);
width: 100%;
height: 100%;
}
.green {
position: absolute;
text-shadow: 2px 2px 1px rgba(0,0,0,.4),
0 0 20px #69F0AE,
0 0 40px rgba(0, 230, 118, .75),
0 0 50px rgba(0, 230, 118, .75),
0 0 100px rgba(0, 230, 118, .75); }
.green:before{
content:'';
position: absolute;
background: rgba(105, 240, 174, .25);
z-index: -1;
opacity: .7;
filter: blur(30px);
width: 100%;
height: 100%;
}
.blue {
position: absolute;
text-shadow:
2px 2px 1px rgba(0,0,0,.4),
0 0 20px #42A5F5,
0 0 40px rgba(33, 150, 243, .75),
0 0 50px rgba(33, 150, 243, .75),
0 0 60px rgba(33, 150, 243, .75); }
.blue:before{
content:'';
position: absolute;
background: rgba(66, 165, 245, .25);
z-index: -1;
opacity: .7;
filter: blur(30px);
width: 100%;
height: 100%;
}
.buttons{
margin-bottom: auto;
margin-top: 20px;
}
button{
margin: 0 5px;
padding: 10px;
letter-spacing: 1px;
background: none;
border: 2px solid #444;
height: 2.25em;
border-radius: 2.25em;
color: #444;
font-size: 1.25em;
font-weight: bold;
text-transform: uppercase;
transition: .5s;
outline: none;
}
button:nth-child(1):hover{
/*Green*/
color: #00E676;
text-shadow: 0 0 7px #00E676;
border-color: #00E676;
box-shadow: 0 0 15px #00E676, inset 0 0 15px #00E676;
}
button:nth-child(2):hover{
/*Pink*/
color: #ff005b;
text-shadow: 0 0 7px #ff005b;
border-color: #ff005b;
box-shadow: 0 0 15px #ff005b, inset 0 0 15px #ff005b;
}
button:nth-child(3):hover{
/*Blue*/
color: #2196F3;
text-shadow: 0 0 7px #2196F3;
border-color: #2196F3;
box-shadow: 0 0 15px #2196F3, inset 0 0 15px #2196F3;
}
/*Animation*/
@-moz-keyframes fade {
40% {
opacity: 0.8;
}
42% {
opacity: 0.1;
}
43% {
opacity: 0.8;
}
45% {
opacity: 0.1;
}
46% {
opacity: 0.8;
}
}
@-webkit-keyframes fade {
40% {
opacity: 0.8;
}
42% {
opacity: 0.1;
}
43% {
opacity: 0.8;
}
45% {
opacity: 0.1;
}
46% {
opacity: 0.8;
}
}
@-o-keyframes fade {
40% {
opacity: 0.8;
}
42% {
opacity: 0.1;
}
43% {
opacity: 0.8;
}
45% {
opacity: 0.1;
}
46% {
opacity: 0.8;
}
}
@keyframes fade {
40% {
opacity: 0.8;
}
42% {
opacity: 0.1;
}
43% {
opacity: 0.8;
}
45% {
opacity: 0.1;
}
46% {
opacity: 0.8;
}
}
</style>
</head>
<body><script src="/demos/googlegg.js"></script> <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Quicksand"> <script src="js/typed.min.js"></script> <div class="buttons">
<button onClick="colorChange(colors[0][0],colors[0][1] )">Green</button>
<button onClick="colorChange(colors[2][0], colors[2][1])">Pink</button>
<button onClick="colorChange(colors[1][0], colors[1][1])">
Blue
</button>
</div>
<div id="typedStrings">
<p>Welcome!</p>
<p>Gary</p>
<p>欢迎O(∩_∩)O~</p>
</div>
<span id="span"></span> <script type="text/javascript">
$("#span").typed({
stringsElement: $("#typedStrings"),
typeSpeed: 70,
showCursor: false,
contentType: "html"
});
var colors = [["green","#00E676"], ["blue","#2196F3"], ["pink", "#ff005b"]];
var randomColor = colors[Math.floor(Math.random() * colors.length)];
var initialColor = randomColor[0];
var initialHeartColor = randomColor[1];
function colorChange(color, heart){
$('#span').attr('class', '').addClass(color);
$('body p i').css('color', initialHeartColor);
$('body p i').css('color', heart);
}
colorChange(initialColor);
</script> </div>
</body>
</html>

index.html

实现过程:

CSS样式

body {
height: 100vh;
box-sizing: border-box;
background: #333;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow-y: hidden;
}

justify-content:在弹性盒对象的 <div> 元素中的各项周围留有空白  传送门

overflow-y:属性规定是否对内容的上/下边缘进行裁剪

 参数hidden:裁剪内容 - 不提供滚动机制  传送门

animation:将动画与 div 元素绑定  传送门

text-shadow:向文本设置阴影  传送门

opacity:value  规定不透明度。从 0.0 (完全透明)到 1.0(完全不透明)  传送门

filter :定义了元素模糊与饱和度  传送门

三个按钮CSS样式

button:nth-child(1):hover{
/*Green*/
color: #00E676;
text-shadow: 0 0 7px #00E676;
border-color: #00E676;
box-shadow: 0 0 15px #00E676, inset 0 0 15px #00E676;
}
button:nth-child(2):hover{
/*Pink*/
color: #ff005b;
text-shadow: 0 0 7px #ff005b;
border-color: #ff005b;
box-shadow: 0 0 15px #ff005b, inset 0 0 15px #ff005b;
}
button:nth-child(3):hover{
/*Blue*/
color: #2196F3;
text-shadow: 0 0 7px #2196F3;
border-color: #2196F3;
box-shadow: 0 0 15px #2196F3, inset 0 0 15px #2196F3;
}

text-shadow:向文本设置阴影  传送门

border-color: 设置4 个边框的颜色  传送门

1个参数
border-color:red;
所有 4 个边框都是红色 2个参数
border-color:dotted red green;
上边框和下边框是红色
右边框和左边框是绿色 border-color:red green blue;
上边框是红色
右边框和左边框是绿色
下边框是蓝色 border-color:red green blue pink;
上边框是红色
右边框是绿色
下边框是蓝色
左边框是粉色

border-color参数属性值

box-shadow:设置一个或多个下拉阴影的框  传送门

opacity:设置 div 元素的不透明级别  传送门

(制作彩色霓虹灯发光文字动画关键!)

引入typed.js并添加自定义改变颜色函数colorChange(color, heart)

<script type="text/javascript">
$("#span").typed({
stringsElement: $("#typedStrings"),
typeSpeed: 70,
showCursor: false,
contentType: "html"
});
var colors = [["green","#00E676"], ["blue","#2196F3"], ["pink", "#ff005b"]];
var randomColor = colors[Math.floor(Math.random() * colors.length)];
var initialColor = randomColor[0];
var initialHeartColor = randomColor[1];
function colorChange(color, heart){
$('#span').attr('class', '').addClass(color);
$('body p i').css('color', initialHeartColor);
$('body p i').css('color', heart);
}
colorChange(initialColor);
</script>

将按钮绑定js事件

<div class="buttons">
<button onClick="colorChange(colors[0][0],colors[0][1] )">Green</button>
<button onClick="colorChange(colors[2][0], colors[2][1])">Pink</button>
<button onClick="colorChange(colors[1][0], colors[1][1])">Blue</button>
</div>

JS框架_(Typed.js)彩色霓虹灯发光文字动画的更多相关文章

  1. JS框架_(JQuery.js)绚丽的3D星空动画

    百度云盘: 传送门 密码:8ft8 绚丽的3D星空动画效果(纯CSS) (3D星空动画可以用作网页背景,Gary为文本文字) <!doctype html> <html lang=& ...

  2. JS框架_(Laydate.js)简单实现日期日历

    百度云盘 传送门 密码:71hf JavaScript日期与时间组件_____laydate.js 日期日历效果: <!DOCTYPE html> <html> <hea ...

  3. JS框架_(JQuery.js)圆形多选菜单选项

    百度云盘 传送门 密码:zb1c 圆形多选菜单选项效果: <!DOCTYPE html> <html lang="en" > <head> &l ...

  4. JS框架_(JQuery.js)网页文字评论弹幕

    百度云盘 传送门 密码:3azl jQuery网页右下角文字评论弹幕效果 <!DOCTYPE html> <html> <head> <title>jQ ...

  5. JS框架_(coolShow.js)图片旋转动画特效

    百度云盘 传送门 密码:ble6 coolShow.js插件图片旋转动画效果 <!DOCTYPE HTML> <head> <meta http-equiv=" ...

  6. JS框架_(JQuery.js)Tooltip弹出式按钮插件

    百度云盘 传送门 密码:7eh5 弹出式按钮效果 <!DOCTYPE html> <html > <head> <meta charset="UTF ...

  7. JS框架_(Popup.js)3D对话框窗口插件

    百度云盘 传送门 密码:afdo 3D对话框窗口插件效果: <!doctype html> <html lang="zh"> <head> &l ...

  8. JS框架_(JQuery.js)动画效果鼠标跟随

    百度云盘 传送门 密码 :4n9u 火狐浏览器上纯CSS_动画效果鼠标跟随效果: (作者:lily_lcj 传送门) <!DOCTYPE html PUBLIC "-//W3C//DT ...

  9. JS框架_(JQuery.js)夜晚天空满天星星闪烁动画

    百度云盘 传送门 密码:xftr 满天星星闪烁动画效果: (可用星空动画来作为页面背景,白色文字改为文章或者其他的O(∩_∩)O) <!doctype html> <html> ...

随机推荐

  1. [BZOJ 1563] [NOI 2009] 诗人小G(决策单调性)

    [BZOJ 1563] [NOI 2009] 诗人小G(决策单调性) 题面 一首诗包含了若干个句子,对于一些连续的短句,可以将它们用空格隔开并放在一行中,注意一行中可以放的句子数目是没有限制的.小 G ...

  2. idea 去除重复代码提醒

  3. Collection接口的子接口——Set接口

    https://docs.oracle.com/javase/8/docs/api/java/util/Set.html public interface Set<E>  extends ...

  4. webpack 四个核心概念

    webpack 是当下最热门的前端资源模块化和打包工具.它可以将许多松散的模块(如 CommonJs 模块. AMD 模块. ES6 模块.CSS.图片. JSON.Coffeescript. LES ...

  5. 转载:JavaWeb 文件上传下载

    转自:https://www.cnblogs.com/aaron911/p/7797877.html 1. 文件上传下载概述 1.1. 什么是文件上传下载 所谓文件上传下载就是将本地文件上传到服务器端 ...

  6. 渗透神器CobaltStrike 3.1.2 去后门破解版 & Windows版TeamServer【转】

    转自我八师傅博客 CS简介 Cobalt Strike(简称CS)是全球黑客公认一款非常优秀的渗透测试神器,以metasploit为基础的GUI的框架式渗透工具,集成了传统远控功能(远程桌面VNC.键 ...

  7. CRM项目讲解和django知识点回顾

    今天想把之前写的CRM项目梳理下,顺便回顾一下djiango的部分重要知识. 1.登录页面(包含简单验证码) 首先来看下CRM的登录页面,样式啥的不重要,大家可以去jquery ui的网站上或者其他地 ...

  8. POJ2449 K短路模板

    #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> ...

  9. CentOS下phpMyAdmin安装

    1.phpMyAdmin官网下载https://www.phpmyadmin.net/downloads/ 2.下载程序包 wget https://files.phpmyadmin.net/phpM ...

  10. VCL界面控件DevExpress VCL Controls v19.1.3全新来袭

    DevExpress VCL Controls是 Devexpress公司旗下最老牌的用户界面套包.所包含的控件有:数据录入,图表,数据分析,导航,布局,网格,日程管理,样式,打印和工作流等,让您快速 ...