2024龙年除夕跨年烟花html代码大全

maolai web前端评论4481阅读模式

2024跨年烟花代码html编程特效大全【过年放烟花特效代码+带音效】,除夕最炫烟花代码(html+js编程+带音效),跨年烟花代码带烟花特效和声音,2024跨年代码(烟花+自定义文字+背景音乐+雪花+倒计时)

2024龙年除夕跨年烟花秀(源码+浪漫烟花+美妙音乐+雪花飘飘+倒计时+双版本可选),复制下面代码新建一个文档保存为index.html即可预览

祝大家在2024新的一年里:身体健康平安,生活充实饱满,事业步步高升,心情阳光灿烂,财运滚滚而来,家庭美满幸福,新年开心快乐!

跨年烟花页面html代码汇总一、

<!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" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
	<style>
		body{margin:0;padding:0;overflow: hidden;}
		.city{width:100%;position:fixed;bottom:0px;z-index: 100;}
		.city img{width: 100%;}
	</style>
	<title>html5夜景放烟花绽放动画效果 - bokequ.com</title>
</head>
<body onselectstart = "return false">
    <!--背景音乐<audio src="http://www.bokequ.com/show/demo8/css/bokequ.mp3" autoplay="autoplay" loop="loop" preload="auto" controls="controls" hidden id="audios" type="audio/mp3"></audio>-->
<div style="height:1678px;overflow:hidden;">
	<canvas id='cas' style="background-color:rgba(0,5,24,1);" width="1200" height="886">浏览器不支持canvas</canvas>
	<div class="city"><img src="http://www.bokequ.com/show/demo7/img/city.png" alt="城市" /></div>
	<img src="http://www.bokequ.com/show/demo7/img/moon.png" alt="月亮" id="moon" style="visibility: hidden;"/>
	<div style="display:none">
		<div class="shape">新年快乐</div>
		<div class="shape">合家幸福</div>
        <div class="shape">万事如意</div>
        <div class="shape">心想事成</div>
        <div class="shape">财源广进</div>
	</div>
