源码下载地址

下载到本地文件,浏览器打开HTML文件即可看到效果

html5散开变大雪花动画特效(渐变)


HTML源码

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>html5散开变大雪花动画特效</title><script type="text/javascript" src="js/jquery.min.js"></script><style>
html,body {width: 100%;height: 100%;margin: 0;padding: 0;overflow: hidden;
}
.container{width: 100%;height: 100%;margin: 0;padding: 0;
}</style>
</head>
<body><div id="jsi-snow-container" class="container"></div><script>
var RENDERER = {SNOW_COUNT: {INIT : 100, DELTA : 1},BACKGROUND_COLOR : 'hsl(%h, 50%, %l%)', INIT_HUE : 180,DELTA_HUE : 0.1,init : function(){this.setParameters();this.reconstructMethod();this.createSnow(this.SNOW_COUNT.INIT * this.countRate, true);this.render();},setParameters : function(){this.$window = $(window);this.$container = $('#jsi-snow-container');this.width = this.$container.width();this.height = this.$container.height();this.center = {x : this.width / 2, y : this.height / 2};this.countRate =  this.width * this.height / 500 / 500;this.canvas = $('<canvas />').attr({width : this.width, height : this.height}).appendTo(this.$container).get(0);this.context = this.canvas.getContext('2d');this.radius = Math.sqrt(this.center.x * this.center.x + this.center.y * this.center.y);this.hue = this.INIT_HUE;this.snows = [];},reconstructMethod : function(){this.render = this.render.bind(this);},createSnow : function(count, toRandomize){for(var i = 0; i < count; i++){this.snows.push(new SNOW(this.width, this.height, this.center, toRandomize));}},render : function(){requestAnimationFrame(this.render);var gradient = this.context.createRadialGradient(this.center.x, this.center.y, 0, this.center.x, this.center.y, this.radius),backgroundColor = this.BACKGROUND_COLOR.replace('%h', this.hue);gradient.addColorStop(0, backgroundColor.replace('%l', 30));gradient.addColorStop(0.2, backgroundColor.replace('%l', 20));gradient.addColorStop(1, backgroundColor.replace('%l', 5));this.context.fillStyle = gradient;this.context.fillRect(0, 0, this.width, this.height);for(var i = this.snows.length - 1; i >= 0; i--){if(!this.snows[i].render(this.context)){this.snows.splice(i, 1);}}this.hue += this.DELTA_HUE;this.hue %= 360;this.createSnow(this.SNOW_COUNT.DELTA, false);}
};
var SNOW = function(width, height, center, toRandomize){this.width = width;this.height = height;this.center = center;this.init(toRandomize);
};
SNOW.prototype = {RADIUS : 20,OFFSET : 4,INIT_POSITION_MARGIN : 20,COLOR : 'rgba(255, 255, 255, 0.8)',TOP_RADIUS : {MIN : 1, MAX : 3},SCALE : {INIT : 0.04, DELTA : 0.01},DELTA_ROTATE : {MIN : -Math.PI / 180 / 2, MAX : Math.PI / 180 / 2},THRESHOLD_TRANSPARENCY : 0.7,VELOCITY : {MIN : -1, MAX : 1},LINE_WIDTH : 2,BLUR : 10,init : function(toRandomize){this.setParameters(toRandomize);this.createSnow();},setParameters : function(toRandomize){if(!this.canvas){this.radius = this.RADIUS + this.TOP_RADIUS.MAX * 2 + this.LINE_WIDTH;this.length = this.radius * 2;this.canvas = $('<canvas />').attr({width : this.length, height : this.length}).get(0);this.context = this.canvas.getContext('2d');}this.topRadius = this.getRandomValue(this.TOP_RADIUS);var theta = Math.PI * 2 * Math.random();this.x = this.center.x + this.INIT_POSITION_MARGIN * Math.cos(theta);this.y = this.center.y + this.INIT_POSITION_MARGIN * Math.sin(theta);this.vx = this.getRandomValue(this.VELOCITY);this.vy = this.getRandomValue(this.VELOCITY);this.deltaRotate = this.getRandomValue(this.DELTA_ROTATE);this.scale = this.SCALE.INIT;this.deltaScale = 1 + this.SCALE.DELTA * 500 / Math.max(this.width, this.height);this.rotate = 0;if(toRandomize){for(var i = 0, count = Math.random() * 1000; i < count; i++){this.x += this.vx;this.y += this.vy;this.scale *= this.deltaScale;this.rotate += this.deltaRotate;}}},getRandomValue : function(range){return range.MIN + (range.MAX - range.MIN) * Math.random();},createSnow : function(){this.context.clearRect(0, 0, this.length, this.length);this.context.save();this.context.beginPath();this.context.translate(this.radius, this.radius);this.context.strokeStyle = this.COLOR;this.context.lineWidth = this.LINE_WIDTH;this.context.shadowColor = this.COLOR;this.context.shadowBlur = this.BLUR;var angle60 = Math.PI / 180 * 60,sin60 = Math.sin(angle60),cos60 = Math.cos(angle60),threshold = Math.random() * this.RADIUS / this.OFFSET | 0,rate = 0.5 + Math.random() * 0.5,offsetY = this.OFFSET * Math.random() * 2,offsetCount = this.RADIUS / this.OFFSET;for(var i = 0; i < 6; i++){this.context.save();this.context.rotate(angle60 * i);for(var j = 0; j <= threshold; j++){var y = -this.OFFSET * j;this.context.moveTo(0, y);this.context.lineTo(y * sin60, y * cos60);}for(var j = threshold; j < offsetCount; j++){var y = -this.OFFSET * j,x = j * (offsetCount - j + 1) * rate;this.context.moveTo(x, y - offsetY);this.context.lineTo(0, y);this.context.lineTo(-x, y - offsetY);}this.context.moveTo(0, 0);this.context.lineTo(0, -this.RADIUS);this.context.arc(0, -this.RADIUS - this.topRadius, this.topRadius, Math.PI / 2, Math.PI * 2.5, false);this.context.restore();}this.context.stroke();this.context.restore();},render : function(context){context.save();if(this.scale > this.THRESHOLD_TRANSPARENCY){context.globalAlpha = Math.max(0, (1 - this.scale) / (1 - this.THRESHOLD_TRANSPARENCY));if(this.scale > 1 || this.x < -this.radius || this.x > this.width + this.radius || this.y < -this.radius || this.y > this.height + this.radius){context.restore();return false;}}context.translate(this.x, this.y);context.rotate(this.rotate);context.scale(this.scale, this.scale);context.drawImage(this.canvas, -this.radius, -this.radius);context.restore();this.x += this.vx;this.y += this.vy;this.scale *= this.deltaScale;this.rotate += this.deltaRotate;return true;}
};$(function(){RENDERER.init();
});</script>
</body>
</html>

