html代码

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery+CSS3情人节爱心特效 - PHP中文网</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><link type="text/css" rel="stylesheet" href="css/qrj.css" /></head>
<body>
<center>
<!-- 正文 -->
<div class="view-top"><div class="heart-vt"><div id="valentine"><div class="shake"><div class="rope"></div><div class="heart-wrap"><img src="data:images/loveb.png" class="heart"><img src="data:images/loves.png" class="beat"></div></div><div class="tiny"></div><div class="close">&times;</div></div></div></div><!-- 全局通用组件 -->
<script src="js/jquery.min.js"></script>
<!--animation.js-->
<script src="js/qrj.js"></script>
</center></body>
</html>

css3样式代码

@charset "utf-8";.clearfix:after {visibility: hidden;content: ".";display: block;height: 0;clear: both
}.clearfix {zoom: 1
}.heart-vt{left: 50%;height: 100%;position: absolute
}.view-top {width:400px;height: 420px;position: relative;background: #ffd1d6;overflow: hidden
}.heart-vt{width: 400px;top: 0;margin-left: -200px;overflow: hiddenz-index: 3
}#valentine,#valentine .shake {height: 0;top: 0;position: absolute
}#valentine {display: none;z-index: 100;width: 400px;left: 0;left: 145px\9;*left: 145px;_left: 145px
}@keyframes shake {from {transform: rotate(15deg)}to {transform: rotate(-15deg)}
}@keyframes shake-reverse {from {transform: rotate(-15deg)}to {transform: rotate(15deg)}
}#valentine .shake {width: 240px;z-index: 20;left: 100px;animation-name: shake;animation-duration: 2.5s;animation-iteration-count: infinite;animation-timing-function: cubic-bezier(.6,0,.3,1);animation-direction: alternate;transform-origin: top center
}#valentine .shake .rope {position: absolute;width: 2px;left: 105px;top: -10px;background-color: #FF2128
}#valentine .shake .heart-wrap {position: absolute;width: 235px;height: 225px
}#valentine .heart-wrap .heart {display: block;position: relative;width: 235px;height: 225px
}@keyframes beat {0% {transform: scale(0);opacity: 1}40% {opacity: .8}80% {transform: scale(1);opacity: .5}100% {transform: scale(1);opacity: 0}
}#valentine .heart-wrap .beat {position: absolute;top: 25px;left: 130px;animation-name: beat;animation-duration: 1.6s;animation-iteration-count: infinite;animation-timing-function: ease-out;transform-origin: bottom center
}#valentine .tiny {position: relative;width: 0;height: 0;top: 0;left: 200px;z-index: 1
}#valentine .close,#valentine .tiny img {position: absolute
}#valentine .close {display: none;top: 260px;right: -20px;width: 36px;height: 36px;background: #888;border-radius: 50%;text-align: center;line-height: 36px;color: #FFF;font-size: 32px;font-family: 'Times New Roman';cursor: pointer;text-decoration: none
}#valentine .close:hover {background: #666
}
function TinyHeart(t, e, s) {this.container = s,this.init(t, e)
}
var px = function(t) {return t ? Math.floor(t) + "px": 0
},
getRadian = function(t) {var e = window.getComputedStyle(t),s = e.getPropertyValue("transform");if (!s.match("matrix")) return 0;var a = s.match(/-?0(\.[0-9]*[1-9])?/gi).map(function(t) {return parseFloat(t, 10)});return - Math.asin(a[1])
},
random = function(t, e) {return t && "number" == typeof t.length ? t[Math.floor(Math.random() * t.length)] : ("number" != typeof e && (e = t || 1, t = 0), t + Math.random() * (e - t))
};
TinyHeart.STYLES = ["t01dc2e861029c8a8ca", "t016cc24a48997d651a", "t01dd2a63c80cbdbc30"],
TinyHeart.prototype = {init: function(t, e) {this.alive = !0,this.scale = random(.3, .7),this.opacity = random(50, 70) / 100,this.style = random(TinyHeart.STYLES);var s = random(2 * Math.PI);this.x = t + 80 * Math.sin(s) - 48 * this.scale / 2,this.y = e + 80 * Math.cos(s) - 42 * this.scale / 2,this.theta = random(2 * Math.PI),this.drag = random(.9, .99),this.wander = random(.5, 2),this.force = random(.1, .4),this.vx = Math.sin(this.theta) * this.force,this.vy = Math.cos(this.theta) * this.force,this.draw()},move: function() {this.x += this.vx,this.y += this.vy,this.vx *= this.drag,this.vy *= this.drag,this.theta += random( - .5, .5) * this.wander,this.vx += .1 * Math.sin(this.theta),this.vy += .1 * Math.cos(this.theta),this.scale *= .995,this.opacity *= .96,this.alive = this.opacity > .1,this.draw()},draw: function() {var t = this.img;t || (t = document.createElement("img"), t.src = "http://p4.qhimg.com/" + this.style + ".png", this.container.appendChild(t), this.img = t),t.style.left = px(this.x),t.style.top = px(this.y),t.style.width = px(48 * this.scale),t.style.height = px(42 * this.scale),t.style.opacity = this.opacity},destory: function() {this.img && this.container.removeChild(this.img)}
};
var shakes = {MAX_PARTICLES: 500,pool: [],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();

情人节表白专用代码,希望你成功相关推荐

  1. Python情人节表白女神代码(修订版)

    Python情人节表白女神代码(修订版) 引言:又是一年一度的情人节来临之际,最近后台私信不断,槽点:20年初写的表白女神代码无法调试出结果,临时加更本篇内容(对每一行进行了注释解析,自定义妥妥保姆级 ...

  2. 情人节表白专用小系统

    两位主人公 这篇文章以两位主人公来进行秀恩爱,敬醋虽好,可不要贪杯哦~这两位主人公可以扮演面试官和面试者的身份,也可以扮演,媒婆和小伙的身份,还可以扮演男女朋友的身份,今天的角色是男女朋友的身份,男主 ...

  3. 程序猿像妹子表白专用代码

    点击下载源码 转载于:https://www.cnblogs.com/yangykaifa/p/6709058.html

  4. 七夕情人节表白网站代码 3D流星雨旋转相册 程序员专属情人节表白网站

    ❤ 精彩专栏推荐

  5. 程序员像妹子表白专用代码

    点击下载源代码

  6. 用html制作表白网站制作 超炫酷的七夕情人节表白网页代码

    ❤ 精彩专栏推荐

  7. HTML+CSS+JS520告白表白模板在线制作(七夕情人节表白网页代码)

    ❤ 精彩专栏推荐

  8. 七夕情人节表白网页代码HTML 教你如何制作浪漫的表白网站

    ❤ 精彩专栏推荐

  9. 表白专用代码拿走不谢

    %数学之心 figure; clc; x=-2:0.01:2; y=sqrt(2*sqrt(x.^2)-x.^2); z=asin(abs(x)-1)-pi./2; plot(x,y); grid o ...

最新文章

  1. Vivado中ASYNC_REG命令讲解
  2. 项目发布错误的解决方法
  3. mysql中char和text的区别_mysql中text与varchar与char的区别
  4. ITK:按标量乘以图像
  5. applecare多少钱?_否,AppleCare +无法覆盖丢失或被盗的iPhone
  6. 在一台机器上运行多个ActiveMQ实例
  7. Android中动态的更改selector中某张图片的属性
  8. php表单提交邮箱_最全实现dede订单表单提交发送到指定邮箱(附前台设置)
  9. 信息学奥赛一本通 1124:矩阵加法 | OpenJudge NOI 1.8 08:矩阵加法
  10. 辐射4核能选项用计算机失败,gg修改器出现保护进程加载失败怎么解决 | 手游网游页游攻略大全...
  11. JAVA中数据的读取与写入,不同类型数据的转换
  12. TensorFlow strides 参数讨论
  13. VI3之vCenterServer配置的备份与还原
  14. 深入浅出JavaScript之this
  15. 【笑话】男生追女生的数学模型
  16. IP寻址与子网划分网管员要知道什么
  17. 高德api只显示省级地图
  18. 怎么管理一个测试团队
  19. react-native <0.69 Exceptions.h:5:10: fatal error: ‘fbjni/fbjni.h‘ file not found
  20. QML 全屏 输入法无法显示

热门文章

  1. [Python]TempConvert.py(温度转换)解释拓展
  2. r720换固态硬盘后如何重装系统_联想解决R720在Raid模式下重装Win10系统无法识别固态硬盘的问题...
  3. python数据分析 获取数组中非零元素的索引
  4. react-contexify 右键菜单动态生成
  5. 29岁,从绝望崩溃到年入50万:这个技能,决定你5年后的人生!
  6. 关于nginx指向nacos遇到的坑
  7. 什么是表示学习(representation learning)表征学习 表达学习
  8. 谷歌地图 图片保存_Google如何在地图上跟踪并保存您的一举一动
  9. 「分布式技术专题」基于Gossip协议的去中心服务
  10. 涉密台式计算机密码可以输入几次,涉密打印机、扫描仪等与涉密计算机之间不采用无线方式连接 - 作业在线问答...