[JavaScript] 纯文本查看 复制代码
_sex = "";
_index = 0;
var loader = new ImagesLoader();
loader.loadImages(["bg.jpg", "cj1.jpg", "cj2.jpg", "cj3.jpg", "cj4.jpg", "cj5.jpg", "cj6.jpg", "cj7.jpg", "cj8.jpg", "cj9.jpg", "cj10.jpg", "cj11.jpg", "cj12.jpg", "cj13.jpg", "cj14.jpg", "cj15.jpg", "cj16.jpg", "cjbg.png", "cjicon.png", "c1.png", "c2.png", "c3.png", "c4.png", "c5.png", "c6.png", "c7.png", "c8.png", "c9.png", "c10.png", "c11.png", "c12.png", "c13.png", "c14.png", "c15.png", "c16.png", "close.png", "duck.png", "faicon.png", "fuicon.png", "sed.png", "pause.png", "share_bg.png", "shan.gif", "head1.png", "head2.png", "head3.png", "head4.png", "head5.png", "head6.png", "head7.png", "head8.png", "head9.png", "head10.png", "head11.png", "head12.png", "heart.png", "ice.png", "keep.png", "ewm1.png", "an.png", "left.png", "c_left.png", "load_bg.png", "load_img.png", "load_top.png", "load_txt.png", "man.png", "hand.png", "man1.png", "man2.png", "man3.png", "man4.png", "man5.png", "man6.png", "man7.png", "man8.png", "m1.png", "m2.png", "m3.png", "m4.png", "m5.png", "m6.png", "m7.png", "m8.png", "next.png", "once.png", "open.png", "right.png", "wb1.png", "wb2.png", "wb3.png", "wb4.png", "wb5.png", "wb6.png", "wb7.png", "wb8.png", "wb9.png", "wb10.png", "wb11.png", "wb12.png", "b1.png", "b2.png", "b3.png", "b4.png", "b5.png", "b6.png", "b7.png", "b8.png", "b9.png", "b10.png", "b11.png", "b12.png", "c_right.png", "share.png", "start.png", "suc.png", "tit1.png", "tit2.png", "tit3.png", "tit4.png", "tit5.png", "tit6.png", "tit7.png", "tit8.png", "tit9.png", "txt2.png", "whead1.png", "whead2.png", "whead3.png", "whead4.png", "whead5.png", "whead6.png", "whead7.png", "whead8.png", "whead9.png", "whead10.png", "whead11.png", "whead12.png", "woman.png", "w1.png", "w2.png", "w3.png", "w4.png", "w5.png", "w6.png", "w7.png", "w8.png", "woman1.png", "woman2.png", "woman3.png", "woman4.png", "woman5.png", "woman6.png", "woman7.png", "woman8.png", "yh.png", "hi.png", "hi_bg.png", "hi3.png", "hi2.png", "hi1.png", "man_b.png", "woman_b.png", "man_btn.png", "woman_btn.png", "xing.png", "down1.png", "down2.png"], "./images/");
loader.complete(function () {
$(".loading").hide();
$(".sel").show();
});
loader.process(function () {
$(".loadingNum").html(this.processNum + "%");
$(".loding").css({
"width": 4.79 * this.processNum / 100 + "rem"
});
$(".load_img").css({
"margin-left": 4.5 * this.processNum / 100 + "rem"
});
});
loader.start();
console.log($(window).height());
if ($(window).height() > 800) {
$(".sel").css("margin-top", "calc(100% - 6.67rem)");
$(".scene").css("margin-top", "calc(100% - 6.67rem)");
$(".share").css("margin-top", "calc(100% - 6.67rem)");
$(".sel_sence").css("margin-top", "10rem");
$(".txt_btn").css("margin-top", "11rem");
}
const app = new PIXI.Application({
"width": 750,
"height": 1334,
"transparent": true
});
document.getElementById("stage").appendChild(app.view);
let bgSpr = new PIXI.Sprite.fromImage("images/share_bg.png");
bgSpr.position.set(0, 0);
bgSpr.width = 750;
bgSpr.height = 1334;
bgSpr.name = "bg";
let cont = new PIXI.Container();
cont.position.set(35, 110);
cont.interactive = true;
cont.name = "cont";
let cj = new PIXI.Sprite.fromImage(" images/cjbg.png");
cj.name = "cj";
let cjbg = new PIXI.Sprite.fromImage(" images/cj1.jpg");
cjbg.position.set(18, 18);
cjbg.name = "cjbg";
let imgContainer = new PIXI.Container();
imgContainer.position.set(215, 176);
imgContainer.interactive = true;
imgContainer.name = "man";
function sex(_0x3f6e74) {
if (_0x3f6e74 == 0) {
mbody = new PIXI.Sprite.fromImage(" images/man1.png");
mbody.position.set(-50, 100);
mbody.name = "mbody";
mhair = new PIXI.Sprite.fromImage(" images/head1.png");
mhair.position.set(3, -20);
mhair.name = "mhair";
imgContainer.addChild(mbody);
imgContainer.addChild(mhair);
cj.addChild(cjbg);
cj.addChild(imgContainer);
} else {
mbody = new PIXI.Sprite.fromImage(" images/woman1.png");
mbody.position.set(-50, 100);
mbody.name = "mbody";
mhair = new PIXI.Sprite.fromImage(" images/whead1.png");
mhair.position.set(3, -20);
mhair.name = "mhair";
imgContainer.addChild(mbody);
imgContainer.addChild(mhair);
cj.addChild(cjbg);
cj.addChild(imgContainer);
}
}
cont.addChild(cj);
console.log(app.stage);
function showCj(_0x430d91) {
press();
$(".swi_act .swi_con").removeClass("sed");
$(".swi_act .swi_con" + _0x430d91 + "").addClass("sed");
app.stage.getChildByName("cont").children[0].children[0].texture = new PIXI.Texture.fromImage("images/cj" + _0x430d91 + ".jpg");
}
function changeHair(_0x4feb43, _0x47f3ac, _0x41fe7c) {
if (_0x47f3ac == 1) {
$(".swper2 .swi_con").removeClass("sed");
$(".swper2 .swi_con" + _0x41fe7c + "").addClass("sed");
} else if (_0x47f3ac == 0) {
$(".swper3 .swi_con").removeClass("sed");
$(".swper3 .swi_con" + _0x41fe7c + "").addClass("sed");
}
press();
if (_0x4feb43 == 0) {
if (_0x47f3ac == 1) {
app.stage.getChildByName("cont").children[0].children[1].children[1].texture = new PIXI.Texture.fromImage("images/head" + _0x41fe7c + ".png");
if (_0x41fe7c == 4) {
app.stage.getChildByName("cont").children[0].children[1].children[1].y = -24;
} else {
app.stage.getChildByName("cont").children[0].children[1].children[1].y = -20;
}
} else {
app.stage.getChildByName("cont").children[0].children[1].children[0].texture = new PIXI.Texture.fromImage("images/man" + _0x41fe7c + ".png");
}
} else if (_0x4feb43 == 1) {
if (_0x47f3ac == 1) {
app.stage.getChildByName("cont").children[0].children[1].children[1].texture = new PIXI.Texture.fromImage("images/whead" + _0x41fe7c + ".png");
} else {
app.stage.getChildByName("cont").children[0].children[1].children[0].texture = new PIXI.Texture.fromImage("images/woman" + _0x41fe7c + ".png");
}
}
}
$(".next").bind("touchend", function () {
$(".sel_sence").hide();
$(".next").hide();
$(".head_tit").show();
$(".head_btn").show();
$(".swiper-container6").show();
$(".prev_img").hide();
$(".prev_img1").show();
if (app.stage.getChildByName("tit") != null) {
app.stage.getChildByName("tit").visible = true;
}
titSpr(1);
});
$(".prev_img1").bind("touchend", function () {
app.stage.getChildByName("tit").visible = false;
$(".sel_sence").show();
$(".next").show();
$(".head_tit").hide();
$(".head_btn").hide();
$(".swiper-container6").hide();
$(".prev_img").hide();
$(".prev_img0").show();
app.stage.removeChild(tit);
app.stage.getChildByName("cont").y = 110;
});
$(".head_btn").bind("touchend", function () {
$(".share_btn").css("display", "flex");
$(".head_btn").hide();
$(".swper6").addClass("vsty");
$(".share").show();
$(".prev_img").hide();
$(".prev_img2").show();
});
$(".prev_img2").bind("touchend", function () {
$(".share_btn").css("display", "none");
$(".head_btn").show();
$(".swper6").removeClass("vsty");
$(".share").hide();
$(".prev_img").hide();
$(".prev_img1").show();
});
function titSpr(_0x2a29f0) {
if (app.stage.children.length == 2) {
tit = app.stage.getChildByName("tit").texture = new PIXI.Texture.fromImage("images/tit" + _0x2a29f0 + ".png");
app.stage.getChildByName("cont").y = 204;
} else {
tit = new PIXI.Sprite.fromImage(" images/tit" + _0x2a29f0 + ".png");
tit.position.set(43, 39);
tit.name = "tit";
app.stage.addChild(tit);
app.stage.getChildByName("cont").y = 204;
}
}
app.stage.addChild(cont);
function makeBill() {
setTimeout(function () {
app.render();
let _0x2e7c31 = app.view.toDataURL("image/png");
let _0x13f634 = new PIXI.Application({
"width": 750,
"height": 1334,
"transparent": true
});
let _0x2bc2b6 = new PIXI.Sprite.fromImage("images/share_bg.png");
_0x2bc2b6.position.set(0, 0);
_0x2bc2b6.width = 750;
_0x2bc2b6.height = 1334;
_0x13f634.stage.addChild(_0x2bc2b6);
let _0x2a005c = new PIXI.Sprite.fromImage(_0x2e7c31);
_0x2a005c.position.set(0, 0);
_0x2a005c.width = 750;
_0x2a005c.height = 1334;
_0x13f634.stage.addChild(_0x2a005c);
let _0x36c503 = new PIXI.Sprite.fromImage("images/share.png");
_0x36c503.position.set(54, 1070);
_0x36c503.width = 440;
_0x36c503.height = 161;
_0x13f634.stage.addChild(_0x36c503);
let _0x4135b5 = new PIXI.Sprite.fromImage("images/ewm1.png");
_0x4135b5.position.set(547, 1070);
_0x4135b5.width = 158;
_0x4135b5.height = 160;
_0x13f634.stage.addChild(_0x4135b5);
setTimeout(function () {
let _0x309ff4 = _0x13f634.renderer.plugins.extract.base64(_0x13f634.stage);
document.getElementById("myhaibao").src = _0x309ff4;
$(".an").show();
$(".close").show();
}, 200);
}, 200);
}
$(".sel_con .man_btn").each(function (_0x2f204a) {
$(this).click(function () {
_sex = _0x2f204a;
$(".xing_b").removeClass("xing_s");
$(this).find(".xing_b").addClass("xing_s");
$(".sel").hide();
$(".scene").show();
$(".starts_img").show();
$(".prev_img").hide();
$(".prev_img0").show();
if (_0x2f204a == 0) {
$(".man0").show();
$(".woman0").hide();
sex(0);
} else if (_0x2f204a == 1) {
$(".man0").hide();
$(".woman0").show();
sex(1);
}
});
});
$(".start").click(function () {
if ($(".xing_b").hasClass("xing_s")) {
$(".sel").hide();
$(".scene").show();
$(".starts_img").show();
$(".prev_img").hide();
$(".prev_img0").show();
if (_sex == 0) {
$(".man0").show();
$(".woman0").hide();
sex(0);
} else if (_sex == 1) {
$(".man0").hide();
$(".woman0").show();
sex(1);
}
} else {
alert("请选择男女哦!??");
}
});
$(".once").bind("touchend", function () {
location.replace(window.location.href + "?v=" + Math.random());
});
$(".prev_img0").bind("touchend", function () {
location.replace(window.location.href);
});
$(".keep").bind("touchend", function () {
$(".bill").show();
makeBill();
});
$(".close").bind("touchend", function () {
$(".bill").hide();
});
$(".sel_sence li").click(function (_0xe2aa7a) {
let _0x50392e = $(this).index();
$(".sel_sence li").eq(_0x50392e).addClass("active").siblings().removeClass("active");
$(".swiper-container").hide();
if (_0x50392e == 1) {
if (_sex == 0) {
$(".swiper-container2").show();
} else if (_sex == 1) {
$(".swiper-container3").show();
}
} else if (_0x50392e == 2) {
if (_sex == 0) {
$(".swiper-container4").show();
} else if (_sex == 1) {
$(".swiper-container5").show();
}
} else {
$(".swiper-container1").show();
}
cont.addChild(cj);
});
let objMusic = document.getElementById("bgMusic");
let musicState = true;
function musicPlay() {
musicState = true;
objMusic.play();
document.addEventListener("WeixinJSBridgeReady", function () {
objMusic.play();
}, false);
$(".music").removeClass("musicPause").addClass("musicPlay");
}
function musicPause() {
musicState = false;
objMusic.pause();
document.addEventListener("WeixinJSBridgeReady", function () {
objMusic.pause();
}, false);
$(".music").removeClass("musicPlay").addClass("musicPause");
}
musicPlay();
$(".music").bind("touchend", function () {
if (musicState) {
musicPause();
} else {
musicPlay();
}
});
function press() {
let _0x505455 = document.getElementById("prMusic");
_0x505455.play();
}
(function (_0x1ea139, _0x12c080, _0x2e2901) {
_0x2e2901 = "al";
try {
_0x2e2901 += "ert";
_0x12c080 = encode_version;
if (!(typeof _0x12c080 !== "undefined" && _0x12c080 === "jsjiami.com.v5")) {
_0x1ea139[_0x2e2901]("删除版本号,js会定期弹窗,还请支持我们的工作");
}
} catch (_0x2d7234) {
_0x1ea139[_0x2e2901]("删除版本号,js会定期弹窗");
}
})(window);
encode_version = "jsjiami.com.v5";