dy上很火的爱心代码如下:这里是用的vs code软件运行的

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Canvas爱心表白动画特效</title><style>
html, body {height: 100%;padding: 0;margin: 0;background: #000;
}
canvas {width: 100%;height: 100%;
}
</style></head>
<body><div style="text-align:center;clear:both;">
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
</div><canvas id="pinkboard"></canvas><script>
/** 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 = '#ea80b0';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'));
</script></body>
</html>

效果图如下:

<body style="  overflow:hidden;"><canvas id="c"></canvas><script>var b = document.body;var c = document.getElementsByTagName('canvas')[0];var a = c.getContext('2d');
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {// 是移动端打开document.write('<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">');
} else {// 不是移动端打开
}</script><div><img style="position:absolute;
width:250px;
height:250px;
top: 20%;
left: 52%;
transform: translate(-50%,-50%);"
src="1.jpg"></div>
<audio autoplay="autopaly" loop="loop" id="audios" preload="auto"><source src="http://music.163.com/song/media/outer/url?id=558290126.mp3" />
</audio>
</body>

效果图如下(动态):

<body><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">我喜欢你</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">和我</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">在一起</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">好吗</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">爱</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">爱你哟</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">么么哒</div></div></div></div><div class="love"><div class="love_horizontal"><div class="love_vertical"><div class="love_word">Love</div></div></div></div>
</div><div><img style="position:absolute;
width:250px;
height:250px;
top: 50%;
left: 52%;
transform: translate(-50%,-50%);"
src="./images/1.jpg"></div>
<audio autoplay="autoplay" loop="loop" preload="auto"
src="http://music.163.com/song/media/outer/url?id=1828026086.mp3">
</audio>
</body>

李峋 爱心代码 点燃我温暖我相关推荐

  1. 《点燃我,温暖你》朱韵李峋爱心代码

    闲来无事,找了下<点燃我,温暖你>中朱韵的期中考试作业,在上面又删删改改,发现小猪猪的确有两下子(比我期中考试时水平高多了) 代码双手奉上: #include<bits/stdc++ ...

  2. 跳动爱心代码-李峋爱心代码(手把手教学)

    电视剧 点燃我,温暖你 打火机与公主裙 李洵爱心跳动效果. 获取完整代码,公众号「先取个名字吧」 回复爱心代码. 本文分为两种方式讲解如何运行代码,第一种方式比较简单推荐新手(完全不懂编程的),第二种 ...

  3. 跳动的爱心代码--李峋爱心代码(完整源码)

    本文章分为两部分: 第一部分为实现效果展示,第二部分是实现跳动爱心源码. 关注微信公众号: 先取个名字吧 跳动的爱心效果展示 关注微信公众号(先取个名字吧)获取完整源码,回复爱心代码. 实现步骤 1. ...

  4. Yep | 李峋爱心代码 python、html+CSS+JavaScript实现

    一.python实现 直接打开运行环境跑代码. 效果图:动态滴 import random from math import sin, cos, pi, log from tkinter import ...

  5. 李峋爱心代码 程序员教你用代码制作爱心网页[樱花+爱心],正好拿去送给女神给她个惊喜

    HTML+CSS+JavaScript实现 先点赞后观看,养成好习惯 效果图 注:任意浏览器都可以,建议使用谷歌浏览器 代码: <!DOCTYPE HTML ><HTML>&l ...

  6. 李峋爱心Python代码

    李峋爱心Python代码: # coding=gbk import random from math import sin, cos, pi, log from tkinter import * CA ...

  7. 最新复刻李峋爱心表白HTML源代码+超唯美

    正文: 果然没一个人能逃过命韵峋环,李峋的爱心代码真的甜到发昏.(个人感觉这个有点像GIF图"没有断定"没有演示代码的执行过程),是动态的,爱心可以动. 下面是经博主美化后的复刻的 ...

  8. HTML李峋同款爱心代码源码分享,手机网页爱心代码源码

    效果图展示 分享一下最近网上很火李峋爱心代码,相似度95%,没电脑的可以去网上搜索能手机运行网页代码的软件,比如webcat.详情自行百度 话不多说,直接上源码: <!DOCTYPE html& ...

  9. 李峋同款-C语言版本-爱心

    近期很火的<点燃我,温暖你>很火,里面的李峋爱心代码相信很多人心动, 网上有很多的"李峋同款"爱心源码,但都不是C语言的,用语言描述一下,就是好多爱心,然后从内到外,从 ...

最新文章

  1. Kafka无消息丢失配置
  2. 区块链BaaS云服务(39)时戳信息Bystack
  3. [设计模式]中介者模式之Events消息传递实现
  4. ExecutorService——shutdown方法和awaitTermination方法
  5. mysql如何抛出错误信息_如何捕获并重新抛出MySQL中的所有错误
  6. 帮写python代码_10个工具,帮你写出更好的Python代码
  7. pillow api
  8. python中从键盘输入的代码_python如何从键盘获取输入实例
  9. [详细功能介绍]Stimulsoft报表全线更新至2012.3
  10. 2011-9-11 凌晨00:46
  11. 华为笔试题——去除重复的数字
  12. ios9提取安装包ipa_iOS 应用降级与 IPA 安装包备份
  13. ListView分页操作
  14. 从单片机——快速上手PLC
  15. D - Sleepy Game
  16. GUTI S-TMSI及在LTE PAGING中的应用
  17. C#-WinForm登录窗体实现记住密码的功能(仿QQ实现)
  18. list index out of range错误
  19. java新特性-函数式接口-作为方法参数-作为方法的返回值-常用函数式接口-Supplier-Consumer-Predicate-Function
  20. 快速切换本地host文件的工具 —— SwitchHosts

热门文章

  1. Android集成友盟第三方登录
  2. [Swift通天遁地]七、数据与安全-(6)管理文件夹和创建并操作文件
  3. html单元格分割,html – 拆分td在两个
  4. HCIP-DATACOM-解题九月部分58+51题
  5. 安徽电信翼拍照显示服务器异常,人像拍照环境指南
  6. SpringMVC数据接收及传递
  7. 怎么退出自适应巡航_自适应巡航功能是何方神圣?“全速域自适应巡航”又有什么作用呢...
  8. RedHat7使用yum源安装依赖包
  9. Git 修改已提交的 commit 信息
  10. 前端面试谈:简历通用注意事项