动态爱心表白代码

效果图:

 可以直接复制,新建文本文档(txt文件),复制保存后将后缀名改为html


<!doctype html>
<html>
 
<head>
    <meta charset="utf-8">
    <title>love++</title>
 
    <style>
        html,
        body {
 
            width: 500px;
            height: 300px;
            left: 50px;
            top: 30px;
            margin: 100px 289px;
 
            background: #f6d8e2;
        }
 
        pp1 {
            position: absolute;
            top: 20px;
            left: 20px;
        }
 
        canvas {
            position: absolute;
            width: 1000px;
            height: 500px;
            left: 135px;
            top: 50px;
        }
    </style>
    <link href="css/default.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="d.js"></script>
 
   
</head>
 
<div id="myContent"></div>
<div id="contentToWrite" class="comments" 
 style="margin-left: 39px;color: red;">此处</div>
<div id="contentToWrite" class="comments" 
 style="margin-left: 39px;color:#f6d8e2;">00</div>
<div id="contentToWrite" class="comments"
 style="margin-left: 30px;color: red;">添加文字</div>
<script type="text/javascript"> writeContent(true); </script>
</body>
 
<body>
 
    <canvas id="pinkboard"></canvas>
 
    <script>
        /*
         * Settings
         */
        var settings = {
            particles: {
                length: 500, // maximum amount of particles
                duration: 2, // particle duration in sec
                velocity: 100, // particle velocity in pixels/sec
                effect: -0.75, // play with this for a nice effect
                size: 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 
  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值