Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*內頁移動參數*/
- var c = document.getElementById("comic");
- c.style.left= "0px";
- var t;
- var count = 0;
- var moving = false;
- /*對話框參數*/
- var chap2_R = document.getElementById("chap2_R");
- var d;
- var diao = 0;
- var diaoing = false;
- var dialogbox = document.getElementById("DialogBox");
- dialogbox.style.opacity = "0";
- /*提示卷軸參數*/
- var hin_win = document.getElementById("hintc");
- var hint_word = document.getElementById("hint_word");
- var reel_op = document.getElementById("reel_op");
- var reel_cl = document.getElementById("reel_cl");
- reel_cl.style.visibility = "hidden";
- hint_word.style.opacity = "0";
- /*前進後退頁計步器*/
- function Npage(){
- var cm = parseFloat(c.style.left);
- count += 1;
- if (count == 1){
- sessionStorage.setItem('CC', '10');//送出換頁需要音效的參數代號
- }
- if (count > 1){
- sessionStorage.removeItem('CC');
- }
- if (count <=80){
- cm -= 0.853125;
- c.style.left = cm + "vw";
- }
- if (count >105){clearInterval(t); count = 0; moving=false;}
- }
- function Ppage(){
- "use strict";
- var cm = parseFloat(c.style.left);
- count += 1;
- if (count == 1){
- sessionStorage.setItem('CC', '10');//送出換頁需要音效的參數代號
- }
- if (count > 1){
- sessionStorage.removeItem('CC');
- }
- if (count <=80){
- cm += 0.853125;
- c.style.left = cm + "vw";
- }
- if (count >105){clearInterval(t); count = 0; moving=false;}
- }
- /*對話框計步器*/
- function dialogIn(){
- var dialogo = parseFloat(dialogbox.style.opacity);
- diao += 1;
- if (20 > diao){
- dialogo += 0.07;
- dialogbox.style.opacity = dialogo;
- }
- if (diao > 20){clearInterval(d); diao = 0; diaoing = false;}
- }
- function dialogOut(){
- var dialogo = parseFloat(dialogbox.style.opacity);
- diao += 1;
- if (20 > diao){
- dialogo -= 0.07;
- dialogbox.style.opacity = dialogo;
- }
- if (diao > 20){clearInterval(d); diao = 0; diaoing = false;}
- }
- /*卷軸計步器*/
- function hintIn(){
- var hinto = parseFloat(hintword.style.opacity);
- hintw += 1;
- if (6 > hintw){
- hinto += 0.2;
- hintword.style.opacity = hinto;
- }
- if (hintw > 6){clearInterval(hw); hintw = 0; hintwing = false;}
- }
- function hintOut(){
- var hinto = parseFloat(hintword.style.opacity);
- hintw += 1;
- if (6 > hintw){
- hinto -= 0.2;
- hintword.style.opacity = hinto;
- }
- if (hintw > 6){clearInterval(hw); hintw = 0; hintwing = false;}
- }
- /*按鈕的function*/
- function next(){
- if (moving) return;
- if (diaoing) return;
- if (nc >= 0){
- aL.style.visibility = "visible";
- setTimeout(function (){
- c1d1.style.visibility = "hidden";
- c1d2.style.visibility = "visible";
- },900);//cNdN皆為各對話框
- }
- if (nc >= 1){
- setTimeout(function (){
- c1d2.style.visibility = "hidden";
- c1d3.style.visibility = "visible";
- },900);
- }
- if (nc >= 2){
- setTimeout(function (){
- c1d3.style.visibility = "hidden";
- },900);
- }
- if (nc == 2){//互動頁出現
- sessionStorage.setItem('CC', '30');
- setTimeout(function Nchap(){
- arR.style.visibility = "hidden";
- },1200);
- setTimeout(function(){
- hin_win.style.visibility = "visible";
- reel_op.src = "美術/UI/hint視窗/hint.gif";
- reel_op.style.visibility = "visible";
- setTimeout(function (){$("#hint_word").animate({opacity:"1.0"},150);},700);
- DialogBox.style.filter = "brightness(.3)";
- comic.style.filter = "brightness(.3)";
- },2700);
- setTimeout(function(){
- $("#hint_word").animate({opacity:"0"},150);
- reel_op.style.visibility = "hidden";
- reel_cl.src = "美術/UI/hint視窗/hint2.gif";
- reel_cl.style.visibility = "visible";
- setTimeout(function (){
- hin_win.style.visibility = "hidden";
- reel_cl.style.visibility = "hidden";
- },1200);
- },5700);
- setTimeout(function(){
- DialogBox.style.filter = "brightness(1)";
- comic.style.filter = "brightness(1)";
- zone.style.visibility = "visible";
- },7000);
- setTimeout(function(){
- t1_1.src = "美術/上色檔/景一/景1-4(1_9).png";
- },1500);
- setTimeout(function(){
- t1_1.src = "美術/上色檔/景一/景1-4(10_36).png";
- t2_1.style.visibility = "visible";
- },2220);
- }
- if (nc == 3){
- zone.style.visibility = "hidden";
- setTimeout(function (){
- c1d5.style.visibility = "visible";
- },900);
- }
- if (nc == 4){
- setTimeout(function (){
- c1d5.style.visibility = "hidden";
- },900);
- }
- if (nc == 5){
- setTimeout(function (){
- c1d7.style.visibility = "visible";
- },900);
- }
- if (nc == 6){
- setTimeout(function (){
- c1d7.style.visibility = "hidden";
- },900);
- setTimeout(function(){
- apng1_8.src = "美術/上色檔/景一/景1-8apng.png"
- },1600);
- }
- if (nc == 8){
- setTimeout(function (){
- c1d10.style.visibility = "visible";
- },900);
- }
- if (nc == 9){
- setTimeout(function (){
- c1d10.style.visibility = "hidden";
- c1d11.style.visibility = "visible";
- },900);
- }
- if (nc == 10){
- setTimeout(function (){
- c1d11.style.visibility = "hidden";
- c1d12.style.visibility = "visible";
- },900);
- }
- if (nc >= 10){
- setTimeout(function Nchap(){
- chap2_R.style.visibility = "visible"
- },1500);
- }
- if (nc >= 11) {
- sessionStorage.setItem('CC', '11');
- sessionStorage.removeItem('NC');
- window.location.href = 'chap2.html';
- return;
- }
- moving = true;
- t = setInterval("Npage()",20);
- diaoing = true;
- d = setInterval("dialogOut()",20);
- diao += 1;
- setTimeout(function (){
- diaoing = true;
- d = setInterval("dialogIn()",20);
- diao += 1;
- },1800);
- }
- function pre(){
- if (moving) return;
- if (diaoing) return;
- else dialogbox.style.opacity = "1";
- if (nc == 0) return;
- if (nc <= 1){
- aL.style.visibility = "hidden";
- setTimeout(function (){
- c1d2.style.visibility = "hidden";
- c1d1.style.visibility = "visible";
- },900);
- }
- if (nc == 2){
- setTimeout(function (){
- c1d3.style.visibility = "hidden";
- c1d2.style.visibility = "visible";
- },900);
- }
- if (nc == 3){
- arR.style.visibility = "visible";arR.style.visibility = "visible";
- t1_1.src = "美術/上色檔/景一/景1-4.jpg";
- t2_1.style.visibility = "hidden";
- t2_1.src = "美術/上色檔/景一/景1-4window(10-36).png";
- t2_2.style.visibility = "hidden";
- t2_2.src = "美術/上色檔/景一/景1-4window.png";
- zone.style.visibility = "hidden";
- setTimeout(function (){
- c1d3.style.visibility = "visible";
- },900);
- }
- if (nc == 4){
- setTimeout(function(){
- zone.style.visibility = "visible";
- },900);
- setTimeout(function (){
- c1d5.style.visibility = "hidden";
- },900);
- }
- if (nc == 5){
- setTimeout(function (){
- c1d5.style.visibility = "visible";
- },900);
- }
- if (nc == 6){
- setTimeout(function (){
- c1d7.style.visibility = "hidden";
- },900);
- }
- if (nc == 7){
- setTimeout(function (){
- c1d7.style.visibility = "visible";
- },900);
- apng1_8.src = "美術/上色檔/景一/景1-8.jpg"
- }
- if (nc == 9){
- setTimeout(function (){
- c1d10.style.visibility = "hidden";
- },900);
- }
- if (nc == 10){
- setTimeout(function (){
- c1d10.style.visibility = "visible";
- c1d11.style.visibility = "hidden";
- },900);
- }
- if (11 == nc){
- setTimeout(function (){
- c1d11.style.visibility = "visible";
- c1d12.style.visibility = "hidden";
- },900);
- }
- if (11 >= nc){
- chap2_R.style.visibility = "hidden";
- aR.style.visibility = "visible";
- }
- moving = true;
- t = setInterval("Ppage()",20);
- diaoing = true;
- d = setInterval("dialogOut()",20);
- diao += 1;
- setTimeout(function (){
- diaoing = true;
- d = setInterval("dialogIn()",20);
- diao += 1;
- },1800);
- }
Add Comment
Please, Sign In to add comment