Commit 3b9d058d by o.kimura

最終結果の関数を切り離す

parent d79c9fe9
......@@ -203,6 +203,7 @@
<body>
<script>
navigator.serviceWorker.register('sw.js');
</script>
<!-- sound -->
......@@ -415,6 +416,16 @@
<div id="result_plate" class="vanish">
<!------------------------------------------------------------------------------------ begin : ans_plate -->
<img src="images/result/q1.png" class="vanish" id="q1">
<img src="images/result/q2.png" class="vanish" id="q2">
<img src="images/result/q3.png" class="vanish" id="q3">
<img src="images/result/yes1.png" class="vanish" id="yes1">
<img src="images/result/yes2.png" class="vanish" id="yes2">
<img src="images/result/yes3.png" class="vanish" id="yes3">
<img src="images/result/no1.png" class="vanish" id="no1">
<img src="images/result/no2.png" class="vanish" id="no2">
<img src="images/result/no3.png" class="vanish" id="no3">
<img src="images/result/arr_yes.png" class="vanish" id="arr_yes" width="40" height="40">
<img src="images/result/arr_no.png" class="vanish" id="arr_no" width="40" height="40">
<img src="" class="vanish" id="yes_btn" width="200" height="auto">
......
var rand = 0;
// quiz master
function quizMaster(et) {
......@@ -275,6 +276,8 @@ function quizMaster(et) {
}); //----- sound : click
function returnTop() {
console.log("playSE#seStop"); //----------sound : seStop
rand = 0;
$("#result_plate").removeClass("goldPrize randomize1 randomize2 randomize3 answer1 answer2");
$("#yes_btn").removeClass("yes_btn3 yes_btn2 yes_btn1");
$("#no_btn").removeClass("no_btn3 no_btn2 no_btn1");
......@@ -282,6 +285,17 @@ function quizMaster(et) {
$("#no_btn").addClass("vanish");
$("#arr_yes").addClass("vanish");
$("#arr_no").addClass("vanish");
$("#q1").addClass("vanish");
$("#q2").addClass("vanish");
$("#q3").addClass("vanish");
$("#yes1").addClass("vanish");
$("#yes2").addClass("vanish");
$("#yes3").addClass("vanish");
$("#no1").addClass("vanish");
$("#no2").addClass("vanish");
$("#no3").addClass("vanish");
$("#button_next_result").addClass("vanish");
$("#gamemp3").get(0).pause();
......@@ -291,7 +305,7 @@ function quizMaster(et) {
document.getElementById("result_title").classList.remove("vanish");
document.getElementById("result_main").classList.remove("vanish");
resultPlate.classList.remove("randomize" + (Math.floor(Math.random() * 3) + 1));
// resultPlate.classList.remove("randomize" + (Math.floor(Math.random() * 3) + 1));
myObj.hideResult();
topAnime.dispFunc();
}
......@@ -305,15 +319,29 @@ function quizMaster(et) {
}, {
passive: true
}); //----- sound : click
function returnSelect() {
console.log("playSE#seStop"); //----------sound : seStop 要注意。
$("#result_plate").removeClass("goldPrize randomize1 randomize2 randomize3 answer1 answer2");
// $("#result_plate").removeClass("goldPrize randomize1 randomize2 randomize3 answer1 answer2");
rand = 0;
$("#yes_btn").removeClass("yes_btn3 yes_btn2 yes_btn1");
$("#no_btn").removeClass("no_btn3 no_btn2 no_btn1");
$("#yes_btn").addClass("vanish");
$("#no_btn").addClass("vanish");
$("#arr_yes").addClass("vanish");
$("#arr_no").addClass("vanish");
$("#q1").addClass("vanish");
$("#q2").addClass("vanish");
$("#q3").addClass("vanish");
$("#yes1").addClass("vanish");
$("#yes2").addClass("vanish");
$("#yes3").addClass("vanish");
$("#no1").addClass("vanish");
$("#no2").addClass("vanish");
$("#no3").addClass("vanish");
$("#button_next_result").addClass("vanish");
$("#gamemp3").get(0).pause();
......@@ -322,7 +350,6 @@ function quizMaster(et) {
$("#topmp3").get(0).pause();
document.getElementById("result_title").classList.remove("vanish");
document.getElementById("result_main").classList.remove("vanish");
resultPlate.classList.remove("randomize" + (Math.floor(Math.random() * 3) + 1));
myObj.hideResult();
levelSelectMenu.dispFunc();
......@@ -389,6 +416,7 @@ function quizMaster(et) {
document.getElementById("result_select_button").classList.add("vanish");
resultPlate.classList.add("vanish");
}
myObj.dispResult = function () {
resultPlate.classList.remove("vanish");
......@@ -401,7 +429,6 @@ function quizMaster(et) {
}
}); //------ anime
setTimeout(function () {
document.getElementById("result_top_button").classList.remove("vanish");
document.getElementById("result_select_button").classList.remove("vanish");
document.getElementById("button_next_result").classList.remove("vanish");
......@@ -423,46 +450,51 @@ function quizMaster(et) {
easing: "easeOutSine",
duration: 500
}); //------ anime
}, 1000);
$("#button_next_result").on("click", function () {
judgePat(myObj, resultPlate);
$(this).addClass("vanish");
});
}
return myObj;
}
$(function () {
$("#button_next_result").on("click", function () {
judgePat();
$(this).addClass("vanish");
});
$("#yes_btn").on("click", function () {
$("#result_plate").addClass("answer1");
// $("#result_plate").addClass("answer1");
document.getElementById("arr_yes").classList.add("vanish");
document.getElementById("arr_no").classList.add("vanish");
document.getElementById("yes_btn").classList.add("vanish");
document.getElementById("no_btn").classList.add("vanish");
document.getElementById("q" + rand).classList.add("vanish");
document.getElementById("yes" + rand).classList.remove("vanish");
document.getElementById("result_top_button").classList.remove("vanish");
document.getElementById("result_select_button").classList.remove("vanish");
});
$("#no_btn").on("click", function () {
$("#result_plate").addClass("answer2");
//$("#result_plate").addClass("answer2");
document.getElementById("arr_yes").classList.add("vanish");
document.getElementById("arr_no").classList.add("vanish");
document.getElementById("yes_btn").classList.add("vanish");
document.getElementById("no_btn").classList.add("vanish");
document.getElementById("q" + rand).classList.add("vanish");
document.getElementById("no" + rand).classList.remove("vanish");
document.getElementById("result_top_button").classList.remove("vanish");
document.getElementById("result_select_button").classList.remove("vanish");
});
});
function judgePat(myObj, resultPlate) {
function judgePat() {
console.log("hit")
document.getElementById("result_title").classList.add("vanish");
document.getElementById("result_main").classList.add("vanish");
var rand = (Math.floor(Math.random() * 3) + 1);
resultPlate.classList.remove("randomize1");
resultPlate.classList.remove("randomize2");
resultPlate.classList.remove("randomize3");
resultPlate.classList.add("randomize" + rand);
rand = (Math.floor(Math.random() * 3) + 1);
document.getElementById("arr_yes").classList.remove("vanish");
document.getElementById("arr_no").classList.remove("vanish");
document.getElementById("yes_btn").classList.remove("vanish");
......@@ -471,13 +503,17 @@ function judgePat(myObj, resultPlate) {
document.getElementById("no_btn").classList.add("no_btn" + rand);
if (rand == 1) {
$("#yes_btn").attr("src", "images/result/yesbtn1.png");
$("#yes_btn").attr("src", "images/result/yesbtn1.png");
$("#no_btn").attr("src", "images/result/nobtn1.png");
$("#q1").removeClass("vanish");
} else if (rand == 2) {
$("#yes_btn").attr("src", "images/result/yesbtn2.png");
$("#no_btn").attr("src", "images/result/nobtn2.png");
$("#q2").removeClass("vanish");
} else if (rand == 3) {
$("#yes_btn").attr("src", "images/result/yesbtn3.png");
$("#no_btn").attr("src", "images/result/nobtn3.png");
$("#q3").removeClass("vanish");
}
anime({
targets: "#result_plate",
......@@ -485,5 +521,5 @@ function judgePat(myObj, resultPlate) {
easing: "easeOutSine",
duration: 500
}); //------ anime
return myObj;
console.log("rand: " + rand)
}
// takumi
function takumiMaster(){
function takumiMaster() {
//---init
var myObj = new Object();
......@@ -9,40 +9,54 @@ function takumiMaster(){
//---------------------------------------------------------------------たくみ君を消します。
myObj.hideFunc = function(){
myObj.hideFunc = function () {
fuki.classList.add("vanish");
anime({targets: "#takumi",right:"-13vw",easing:"easeOutQuad" , duration: 300, complete:function(){
anime({
targets: "#takumi",
right: "-13vw",
easing: "easeOutQuad",
duration: 300,
complete: function () {
takumi.classList.add("vanish");
}});//------ anime
}
myObj.directHide = function(){//-------------演出無しで消します
}); //------ anime
}
myObj.directHide = function () { //-------------演出無しで消します
fuki.classList.add("vanish");
takumi.classList.add("vanish");
}
//---------------------------------------------------------------------たくみ君を表示します。
myObj.dispFunc = function(){
myObj.dispFunc = function () {
takumi.classList.remove("vanish");
anime({targets: "#takumi",right:["-13vw","0"], duration: 1000});//------ anime
anime({
targets: "#takumi",
right: ["-13vw", "0"],
duration: 1000
}); //------ anime
}
//---------------------------------------------------------------------吹き出しを消します。
myObj.hideFuki = function (){
myObj.hideFuki = function () {
fuki.classList.add("vanish");
}
//---------------------------------------------------------------------吹き出しを表示します。
myObj.dispFuki = function (str){
if (str != undefined){
myObj.dispFuki = function (str) {
if (str != undefined) {
this.setFukiText(str);
}
fuki.classList.remove("vanish");
anime({targets: "#takumi_fuki",scale:[0,1], duration: 1000});//------ anime
anime({
targets: "#takumi_fuki",
scale: [0, 1],
duration: 1000
}); //------ anime
}
//---------------------------------------------------------------------吹き出しの内容を変更します。
myObj.setFukiText = function(str){
myObj.setFukiText = function (str) {
//パスは"images/...."から記述してください。
fuki_text.src = str;
}
......
......@@ -517,7 +517,6 @@ function topAnime(et) {
$(function () {
$("#button_return").on("click", function () {
console.log("hit")
$("#topmp3").get(0).pause();
$("#selectmp3").get(0).pause();
$("#quizmp3").get(0).pause();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment