李峋的爱心代码

简介: 《点燃我温暖你》中李峋的爱心代码

df47ce85d32041cb8e1956fa8c422304.gif

代码

<html>
  <head>
    <meta charset="utf-8" />
    <title>💗</title>
    <style>
      html,
      body {
        height: 100%;
        padding: 0;
        margin: 0;
        background: #000;
      }
      canvas {
        position: absolute;
        width: 100%;
        height: 100%;
        animation: anim 1.5s ease-in-out infinite;
        -webkit-animation: anim 1.5s ease-in-out infinite;
        -o-animation: anim 1.5s ease-in-out infinite;
        -moz-animation: anim 1.5s ease-in-out infinite;
      }
      #name {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-top: -20px;
        font-size: 46px;
        color: #ea80b0;
      }
      @keyframes anim {
        0% {
          transform: scale(0.8);
        }
        25% {
          transform: scale(0.7);
        }
        50% {
          transform: scale(1);
        }
        75% {
          transform: scale(0.7);
        }
        100% {
          transform: scale(0.8);
        }
      }
      @-webkit-keyframes anim {
        0% {
          -webkit-transform: scale(0.8);
        }
        25% {
          -webkit-transform: scale(0.7);
        }
        50% {
          -webkit-transform: scale(1);
        }
        75% {
          -webkit-transform: scale(0.7);
        }
        100% {
          -webkit-transform: scale(0.8);
        }
      }
      @-o-keyframes anim {
        0% {
          -o-transform: scale(0.8);
        }
        25% {
          -o-transform: scale(0.7);
        }
        50% {
          -o-transform: scale(1);
        }
        75% {
          -o-transform: scale(0.7);
        }
        100% {
          -o-transform: scale(0.8);
        }
      }
      @-moz-keyframes anim {
        0% {
          -moz-transform: scale(0.8);
        }
        25% {
          -moz-transform: scale(0.7);
        }
        50% {
          -moz-transform: scale(1);
        }
        75% {
          -moz-transform: scale(0.7);
        }
        100% {
          -moz-transform: scale(0.8);
        }
      }
    </style>
  </head>
  <body>
    <canvas id="pinkboard"></canvas>
    <!-- 在下面加名字 -->
     <div id="name" style="color: blue;">💖</div> 
 
    <script>
      var settings = {
        particles: {
          length: 500, 
          duration: 2, 
          velocity: 100, 
          effect: -0.75,
          size: 30, 
        },
      };
      (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);
          };
        }
      })();
      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;
      })();
      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;
      })();
      var ParticlePool = (function () {
        var particles,
          firstActive = 0,
          firstFree = 0,
          duration = settings.particles.duration;
 
        function ParticlePool(length) {
          particles = 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);
          firstFree++;
          if (firstFree == particles.length) firstFree = 0;
          if (firstActive == firstFree) firstActive++;
          if (firstActive == particles.length) firstActive = 0;
        };
        ParticlePool.prototype.update = function (deltaTime) {
          var i;
          if (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);
          }
          while (
            particles[firstActive].age >= duration &&
            firstActive != firstFree
          ) {
            firstActive++;
            if (firstActive == particles.length) firstActive = 0;
          }
        };
        ParticlePool.prototype.draw = function (context, image) {
          if (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;
      })();
      (function (canvas) {
        var context = canvas.getContext("2d"),
          particles = new ParticlePool(settings.particles.length),
          particleRate =
            settings.particles.length / settings.particles.duration, 
          time;
        function 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
          );}
        var image = (function () {
          var canvas = document.createElement("canvas"),
            context = canvas.getContext("2d");
          canvas.width = settings.particles.size;
          canvas.height = settings.particles.size;
          function 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;
          }
          context.beginPath();
          var t = -Math.PI;
          var point = to(t);
          context.moveTo(point.x, point.y);
          while (t < Math.PI) {
            t += 0.01;
            point = to(t);
            context.lineTo(point.x, point.y);
          }
          context.closePath();
          context.fillStyle = "#ea80b0";
          context.fill();
          var image = new Image();
          image.src = canvas.toDataURL();
          return image;
        })();
        function render() {
          requestAnimationFrame(render);
          var newTime = new Date().getTime() / 1000,
            deltaTime = newTime - (time || newTime);
          time = newTime;
          context.clearRect(0, 0, canvas.width, canvas.height);
          var 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
            );
          }
          particles.update(deltaTime);
          particles.draw(context, image);
        }
        function onResize() {
          canvas.width = canvas.clientWidth;
          canvas.height = canvas.clientHeight;
        }
        window.onresize = onResize;
        setTimeout(function () {
          onResize();
          render();
        }, 10);
      })(document.getElementById("pinkboard"));
    </script>
  </body>
