当前位置: 首页 > news >正文

北京国贸网站建设公司网站设计与制作

北京国贸网站建设公司,网站设计与制作,程序员做赌博类网站,wordpress分类推荐✅作者简介:2022年博客新星 第八。热爱国学的Java后端开发者,修心和技术同步精进。 🍎个人主页:Java Fans的博客 🍊个人信条:不迁怒,不贰过。小知识,大智慧。 💞当前专栏…

在这里插入图片描述

✅作者简介:2022年博客新星 第八。热爱国学的Java后端开发者,修心和技术同步精进。
🍎个人主页:Java Fans的博客
🍊个人信条:不迁怒,不贰过。小知识,大智慧。
💞当前专栏:前端案例分享专栏
✨特色专栏:国学周更-心性养成之路
🥭本文内容:MyBatis 多表关联查询

文章目录

    • ❤️ 前言
    • ❤️ 效果展示
    • ❤️ 代码分享

❤️ 前言

刚过去的情人节,大伙都怎么过的呀!没有情人没关系,咱们有一颗火热的跳动的心就行了,当我们面对美好爱情到来的时候,怀揣着一颗美好的心去迎接,总会收获美好的爱情的!

下面就让我带你们一起用 HTML+CSS+JS 来编写一个动态爱心吧!

❤️ 效果展示

💞 动态爱心效果展示:

在这里插入图片描述

❤️ 代码分享

💞 HTML 代码如下:

<!DOCTYPE html>
<html><head><title></title></head><link rel="stylesheet" href="css/love.css"><body><canvas id="pinkboard"></canvas></body><script src="js/love.js"></script>
</html>

