if (!heartFunc(x, y)) {
appendPic(item)
} else {
var back = “jpg”;
var imgNum = 10;
if (item % imgNum == 1) {
back = “gif”
}
if (item % imgNum == 2 || item % imgNum == 3 || item % imgNum == 4) {
back = “png”
}
var html = ‘’
$(“#container”).append(html)
setTimeout(function () {
$(“#pic-” + item).css(“top”, 45 + 25 * (2 - y) * 0.85 + “%”).css(“left”, 50 + 25 * (2 - x) * 0.85 + “%”)
.css(“transform”, “rotate(”+(25 * (0.5 - Math.random())) + “deg) translate(-50%,-50%)”)
.css(“width”, “100px”).css(“height”, “100px”)
}, 500);
}
}
var init = function () {
for (var i = 1; i < 100; i++) {
appendPic(i)
count++
}
}
var selectFunc = function () {
$(“.surprise”).removeClass(“surprise”).css(“transform”, “rotate(”+(25 * (0.5 - Math.random())) + "deg) ")
$(“#pic-” + Math.floor(Math.random() * count)).addClass(“surprise”)
$(“.start”).removeClass(“start”)
}
var comfirmFunc = function () {
startFunc();
}
var startFunc = function () {
$(“.surprise”).removeClass