</html>
目录
相关文章
|
23天前
|
人工智能 自然语言处理 API
阿里云Token Plan最新活动:额度上调70%以上,首购5折19.5元起,叠加额度上调与夜间折扣
2026年11月,阿里云百炼 Token Plan 大幅升级:个人版 Lite、Essential、Standard 三档月费不变、额度上调约74%~78%,Pro 提额并降价至312元/月,四档单位额度成本降幅均超四成,存量用户按新标准自动补齐。新客首购5折,Lite 低至19.5元/月、Essential 39.5元/月,截至11月30日;另有每晚22:00至次日08:00指定模型4折或5折。个人版按使用强度分四档,团队版按坐席分三档,并承诺不使用对话数据训练模型,整体从"单次调用成本"转向"一份订阅覆盖多工具、多模型、多任务"。
|
JSON Linux 网络安全
【全面解析】Windows 如何使用 SSH 密钥远程连接 Linux 服务器
【全面解析】Windows 如何使用 SSH 密钥远程连接 Linux 服务器
2274 2
|
9月前
|
人工智能 API 数据安全/隐私保护
别再浪费 OpenClaw 超能力!阿里云/本地部署+Prompt+Skills,解锁AI助手90%潜力
很多人花时间搭建好OpenClaw(原Clawdbot),却只用来做简单的信息搜索和问答——这无疑是对这款强大AI执行引擎的浪费。OpenClaw的核心价值从来不是“替代聊天工具”,而是通过“优质大模型+体系化方法+精准指令”的组合,成为能替你动手完成工作的“数字员工”。
1009 1
|
10月前
|
运维 Kubernetes 应用服务中间件
一文讲解kubernetes的gateway Api的功能、架构、部署、管理及使用
Gateway API是Kubernetes官方推出的下一代L4/L7网络网关标准,面向角色(基础设施商、运维、开发)、可移植、表达力强且高度可扩展。它通过GatewayClass、Gateway、HTTPRoute等资源实现权限分离与策略即代码,替代Ingress短板,已获Istio、Envoy、ASM等主流支持。
2417 119
|
8月前
|
人工智能 JSON 文字识别
一行命令,让你的 Code Agent 会读PDF
一行命令 `npx skills add tanis90/pdf-converter-mineru`,即可为Claude Code、Cursor等主流Code Agent注入PDF阅读能力。基于上海AI Lab开源的MinerU引擎,支持扫描件OCR、表格/公式识别、中英混排,自动选择快读或高精模式,开箱即用,无需部署MCP服务。(239字)
3892 16
|
存储 运维 安全
阿里云服务器2核4G与4核8G配置解析:实例规格、价格及选择指南
阿里云服务器2核4G和4核8G配置凭借其均衡的性能与性价比,成为中小企业及开发者群体的热门选择。通用算力型u1实例2核4G5M带宽80G ESSD Entry云盘特惠价199元1年,个人用户最低531.79元1年,4核8G配置价格最低的是通用算力型u1实例,活动价格为955.58元1年起,除此之外,还有计算型c7、c9i、c8y等计算型实例有2核4G与4核8G配置可选。具体配置还需要看想要购买的云服务器实例规格和配置及带宽大小。本文将结合2025年最新活动价格,深度解析阿里云服务器2核4G与4核8G配置的实例规格、适用场景及选择策略,以供参考。
|
9月前
|
Linux API 数据安全/隐私保护
无需技术储备!OpenClaw(阿里云/Win11/MacOS/Linux)部署步骤+千问/Coding Plan API配置+避坑指南
OpenClaw(前身为Clawdbot、Moltbot)作为2026年现象级开源AI助理项目,以“私有化运行+全权限实操”的核心定位,打破了传统聊天机器人“只说不做”的局限。它可部署在本地设备或云服务器上,通过自然语言指令完成文件管理、系统运维、邮件收发、网页抓取等实际操作,所有数据本地存储,隐私安全性拉满,成为个人与轻量团队提升效率的核心工具。
1121 2
|
人工智能 安全 程序员
用 Colab 和 ngrok 免费部署你的 Web UI 项目,随时随地访问!
用 Colab 和 ngrok 免费部署你的 Web UI 项目,随时随地访问!
1979 12
|
人工智能 数据可视化 网络安全
Dify与DeepSeek的深度融合——构建您的专属AI助手
在当今数据驱动、AI为王的时代,Dify与DeepSeek作为领先的AI开发工具和大模型引擎,为企业和个人提供高效智能的解决方案。Dify是面向AI应用开发的低代码平台,集成预训练模型、可视化界面和无缝部署功能;DeepSeek则是高性能、低成本的开源大语言模型,具备多轮推理能力。两者结合并通过私有化部署,确保数据安全与合规,极大提升开发效率和业务生产力。阿里云计算巢提供了两者的私有化部署方案,帮助用户快速搭建专属AI应用。
1440 1
|
PHP
CTFSHOW 每周大挑战 RCE极限挑战
CTFSHOW 每周大挑战 RCE极限挑战
542 0