Difference between revisions of "Template:Queens Canada/Scripts"

m
m
Line 240: Line 240:
 
/*Script for opening video overlay*/
 
/*Script for opening video overlay*/
 
function toggle(){
 
function toggle(){
     // 74.07% x 48.25%
+
     // 74.07% x 48.25% is the size of the circle relative to its container. Not used right now.
     var introVid = document.querySelector(".intro-video-screen")
+
     var introVidScreen = document.querySelector(".intro-video-screen")
 
     var circle = document.querySelector(".home-video-circle")
 
     var circle = document.querySelector(".home-video-circle")
     //circle.classList.toggle("full-circle");
+
     var video = document.querySelector(".actual-intro-video")
  
 +
    // the next two lines make it so that the full screen animation looks the best for the user
 +
    // and so that if they scroll while viewing the video, they go back to the same place
 +
    // the second line adjust the scrolling to accomadate for the wiki bar at the top
 
     document.getElementsByClassName("home-video")[0].scrollIntoView();
 
     document.getElementsByClassName("home-video")[0].scrollIntoView();
 
     window.scrollBy(0,-18);
 
     window.scrollBy(0,-18);
Line 250: Line 253:
 
     if(circle.classList.contains("full-circle"))  
 
     if(circle.classList.contains("full-circle"))  
 
     {
 
     {
         introVid.classList.toggle("active");
+
         introVidScreen.classList.toggle("active");
 
         setTimeout(function(){ circle.classList.toggle("full-circle"); }, 800);
 
         setTimeout(function(){ circle.classList.toggle("full-circle"); }, 800);
 
     }
 
     }
Line 256: Line 259:
 
     {   
 
     {   
 
         circle.classList.toggle("full-circle");
 
         circle.classList.toggle("full-circle");
         setTimeout(function(){ introVid.classList.toggle("active"); }, 800);
+
         setTimeout(function(){ introVidScreen.classList.toggle("active"); }, 800);
 
     }
 
     }
 
   
 
   
     //var video = document.querySelector("video")
+
     video.pause();
    //setTimeout(function(){ introVid.classList.toggle("active"); }, 800);
+
     video.currentTime = 0;
    //introVid.classList.toggle("active");
+
    //video.pause();
+
     //video.currentTime = 0;
+
 
}
 
}
  

Revision as of 18:05, 16 August 2020