李峋同款爱心(有源码2种)(下)

简介: 李峋同款爱心

第二种

 <!DOCTYPE html>
<!-- saved from url=(0051)https://httishere.gitee.io/notion/v4/love-name.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title> Love you </title>
    <style type="text/css">
      body {
        margin: 0;
        overflow: hidden;
        background: #000;
      }
      canvas {
        position: absolute;
        width: 100%;
        height: 100%;
      }
      #pinkboard {
        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;
      }
      @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);
        }
      }
      #name {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-top: -20px;
        font-size: 46px;
        color: #ea80b0;
      }
</style>
  <script src="./ Love you _files/monitors.3.6.36.cn.js.下载" async="" crossorigin="anonymous"></script><script src="./ Love you _files/sentry.3.6.36.cn.js.下载" async="" crossorigin="anonymous"></script></head>
  <body>
    <canvas id="pinkboard" width="1707" height="868"></canvas>
    <canvas id="canvas" width="1707" height="868"></canvas>
    <script type="text/javascript">
      const colors = [
        "#eec996",
        "#8fb7d3",
        "#b7d4c6",
        "#c3bedd",
        "#f1d5e4",
        "#cae1d3",
        "#f3c89d",
        "#d0b0c3",
        "#819d53",
        "#c99294",
        "#cec884",
        "#ff8e70",
        "#e0a111",
        "#fffdf6",
        "#cbd7ac",
        "#e8c6c0",
        "#dc9898",
        "#ecc8ba",
      ]; //用来设置的颜色
      var canvas = document.getElementById("canvas");
      var ctx = canvas.getContext("2d");
      let count = 1;
      var ww = window.innerWidth;
      var wh = window.innerHeight;
      var hearts = [];
      function init() {
        requestAnimationFrame(render);
        canvas.width = ww;
        canvas.height = wh;
        for (var i = 0; i < 100; i++) {
          hearts.push(new Heart());
        }
      }
      function Heart() {
        this.x = Math.random() * ww;
        this.y = Math.random() * wh;
        this.opacity = Math.random() * 0.5 + 0.5;
        this.vel = {
          x: (Math.random() - 0.5) * 4,
          y: (Math.random() - 0.5) * 4,
        };
        this.targetScale = Math.random() * 0.15 + 0.02;
        this.scale = this.targetScale * Math.random();
      }
      Heart.prototype.update = function (i) {
        this.x += this.vel.x;
        this.y += this.vel.y;
        this.scale += (this.targetScale - this.scale) * 0.01;
        if (this.x - this.width > ww || this.x + this.width < 0) {
          this.scale = 0;
          this.x = Math.random() * ww;
        }
        if (this.y - this.height > wh || this.y + this.height < 0) {
          this.scale = 0;
          this.y = Math.random() * wh;
        }
        this.width = 473.8;
        this.height = 408.6;
      };
      Heart.prototype.draw = function (i) {
        ctx.globalAlpha = this.opacity;
        ctx.font = `${180 * this.scale}px "微软雅黑"`;
        // ctx.font="20px";
        ctx.fillStyle = colors[i % 18];
        ctx.fillText(
          "kawsar",
          this.x - this.width * 0.5,
          this.y - this.height * 0.5,
          this.width,
          this.height
        );
        // ctx.drawImage(
        // heartImage,
        // this.x - this.width * 0.5,
        // this.y - this.height * 0.5,
        // this.width,
        // this.heig
目录
相关文章
|
2月前
|
缓存 Android开发
基于autojs7的亚丁号点淘辅助
基于autojs7的亚丁号点淘辅助
68 0
|
2月前
|
存储 Java API
淘宝拍立淘图片搜索接口:轻松找到同款商品!
淘宝拍立淘图片搜索接口:轻松找到同款商品!
141 0
|
2月前
|
前端开发 Java 数据库连接
网上体育商城的设计与实现(论文+源码)_kaic
网上体育商城的设计与实现(论文+源码)_kaic
|
2月前
|
存储 JSON API
如何教会小白使用淘宝API接口获取商品数据
随着互联网的普及,越来越多的人开始接触网络购物,而淘宝作为中国最大的电商平台之一,成为了众多消费者首选的购物平台。然而,对于一些小白用户来说,如何通过淘宝API接口获取商品数据可能是一个难题。本文将详细介绍如何教会小白使用淘宝API接口获取商品数据。
|
10月前
|
监控 Serverless 持续交付
小试牛刀,一键部署电商商城
SAE 仅需一键,极速部署一个微服务电商商城,体验 Serverless 带给您的全托管体验,一起来部署吧!
2467 44
|
缓存 算法 搜索推荐
618省心凑背后的新算法——个性化凑单商品打包购推荐
作为购物导购链路的一个重要环节,凑单旨在快速帮助用户找到达成某个满减门槛(比如满300减50)的商品,完成性价比最高的跨店组合结算。
644 0
618省心凑背后的新算法——个性化凑单商品打包购推荐
|
存储 移动开发 前端开发
电商系列 - 以二维码、海报等来讲讲分享的设计
在做电商平台时,相信都离不开各种推广,通过分享二维码、分享海报、商品链接、店铺链接等方式,来进行线上,或者线下的推广。线上诸如朋友圈、软文、广告、群组等方式、线下诸如店铺海报、地推海报、贴二维码等方式
127 0
阿云漫画 | 淘宝“2021年度十大商品”,你get过几件?
编者按: 2021年还有29小时30分钟就要结束了,该用什么记录这一年?继各大平台陆续发布年度关键词、热搜、弹幕之后,国民电商平台淘宝也发布了一份特殊的年度榜单。网友看完表示,“这一年的人间烟火味都在这了。”
119 0
|
人工智能 算法
如何让店铺在点评网站上一眼出众?
如何让店铺在点评网站上一眼出众?
如何让店铺在点评网站上一眼出众?