</div>
	<script>
		var canvas = document.getElementById("cas");
		var ocas = document.createElement("canvas");
		var octx = ocas.getContext("2d");
		var ctx = canvas.getContext("2d");
		ocas.width = canvas.width = window.innerWidth;
		ocas.height = canvas.height = 1678;
		var bigbooms = [];
		window.onload = function(){
			initAnimate()
		}

		function initAnimate(){
			drawBg();

			lastTime = new Date();
			animate();
		}
		var lastTime;
		function animate(){
			ctx.save();
			ctx.fillStyle = "rgba(0,5,24,0.1)";
			ctx.fillRect(0,0,canvas.width,canvas.height);
			ctx.restore();
			var newTime = new Date();
            if(newTime-lastTime>500+(window.innerHeight-767)/2){
				var random = Math.random()*100>2?true:false;
				var x = getRandom(canvas.width/5 , canvas.width*4/5);
				var y = getRandom(50 , 200);
				if(random){
					var bigboom = new Boom(getRandom(canvas.width/3,canvas.width*2/3) ,2,"#FFF" , {x:x , y:y});
					bigbooms.push(bigboom)
				}
				else {
					var bigboom = new Boom(getRandom(canvas.width/3,canvas.width*2/3) ,2,"#FFF" , {x:canvas.width/2 , y:200} , document.querySelectorAll(".shape")[parseInt(getRandom(0, document.querySelectorAll(".shape").length))]);
					bigbooms.push(bigboom)
				}
				lastTime = newTime;
				console.log(bigbooms)
			}

			stars.foreach(function(){
				this.paint();
			})

			drawMoon();

			bigbooms.foreach(function(index){
				var that = this;
				if(!this.dead){
					this._move();
					this._drawLight();
				}
				else{
					this.booms.foreach(function(index){
						if(!this.dead) {
							this.moveTo(index);
						}
						else if(index === that.booms.length-1){
							bigbooms[bigbooms.indexOf(that)] = null;
						}
					})
				}
			});
			
			raf(animate);
		}

		function drawMoon(){
			var moon = document.getElementById("moon");
			var centerX = canvas.width-200 , centerY = 100 , width = 80;
			if(moon.complete){
				ctx.drawImage(moon , centerX , centerY , width , width )
			}
			else {
				moon.onload = function(){
					ctx.drawImage(moon ,centerX , centerY , width , width)
				}
			}
			var index = 0;
			for(var i=0;i<10;i++){
				ctx.save();
				ctx.beginPath();
				ctx.arc(centerX+width/2 , centerY+width/2 , width/2+index , 0 , 2*Math.PI);
				ctx.fillStyle="rgba(240,219,120,0.005)";
				index+=2;
				ctx.fill();
				ctx.restore();
			}
			
		}

		Array.prototype.foreach = function(callback){
			for(var i=0;i<this.length;i++){
				if(this[i]!==null) callback.apply(this[i] , [i])
			}
		}

		var raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60); };
 		
		canvas.onclick = function(){
			var x = event.clientX;
			var y = event.clientY;
			var bigboom = new Boom(getRandom(canvas.width/3,canvas.width*2/3) ,2,"#FFF" , {x:x , y:y});
			bigbooms.push(bigboom)
		}

		// canvas.addEventLisener("touchstart" , function(event){
		// 	var touch = event.targetTouches[0];
		// 	var x = event.pageX;
		// 	var y = event.pageY;
		// 	var bigboom = new Boom(getRandom(canvas.width/3,canvas.width*2/3) ,2,"#FFF" , {x:x , y:y});
		// 	bigbooms.push(bigboom)
		// })

		var Boom = function(x,r,c,boomArea,shape){
			this.booms = [];
			this.x = x;
			this.y = (canvas.height+r);
			this.r = r;
			this.c = c;
			this.shape = shape || false;
			this.boomArea = boomArea;
			this.theta = 0;
			this.dead = false;
			this.ba = parseInt(getRandom(80 , 200));
		}
		Boom.prototype = {
			_paint:function(){
				ctx.save();
				ctx.beginPath();
				ctx.arc(this.x,this.y,this.r,0,2*Math.PI);
				ctx.fillStyle = this.c;
				ctx.fill();
				ctx.restore();
			},
			_move:function(){
				var dx = this.boomArea.x - this.x , dy = this.boomArea.y - this.y;
				this.x = this.x+dx*0.01;
				this.y = this.y+dy*0.01;

				if(Math.abs(dx)<=this.ba && Math.abs(dy)<=this.ba){
					if(this.shape){
						this._shapBoom();
					}
					else this._boom();
					this.dead = true;
				}
				else {
					this._paint();
				}
			},
			_drawLight:function(){
				ctx.save();
				ctx.fillStyle = "rgba(255,228,150,0.3)";
				ctx.beginPath();
				ctx.arc(this.x , this.y , this.r+3*Math.random()+1 , 0 , 2*Math.PI);
				ctx.fill();
				ctx.restore();
			},
			_boom:function(){
				var fragNum = getRandom(30 , 200);
				var style = getRandom(0,10)>=5? 1 : 2;
				var color;
				if(style===1){
					color = {
						a:parseInt(getRandom(128,255)),
						b:parseInt(getRandom(128,255)),
						c:parseInt(getRandom(128,255))
					}
				}

				var fanwei = parseInt(getRandom(300, 400));
				for(var i=0;i<fragNum;i++){
					if(style===2){
						color = {
							a:parseInt(getRandom(128,255)),
							b:parseInt(getRandom(128,255)),
							c:parseInt(getRandom(128,255))
						}
					}
					var a = getRandom(-Math.PI, Math.PI);
					var x = getRandom(0, fanwei) * Math.cos(a) + this.x;
					var y = getRandom(0, fanwei) * Math.sin(a) + this.y; 
					var radius = getRandom(0 , 2)
					var frag = new Frag(this.x , this.y , radius , color , x , y );
					this.booms.push(frag);
				}
			},
			_shapBoom:function(){
				var that = this;
				putValue(ocas , octx , this.shape , 5, function(dots){
					var dx = canvas.width/2-that.x;
					var dy = canvas.height/2-that.y;
					for(var i=0;i<dots.length;i++){
						color = {a:dots[i].a,b:dots[i].b,c:dots[i].c}
						var x = dots[i].x;
						var y = dots[i].y;
						var radius = 1;
						var frag = new Frag(that.x , that.y , radius , color , x-dx , y-dy);
						that.booms.push(frag);
					}
				})
			}
		}

		function putValue(canvas , context , ele , dr , callback){
			context.clearRect(0,0,canvas.width,canvas.height);
			var img = new Image();
			if(ele.innerHTML.indexOf("img")>=0){
				img.src = ele.getElementsByTagName("img")[0].src;
				imgload(img , function(){
					context.drawImage(img , canvas.width/2 - img.width/2 , canvas.height/2 - img.width/2);
					dots = getimgData(canvas , context , dr);
					callback(dots);
				})
			}
			else {
				var text = ele.innerHTML;
				context.save();
				var fontSize =200;
				context.font = fontSize+"px 宋体 bold";
				context.textAlign = "center";
				context.textBaseline = "middle";
				context.fillStyle = "rgba("+parseInt(getRandom(128,255))+","+parseInt(getRandom(128,255))+","+parseInt(getRandom(128,255))+" , 1)";
				context.fillText(text , canvas.width/2 , canvas.height/2);
				context.restore();
				dots = getimgData(canvas , context , dr);
				callback(dots);
			}
		}

		function imgload(img , callback){
			if(img.complete){
				callback.call(img);
			}
			else {
				img.onload = function(){
					callback.call(this);
				}
			}
		}

		function getimgData(canvas , context , dr){
			var imgData = context.getImageData(0,0,canvas.width , canvas.height);
			context.clearRect(0,0,canvas.width , canvas.height);
			var dots = [];
			for(var x=0;x<imgData.width;x+=dr){
				for(var y=0;y<imgData.height;y+=dr){
					var i = (y*imgData.width + x)*4;
					if(imgData.data[i+3] > 128){
						var dot = {x:x , y:y , a:imgData.data[i] , b:imgData.data[i+1] , c:imgData.data[i+2]};
						dots.push(dot);
					}
				}
			}
			return dots;
		}

		function getRandom(a , b){
			return Math.random()*(b-a)+a;
		}


		var maxRadius = 1 , stars=[];
		function drawBg(){
			for(var i=0;i<100;i++){
				var r = Math.random()*maxRadius;
				var x = Math.random()*canvas.width;
				var y = Math.random()*2*canvas.height - canvas.height;
				var star = new Star(x , y , r);
				stars.push(star);
				star.paint()
			}

		}

		var Star = function(x,y,r){
			this.x = x;this.y=y;this.r=r;
		}
		Star.prototype = {
			paint:function(){
				ctx.save();
				ctx.beginPath();
				ctx.arc(this.x , this.y , this.r , 0 , 2*Math.PI);
				ctx.fillStyle = "rgba(255,255,255,"+this.r+")";
				ctx.fill();
				ctx.restore();
			}
		}

		var focallength = 250;
		var Frag = function(centerX , centerY , radius , color ,tx , ty){
			this.tx = tx;
			this.ty = ty;
			this.x = centerX;
			this.y = centerY;
			this.dead = false;
			this.centerX = centerX;
			this.centerY = centerY;
			this.radius = radius;
			this.color = color;
		}

		Frag.prototype = {
			paint:function(){
				ctx.save();
				ctx.beginPath();
				ctx.arc(this.x , this.y , this.radius , 0 , 2*Math.PI);
				ctx.fillStyle = "rgba("+this.color.a+","+this.color.b+","+this.color.c+",1)";
				ctx.fill()
				ctx.restore();
			},
			moveTo:function(index){
				this.ty = this.ty+0.3;
				var dx = this.tx - this.x , dy = this.ty - this.y;
				this.x = Math.abs(dx)<0.1 ? this.tx : (this.x+dx*0.1);
				this.y = Math.abs(dy)<0.1 ? this.ty : (this.y+dy*0.1);
				if(dx===0 && Math.abs(dy)<=80){
					this.dead = true;
				}
				this.paint();
			}
		}
	</script>