源码下载地址

HTML5 3D逼真冬天雪景雪花飘洒特效

效果

源码
源码下载地址

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5 3D逼真冬天雪景雪花飘洒特效 </title><style type="text/css">
body {background:url(images/bg.jpg) no-repeat top center;margin:0 auto;
}
a {color:#0078ff;
}
</style></head>
<body onLoad="init()">
<script type="text/javascript" src="js/ThreeCanvas.js"></script>
<script type="text/javascript" src="js/Snow.js"></script>
</body>
</html>

html5 3D雪花斜着下飘落场景特效


源码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,hight=device-hight,minimum-scale=1.0,maximum-scale=1.0,ser-scalable=none"/>
<title>html5 3D雪花斜着下飘落场景特效</title>
<style type="text/css">
body {background: url(images/xh.jpg) center no-repeat; width: 100%; height: 100%; background-size: 100% 100%; }
</style>
</head>
<body id="body" onLoad="init()">
<script type="text/javascript" src="js/ThreeCanvas.js"></script>
<script type="text/javascript" src="js/Snow.js"></script>
</body>
</html>

雪花代码3——平安夜/圣诞节雪花飘


源码

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>平安夜/圣诞节雪花飘</title><script type="text/javascript" src="jquery-1.8.2.min.js"></script><script src="jq.snow.js"></script><!--下面是调用方法和参数说明--><script>$(function(){$.fn.snow({ minSize: 5,        //雪花的最小尺寸maxSize: 40,   //雪花的最大尺寸newOn: 100     //雪花出现的频率 这个数值越小雪花越多});});</script>
</head>
<body style="background:#3B3B3B url(bg1.jpg) no-repeat center; height:750px;overflow-x:hidden;">
</body>
</html>

html5页面飘落蒲公英动画特效

<!DOCTYPE>
<html>
<head><title>html5页面飘落蒲公英动画特效</title><style type="text/css">body.custom-background {background-image:url('1431335355535.jpg');background-size:100% 100%;background-repeat:no-repeat;background-position:top left;background-attachment:fixed;}</style><script type="text/javascript" src="jquery.min.js"></script>
</head><body class="custom-background"><div class="snow-container" style="position:fixed;
        top:0;
        left:0;
        width:100%;
        height:100%;
        pointer-events:none;
        z-index:100001;"></div><script type="text/javascript" src="all.js"></script></body>
</html>

源码下载地址

源码下载地址

网页设计-动态雪花背景源码相关推荐

  1. 易购数码类电商商城网页设计与实现项目源码

    前些天发现了一个巨牛的人工智能学习电子书,通俗易懂,风趣幽默,无广告,忍不住分享一下给大家.(点击跳转人工智能学习资料) 微信公众号:创享日记 发送:易购网站 获取完整报告论文+源码等 一.系统流程设 ...

  2. 网页设计期末作业ppt+源码(免费获取)

    PPT展示: 源码如下: <!doctype html> <html> <head> <meta charset="utf-8"> ...

  3. 公司产品移动端网页-前端网页设计技术精美网站源码HTML+CSS+JS

    微信公众号:创享日记 发送:产品网页 获取完整源码(打开即可用) 效果①主页首页 /*========================================================= ...

  4. html网页制作期末大作业成品_网页设计期末作业-简洁源码-我的学校

    Web前端开发技术 描述 网页设计题材,DIV+CSS 布局制作,HTML+CSS网页设计期末课程大作业,校园班级网页设计 | 我的班级网页 | 我的学校 | 校园社团 | 校园运动会 | 等网站的设 ...

  5. 基于HTML+JavaScript+CSS计算机实验室预约管理系统网页设计 文档+html源码

    资源下载地址:https://download.csdn.net/download/sheziqiong/85738352 资源下载地址:https://download.csdn.net/downl ...

  6. 游戏交流社区BBS论坛APP客户端和网页服务端设计 毕业论文+前后端源码及数据库文件

    下载地址:https://download.csdn.net/download/m0_63680064/36065411 项目介绍: 游戏交流社区BBS论坛APP客户端和网页服务端设计 毕业论文+前后 ...

  7. HTML5期末大作业:花店购物网站设计——花店购物网站源码(27页) 学生动花店购物页设计模板下载 植物大学生HTML网页制作作品 简单网页设计成品 dreamweaver学生网站模板

    HTML5期末大作业:花店购物网站设计--花店购物网站源码(27页) 学生动花店购物页设计模板下载 植物大学生HTML网页制作作品 简单网页设计成品 dreamweaver学生网站模板 常见网页设计作 ...

  8. java毕业设计基于的校园头条新闻管理系统的设计与实现mybatis+源码+调试部署+系统+数据库+lw

    java毕业设计基于的校园头条新闻管理系统的设计与实现mybatis+源码+调试部署+系统+数据库+lw java毕业设计基于的校园头条新闻管理系统的设计与实现mybatis+源码+调试部署+系统+数 ...

  9. java毕业生设计高校共享机房管理系统的设计与实现计算机源码+系统+mysql+调试部署+lw

    java毕业生设计高校共享机房管理系统的设计与实现计算机源码+系统+mysql+调试部署+lw java毕业生设计高校共享机房管理系统的设计与实现计算机源码+系统+mysql+调试部署+lw 本源码技 ...

  10. web前端期末大作业:文化网站设计——中国风文化html源码(6个页面) HTML+CSS+JavaScript...

    web前端期末大作业:文化网站设计--中国风文化html源码(6个页面) HTML+CSS+JavaScript 期末作业HTML代码 临近期末, 你还在为HTML网页设计结课作业,老师的作业要求感到 ...

最新文章

  1. java response.write_response设置编码方式 print和write方法的对比
  2. AI技术必备资源汇总
  3. 汇编 Irvine32链接库中一些过程函数的使用说明
  4. oracle分区list,Oracle 分区表中存在range-list表分区时遇到问题及解决办法
  5. 【学习笔记】《数据挖掘:理论与算法》CH5 支持向量机
  6. boost::locale::calendar用法的测试程序
  7. C++string容器-赋值操作
  8. 陪我长大的村,镇,学校和家乡
  9. Redis(二):Redis入门与性能测试
  10. Python字典(Dictionary)的setdefault()方法的详解,字典中的赋值技巧
  11. Java描述设计模式(02):简单工厂模式
  12. transform的q、k、v的计算过程
  13. C# 利用反射动态将字符串转换成属性对应的类型值
  14. 我的渣渣java实训
  15. 开发者须知:关于 Android L 的一切
  16. FTP初始化文件.netrc使用技巧[转发]
  17. 翻译:group_concat()函数(已提交到MariaDB官方手册)
  18. Pandas学习笔记- DataFrame
  19. ad18添加许可证无反应怎么回事
  20. Nginx的软件架构

热门文章

  1. Beyong Compare3,4使用
  2. 深澜系统服务器架构,S7510E-X结合深澜服务器做Portal无感知认证终端不定时掉线经验案例...
  3. 王者战力查询教程,每天可查,数据准确~
  4. c++勾股定理解直三角形边长
  5. HMM隐马尔科夫模型
  6. MySql自动同步主库数据(Canal)
  7. 微信上传图片接口,下载接口到本地
  8. python编码器用什么_用于ceasar-ciph的python构建编码器
  9. 你真的了解SEO搜索引擎优化吗?
  10. Android studio中如何调用setpositivebutton函数