HoR_somesaki

HollyBlue_Page

Mar 16th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*內頁移動參數*/
  2. var c = document.getElementById("comic");
  3. c.style.left= "0px";
  4. var t;
  5. var count = 0;
  6. var moving = false;
  7. /*對話框參數*/
  8. var chap2_R = document.getElementById("chap2_R");
  9. var d;
  10. var diao = 0;
  11. var diaoing = false;
  12. var dialogbox = document.getElementById("DialogBox");
  13. dialogbox.style.opacity = "0";
  14. /*提示卷軸參數*/
  15. var hin_win = document.getElementById("hintc");
  16. var hint_word = document.getElementById("hint_word");
  17. var reel_op = document.getElementById("reel_op");
  18. var reel_cl = document.getElementById("reel_cl");
  19. reel_cl.style.visibility = "hidden";
  20. hint_word.style.opacity = "0";
  21.  
  22. /*前進後退頁計步器*/
  23. function Npage(){
  24.     var cm =  parseFloat(c.style.left);
  25.     count += 1;
  26.     if (count == 1){
  27.         sessionStorage.setItem('CC', '10');//送出換頁需要音效的參數代號
  28.     }
  29.     if (count > 1){
  30.         sessionStorage.removeItem('CC');
  31.     }
  32.     if (count <=80){
  33.         cm -= 0.853125;
  34.         c.style.left = cm + "vw";
  35.     }
  36.     if (count >105){clearInterval(t); count = 0; moving=false;}
  37. }
  38. function Ppage(){
  39.     "use strict";
  40.     var cm =  parseFloat(c.style.left);
  41.     count += 1;
  42.     if (count == 1){
  43.         sessionStorage.setItem('CC', '10');//送出換頁需要音效的參數代號
  44.     }
  45.     if (count > 1){
  46.         sessionStorage.removeItem('CC');
  47.     }
  48.     if (count <=80){
  49.         cm += 0.853125;
  50.         c.style.left = cm + "vw";
  51.     }
  52.     if (count >105){clearInterval(t); count = 0; moving=false;}
  53. }
  54. /*對話框計步器*/
  55. function dialogIn(){
  56.     var dialogo = parseFloat(dialogbox.style.opacity);
  57.     diao += 1;
  58.     if (20 > diao){
  59.         dialogo += 0.07;
  60.         dialogbox.style.opacity = dialogo;
  61.     }
  62.     if (diao > 20){clearInterval(d); diao = 0; diaoing = false;}
  63. }
  64. function dialogOut(){
  65.     var dialogo = parseFloat(dialogbox.style.opacity);
  66.     diao += 1;
  67.     if (20 > diao){
  68.         dialogo -= 0.07;
  69.         dialogbox.style.opacity = dialogo;
  70.     }
  71.     if (diao > 20){clearInterval(d); diao = 0; diaoing = false;}
  72. }
  73. /*卷軸計步器*/
  74. function hintIn(){
  75.     var hinto = parseFloat(hintword.style.opacity);
  76.     hintw += 1;
  77.     if (6 > hintw){
  78.         hinto += 0.2;
  79.         hintword.style.opacity = hinto;    
  80.     }
  81.     if (hintw > 6){clearInterval(hw); hintw = 0; hintwing = false;}
  82. }
  83. function hintOut(){
  84.     var hinto = parseFloat(hintword.style.opacity);
  85.     hintw += 1;
  86.     if (6 > hintw){
  87.         hinto -= 0.2;
  88.         hintword.style.opacity = hinto;    
  89.     }
  90.     if (hintw > 6){clearInterval(hw); hintw = 0; hintwing = false;}
  91. }
  92.  
  93. /*按鈕的function*/
  94. function next(){
  95.     if (moving) return;
  96.     if (diaoing) return;
  97.     if (nc >= 0){
  98.         aL.style.visibility = "visible";
  99.         setTimeout(function (){
  100.         c1d1.style.visibility = "hidden";
  101.         c1d2.style.visibility = "visible";
  102.         },900);//cNdN皆為各對話框
  103.     }
  104.     if (nc >= 1){
  105.         setTimeout(function (){
  106.         c1d2.style.visibility = "hidden";
  107.         c1d3.style.visibility = "visible";
  108.         },900);
  109.     }
  110.     if (nc >= 2){
  111.         setTimeout(function (){
  112.         c1d3.style.visibility = "hidden";
  113.         },900);
  114.     }
  115.     if (nc == 2){//互動頁出現
  116.         sessionStorage.setItem('CC', '30');
  117.         setTimeout(function Nchap(){
  118.             arR.style.visibility = "hidden";
  119.         },1200);
  120.         setTimeout(function(){
  121.             hin_win.style.visibility = "visible";
  122.             reel_op.src = "美術/UI/hint視窗/hint.gif";
  123.             reel_op.style.visibility = "visible";
  124.             setTimeout(function (){$("#hint_word").animate({opacity:"1.0"},150);},700);
  125.             DialogBox.style.filter = "brightness(.3)";
  126.             comic.style.filter = "brightness(.3)";
  127.         },2700);
  128.        
  129.         setTimeout(function(){
  130.             $("#hint_word").animate({opacity:"0"},150);
  131.             reel_op.style.visibility = "hidden";
  132.             reel_cl.src = "美術/UI/hint視窗/hint2.gif";
  133.             reel_cl.style.visibility = "visible";
  134.             setTimeout(function (){
  135.             hin_win.style.visibility = "hidden";
  136.             reel_cl.style.visibility = "hidden";
  137.             },1200);
  138.         },5700);
  139.         setTimeout(function(){
  140.             DialogBox.style.filter = "brightness(1)";
  141.             comic.style.filter = "brightness(1)";
  142.             zone.style.visibility = "visible";
  143.         },7000);
  144.        
  145.         setTimeout(function(){
  146.             t1_1.src = "美術/上色檔/景一/景1-4(1_9).png";
  147.         },1500);
  148.         setTimeout(function(){
  149.             t1_1.src = "美術/上色檔/景一/景1-4(10_36).png";
  150.             t2_1.style.visibility = "visible";
  151.         },2220);
  152.     }
  153.     if (nc == 3){
  154.         zone.style.visibility = "hidden";
  155.         setTimeout(function (){
  156.         c1d5.style.visibility = "visible";
  157.         },900);
  158.     }
  159.     if (nc == 4){
  160.         setTimeout(function (){
  161.         c1d5.style.visibility = "hidden";
  162.         },900);
  163.     }
  164.     if (nc == 5){
  165.         setTimeout(function (){
  166.         c1d7.style.visibility = "visible";
  167.         },900);
  168.     }
  169.     if (nc == 6){
  170.         setTimeout(function (){
  171.         c1d7.style.visibility = "hidden";
  172.         },900);
  173.         setTimeout(function(){
  174.             apng1_8.src = "美術/上色檔/景一/景1-8apng.png"
  175.         },1600);
  176.     }
  177.     if (nc == 8){
  178.         setTimeout(function (){
  179.         c1d10.style.visibility = "visible";
  180.         },900);
  181.     }
  182.     if (nc == 9){
  183.         setTimeout(function (){
  184.         c1d10.style.visibility = "hidden";
  185.         c1d11.style.visibility = "visible";
  186.         },900);
  187.     }
  188.     if (nc == 10){
  189.         setTimeout(function (){
  190.         c1d11.style.visibility = "hidden";
  191.         c1d12.style.visibility = "visible";
  192.         },900);
  193.     }
  194.     if (nc >= 10){
  195.         setTimeout(function Nchap(){
  196.             chap2_R.style.visibility = "visible"
  197.         },1500);
  198.     }
  199.     if (nc >= 11) {
  200.         sessionStorage.setItem('CC', '11');
  201.         sessionStorage.removeItem('NC');
  202.         window.location.href = 'chap2.html';
  203.         return;
  204.     }
  205.  
  206.     moving = true;
  207.     t = setInterval("Npage()",20);
  208.    
  209.     diaoing = true;
  210.     d = setInterval("dialogOut()",20);
  211.     diao += 1;
  212.     setTimeout(function (){
  213.         diaoing = true;
  214.         d = setInterval("dialogIn()",20);
  215.         diao += 1;
  216.     },1800);
  217. }
  218. function pre(){
  219.     if (moving) return;
  220.     if (diaoing) return;
  221.     else dialogbox.style.opacity = "1";
  222.     if (nc == 0) return;
  223.     if (nc <= 1){
  224.         aL.style.visibility = "hidden";
  225.         setTimeout(function (){
  226.         c1d2.style.visibility = "hidden";
  227.         c1d1.style.visibility = "visible";
  228.         },900);
  229.     }
  230.     if (nc == 2){
  231.         setTimeout(function (){
  232.         c1d3.style.visibility = "hidden";
  233.         c1d2.style.visibility = "visible";
  234.         },900);
  235.     }
  236.     if (nc == 3){
  237.         arR.style.visibility = "visible";arR.style.visibility = "visible";
  238.         t1_1.src = "美術/上色檔/景一/景1-4.jpg";
  239.         t2_1.style.visibility = "hidden";
  240.         t2_1.src = "美術/上色檔/景一/景1-4window(10-36).png";
  241.         t2_2.style.visibility = "hidden";
  242.         t2_2.src = "美術/上色檔/景一/景1-4window.png"; 
  243.  
  244.         zone.style.visibility = "hidden";
  245.         setTimeout(function (){
  246.         c1d3.style.visibility = "visible";
  247.         },900);
  248.     }
  249.     if (nc == 4){
  250.         setTimeout(function(){
  251.         zone.style.visibility = "visible";
  252.         },900);
  253.         setTimeout(function (){
  254.         c1d5.style.visibility = "hidden";
  255.         },900);
  256.     }
  257.     if (nc == 5){
  258.         setTimeout(function (){
  259.         c1d5.style.visibility = "visible";
  260.         },900);
  261.     }
  262.     if (nc == 6){
  263.         setTimeout(function (){
  264.         c1d7.style.visibility = "hidden";
  265.         },900);
  266.     }
  267.     if (nc == 7){
  268.         setTimeout(function (){
  269.         c1d7.style.visibility = "visible";
  270.         },900);
  271.         apng1_8.src = "美術/上色檔/景一/景1-8.jpg"
  272.     }
  273.     if (nc == 9){
  274.         setTimeout(function (){
  275.         c1d10.style.visibility = "hidden";
  276.         },900);
  277.     }
  278.     if (nc == 10){
  279.         setTimeout(function (){
  280.         c1d10.style.visibility = "visible";
  281.         c1d11.style.visibility = "hidden";
  282.         },900);
  283.     }
  284.     if (11 == nc){
  285.         setTimeout(function (){
  286.         c1d11.style.visibility = "visible";
  287.         c1d12.style.visibility = "hidden"; 
  288.         },900);
  289.     }
  290.     if (11 >= nc){
  291.         chap2_R.style.visibility = "hidden";
  292.         aR.style.visibility = "visible";
  293.     }
  294.     moving = true;
  295.     t = setInterval("Ppage()",20);
  296.    
  297.     diaoing = true;
  298.     d = setInterval("dialogOut()",20);
  299.     diao += 1;
  300.     setTimeout(function (){
  301.         diaoing = true;
  302.         d = setInterval("dialogIn()",20);
  303.         diao += 1;
  304.     },1800);
  305. }
Add Comment
Please, Sign In to add comment