</body>
</html>

效果演示页面一http://www.bokequ.com/show/demo7/
跨年烟花页面html代码汇总二、

<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>带你赏烟花 - bokequ.com</title>
		<style>
			html,body{height:100%;margin:0;padding:0}
			ul,li{text-indent:0;text-decoration:none;margin:0;padding:0}
			img{border:0}
			//body{background-color:#000;color:#999;font:100%/18px helvetica, arial, sans-serif}
			body{
				background-image:url('http://www.bokequ.com/show/demo8/css/bokequ.png');no-repeat:background-image;background-size:100% 100%;
				color:#999;font:100%/18px helvetica, arial, sans-serif}
			canvas{cursor:crosshair;display:block;left:0;position:absolute;top:0;z-index:20}
		</style>
	</head>
	<body>
		<!--autoplay loop controls hidden id="audios" type="audio/mp3-->
		<audio src="http://www.bokequ.com/show/demo8/css/bokequ.mp3" autoplay="autoplay"  loop="loop" preload="auto" controls="controls" hidden id="audios" type="audio/mp3"></audio>
		<script type="text/javascript" src="http://www.bokequ.com/show/demo8/css/script.js"></script>
		<script>
			<!--自动播放(手机)-->
			window.onload = function() {
    			var music = new Audio("music.mp3");
   			 music.play();
			};
			<!--单击自动播放(电脑)-->
			document.addEventListener('click', function() {
  			document.getElementById('audios').play();
			});
			<!--加载自动播放(电脑)-->
			document.addEventListener('touchstart', function() {
 			document.getElementById('audios').play();
			});
		</script>
		<script type="text/javascript">
			$(function(){
			var Fireworks = function(){
			var self = this;
			var rand = function(rMi, rMa){return ~~((Math.random()*(rMa-rMi+1))+rMi);}
			var hitTest = function(x1, y1, w1, h1, x2, y2, w2, h2){return !(x1 + w1 < x2 || x2 + w2 < x1 || y1 + h1 < y2 || y2 + h2 < y1);};
			window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();
 
			self.init = function(){ 
			self.canvas = document.createElement('canvas');             
			self.canvas.width = self.cw = $(window).innerWidth();
			self.canvas.height = self.ch = $(window).innerHeight();         
			self.particles = [];    
			self.partCount = 500;	//密集度
			self.fireworks = [];    
			self.mx = self.cw/2;
			self.my = self.ch/2;
			self.currentHue = 30;
			self.partSpeed = 3;		//大小
			self.partSpeedVariance = 15;	//爆炸范围
			self.partWind =10;		//线条形状
			self.partFriction = 10;	//烟花大小
			self.partGravity = 1;		//下坠
			self.hueMin = 0;
			self.hueMax = 500;		//颜色
			self.fworkSpeed = 2;	//速度
			self.fworkAccel = 5;		//导向显示
			self.hueVariance = 5;
			self.flickerDensity = 250;
			self.showShockwave = true;
			self.showTarget = false;
			self.clearAlpha = 70;	//消失的速度
 
			$(document.body).append(self.canvas);
			self.ctx = self.canvas.getContext('2d');
			self.ctx.lineCap = 'round';
			self.ctx.lineJoin = 'round';	
			self.lineWidth = 1;		//粗细
			self.bindEvents();          
			self.canvasLoop();
 
			self.canvas.onselectstart = function() {
			return false;
			};
			};      
 
			self.createParticles = function(x,y, hue){
			var countdown = self.partCount;
			while(countdown--){
			var newParticle = {
				x: x,
				y: y,
				coordLast: [
					{x: x, y: y},
					{x: x, y: y},
					{x: x, y: y}
				],
				angle: rand(0, 360),
				speed: rand(((self.partSpeed - self.partSpeedVariance) <= 0) ? 1 : self.partSpeed - self.partSpeedVariance, (self.partSpeed + self.partSpeedVariance)),
				friction: 1 - self.partFriction/100,
				gravity: self.partGravity/2,
				hue: rand(hue-self.hueVariance, hue+self.hueVariance),
				brightness: rand(50, 80),
				alpha: rand(40,100)/100,
				decay: rand(10, 50)/1000,
				wind: (rand(0, self.partWind) - (self.partWind/2))/25,
				lineWidth: self.lineWidth
			};              
			self.particles.push(newParticle);
			}
			};
 
 
			self.updateParticles = function(){
			var i = self.particles.length;
			while(i--){
			var p = self.particles[i];
			var radians = p.angle * Math.PI / 180;
			var vx = Math.cos(radians) * p.speed;
			var vy = Math.sin(radians) * p.speed;
			p.speed *= p.friction;
							
			p.coordLast[2].x = p.coordLast[1].x;
			p.coordLast[2].y = p.coordLast[1].y;
			p.coordLast[1].x = p.coordLast[0].x;
			p.coordLast[1].y = p.coordLast[0].y;
			p.coordLast[0].x = p.x;
			p.coordLast[0].y = p.y;
 
			p.x += vx;
			p.y += vy;
			p.y += p.gravity;
 
			p.angle += p.wind;              
			p.alpha -= p.decay;
 
			if(!hitTest(0,0,self.cw,self.ch,p.x-p.radius, p.y-p.radius, p.radius*2, p.radius*2) || p.alpha < .05){                  
				self.particles.splice(i, 1);    
			}
			};
			};
 
			self.drawParticles = function(){
			var i = self.particles.length;
			while(i--){
			var p = self.particles[i];                          
 
			var coordRand = (rand(1,3)-1);
			self.ctx.beginPath();                               
			self.ctx.moveTo(Math.round(p.coordLast[coordRand].x), Math.round(p.coordLast[coordRand].y));
			self.ctx.lineTo(Math.round(p.x), Math.round(p.y));
			self.ctx.closePath();               
			self.ctx.strokeStyle = 'hsla('+p.hue+', 100%, '+p.brightness+'%, '+p.alpha+')';
			self.ctx.stroke();              
 
			if(self.flickerDensity > 0){
				var inverseDensity = 50 - self.flickerDensity;                  
				if(rand(0, inverseDensity) === inverseDensity){
					self.ctx.beginPath();
					self.ctx.arc(Math.round(p.x), Math.round(p.y), rand(p.lineWidth,p.lineWidth+3)/2, 0, Math.PI*2, false)
					self.ctx.closePath();
					var randAlpha = rand(50,100)/100;
					self.ctx.fillStyle = 'hsla('+p.hue+', 100%, '+p.brightness+'%, '+randAlpha+')';
					self.ctx.fill();
				}   
			}
			};
			};
 
 
			self.createFireworks = function(startX, startY, targetX, targetY){
			var newFirework = {
			x: startX,
			y: startY,
			startX: startX,
			startY: startY,
			hitX: false,
			hitY: false,
			coordLast: [
				{x: startX, y: startY},
				{x: startX, y: startY},
				{x: startX, y: startY}
			],
			targetX: targetX,
			targetY: targetY,
			speed: self.fworkSpeed,
			angle: Math.atan2(targetY - startY, targetX - startX),
			shockwaveAngle: Math.atan2(targetY - startY, targetX - startX)+(90*(Math.PI/180)),
			acceleration: self.fworkAccel/100,
			hue: self.currentHue,
			brightness: rand(50, 80),
			alpha: rand(50,100)/100,
			lineWidth: self.lineWidth
			};          
			self.fireworks.push(newFirework);
 
			};
 
 
			self.updateFireworks = function(){
			var i = self.fireworks.length;
 
			while(i--){
			var f = self.fireworks[i];
			self.ctx.lineWidth = f.lineWidth;
 
			vx = Math.cos(f.angle) * f.speed,
			vy = Math.sin(f.angle) * f.speed;
			f.speed *= 1 + f.acceleration;              
			f.coordLast[2].x = f.coordLast[1].x;
			f.coordLast[2].y = f.coordLast[1].y;
			f.coordLast[1].x = f.coordLast[0].x;
			f.coordLast[1].y = f.coordLast[0].y;
			f.coordLast[0].x = f.x;
			f.coordLast[0].y = f.y;
 
			if(f.startX >= f.targetX){
				if(f.x + vx <= f.targetX){
					f.x = f.targetX;
					f.hitX = true;
				} else {
					f.x += vx;
				}
			} else {
				if(f.x + vx >= f.targetX){
					f.x = f.targetX;
					f.hitX = true;
				} else {
					f.x += vx;
				}
			}
 
			if(f.startY >= f.targetY){
				if(f.y + vy <= f.targetY){
					f.y = f.targetY;
					f.hitY = true;
				} else {
					f.y += vy;
				}
			} else {
				if(f.y + vy >= f.targetY){
					f.y = f.targetY;
					f.hitY = true;
				} else {
					f.y += vy;
				}
			}               
 
			if(f.hitX && f.hitY){
				self.createParticles(f.targetX, f.targetY, f.hue);
				self.fireworks.splice(i, 1);
				
			}
			};
			};
 
			self.drawFireworks = function(){
			var i = self.fireworks.length;
			self.ctx.globalCompositeOperation = 'lighter';
			while(i--){
			var f = self.fireworks[i];      
			self.ctx.lineWidth = f.lineWidth;
 
			var coordRand = (rand(1,3)-1);                  
			self.ctx.beginPath();                           
			self.ctx.moveTo(Math.round(f.coordLast[coordRand].x), Math.round(f.coordLast[coordRand].y));
			self.ctx.lineTo(Math.round(f.x), Math.round(f.y));
			self.ctx.closePath();
			self.ctx.strokeStyle = 'hsla('+f.hue+', 100%, '+f.brightness+'%, '+f.alpha+')';
			self.ctx.stroke();  
 
			if(self.showTarget){
				self.ctx.save();
				self.ctx.beginPath();
				self.ctx.arc(Math.round(f.targetX), Math.round(f.targetY), rand(1,8), 0, Math.PI*2, false)
				self.ctx.closePath();
				self.ctx.lineWidth = 1;
				self.ctx.stroke();
				self.ctx.restore();
			}
				
			if(self.showShockwave){
				self.ctx.save();
				self.ctx.translate(Math.round(f.x), Math.round(f.y));
				self.ctx.rotate(f.shockwaveAngle);
				self.ctx.beginPath();
				self.ctx.arc(0, 0, 1*(f.speed/5), 0, Math.PI, true);
				self.ctx.strokeStyle = 'hsla('+f.hue+', 100%, '+f.brightness+'%, '+rand(25, 60)/100+')';
				self.ctx.lineWidth = f.lineWidth;
				self.ctx.stroke();
				self.ctx.restore();
			}
			};
			};
 
			self.bindEvents = function(){
			$(window).on('resize', function(){          
			clearTimeout(self.timeout);
			self.timeout = setTimeout(function() {
				self.canvas.width = self.cw = $(window).innerWidth();
				self.canvas.height = self.ch = $(window).innerHeight();
				self.ctx.lineCap = 'round';
				self.ctx.lineJoin = 'round';
			},1);
			});
 
			window.onload=function(){
				 tttt()
			}
			var tttt = setInterval(function(){
				 var e={'pageX':Math.random()*1900,'pageY':Math.random()*900}
				self.mx = e.pageX - self.canvas.offsetLeft;
				self.my = e.pageY - self.canvas.offsetTop;
				self.currentHue = rand(self.hueMin, self.hueMax);
				self.createFireworks(self.cw/2, self.ch, self.mx, self.my); 
			},50)      
			}
 
			self.clear = function(){
			self.particles = [];
			self.fireworks = [];
			self.ctx.clearRect(0, 0, self.cw, self.ch);
			};
 
 
			self.canvasLoop = function(){
			requestAnimFrame(self.canvasLoop, self.canvas);         
			self.ctx.globalCompositeOperation = 'destination-out';
			self.ctx.fillStyle = 'rgba(0,0,0,'+self.clearAlpha/100+')';
			self.ctx.fillRect(0,0,self.cw,self.ch);
			self.updateFireworks();
			self.updateParticles();
			self.drawFireworks();           
			self.drawParticles();
 
			};
 
			self.init();        
 
			}
			var fworks = new Fireworks();
			});
		</script>
	</body>
</html>

烟花效果演示页面二地址http://www.bokequ.com/show/demo8/
跨年烟花页面html代码汇总三、

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>跨新年烟花代码(happy new year to you)- bokequ.com</title>
<link rel="stylesheet" href="http://www.bokequ.com/show/demo9/css/style.css">
</head>
<body oncontextmenu=self.event.returnValue=false onselectstart="return false">
    <noscript><iframe scr="*.htm"></iframe></noscript>
<canvas id="canvas" width="1536" height="711"></canvas>
<div class="block-audio">
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp1.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp1.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp1.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp2.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp2.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp2.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp3.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp3.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp3.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp4.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp4.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp4.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp5.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp5.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp5.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp6.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp6.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp6.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp7.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp7.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp7.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp8.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp8.mp3" controls="controls"></audio>
  <audio class="exp" src="http://www.bokequ.com/show/demo9/css/exp8.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ1.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ1.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ2.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ2.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ3.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ3.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ4.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ4.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ5.mp3" controls="controls"></audio>
  <audio class="launch" src="http://www.bokequ.com/show/demo9/css/bokequ5.mp3" controls="controls"></audio>
</div>
<script src="http://www.bokequ.com/show/demo9/js/jquery-1.js"></script>
<script src="http://www.bokequ.com/show/demo9/js/jquery.js"></script>
<script src="http://www.bokequ.com/show/demo9/js/index.js"></script>
</body>
</html>

烟花效果演示地址三http://www.bokequ.com/show/demo9/
跨年烟花页面html代码汇总四、

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Happy 2024新年快乐! - bokequ.com</title>
  </head>
  <body>
    <script src="js/gameCanvas-4.0.js"></script>
    <script src="js/script.js"></script>
    <!--live2d-->
    <script src="https://npm.elemecdn.com/live2d-widget@3.x/lib/L2Dwidget.min.js"></script>
    <!--live2dend-->
    <!--放大图片-->
    <link
      rel="stylesheet"
      type="text/css"
      href="https://blog-static.cnblogs.com/files/zouwangblog/zoom.css"
    />
    <script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.2.0/js/transition.js"></script>
    <script src="https://blog-static.cnblogs.com/files/zouwangblog/zoom.js"></script>
    <script type="text/javascript">
      $("#cnblogs_post_body img").attr("data-action", "zoom");
    </script>
    <!--放大图片end-->
    <!--鼠标特效-->
    <script src="js/mouse-click.js"></script>
    <canvas
      width="1777"
      height="841"
      style="
        position: fixed;
        left: 0px;
        top: 0px;
        z-index: 2147483647;
        pointer-events: none;
      "
    ></canvas>
    <!--鼠标特效 end-->
    <!-- 友链 -->
    <input id="linkListFlg" type="hidden" />
    <!-- require APlayer -->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"
    />
    <script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
    <!-- require MetingJS -->
    <script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
    <meting-js
      id="2829883282"
      lrc-type="0"
      server="netease"
      order="random"
      type="playlist"
      fixed="true"
      autoplay="false"
      list-olded="true"
    >
    </meting-js>
    <!-- // 随机线条 -->
    <script>
      !(function () {
        function n(n, e, t) {
          return n.getAttribute(e) || t;
        }
        function e(n) {
          return document.getElementsByTagName(n);
        }
        function t() {
          var t = e("script"),
            o = t.length,
            i = t[o - 1];
          return {
            l: o,
            z: n(i, "zIndex", -1),
            o: n(i, "opacity", 0.6),
            c: n(i, "color", "148,0,211"),
            n: n(i, "count", 99),
          };
        }
        function o() {
          (a = m.width =
            window.innerWidth ||
            document.documentElement.clientWidth ||
            document.body.clientWidth),
            (c = m.height =
              window.innerHeight ||
              document.documentElement.clientHeight ||
              document.body.clientHeight);
        }
        function i() {
          r.clearRect(0, 0, a, c);
          var n, e, t, o, m, l;
          s.forEach(function (i, x) {
            for (
              i.x += i.xa,
                i.y += i.ya,
                i.xa *= i.x > a || i.x < 0 ? -1 : 1,
                i.ya *= i.y > c || i.y < 0 ? -1 : 1,
                r.fillRect(i.x - 0.5, i.y - 0.5, 1, 1),
                e = x + 1;
              e < u.length;
              e++
            )
              (n = u[e]),
                null !== n.x &&
                  null !== n.y &&
                  ((o = i.x - n.x),
                  (m = i.y - n.y),
                  (l = o * o + m * m),
                  l < n.max &&
                    (n === y &&
                      l >= n.max / 2 &&
                      ((i.x -= 0.03 * o), (i.y -= 0.03 * m)),
                    (t = (n.max - l) / n.max),
                    r.beginPath(),
                    (r.lineWidth = t / 2),
                    (r.strokeStyle = "rgba(" + d.c + "," + (t + 0.2) + ")"),
                    r.moveTo(i.x, i.y),
                    r.lineTo(n.x, n.y),
                    r.stroke()));
          }),
            x(i);
        }
        var a,
          c,
          u,
          m = document.createElement("canvas"),
          d = t(),
          l = "c_n" + d.l,
          r = m.getContext("2d"),
          x =
            window.requestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.oRequestAnimationFrame ||
            window.msRequestAnimationFrame ||
            function (n) {
              window.setTimeout(n, 1e3 / 45);
            },
          w = Math.random,
          y = { x: null, y: null, max: 2e4 };
        (m.id = l),
          (m.style.cssText =
            "position:fixed;top:0;left:0;z-index:" + d.z + ";opacity:" + d.o),
          e("body")[0].appendChild(m),
          o(),
          (window.onresize = o),
          (window.onmousemove = function (n) {
            (n = n || window.event), (y.x = n.clientX), (y.y = n.clientY);
          }),
          (window.onmouseout = function () {
            (y.x = null), (y.y = null);
          });
        for (var s = [], f = 0; d.n > f; f++) {
          var h = w() * a,
            g = w() * c,
            v = 2 * w() - 1,
            p = 2 * w() - 1;
          s.push({ x: h, y: g, xa: v, ya: p, max: 6e3 });
        }
        (u = s.concat([y])),
          setTimeout(function () {
            i();
          }, 100);
      })();
    </script>
    <!-- 雪花特效 -->
    <script type="text/javascript">
      (function ($) {
        $.fn.snow = function (options) {
          var $flake = $('<div id="snowbox" />')
              .css({ position: "absolute", "z-index": "9999", top: "-50px" })
              .html("❄"),
            documentHeight = $(document).height(),
            documentWidth = $(document).width(),
            defaults = {
              minSize: 10,
              maxSize: 20,
              newOn: 1000,
              flakeColor:
                "#00CED1" /* 此处可以定义雪花颜色,若要白色可以改为#FFFFFF */,
            },
            options = $.extend({}, defaults, options);
          var interval = setInterval(function () {
            var startPositionLeft = Math.random() * documentWidth - 100,
              startOpacity = 0.5 + Math.random(),
              sizeFlake = options.minSize + Math.random() * options.maxSize,
              endPositionTop = documentHeight - 200,
              endPositionLeft = startPositionLeft - 500 + Math.random() * 500,
              durationFall = documentHeight * 10 + Math.random() * 5000;
            $flake
              .clone()
              .appendTo("body")
              .css({
                left: startPositionLeft,
                opacity: startOpacity,
                "font-size": sizeFlake,
                color: options.flakeColor,
              })
              .animate(
                {
                  top: endPositionTop,
                  left: endPositionLeft,
                  opacity: 0.2,
                },
                durationFall,
                "linear",
                function () {
                  $(this).remove();
                }
              );
          }, options.newOn);
        };
      })(jQuery);
      $(function () {
        $.fn.snow({
          minSize: 5 /* 定义雪花最小尺寸 */,
          maxSize: 80 /* 定义雪花最大尺寸 */,
          newOn: 300 /* 定义密集程度,数字越小越密集 */,
        });
      });
    </script>
  </body>
</html>

烟花效果演示地址四http://www.bokequ.com/show/demo10/
2024跨年烟花音乐背景倒计时演示地址演示1演示2
百度云盘下载地址

除夕跨年烟花html代码大全
隐藏内容,评论可见

 
maolai
  • 本文由 maolai 发表于 2024年1月3日 14:10:19
  • 转载请务必保留本文链接:http://www.bokequ.com/485.html

发表评论