热播剧李峋的超炫爱心代码同款,让你现实中感受电视剧情节,拿去感受感受计算机天才的魅力吧~

代码展示

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE> 李峋同款爱你(づ ̄3 ̄)づ╭❤~</TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""><style>html, body {height: 100%;padding: 0;margin: 0;background: #000;
}
canvas {position: absolute;width: 100%;height: 100%;
}.child{position: fixed;top:50%;left: 50%;margin-top: -75px;margin-left:-100px ;}h4{font-size: 18px;color:#EA80B0;position: relative;left: -40px;}</style></HEAD><BODY><div class="child"><h4>李峋我LOVE你(づ ̄3 ̄)づ╭❤~</h4></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>

效果展示

操作提示

只需要将代码复制到txt文件再将后缀改html打开即可看到李峋同款爱心哦!快去试试吧~

还可在代码中更改为对象名字,给你的那个她看看吧!

HTML文本抖音李峋同款爱心代码超好看相关推荐

  1. 李峋同款爱心代码 (超好看) | 电视剧《点燃我温暖你》

    李峋同款爱心代码 (超好看) | 电视剧<点燃我温暖你> 废话不多说,上代码: import random from math import sin, cos, pi, log from ...

  2. 李峋同款爱心代码(附源码,前端代码,python代码)

    Hello 大家好 如何浪漫的表白,作为程序员出身的小编,今天就带你实现热播剧<点燃我,温暖你>中超火的李峋同款爱心代码!前面是教程,怕麻烦的朋友可以直接划到文末,下载现成的,下载完成后打 ...

  3. Python版李峋同款爱心代码来了!!

    李峋是谁?我也不太清楚! 但是最近看到不少关于李峋同款爱心的视频和文章 今天也来分享一下李峋同款爱心的相关代码,如下! import random from math import sin, cos, ...

  4. 李峋同款爱心代码【有声版】

    一.工具准备 1.安装Pycharm 1.1双击pycharm-professional-2020.1.exe一直下一步即可. 1.2将图中所框目录放到桌面(脚本有需要的评论留言) 1.3双击图中所框 ...

  5. 李峋同款爱心代码(附源码)

    李峋同款浪漫爱心代码(快拿去给爸爸妈妈,给男(女)朋友看!!!) 基于新建文件基础上.txt文档 <html> <head><meta charset="utf ...

  6. 李峋同款爱心代码-电视剧《点燃我温暖你》

    浅浅模仿了一下李峋同款跳动的心,用python完成,引用了tkinter库,最后效果图如图1所示.电视剧里面应该是用AE做的动画(大概率是). """ @author:A ...

  7. 抖音爆火李峋同款爱心代码,简单附带教程,还有烟花代码,手残党也能学会!!

    最近看到抖音爆火的一些HTML代码,有人找"极客G"更新,今天用了几个小时给大家整理出来了下面几个代码,最简单的就是第一个爱心代码,第二个烟花代码可自定义文本,具体看下面. 代码是 ...

  8. [Python]《点燃我,温暖你》李峋同款爱心代码

    代码原作者是[抖音:无所不能的法学生小黑] 代码原作者是[抖音:无所不能的法学生小黑] 代码原作者是[抖音:无所不能的法学生小黑] 重要的事情说三次 import random import sys ...

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

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

最新文章

  1. 服务器 上传文件 杀毒,一种实现文件上传网站后自动进行杀毒的方法及系统
  2. R语言笔记6:在R中写一些简单的函数、functions基础和作用域
  3. 自定义Kettle数据库插件
  4. 安装路径是什么意思_404 not found nginx是什么意思
  5. Frida-跨平台注入工具基础篇
  6. 使用线程池有以下几个目的
  7. 【线段树】扇形面积并(P3997)
  8. linux的基础知识——会话
  9. file association没有 *.class文件_springboot如何MultipartFile文件跨服务
  10. 【毕设狗】【单片机毕业设计】基于单片机的空气质量检测-仿真设计
  11. K210车牌归属地识别[获取图像+训练+识别效果演示]
  12. 神经网络与机器学习笔记
  13. 用户使用情况报告(附用户使用调查表)
  14. 前端测试之用户体验测试
  15. 铀球(235U)的临界半径计算(1d,S8)
  16. JavaScript中throw的错误异常处理
  17. springCloud微服务生态圈囊括—— 服务注册,服务调用,服务降级,熔断。(1)
  18. rook 排错记录 + Orphaned pod found kube-controller-manager的日志输出
  19. 立体匹配---立体匹配过程
  20. eNSP基础命令_01

热门文章

  1. 铜九铁路客运将于2008年9月1日正式开通
  2. LEP(Linux Easy Profiling)2017年度颁奖典礼在西邮隆重举行
  3. 如何防止服务器记录上网信息,服务器怎么监控上网记录
  4. 网络赛1-D - Find Integer HDU - 6441
  5. UI设计中签到页面如何设计
  6. 沃兹结束苹果生涯 | 历史上的今天
  7. Android 应用开发 之通过AsyncTask与ThreadPool(线程池)两种方式异步加载大量数据的分析与对比
  8. 7.20-7.22作业代码
  9. 【AI人工智能】AI绘画能取代设计师?
  10. 联想小新pro14 2022款和2021款的区别