设为首页 加入收藏

TOP

程序员的情人节应该这么优雅度过(附源码)(二)
2018-02-13 12:56:02 】 浏览:740
Tags:程序员 情人节 应该 这么 优雅 度过 源码
l: [],
    start: function(t, e, s) {
        shakes.ropeH = t,
        shakes.container = e,
        shakes.timer = setInterval(function() {
            shakes.spawn(getRadian(s)),
            shakes.update()
        },
        50)
    },
    spawn: function(t) {
        if (! (shakes.pool.length >= shakes.MAX_PARTICLES)) {
            var e = Math.sin(t) * (shakes.ropeH + 40),
            s = Math.cos(t) * (shakes.ropeH + 40) + 20;
            heart = new TinyHeart(e, s, shakes.container),
            shakes.pool.push(heart)
        }
    },
    update: function() {
        var t, e;
        for (t = shakes.pool.length - 1; t >= 0; t--) e = shakes.pool[t],
        e.alive ? e.move() : (e.destory(), shakes.pool.splice(t, 1))
    },
    stop: function() {
        clearInterval(shakes.timer),
        shakes.pool.forEach(function(t) {
            t.destory()
        }),
        shakes.pool = []
    }
},
init = function() {
    var t = 180,
    e = document.querySelector("#valentine"),
    s = e.querySelector(".tiny"),
    a = e.querySelector(".shake"),
    i = function() {
        e.querySelector(".close").addEventListener("click",
        function() {
            shakes.stop(),
            e.style.display = "none"
        })
    };
    shakes.start(t, s, a),
    a.querySelector(".rope").style.height = t + "px",
    a.querySelector(".heart-wrap").style.top = t - 60 + "px",
    e.style.display = "block",
    i()
};
init();


效果图:


程序员的情人节应该这么优雅度过(附源码)


4、jQuery+HTML5实现唯美表白动画代码


这是一个很小的jQuery+HTML5静态页面,是一位程序员用来庆祝跟mm相恋一周年纪念日。同时也为了以程序员的视角来表达浪漫,改变大家对于程序员先入为主的形象,程序员改变世界~


效果图:


程序员的情人节应该这么优雅度过(附源码)


5、情人节送花动画HTML5特效


HTML5情人节送花表白放烟花动画特效,小伙子走进花店买花,然后把玫瑰花送到姑娘手上,姑娘接过花然后两个人一起看烟花,非常浪漫的一个HTML5动画,不止适合情人节表白使用,平时表白也可以用的。


部分代码:


<div id='content'>
    <ul class='content-wrap'>
        <!-- 第一副画面 -->
        <li>
            <!-- 背景图 -->
            <div class="a_background">
                <div class="a_background_top"></div>
                <div class="a_background_middle"></div>
                <div class="a_background_botton"></div>
            </div>
            <!-- 云 -->
      &nb

首页 上一页 1 2 3 4 5 下一页 尾页 2/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Java中8种常见的排序方法 下一篇Hibernate 5.2.x 中 sessionFacto..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目