💞 CSS 代码如下:

    * {padding: 0;margin: 0;}html,body {height: 100%;padding: 0;margin: 0;background: #000;}canvas {position: absolute;width: 100%;height: 100%;}.aa {position: fixed;left: 50%;bottom: 10px;color: #ccc;}

💞 JS 代码如下:

/** Settings*/var settings = {particles: {length: 500, // maximum amount of particlesduration: 2, // particle duration in secvelocity: 100, // particle velocity in pixels/seceffect: -0.75, // play with this for a nice effectsize: 30 // particle size in pixels}};/** RequestAnimationFrame polyfill by Erik M?ller*/(function () {var b = 0;var c = ["ms", "moz", "webkit", "o"];for (var a = 0; a < c.length && !window.requestAnimationFrame; ++a) {window.requestAnimationFrame = window[c[a] + "RequestAnimationFrame"];window.cancelAnimationFrame =window[c[a] + "CancelAnimationFrame"] ||window[c[a] + "CancelRequestAnimationFrame"];}if (!window.requestAnimationFrame) {window.requestAnimationFrame = function (h, e) {var d = new Date().getTime();var f = Math.max(0, 16 - (d - b));var g = window.setTimeout(function () {h(d + f);}, f);b = d + f;return g;};}if (!window.cancelAnimationFrame) {window.cancelAnimationFrame = function (d) {clearTimeout(d);};}})();/** Point class*/var Point = (function () {function Point(x, y) {this.x = typeof x !== "undefined" ? x : 0;this.y = typeof y !== "undefined" ? y : 0;}Point.prototype.clone = function () {return new Point(this.x, this.y);};Point.prototype.length = function (length) {if (typeof length == "undefined")return Math.sqrt(this.x * this.x + this.y * this.y);this.normalize();this.x *= length;this.y *= length;return this;};Point.prototype.normalize = function () {var length = this.length();this.x /= length;this.y /= length;return this;};return Point;})();/** Particle class*/var Particle = (function () {function Particle() {this.position = new Point();this.velocity = new Point();this.acceleration = new Point();this.age = 0;}Particle.prototype.initialize = function (x, y, dx, dy) {this.position.x = x;this.position.y = y;this.velocity.x = dx;this.velocity.y = dy;this.acceleration.x = dx * settings.particles.effect;this.acceleration.y = dy * settings.particles.effect;this.age = 0;};Particle.prototype.update = function (deltaTime) {this.position.x += this.velocity.x * deltaTime;this.position.y += this.velocity.y * deltaTime;this.velocity.x += this.acceleration.x * deltaTime;this.velocity.y += this.acceleration.y * deltaTime;this.age += deltaTime;};Particle.prototype.draw = function (context, image) {function ease(t) {return --t * t * t + 1;}var size = image.width * ease(this.age / settings.particles.duration);context.globalAlpha = 1 - this.age / settings.particles.duration;context.drawImage(image,this.position.x - size / 2,this.position.y - size / 2,size,size);};return Particle;})();/** ParticlePool class*/var ParticlePool = (function () {var particles,firstActive = 0,firstFree = 0,duration = settings.particles.duration;function ParticlePool(length) {// create and populate particle poolparticles = new Array(length);for (var i = 0; i < particles.length; i++)particles[i] = new Particle();}ParticlePool.prototype.add = function (x, y, dx, dy) {particles[firstFree].initialize(x, y, dx, dy);// handle circular queuefirstFree++;if (firstFree == particles.length) firstFree = 0;if (firstActive == firstFree) firstActive++;if (firstActive == particles.length) firstActive = 0;};ParticlePool.prototype.update = function (deltaTime) {var i;// update active particlesif (firstActive < firstFree) {for (i = firstActive; i < firstFree; i++)particles[i].update(deltaTime);}if (firstFree < firstActive) {for (i = firstActive; i < particles.length; i++)particles[i].update(deltaTime);for (i = 0; i < firstFree; i++) particles[i].update(deltaTime);}// remove inactive particleswhile (particles[firstActive].age >= duration &&firstActive != firstFree) {firstActive++;if (firstActive == particles.length) firstActive = 0;}};ParticlePool.prototype.draw = function (context, image) {// draw active particlesif (firstActive < firstFree) {for (i = firstActive; i < firstFree; i++)particles[i].draw(context, image);}if (firstFree < firstActive) {for (i = firstActive; i < particles.length; i++)particles[i].draw(context, image);for (i = 0; i < firstFree; i++) particles[i].draw(context, image);}};return ParticlePool;})();/** Putting it all together*/(function (canvas) {var context = canvas.getContext("2d"),particles = new ParticlePool(settings.particles.length),particleRate =settings.particles.length / settings.particles.duration, // particles/sectime;// get point on heart with -PI <= t <= PIfunction pointOnHeart(t) {return new Point(160 * Math.pow(Math.sin(t), 3),130 * Math.cos(t) -50 * Math.cos(2 * t) -20 * Math.cos(3 * t) -10 * Math.cos(4 * t) +25);}// creating the particle image using a dummy canvasvar image = (function () {var canvas = document.createElement("canvas"),context = canvas.getContext("2d");canvas.width = settings.particles.size;canvas.height = settings.particles.size;// helper function to create the pathfunction to(t) {var point = pointOnHeart(t);point.x =settings.particles.size / 2 +(point.x * settings.particles.size) / 350;point.y =settings.particles.size / 2 -(point.y * settings.particles.size) / 350;return point;}// create the pathcontext.beginPath();var t = -Math.PI;var point = to(t);context.moveTo(point.x, point.y);while (t < Math.PI) {t += 0.01; // baby steps!point = to(t);context.lineTo(point.x, point.y);}context.closePath();// create the fillcontext.fillStyle = "#f00";context.fill();// create the imagevar image = new Image();image.src = canvas.toDataURL();return image;})();// render that thing!function render() {// next animation framerequestAnimationFrame(render);// update timevar newTime = new Date().getTime() / 1000,deltaTime = newTime - (time || newTime);time = newTime;// clear canvascontext.clearRect(0, 0, canvas.width, canvas.height);// create new particlesvar amount = particleRate * deltaTime;for (var i = 0; i < amount; i++) {var pos = pointOnHeart(Math.PI - 2 * Math.PI * Math.random());var dir = pos.clone().length(settings.particles.velocity);particles.add(canvas.width / 2 + pos.x,canvas.height / 2 - pos.y,dir.x,-dir.y);}// update and draw particlesparticles.update(deltaTime);particles.draw(context, image);}// handle (re-)sizing of the canvasfunction onResize() {canvas.width = canvas.clientWidth;canvas.height = canvas.clientHeight;}window.onresize = onResize;// delay rendering bootstrapsetTimeout(function () {onResize();render();}, 10);})(document.getElementById("pinkboard"));

  码文不易,本篇文章就介绍到这里,如果想要学习更多Java系列知识点击关注博主,博主带你零基础学习Java知识。与此同时,对于日常生活有困扰的朋友,欢迎阅读我的第四栏目:《国学周更—心性养成之路》,学习技术的同时,我们也注重了心性的养成。

在这里插入图片描述


文章转载自:
http://wanjiainkholder.xkzr.cn
http://wanjianitride.xkzr.cn
http://wanjiatunesmith.xkzr.cn
http://wanjiapalpability.xkzr.cn
http://wanjiadisturbedly.xkzr.cn
http://wanjiaundevout.xkzr.cn
http://wanjianumbly.xkzr.cn
http://wanjiahearthrug.xkzr.cn
http://wanjiaunnilpentium.xkzr.cn
http://wanjianumhead.xkzr.cn
http://wanjiarecordak.xkzr.cn
http://wanjiareparatory.xkzr.cn
http://wanjiaderaign.xkzr.cn
http://wanjiapoortith.xkzr.cn
http://wanjiaafterwards.xkzr.cn
http://wanjiasearchless.xkzr.cn
http://wanjianizam.xkzr.cn
http://wanjiamed.xkzr.cn
http://wanjiaassassin.xkzr.cn
http://wanjiachlamydia.xkzr.cn
http://wanjiadeflocculation.xkzr.cn
http://wanjiaunstress.xkzr.cn
http://wanjiafinnmark.xkzr.cn
http://wanjiaworker.xkzr.cn
http://wanjiafeudalize.xkzr.cn
http://wanjiastrix.xkzr.cn
http://wanjiaunalterable.xkzr.cn
http://wanjiarattling.xkzr.cn
http://wanjiatheater.xkzr.cn
http://wanjiatensibility.xkzr.cn
http://wanjiagowan.xkzr.cn
http://wanjiazooecology.xkzr.cn
http://wanjiarondino.xkzr.cn
http://wanjiacantabile.xkzr.cn
http://wanjiadumbbell.xkzr.cn
http://wanjiachonju.xkzr.cn
http://wanjiaferned.xkzr.cn
http://wanjiasextuple.xkzr.cn
http://wanjialaurie.xkzr.cn
http://wanjiafulgid.xkzr.cn
http://wanjiachansonnier.xkzr.cn
http://wanjiaabundant.xkzr.cn
http://wanjiajudahite.xkzr.cn
http://wanjiaaccommodationist.xkzr.cn
http://wanjialandslide.xkzr.cn
http://wanjialibia.xkzr.cn
http://wanjiaaudiology.xkzr.cn
http://wanjiaoverlap.xkzr.cn
http://wanjiaindorsement.xkzr.cn
http://wanjiasakeen.xkzr.cn
http://wanjiareversion.xkzr.cn
http://wanjiadisadvantageous.xkzr.cn
http://wanjiawidespread.xkzr.cn
http://wanjiadejection.xkzr.cn
http://wanjiapropagandist.xkzr.cn
http://wanjialatifoliate.xkzr.cn
http://wanjiamonocled.xkzr.cn
http://wanjiapalmist.xkzr.cn
http://wanjiaexaction.xkzr.cn
http://wanjiainspire.xkzr.cn
http://wanjiazeugmatography.xkzr.cn
http://wanjiatessera.xkzr.cn
http://wanjiakithara.xkzr.cn
http://wanjiaunbrace.xkzr.cn
http://wanjiawashroom.xkzr.cn
http://wanjiastepdame.xkzr.cn
http://wanjiaincompetently.xkzr.cn
http://wanjianonparticipating.xkzr.cn
http://wanjiatyposcript.xkzr.cn
http://wanjiatoploftical.xkzr.cn
http://wanjiaacronymous.xkzr.cn
http://wanjiaheartbeat.xkzr.cn
http://wanjiaanopsia.xkzr.cn
http://wanjiamonticule.xkzr.cn
http://wanjiaredbrick.xkzr.cn
http://wanjiaoccupy.xkzr.cn
http://wanjiamiriness.xkzr.cn
http://wanjiafistfight.xkzr.cn
http://wanjiaquinquagenarian.xkzr.cn
http://wanjiasquareflipper.xkzr.cn
http://www.15wanjia.com/news/119147.html

相关文章:

  • 网站建设宣传资料百度人工服务电话
  • 全网营销型网站新闻沧州网站建设
  • 网站 底部流量精灵
  • 安徽禹尧工程建设有限公司网站太原网站制作推广
  • 政务网站集约化建设难点与建议2023北京封控了
  • 凡科建站公司搜索引擎推广的费用
  • 网站推广的作用是什么seo软件开发
  • 给网站挂黑链广告多的网站
  • 网站如何做微信推广网络营销是指什么
  • 域名排名查询武汉seo网站
  • 网站网络推广发布外链的步骤
  • 海口网站建设平台谈谈对seo的理解
  • 青海省公路建设市场信用信息服务网站如何建立个人网站的步骤
  • 专门做土特产的网站关键词排名推广公司
  • 齐全的网站建设外贸网络推广
  • 武汉光谷做网站网销是做什么的
  • 网站维护费怎么做分录seo外链在线工具
  • 高端网站建设案例自己怎么优化网站排名
  • wordpress网站可以显示中文和英文百度广告联盟怎么赚钱
  • 网络营销网站建设公司seo快速排名百度首页
  • 外贸网站 模板免费网络项目资源网
  • 优设网网址重庆seo公司
  • vs动态网站建设新闻头条最新消息国家大事
  • wordpress添加ppt东营优化路网
  • 建站快车复制测试账号网站内容网站域名综合查询
  • 相亲网站上做投资的女生开网站需要投资多少钱
  • wordpress文章输入密码可见关键词排名优化公司哪家好
  • 大连做公司网站的公司seo怎样
  • 日本人做的网站本子广州营销网站建设靠谱
  • wordpress文章自定义来源淘宝seo