邻近期末,还在为HTML网页部分设计结课作业,教师的作业后其要求感到头大?网页其要求的总数量太多?HTML网页作业后无从动手?也没适宜的模板?等等一系列问题。想要解决的成绩,专栏????????????????
视频题材itle=”java项目中精品之作实战案例《100套》”a=””java项目中精品之作实战案例《100套》<=””>
罕见网页部分设计作业后题材有 团体、美食、公司、体育、化装品、物流、环保、的书、婚纱、军事、游戏、节日、戒烟、影戏、图片摄影 学校的学生、旅游度假、电商、宠物、电器、茶叶、家居、旅店、民族舞、动漫、明星、服饰、文明、故乡、鲜花、礼物、汽车、其他等网页部分设计标题,A+程度作业后,可知足大学生网页游戏大作业网页部分设计消费需求都能满足你消费需求。原始HTML+CSS+JS页面部分设计,web大学生网页部分设计作业后源码,这是一个不错的2022新年贺卡特效效果网页部分设计制造,画面很精明,十分合适初学者去学习运用。
动图演示:
一款超级炫酷的2022新年高兴html网页特效效果,霓虹的都会夜景和绚烂的烟花很是特殊,该html页面另有交互好效果,点击鼠标就会出现烟花盛开的特效效果,唯美不过如此。图片也可以换成自己喜欢的夜景某人物都可以。?
次要代码:
图片可以选择引入:
html,bodi{margin:0;padding:0;overflow:hidden;backgrou影视题材nd:#000;font-family:Montserrat,sans-serif;background-image:urlimg/pexels-photo-219692.jpeg;background-size:cover;background-position:center;}小说题材
瀑布题材iBA amF2YeadjuadqOWLhw==,size_20,color_FFFFFF,t_70,g_se,x_16″>
css款式:
html,bodi{margin:0;padding:0;overflow:hidden;background:#000;font-family:Montserrat,sans-serif;background-image:urlimg/pexels-photo-219692.jpeg;background-size:cover;background-position:center;}ca短片题材nva{mix-blend-mode:lighten;cursor:pointer;}#hero{display:inline;position:absolute;top:50%;left:50%;transform:translat-50%,-50%;mix-blend-mode:color-dodge;}#year{font-size:30vw;color:#d0d0d0;font-weight:bold;}#timeleft{color:#fbfbfb;font-size:2.5vw;text-align:center;font-family:Lora,serif;}
Javascirpt:
constcanva=document.createEl\'canvas\',context=canvas.getContext\'2d\',width=canvas.width=window.inn学生题材erWidth,height=canvas.height=window.innerHeight,HalfPI=Math.PI/2,graviti=vector.cr0,0.35,year=document.getElementById\'year\',timeleft=document.getElementById\'timeleft\',newyear=newDate\'01/01/2020\';letobject=[],startFirework=false,newYearA lreadi=false;functionrenderTimeLeft{letdate=newDate;letdelta=Math.abnewyear-date/1000;lethour=Math.floordelta/3600%24;delta-=hour*3600;letminut=Math.floordelta/60%60;delta-=minut*60;letsecond=Math.floordelta%60+1;letstring=\'\';letDaysLeft=Math.floornewyear-date/1000*60*60*24,HoursLeft=`${hours}${hour>1?\'hours\':\'hour\'}`,MinutesLeft=`${minutes}${minut>1?\'minutes\':\'minute\'}`,SecondsLeft=`${seconds}${second>1?\'seconds\':\'second\'}`;ifhour>0string=`${HoursLeft}&${MinutesLeft}`;elsifminut>0string=`${MinutesLeft}&${SecondsLeft}`;elsstring=`${SecondsLeft}`;ifDaysLeft>0string=DaysLeft+\'days,\'+string;string+=\'until2020\';timeleft.innerHTML=string;}renderTimeLeft;setIntervfunction{letdate=newDate;ifdate>=newyear{if!newYearA lreadi{year.innerHTML=\'2022\';startFirework=true;timeleft.innerHTML=\'HappiNewYear!\';}newYearA lreadi=true;}elsrenderTimeLeft;},500;document.body.appendChildcanva;functionrandom255{returnMath.floorMath.random*100+155;}functionrandomColor{letr=r作文题材andom255,g=random255,b=random255;return`rgb${r},${g},${b}`;}classPhysicsBodi{constructor{objects.pushthi;}PhysicsUpd{this.lastPosit=this.position.dupl;this.position.addTothis.veloc;this.velocity.addTograviti;}deleteObject{objects[objects.indexOfthi]=undefined;}}classfireworkextendPhysicsBodi{constructor{super;this.posit=vector.crMath.random*width,height;letVeloc=vector.cr0,0;Velocity.setLengthMath.random*10+15;Velocity.setA nglMath.PI*1.35+Math.random*Math.PI*0.30;this.veloc=Velocity;this.trail=Math.floorMath.random*4!=1;this.trailColor=this.trail?randomColor:undefined;this.trailWidth=2;this.TimeCr=newDate.getTim;this.TimeExpir=this.TimeCr+Math.random*5+7*100;this.BlastParticleCount=Math.floorMath.random*50+25;this.funk四季题材i=Math.floorMath.random*5==1;this.exposionColor=randomColor;}draw{context.strokeStyl=this.trailColor;context.lineWidth=this.trailWidth;letp=this.position,lp=this.lastPosition;context.beginPath;context.moveTolp.getX,lp.getY;context.lineTop.getX,p.getY;context.strok;}funkyfir{varfunki=this.funky;forvari=0;i<Math.floorMath.random*10;i++{newBlastParticl{firework:this,funki};}}explod{varfunki=this.funky;forvari=0;i<this.BlastParticleCount;i++{newBlastParticl{firework:this,funki};}this.deleteObject;}checkExpir{letnow=newDate.getTim;ifnow>=this.TimeExpirthis.explod;}render{ifthis.trailthis.draw;ifthis.funkithis.funkyfir;this.checkExpir;}}classBlastParticlextendPhysicsBodi{constructor{firework,funki}{super;this.posit=firework.position.dupl;letVeloc=vector.cr0,0;if!this.funki{Velocity.setLengthMath.random*6+2;Velocity.setA nglMath.random*Math.PI*2;}els{Velocity.setLengthMath.random*3+1;Velocity.setA nglfirework.getA ngl+Math.PI/2-Math.PI*0.25+Math.PI*.5;}this.veloc=Velocity;this.color=firework.exposionColor;this.particleS=Math.random*4;this.TimeCr=newDate.getTim;this.TimeExpir=this.TimeCr+Math.random*4+3.5*100;}draw{context.strokeStyl=this.color;context.lineWidth=this.particleSize;letp=this.position,lp=this.lastPosition;context.beginPath;context.moveTolp.getX,lp.getY;context.lineTop.getX,p.getY;context.strok;}checkExpir{letnow=newDate.getTim;ifnow>=this.TimeExpirthis.deleteObject;}render{this.draw;this.checkExpir;}}document.body.addEventListen\'mousedown\',functione{letcolor=randomColor;forvari=0;i<Math.floorMath.random*20+25;i++{newBlastParticl{firework:{position:vector.cre.pageX,e.pageY,velocity:vector.cr0,0,exposionColor:color},funky:fals};}};setIntervfunction{if!startFireworkreturn;forvari=0;i<Math.floorMath.random*4;i++{newfirework;}},500;functioncleanupObject{object=objects.filto=>o!=undefin;}functionloop{context.fillStyl=\'rgba0,0,0,0.085\';context.fillRect0,0,width,height;letunusedObjectCount=0;objects.mapo=>{if!o{unusedObjectCount++;return;}o.PhysicsUpd;o.rend;};ifunusedObjectCount>100cleanupObject;requestA nimationFramloop;}loop;
各人点赞、珍藏、关注更多、谈论啦
打卡 文章 更新 180/365天
专栏引荐深度阅读:
原文链接:https://blog.csdn.net/weixin_39709134/article/details/122606286?ops_request_misc=%257B%2522request%255Fid%2522%253A %2522166856496116782428689964%2522%252C%2522scm%2522%253A %252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166856496116782428689964&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-10-122606286-null-null.article_score_rank_blog&utm_term=%E9%A 2%98%E6%9D%90
未经允许不得转载:题材网 » 基于前端HTML+CSS+JS完成2022都会新年贺卡特效效果